From b1e512c15297ad20d2d41e7a79ef9a0fe32fac4b Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 15 Sep 2026 21:10:36 -0400 Subject: [PATCH 001/198] Some cleanups --- .../features/settings/model/BooleanSetting.kt | 1 - .../features/settings/model/IntSetting.kt | 3 - .../model/view/GpuUnswizzleSetting.kt | 89 ---- .../settings/model/view/SettingsItem.kt | 41 -- .../settings/ui/GpuUnswizzleDialogFragment.kt | 206 -------- .../features/settings/ui/SettingsAdapter.kt | 12 - .../settings/ui/SettingsFragmentPresenter.kt | 1 - .../ui/viewholder/GpuUnswizzleViewHolder.kt | 71 --- .../main/res/layout/dialog_gpu_unswizzle.xml | 96 ---- .../app/src/main/res/values-ar/strings.xml | 26 - .../app/src/main/res/values-de/strings.xml | 16 - .../app/src/main/res/values-es/strings.xml | 26 - .../app/src/main/res/values-fr/strings.xml | 17 - .../app/src/main/res/values-ru/strings.xml | 26 - .../app/src/main/res/values-uk/strings.xml | 26 - .../src/main/res/values-zh-rCN/strings.xml | 26 - .../src/main/res/values-zh-rTW/strings.xml | 11 - .../app/src/main/res/values/arrays.xml | 48 -- .../app/src/main/res/values/strings.xml | 26 - src/common/settings.h | 21 - src/common/settings_enums.h | 3 - src/qt_common/config/shared_translation.cpp | 41 -- src/video_core/host_shaders/CMakeLists.txt | 1 - src/video_core/host_shaders/astc_decoder.comp | 118 +++-- .../block_linear_unswizzle_2d.comp | 16 +- .../block_linear_unswizzle_3d.comp | 16 +- .../block_linear_unswizzle_3d_bcn.comp | 164 ------ .../host_shaders/pitch_unswizzle.comp | 22 +- .../renderer_opengl/gl_texture_cache.cpp | 5 +- .../renderer_opengl/gl_texture_cache.h | 7 +- .../renderer_opengl/util_shaders.cpp | 11 +- .../renderer_vulkan/vk_compute_pass.cpp | 483 +++++++++--------- .../renderer_vulkan/vk_compute_pass.h | 61 ++- .../renderer_vulkan/vk_texture_cache.cpp | 175 ++++--- .../renderer_vulkan/vk_texture_cache.h | 22 +- src/video_core/texture_cache/texture_cache.h | 145 +----- .../texture_cache/texture_cache_base.h | 20 - 37 files changed, 509 insertions(+), 1590 deletions(-) delete mode 100644 src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/GpuUnswizzleSetting.kt delete mode 100644 src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/GpuUnswizzleDialogFragment.kt delete mode 100644 src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/GpuUnswizzleViewHolder.kt delete mode 100644 src/android/app/src/main/res/layout/dialog_gpu_unswizzle.xml delete mode 100644 src/video_core/host_shaders/block_linear_unswizzle_3d_bcn.comp 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 ca3309245e..c0f85d0f60 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 @@ -39,7 +39,6 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_SAMPLE_SHADING("sample_shading"), RENDERER_FRAME_GEN("frame_gen"), RENDERER_FRAME_GEN_FLOW_SCALE_AUTO("frame_gen_flow_scale_auto"), - GPU_UNSWIZZLE_ENABLED("gpu_unswizzle_enabled"), PICTURE_IN_PICTURE("picture_in_picture"), USE_CUSTOM_RTC("custom_rtc_enabled"), BLACK_BACKGROUNDS("black_backgrounds"), 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 ea31692fbf..7f1b49a94a 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 @@ -51,9 +51,6 @@ enum class IntSetting(override val key: String) : AbstractIntSetting { FAST_CPU_TIME("fast_cpu_time"), CPU_TICKS("cpu_ticks"), FAST_GPU_TIME("fast_gpu_time"), - GPU_UNSWIZZLE_TEXTURE_SIZE("gpu_unswizzle_texture_size"), - GPU_UNSWIZZLE_STREAM_SIZE("gpu_unswizzle_stream_size"), - GPU_UNSWIZZLE_CHUNK_SIZE("gpu_unswizzle_chunk_size"), BAT_TEMPERATURE_UNIT("bat_temperature_unit"), CABINET_APPLET("cabinet_applet_mode"), CONTROLLER_APPLET("controller_applet_mode"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/GpuUnswizzleSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/GpuUnswizzleSetting.kt deleted file mode 100644 index a9a40f6903..0000000000 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/GpuUnswizzleSetting.kt +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -package org.yuzu.yuzu_emu.features.settings.model.view - -import androidx.annotation.ArrayRes -import androidx.annotation.StringRes -import org.yuzu.yuzu_emu.features.settings.model.AbstractSetting -import org.yuzu.yuzu_emu.features.settings.model.BooleanSetting -import org.yuzu.yuzu_emu.features.settings.model.IntSetting - -class GpuUnswizzleSetting( - @StringRes titleId: Int = 0, - titleString: String = "", - @StringRes descriptionId: Int = 0, - descriptionString: String = "", - @ArrayRes val textureSizeChoicesId: Int, - @ArrayRes val textureSizeValuesId: Int, - @ArrayRes val streamSizeChoicesId: Int, - @ArrayRes val streamSizeValuesId: Int, - @ArrayRes val chunkSizeChoicesId: Int, - @ArrayRes val chunkSizeValuesId: Int -) : SettingsItem( - object : AbstractSetting { - override val key: String = SettingsItem.GPU_UNSWIZZLE_COMBINED - override val defaultValue: Any = false - override val isSaveable = true - override val isRuntimeModifiable = true - override val isSwitchable = true - override val pairedSettingKey: String = "" - override var global: Boolean - get() { - return BooleanSetting.GPU_UNSWIZZLE_ENABLED.global && - IntSetting.GPU_UNSWIZZLE_TEXTURE_SIZE.global && - IntSetting.GPU_UNSWIZZLE_STREAM_SIZE.global && - IntSetting.GPU_UNSWIZZLE_CHUNK_SIZE.global - } - set(value) { - BooleanSetting.GPU_UNSWIZZLE_ENABLED.global = value - IntSetting.GPU_UNSWIZZLE_TEXTURE_SIZE.global = value - IntSetting.GPU_UNSWIZZLE_STREAM_SIZE.global = value - IntSetting.GPU_UNSWIZZLE_CHUNK_SIZE.global = value - } - override fun getValueAsString(needsGlobal: Boolean): String = "combined" - override fun reset() { - BooleanSetting.GPU_UNSWIZZLE_ENABLED.reset() - IntSetting.GPU_UNSWIZZLE_TEXTURE_SIZE.reset() - IntSetting.GPU_UNSWIZZLE_STREAM_SIZE.reset() - IntSetting.GPU_UNSWIZZLE_CHUNK_SIZE.reset() - } - }, - titleId, - titleString, - descriptionId, - descriptionString -) { - override val type = SettingsItem.TYPE_GPU_UNSWIZZLE - - // Check if GPU unswizzle is enabled via the dedicated boolean setting - fun isEnabled(needsGlobal: Boolean = false): Boolean = - BooleanSetting.GPU_UNSWIZZLE_ENABLED.getBoolean(needsGlobal) - - fun setEnabled(value: Boolean) = - BooleanSetting.GPU_UNSWIZZLE_ENABLED.setBoolean(value) - - fun enable() = setEnabled(true) - - fun disable() = setEnabled(false) - - fun getTextureSize(needsGlobal: Boolean = false): Int = - IntSetting.GPU_UNSWIZZLE_TEXTURE_SIZE.getInt(needsGlobal) - - fun setTextureSize(value: Int) = - IntSetting.GPU_UNSWIZZLE_TEXTURE_SIZE.setInt(value) - - fun getStreamSize(needsGlobal: Boolean = false): Int = - IntSetting.GPU_UNSWIZZLE_STREAM_SIZE.getInt(needsGlobal) - - fun setStreamSize(value: Int) = - IntSetting.GPU_UNSWIZZLE_STREAM_SIZE.setInt(value) - - fun getChunkSize(needsGlobal: Boolean = false): Int = - IntSetting.GPU_UNSWIZZLE_CHUNK_SIZE.getInt(needsGlobal) - - fun setChunkSize(value: Int) = - IntSetting.GPU_UNSWIZZLE_CHUNK_SIZE.setInt(value) - - fun reset() = setting.reset() -} diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 3f38831a17..8c07d394b0 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -141,14 +141,12 @@ abstract class SettingsItem( const val TYPE_SPINBOX = 12 const val TYPE_LAUNCHABLE = 13 const val TYPE_PATH = 14 - const val TYPE_GPU_UNSWIZZLE = 15 const val TYPE_FX_TOOLBAR = 16 const val TYPE_FX_PRESET = 17 const val TYPE_FX_SHADER = 18 const val TYPE_FX_BUTTON = 19 const val FASTMEM_COMBINED = "fastmem_combined" - const val GPU_UNSWIZZLE_COMBINED = "gpu_unswizzle_combined" val emptySetting = object : AbstractSetting { override val key: String = "" @@ -794,45 +792,6 @@ abstract class SettingsItem( valuesId = R.array.gpuValues ) ) - put( - SingleChoiceSetting( - IntSetting.GPU_UNSWIZZLE_TEXTURE_SIZE, - titleId = R.string.gpu_unswizzle_texture_size, - descriptionId = R.string.gpu_unswizzle_texture_size_description, - choicesId = R.array.gpuTextureSizeSwizzleEntries, - valuesId = R.array.gpuTextureSizeSwizzleValues - ) - ) - put( - SingleChoiceSetting( - IntSetting.GPU_UNSWIZZLE_STREAM_SIZE, - titleId = R.string.gpu_unswizzle_stream_size, - descriptionId = R.string.gpu_unswizzle_stream_size_description, - choicesId = R.array.gpuSwizzleEntries, - valuesId = R.array.gpuSwizzleValues - ) - ) - put( - SingleChoiceSetting( - IntSetting.GPU_UNSWIZZLE_CHUNK_SIZE, - titleId = R.string.gpu_unswizzle_chunk_size, - descriptionId = R.string.gpu_unswizzle_chunk_size_description, - choicesId = R.array.gpuSwizzleChunkEntries, - valuesId = R.array.gpuSwizzleChunkValues - ) - ) - put( - GpuUnswizzleSetting( - titleId = R.string.gpu_unswizzle_settings, - descriptionId = R.string.gpu_unswizzle_settings_description, - textureSizeChoicesId = R.array.gpuTextureSizeSwizzleEntries, - textureSizeValuesId = R.array.gpuTextureSizeSwizzleValues, - streamSizeChoicesId = R.array.gpuSwizzleEntries, - streamSizeValuesId = R.array.gpuSwizzleValues, - chunkSizeChoicesId = R.array.gpuSwizzleChunkEntries, - chunkSizeValuesId = R.array.gpuSwizzleChunkValues - ) - ) put( SingleChoiceSetting( IntSetting.FAST_CPU_TIME, diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/GpuUnswizzleDialogFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/GpuUnswizzleDialogFragment.kt deleted file mode 100644 index e14bc7639e..0000000000 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/GpuUnswizzleDialogFragment.kt +++ /dev/null @@ -1,206 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -package org.yuzu.yuzu_emu.features.settings.ui - -import android.app.Dialog -import android.content.DialogInterface -import android.os.Bundle -import android.view.LayoutInflater -import android.widget.ArrayAdapter -import androidx.fragment.app.DialogFragment -import androidx.fragment.app.activityViewModels -import com.google.android.material.dialog.MaterialAlertDialogBuilder -import org.yuzu.yuzu_emu.R -import org.yuzu.yuzu_emu.databinding.DialogGpuUnswizzleBinding -import org.yuzu.yuzu_emu.features.settings.model.view.GpuUnswizzleSetting - -class GpuUnswizzleDialogFragment : DialogFragment() { - private var position = 0 - private val settingsViewModel: SettingsViewModel by activityViewModels() - private lateinit var binding: DialogGpuUnswizzleBinding - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - position = requireArguments().getInt(POSITION) - - if (settingsViewModel.clickedItem == null) dismiss() - } - - override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { - binding = DialogGpuUnswizzleBinding.inflate(LayoutInflater.from(requireContext())) - val item = settingsViewModel.clickedItem as GpuUnswizzleSetting - - // Setup texture size dropdown - val textureSizeEntries = resources.getStringArray(item.textureSizeChoicesId) - val textureSizeValues = resources.getIntArray(item.textureSizeValuesId) - val textureSizeAdapter = ArrayAdapter( - requireContext(), - android.R.layout.simple_dropdown_item_1line, - textureSizeEntries.toMutableList() - ) - binding.dropdownTextureSize.setAdapter(textureSizeAdapter) - - // Setup stream size dropdown - val streamSizeEntries = resources.getStringArray(item.streamSizeChoicesId) - val streamSizeValues = resources.getIntArray(item.streamSizeValuesId) - val streamSizeAdapter = ArrayAdapter( - requireContext(), - android.R.layout.simple_dropdown_item_1line, - streamSizeEntries.toMutableList() - ) - binding.dropdownStreamSize.setAdapter(streamSizeAdapter) - - // Setup chunk size dropdown - val chunkSizeEntries = resources.getStringArray(item.chunkSizeChoicesId) - val chunkSizeValues = resources.getIntArray(item.chunkSizeValuesId) - val chunkSizeAdapter = ArrayAdapter( - requireContext(), - android.R.layout.simple_dropdown_item_1line, - chunkSizeEntries.toMutableList() - ) - binding.dropdownChunkSize.setAdapter(chunkSizeAdapter) - - // Load current values - val isEnabled = item.isEnabled() - binding.switchEnable.isChecked = isEnabled - - if (isEnabled) { - val textureSizeIndex = textureSizeValues.indexOf(item.getTextureSize()) - if (textureSizeIndex >= 0) { - binding.dropdownTextureSize.setText(textureSizeEntries[textureSizeIndex], false) - } - - val streamSizeIndex = streamSizeValues.indexOf(item.getStreamSize()) - if (streamSizeIndex >= 0) { - binding.dropdownStreamSize.setText(streamSizeEntries[streamSizeIndex], false) - } - - val chunkSizeIndex = chunkSizeValues.indexOf(item.getChunkSize()) - if (chunkSizeIndex >= 0) { - binding.dropdownChunkSize.setText(chunkSizeEntries[chunkSizeIndex], false) - } - } else { - // Set default/recommended values when disabling - binding.dropdownTextureSize.setText(textureSizeEntries[3], false) - binding.dropdownStreamSize.setText(streamSizeEntries[3], false) - binding.dropdownChunkSize.setText(chunkSizeEntries[3], false) - } - - // Clear adapter filters after setText to fix rotation bug - textureSizeAdapter.filter.filter(null) - streamSizeAdapter.filter.filter(null) - chunkSizeAdapter.filter.filter(null) - - // Enable/disable dropdowns based on switch state - updateDropdownsState(isEnabled) - binding.switchEnable.setOnCheckedChangeListener { _, checked -> - updateDropdownsState(checked) - } - - val dialog = MaterialAlertDialogBuilder(requireContext()) - .setTitle(item.title) - .setView(binding.root) - .create() - - // Setup button listeners - binding.btnDefault.setOnClickListener { - // Reset to defaults - item.reset() - // Refresh values with adapters reset - val textureSizeIndex = textureSizeValues.indexOf(item.getTextureSize()) - if (textureSizeIndex >= 0) { - binding.dropdownTextureSize.setText(textureSizeEntries[textureSizeIndex], false) - } - val streamSizeIndex = streamSizeValues.indexOf(item.getStreamSize()) - if (streamSizeIndex >= 0) { - binding.dropdownStreamSize.setText(streamSizeEntries[streamSizeIndex], false) - } - val chunkSizeIndex = chunkSizeValues.indexOf(item.getChunkSize()) - if (chunkSizeIndex >= 0) { - binding.dropdownChunkSize.setText(chunkSizeEntries[chunkSizeIndex], false) - } - // Clear filters - textureSizeAdapter.filter.filter(null) - streamSizeAdapter.filter.filter(null) - chunkSizeAdapter.filter.filter(null) - - settingsViewModel.setAdapterItemChanged(position) - settingsViewModel.setShouldReloadSettingsList(true) - } - - binding.btnCancel.setOnClickListener { - dialog.dismiss() - } - - binding.btnOk.setOnClickListener { - if (binding.switchEnable.isChecked) { - item.enable() - // Save the selected values - val selectedTextureIndex = textureSizeEntries.indexOf( - binding.dropdownTextureSize.text.toString() - ) - if (selectedTextureIndex >= 0) { - item.setTextureSize(textureSizeValues[selectedTextureIndex]) - } - - val selectedStreamIndex = streamSizeEntries.indexOf( - binding.dropdownStreamSize.text.toString() - ) - if (selectedStreamIndex >= 0) { - item.setStreamSize(streamSizeValues[selectedStreamIndex]) - } - - val selectedChunkIndex = chunkSizeEntries.indexOf( - binding.dropdownChunkSize.text.toString() - ) - if (selectedChunkIndex >= 0) { - item.setChunkSize(chunkSizeValues[selectedChunkIndex]) - } - } else { - // Disable GPU unswizzle - item.disable() - } - - settingsViewModel.setAdapterItemChanged(position) - settingsViewModel.setShouldReloadSettingsList(true) - dialog.dismiss() - } - - // Ensure filters are cleared after dialog is shown - binding.root.post { - textureSizeAdapter.filter.filter(null) - streamSizeAdapter.filter.filter(null) - chunkSizeAdapter.filter.filter(null) - } - - return dialog - } - - private fun updateDropdownsState(enabled: Boolean) { - binding.layoutTextureSize.isEnabled = enabled - binding.dropdownTextureSize.isEnabled = enabled - binding.layoutStreamSize.isEnabled = enabled - binding.dropdownStreamSize.isEnabled = enabled - binding.layoutChunkSize.isEnabled = enabled - binding.dropdownChunkSize.isEnabled = enabled - } - - companion object { - const val TAG = "GpuUnswizzleDialogFragment" - const val POSITION = "Position" - - fun newInstance( - settingsViewModel: SettingsViewModel, - item: GpuUnswizzleSetting, - position: Int - ): GpuUnswizzleDialogFragment { - val dialog = GpuUnswizzleDialogFragment() - val args = Bundle() - args.putInt(POSITION, position) - dialog.arguments = args - settingsViewModel.clickedItem = item - return dialog - } - } -} 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 8d47db94e0..c84d0160f5 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 @@ -106,10 +106,6 @@ class SettingsAdapter( PathViewHolder(ListItemSettingBinding.inflate(inflater), this) } - SettingsItem.TYPE_GPU_UNSWIZZLE -> { - GpuUnswizzleViewHolder(ListItemSettingBinding.inflate(inflater), this) - } - SettingsItem.TYPE_FX_TOOLBAR -> { FxToolbarViewHolder( ListItemSettingFxToolbarBinding.inflate(inflater, parent, false), @@ -511,14 +507,6 @@ class SettingsAdapter( settingsViewModel.setShouldShowPathResetDialog(true) } - fun onGpuUnswizzleClick(item: GpuUnswizzleSetting, position: Int) { - GpuUnswizzleDialogFragment.newInstance( - settingsViewModel, - item, - position - ).show(fragment.childFragmentManager, GpuUnswizzleDialogFragment.TAG) - } - private class DiffCallback : DiffUtil.ItemCallback() { override fun areItemsTheSame(oldItem: SettingsItem, newItem: SettingsItem): Boolean { return oldItem.setting.key == newItem.setting.key 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 ca282ba159..53e0e3a3d7 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 @@ -561,7 +561,6 @@ class SettingsFragmentPresenter( add(IntSetting.ANDROID_PIPELINE_WORKERS.key) add(BooleanSetting.RENDERER_ASYNCHRONOUS_GPU_EMULATION.key) add(BooleanSetting.RENDERER_ASYNC_PRESENTATION.key) - add(SettingsItem.GPU_UNSWIZZLE_COMBINED) add(HeaderSetting(R.string.extensions)) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/GpuUnswizzleViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/GpuUnswizzleViewHolder.kt deleted file mode 100644 index 06701eb077..0000000000 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/GpuUnswizzleViewHolder.kt +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -package org.yuzu.yuzu_emu.features.settings.ui.viewholder - -import android.view.View -import org.yuzu.yuzu_emu.R -import org.yuzu.yuzu_emu.databinding.ListItemSettingBinding -import org.yuzu.yuzu_emu.features.settings.model.view.GpuUnswizzleSetting -import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem -import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter -import org.yuzu.yuzu_emu.utils.ViewUtils.setVisible - -class GpuUnswizzleViewHolder(val binding: ListItemSettingBinding, adapter: SettingsAdapter) : - SettingViewHolder(binding.root, adapter) { - private lateinit var setting: GpuUnswizzleSetting - - override fun bind(item: SettingsItem) { - setting = item as GpuUnswizzleSetting - binding.textSettingName.text = setting.title - binding.textSettingDescription.setVisible(item.description.isNotEmpty()) - binding.textSettingDescription.text = item.description - - binding.textSettingValue.setVisible(true) - val resMgr = binding.root.context.resources - - if (setting.isEnabled()) { - // Show a summary of current settings - val textureSizeEntries = resMgr.getStringArray(setting.textureSizeChoicesId) - val textureSizeValues = resMgr.getIntArray(setting.textureSizeValuesId) - val textureSizeIndex = textureSizeValues.indexOf(setting.getTextureSize()) - val textureSizeLabel = if (textureSizeIndex >= 0) textureSizeEntries[textureSizeIndex] else "?" - - val streamSizeEntries = resMgr.getStringArray(setting.streamSizeChoicesId) - val streamSizeValues = resMgr.getIntArray(setting.streamSizeValuesId) - val streamSizeIndex = streamSizeValues.indexOf(setting.getStreamSize()) - val streamSizeLabel = if (streamSizeIndex >= 0) streamSizeEntries[streamSizeIndex] else "?" - - val chunkSizeEntries = resMgr.getStringArray(setting.chunkSizeChoicesId) - val chunkSizeValues = resMgr.getIntArray(setting.chunkSizeValuesId) - val chunkSizeIndex = chunkSizeValues.indexOf(setting.getChunkSize()) - val chunkSizeLabel = if (chunkSizeIndex >= 0) chunkSizeEntries[chunkSizeIndex] else "?" - - binding.textSettingValue.text = "$textureSizeLabel ⋅ $streamSizeLabel ⋅ $chunkSizeLabel" - } else { - binding.textSettingValue.text = resMgr.getString(R.string.gpu_unswizzle_disabled) - } - - binding.buttonClear.setVisible(setting.clearable) - binding.buttonClear.setOnClickListener { - adapter.onClearClick(setting, bindingAdapterPosition) - } - - setStyle(setting.isEditable, binding) - } - - override fun onClick(clicked: View) { - if (!setting.isEditable) { - return - } - - adapter.onGpuUnswizzleClick(setting, bindingAdapterPosition) - } - - override fun onLongClick(clicked: View): Boolean { - if (setting.isEditable) { - return adapter.onLongClick(setting, bindingAdapterPosition) - } - return false - } -} diff --git a/src/android/app/src/main/res/layout/dialog_gpu_unswizzle.xml b/src/android/app/src/main/res/layout/dialog_gpu_unswizzle.xml deleted file mode 100644 index 8299551618..0000000000 --- a/src/android/app/src/main/res/layout/dialog_gpu_unswizzle.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/android/app/src/main/res/values-ar/strings.xml b/src/android/app/src/main/res/values-ar/strings.xml index 44f86d380f..f199e42efa 100644 --- a/src/android/app/src/main/res/values-ar/strings.xml +++ b/src/android/app/src/main/res/values-ar/strings.xml @@ -599,17 +599,6 @@ يُمكّن هذا الخيار من التعامل مع عملية إعادة تحجيم الألعاب بطريقة تقليدية باستخدام مسار إعادة التحجيم السريع استخدم تظليل غير متزامن يقوم بتجميع التظليل بشكل غير متزامن. قد يقلل ذلك من التقطعات ولكنه قد يؤدي أيضًا إلى حدوث أخطاء. - إعدادات إلغاء ترتيب بيانات وحدة معالجة الرسومات - قم بضبط معلمات فكّ تشابك النسيج المستندة إلى وحدة معالجة الرسومات أو تعطيلها تمامًا. اضبط هذه الإعدادات لتحقيق التوازن بين الأداء وجودة تحميل النسيج. - تفعيل إلغاء ترتيب بيانات وحدة معالجة الرسومات - تعطيل - الحد الأقصى لحجم النسيج في وحدة معالجة الرسومات بعد إعادة ترتيب البيانات - يُحدد هذا الخيار الحد الأقصى لحجم (ميغابايت) معالجة الصور باستخدام وحدة معالجة الرسومات. مع أن وحدة معالجة الرسومات أسرع في معالجة الصور المتوسطة والكبيرة، إلا أن وحدة المعالجة المركزية قد تكون أكثر كفاءة في معالجة الصور الصغيرة جدًا. اضبط هذا الخيار لتحقيق التوازن الأمثل بين سرعة معالجة الرسومات واستهلاك وحدة المعالجة المركزية. - حجم تدفق إلغاء ترتيب بيانات وحدة معالجة الرسومات - يحدد هذا الخيار حد البيانات لكل إطار لمعالجة الصور الكبيرة. القيم الأعلى تُسرّع تحميل الصور على حساب زيادة زمن استجابة الإطارات؛ أما القيم الأقل فتُقلل من الحمل الزائد على وحدة معالجة الرسومات، ولكنها قد تتسبب في ظهور الصور بشكل مفاجئ. - حجم كتلة إلغاء ترتيب بيانات وحدة معالجة الرسومات - يُحدد هذا الخيار عدد شرائح العمق التي تتم معالجتها لكل دفعة من الصور ثلاثية الأبعاد (3D). زيادة هذا العدد تُحسّن كفاءة الإنتاجية على وحدات معالجة الرسومات القوية، ولكنها قد تُسبب تقطعًا أو انقطاعًا في عمل برنامج التشغيل على الأجهزة ذات المواصفات الأقل قوة. - افتراضي إضافات @@ -1050,25 +1039,10 @@ كسر السرعة - صغير جدًا (16 ميغابايت) - صغير (32 ميغابايت) - قياسي (128 ميغابايت) - كبير (256 ميغابايت) - كبير جدًا (512 ميغابايت) - منخفض جدًا (4 ميغابايت) - منخفض (8 ميغابايت) - قياسي (16 ميغابايت) - متوسط (32 ميغابايت) - عالي (64 ميغابايت) - منخفض جدًا (32) - منخفض (64) - قياسي (128) - متوسط (256) - عالي (512) مئوية diff --git a/src/android/app/src/main/res/values-de/strings.xml b/src/android/app/src/main/res/values-de/strings.xml index 6ed158fc72..307f739870 100644 --- a/src/android/app/src/main/res/values-de/strings.xml +++ b/src/android/app/src/main/res/values-de/strings.xml @@ -508,7 +508,6 @@ Wird der Handheld-Modus verwendet, verringert es die Auflösung und erhöht die Überspringt bestimmte Cache-Invalidierungen auf CPU-Seite während Speicherupdates, reduziert die CPU-Auslastung und verbessert die Leistung. Kann in einigen Spielen zu Fehlern oder Abstürzen führen. Asynchrone Shader Kompiliert Shader asynchron. Dies kann Ruckler reduzieren, aber auch Grafikfehler verursachen. - Standard Erweiterungen @@ -918,25 +917,10 @@ Wirklich fortfahren? Übertaktung - Sehr klein (16 MB) - Klein (32 MB) - Normal (128 MB) - Groß (256 MB) - Sehr groß (512 MB) - Sehr niedrig (4 MB) - Niedrig (8 MB) - Normal (16 MB) - Mittel (32 MB) - Hoch (64 MB) - Sehr niedrig (32) - Niedrig (64) - Normal (128) - Mittel (256) - Hoch (512) Celsius diff --git a/src/android/app/src/main/res/values-es/strings.xml b/src/android/app/src/main/res/values-es/strings.xml index 448d55b92b..1f7faad22c 100644 --- a/src/android/app/src/main/res/values-es/strings.xml +++ b/src/android/app/src/main/res/values-es/strings.xml @@ -541,17 +541,6 @@ Permite el manejo de versiones anteriores para el paso de configuración de reescalado para juegos mediante el uso de una ruta de reescalado rápida. Usar sombreadores asíncronos Compila los sombreadores de forma asíncrona. Esto puede reducir los tirones, pero también puede introducir errores gráficos. - Ajustes de desentrelazado de la GPU - Configura los parámetros de desentrelazado de texturas basadas ​​en la GPU o desactívelos por completo. Modifique estos ajustes para equilibrar el rendimiento y la calidad de las texturas cargadas. - Activar desentrelazado de la GPU - Desactivado - Tamaño máximo de textura de desentrelazado de la GPU - Establece el tamaño máximo (en MB) para el desentrelazado de texturas basada en GPU. Aunque la GPU es más rápida para texturas medianas y grandes, la CPU puede ser más eficiente para texturas muy pequeñas. Ajuste este valor para encontrar el equilibrio entre la aceleración de la GPU y la sobrecarga de la CPU. - Tamaño del flujo de desentrelazado de la GPU - Establece el límite de datos por fotograma para desentrelazar texturas grandes. Los valores altos aceleran la carga de texturas, a coste de una mayor latencia por fotograma; los valores bajos reducen la carga de la GPU, pero pueden causar parpadeos visibles en las texturas. - Tamaño del trozo de desentrelazado de la GPU - Determina la cantidad de cortes de profundidad procesados ​​en un solo envío de texturas 3D. Aumentar este valor puede mejorar el rendimiento en una GPU de gama alta, pero puede causar tirones y problemas en los tiempos de respuesta en hardware más modesto. - Por defecto Extensiones @@ -988,25 +977,10 @@ Overclock - Muy pequeño (16 MB) - Pequeño (32 MB) - Normal (128 MB) - Grande (256 MB) - Muy grande (512 MB) - Muy bajo (4 MB) - Bajo (8 MB) - Normal (16 MB) - Medio (32 MB) - Alto (64 MB) - Muy bajo (32) - Bajo (64) - Normal (128) - Medio (256) - Alto (512) Celsius diff --git a/src/android/app/src/main/res/values-fr/strings.xml b/src/android/app/src/main/res/values-fr/strings.xml index 7507051dd7..a73d1ac9fb 100644 --- a/src/android/app/src/main/res/values-fr/strings.xml +++ b/src/android/app/src/main/res/values-fr/strings.xml @@ -482,8 +482,6 @@ Emuler BGR565 Utiliser les shaders asynchrones Compile les shaders de manière asynchrone. Cela peut réduire les saccades mais peut aussi provoquer des problèmes graphiques. - Désactivé - Par défaut Extensions @@ -884,25 +882,10 @@ 8 Go (Dangereux) - Très petit (16 Mo) - Petit (32 Mo) - Normal (128 Mo) - Large (256 Mo) - Très large (512 Mo) - Très faible (4 Mo) - Faible (8 Mo) - Normal (16 Mo) - Moyen (32 Mo) - Élevé (64 Mo) - Très faible (32) - Faible (64) - Normal (128) - Moyen (256) - Élevé (512) Celsius diff --git a/src/android/app/src/main/res/values-ru/strings.xml b/src/android/app/src/main/res/values-ru/strings.xml index 7a4b6cf91e..a839b3bfbc 100644 --- a/src/android/app/src/main/res/values-ru/strings.xml +++ b/src/android/app/src/main/res/values-ru/strings.xml @@ -579,17 +579,6 @@ Включает старый метод обработки этапа перенастройки масштабирования для игр за счёт использования быстрого алгоритма перемасштабирования. Использовать асинхронные шейдеры Компилирует шейдеры асинхронно. Это может уменьшить подтормаживания, но также может вызвать графические артефакты. - Настройки распаковки текстур (Unswizzle) - Настройте параметры распаковки текстур на стороне ГПУ либо полностью отключите эту функцию. Изменение этих параметров позволяет найти баланс между производительностью и качеством загрузки текстур. - Включить распаковку текстур (Unswizzle) - Отключено - Макс. размер текстуры Unswizzle - Задает максимальный размер (в МБ) текстур для преобразования формата (unswizzle) на ГПУ. Хотя ГПУ быстрее работает со средними и большими текстурами, ЦП может быть эффективнее для очень маленьких. Настройте это значение, чтобы найти баланс между ускорением на ГПУ и нагрузкой на ЦП. - Размер потока Unswizzle - Задает лимит данных на кадр для преобразования крупных текстур (unswizzle). Высокие значения ускоряют загрузку текстур ценой увеличения задержки кадра; низкие значения снижают нагрузку на ГПУ, но могут вызывать заметную постепенную подгрузку текстур. - Размер блока Unswizzle - Задает количество слоёв глубины, обрабатываемых за одну пачку для 3D-текстур. Увеличение этого значения улучшает пропускную способность на мощных ГПУ, но может вызывать подтормаживания или таймауты драйвера на слабом железе. - По умолчанию Расширения @@ -1030,25 +1019,10 @@ Разгон - Очень малый (16 МБ) - Малый (32 МБ) - Обычный (128 МБ) - Большой (256 МБ) - Очень большой (512 МБ) - Очень низкий (4 МБ) - Низкий (8 МБ) - Обычный (16 МБ) - Средний (32 МБ) - Высокий (64 МБ) - Очень малый (32) - Малый (64) - Обычный (128) - Средний (256) - Большой (512) Цельсий diff --git a/src/android/app/src/main/res/values-uk/strings.xml b/src/android/app/src/main/res/values-uk/strings.xml index 9923fc72c4..3f2cb94fb2 100644 --- a/src/android/app/src/main/res/values-uk/strings.xml +++ b/src/android/app/src/main/res/values-uk/strings.xml @@ -502,17 +502,6 @@ Вмикає застарілу обробку масштабування для ігор, використовуючи швидкий шлях масштабування Асинхронні шейдери Компілює шейдери асинхронно. Це може зменшити затримки, але також може спричинити графічні баги. - Налаштування розпакування за допомогою ГП - Налаштуйте розпакування текстур за допомогою ГП або повністю вимкнути його. Відкоригуйте ці налаштування, щоб урівноважити продуктивність і якість завантаження текстур. - Увімкнути розпакування за допомогою ГП - Вимкнено - Максимальний розмір текстур для розпакування ГП за допомогою ГП - Встановлює максимальний розмір (МБ) для розпакування текстур за допомогою ГП. ГП швидше справляється з текстурами середніх і великих розмірів, а ЦП ефективніший для дуже маленьких. Налаштуйте, щоб збалансувати ГП-прискоренням і навантаженням на ЦП. - Розмір потоку розпакування за допомогою ГП - Встановлює обмеження даних на кадр для розпакування великих текстур. Вищі значення пришвидшують завантаження текстур за рахунок більших кадрових затримок; менші значення зменшують перевантаження ГП але може спричинити помітні появи текстур. - Розмір блоків розпакування за допомогою ГП - Визначає кількість зрізів глибини, оброблених за партію 3D-текстур. Збільшення здатне покращити пропускну здатність на потужних ГП, але може призвести до затримок або затримок драйвера зі слабшим устаткуванням. - Стандартно Розширення @@ -929,25 +918,10 @@ 8 ГБ (Небезпечно) - Дуже малий (16 МБ) - Малий (32 МБ) - Нормальний (128 МБ) - Великий (256 МБ) - Дуже великий (512 МБ) - Дуже низький (4 МБ) - Низький (8 МБ) - Нормальний (16 МБ) - Середній (32 МБ) - Високий (64 МБ) - Дуже низький (32) - Низький (64) - Нормальний (128) - Середній (256) - Високий (512) Цельсій 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 index 193d00c3d1..3cdb7278b3 100644 --- a/src/android/app/src/main/res/values-zh-rCN/strings.xml +++ b/src/android/app/src/main/res/values-zh-rCN/strings.xml @@ -560,17 +560,6 @@ 启用通过使用快速缩放路径,来为游戏提供缩放配置处理的传统处理方式 使用异步着色器 以异步方式编译着色器。采用此方式或可减少卡顿,但也可能引入故障点。 - GPU Unswizzle 设置 - 配置基于 GPU 的纹理 unswizzling 参数,或完全禁用该功能。通过调整这些设置,以尝试在性能与纹理加载质量之间取得平衡。 - 启用 GPU Unswizzle - 禁用 - GPU Unswizzle 最大纹理尺寸 - 设置基于 GPU 的纹理 unswizzling 的最大尺寸(MB)。虽然 GPU 处理中等和大型纹理的速度更快,但对于非常小的纹理,CPU 可能更为高效。通过调节此项设置,以平衡GPU 加速与 CPU 开销。 - GPU Unswizzle 流大小 - 设置用于 unswizzling 大型纹理时的每帧数据限制。较高的数值可以加速纹理的加载过程,但会带来更高的帧延迟。而较低的数值则可以降低 GPU 的开销,但也可能会导致可见的纹理闪现。 - GPU Unswizzle 块大小 - 定义了 3D 纹理每批次处理的深度切片数量。增加此数值可在高性能 GPU 上提升吞吐效率,但在性能较弱的硬件上可能会导致卡顿或驱动超时。 - 默认 扩展 @@ -1004,25 +993,10 @@ 超频 - 极小 (16 MB) - 较小 (32 MB) - 正常 (128 MB) - 较大 (256 MB) - 极大 (512 MB) - 极低 (4 MB) - 低 (8 MB) - 正常 (16 MB) - 中 (32 MB) - 高 (64 MB) - 极低 (32) - 低 (64) - 正常 (128) - 中 (256) - 高 (512) 摄氏度 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 index 0a1c3ba4c2..fa59e2a9b7 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -580,17 +580,6 @@ 透過快速重新縮放處理來啟用遊戲重新縮放設定階段的舊版處理方式 使用非同步著色器 使用非同步編譯著色器。這可能會減少卡頓,但也可能導致圖形錯誤。 - GPU Unswizzle 設定 - 設定基於 GPU 的 Unswizzling 參數或完全停用此功能。調整此設定以在性能與紋理載入品質中取得平衡 - 啟用 GPU Unswizzle - 停用 - GPU Unswizzle 最大紋理尺寸 - 設定 GPU 紋理 Unswizzling 的最大值 (MB)。雖然 GPU 處理中型和大型紋理的速度較快,但 CPU 處理非常小的紋理可能更有效率。整此設定以在 GPU 加速與 CPU 負載之間取得平衡 - GPU Unswizzle 流大小 - 設定每個影格處理大型紋理 Unswizzling 的資料上限。數值越高載入紋理的速度越快,但會增加畫面延遲;數值較低則能降低 GPU 負載,不過有可能導致至紋理載入不完全甚至突然出現 - GPU Unswizzle 塊大小 - 設定 3D 紋理每批次處理的深度切片數量。增加此數值可提升規格較佳 GPU 的處理效率,但在較低規格的硬體上可能導致卡頓或驅動程式逾時 - 預設 擴充功能 diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index b3aed5758c..63352386a4 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -591,54 +591,6 @@ 2 - - @string/gpu_texturesizeswizzle_verysmall - @string/gpu_texturesizeswizzle_small - @string/gpu_texturesizeswizzle_normal - @string/gpu_texturesizeswizzle_large - @string/gpu_texturesizeswizzle_verylarge - - - - 0 - 1 - 2 - 3 - 4 - - - - @string/gpu_swizzle_verylow - @string/gpu_swizzle_low - @string/gpu_swizzle_normal - @string/gpu_swizzle_medium - @string/gpu_swizzle_high - - - - 0 - 1 - 2 - 3 - 4 - - - - @string/gpu_swizzlechunk_verylow - @string/gpu_swizzlechunk_low - @string/gpu_swizzlechunk_normal - @string/gpu_swizzlechunk_medium - @string/gpu_swizzlechunk_high - - - - 0 - 1 - 2 - 3 - 4 - - @string/temperature_celsius @string/temperature_fahrenheit diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 730f6bbade..9b941608a1 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -605,17 +605,6 @@ Enables a legacy handling for the rescale configuration pass for games by using a quick rescale path Use asynchronous shaders Compiles shaders asynchronously. This may reduce stutters but may also introduce glitches. - GPU Unswizzle Settings - Configure GPU-based texture unswizzling parameters or disable it entirely. Adjust these settings to balance performance and texture loading quality. - Enable GPU Unswizzle - Disabled - GPU Unswizzle Max Texture Size - Sets the maximum size (MB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - GPU Unswizzle Stream Size - Sets the data limit per frame for unswizzling large textures. Higher values speed up texture loading at the cost of higher frame latency; lower values reduce GPU overhead but may cause visible texture pop-in. - GPU Unswizzle Chunk Size - Defines the number of depth slices processed per batch for 3D textures. Increasing this improves throughput efficiency on powerful GPUs but may cause stuttering or driver timeouts on weaker hardware. - Default Extensions @@ -1065,25 +1054,10 @@ Overclock - Very Small (16 MB) - Small (32 MB) - Normal (128 MB) - Large (256 MB) - Very Large (512 MB) - Very Low (4 MB) - Low (8 MB) - Normal (16 MB) - Medium (32 MB) - High (64 MB) - Very Low (32) - Low (64) - Normal (128) - Medium (256) - High (512) Celsius diff --git a/src/common/settings.h b/src/common/settings.h index c1c2d4f0df..48d4ca427d 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -666,27 +666,6 @@ struct Values { SwitchableSetting use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders", Category::RendererHacks}; - SwitchableSetting gpu_unswizzle_texture_size{linkage, - GpuUnswizzleSize::Large, - "gpu_unswizzle_texture_size", - Category::RendererHacks, - Specialization::Default}; - - SwitchableSetting gpu_unswizzle_stream_size{linkage, - GpuUnswizzle::Medium, - "gpu_unswizzle_stream_size", - Category::RendererHacks, - Specialization::Default}; - - SwitchableSetting gpu_unswizzle_chunk_size{linkage, - GpuUnswizzleChunk::Medium, - "gpu_unswizzle_chunk_size", - Category::RendererHacks, - Specialization::Default}; - - SwitchableSetting gpu_unswizzle_enabled{linkage, false, "gpu_unswizzle_enabled", - Category::RendererHacks}; - SwitchableSetting dyna_state{linkage, #if defined(__ANDROID__) ExtendedDynamicState::Disabled, diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index 4b406f4c35..1d7c25cf09 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h @@ -153,9 +153,6 @@ ENUM(ConsoleMode, Handheld, Docked); ENUM(AppletMode, HLE, LLE); ENUM(SpirvOptimizeMode, Never, OnLoad, Always); ENUM(GpuClock, Normal, Boost, Overclock) -ENUM(GpuUnswizzleSize, VerySmall, Small, Normal, Large, VeryLarge) -ENUM(GpuUnswizzle, VeryLow, Low, Normal, Medium, High) -ENUM(GpuUnswizzleChunk, VeryLow, Low, Normal, Medium, High) ENUM(TemperatureUnits, Celsius, Fahrenheit) ENUM(ExtendedDynamicState, Disabled, EDS1, EDS2, EDS3); ENUM(GpuLogLevel, Off, Errors, Standard, Verbose, All) diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 4ef97c602a..96e569aa21 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -234,23 +234,6 @@ std::unique_ptr InitializeTranslations(QObject* parent) { INSERT(Settings, gpu_clock, tr("GPU Clocks"), tr("Makes the game believe GPU work finishes faster than it does, so it stops lowering " "resolution and render distance to fit the Switch's clocks.")); - INSERT(Settings, gpu_unswizzle_enabled, tr("GPU Unswizzle"), - tr("Accelerates BCn 3D texture decoding using GPU compute.\n" - "Disable if experiencing crashes or graphical glitches.")); - INSERT(Settings, gpu_unswizzle_texture_size, tr("GPU Unswizzle Max Texture Size"), - tr("Sets the maximum size (MiB) for GPU-based texture unswizzling.\n" - "While the GPU is faster for medium and large textures, the CPU may be more " - "efficient for very small ones.\n" - "Adjust this to find the balance between GPU acceleration and CPU overhead.")); - INSERT(Settings, gpu_unswizzle_stream_size, tr("GPU Unswizzle Stream Size"), - tr("Sets the maximum amount of texture data (in MiB) processed per frame.\n" - "Higher values can reduce stutter during texture loading but may impact frame " - "consistency.")); - INSERT(Settings, gpu_unswizzle_chunk_size, tr("GPU Unswizzle Chunk Size"), - tr("Determines the number of depth slices processed in a single dispatch.\n" - "Increasing this can improve throughput on high-end GPUs but may cause TDR or driver " - "timeouts on weaker hardware.")); - INSERT(Settings, use_vulkan_driver_pipeline_cache, tr("Use Vulkan pipeline cache"), tr("Enables GPU vendor-specific pipeline cache.\nThis option can improve shader loading " "time significantly in cases where the Vulkan driver does not store pipeline cache " @@ -654,30 +637,6 @@ std::unique_ptr ComboboxEnumeration(QObject* parent) { PAIR(GpuClock, Boost, tr("Boost")), PAIR(GpuClock, Overclock, tr("Overclock")), }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(GpuUnswizzleSize, VerySmall, tr("Very Small (16 MB)")), - PAIR(GpuUnswizzleSize, Small, tr("Small (32 MB)")), - PAIR(GpuUnswizzleSize, Normal, tr("Normal (128 MB)")), - PAIR(GpuUnswizzleSize, Large, tr("Large (256 MB)")), - PAIR(GpuUnswizzleSize, VeryLarge, tr("Very Large (512 MB)")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(GpuUnswizzle, VeryLow, tr("Very Low (4 MB)")), - PAIR(GpuUnswizzle, Low, tr("Low (8 MB)")), - PAIR(GpuUnswizzle, Normal, tr("Normal (16 MB)")), - PAIR(GpuUnswizzle, Medium, tr("Medium (32 MB)")), - PAIR(GpuUnswizzle, High, tr("High (64 MB)")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(GpuUnswizzleChunk, VeryLow, tr("Very Low (32)")), - PAIR(GpuUnswizzleChunk, Low, tr("Low (64)")), - PAIR(GpuUnswizzleChunk, Normal, tr("Normal (128)")), - PAIR(GpuUnswizzleChunk, Medium, tr("Medium (256)")), - PAIR(GpuUnswizzleChunk, High, tr("High (512)")), - }}); translations->insert({Settings::EnumMetadata::Index(), { diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt index c4e7ac3f6f..a115bc7b64 100644 --- a/src/video_core/host_shaders/CMakeLists.txt +++ b/src/video_core/host_shaders/CMakeLists.txt @@ -22,7 +22,6 @@ set(SHADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/blit_depth_msaa.frag ${CMAKE_CURRENT_SOURCE_DIR}/blit_depth_stencil_msaa.frag ${CMAKE_CURRENT_SOURCE_DIR}/block_linear_unswizzle_3d.comp - ${CMAKE_CURRENT_SOURCE_DIR}/block_linear_unswizzle_3d_bcn.comp ${CMAKE_CURRENT_SOURCE_DIR}/convert_abgr8_to_d24s8.frag ${CMAKE_CURRENT_SOURCE_DIR}/convert_abgr8_to_d32f.frag ${CMAKE_CURRENT_SOURCE_DIR}/convert_d32f_to_abgr8.frag diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp index e059c683ff..b7797e3165 100644 --- a/src/video_core/host_shaders/astc_decoder.comp +++ b/src/video_core/host_shaders/astc_decoder.comp @@ -165,7 +165,26 @@ uint FastReplicateTo8(uint value, uint num_bits) { } uint FastReplicateTo6(uint value, uint num_bits) { - return ReplicateBits(value, num_bits, 6); + if (num_bits == 0) { + return 0; + } + if (num_bits >= 6) { + return value; + } + const uint v = value & ((1u << num_bits) - 1u); + if (num_bits == 1) { + return v * 63u; + } + if (num_bits == 2) { + return v * 21u; + } + if (num_bits == 3) { + return v * 9u; + } + if (num_bits == 4) { + return (v << 2u) | (v >> 2u); + } + return (v << 1u) | (v >> 4u); } uint Div3Floor(uint v) { @@ -958,35 +977,71 @@ void ComputeEndpoints(out uvec4 ep1, out uvec4 ep2, uint color_endpoint_mode, ui } uint UnquantizeTexelWeight(EncodingData val) { - uint encoding = Encoding(val), bitlen = NumBits(val), bitval = BitValue(val); - if (encoding == JUST_BITS) { - return (bitlen >= 1 && bitlen <= 5) - ? uint(floor(0.5f + float(bitval) * 64.0f / float((1 << bitlen) - 1))) - : FastReplicateTo6(bitval, bitlen); - } else if (encoding == TRIT || encoding == QUINT) { - uint B = 0, C = 0, D = 0; - uint b_mask = (0x3100 >> (bitlen * 4)) & 0xf; - uint b = (bitval >> 1) & b_mask; + const uint encoding = Encoding(val); + const uint bitlen = NumBits(val); + const uint bitval = BitValue(val); + const uint A = ReplicateBitTo7((bitval & 1)); + uint B = 0, C = 0, D = 0; + uint result = 0; + const uint bitlen_0_results[5] = {0, 16, 32, 48, 64}; + switch (encoding) { + case JUST_BITS: + result = FastReplicateTo6(bitval, bitlen); + break; + case TRIT: { D = QuintTritValue(val); - if (encoding == TRIT) { - switch (bitlen) { - case 0: return D * 32; //0,32,64 - case 1: C = 50; break; - case 2: C = 23; B = (b << 6) | (b << 2) | b; break; - case 3: C = 11; B = (b << 5) | b; break; - } - } else if (encoding == QUINT) { - switch (bitlen) { - case 0: return D * 16; //0, 16, 32, 48, 64 - case 1: C = 28; break; - case 2: C = 13; B = (b << 6) | (b << 1); break; - } + switch (bitlen) { + case 0: + return bitlen_0_results[D * 2]; + case 1: { + C = 50; + break; } - uint A = ReplicateBitTo7(bitval & 1); - uint res = (A & 0x20) | (((D * C + B) ^ A) >> 2); - return res + (res > 32 ? 1 : 0); + case 2: { + C = 23; + const uint b = (bitval >> 1) & 1; + B = (b << 6) | (b << 2) | b; + break; + } + case 3: { + C = 11; + const uint cb = (bitval >> 1) & 3; + B = (cb << 5) | cb; + break; + } + default: + break; + } + break; } - return 0; + case QUINT: { + D = QuintTritValue(val); + switch (bitlen) { + case 0: + return bitlen_0_results[D]; + case 1: { + C = 28; + break; + } + case 2: { + C = 13; + const uint b = (bitval >> 1) & 1; + B = (b << 6) | (b << 1); + break; + } + } + break; + } + } + if (encoding != JUST_BITS && bitlen > 0) { + result = D * C + B; + result ^= A; + result = (A & 0x20) | (result >> 2); + } + if (result > 32) { + result += 1; + } + return result; } void UnquantizeTexelWeights(uvec2 size, bool is_dual_plane) { @@ -1394,11 +1449,10 @@ void DecompressBlock(ivec3 coord) { } uint SwizzleOffset(uvec2 pos) { - return ((pos.x & 32u) << 3u) | - ((pos.y & 6u) << 5u) | - ((pos.x & 16u) << 1u) | - ((pos.y & 1u) << 4u) | - (pos.x & 15u); + const uint x = pos.x; + const uint y = pos.y; + return ((x % 64) / 32) * 256 + ((y % 8) / 2) * 64 + + ((x % 32) / 16) * 32 + (y % 2) * 16 + (x % 16); } void main() { diff --git a/src/video_core/host_shaders/block_linear_unswizzle_2d.comp b/src/video_core/host_shaders/block_linear_unswizzle_2d.comp index 2a3446ca66..9cb0f2aca2 100644 --- a/src/video_core/host_shaders/block_linear_unswizzle_2d.comp +++ b/src/video_core/host_shaders/block_linear_unswizzle_2d.comp @@ -51,7 +51,7 @@ layout(binding = BINDING_INPUT_BUFFER, std430) buffer InputBufferU128 { uvec4 u1 layout(binding = BINDING_OUTPUT_IMAGE) uniform writeonly uimage2DArray output_image; -layout(local_size_x = 32, local_size_y = 32, local_size_z = 1) in; +layout(local_size_x = 32, local_size_y = 8, local_size_z = 1) in; const uint GOB_SIZE_X = 64; const uint GOB_SIZE_Y = 8; @@ -65,19 +65,11 @@ const uint GOB_SIZE_SHIFT = GOB_SIZE_X_SHIFT + GOB_SIZE_Y_SHIFT + GOB_SIZE_Z_SHI const uvec2 SWIZZLE_MASK = uvec2(GOB_SIZE_X - 1, GOB_SIZE_Y - 1); -uint SwizzleTable(uint pos) { - const uint t[8] = uint[]( - 0x12100200, 0x13110301, 0x16140604, 0x17150705, - 0x1a180a08, 0x1b190b09, 0x1e1c0e0c, 0x1f1d0f0d - ); - const uint i = pos >> 4; - const uint h = (t[i / 4] >> ((i % 4) * 8)) & 0xff; - return (h << 4) | (pos & 0xf); -} - uint SwizzleOffset(uvec2 pos) { pos = pos & SWIZZLE_MASK; - return SwizzleTable(pos.y * 64 + pos.x); + return ((pos.x & 32u) << 3u) | ((pos.y & 6u) << 5u) | + ((pos.x & 16u) << 1u) | ((pos.y & 1u) << 4u) | + (pos.x & 15u); } uvec4 ReadTexel(uint offset) { diff --git a/src/video_core/host_shaders/block_linear_unswizzle_3d.comp b/src/video_core/host_shaders/block_linear_unswizzle_3d.comp index 34e4f93307..dc23b32492 100644 --- a/src/video_core/host_shaders/block_linear_unswizzle_3d.comp +++ b/src/video_core/host_shaders/block_linear_unswizzle_3d.comp @@ -53,7 +53,7 @@ layout(binding = BINDING_INPUT_BUFFER, std430) buffer InputBufferU128 { uvec4 u1 layout(binding = BINDING_OUTPUT_IMAGE) uniform writeonly uimage3D output_image; -layout(local_size_x = 16, local_size_y = 8, local_size_z = 8) in; +layout(local_size_x = 16, local_size_y = 8, local_size_z = 2) in; const uint GOB_SIZE_X = 64; const uint GOB_SIZE_Y = 8; @@ -67,19 +67,11 @@ const uint GOB_SIZE_SHIFT = GOB_SIZE_X_SHIFT + GOB_SIZE_Y_SHIFT + GOB_SIZE_Z_SHI const uvec2 SWIZZLE_MASK = uvec2(GOB_SIZE_X - 1, GOB_SIZE_Y - 1); -uint SwizzleTable(uint pos) { - const uint t[8] = uint[]( - 0x12100200, 0x13110301, 0x16140604, 0x17150705, - 0x1a180a08, 0x1b190b09, 0x1e1c0e0c, 0x1f1d0f0d - ); - const uint i = pos >> 4; - const uint h = (t[i / 4] >> ((i % 4) * 8)) & 0xff; - return (h << 4) | (pos & 0xf); -} - uint SwizzleOffset(uvec2 pos) { pos = pos & SWIZZLE_MASK; - return SwizzleTable(pos.y * 64 + pos.x); + return ((pos.x & 32u) << 3u) | ((pos.y & 6u) << 5u) | + ((pos.x & 16u) << 1u) | ((pos.y & 1u) << 4u) | + (pos.x & 15u); } uvec4 ReadTexel(uint offset) { diff --git a/src/video_core/host_shaders/block_linear_unswizzle_3d_bcn.comp b/src/video_core/host_shaders/block_linear_unswizzle_3d_bcn.comp deleted file mode 100644 index e084837f25..0000000000 --- a/src/video_core/host_shaders/block_linear_unswizzle_3d_bcn.comp +++ /dev/null @@ -1,164 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#version 430 - -#ifdef VULKAN - #extension GL_EXT_shader_16bit_storage : require - #extension GL_EXT_shader_8bit_storage : require - #define HAS_EXTENDED_TYPES 1 - #define BEGIN_PUSH_CONSTANTS layout(push_constant) uniform PushConstants { - #define END_PUSH_CONSTANTS }; - #define UNIFORM(n) - #define BINDING_INPUT_BUFFER 0 - #define BINDING_OUTPUT_BUFFER 1 -#else - #extension GL_NV_gpu_shader5 : enable - #ifdef GL_NV_gpu_shader5 - #define HAS_EXTENDED_TYPES 1 - #else - #define HAS_EXTENDED_TYPES 0 - #endif - #define BEGIN_PUSH_CONSTANTS - #define END_PUSH_CONSTANTS - #define UNIFORM(n) layout(location = n) uniform - #define BINDING_INPUT_BUFFER 1 - #define BINDING_OUTPUT_BUFFER 0 -#endif - -// --- Push Constants / Uniforms --- -#ifdef VULKAN -layout(push_constant) uniform PushConstants { - uvec3 blocks_dim; // Offset 0 - uint bytes_per_block_log2; // Offset 12 - - uvec3 origin; // Offset 16 - uint slice_size; // Offset 28 - - uint block_size; // Offset 32 - uint x_shift; // Offset 36 - uint block_height; // Offset 40 - uint block_height_mask; // Offset 44 - - uint block_depth; // Offset 48 - uint block_depth_mask; // Offset 52 - int _pad; // Offset 56 - - ivec3 destination; // Offset 60 -} pc; -#else -BEGIN_PUSH_CONSTANTS - UNIFORM(0) uvec3 origin; - UNIFORM(1) ivec3 destination; - UNIFORM(2) uint bytes_per_block_log2; - UNIFORM(3) uint slice_size; - UNIFORM(4) uint block_size; - UNIFORM(5) uint x_shift; - UNIFORM(6) uint block_height; - UNIFORM(7) uint block_height_mask; - UNIFORM(8) uint block_depth; - UNIFORM(9) uint block_depth_mask; - UNIFORM(10) uvec3 blocks_dim; -END_PUSH_CONSTANTS -#define pc // Map pc prefix to nothing for OpenGL compatibility -#endif - -// --- Buffers --- -#if HAS_EXTENDED_TYPES -layout(binding = BINDING_INPUT_BUFFER, std430) buffer InputBufferU8 { uint8_t u8data[]; }; -layout(binding = BINDING_INPUT_BUFFER, std430) buffer InputBufferU16 { uint16_t u16data[]; }; -#endif -layout(binding = BINDING_INPUT_BUFFER, std430) buffer InputBufferU32 { uint u32data[]; }; -layout(binding = BINDING_INPUT_BUFFER, std430) buffer InputBufferU64 { uvec2 u64data[]; }; -layout(binding = BINDING_INPUT_BUFFER, std430) buffer InputBufferU128 { uvec4 u128data[]; }; - -layout(binding = BINDING_OUTPUT_BUFFER, std430) writeonly buffer OutputBuffer { - uint out_u32[]; -}; - -// --- Constants --- -layout(local_size_x = 8, local_size_y = 8, local_size_z = 4) in; - -const uint GOB_SIZE_X = 64; -const uint GOB_SIZE_Y = 8; -const uint GOB_SIZE_Z = 1; -const uint GOB_SIZE = GOB_SIZE_X * GOB_SIZE_Y * GOB_SIZE_Z; - -const uint GOB_SIZE_X_SHIFT = 6; -const uint GOB_SIZE_Y_SHIFT = 3; -const uint GOB_SIZE_Z_SHIFT = 0; -const uint GOB_SIZE_SHIFT = GOB_SIZE_X_SHIFT + GOB_SIZE_Y_SHIFT + GOB_SIZE_Z_SHIFT; -const uvec2 SWIZZLE_MASK = uvec2(GOB_SIZE_X - 1u, GOB_SIZE_Y - 1u); - -uint SwizzleTable(uint pos) { - const uint t[8] = uint[]( - 0x12100200, 0x13110301, 0x16140604, 0x17150705, - 0x1a180a08, 0x1b190b09, 0x1e1c0e0c, 0x1f1d0f0d - ); - const uint i = pos >> 4; - const uint h = (t[i / 4] >> ((i % 4) * 8)) & 0xff; - return (h << 4) | (pos & 0xf); -} - -// --- Helpers --- -uint SwizzleOffset(uvec2 pos) { - pos &= SWIZZLE_MASK; - return SwizzleTable(pos.y * 64u + pos.x); -} - -uvec4 ReadTexel(uint offset) { - uint bpl2 = pc.bytes_per_block_log2; - switch (bpl2) { -#if HAS_EXTENDED_TYPES - case 0u: return uvec4(u8data[offset], 0u, 0u, 0u); - case 1u: return uvec4(u16data[offset / 2u], 0u, 0u, 0u); -#else - case 0u: return uvec4(bitfieldExtract(u32data[offset / 4u], int((offset * 8u) & 24u), 8), 0u, 0u, 0u); - case 1u: return uvec4(bitfieldExtract(u32data[offset / 4u], int((offset * 8u) & 16u), 16), 0u, 0u, 0u); -#endif - case 2u: return uvec4(u32data[offset / 4u], 0u, 0u, 0u); - case 3u: return uvec4(u64data[offset / 8u], 0u, 0u); - case 4u: return u128data[offset / 16u]; - } - return uvec4(0u); -} - -void main() { - uvec3 block_coord = gl_GlobalInvocationID; - if (any(greaterThanEqual(block_coord, pc.blocks_dim))) { - return; - } - - uint bytes_per_block = 1u << pc.bytes_per_block_log2; - // Origin is in pixels, divide by 4 for block-space (e.g. BCn formats) - uvec3 pos; - pos.x = (block_coord.x + (pc.origin.x >> 2u)) * bytes_per_block; - pos.y = block_coord.y + (pc.origin.y >> 2u); - pos.z = block_coord.z + pc.origin.z; - - uint swizzle = SwizzleOffset(pos.xy); - uint block_y = pos.y >> GOB_SIZE_Y_SHIFT; - uint offset = 0u; - // Apply block-linear offsets - offset += (pos.z >> pc.block_depth) * pc.slice_size; - offset += (pos.z & pc.block_depth_mask) << (GOB_SIZE_SHIFT + pc.block_height); - offset += (block_y >> pc.block_height) * pc.block_size; - offset += (block_y & pc.block_height_mask) << GOB_SIZE_SHIFT; - offset += (pos.x >> GOB_SIZE_X_SHIFT) << pc.x_shift; - offset += swizzle; - - uvec4 texel = ReadTexel(offset); - - // Calculate linear output index - uint block_index = block_coord.x + - (block_coord.y * pc.blocks_dim.x) + - (block_coord.z * pc.blocks_dim.x * pc.blocks_dim.y); - uint out_idx = block_index * (bytes_per_block >> 2u); - - out_u32[out_idx] = texel.x; - out_u32[out_idx + 1u] = texel.y; - if (pc.bytes_per_block_log2 == 4u) { - out_u32[out_idx + 2u] = texel.z; - out_u32[out_idx + 3u] = texel.w; - } -} \ No newline at end of file diff --git a/src/video_core/host_shaders/pitch_unswizzle.comp b/src/video_core/host_shaders/pitch_unswizzle.comp index 7d23f594c7..dba874b414 100644 --- a/src/video_core/host_shaders/pitch_unswizzle.comp +++ b/src/video_core/host_shaders/pitch_unswizzle.comp @@ -33,7 +33,7 @@ BEGIN_PUSH_CONSTANTS UNIFORM(0) uvec2 origin; UNIFORM(1) ivec2 destination; -UNIFORM(2) uint bytes_per_block; +UNIFORM(2) uint bytes_per_block_log2; UNIFORM(3) uint pitch; END_PUSH_CONSTANTS @@ -47,26 +47,26 @@ layout(binding = BINDING_INPUT_BUFFER, std430) readonly buffer InputBufferU128 { layout(binding = BINDING_OUTPUT_IMAGE) writeonly uniform uimage2D output_image; -layout(local_size_x = 32, local_size_y = 32, local_size_z = 1) in; +layout(local_size_x = 32, local_size_y = 8, local_size_z = 1) in; uvec4 ReadTexel(uint offset) { - switch (bytes_per_block) { + switch (bytes_per_block_log2) { #if HAS_EXTENDED_TYPES - case 1: + case 0: return uvec4(u8data[offset], 0, 0, 0); - case 2: + case 1: return uvec4(u16data[offset / 2], 0, 0, 0); #else - case 1: + case 0: return uvec4(bitfieldExtract(u32data[offset / 4], int((offset * 8) & 24), 8), 0, 0, 0); - case 2: + case 1: return uvec4(bitfieldExtract(u32data[offset / 4], int((offset * 8) & 16), 16), 0, 0, 0); #endif - case 4: + case 2: return uvec4(u32data[offset / 4], 0, 0, 0); - case 8: + case 3: return uvec4(u64data[offset / 8], 0, 0); - case 16: + case 4: return u128data[offset / 16]; } return uvec4(0); @@ -76,7 +76,7 @@ void main() { uvec2 pos = gl_GlobalInvocationID.xy + origin; uint offset = 0; - offset += pos.x * bytes_per_block; + offset += pos.x << bytes_per_block_log2; offset += pos.y * pitch; const uvec4 texel = ReadTexel(offset); diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 680cb2179f..48aa32bc90 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -556,7 +556,7 @@ void TextureCacheRuntime::Finish() { glFinish(); } -StagingBufferMap TextureCacheRuntime::UploadStagingBuffer(size_t size, bool deferred) { +StagingBufferMap TextureCacheRuntime::UploadStagingBuffer(size_t size) { return staging_buffer_pool.RequestUploadBuffer(size); } @@ -651,8 +651,7 @@ void TextureCacheRuntime::BlitFramebuffer(Framebuffer* dst, Framebuffer* src, } void TextureCacheRuntime::AccelerateImageUpload(Image& image, const StagingBufferMap& map, - std::span swizzles, - u32 z_start, u32 z_count) { + std::span swizzles) { switch (image.info.type) { case ImageType::e2D: if (IsPixelFormatASTC(image.info.format)) { diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 8a830fa0c9..9f3b244a8d 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -77,7 +77,7 @@ public: void FlushDeferredClear() {} - StagingBufferMap UploadStagingBuffer(size_t size, bool deferred = false); + StagingBufferMap UploadStagingBuffer(size_t size); StagingBufferMap DownloadStagingBuffer(size_t size, bool deferred = false); @@ -121,8 +121,7 @@ public: Tegra::Engines::Fermi2D::Operation operation); void AccelerateImageUpload(Image& image, const StagingBufferMap& map, - std::span swizzles, - u32 z_start, u32 z_count); + std::span swizzles); void InsertUploadMemoryBarrier(); @@ -229,8 +228,6 @@ public: bool ScaleDown(bool ignore = false); - u64 allocation_tick; - private: void CopyBufferToImage(const VideoCommon::BufferImageCopy& copy, size_t buffer_offset); diff --git a/src/video_core/renderer_opengl/util_shaders.cpp b/src/video_core/renderer_opengl/util_shaders.cpp index 7ced8c77b4..ef3fc05f2a 100644 --- a/src/video_core/renderer_opengl/util_shaders.cpp +++ b/src/video_core/renderer_opengl/util_shaders.cpp @@ -4,6 +4,7 @@ // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include #include @@ -116,7 +117,7 @@ void UtilShaders::ASTCDecode(Image& image, const StagingBufferMap& map, void UtilShaders::BlockLinearUpload2D(Image& image, const StagingBufferMap& map, std::span swizzles) { - static constexpr Extent3D WORKGROUP_SIZE{32, 32, 1}; + static constexpr Extent3D WORKGROUP_SIZE{32, 8, 1}; static constexpr GLuint BINDING_INPUT_BUFFER = 0; static constexpr GLuint BINDING_OUTPUT_IMAGE = 0; @@ -151,7 +152,7 @@ void UtilShaders::BlockLinearUpload2D(Image& image, const StagingBufferMap& map, void UtilShaders::BlockLinearUpload3D(Image& image, const StagingBufferMap& map, std::span swizzles) { - static constexpr Extent3D WORKGROUP_SIZE{16, 8, 8}; + static constexpr Extent3D WORKGROUP_SIZE{16, 8, 2}; static constexpr GLuint BINDING_INPUT_BUFFER = 0; static constexpr GLuint BINDING_OUTPUT_IMAGE = 0; @@ -189,12 +190,12 @@ void UtilShaders::BlockLinearUpload3D(Image& image, const StagingBufferMap& map, void UtilShaders::PitchUpload(Image& image, const StagingBufferMap& map, std::span swizzles) { - static constexpr Extent3D WORKGROUP_SIZE{32, 32, 1}; + static constexpr Extent3D WORKGROUP_SIZE{32, 8, 1}; static constexpr GLuint BINDING_INPUT_BUFFER = 0; static constexpr GLuint BINDING_OUTPUT_IMAGE = 0; static constexpr GLuint LOC_ORIGIN = 0; static constexpr GLuint LOC_DESTINATION = 1; - static constexpr GLuint LOC_BYTES_PER_BLOCK = 2; + static constexpr GLuint LOC_BYTES_PER_BLOCK_LOG2 = 2; static constexpr GLuint LOC_PITCH = 3; const u32 bytes_per_block = BytesPerBlock(image.info.format); @@ -208,7 +209,7 @@ void UtilShaders::PitchUpload(Image& image, const StagingBufferMap& map, glFlushMappedNamedBufferRange(map.buffer, map.offset, image.guest_size_bytes); glUniform2ui(LOC_ORIGIN, 0, 0); glUniform2i(LOC_DESTINATION, 0, 0); - glUniform1ui(LOC_BYTES_PER_BLOCK, bytes_per_block); + glUniform1ui(LOC_BYTES_PER_BLOCK_LOG2, static_cast(std::countr_zero(bytes_per_block))); glUniform1ui(LOC_PITCH, pitch); glBindImageTexture(BINDING_OUTPUT_IMAGE, image.StorageHandle(), 0, GL_FALSE, 0, GL_WRITE_ONLY, format); diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index ab58560170..4685c6ae30 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -16,13 +16,16 @@ #include "common/common_types.h" #include "common/div_ceil.h" #include "common/vector_math.h" +#include #include "video_core/host_shaders/astc_decoder_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_nosubgroups_comp_spv.h" #include "video_core/host_shaders/resolve_conditional_render_comp_spv.h" #include "video_core/host_shaders/vulkan_quad_indexed_comp_spv.h" #include "video_core/host_shaders/vulkan_uint8_comp_spv.h" -#include "video_core/host_shaders/block_linear_unswizzle_3d_bcn_comp_spv.h" +#include "video_core/host_shaders/block_linear_unswizzle_2d_comp_spv.h" +#include "video_core/host_shaders/block_linear_unswizzle_3d_comp_spv.h" +#include "video_core/host_shaders/pitch_unswizzle_comp_spv.h" #include "video_core/renderer_vulkan/vk_compute_pass.h" #include "video_core/surface.h" #include "video_core/renderer_vulkan/vk_descriptor_pool.h" @@ -185,6 +188,26 @@ struct AstcPushConstants { u32 block_height_mask; }; +struct BlockLinear3DImagePushConstants { + alignas(16) std::array origin; + alignas(16) std::array destination; + u32 bytes_per_block_log2; + u32 slice_size; + u32 block_size; + u32 x_shift; + u32 block_height; + u32 block_height_mask; + u32 block_depth; + u32 block_depth_mask; +}; + +struct PitchUnswizzlePushConstants { + std::array origin; + std::array destination; + u32 bytes_per_block_log2; + u32 pitch; +}; + struct QueriesPrefixScanPushConstants { u32 min_accumulation_base; u32 max_accumulation_base; @@ -616,260 +639,230 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, scheduler.Finish(); } -constexpr u32 BL3D_BINDING_INPUT_BUFFER = 0; -constexpr u32 BL3D_BINDING_OUTPUT_BUFFER = 1; +namespace { -struct alignas(16) BlockLinearUnswizzle3DPushConstants { - u32 blocks_dim[3]; // Offset 0 - u32 bytes_per_block_log2; // Offset 12 - - u32 origin[3]; // Offset 16 - u32 slice_size; // Offset 28 - - u32 block_size; // Offset 32 - u32 x_shift; // Offset 36 - u32 block_height; // Offset 40 - u32 block_height_mask; // Offset 44 - - u32 block_depth; // Offset 48 - u32 block_depth_mask; // Offset 52 - s32 _pad; // Offset 56 - - s32 destination[3]; // Offset 60 - s32 _pad_end; // Offset 72 -}; -static_assert(sizeof(BlockLinearUnswizzle3DPushConstants) <= 128); - -BlockLinearUnswizzle3DPass::BlockLinearUnswizzle3DPass( - const Device& device_, Scheduler& scheduler_, - DescriptorPool& descriptor_pool_, - StagingBufferPool& staging_buffer_pool_, - ComputePassDescriptorQueue& compute_pass_descriptor_queue_) - : ComputePass(device_, scheduler_, descriptor_pool_, - std::array{{ - { - .binding = BL3D_BINDING_INPUT_BUFFER, - .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, // block-linear input - .descriptorCount = 1, - .stageFlags = VK_SHADER_STAGE_COMPUTE_BIT, - .pImmutableSamplers = nullptr, - }, - { - .binding = BL3D_BINDING_OUTPUT_BUFFER, - .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, - .descriptorCount = 1, - .stageFlags = VK_SHADER_STAGE_COMPUTE_BIT, - .pImmutableSamplers = nullptr, - }, - }}, - std::array{{ - { - .dstBinding = BL3D_BINDING_INPUT_BUFFER, - .dstArrayElement = 0, - .descriptorCount = 1, - .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, - .offset = BL3D_BINDING_INPUT_BUFFER * sizeof(DescriptorUpdateEntry), - .stride = sizeof(DescriptorUpdateEntry), - }, - { - .dstBinding = BL3D_BINDING_OUTPUT_BUFFER, - .dstArrayElement = 0, - .descriptorCount = 1, - .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, - .offset = BL3D_BINDING_OUTPUT_BUFFER * sizeof(DescriptorUpdateEntry), - .stride = sizeof(DescriptorUpdateEntry), - } - }}, - DescriptorBankInfo{ - .uniform_buffers = 0, - .storage_buffers = 2, - .texture_buffers = 0, - .image_buffers = 0, - .textures = 0, - .images = 0, - .score = 2, - }, - COMPUTE_PUSH_CONSTANT_RANGE, - BLOCK_LINEAR_UNSWIZZLE_3D_BCN_COMP_SPV), - scheduler{scheduler_}, - staging_buffer_pool{staging_buffer_pool_}, - compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} - -BlockLinearUnswizzle3DPass::~BlockLinearUnswizzle3DPass() = default; - -// God have mercy on my soul -void BlockLinearUnswizzle3DPass::Unswizzle( - Image& image, - const StagingBufferRef& swizzled, - std::span swizzles, - u32 z_start, u32 z_count) -{ - using namespace VideoCommon::Accelerated; - - const u32 MAX_BATCH_SLICES = (std::min)(z_count, image.info.size.depth); - - // Allocate or grow to cover this batch's slice count - image.AllocateComputeUnswizzleBuffer(MAX_BATCH_SLICES); - - ASSERT(swizzles.size() == 1); - const auto& sw = swizzles[0]; - const auto params = MakeBlockLinearSwizzle3DParams(sw, image.info); - - const u32 blocks_x = (image.info.size.width + 3) / 4; - const u32 blocks_y = (image.info.size.height + 3) / 4; - - scheduler.RequestOutsideRenderPassOperationContext(); - for (u32 z_offset = 0; z_offset < z_count; z_offset += MAX_BATCH_SLICES) { - const u32 current_chunk_slices = (std::min)(MAX_BATCH_SLICES, z_count - z_offset); - const u32 current_z_start = z_start + z_offset; - - UnswizzleChunk(image, swizzled, sw, params, blocks_x, blocks_y, - current_z_start, current_chunk_slices); +void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, VkImage vk_image, + VkImageAspectFlags aspect_mask, bool is_initialized) { + VkAccessFlags src_access = VK_ACCESS_NONE; + VkImageLayout old_layout = VK_IMAGE_LAYOUT_UNDEFINED; + VkPipelineStageFlags src_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + if (is_initialized) { + src_access = VK_ACCESS_SHADER_WRITE_BIT; + old_layout = VK_IMAGE_LAYOUT_GENERAL; + src_stage = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER; } -} - -void BlockLinearUnswizzle3DPass::UnswizzleChunk( - Image& image, - const StagingBufferRef& swizzled, - const VideoCommon::SwizzleParameters& sw, - const BlockLinearSwizzle3DParams& params, - u32 blocks_x, u32 blocks_y, - u32 z_start, u32 z_count) -{ - BlockLinearUnswizzle3DPushConstants pc{}; - pc.origin[0] = params.origin[0]; - pc.origin[1] = params.origin[1]; - pc.origin[2] = z_start; // Current chunk's Z start - - pc.destination[0] = params.destination[0]; - pc.destination[1] = params.destination[1]; - pc.destination[2] = 0; // Shader writes to start of output buffer - - pc.bytes_per_block_log2 = params.bytes_per_block_log2; - pc.slice_size = params.slice_size; - pc.block_size = params.block_size; - pc.x_shift = params.x_shift; - pc.block_height = params.block_height; - pc.block_height_mask = params.block_height_mask; - pc.block_depth = params.block_depth; - pc.block_depth_mask = params.block_depth_mask; - - pc.blocks_dim[0] = blocks_x; - pc.blocks_dim[1] = blocks_y; - pc.blocks_dim[2] = z_count; // Only process the count - - compute_pass_descriptor_queue.Acquire(scheduler, 3); - compute_pass_descriptor_queue.AddBuffer(swizzled.buffer, - sw.buffer_offset + swizzled.offset, - image.guest_size_bytes - sw.buffer_offset); - compute_pass_descriptor_queue.AddBuffer(*image.compute_unswizzle_buffer, 0, - image.compute_unswizzle_buffer_size); - - const void* descriptor_data = compute_pass_descriptor_queue.UpdateData(); - const VkDescriptorSet set = descriptor_allocator.Commit(); - - const u32 gx = Common::DivCeil(blocks_x, 8u); - const u32 gy = Common::DivCeil(blocks_y, 8u); - const u32 gz = Common::DivCeil(z_count, 4u); - - const u32 bytes_per_block = 1u << pc.bytes_per_block_log2; - const VkDeviceSize output_slice_size = - static_cast(blocks_x) * blocks_y * bytes_per_block; - const VkDeviceSize barrier_size = output_slice_size * z_count; - - const bool is_first_chunk = (z_start == 0); - - const VkBuffer out_buffer = *image.compute_unswizzle_buffer; - const VkImage dst_image = image.Handle(); - const VkImageAspectFlags aspect = image.AspectMask(); - const u32 image_width = image.info.size.width; - const u32 image_height = image.info.size.height; - - scheduler.Record([this, set, descriptor_data, pc, gx, gy, gz, z_start, z_count, - barrier_size, is_first_chunk, out_buffer, dst_image, aspect, - image_width, image_height - ](vk::CommandBuffer cmdbuf) { - - if (dst_image == VK_NULL_HANDLE || out_buffer == VK_NULL_HANDLE) { - return; - } - - device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline); - cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); - cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(pc), &pc); - cmdbuf.Dispatch(gx, gy, gz); - - // Single barrier for compute -> transfer (buffer ready, image transition) - const VkBufferMemoryBarrier buffer_barrier{ - .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, - .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .buffer = out_buffer, - .offset = 0, - .size = barrier_size, - }; - - // Image layout transition - const VkImageMemoryBarrier pre_barrier{ + scheduler.Record([vk_pipeline, vk_image, aspect_mask, src_access, old_layout, + src_stage](vk::CommandBuffer cmdbuf) { + const VkImageMemoryBarrier image_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .pNext = nullptr, - .srcAccessMask = is_first_chunk ? VkAccessFlags{} : - static_cast(VK_ACCESS_TRANSFER_WRITE_BIT), - .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .oldLayout = is_first_chunk ? VK_IMAGE_LAYOUT_UNDEFINED : - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = dst_image, - .subresourceRange = {aspect, 0, 1, 0, 1}, - }; - - // Single barrier handles both buffer and image - cmdbuf.PipelineBarrier( - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, - nullptr, buffer_barrier, pre_barrier - ); - - // Copy chunk to correct Z position in image - const VkBufferImageCopy copy{ - .bufferOffset = 0, // Read from start of staging buffer - .bufferRowLength = 0, - .bufferImageHeight = 0, - .imageSubresource = {aspect, 0, 0, 1}, - .imageOffset = {0, 0, static_cast(z_start)}, // Write to correct Z - .imageExtent = {image_width, image_height, z_count}, - }; - cmdbuf.CopyBufferToImage(out_buffer, dst_image, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, copy); - - // Post-copy transition - const VkImageMemoryBarrier post_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .srcAccessMask = src_access, .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, - .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + .oldLayout = old_layout, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = dst_image, - .subresourceRange = {aspect, 0, 1, 0, 1}, + .image = vk_image, + .subresourceRange{ + .aspectMask = aspect_mask, + .baseMipLevel = 0, + .levelCount = VK_REMAINING_MIP_LEVELS, + .baseArrayLayer = 0, + .layerCount = VK_REMAINING_ARRAY_LAYERS, + }, }; - - cmdbuf.PipelineBarrier( - VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - 0, - nullptr, nullptr, post_barrier - ); + cmdbuf.PipelineBarrier(src_stage, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, image_barrier); + cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, vk_pipeline); }); } +void RecordUnswizzleEndBarrier(Scheduler& scheduler, VkImage vk_image, + VkImageAspectFlags aspect_mask) { + scheduler.Record([vk_image, aspect_mask](vk::CommandBuffer cmdbuf) { + const VkImageMemoryBarrier image_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + .pNext = nullptr, + .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, + .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | + VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .oldLayout = VK_IMAGE_LAYOUT_GENERAL, + .newLayout = VK_IMAGE_LAYOUT_GENERAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = vk_image, + .subresourceRange{ + .aspectMask = aspect_mask, + .baseMipLevel = 0, + .levelCount = VK_REMAINING_MIP_LEVELS, + .baseArrayLayer = 0, + .layerCount = VK_REMAINING_ARRAY_LAYERS, + }, + }; + cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, + vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, 0, image_barrier); + }); +} + +} // Anonymous namespace + +BlockLinearUnswizzleImage2DPass::BlockLinearUnswizzleImage2DPass( + const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_) + : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, + ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, + COMPUTE_PUSH_CONSTANT_RANGE, + BLOCK_LINEAR_UNSWIZZLE_2D_COMP_SPV), + scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, + compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} + +BlockLinearUnswizzleImage2DPass::~BlockLinearUnswizzleImage2DPass() = default; + +void BlockLinearUnswizzleImage2DPass::Unswizzle( + Image& image, const StagingBufferRef& map, + std::span swizzles) { + using namespace VideoCommon::Accelerated; + scheduler.RequestOutsideRenderPassOperationContext(); + const VkImageAspectFlags aspect_mask = image.AspectMask(); + const VkImage vk_image = image.Handle(); + RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + image.ExchangeInitialization()); + for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { + const size_t input_offset = swizzle.buffer_offset + map.offset; + const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 32U); + const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); + const u32 num_dispatches_z = image.info.resources.layers; + + compute_pass_descriptor_queue.Acquire(scheduler, 2); + compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, + image.guest_size_bytes - swizzle.buffer_offset); + compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); + const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; + + const auto params = MakeBlockLinearSwizzle2DParams(swizzle, image.info); + scheduler.Record([this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, + descriptor_data](vk::CommandBuffer cmdbuf) { + const VkDescriptorSet set = descriptor_allocator.Commit(); + device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); + cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); + cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, params); + cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); + }); + } + RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); + scheduler.Finish(); +} + +BlockLinearUnswizzleImage3DPass::BlockLinearUnswizzleImage3DPass( + const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_) + : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, + ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, + COMPUTE_PUSH_CONSTANT_RANGE, + BLOCK_LINEAR_UNSWIZZLE_3D_COMP_SPV), + scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, + compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} + +BlockLinearUnswizzleImage3DPass::~BlockLinearUnswizzleImage3DPass() = default; + +void BlockLinearUnswizzleImage3DPass::Unswizzle( + Image& image, const StagingBufferRef& map, + std::span swizzles) { + using namespace VideoCommon::Accelerated; + scheduler.RequestOutsideRenderPassOperationContext(); + const VkImageAspectFlags aspect_mask = image.AspectMask(); + const VkImage vk_image = image.Handle(); + RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + image.ExchangeInitialization()); + for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { + const size_t input_offset = swizzle.buffer_offset + map.offset; + const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 16U); + const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); + const u32 num_dispatches_z = Common::DivCeil(swizzle.num_tiles.depth, 2U); + + compute_pass_descriptor_queue.Acquire(scheduler, 2); + compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, + image.guest_size_bytes - swizzle.buffer_offset); + compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); + const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; + + const auto p = MakeBlockLinearSwizzle3DParams(swizzle, image.info); + const BlockLinear3DImagePushConstants params{ + .origin = p.origin, + .destination = p.destination, + .bytes_per_block_log2 = p.bytes_per_block_log2, + .slice_size = p.slice_size, + .block_size = p.block_size, + .x_shift = p.x_shift, + .block_height = p.block_height, + .block_height_mask = p.block_height_mask, + .block_depth = p.block_depth, + .block_depth_mask = p.block_depth_mask, + }; + scheduler.Record([this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, + descriptor_data](vk::CommandBuffer cmdbuf) { + const VkDescriptorSet set = descriptor_allocator.Commit(); + device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); + cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); + cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, params); + cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); + }); + } + RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); + scheduler.Finish(); +} + +PitchUnswizzlePass::PitchUnswizzlePass(const Device& device_, Scheduler& scheduler_, + DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_) + : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, + ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, + COMPUTE_PUSH_CONSTANT_RANGE, + PITCH_UNSWIZZLE_COMP_SPV), + scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, + compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} + +PitchUnswizzlePass::~PitchUnswizzlePass() = default; + +void PitchUnswizzlePass::Unswizzle(Image& image, const StagingBufferRef& map, + std::span swizzles) { + const u32 bytes_per_block = VideoCore::Surface::BytesPerBlock(image.info.format); + ASSERT(std::has_single_bit(bytes_per_block)); + scheduler.RequestOutsideRenderPassOperationContext(); + const VkImageAspectFlags aspect_mask = image.AspectMask(); + const VkImage vk_image = image.Handle(); + RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + image.ExchangeInitialization()); + for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { + const size_t input_offset = swizzle.buffer_offset + map.offset; + const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 32U); + const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); + + compute_pass_descriptor_queue.Acquire(scheduler, 2); + compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, + image.guest_size_bytes - swizzle.buffer_offset); + compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); + const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; + + const PitchUnswizzlePushConstants params{ + .origin = {0, 0}, + .destination = {0, 0}, + .bytes_per_block_log2 = static_cast(std::countr_zero(bytes_per_block)), + .pitch = image.info.pitch, + }; + scheduler.Record([this, num_dispatches_x, num_dispatches_y, params, + descriptor_data](vk::CommandBuffer cmdbuf) { + const VkDescriptorSet set = descriptor_allocator.Commit(); + device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); + cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); + cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, params); + cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, 1); + }); + } + RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); + scheduler.Finish(); +} + } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index 3d30aa6bdc..811deee8a2 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h @@ -17,7 +17,6 @@ #include "video_core/texture_cache/types.h" #include "video_core/vulkan_common/vulkan_memory_allocator.h" #include "video_core/vulkan_common/vulkan_wrapper.h" -#include "video_core/texture_cache/accelerated_swizzle.h" namespace VideoCommon { struct SwizzleParameters; @@ -25,8 +24,6 @@ struct SwizzleParameters; namespace Vulkan { -using VideoCommon::Accelerated::BlockLinearSwizzle3DParams; - class Device; class StagingBufferPool; class Scheduler; @@ -137,26 +134,50 @@ private: MemoryAllocator& memory_allocator; }; -class BlockLinearUnswizzle3DPass final : public ComputePass { +class BlockLinearUnswizzleImage2DPass final : public ComputePass { public: - explicit BlockLinearUnswizzle3DPass(const Device& device_, Scheduler& scheduler_, - DescriptorPool& descriptor_pool_, - StagingBufferPool& staging_buffer_pool_, - ComputePassDescriptorQueue& compute_pass_descriptor_queue_); - ~BlockLinearUnswizzle3DPass(); + explicit BlockLinearUnswizzleImage2DPass( + const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_); + ~BlockLinearUnswizzleImage2DPass(); - void Unswizzle(Image& image, - const StagingBufferRef& swizzled, - std::span swizzles, - u32 z_start, u32 z_count); + void Unswizzle(Image& image, const StagingBufferRef& map, + std::span swizzles); - void UnswizzleChunk( - Image& image, - const StagingBufferRef& swizzled, - const VideoCommon::SwizzleParameters& sw, - const BlockLinearSwizzle3DParams& params, - u32 blocks_x, u32 blocks_y, - u32 z_start, u32 z_count); +private: + Scheduler& scheduler; + StagingBufferPool& staging_buffer_pool; + ComputePassDescriptorQueue& compute_pass_descriptor_queue; +}; + +class BlockLinearUnswizzleImage3DPass final : public ComputePass { +public: + explicit BlockLinearUnswizzleImage3DPass( + const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_); + ~BlockLinearUnswizzleImage3DPass(); + + void Unswizzle(Image& image, const StagingBufferRef& map, + std::span swizzles); + +private: + Scheduler& scheduler; + StagingBufferPool& staging_buffer_pool; + ComputePassDescriptorQueue& compute_pass_descriptor_queue; +}; + +class PitchUnswizzlePass final : public ComputePass { +public: + explicit PitchUnswizzlePass(const Device& device_, Scheduler& scheduler_, + DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_); + ~PitchUnswizzlePass(); + + void Unswizzle(Image& image, const StagingBufferRef& map, + std::span swizzles); private: Scheduler& scheduler; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index bc2e82acae..4b37fee265 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -160,6 +160,73 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { info.size.depth == 1; } +[[nodiscard]] VkFormat UnswizzleStorageFormat(u32 bytes_per_block) { + switch (bytes_per_block) { + case 1: + return VK_FORMAT_R8_UINT; + case 2: + return VK_FORMAT_R16_UINT; + case 4: + return VK_FORMAT_R32_UINT; + case 8: + return VK_FORMAT_R32G32_UINT; + case 16: + return VK_FORMAT_R32G32B32A32_UINT; + default: + return VK_FORMAT_UNDEFINED; + } +} + +[[nodiscard]] bool IsUnswizzleStorageFormatSupported(const Device& device, u32 bytes_per_block) { + switch (bytes_per_block) { + case 1: + return device.IsStorageBuffer8BitAccessSupported(); + case 2: + return device.IsStorageBuffer16BitAccessSupported(); + case 4: + case 8: + case 16: + return true; + default: + return false; + } +} + +[[nodiscard]] bool IsUnswizzleAcceleratedFormat(const Device& device, PixelFormat format) { + if (IsPixelFormatASTC(format) || VideoCore::Surface::IsPixelFormatBCn(format)) { + return false; + } + if (VideoCore::Surface::GetFormatType(format) != SurfaceType::ColorTexture) { + return false; + } + return IsUnswizzleStorageFormatSupported(device, BytesPerBlock(format)); +} + +[[nodiscard]] bool WillUseAcceleratedUnswizzle(const Device& device, const ImageInfo& info) { + switch (info.type) { + case ImageType::e2D: + case ImageType::e3D: + case ImageType::Linear: + break; + default: + return false; + } + if (info.num_samples > 1 || !device.IsKhrImageFormatListSupported()) { + return false; + } + return IsUnswizzleAcceleratedFormat(device, info.format); +} + +[[nodiscard]] VkImageViewType UnswizzleStorageViewType(ImageType type) { + if (type == ImageType::e3D) { + return VK_IMAGE_VIEW_TYPE_3D; + } + if (type == ImageType::Linear) { + return VK_IMAGE_VIEW_TYPE_2D; + } + return VK_IMAGE_VIEW_TYPE_2D_ARRAY; +} + [[nodiscard]] VkImageCreateInfo MakeImageCreateInfo(const Device& device, const ImageInfo& info, std::optional format_override = {}) { auto format_info = @@ -249,7 +316,8 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { } [[nodiscard]] vk::ImageView MakeStorageView(const vk::Device& device, u32 level, VkImage image, - VkFormat format) { + VkFormat format, + VkImageViewType view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY) { static constexpr VkImageViewUsageCreateInfo storage_image_view_usage_create_info{ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, .pNext = nullptr, @@ -260,7 +328,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { .pNext = &storage_image_view_usage_create_info, .flags = 0, .image = image, - .viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY, + .viewType = view_type, .format = format, .components{ .r = VK_COMPONENT_SWIZZLE_IDENTITY, @@ -946,6 +1014,14 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue, memory_allocator); } + if (device.IsKhrImageFormatListSupported()) { + bl_unswizzle_2d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, + compute_pass_descriptor_queue); + bl_unswizzle_3d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, + compute_pass_descriptor_queue); + pitch_unswizzle_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, + compute_pass_descriptor_queue); + } if (!device.IsKhrImageFormatListSupported()) { return; } @@ -953,6 +1029,8 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched const auto image_format = static_cast(index_a); if (IsPixelFormatASTC(image_format) && !device.IsOptimalAstcSupported()) { view_formats[index_a].push_back(VK_FORMAT_A8B8G8R8_UNORM_PACK32); + } else if (IsUnswizzleAcceleratedFormat(device, image_format)) { + view_formats[index_a].push_back(UnswizzleStorageFormat(BytesPerBlock(image_format))); } for (size_t index_b = 0; index_b < VideoCore::Surface::MaxPixelFormat; index_b++) { const auto view_format = static_cast(index_b); @@ -964,18 +1042,14 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched } } - if (Settings::values.gpu_unswizzle_enabled.GetValue()) { - bl3d_unswizzle_pass.emplace(device, scheduler, descriptor_pool, - staging_buffer_pool, compute_pass_descriptor_queue); - } } void TextureCacheRuntime::Finish() { scheduler.Finish(); } -StagingBufferRef TextureCacheRuntime::UploadStagingBuffer(size_t size, bool deferred) { - return staging_buffer_pool.Request(size, MemoryUsage::Upload, deferred); +StagingBufferRef TextureCacheRuntime::UploadStagingBuffer(size_t size) { + return staging_buffer_pool.Request(size, MemoryUsage::Upload); } StagingBufferRef TextureCacheRuntime::DownloadStagingBuffer(size_t size, bool deferred) { @@ -1899,6 +1973,10 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu flags |= VideoCommon::ImageFlagBits::Converted; flags |= VideoCommon::ImageFlagBits::CostlyLoad; } + if (False(flags & VideoCommon::ImageFlagBits::Converted) && + WillUseAcceleratedUnswizzle(runtime->device, info)) { + flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; + } if (runtime->device.HasDebuggingToolAttached()) { original_image.SetObjectNameEXT(VideoCommon::Name(*this).c_str()); } @@ -1911,6 +1989,14 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu storage_image_views[level] = MakeStorageView(device, level, *original_image, storage_format); } + } else if (True(flags & VideoCommon::ImageFlagBits::AcceleratedUpload)) { + const auto& device = runtime->device.GetLogical(); + const VkFormat storage_format = UnswizzleStorageFormat(BytesPerBlock(info.format)); + const VkImageViewType view_type = UnswizzleStorageViewType(info.type); + for (s32 level = 0; level < info.resources.levels; ++level) { + storage_image_views[level] = + MakeStorageView(device, level, *original_image, storage_format, view_type); + } } } @@ -1927,48 +2013,6 @@ Image::~Image() { } } -void Image::AllocateComputeUnswizzleBuffer(u32 max_slices) { - using VideoCore::Surface::BytesPerBlock; - - const u32 block_bytes = BytesPerBlock(info.format); // 8 for BC1, 16 for BC6H - const u32 block_width = 4; - const u32 block_height = 4; - - // BCn is 4x4x1 blocks - const u32 blocks_x = (info.size.width + block_width - 1) / block_width; - const u32 blocks_y = (info.size.height + block_height - 1) / block_height; - const u32 blocks_z = (std::min)(max_slices, info.size.depth); - - const u64 block_count = - static_cast(blocks_x) * - static_cast(blocks_y) * - static_cast(blocks_z); - - const VkDeviceSize required_size = block_count * block_bytes; - if (has_compute_unswizzle_buffer && required_size <= compute_unswizzle_buffer_size) { - return; - } - - compute_unswizzle_buffer_size = required_size; - - VkBufferCreateInfo ci{ - .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .size = compute_unswizzle_buffer_size, - .usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_SRC_BIT, - .sharingMode = VK_SHARING_MODE_EXCLUSIVE, - .queueFamilyIndexCount = 0, - .pQueueFamilyIndices = nullptr, - }; - - compute_unswizzle_buffer = - runtime->memory_allocator.CreateBuffer(ci, MemoryUsage::DeviceLocal); - - has_compute_unswizzle_buffer = true; -} - void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset, std::span copies) { // TODO: Move this to another API @@ -2326,11 +2370,15 @@ VkImageView Image::StorageImageView(s32 level) noexcept { if (!view) { auto format_info = MaxwellToVK::SurfaceFormat(runtime->device, FormatType::Optimal, true, info.format); + VkImageViewType view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY; if (WillUseAcceleratedAstcDecode(runtime->device, info)) { format_info.format = VK_FORMAT_A8B8G8R8_UNORM_PACK32; + } else if (True(flags & VideoCommon::ImageFlagBits::AcceleratedUpload)) { + format_info.format = UnswizzleStorageFormat(BytesPerBlock(info.format)); + view_type = UnswizzleStorageViewType(info.type); } view = MakeStorageView(runtime->device.GetLogical(), level, *(this->*current_image), - format_info.format); + format_info.format, view_type); } return *view; } @@ -3129,25 +3177,20 @@ VkRenderPass Framebuffer::RenderPassVariant(u32 color_clear_mask, bool depth_ste void TextureCacheRuntime::AccelerateImageUpload( Image& image, const StagingBufferRef& map, - std::span swizzles, - u32 z_start, u32 z_count) { - + std::span swizzles) { if (IsPixelFormatASTC(image.info.format)) { return astc_decoder_pass->Assemble(image, map, swizzles); } - - if (!Settings::values.gpu_unswizzle_enabled.GetValue() || !bl3d_unswizzle_pass) { - if (IsPixelFormatBCn(image.info.format) && image.info.type == ImageType::e3D) { - ASSERT(false && "GPU unswizzle is disabled for BCn 3D texture"); - } - ASSERT(false); - return; + switch (image.info.type) { + case ImageType::e2D: + return bl_unswizzle_2d_pass->Unswizzle(image, map, swizzles); + case ImageType::e3D: + return bl_unswizzle_3d_pass->Unswizzle(image, map, swizzles); + case ImageType::Linear: + return pitch_unswizzle_pass->Unswizzle(image, map, swizzles); + default: + break; } - - if (bl3d_unswizzle_pass && IsPixelFormatBCn(image.info.format) && image.info.type == ImageType::e3D && image.info.resources.levels == 1 && image.info.resources.layers == 1) { - return bl3d_unswizzle_pass->Unswizzle(image, map, swizzles, z_start, z_count); - } - ASSERT(false); } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 2e9736f707..2e6b547e72 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -52,7 +52,7 @@ public: void Finish(); - StagingBufferRef UploadStagingBuffer(size_t size, bool deferred = false); + StagingBufferRef UploadStagingBuffer(size_t size); StagingBufferRef DownloadStagingBuffer(size_t size, bool deferred = false); @@ -98,8 +98,7 @@ public: } void AccelerateImageUpload(Image&, const StagingBufferRef&, - std::span, - u32 z_start, u32 z_count); + std::span); void InsertUploadMemoryBarrier() {} @@ -157,8 +156,9 @@ public: BlitImageHelper& blit_image_helper; RenderPassCache& render_pass_cache; std::optional astc_decoder_pass; - - std::optional bl3d_unswizzle_pass; + std::optional bl_unswizzle_2d_pass; + std::optional bl_unswizzle_3d_pass; + std::optional pitch_unswizzle_pass; const Settings::ResolutionScalingInfo& resolution; std::array, VideoCore::Surface::MaxPixelFormat> view_formats; @@ -334,8 +334,6 @@ public: void DownloadMemory(const StagingBufferRef& map, std::span copies); - void AllocateComputeUnswizzleImage(); - [[nodiscard]] VkImage Handle() const noexcept { return *(this->*current_image); } @@ -361,10 +359,6 @@ public: bool ScaleDown(bool ignore = false); - u64 allocation_tick; - - friend class BlockLinearUnswizzle3DPass; - private: bool BlitScaleHelper(bool scale_up); @@ -376,12 +370,6 @@ private: vk::Image original_image; vk::Image scaled_image; - vk::Buffer compute_unswizzle_buffer; - VkDeviceSize compute_unswizzle_buffer_size = 0; - bool has_compute_unswizzle_buffer = false; - - void AllocateComputeUnswizzleBuffer(u32 max_slices); - // Use a pointer to field because it is relative, so that the object can be // moved without breaking the reference. vk::Image Image::*current_image{}; diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 640bd38407..a248fe9c93 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -8,7 +8,6 @@ #include #include -#include #include "common/container/unordered_map.h" #include @@ -76,41 +75,6 @@ TextureCache

::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag critical_memory = DEFAULT_CRITICAL_MEMORY + 1_GiB; minimum_memory = 0; } - - const bool gpu_unswizzle_enabled = Settings::values.gpu_unswizzle_enabled.GetValue(); - - if (gpu_unswizzle_enabled) { - switch (Settings::values.gpu_unswizzle_texture_size.GetValue()) { - case Settings::GpuUnswizzleSize::VerySmall: gpu_unswizzle_maxsize = 16_MiB; break; - case Settings::GpuUnswizzleSize::Small: gpu_unswizzle_maxsize = 32_MiB; break; - case Settings::GpuUnswizzleSize::Normal: gpu_unswizzle_maxsize = 128_MiB; break; - case Settings::GpuUnswizzleSize::Large: gpu_unswizzle_maxsize = 256_MiB; break; - case Settings::GpuUnswizzleSize::VeryLarge: gpu_unswizzle_maxsize = 512_MiB; break; - default: gpu_unswizzle_maxsize = 128_MiB; break; - } - - switch (Settings::values.gpu_unswizzle_stream_size.GetValue()) { - case Settings::GpuUnswizzle::VeryLow: swizzle_chunk_size = 4_MiB; break; - case Settings::GpuUnswizzle::Low: swizzle_chunk_size = 8_MiB; break; - case Settings::GpuUnswizzle::Normal: swizzle_chunk_size = 16_MiB; break; - case Settings::GpuUnswizzle::Medium: swizzle_chunk_size = 32_MiB; break; - case Settings::GpuUnswizzle::High: swizzle_chunk_size = 64_MiB; break; - default: swizzle_chunk_size = 16_MiB; - } - - switch (Settings::values.gpu_unswizzle_chunk_size.GetValue()) { - case Settings::GpuUnswizzleChunk::VeryLow: swizzle_slices_per_batch = 32; break; - case Settings::GpuUnswizzleChunk::Low: swizzle_slices_per_batch = 64; break; - case Settings::GpuUnswizzleChunk::Normal: swizzle_slices_per_batch = 128; break; - case Settings::GpuUnswizzleChunk::Medium: swizzle_slices_per_batch = 256; break; - case Settings::GpuUnswizzleChunk::High: swizzle_slices_per_batch = 512; break; - default: swizzle_slices_per_batch = 128; - } - } else { - gpu_unswizzle_maxsize = 0; - swizzle_chunk_size = 0; - swizzle_slices_per_batch = 0; - } } template @@ -180,7 +144,6 @@ void TextureCache

::TickFrame() { sentenced_framebuffers.Tick(); sentenced_image_view.Tick(); TickAsyncDecode(); - TickAsyncUnswizzle(); runtime.TickFrame(); ++frame_tick; @@ -1132,19 +1095,6 @@ void TextureCache

::RefreshContents(Image& image, ImageId image_id) { return; } - const bool gpu_unswizzle_enabled = Settings::values.gpu_unswizzle_enabled.GetValue(); - - if (gpu_unswizzle_enabled && - IsPixelFormatBCn(image.info.format) && - image.info.type == ImageType::e3D && - image.info.resources.levels == 1 && - image.info.resources.layers == 1 && - MapSizeBytes(image) >= gpu_unswizzle_maxsize && - False(image.flags & ImageFlagBits::GpuModified)) { - - QueueAsyncUnswizzle(image, image_id); - return; - } auto staging = runtime.UploadStagingBuffer(MapSizeBytes(image)); UploadImageContents(image, staging); runtime.InsertUploadMemoryBarrier(); @@ -1160,7 +1110,7 @@ void TextureCache

::UploadImageContents(Image& image, StagingBuffer& staging) gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), mapped_span.size_bytes(), VideoCommon::CacheType::NoTextureCache); const auto uploads = FullUploadSwizzles(image.info); - runtime.AccelerateImageUpload(image, staging, FixSmallVectorADL(uploads), 0, 0); + runtime.AccelerateImageUpload(image, staging, FixSmallVectorADL(uploads)); return; } @@ -1372,20 +1322,6 @@ void TextureCache

::QueueAsyncDecode(Image& image, ImageId image_id) { texture_decode_worker.QueueWork(std::move(func)); } -template -void TextureCache

::QueueAsyncUnswizzle(Image& image, ImageId image_id) { - if (True(image.flags & ImageFlagBits::IsDecoding)) { - return; - } - - image.flags |= ImageFlagBits::IsDecoding; - - unswizzle_queue.push_back({ - .image_id = image_id, - .info = image.info - }); -} - template void TextureCache

::TickAsyncDecode() { bool has_uploads{}; @@ -1411,83 +1347,6 @@ void TextureCache

::TickAsyncDecode() { } } -template -void TextureCache

::TickAsyncUnswizzle() { - if (unswizzle_queue.empty()) { - return; - } - - if(current_unswizzle_frame > 0) { - current_unswizzle_frame--; - return; - } - - PendingUnswizzle& task = unswizzle_queue.front(); - Image& image = slot_images[task.image_id]; - - if (!task.initialized) { - task.total_size = MapSizeBytes(image); - task.staging_buffer = runtime.UploadStagingBuffer(task.total_size, true); - - const auto& info = image.info; - const u32 bytes_per_block = BytesPerBlock(info.format); - const u32 width_blocks = Common::DivCeil(info.size.width, 4u); - const u32 height_blocks = Common::DivCeil(info.size.height, 4u); - - const u32 stride = width_blocks * bytes_per_block; - const u32 aligned_height = height_blocks; - task.bytes_per_slice = static_cast(stride) * aligned_height; - task.last_submitted_offset = 0; - task.initialized = true; - } - - // Read data - if (task.current_offset < task.total_size) { - const size_t remaining = task.total_size - task.current_offset; - - size_t copy_amount = (std::min)(swizzle_chunk_size, remaining); - - if (remaining > swizzle_chunk_size) { - copy_amount = (copy_amount / task.bytes_per_slice) * task.bytes_per_slice; - if (copy_amount == 0) copy_amount = task.bytes_per_slice; - } - - gpu_memory->ReadBlock(image.gpu_addr + task.current_offset, - task.staging_buffer.mapped_span.data() + task.current_offset, - copy_amount); - task.current_offset += copy_amount; - } - - const bool is_final_batch = task.current_offset >= task.total_size; - const size_t bytes_ready = task.current_offset - task.last_submitted_offset; - const u32 complete_slices = static_cast(bytes_ready / task.bytes_per_slice); - - if (complete_slices >= swizzle_slices_per_batch || (is_final_batch && complete_slices > 0)) { - const u32 z_start = static_cast(task.last_submitted_offset / task.bytes_per_slice); - const u32 slices_to_process = (std::min)(complete_slices, swizzle_slices_per_batch); - const u32 z_count = (std::min)(slices_to_process, image.info.size.depth - z_start); - - if (z_count > 0) { - const auto uploads = FullUploadSwizzles(task.info); - runtime.AccelerateImageUpload(image, task.staging_buffer, FixSmallVectorADL(uploads), z_start, z_count); - task.last_submitted_offset += (static_cast(z_count) * task.bytes_per_slice); - } - } - - // Check if complete - const u32 slices_submitted = static_cast(task.last_submitted_offset / task.bytes_per_slice); - const bool all_slices_submitted = slices_submitted >= image.info.size.depth; - - if (is_final_batch && all_slices_submitted) { - runtime.FreeDeferredStagingBuffer(task.staging_buffer); - image.flags &= ~ImageFlagBits::IsDecoding; - unswizzle_queue.pop_front(); - - // Wait 4 frames to process the next entry - current_unswizzle_frame = 4u; - } -} - template bool TextureCache

::ScaleUp(Image& image) { const bool has_copy = image.HasScaled(); @@ -1637,8 +1496,6 @@ ImageId TextureCache

::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA const ImageId new_image_id = slot_images.insert(runtime, new_info, gpu_addr, cpu_addr); Image& new_image = slot_images[new_image_id]; - new_image.allocation_tick = frame_tick; - if (!gpu_memory->IsContinuousRange(new_image.gpu_addr, new_image.guest_size_bytes) && new_info.is_sparse) { new_image.flags |= ImageFlagBits::Sparse; diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 8a2318cc72..517afa4aa8 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -131,17 +131,6 @@ class TextureCache : public VideoCommon::ChannelSetupCaches> async_decodes; - std::deque unswizzle_queue; - u8 current_unswizzle_frame; - // Join caching boost::container::small_vector join_overlap_ids; ::Common::unordered_set join_overlaps_found; From a7061eb4c8afc3a74bd983212131954671317f0b Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Wed, 16 Sep 2026 03:46:44 +0200 Subject: [PATCH 002/198] [ns] Rename i_async_result -> async_result (#4439) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4439 Reviewed-by: lizzie Reviewed-by: MaranBr --- src/core/CMakeLists.txt | 4 ++-- src/core/hle/service/ns/application_manager_interface.h | 2 +- .../hle/service/ns/{i_async_result.cpp => async_result.cpp} | 0 src/core/hle/service/ns/{i_async_result.h => async_result.h} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename src/core/hle/service/ns/{i_async_result.cpp => async_result.cpp} (100%) rename src/core/hle/service/ns/{i_async_result.h => async_result.h} (100%) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 74391b5e65..5f9e9bd654 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -796,6 +796,8 @@ add_library(core STATIC hle/service/ns/application_manager_interface.h hle/service/ns/application_version_interface.cpp hle/service/ns/application_version_interface.h + hle/service/ns/async_result.cpp + hle/service/ns/async_result.h hle/service/ns/content_management_interface.cpp hle/service/ns/content_management_interface.h hle/service/ns/develop_interface.cpp @@ -810,8 +812,6 @@ add_library(core STATIC hle/service/ns/ecommerce_interface.h hle/service/ns/factory_reset_interface.cpp hle/service/ns/factory_reset_interface.h - hle/service/ns/i_async_result.cpp - hle/service/ns/i_async_result.h hle/service/ns/language.cpp hle/service/ns/language.h hle/service/ns/ns.cpp diff --git a/src/core/hle/service/ns/application_manager_interface.h b/src/core/hle/service/ns/application_manager_interface.h index af5ec780af..c4ca66f319 100644 --- a/src/core/hle/service/ns/application_manager_interface.h +++ b/src/core/hle/service/ns/application_manager_interface.h @@ -7,7 +7,7 @@ #pragma once #include "core/hle/service/cmif_types.h" -#include "core/hle/service/ns/i_async_result.h" +#include "core/hle/service/ns/async_result.h" #include "core/hle/service/ns/language.h" #include "core/hle/service/ns/ns_types.h" #include "core/hle/service/os/event.h" diff --git a/src/core/hle/service/ns/i_async_result.cpp b/src/core/hle/service/ns/async_result.cpp similarity index 100% rename from src/core/hle/service/ns/i_async_result.cpp rename to src/core/hle/service/ns/async_result.cpp diff --git a/src/core/hle/service/ns/i_async_result.h b/src/core/hle/service/ns/async_result.h similarity index 100% rename from src/core/hle/service/ns/i_async_result.h rename to src/core/hle/service/ns/async_result.h From d76f8f91c423841e131ad822ce26610585cca018 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 16 Sep 2026 04:00:59 +0200 Subject: [PATCH 003/198] [hle] Fix nullptr on ListApplicationIcon (#4438) Control could be null, handle such case Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4438 Reviewed-by: CamilleLaVey Reviewed-by: MaranBr --- ...nly_application_control_data_interface.cpp | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp index baf28b9b5c..1359cdbb95 100644 --- a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp +++ b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp @@ -311,27 +311,30 @@ void IReadOnlyApplicationControlDataInterface::ListApplicationIcon(HLERequestCon // u64 - app count memory.WriteBlock(t_mem_address + out_length, &app_count, sizeof(u64)); out_length += sizeof(u64); + ASSERT(out_length <= t_mem->GetSize()); // [list of u64] - size of icons for (size_t i = 0; i < app_count; ++i) { const u64 app_id = app_ids_buffer[i]; const FileSys::PatchManager pm{app_id, system.GetFileSystemController(), system.GetContentProvider()}; - const auto control = pm.GetControlMetadata(); - u64 full_size = control.second->GetSize(); - memory.WriteBlock(t_mem_address + out_length, &full_size, sizeof(u64)); + if (const auto control = pm.GetControlMetadata(); control.second) { + u64 full_size = control.second->GetSize(); + memory.WriteBlock(t_mem_address + out_length, &full_size, sizeof(u64)); + } out_length += sizeof(u64); + ASSERT(out_length <= t_mem->GetSize()); } // [list of raw icon data] - std::vector full_icon_data; for (size_t i = 0; i < app_count; ++i) { const u64 app_id = app_ids_buffer[i]; const FileSys::PatchManager pm{app_id, system.GetFileSystemController(), system.GetContentProvider()}; - const auto control = pm.GetControlMetadata(); - auto const full_size = control.second->GetSize(); - if (full_size > 0) { - full_icon_data.resize(full_size); - control.second->Read(full_icon_data.data(), full_size, 0); - memory.WriteBlock(t_mem_address + out_length, full_icon_data.data(), full_size); - out_length += full_size; + if (const auto control = pm.GetControlMetadata(); control.second) { + if (auto const full_size = control.second->GetSize(); full_size > 0) { + std::vector full_icon_data(full_size); + control.second->Read(full_icon_data.data(), full_size, 0); + memory.WriteBlock(t_mem_address + out_length, full_icon_data.data(), full_size); + out_length += full_size; + ASSERT(out_length <= t_mem->GetSize()); + } } } } @@ -345,6 +348,12 @@ void IReadOnlyApplicationControlDataInterface::ListApplicationIcon(HLERequestCon void IReadOnlyApplicationControlDataInterface::ListApplicationTitle(HLERequestContext& ctx) { const auto app_ids_buffer = ctx.ReadBuffer(); const size_t app_count = app_ids_buffer.size() / sizeof(u64); + + std::vector application_ids(app_count); + if (app_count > 0) { + std::memcpy(application_ids.data(), app_ids_buffer.data(), app_count * sizeof(u64)); + } + auto t_mem_obj = ctx.GetObjectFromHandle(ctx.GetCopyHandle(0)); auto* t_mem = t_mem_obj.GetPointerUnsafe(); constexpr size_t title_entry_size = sizeof(FileSys::LanguageEntry); @@ -354,8 +363,9 @@ void IReadOnlyApplicationControlDataInterface::ListApplicationTitle(HLERequestCo auto& memory = system.ApplicationMemory(); const auto t_mem_address = t_mem->GetSourceAddress(); for (size_t i = 0; i < app_count; ++i) { - const u64 app_id = app_ids_buffer[i]; - const FileSys::PatchManager pm{app_id, system.GetFileSystemController(), system.GetContentProvider()}; + const u64 app_id = application_ids[i]; + const FileSys::PatchManager pm{app_id, system.GetFileSystemController(), + system.GetContentProvider()}; const auto control = pm.GetControlMetadata(); FileSys::LanguageEntry entry{}; if (control.first != nullptr) { From fd34024f0e1ffca0aa813698d2552a1dea2b5b17 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 16 Sep 2026 04:45:45 +0200 Subject: [PATCH 004/198] [hle/ns] fix build error due to missing async_result.h (#4440) We may have merged quite a bit too fast before letting CI finish. Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4440 Reviewed-by: MaranBr Reviewed-by: CamilleLaVey --- src/core/hle/service/ns/async_result.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/ns/async_result.cpp b/src/core/hle/service/ns/async_result.cpp index be04c162d3..8617280bef 100644 --- a/src/core/hle/service/ns/async_result.cpp +++ b/src/core/hle/service/ns/async_result.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/ns/i_async_result.h" +#include "core/hle/service/ns/async_result.h" #include @@ -32,4 +32,4 @@ Result IAsyncResult::Cancel() { R_SUCCEED(); } -} // namespace Service::NS \ No newline at end of file +} // namespace Service::NS From 4ce45b3b37d162660f0e1ec829c4eab896fc4db4 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 16 Sep 2026 08:10:29 +0200 Subject: [PATCH 005/198] [hle] Fix crash on MK8D and SM3DW LDN (#4417) Crash is due to SIGILL due to mismatched N and span<> ctor(). Also some astray nullptr references. Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4417 Reviewed-by: MaranBr Reviewed-by: Maufeat --- src/common/uuid.cpp | 4 ++-- src/common/uuid.h | 2 +- .../hle/service/am/service/application_functions.cpp | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp index 51fe0abaa5..4b992c5df8 100644 --- a/src/common/uuid.cpp +++ b/src/common/uuid.cpp @@ -208,9 +208,9 @@ UUID UUID::MakeRandomRFC4122V4() { return uuid; } -UUID UUID::MakeRFC4122V5(std::span sha1) { +UUID UUID::MakeRFC4122V5(std::span sha1) { UUID uuid{}; - std::memcpy(&uuid.uuid, sha1.data(), sizeof(UUID)); + std::memcpy(&uuid.uuid, sha1.data(), sha1.size()); uuid.uuid[8] = 0x80 | (uuid.uuid[8] & 0x3F); uuid.uuid[6] = 0x50 | (uuid.uuid[6] & 0xF); return uuid; diff --git a/src/common/uuid.h b/src/common/uuid.h index 3aa3212dd7..465b5be58d 100644 --- a/src/common/uuid.h +++ b/src/common/uuid.h @@ -104,7 +104,7 @@ struct UUID { /// @returns A random UUID that is RFC 4122 Version 4 compliant. [[nodiscard]] static UUID MakeRandomRFC4122V4(); - [[nodiscard]] static UUID MakeRFC4122V5(std::span sha1); + [[nodiscard]] static UUID MakeRFC4122V5(std::span sha1); friend constexpr bool operator==(const UUID& lhs, const UUID& rhs) = default; }; diff --git a/src/core/hle/service/am/service/application_functions.cpp b/src/core/hle/service/am/service/application_functions.cpp index 215d204098..90d292c4a2 100644 --- a/src/core/hle/service/am/service/application_functions.cpp +++ b/src/core/hle/service/am/service/application_functions.cpp @@ -347,21 +347,22 @@ Result IApplicationFunctions::NotifyRunning(Out out_became_running) { Result IApplicationFunctions::GetPseudoDeviceId(Out out_pseudo_device_id) { LOG_WARNING(Service_AM, "(stubbed)"); - R_UNLESS(out_pseudo_device_id, ResultUnknown); + R_UNLESS(out_pseudo_device_id != nullptr, ResultUnknown); // This should be hashed with the device specific hash // for now this will do const auto res = FileSys::PatchManager::GetMetadataFromBaseOrUpdate(system, m_applet->program_id); - u8 hash[EVP_MAX_MD_SIZE]; + R_UNLESS(res.first != nullptr, ResultUnknown); + std::array hash; unsigned int hash_len = 0; auto const seed = res.first->raw.seed_for_pseudo_device_id; EVP_MD_CTX *ctx = EVP_MD_CTX_new(); auto const algorithm = EVP_sha1(); EVP_DigestInit_ex(ctx, algorithm, nullptr); EVP_DigestUpdate(ctx, &seed, sizeof(seed)); - EVP_DigestFinal_ex(ctx, hash, &hash_len); + EVP_DigestFinal_ex(ctx, hash.data(), &hash_len); EVP_MD_CTX_free(ctx); - *out_pseudo_device_id = Common::UUID::MakeRFC4122V5(std::span{hash, std::size(hash)}); + *out_pseudo_device_id = Common::UUID::MakeRFC4122V5(std::span{hash.begin(), hash.begin() + 16}); R_SUCCEED(); } From 7bf95be2c29328a4cfeb8b2384ce34c6fb6d890c Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 16 Sep 2026 09:29:12 +0200 Subject: [PATCH 006/198] [dynarmic] fix A32 crash due to wrong LEA encoding (#4444) LEA 1< - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4444 Reviewed-by: CamilleLaVey Reviewed-by: Maufeat --- src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h index 54ad638ada..5d98d47564 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h @@ -90,7 +90,7 @@ template<> code.shl(tmp, int(ctx.conf.page_table_log2_stride)); code.mov(page, qword[r14 + tmp.cvt64()]); } else { - code.mov(page, qword[r14 + tmp.cvt64() * int(ctx.conf.page_table_log2_stride)]); + code.mov(page, qword[r14 + tmp.cvt64() * int(1 << ctx.conf.page_table_log2_stride)]); } // check for marked bit, use as unmapped if marked From ac35358b3ffed74aaac56b0e99b09e81bb60d2e1 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 16 Sep 2026 15:35:13 +0200 Subject: [PATCH 007/198] [common] Replace `Common::SpinLock` with `std::mutex` (#4436) `std::mutex` can be better than the spin-lock specially since we don't waste CPU cycles for no reason. Test less stuttering/heat consumption. Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4436 Reviewed-by: CamilleLaVey Reviewed-by: MaranBr --- src/common/CMakeLists.txt | 1 - src/common/spin_lock.h | 50 ------------------------------- src/core/hle/kernel/k_slab_heap.h | 7 ++--- src/core/hle/kernel/k_thread.h | 3 +- 4 files changed, 4 insertions(+), 57 deletions(-) delete mode 100644 src/common/spin_lock.h diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 61e0e64aa8..94da1724df 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -110,7 +110,6 @@ add_library( socket_types.h sparse_large_vector.cpp sparse_large_vector.h - spin_lock.h stb.cpp stb.h steady_clock.cpp diff --git a/src/common/spin_lock.h b/src/common/spin_lock.h deleted file mode 100644 index 93d507ae80..0000000000 --- a/src/common/spin_lock.h +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#ifdef _MSC_VER -#include -#elif defined(ARCHITECTURE_x86_64) -#include -#endif -#include - -namespace Common { - -/// @brief A lock similar to mutex that forces a thread to spin wait instead calling the -/// supervisor. Should be used on short sequences of code. -struct SpinLock { - SpinLock() noexcept = default; - SpinLock(const SpinLock&) noexcept = delete; - SpinLock& operator=(const SpinLock&) noexcept = delete; - SpinLock(SpinLock&&) noexcept = delete; - SpinLock& operator=(SpinLock&&) noexcept = delete; - - inline void lock() noexcept { - while (lck.test_and_set(std::memory_order_acquire)) { -#if defined(ARCHITECTURE_x86_64) - _mm_pause(); -#elif defined(ARCHITECTURE_arm64) && defined(_MSC_VER) - __yield(); -#elif defined(ARCHITECTURE_arm64) - asm("yield"); -#endif - } - } - - inline void unlock() noexcept { - lck.clear(std::memory_order_release); - } - - [[nodiscard]] inline bool try_lock() noexcept { - return !lck.test_and_set(std::memory_order_acquire); - } - - std::atomic_flag lck = ATOMIC_FLAG_INIT; -}; - -} // namespace Common diff --git a/src/core/hle/kernel/k_slab_heap.h b/src/core/hle/kernel/k_slab_heap.h index c91e7969a2..a5dbab9571 100644 --- a/src/core/hle/kernel/k_slab_heap.h +++ b/src/core/hle/kernel/k_slab_heap.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project @@ -12,7 +12,6 @@ #include "common/atomic_ops.h" #include "common/common_funcs.h" #include "common/common_types.h" -#include "common/spin_lock.h" namespace Kernel { @@ -30,7 +29,7 @@ public: }; public: - constexpr KSlabHeapImpl() = default; + KSlabHeapImpl() = default; void Initialize() { ASSERT(m_head == nullptr); @@ -68,7 +67,7 @@ public: private: std::atomic m_head{}; - Common::SpinLock m_lock; + std::mutex m_lock; }; } // namespace impl diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index 95ba1b4d76..0ee5f72c8e 100644 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h @@ -19,7 +19,6 @@ #include "common/intrusive_red_black_tree.h" #include "common/scratch_buffer.h" -#include "common/spin_lock.h" #include "core/arm/arm_interface.h" #include "core/hle/kernel/k_affinity_mask.h" #include "core/hle/kernel/k_light_lock.h" @@ -920,7 +919,7 @@ private: bool m_resource_limit_release_hint{}; bool m_is_kernel_address_key{}; StackParameters m_stack_parameters{}; - Common::SpinLock m_context_guard{}; + std::mutex m_context_guard{}; // For emulation std::shared_ptr m_host_context{}; From c3f1e6562b6cb5aefcb9edd490b303867917f25e Mon Sep 17 00:00:00 2001 From: Feng Chen Date: Wed, 16 Sep 2026 22:12:01 +0200 Subject: [PATCH 008/198] [common/fs] Preserve Windows roots during path sanitization (#4437) Commit 5b4c29b123 made SanitizePath rebuild paths from split components after resolving traversal. That reconstruction retained only one leading separator, collapsing UNC paths and breaking network-backed directories. Parse the path root separately from normal components. Preserve UNC prefixes, drive-absolute and drive-relative forms, and extended UNC/device namespaces while normalizing separators and dot components. Treat the UNC server/share portion as part of the root so parent traversal cannot escape into another share. Also preserve root-only results such as / and C:\\ instead of stripping their final separator. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4437 Reviewed-by: lizzie Reviewed-by: CamilleLaVey --- src/common/fs/path_util.cpp | 79 +++++++++++++++++++++++++++++++------ src/common/fs/path_util.h | 5 ++- 2 files changed, 69 insertions(+), 15 deletions(-) diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index b895aac54c..82ea8f6cb2 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include #include #include #include "common/container/unordered_map.h" @@ -480,28 +481,80 @@ std::string SanitizePath(std::string_view path_, DirectorySeparator directory_se [type2](char c1, char c2) { return c1 == type2 && c2 == type2; }), path.end()); - const bool absolute = !path.empty() && path[0] == type2; - std::vector parts; + std::string root; + std::string_view components{path}; + bool drive_relative = false; - for (const auto part : SplitPathComponents(path)) - { - if (part.empty() || part == ".") - continue; - if (part == ".." && !parts.empty() && parts.back() != "..") - parts.pop_back(); - else if (part != "..") parts.push_back(part); +#ifdef _WIN32 + const bool network = path.size() > 1 && path[0] == type2 && path[1] == type2; + const bool drive = + path.size() > 1 && std::isalpha(static_cast(path[0])) && path[1] == ':'; + + if (network) { + root.assign(2, type2); + components.remove_prefix(2); + } else if (drive) { + root.assign(path.data(), 2); + components.remove_prefix(2); + if (!components.empty() && components.front() == type2) { + root += type2; + components.remove_prefix(1); + } else { + drive_relative = true; + } + } +#endif + + if (root.empty() && !components.empty() && components.front() == type2) { + root += type2; + components.remove_prefix(1); } - std::string resolved = absolute ? std::string(1, type2) : std::string{}; - for (std::size_t i = 0; i < parts.size(); ++i) - { - if (i != 0) + const auto path_parts = SplitPathComponents(components); + std::size_t root_component_count = 0; +#ifdef _WIN32 + if (network) { + root_component_count = 2; + + const auto is_unc = [](std::string_view part) { + return part.size() == 3 && (part[0] == 'U' || part[0] == 'u') && + (part[1] == 'N' || part[1] == 'n') && (part[2] == 'C' || part[2] == 'c'); + }; + if (path_parts.size() >= 2 && path_parts[0] == "?" && is_unc(path_parts[1])) { + root_component_count = 4; + } + } +#endif + + std::vector parts; + for (std::size_t i = 0; i < path_parts.size(); ++i) { + const auto part = path_parts[i]; + if (i < root_component_count) { + parts.push_back(part); + } else if (part.empty() || part == ".") { + continue; + } else if (part == "..") { + if (parts.size() > root_component_count) { + parts.pop_back(); + } + } else { + parts.push_back(part); + } + } + + const std::size_t root_length = root.size(); + std::string resolved = std::move(root); + for (std::size_t i = 0; i < parts.size(); ++i) { + if (i != 0 || (!resolved.empty() && resolved.back() != type2 && !drive_relative)) resolved += type2; resolved.append(parts[i].data(), parts[i].size()); } path = std::move(resolved); + if (!path.empty() && path.size() == root_length) { + return path; + } return std::string(RemoveTrailingSlash(path)); } diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h index 983e4917e8..e8fa5614ae 100644 --- a/src/common/fs/path_util.h +++ b/src/common/fs/path_util.h @@ -347,8 +347,9 @@ enum class DirectorySeparator { // i.e. "C:\Users\Yuzu\Documents\save.bin" becomes {"C:", "Users", "Yuzu", "Documents", "save.bin" } [[nodiscard]] std::vector SplitPathComponentsCopy(std::string_view filename); -// Removes trailing slash, makes all '\\' into '/', and removes duplicate '/'. Makes '/' into '\\' -// depending if directory_separator is BackwardSlash or PlatformDefault and running on windows +// Normalizes directory separators, removes duplicate and non-root trailing separators, and resolves +// '.' and '..' components without traversing above the path root. Windows drive and UNC roots are +// preserved. [[nodiscard]] std::string SanitizePath( std::string_view path, DirectorySeparator directory_separator = DirectorySeparator::ForwardSlash); From 4fe5f62c38e71b045d425dc5f4cc4ab83feeafbe Mon Sep 17 00:00:00 2001 From: Exverge Date: Wed, 16 Sep 2026 22:47:16 +0200 Subject: [PATCH 009/198] [dynarmic] fix sign extension and optimize vaddr lookups for 64bit on x64 systems (#4446) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Same as #4415 + #4444 just ported to A64 because I amazingly forgot Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4446 Reviewed-by: lizzie Reviewed-by: CamilleLaVey --- .../src/dynarmic/backend/x64/emit_x64_memory.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h index 5d98d47564..b78c14f6b7 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h @@ -161,8 +161,12 @@ template<> code.jnz(abort, code.T_NEAR); } - code.shl(tmp, int(ctx.conf.page_table_log2_stride)); - code.mov(page, qword[r14 + tmp]); + if (ctx.conf.page_table_log2_stride > 3) { + code.shl(tmp, int(ctx.conf.page_table_log2_stride)); + code.mov(page, qword[r14 + tmp.cvt64()]); + } else { + code.mov(page, qword[r14 + tmp.cvt64() * int(1 << ctx.conf.page_table_log2_stride)]); + } // check for marked bit, use as unmapped if marked if (ctx.conf.page_table_marked_bit) { @@ -178,9 +182,10 @@ template<> code.mov(tmp, ctx.conf.page_table_pointer_mask); code.and_(page, tmp); } + // check for sign bit, apply sign extension as needed if (ctx.conf.page_table_sign_extension) { - code.shl(page, *ctx.conf.page_table_sign_extension); - code.sar(page, *ctx.conf.page_table_sign_extension); + code.shl(page, 63 - int(*ctx.conf.page_table_sign_extension)); + code.sar(page, 63 - int(*ctx.conf.page_table_sign_extension)); } code.jz(abort, code.T_NEAR); From 90aafeedc1d980849894f5bf251313db95594e8a Mon Sep 17 00:00:00 2001 From: lizzie Date: Thu, 17 Sep 2026 00:28:37 +0200 Subject: [PATCH 010/198] [k_scheduler] fix for libc++ that lazily initializes mutexes (#4447) `__m_` is nullptr when `unlock();` is called, so `try_lock();` will force materialization of the backing mutex. Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4447 Reviewed-by: CamilleLaVey Reviewed-by: MaranBr --- src/core/hle/kernel/k_scheduler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/hle/kernel/k_scheduler.cpp b/src/core/hle/kernel/k_scheduler.cpp index 8e629f6456..3156a17064 100644 --- a/src/core/hle/kernel/k_scheduler.cpp +++ b/src/core/hle/kernel/k_scheduler.cpp @@ -465,6 +465,10 @@ void KScheduler::ScheduleImplFiber(KernelCore& kernel) { // Check if we need scheduling. If we do, then we can't complete the switch and should // retry. if (m_state.needs_scheduling.load(std::memory_order_seq_cst)) { + // Some libc++ lazily init mutex + [[maybe_unused]] auto const can_lock = highest_priority_thread->m_context_guard.try_lock(); + DEBUG_ASSERT(!can_lock); + // Our switch failed. // We should unlock the thread context, and then retry. highest_priority_thread->m_context_guard.unlock(); @@ -496,6 +500,10 @@ void KScheduler::Unload(KernelCore& kernel, KThread* thread) { // Check if the thread is terminated by checking the DPC flags. if ((thread->GetStackParameters().dpc_flags & static_cast(DpcFlag::Terminated)) == 0) { + // Some libc++ lazily init mutex + [[maybe_unused]] auto const can_lock = thread->m_context_guard.try_lock(); + DEBUG_ASSERT(!can_lock); + // The thread isn't terminated, so we want to unlock it. thread->m_context_guard.unlock(); } From 8c1194474e76be02eaf69eefb9fcfdd04bd31229 Mon Sep 17 00:00:00 2001 From: lizzie Date: Thu, 17 Sep 2026 05:43:59 +0200 Subject: [PATCH 011/198] [hle/ssl] Implement Peek(),{Get,Set}RenegotiationMode,Pending,Poll and stub miscellany (#4428) Mainly because of Pending() as it's used in some games. May as well implement the rest. Skyline implemented ISslContext::RegisterInternalPki which is just a success stub (for now) for JJBA:ASB Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4428 Reviewed-by: MaranBr Reviewed-by: Maufeat Reviewed-by: CamilleLaVey --- src/core/hle/service/ssl/ssl.cpp | 462 +++++++++--------- src/core/hle/service/ssl/ssl_backend.h | 7 +- .../hle/service/ssl/ssl_backend_openssl.cpp | 47 +- 3 files changed, 266 insertions(+), 250 deletions(-) diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 750a7de236..178c4c690b 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -48,6 +48,12 @@ enum class OptionType : u32 { EnableAlpn = 3, }; +// This is nn::ssl::sf::RenegotiationMode +enum RenegotiationMode : u32 { + None = 0, ///< None + Secure = 1, ///< Secure +}; + // This is nn::ssl::sf::SslVersion struct SslVersion { union { @@ -75,34 +81,34 @@ public: shared_data{shared_data_in}, backend{std::move(backend_in)} { // clang-format off static const FunctionInfo functions[] = { - {0, &ISslConnection::SetSocketDescriptor, "SetSocketDescriptor"}, - {1, &ISslConnection::SetHostName, "SetHostName"}, - {2, &ISslConnection::SetVerifyOption, "SetVerifyOption"}, - {3, &ISslConnection::SetIoMode, "SetIoMode"}, - {4, nullptr, "GetSocketDescriptor"}, - {5, nullptr, "GetHostName"}, + {0, D<&ISslConnection::SetSocketDescriptor>, "SetSocketDescriptor"}, + {1, D<&ISslConnection::SetHostName>, "SetHostName"}, + {2, D<&ISslConnection::SetVerifyOption>, "SetVerifyOption"}, + {3, D<&ISslConnection::SetIoMode>, "SetIoMode"}, + {4, D<&ISslConnection::GetSocketDescriptor>, "GetSocketDescriptor"}, + {5, D<&ISslConnection::GetHostName>, "GetHostName"}, {6, nullptr, "GetVerifyOption"}, - {7, nullptr, "GetIoMode"}, - {8, &ISslConnection::DoHandshake, "DoHandshake"}, + {7, D<&ISslConnection::GetIoMode>, "GetIoMode"}, + {8, D<&ISslConnection::DoHandshake>, "DoHandshake"}, {9, &ISslConnection::DoHandshakeGetServerCert, "DoHandshakeGetServerCert"}, - {10, &ISslConnection::Read, "Read"}, - {11, &ISslConnection::Write, "Write"}, - {12, &ISslConnection::Pending, "Pending"}, - {13, nullptr, "Peek"}, - {14, nullptr, "Poll"}, - {15, nullptr, "GetVerifyCertError"}, - {16, nullptr, "GetNeededServerCertBufferSize"}, - {17, &ISslConnection::SetSessionCacheMode, "SetSessionCacheMode"}, - {18, nullptr, "GetSessionCacheMode"}, - {19, nullptr, "FlushSessionCache"}, - {20, nullptr, "SetRenegotiationMode"}, - {21, nullptr, "GetRenegotiationMode"}, - {22, &ISslConnection::SetOption, "SetOption"}, - {23, &ISslConnection::GetOption, "GetOption"}, + {10, D<&ISslConnection::Read>, "Read"}, + {11, D<&ISslConnection::Write>, "Write"}, + {12, D<&ISslConnection::Pending>, "Pending"}, + {13, D<&ISslConnection::Peek>, "Peek"}, + {14, D<&ISslConnection::Poll>, "Poll"}, + {15, D<&ISslConnection::GetVerifyCertError>, "GetVerifyCertError"}, + {16, D<&ISslConnection::GetNeededServerCertBufferSize>, "GetNeededServerCertBufferSize"}, + {17, D<&ISslConnection::SetSessionCacheMode>, "SetSessionCacheMode"}, + {18, D<&ISslConnection::GetSessionCacheMode>, "GetSessionCacheMode"}, + {19, D<&ISslConnection::FlushSessionCache>, "FlushSessionCache"}, + {20, D<&ISslConnection::SetRenegotiationMode>, "SetRenegotiationMode"}, + {21, D<&ISslConnection::GetRenegotiationMode>, "GetRenegotiationMode"}, + {22, D<&ISslConnection::SetOption>, "SetOption"}, + {23, D<&ISslConnection::GetOption>, "GetOption"}, {24, nullptr, "GetVerifyCertErrors"}, {25, nullptr, "GetCipherInfo"}, - {26, &ISslConnection::SetNextAlpnProto, "SetNextAlpnProto"}, - {27, &ISslConnection::GetNextAlpnProto, "GetNextAlpnProto"}, + {26, D<&ISslConnection::SetNextAlpnProto>, "SetNextAlpnProto"}, + {27, D<&ISslConnection::GetNextAlpnProto>, "GetNextAlpnProto"}, {28, nullptr, "SetDtlsSocketDescriptor"}, {29, nullptr, "GetDtlsHandshakeTimeout"}, {30, nullptr, "SetPrivateOption"}, @@ -141,80 +147,6 @@ public: } private: - SslVersion ssl_version; - std::shared_ptr shared_data; - std::unique_ptr backend; - std::optional fd_to_close; - bool do_not_close_socket = false; - bool get_server_cert_chain = false; - bool skip_default_verify = false; - bool enable_alpn = false; - std::shared_ptr socket; - std::vector next_alpn_proto; - bool did_handshake = false; - u32 verify_option = 0; - - Result SetSocketDescriptorImpl(s32* out_fd, s32 fd) { - LOG_DEBUG(Service_SSL, "called, fd={}", fd); - ASSERT(!did_handshake); - auto bsd = system.ServiceManager().GetService("bsd:u"); - ASSERT_OR_EXECUTE(bsd, { return ResultInternalError; }); - - auto const res_v = bsd->DuplicateSocketImpl(fd); - if (auto *res = std::get_if(&res_v)) { - const s32 duplicated_fd = *res; - if (do_not_close_socket) { - *out_fd = duplicated_fd; - } else { - *out_fd = -1; - fd_to_close = duplicated_fd; - } - std::optional> sock = bsd->GetSocket(duplicated_fd); - if (!sock.has_value()) { - LOG_ERROR(Service_SSL, "invalid socket fd {} after duplication", duplicated_fd); - return ResultInvalidSocket; - } - socket = std::move(*sock); - backend->SetSocket(socket); - return ResultSuccess; - } - LOG_ERROR(Service_SSL, "Failed to duplicate socket with fd {}", fd); - return ResultInvalidSocket; - } - - Result SetHostNameImpl(const std::string& hostname) { - LOG_DEBUG(Service_SSL, "called. hostname={}", hostname); - ASSERT(!did_handshake); - return backend->SetHostName(hostname); - } - - Result SetVerifyOptionImpl(u32 option) { - ASSERT(!did_handshake); - LOG_DEBUG(Service_SSL, "called. option={} (forcing 0)", option); - verify_option = 0; - backend->SetVerifyOption(0); - return ResultSuccess; - } - - Result SetIoModeImpl(u32 input_mode) { - auto mode = static_cast(input_mode); - ASSERT(mode == IoMode::Blocking || mode == IoMode::NonBlocking); - ASSERT_OR_EXECUTE(socket, { return ResultNoSocket; }); - - const bool non_block = mode == IoMode::NonBlocking; - const Network::Errno error = socket->SetNonBlock(non_block); - if (error != Network::Errno::SUCCESS) { - LOG_ERROR(Service_SSL, "Failed to set native socket non-block flag to {}", non_block); - } - return ResultSuccess; - } - - Result SetSessionCacheModeImpl(u32 mode) { - ASSERT(!did_handshake); - LOG_WARNING(Service_SSL, "(STUBBED) called. value={}", mode); - return ResultSuccess; - } - Result DoHandshakeImpl() { ASSERT_OR_EXECUTE(!did_handshake && socket, { return ResultNoSocket; }); Result res = backend->DoHandshake(); @@ -234,19 +166,17 @@ private: }; if (!get_server_cert_chain) { // Just return the first one, unencoded. - ASSERT_OR_EXECUTE_MSG( - !certs.empty(), { return {}; }, "Should be at least one server cert"); + ASSERT_OR_EXECUTE_MSG(!certs.empty(), { return {}; }, "Should be at least one server cert"); return certs[0]; } std::vector ret; - Header header{0x4E4D684374726543, static_cast(certs.size()), 0}; + Header header{0x4E4D684374726543, u32(certs.size()), 0}; ret.insert(ret.end(), reinterpret_cast(&header), reinterpret_cast(&header + 1)); size_t data_offset = sizeof(Header) + certs.size() * sizeof(EntryHeader); for (auto& cert : certs) { - EntryHeader entry_header{static_cast(cert.size()), static_cast(data_offset)}; + EntryHeader entry_header{u32(cert.size()), u32(data_offset)}; data_offset += cert.size(); - ret.insert(ret.end(), reinterpret_cast(&entry_header), - reinterpret_cast(&entry_header + 1)); + ret.insert(ret.end(), reinterpret_cast(&entry_header), reinterpret_cast(&entry_header + 1)); } for (auto& cert : certs) { ret.insert(ret.end(), cert.begin(), cert.end()); @@ -254,65 +184,77 @@ private: return ret; } - Result ReadImpl(std::vector* out_data) { - ASSERT_OR_EXECUTE(did_handshake, { return ResultInternalError; }); - size_t actual_size{}; - Result res = backend->Read(&actual_size, *out_data); - if (res != ResultSuccess) { - return res; + Result SetSocketDescriptor(s32 in_fd, Out out_fd) { + LOG_DEBUG(Service_SSL, "called, fd={}", in_fd); + ASSERT(!did_handshake); + auto bsd = system.ServiceManager().GetService("bsd:u"); + ASSERT_OR_EXECUTE(bsd, { return ResultInternalError; }); + + auto const res_v = bsd->DuplicateSocketImpl(in_fd); + if (auto *res = std::get_if(&res_v)) { + const s32 dup_fd = *res; + *out_fd = do_not_close_socket ? dup_fd : -1; + if (!do_not_close_socket) + fd_to_close = dup_fd; + auto const sock = bsd->GetSocket(dup_fd); + if (!sock.has_value()) { + LOG_ERROR(Service_SSL, "invalid socket fd {} after duplication", dup_fd); + return ResultInvalidSocket; + } + socket = std::move(*sock); + backend->SetSocket(std::move(socket)); + return ResultSuccess; } - out_data->resize(actual_size); - return res; + LOG_ERROR(Service_SSL, "Failed to duplicate socket with fd {}", in_fd); + return ResultInvalidSocket; } - Result WriteImpl(size_t* out_size, std::span data) { - ASSERT_OR_EXECUTE(did_handshake, { return ResultInternalError; }); - return backend->Write(out_size, data); + Result SetHostName(InBuffer buf) { + auto const hostname = Common::StringFromBuffer(buf); + LOG_DEBUG(Service_SSL, "called. hostname={}", hostname); + ASSERT(!did_handshake); + return backend->SetHostName(hostname.c_str()); } - Result PendingImpl(s32* out_pending) { - LOG_WARNING(Service_SSL, "(STUBBED) called."); - *out_pending = 0; - return ResultSuccess; + Result SetVerifyOption(u32 option) { + LOG_DEBUG(Service_SSL, "called. option={} (forcing 0)", option); + ASSERT(!did_handshake); + verify_option = 0; + backend->SetVerifyOption(0); + R_SUCCEED(); } - void SetSocketDescriptor(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const s32 in_fd = rp.Pop(); - s32 out_fd{-1}; - const Result res = SetSocketDescriptorImpl(&out_fd, in_fd); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(res); - rb.Push(out_fd); + Result SetIoMode(u32 input_mode) { + auto mode = IoMode(input_mode); + ASSERT(mode == IoMode::Blocking || mode == IoMode::NonBlocking); + R_UNLESS(socket, ResultNoSocket); + const bool non_block = mode == IoMode::NonBlocking; + const Network::Errno error = socket->SetNonBlock(non_block); + if (error != Network::Errno::SUCCESS) { + LOG_ERROR(Service_SSL, "Failed to set native socket non-block flag to {}", non_block); + } + R_SUCCEED(); } - void SetHostName(HLERequestContext& ctx) { - const std::string hostname = Common::StringFromBuffer(ctx.ReadBuffer()); - const Result res = SetHostNameImpl(hostname); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res); + Result GetSocketDescriptor(Out out_fd) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + *out_fd = socket->GetFD(); + R_SUCCEED(); } - void SetVerifyOption(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const u32 option = rp.Pop(); - const Result res = SetVerifyOptionImpl(option); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res); + Result GetHostName(OutBuffer data, Out out_size) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + ASSERT(!did_handshake); + return backend->GetHostName(std::span{data.begin(), data.end()}, out_size); } - void SetIoMode(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const u32 mode = rp.Pop(); - const Result res = SetIoModeImpl(mode); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res); + Result GetIoMode(Out out_mode) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + R_SUCCEED(); } - void DoHandshake(HLERequestContext& ctx) { - const Result res = DoHandshakeImpl(); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res); + Result DoHandshake() { + return DoHandshakeImpl(); } void DoHandshakeGetServerCert(HLERequestContext& ctx) { @@ -351,131 +293,158 @@ private: rb.PushRaw(out); } - void Read(HLERequestContext& ctx) { - std::vector output_bytes(ctx.GetWriteBufferSize()); - const Result res = ReadImpl(&output_bytes); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(res); - if (res == ResultSuccess) { - rb.Push(static_cast(output_bytes.size())); - ctx.WriteBuffer(output_bytes); - } else { - rb.Push(static_cast(0)); - } + Result Read(OutBuffer data, Out out_size) { + R_UNLESS(did_handshake, ResultInternalError); + size_t tmp{}; + auto const res = backend->Read(&tmp, data); + *out_size = u32(tmp); + return res; } - void Write(HLERequestContext& ctx) { - size_t write_size{0}; - const Result res = WriteImpl(&write_size, ctx.ReadBuffer()); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(res); - rb.Push(static_cast(write_size)); + Result Write(InBuffer data, Out out_size) { + R_UNLESS(did_handshake, ResultInternalError); + size_t tmp{}; + auto const res = backend->Write(&tmp, data); + *out_size = u32(tmp); + return res; } - void Pending(HLERequestContext& ctx) { - s32 pending_size{0}; - const Result res = PendingImpl(&pending_size); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(res); - rb.Push(pending_size); + Result Pending(Out out_pending_size) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + *out_pending_size = s32(backend->Pending()); + R_SUCCEED(); } - void SetSessionCacheMode(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const u32 mode = rp.Pop(); - const Result res = SetSessionCacheModeImpl(mode); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res); + Result Peek(OutBuffer data, Out out_size) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + size_t tmp{}; + auto const res = backend->Peek(&tmp, data); + *out_size = u32(tmp); + return res; } - void SetOption(HLERequestContext& ctx) { - struct Parameters { - OptionType option; - s32 value; - }; - static_assert(sizeof(Parameters) == 0x8, "Parameters is an invalid size"); - - IPC::RequestParser rp{ctx}; - const auto parameters = rp.PopRaw(); - - switch (parameters.option) { - case OptionType::DoNotCloseSocket: - do_not_close_socket = static_cast(parameters.value); - break; - case OptionType::GetServerCertChain: - get_server_cert_chain = static_cast(parameters.value); - break; - case OptionType::SkipDefaultVerify: - skip_default_verify = static_cast(parameters.value); - break; - case OptionType::EnableAlpn: - enable_alpn = static_cast(parameters.value); - break; - default: - LOG_WARNING(Service_SSL, "Unknown option={}, value={}", parameters.option, - parameters.value); - } - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); + Result Poll(u32 in_pollevent, u32 timer, Out out_pollevent) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + R_SUCCEED(); } - void GetOption(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const auto option = rp.PopRaw(); + Result GetVerifyCertError() { + LOG_WARNING(Service_SSL, "(STUBBED)"); + R_SUCCEED(); + } - u8 value = 0; + Result GetNeededServerCertBufferSize(Out out_needed_buffer_size) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + R_SUCCEED(); + } + Result SetSessionCacheMode(u32 mode) { + LOG_WARNING(Service_SSL, "(STUBBED) called. value={}", mode); + R_UNLESS(!did_handshake, ResultInternalError); + R_SUCCEED(); + } + + Result GetSessionCacheMode(Out mode) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + R_UNLESS(!did_handshake, ResultInternalError); + R_SUCCEED(); + } + + Result FlushSessionCache() { + LOG_WARNING(Service_SSL, "(STUBBED)"); + R_UNLESS(!did_handshake, ResultInternalError); + R_SUCCEED(); + } + + Result SetRenegotiationMode(RenegotiationMode mode) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + backend->SetRenegotiationMode(u32(mode)); + R_SUCCEED(); + } + + Result GetRenegotiationMode(Out mode) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + u32 tmp{}; + auto const res = backend->GetRenegotiationMode(&tmp); + *mode = RenegotiationMode(tmp); + return res; + } + + Result SetOption(OptionType option, s32 value) { switch (option) { case OptionType::DoNotCloseSocket: - value = static_cast(do_not_close_socket); + do_not_close_socket = bool(value); break; case OptionType::GetServerCertChain: - value = static_cast(get_server_cert_chain); + get_server_cert_chain = bool(value); break; case OptionType::SkipDefaultVerify: - value = static_cast(skip_default_verify); + skip_default_verify = bool(value); break; case OptionType::EnableAlpn: - value = static_cast(enable_alpn); + enable_alpn = bool(value); break; default: - LOG_WARNING(Service_SSL, "Unknown option={}", option); - value = 0; + LOG_WARNING(Service_SSL, "Unknown option={}, value={}", option, value); + } + R_SUCCEED(); + } + + Result GetOption(OptionType option, Out value) { + switch (option) { + case OptionType::DoNotCloseSocket: + *value = u8(do_not_close_socket); + break; + case OptionType::GetServerCertChain: + *value = u8(get_server_cert_chain); + break; + case OptionType::SkipDefaultVerify: + *value = u8(skip_default_verify); + break; + case OptionType::EnableAlpn: + *value = u8(enable_alpn); + break; + default: + LOG_WARNING(Service_SSL, "Unknown option={}", u32(option)); + *value = 0; break; } - - LOG_DEBUG(Service_SSL, "GetOption called, option={}, ret value={}", option, value); - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(value); + LOG_DEBUG(Service_SSL, "GetOption called, option={}, ret value={}", u32(option), *value); + R_SUCCEED(); } - void SetNextAlpnProto(HLERequestContext& ctx) { - const auto data = ctx.ReadBuffer(0); - next_alpn_proto.assign(data.begin(), data.end()); - + Result SetNextAlpnProto(InBuffer data) { + auto const to_write = u32((std::min)(next_alpn_proto.size(), data.size())); + next_alpn_proto.assign(data.begin(), data.begin() + to_write); LOG_DEBUG(Service_SSL, "SetNextAlpnProto called, size={}", next_alpn_proto.size()); - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); + R_SUCCEED(); } - void GetNextAlpnProto(HLERequestContext& ctx) { - const size_t writable = ctx.GetWriteBufferSize(); - const size_t to_write = (std::min)(next_alpn_proto.size(), writable); - - if (to_write != 0) { - ctx.WriteBuffer(std::span(next_alpn_proto.data(), to_write)); - } - - LOG_DEBUG(Service_SSL, "GetNextAlpnProto called, size={}", to_write); - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(static_cast(to_write)); + Result GetNextAlpnProto(OutBuffer data, Out to_write) { + *to_write = u32((std::min)(next_alpn_proto.size(), data.size())); + next_alpn_proto.assign(data.begin(), data.begin() + *to_write); + LOG_DEBUG(Service_SSL, "GetNextAlpnProto called, size={}", *to_write); + R_SUCCEED(); } + + Result GetVerifyCertErrors(OutBuffer unk0, Out unk1, Out unk2) { + LOG_WARNING(Service_SSL, "(STUBBED)"); + R_SUCCEED(); + } + + SslVersion ssl_version; + std::shared_ptr shared_data; + std::unique_ptr backend; + std::optional fd_to_close; + std::shared_ptr socket; + std::vector next_alpn_proto; + u32 verify_option = 0; + + bool do_not_close_socket = false; + bool get_server_cert_chain = false; + bool skip_default_verify = false; + bool enable_alpn = false; + bool did_handshake = false; }; class ISslContext final : public ServiceFramework { @@ -492,7 +461,7 @@ public: {5, &ISslContext::ImportClientPki, "ImportClientPki"}, {6, nullptr, "RemoveServerPki"}, {7, nullptr, "RemoveClientPki"}, - {8, nullptr, "RegisterInternalPki"}, + {8, D<&ISslContext::RegisterInternalPki>, "RegisterInternalPki"}, {9, nullptr, "AddPolicyOid"}, {10, nullptr, "ImportCrl"}, {11, nullptr, "RemoveCrl"}, @@ -587,6 +556,11 @@ private: rb.Push(ResultSuccess); rb.Push(client_id); } + + Result RegisterInternalPki() { + LOG_WARNING(Service_SSL, "(STUBBED) called"); + R_SUCCEED(); + } }; class ISslService final : public ServiceFramework { diff --git a/src/core/hle/service/ssl/ssl_backend.h b/src/core/hle/service/ssl/ssl_backend.h index a3127342a2..ef6bf8f9de 100644 --- a/src/core/hle/service/ssl/ssl_backend.h +++ b/src/core/hle/service/ssl/ssl_backend.h @@ -36,12 +36,17 @@ class SSLConnectionBackend { public: virtual ~SSLConnectionBackend() {} virtual void SetSocket(std::shared_ptr socket) = 0; - virtual Result SetHostName(const std::string& hostname) = 0; virtual void SetVerifyOption(u32 option) = 0; virtual Result DoHandshake() = 0; virtual Result Read(size_t* out_size, std::span data) = 0; + virtual Result Peek(size_t* out_size, std::span data) = 0; virtual Result Write(size_t* out_size, std::span data) = 0; virtual Result GetServerCerts(std::vector>* out_certs) = 0; + virtual Result SetHostName(const char* hostname) = 0; + virtual Result GetHostName(std::span hostname, u32* out_size) = 0; + virtual int Pending() = 0; + virtual Result SetRenegotiationMode(u32 mode) = 0; + virtual Result GetRenegotiationMode(u32* mode) = 0; }; Result CreateSSLConnectionBackend(std::unique_ptr* out_backend); diff --git a/src/core/hle/service/ssl/ssl_backend_openssl.cpp b/src/core/hle/service/ssl/ssl_backend_openssl.cpp index f0e05266ba..435ada845d 100644 --- a/src/core/hle/service/ssl/ssl_backend_openssl.cpp +++ b/src/core/hle/service/ssl/ssl_backend_openssl.cpp @@ -157,18 +157,30 @@ public: socket = std::move(socket_in); } - Result SetHostName(const std::string& hostname) override { + Result SetHostName(const char* hostname) override { if (!skip_cert_verification) { - if (!SSL_set1_host(ssl, hostname.c_str())) { + if (!SSL_set1_host(ssl, hostname)) { LOG_ERROR(Service_SSL, "SSL_set1_host({}) failed", hostname); return CheckOpenSSLErrors(); } } - if (!SSL_set_tlsext_host_name(ssl, hostname.c_str())) { // hostname for SNI + if (!SSL_set_tlsext_host_name(ssl, hostname)) { // hostname for SNI LOG_ERROR(Service_SSL, "SSL_set_tlsext_host_name({}) failed", hostname); return CheckOpenSSLErrors(); } - return ResultSuccess; + R_SUCCEED(); + } + + Result GetHostName(std::span data, u32* out_size) override { + auto const peer_name = SSL_get0_peername(ssl); + if (peer_name == nullptr) { + LOG_ERROR(Service_SSL, "SSL_get0_peername()"); + return CheckOpenSSLErrors(); + } + auto const s = std::string{peer_name}; + *out_size = u32(s.size()); + std::memcpy(data.data(), s.data(), (std::min)(s.size(), data.size())); + R_SUCCEED(); } void SetVerifyOption(u32 option) override { @@ -213,6 +225,13 @@ public: return HandleReturn("SSL_read_ex", out_size, ret); } + Result Peek(size_t* out_size, std::span data) override { + auto const n = (std::min)(data.size(), *out_size); + const int ret = SSL_peek(ssl, data.data(), int(n)); + *out_size = n; + return HandleReturn("SSL_write_ex", out_size, ret); + } + Result Write(size_t* out_size, std::span data) override { const int ret = SSL_write_ex(ssl, data.data(), data.size(), out_size); return HandleReturn("SSL_write_ex", out_size, ret); @@ -263,7 +282,25 @@ public: out_certs->emplace_back(buf, buf + len); OPENSSL_free(buf); } - return ResultSuccess; + R_SUCCEED(); + } + + int Pending() override { + return SSL_pending(ssl); + } + + Result SetRenegotiationMode(u32 mode) override { + if (mode == 0) { + SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_RENEGOTIATION); + } else { + SSL_CTX_set_options(ssl_ctx, SSL_OP_ALLOW_CLIENT_RENEGOTIATION); + } + R_SUCCEED(); + } + + Result GetRenegotiationMode(u32* mode) override { + *mode = SSL_get_secure_renegotiation_support(ssl) ? 1 : 0; + R_SUCCEED(); } ~SSLConnectionBackendOpenSSL() { From f7b8ade40ec28b35309de0f86391ee7507affa36 Mon Sep 17 00:00:00 2001 From: lizzie Date: Thu, 17 Sep 2026 05:45:37 +0200 Subject: [PATCH 012/198] [hle] stpl:sys, stpl:u initial implementation (#4435) These cmds are hardcoded to use 0x20b, also the vftable is the same for `nn::sf::hipc`. Streamplay is probably not gonna be implemented fully, but some future updates *may* hang when querying for the service, thus registering it at once will avoid such issues. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4435 Reviewed-by: MaranBr Reviewed-by: CamilleLaVey --- src/core/hle/service/acc/profile_manager.h | 6 + .../hle/service/filesystem/fsp/fsp_srv.cpp | 3 + src/core/hle/service/ipc_helpers.h | 1 + src/core/hle/service/ngc/ngc.cpp | 117 ++++++++++++++++++ 4 files changed, 127 insertions(+) diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h index 1fd0cc700f..81688175c2 100644 --- a/src/core/hle/service/acc/profile_manager.h +++ b/src/core/hle/service/acc/profile_manager.h @@ -23,6 +23,12 @@ constexpr std::size_t profile_username_size{32}; using ProfileUsername = std::array; using UserIDArray = std::array; +// This is nn::account::Uid +struct Uid { + std::array unk0; +}; +static_assert(sizeof(Uid) == 0x10); + /// Contains extra data related to a user. /// TODO: RE this structure struct UserData { diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index 7d270b7b6f..58303a0bd6 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp @@ -154,6 +154,9 @@ FSP_SRV::FSP_SRV(Core::System& system_) {720, nullptr, "AbandonAccessFailure"}, {800, nullptr, "GetAndClearFileSystemProxyErrorInfo"}, {810, nullptr, "RegisterProgramIndexMapInfo"}, + {820, nullptr, "GetContentStorageInfoIndex"}, + {830, nullptr, "EncryptStreamPlaySaveData"}, + {831, nullptr, "DecryptStreamPlaySaveData"}, {1000, nullptr, "SetBisRootForHost"}, {1001, nullptr, "SetSaveDataSize"}, {1002, nullptr, "SetSaveDataRootPath"}, diff --git a/src/core/hle/service/ipc_helpers.h b/src/core/hle/service/ipc_helpers.h index 67eef7a087..a266b1a05c 100644 --- a/src/core/hle/service/ipc_helpers.h +++ b/src/core/hle/service/ipc_helpers.h @@ -22,6 +22,7 @@ namespace IPC { +constexpr Result ResultNotSupported{ErrorModule::HIPC, 1}; constexpr Result ResultSessionClosed{ErrorModule::HIPC, 301}; struct ResponseBuilder { diff --git a/src/core/hle/service/ngc/ngc.cpp b/src/core/hle/service/ngc/ngc.cpp index 06310145e5..e79108a1eb 100644 --- a/src/core/hle/service/ngc/ngc.cpp +++ b/src/core/hle/service/ngc/ngc.cpp @@ -6,10 +6,16 @@ #include "common/string_util.h" #include "core/core.h" +#include "core/hle/kernel/k_client_session.h" +#include "core/hle/result.h" +#include "core/hle/service/acc/profile_manager.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/ngc/ngc.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" +#include "frontend_common/firmware_manager.h" namespace Service::NGC { @@ -166,12 +172,123 @@ public: } }; +struct SaveDataHandle { + u64 unk0; +}; +static_assert(sizeof(SaveDataHandle) == 0x08); + +class IUserShimScopedObject final : public ServiceFramework { +public: + explicit IUserShimScopedObject(Core::System& system_) : ServiceFramework(system_, "IUserShimScopedObject") { + // clang-format off + static const FunctionInfo functions[] = { + {450, nullptr, "InitializeForSaveData"}, + {451, nullptr, "FinalizeForSaveData"}, + {452, D<&IUserShimScopedObject::OpenSaveData>, "OpenSaveData"}, + {453, nullptr, "CloseSaveData"}, + {454, D<&IUserShimScopedObject::ReadSaveSlot>, "ReadSaveSlot"}, + {455, D<&IUserShimScopedObject::WriteSaveSlot>, "WriteSaveSlot"}, + {456, nullptr, "FlushSaveSlot"}, + {457, nullptr, "CommitSaveData"}, + }; + // clang-format on + RegisterHandlers(functions); + } + + Result OpenSaveData(Account::Uid unk0, Out unk1) { + LOG_WARNING(Service_NGC, "stubbed"); + R_THROW(IPC::ResultNotSupported); + } + + Result ReadSaveSlot(s32 offset, SaveDataHandle handle, OutBuffer out_data, Out out_size) { + LOG_WARNING(Service_NGC, "stubbed"); + R_THROW(IPC::ResultNotSupported); + } + + Result WriteSaveSlot(s32 offset, SaveDataHandle handle, InBuffer out_data) { + LOG_WARNING(Service_NGC, "stubbed"); + // to implement + R_SUCCEED(); + } +}; + +class IUserService final : public ServiceFramework { +public: + explicit IUserService(Core::System& system_) : ServiceFramework(system_, "stpl:u") { + // clang-format off + static const FunctionInfo functions[] = { + {0 , D<&IUserService::Cmd0>, "Cmd0"}, + }; + // clang-format on + RegisterHandlers(functions); + } + Result Cmd0(u32 unk0, OutInterface out_interface) { + LOG_WARNING(Service_NGC, "stubbed"); + *out_interface = std::make_shared(system); + R_SUCCEED(); + } +}; + +class ISystemShimScopedObject final : public ServiceFramework { +public: + explicit ISystemShimScopedObject(Core::System& system_) : ServiceFramework(system_, "ISystemShimScopedObject") { + // clang-format off + static const FunctionInfo functions[] = { + {106, nullptr, "Cmd106"}, + {107, nullptr, "Cmd107"}, + {108, D<&ISystemShimScopedObject::Cmd108>, "Cmd108"}, + {207, nullptr, "Cmd207"}, + {208, D<&ISystemShimScopedObject::Cmd208>, "Cmd208"}, + {209, nullptr, "Cmd209"}, + {210, nullptr, "Cmd210"}, + {211, nullptr, "Cmd211"}, + {212, nullptr, "Cmd212"}, + }; + // clang-format on + RegisterHandlers(functions); + } + + Result Cmd108() { + LOG_WARNING(Service_NGC, "stubbed"); + R_THROW(IPC::ResultNotSupported); + } + + Result Cmd208(Out> unk0) { + LOG_WARNING(Service_NGC, "stubbed"); + R_THROW(IPC::ResultNotSupported); + } +}; + +class ISystemService final : public ServiceFramework { +public: + explicit ISystemService(Core::System& system_) : ServiceFramework(system_, "stpl:sys") { + // clang-format off + static const FunctionInfo functions[] = { + {0 , D<&ISystemService::Cmd0>, "Cmd0"}, + }; + // clang-format on + RegisterHandlers(functions); + } + Result Cmd0(OutInterface out_interface) { + LOG_WARNING(Service_NGC, "stubbed"); + *out_interface = std::make_shared(system); + R_SUCCEED(); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); server_manager->RegisterNamedService("ngct:u", std::make_shared(system), 4); server_manager->RegisterNamedService("ngct:s", std::make_shared(system), 4); server_manager->RegisterNamedService("ngc:u", std::make_shared(system), 4); + + // +23.0.0 + if (FirmwareManager::GetFirmwareVersion(system).first.major >= 23) { + server_manager->RegisterNamedService("stpl:u", std::make_shared(system), 4); + server_manager->RegisterNamedService("stpl:sys", std::make_shared(system), 4); + } + ServerManager::RunServer(std::move(server_manager)); } From 73e004de6eb530567b3022531c11b92f55f265a6 Mon Sep 17 00:00:00 2001 From: lizzie Date: Thu, 17 Sep 2026 05:51:23 +0200 Subject: [PATCH 013/198] [common/page_table] unmark non-constexpr functions (#4433) `std::atomic` member functions don't translate unto `constexpr`. Trivial change, fixes CI warning. Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4433 Reviewed-by: MaranBr Reviewed-by: CamilleLaVey --- src/common/page_table.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/page_table.h b/src/common/page_table.h index 1588eca616..a21fe5311b 100644 --- a/src/common/page_table.h +++ b/src/common/page_table.h @@ -96,15 +96,15 @@ struct PageTable { } /// Write page info atomically - constexpr void Store(bool marked, PageType type, u16 block, uintptr_t pointer) noexcept { + inline void Store(bool marked, PageType type, u16 block, uintptr_t pointer) noexcept { data_raw.store(std::bit_cast(Data{marked, type, block, pointer})); } - constexpr void MarkRasterizerCached() noexcept { + inline void MarkRasterizerCached() noexcept { data_raw.fetch_or(0b111); } - constexpr void MarkDebug(u64 ptr, u16 block) noexcept { + inline void MarkDebug(u64 ptr, u16 block) noexcept { Store(true, PageType::DebugMemory, block, ptr); } From 6374f7f51f0254358fc26a0b3a182f06a9d84ec9 Mon Sep 17 00:00:00 2001 From: lizzie Date: Thu, 17 Sep 2026 05:52:36 +0200 Subject: [PATCH 014/198] Partial revert: [dynarmic] fix sign extension and optimize vaddr lookups for 64bit on x64 systems (#4446) (#4448) Breaks Mario Kart 8 Deluxe. #4446 Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4448 Reviewed-by: MaranBr Reviewed-by: CamilleLaVey --- src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h index b78c14f6b7..d072b9963d 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h @@ -184,8 +184,8 @@ template<> } // check for sign bit, apply sign extension as needed if (ctx.conf.page_table_sign_extension) { - code.shl(page, 63 - int(*ctx.conf.page_table_sign_extension)); - code.sar(page, 63 - int(*ctx.conf.page_table_sign_extension)); + code.shl(page, *ctx.conf.page_table_sign_extension); + code.sar(page, *ctx.conf.page_table_sign_extension); } code.jz(abort, code.T_NEAR); From 14235dc0d0543c7397dd19eb1a677e76114c08f3 Mon Sep 17 00:00:00 2001 From: lizzie Date: Thu, 17 Sep 2026 08:15:58 +0200 Subject: [PATCH 015/198] [ips] fix .pchtxt with >256 bytes on a single line (#4445) It wasn't correct to assume pchtxt would've been less than 256 bytes per line. Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4445 Reviewed-by: Maufeat Reviewed-by: CamilleLaVey --- src/core/file_sys/ips_layer.cpp | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index 9d46549bf0..5a0ddb44f8 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp @@ -100,8 +100,7 @@ VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips) { struct IPSwitchRecord { - std::array data; - size_t count; + std::vector data; }; struct IPSwitchCompiler::IPSwitchPatch { ::Common::unordered_map records; @@ -122,22 +121,23 @@ static IPSwitchRecord EscapeStringSequences(std::string_view sv) { IPSwitchRecord r{}; for (auto it = sv.cbegin(); it < sv.cend(); ) { if (*it == '\\' && it + 1 < sv.cend()) { - switch (it[1]) { - case 'a': r.data[r.count] = '\a'; break; - case 'b': r.data[r.count] = '\b'; break; - case 'e': r.data[r.count] = '\e'; break; - case 'f': r.data[r.count] = '\f'; break; - case 'n': r.data[r.count] = '\n'; break; - case 'r': r.data[r.count] = '\r'; break; - case 't': r.data[r.count] = '\t'; break; - case 'v': r.data[r.count] = '\v'; break; - case '?': r.data[r.count] = '\?'; break; - default: r.data[r.count] = it[1]; break; - } - ++r.count; + r.data.push_back([it]() { + switch (it[1]) { + case 'a': return '\a'; + case 'b': return '\b'; + case 'e': return '\e'; + case 'f': return '\f'; + case 'n': return '\n'; + case 'r': return '\r'; + case 't': return '\t'; + case 'v': return '\v'; + case '?': return '\?'; + default: return it[1]; + } + }()); it += 2; } else { - ++r.count; + r.data.push_back(*it); ++it; } } @@ -223,8 +223,8 @@ void IPSwitchCompiler::Parse(std::span bytes) { if (start <= line.cend() && end <= line.cend()) { // Actually IPS wants ordering from {lsb, ..., msb} -- so LE and BE are inverted, fun! auto const hs = Common::HexStringToVector({start, end}, is_little_endian); + r.data.resize(hs.size()); std::memcpy(r.data.data(), hs.data(), hs.size()); - r.count = hs.size(); LOG_INFO(Loader, "[H] value @ {:#08X}", offset); patches.back().records.insert_or_assign(u32(offset), std::move(r)); } else { @@ -293,7 +293,7 @@ VirtualFile IPSwitchCompiler::Apply(const VirtualFile& in) const { if (patch.enabled) { for (const auto& record : patch.records) { if (record.first < in_data.size()) { - auto replace_size = record.second.count; + auto replace_size = record.second.data.size(); if (record.first + replace_size > in_data.size()) replace_size = in_data.size() - record.first; std::memcpy(in_data.data() + record.first, record.second.data.data(), replace_size); From 1203082a8f1211ad6ce4d95f0c6947f7ecd27a55 Mon Sep 17 00:00:00 2001 From: lizzie Date: Thu, 17 Sep 2026 08:16:18 +0200 Subject: [PATCH 016/198] [msvc] fix build errors (#4451) MSVC doesn't consider atomic to be trivially copyable on x86 (why?). And other chary idiosyncrasies from constructing `std::optional` Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4451 Reviewed-by: Maufeat Reviewed-by: CamilleLaVey --- src/common/sparse_large_vector.h | 3 ++- src/core/arm/dynarmic/arm_dynarmic_32.cpp | 4 ++-- src/core/arm/dynarmic/arm_dynarmic_64.cpp | 4 ++-- src/core/hle/service/ssl/ssl.cpp | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/common/sparse_large_vector.h b/src/common/sparse_large_vector.h index 827944fb08..dad3aea97e 100644 --- a/src/common/sparse_large_vector.h +++ b/src/common/sparse_large_vector.h @@ -38,7 +38,8 @@ void FreeMemoryPages(void* base, std::size_t size) noexcept; /// A large page-aligned buffer that has optimized memory usage for zero-writes. template -requires std::is_trivially_copyable_v + // MSVC doesn't regard structs with atomics as trivially copyable + // requires std::is_trivially_copyable_v class SparseLargeVector final { public: constexpr SparseLargeVector() = default; diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 80e2b2dca9..8be0abc4fa 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp @@ -177,7 +177,7 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) { config.page_table = reinterpret_cast*>( const_cast(page_table->entries.data())); config.page_table_pointer_mask = Common::PageTable::ATTRIBUTE_MASK; - config.page_table_marked_bit = 0; + config.page_table_marked_bit = uint8_t(0); config.absolute_offset_page_table = true; config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; config.only_detect_misalignment_via_page_table_on_page_boundary = true; @@ -193,7 +193,7 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) { Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize()) < (1ULL << 39)) { // Systems like FreeBSD allocate memory really low by default, and since we pack our page table entries, // we have to manually sign extend when our actual pointer is negative. - config.page_table_sign_extension = Common::PageTable::SIGN_BIT; + config.page_table_sign_extension = std::uint8_t(Common::PageTable::SIGN_BIT); } } diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 9662bf1712..9db40b9356 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp @@ -216,7 +216,7 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s const_cast(page_table->entries.data())); config.page_table_address_space_bits = std::uint32_t(address_space_bits); config.page_table_pointer_mask = Common::PageTable::ATTRIBUTE_MASK; - config.page_table_marked_bit = 0; + config.page_table_marked_bit = uint8_t(0); config.silently_mirror_page_table = false; config.absolute_offset_page_table = true; config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; @@ -235,7 +235,7 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize()) < (1ULL << 39)) { // Systems like FreeBSD allocate memory really low by default, and since we pack our page table entries, // we have to manually sign extend when our actual pointer is negative. - config.page_table_sign_extension = Common::PageTable::SIGN_BIT; + config.page_table_sign_extension = std::uint8_t(Common::PageTable::SIGN_BIT); } } diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 178c4c690b..999efd4295 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -238,7 +238,7 @@ private: Result GetSocketDescriptor(Out out_fd) { LOG_WARNING(Service_SSL, "(STUBBED)"); - *out_fd = socket->GetFD(); + *out_fd = uint32_t(socket->GetFD()); R_SUCCEED(); } From 0ce29be60874b24890ab9239cecf1bd67b924428 Mon Sep 17 00:00:00 2001 From: Feng Chen Date: Thu, 17 Sep 2026 19:50:19 +0200 Subject: [PATCH 017/198] [common] Fix RDTSC nanosecond conversion (#4422) Split the RDTSC ticks-per-nanosecond ratio into integer and Q0.64 fractional components. This avoids overflowing GetFixedPoint64Factor for TSC frequencies above 1 GHz while preserving the multiply-only conversion path. Use the invariant clock only above 1 GHz because the reverse nanoseconds-per-tick factor cannot represent an exact ratio of one. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4422 Reviewed-by: lizzie Reviewed-by: MaranBr --- src/common/cpu_features.cpp | 7 ++++--- src/common/cpu_features.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/cpu_features.cpp b/src/common/cpu_features.cpp index 2e02c47826..8ccb6847f7 100644 --- a/src/common/cpu_features.cpp +++ b/src/common/cpu_features.cpp @@ -244,7 +244,8 @@ WallClock::WallClock(bool invariant_, u64 rdtsc_frequency_) noexcept , ns_rdtsc_factor{invariant_ ? GetFixedPoint64Factor(NsRatio::den, rdtsc_frequency_) : 0} , us_rdtsc_factor{invariant_ ? GetFixedPoint64Factor(UsRatio::den, rdtsc_frequency_) : 0} , ms_rdtsc_factor{invariant_ ? GetFixedPoint64Factor(MsRatio::den, rdtsc_frequency_) : 0} - , rdtsc_ns_factor{invariant_ ? GetFixedPoint64Factor(rdtsc_frequency_, NsRatio::den) : 1} + , rdtsc_ns_integer{invariant_ ? rdtsc_frequency_ / NsRatio::den : 1} + , rdtsc_ns_factor{invariant_ ? GetFixedPoint64Factor(rdtsc_frequency_ % NsRatio::den, NsRatio::den) : 0} , cntpct_rdtsc_factor{invariant_ ? GetFixedPoint64Factor(CNTFRQ, rdtsc_frequency_) : 0} , gputick_rdtsc_factor{invariant_ ? GetFixedPoint64Factor(GPUTickFreq, rdtsc_frequency_) : 0} , invariant{invariant_} @@ -291,7 +292,7 @@ bool WallClock::IsNative() const { } u64 WallClock::NsToTicks(std::chrono::nanoseconds ns) const { - return invariant ? MultiplyHigh(ns.count(), rdtsc_ns_factor) : ns.count(); + return ns.count() * rdtsc_ns_integer + MultiplyHigh(ns.count(), rdtsc_ns_factor); } #elif defined(HAS_NCE) namespace { @@ -416,7 +417,7 @@ u64 WallClock::NsToTicks(std::chrono::nanoseconds ns) const { const WallClock g_wall_clock = [] { #if defined(ARCHITECTURE_x86_64) auto const& caps = Common::g_cpu_caps; - return WallClock(caps.invariant_tsc && caps.tsc_frequency >= std::nano::den, caps.tsc_frequency); + return WallClock(caps.invariant_tsc && caps.tsc_frequency > std::nano::den, caps.tsc_frequency); #elif defined(HAS_NCE) return WallClock(false, 1); #else diff --git a/src/common/cpu_features.h b/src/common/cpu_features.h index 7dcb550f8f..61aa2767ab 100644 --- a/src/common/cpu_features.h +++ b/src/common/cpu_features.h @@ -96,6 +96,7 @@ public: u64 ns_rdtsc_factor; u64 us_rdtsc_factor; u64 ms_rdtsc_factor; + u64 rdtsc_ns_integer; u64 rdtsc_ns_factor; u64 cntpct_rdtsc_factor; u64 gputick_rdtsc_factor; From 3c38afad74c751a949de0bcca9a51cfc11797f68 Mon Sep 17 00:00:00 2001 From: xbzk Date: Fri, 18 Sep 2026 23:48:35 +0200 Subject: [PATCH 018/198] [fs] share parent resources with bundled programs (#4319) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Normal games are Applications; Bundled games are Application + Programs; We've been treating both as the same thing, calling both programs, and making programs unable to see settings and saves from application. References: https://switchbrew.org/wiki/Filesystem_services https://switchbrew.org/wiki/NCM_services#ApplicationId https://switchbrew.org/wiki/Super_Mario_3D_All-Stars Ryujinx.HLE/HOS/ApplicationLoader.cs:GetMultiProgramInfo UPDATE: The first version was a big rework to make AppId/ProgId concepts proper, and it was successful in most tests, but it caused a regression with applets, which are programs that breed straight from no application. In order to simplify things i've reverted all the rework, added a helper to identify whether a program has a parent Application and bounded it to it's proper stores. Although this is no big deal coz it doesn't have impact on emulation, it permeates to several routines, so it needs to be tested broadly. Applets, Normal games, Bundled games, Blobbed NSPs/XCIs, Mods, Updates, Saves, DLCs,. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4319 Reviewed-by: MaranBr Reviewed-by: lizzie --- src/core/file_sys/patch_manager.cpp | 68 +++++++++++++++++++------- src/core/file_sys/patch_manager.h | 4 ++ src/core/file_sys/registered_cache.cpp | 17 +++++++ src/core/file_sys/registered_cache.h | 2 + src/core/file_sys/savedata_factory.cpp | 22 ++++++--- src/core/file_sys/savedata_factory.h | 4 ++ 6 files changed, 91 insertions(+), 26 deletions(-) diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index ada8c44e78..4fd7dc6c71 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -9,6 +9,7 @@ #include #include +#include "common/assert.h" #include "common/hex_util.h" #include "common/logging.h" #include "common/settings.h" @@ -156,12 +157,15 @@ std::string GetUpdateVersionStringFromSlot(const ContentProvider* provider, u64 NACP nacp{nacp_file}; return nacp.GetVersionString(); } +YUZU_NO_INLINE std::optional GetParentApplicationId(const ContentProvider* provider, u64 title_id) { + return provider == nullptr ? std::nullopt : provider->GetParentApplicationId(title_id); +} } // Anonymous namespace PatchManager::PatchManager(u64 title_id_, const Service::FileSystem::FileSystemController& fs_controller_, const ContentProvider& content_provider_) - : title_id{title_id_}, fs_controller{fs_controller_}, content_provider{content_provider_} {} + : title_id{title_id_}, parent_title_id{GetParentApplicationId(std::addressof(content_provider_), title_id_)}, fs_controller{fs_controller_}, content_provider{content_provider_} {} PatchManager::~PatchManager() = default; @@ -169,13 +173,35 @@ u64 PatchManager::GetTitleID() const { return title_id; } +VirtualDir PatchManager::GetModificationLoadRoot(bool sdmc) const { + const auto get_root = [&](u64 id) { + return sdmc ? fs_controller.GetSDMCModificationLoadRoot(id) : fs_controller.GetModificationLoadRoot(id); + }; + auto root = get_root(title_id); + if (!parent_title_id) { + return root; + } + std::vector roots{std::move(root), get_root(*parent_title_id)}; + std::erase(roots, nullptr); + return LayeredVfsDirectory::MakeLayeredDirectory(std::move(roots)); +} + +std::vector PatchManager::GetDisabledAddons() const { + auto disabled = Settings::values.disabled_addons[title_id]; + if (parent_title_id) { + const auto& shared = Settings::values.disabled_addons[*parent_title_id]; + disabled.insert(disabled.end(), shared.begin(), shared.end()); + } + return disabled; +} + VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { LOG_INFO(Loader, "Patching ExeFS for title_id={:016X}", title_id); if (exefs == nullptr) return exefs; - const auto& disabled = Settings::values.disabled_addons[title_id]; + const auto disabled = GetDisabledAddons(); bool update_disabled = true; std::optional enabled_version; @@ -303,8 +329,8 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { } // LayeredExeFS - const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); - const auto sdmc_load_dir = fs_controller.GetSDMCModificationLoadRoot(title_id); + const auto load_dir = GetModificationLoadRoot(); + const auto sdmc_load_dir = GetModificationLoadRoot(true); std::vector patch_dirs = {sdmc_load_dir}; if (load_dir != nullptr) { @@ -346,7 +372,7 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { } std::vector PatchManager::CollectPatches(const std::vector& patch_dirs, const std::string& build_id) const { - const auto& disabled = Settings::values.disabled_addons[title_id]; + const auto disabled = GetDisabledAddons(); const auto nso_build_id = fmt::format("{:0<64}", build_id); std::vector out; @@ -405,7 +431,7 @@ std::vector PatchManager::PatchNSO(const std::vector& nso, const std::st LOG_INFO(Loader, "Patching NSO for name={}, build_id={}", name, build_id); - const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); + const auto load_dir = GetModificationLoadRoot(); if (load_dir == nullptr) { LOG_ERROR(Loader, "Cannot load mods for invalid title_id={:016X}", title_id); return nso; @@ -448,7 +474,7 @@ bool PatchManager::HasNSOPatch(const BuildID& build_id_, std::string_view name) LOG_INFO(Loader, "Querying NSO patch existence for build_id={}, name={}", build_id, name); - const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); + const auto load_dir = GetModificationLoadRoot(); if (load_dir == nullptr) { LOG_ERROR(Loader, "Cannot load mods for invalid title_id={:016X}", title_id); return false; @@ -462,13 +488,13 @@ bool PatchManager::HasNSOPatch(const BuildID& build_id_, std::string_view name) } std::vector PatchManager::CreateCheatList(const BuildID& build_id_) const { - const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); + const auto load_dir = GetModificationLoadRoot(); if (load_dir == nullptr) { LOG_ERROR(Loader, "Cannot load mods for invalid title_id={:016X}", title_id); return {}; } - const auto& disabled = Settings::values.disabled_addons[title_id]; + const auto disabled = GetDisabledAddons(); auto patch_dirs = load_dir->GetSubdirectories(); std::sort(patch_dirs.begin(), patch_dirs.end(), [](auto const& l, auto const& r) { return l->GetName() < r->GetName(); }); @@ -502,17 +528,16 @@ std::vector PatchManager::CreateCheatList(const BuildI return out; } -static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType type, - const Service::FileSystem::FileSystemController& fs_controller) { - const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); - const auto sdmc_load_dir = fs_controller.GetSDMCModificationLoadRoot(title_id); +void PatchManager::ApplyLayeredFS(VirtualFile& romfs, ContentRecordType type) const { + const auto load_dir = GetModificationLoadRoot(); + const auto sdmc_load_dir = GetModificationLoadRoot(true); if ((type != ContentRecordType::Program && type != ContentRecordType::Data && type != ContentRecordType::HtmlDocument) || (load_dir == nullptr && sdmc_load_dir == nullptr)) { return; } - const auto& disabled = Settings::values.disabled_addons[title_id]; + const auto disabled = GetDisabledAddons(); std::vector patch_dirs = load_dir->GetSubdirectories(); if (std::find(disabled.cbegin(), disabled.cend(), "SDMC") == disabled.cend()) { patch_dirs.push_back(sdmc_load_dir); @@ -591,7 +616,7 @@ VirtualFile PatchManager::PatchRomFS(const NCA* base_nca, VirtualFile base_romfs // Game Updates const auto update_tid = GetUpdateTitleID(title_id); - const auto& disabled = Settings::values.disabled_addons[title_id]; + const auto disabled = GetDisabledAddons(); bool update_disabled = true; std::optional enabled_version; @@ -698,7 +723,7 @@ VirtualFile PatchManager::PatchRomFS(const NCA* base_nca, VirtualFile base_romfs // LayeredFS if (apply_layeredfs) { - ApplyLayeredFS(romfs, title_id, type, fs_controller); + ApplyLayeredFS(romfs, type); } return romfs; @@ -1072,15 +1097,22 @@ std::vector PatchManager::GetPatches(VirtualFile update_raw) const { std::optional PatchManager::GetGameVersion() const { const auto update_tid = GetUpdateTitleID(title_id); if (content_provider.HasEntry(update_tid, ContentRecordType::Program)) { - return content_provider.GetEntryVersion(update_tid); + const auto version = content_provider.GetEntryVersion(update_tid); + return version || !parent_title_id ? version : content_provider.GetEntryVersion(GetUpdateTitleID(*parent_title_id)); } - return content_provider.GetEntryVersion(title_id); + const auto version = content_provider.GetEntryVersion(title_id); + return version || !parent_title_id ? version : content_provider.GetEntryVersion(*parent_title_id); } PatchManager::Metadata PatchManager::GetControlMetadata() const { const auto base_control_nca = content_provider.GetEntry(title_id, ContentRecordType::Control); if (base_control_nca == nullptr) { + if (parent_title_id) { + const auto control_id = content_provider.HasEntry(*parent_title_id, ContentRecordType::Control) ? *parent_title_id : GetUpdateTitleID(*parent_title_id); + const PatchManager parent{control_id, fs_controller, content_provider}; + return parent.GetControlMetadata(); + } return {}; } diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h index 5d71dbcf20..6819a1a3e7 100644 --- a/src/core/file_sys/patch_manager.h +++ b/src/core/file_sys/patch_manager.h @@ -109,10 +109,14 @@ public: [[nodiscard]] static PatchManager::Metadata GetMetadataFromBaseOrUpdate(Core::System& system, u64 application_id) noexcept; private: + [[nodiscard]] VirtualDir GetModificationLoadRoot(bool sdmc = false) const; + [[nodiscard]] std::vector GetDisabledAddons() const; + void ApplyLayeredFS(VirtualFile& romfs, ContentRecordType type) const; [[nodiscard]] std::vector CollectPatches(const std::vector& patch_dirs, const std::string& build_id) const; u64 title_id; + std::optional parent_title_id; const Service::FileSystem::FileSystemController& fs_controller; const ContentProvider& content_provider; }; diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index ce851e4d38..1f430434f7 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include #include #include #include @@ -348,6 +349,22 @@ std::vector ContentProvider::ListEntries() const { return ListEntriesFilter(std::nullopt, std::nullopt, std::nullopt); } +std::optional ContentProvider::GetParentApplicationId(u64 program_id) const { + const auto application_id = GetBaseTitleID(program_id); + const auto program_index = program_id - application_id; + if (program_index == 0 || program_index > std::numeric_limits::max()) { + return std::nullopt; + } + if (!ListEntriesFilter(TitleType::Application, ContentRecordType::Meta, program_id).empty()) { + return std::nullopt; + } + if ((!ListEntriesFilter(TitleType::Application, ContentRecordType::Meta, application_id).empty() && HasEntry(program_id, ContentRecordType::Program)) + || (!ListEntriesFilter(TitleType::Update, ContentRecordType::Meta, GetUpdateTitleID(application_id)).empty() && HasEntry(GetUpdateTitleID(program_id), ContentRecordType::Program))) { + return application_id; + } + return std::nullopt; +} + PlaceholderCache::PlaceholderCache(VirtualDir dir_) : dir(std::move(dir_)) {} bool PlaceholderCache::Create(const NcaID& id, u64 size) const { diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index a8e60ad470..89140a2e95 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -100,6 +100,8 @@ public: std::optional title_type = {}, std::optional record_type = {}, std::optional title_id = {}) const = 0; + [[nodiscard]] std::optional GetParentApplicationId(u64 program_id) const; + protected: // A single instance of KeyManager to be used by GetEntry() Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index c756734a43..72f022cb41 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp @@ -9,6 +9,7 @@ #include "common/logging.h" #include "common/uuid.h" #include "core/core.h" +#include "core/file_sys/registered_cache.h" #include "core/file_sys/savedata_factory.h" #include "core/file_sys/vfs/vfs.h" @@ -61,17 +62,24 @@ SaveDataFactory::SaveDataFactory(Core::System& system_, ProgramId program_id_, SaveDataFactory::~SaveDataFactory() = default; +std::string SaveDataFactory::GetSaveDataPath(SaveDataSpaceId space, SaveDataType type, u64 title_id, u128 user_id, u64 save_id) const { + if (type == SaveDataType::Account || type == SaveDataType::Device) { + const auto requested_id = title_id != 0 ? title_id : program_id; + const auto parent_id = system.GetContentProvider().GetParentApplicationId(requested_id); + title_id = parent_id.value_or(requested_id); + } + return GetFullPath(program_id, dir, space, type, title_id, user_id, save_id); +} + VirtualDir SaveDataFactory::Create(SaveDataSpaceId space, const SaveDataAttribute& meta) const { - const auto save_directory = GetFullPath(program_id, dir, space, meta.type, meta.program_id, - meta.user_id, meta.system_save_data_id); + const auto save_directory = GetSaveDataPath(space, meta.type, meta.program_id, meta.user_id, meta.system_save_data_id); return dir->CreateDirectoryRelative(save_directory); } VirtualDir SaveDataFactory::Open(SaveDataSpaceId space, const SaveDataAttribute& meta) const { - const auto save_directory = GetFullPath(program_id, dir, space, meta.type, meta.program_id, - meta.user_id, meta.system_save_data_id); + const auto save_directory = GetSaveDataPath(space, meta.type, meta.program_id, meta.user_id, meta.system_save_data_id); auto out = dir->GetDirectoryRelative(save_directory); @@ -154,8 +162,7 @@ std::string SaveDataFactory::GetUserGameSaveDataRoot(u128 user_id, bool future) SaveDataSize SaveDataFactory::ReadSaveDataSize(SaveDataType type, u64 title_id, u128 user_id) const { - const auto path = - GetFullPath(program_id, dir, SaveDataSpaceId::User, type, title_id, user_id, 0); + const auto path = GetSaveDataPath(SaveDataSpaceId::User, type, title_id, user_id, 0); const auto relative_dir = GetOrCreateDirectoryRelative(dir, path); const auto size_file = relative_dir->GetFile(GetSaveDataSizeFileName()); @@ -173,8 +180,7 @@ SaveDataSize SaveDataFactory::ReadSaveDataSize(SaveDataType type, u64 title_id, void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, SaveDataSize new_value) const { - const auto path = - GetFullPath(program_id, dir, SaveDataSpaceId::User, type, title_id, user_id, 0); + const auto path = GetSaveDataPath(SaveDataSpaceId::User, type, title_id, user_id, 0); const auto relative_dir = GetOrCreateDirectoryRelative(dir, path); const auto size_file = relative_dir->CreateFile(GetSaveDataSizeFileName()); diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 15dd4ec7de..36c09ce2ac 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -47,6 +50,7 @@ public: void SetAutoCreate(bool state); private: + std::string GetSaveDataPath(SaveDataSpaceId space, SaveDataType type, u64 title_id, u128 user_id, u64 save_id) const; Core::System& system; ProgramId program_id; VirtualDir dir; From 07f40d5cac635ff102aa6ce9c32572cc20d69959 Mon Sep 17 00:00:00 2001 From: xbzk Date: Fri, 18 Sep 2026 23:49:17 +0200 Subject: [PATCH 019/198] [npad,hid,am] npad WriteEmptyEntry fix, hid function 551 stub, and applet PopOutData rework (#4442) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This was intended to fix Dave the Diver issue, but we found a real silly hid bug, then a maybe broader applet issue: By testing with John it was found out only the last controller connected worked, the others caused the game to freeze peacefully, no crashes, suggesting some loop or deadlock. After seeking that lead, it was found that the freeze was caused by a malformed HID history entry when the controller applet removed P2. Pressing P1 opens the controller applet, then Qt applet disconnects P2, which is expected. Upon seeking callstack and hid sync path, it was found out that NPad::WriteEmptyEntry: was using: ReadCurrentEntry().sampling_number + 1 instead of: ReadCurrentEntry().state.sampling_number + 1 (checked AtomicStorage in src\hid_core\resources\ring_lifo.h) Fixing that fixed the freeze, but killed the sound! Later handheld/docked was accidentally clicked and sound returned. Good lead. Then i just had to corner which part of the toggle was causing the refresh and do something similar at the controller applet return routine (PopOutData in library_applet_accessor.cpp). This part seems harmless, but i'm not clearly sure about how proper it is, since it was like a transplant and test operation. UPDATE: To try Diablo 3 on my machine it was needed to stub HID function 551. And to fix all abnormalies like multiple applet requests and crash the function PopOutData was reworked to ensurey idempotency among different applet focus conditions: focus state changed: updates state and signals if needed no state change, HLE application frontend: requests focus state changed notification already pending change message: flag remains true and no duplicate pushed to queue entry Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4442 Reviewed-by: MaranBr Reviewed-by: lizzie --- src/core/hle/service/am/lifecycle_manager.h | 7 +++++++ .../am/service/library_applet_accessor.cpp | 14 +++++++------- src/core/hle/service/hid/hid_system_server.cpp | 4 ++-- src/hid_core/resources/npad/npad.cpp | 16 ++++++++-------- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/core/hle/service/am/lifecycle_manager.h b/src/core/hle/service/am/lifecycle_manager.h index ae041d3e29..15657a36d8 100644 --- a/src/core/hle/service/am/lifecycle_manager.h +++ b/src/core/hle/service/am/lifecycle_manager.h @@ -92,6 +92,13 @@ public: } } + void RequestFocusStateChangedNotification(Kernel::KernelCore& kernel) { + if (m_focus_state_changed_notification_enabled) { + m_has_focus_state_changed = true; + this->SignalSystemEventIfNeeded(kernel); + } + } + void OnOperationAndPerformanceModeChanged(Kernel::KernelCore& kernel); public: diff --git a/src/core/hle/service/am/service/library_applet_accessor.cpp b/src/core/hle/service/am/service/library_applet_accessor.cpp index c49b1f3f05..849e5794cf 100644 --- a/src/core/hle/service/am/service/library_applet_accessor.cpp +++ b/src/core/hle/service/am/service/library_applet_accessor.cpp @@ -164,14 +164,14 @@ Result ILibraryAppletAccessor::PushInData(SharedPointer storage) { Result ILibraryAppletAccessor::PopOutData(Out> out_storage) { LOG_DEBUG(Service_AM, "called"); - if (auto caller_applet = m_applet->caller_applet.lock(); caller_applet) { - caller_applet->lifecycle_manager.GetSystemEvent().Signal(system.Kernel()); - caller_applet->lifecycle_manager.RequestResumeNotification(); - caller_applet->lifecycle_manager.GetSystemEvent().Clear(system.Kernel()); - caller_applet->lifecycle_manager.UpdateRequestedFocusState(); - } - R_TRY(m_broker->GetOutData().Pop(system.Kernel(), out_storage.Get())); + if (auto caller_applet = m_applet->caller_applet.lock(); caller_applet) { + std::scoped_lock lk{caller_applet->lock}; + const bool focus_state_changed = caller_applet->lifecycle_manager.UpdateRequestedFocusState(); + const bool is_front_app = m_applet->frontend && caller_applet->lifecycle_manager.IsApplication(); + if (focus_state_changed) caller_applet->lifecycle_manager.SignalSystemEventIfNeeded(system.Kernel()); + else if (is_front_app) caller_applet->lifecycle_manager.RequestFocusStateChangedNotification(system.Kernel()); + } if (m_applet->applet_id == AppletId::ProfileSelect && *out_storage) { auto impl = (*out_storage)->GetImpl(); diff --git a/src/core/hle/service/hid/hid_system_server.cpp b/src/core/hle/service/hid/hid_system_server.cpp index f3c01b5d89..e544adf03c 100644 --- a/src/core/hle/service/hid/hid_system_server.cpp +++ b/src/core/hle/service/hid/hid_system_server.cpp @@ -121,7 +121,7 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr data; diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp index e7a1ee2bf3..c67f839df1 100644 --- a/src/hid_core/resources/npad/npad.cpp +++ b/src/hid_core/resources/npad/npad.cpp @@ -398,21 +398,21 @@ void NPad::InitNewlyAddedController(Kernel::KernelCore& kernel, u64 aruid, Core: void NPad::WriteEmptyEntry(NpadInternalState* npad) { NPadGenericState dummy_pad_state{}; NpadGcTriggerState dummy_gc_state{}; - dummy_pad_state.sampling_number = npad->fullkey_lifo.ReadCurrentEntry().sampling_number + 1; + dummy_pad_state.sampling_number = npad->fullkey_lifo.ReadCurrentEntry().state.sampling_number + 1; npad->fullkey_lifo.WriteNextEntry(dummy_pad_state); - dummy_pad_state.sampling_number = npad->handheld_lifo.ReadCurrentEntry().sampling_number + 1; + dummy_pad_state.sampling_number = npad->handheld_lifo.ReadCurrentEntry().state.sampling_number + 1; npad->handheld_lifo.WriteNextEntry(dummy_pad_state); - dummy_pad_state.sampling_number = npad->joy_dual_lifo.ReadCurrentEntry().sampling_number + 1; + dummy_pad_state.sampling_number = npad->joy_dual_lifo.ReadCurrentEntry().state.sampling_number + 1; npad->joy_dual_lifo.WriteNextEntry(dummy_pad_state); - dummy_pad_state.sampling_number = npad->joy_left_lifo.ReadCurrentEntry().sampling_number + 1; + dummy_pad_state.sampling_number = npad->joy_left_lifo.ReadCurrentEntry().state.sampling_number + 1; npad->joy_left_lifo.WriteNextEntry(dummy_pad_state); - dummy_pad_state.sampling_number = npad->joy_right_lifo.ReadCurrentEntry().sampling_number + 1; + dummy_pad_state.sampling_number = npad->joy_right_lifo.ReadCurrentEntry().state.sampling_number + 1; npad->joy_right_lifo.WriteNextEntry(dummy_pad_state); - dummy_pad_state.sampling_number = npad->palma_lifo.ReadCurrentEntry().sampling_number + 1; + dummy_pad_state.sampling_number = npad->palma_lifo.ReadCurrentEntry().state.sampling_number + 1; npad->palma_lifo.WriteNextEntry(dummy_pad_state); - dummy_pad_state.sampling_number = npad->system_ext_lifo.ReadCurrentEntry().sampling_number + 1; + dummy_pad_state.sampling_number = npad->system_ext_lifo.ReadCurrentEntry().state.sampling_number + 1; npad->system_ext_lifo.WriteNextEntry(dummy_pad_state); - dummy_gc_state.sampling_number = npad->gc_trigger_lifo.ReadCurrentEntry().sampling_number + 1; + dummy_gc_state.sampling_number = npad->gc_trigger_lifo.ReadCurrentEntry().state.sampling_number + 1; npad->gc_trigger_lifo.WriteNextEntry(dummy_gc_state); } From 9a30172e45fcb7833cc49ba4d6450211449b14df Mon Sep 17 00:00:00 2001 From: lizzie Date: Sat, 19 Sep 2026 01:39:46 +0200 Subject: [PATCH 020/198] [dynarmic] Coalesce non-exclusive Write/Read fallback functions (#4158) the general idea is to have a common procedure form whom to call this way theres less "jumping around" for values of different sizes additionally this **should** allow for better codegen since most of the u8,u16,u32,u64 can be held within a u64 theoretically this means that you could deifne callbacks in suck a way that it's essentially as costly as a `mov r64, m64` but that's not doable due to the fact we have to do translations... Is this a good change? Primarily aimed for x86 and ARM to benefit, but I suppose LooooooongArch64 can benefit too. Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4158 Reviewed-by: crueter Reviewed-by: MaranBr Reviewed-by: CamilleLaVey --- src/core/arm/dynarmic/arm_dynarmic_32.cpp | 52 +++---- src/core/arm/dynarmic/arm_dynarmic_32.h | 10 +- src/core/arm/dynarmic/arm_dynarmic_64.cpp | 52 +++---- src/core/arm/dynarmic/arm_dynarmic_64.h | 11 +- src/core/hle/service/jit/jit_context.cpp | 62 ++++---- src/core/tools/freezer.cpp | 16 +- .../backend/arm64/a32_address_space.cpp | 39 ++--- .../backend/arm64/a64_address_space.cpp | 40 ++--- .../dynarmic/backend/arm64/address_space.cpp | 51 +++++-- .../dynarmic/backend/arm64/address_space.h | 20 +-- .../backend/x64/a32_emit_x64_memory.cpp | 60 ++++---- .../backend/x64/a64_emit_x64_memory.cpp | 62 ++++---- .../backend/x64/emit_x64_memory.cpp.inc | 36 +++-- .../src/dynarmic/interface/A32/config.h | 14 +- .../src/dynarmic/interface/A64/config.h | 14 +- src/dynarmic/src/dynarmic/ir/opt_passes.cpp | 8 +- src/dynarmic/tests/A32/fuzz_thumb.cpp | 2 +- .../tests/A32/test_arm_instructions.cpp | 6 +- src/dynarmic/tests/A32/testenv.h | 127 ++++++++-------- src/dynarmic/tests/A64/a64.cpp | 20 +-- src/dynarmic/tests/A64/fibonacci.cpp | 81 +++++----- src/dynarmic/tests/A64/testenv.h | 142 ++++++++++-------- src/dynarmic/tests/print_info.cpp | 72 +++++---- .../tests/unicorn_emu/a32_unicorn.cpp | 21 +-- .../tests/unicorn_emu/a64_unicorn.cpp | 21 +-- 25 files changed, 475 insertions(+), 564 deletions(-) diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 8be0abc4fa..a59aa3cac3 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp @@ -22,21 +22,15 @@ DynarmicCallbacks32::DynarmicCallbacks32(ArmDynarmic32& parent, Kernel::KProcess , m_check_memory_access{m_debugger_enabled || !Settings::values.cpuopt_ignore_memory_aborts.GetValue()} {} -u8 DynarmicCallbacks32::MemoryRead8(u32 vaddr) { - CheckMemoryAccess(vaddr, 1, Kernel::DebugWatchpointType::Read); - return m_memory.Read8(vaddr); -} -u16 DynarmicCallbacks32::MemoryRead16(u32 vaddr) { - CheckMemoryAccess(vaddr, 2, Kernel::DebugWatchpointType::Read); - return m_memory.Read16(vaddr); -} -u32 DynarmicCallbacks32::MemoryRead32(u32 vaddr) { - CheckMemoryAccess(vaddr, 4, Kernel::DebugWatchpointType::Read); - return m_memory.Read32(vaddr); -} -u64 DynarmicCallbacks32::MemoryRead64(u32 vaddr) { - CheckMemoryAccess(vaddr, 8, Kernel::DebugWatchpointType::Read); - return m_memory.Read64(vaddr); +u64 DynarmicCallbacks32::MemoryRead(u32 vaddr, size_t size) { + CheckMemoryAccess(vaddr, size, Kernel::DebugWatchpointType::Read); + switch (size) { + case sizeof(u64): return m_memory.Read64(vaddr); + case sizeof(u32): return m_memory.Read32(vaddr); + case sizeof(u16): return m_memory.Read16(vaddr); + case sizeof(u8): return m_memory.Read8(vaddr); + default: UNREACHABLE(); + } } std::optional DynarmicCallbacks32::MemoryReadCode(u32 vaddr) { @@ -50,27 +44,17 @@ std::optional DynarmicCallbacks32::MemoryReadCode(u32 vaddr) { return cached_code_page.inst[(vaddr & Core::Memory::YUZU_PAGEMASK) / sizeof(u32)]; } -void DynarmicCallbacks32::MemoryWrite8(u32 vaddr, u8 value) { - if (CheckMemoryAccess(vaddr, 1, Kernel::DebugWatchpointType::Write)) { - m_memory.Write8(vaddr, value); +void DynarmicCallbacks32::MemoryWrite(Dynarmic::A32::VAddr vaddr, u64 value, size_t size) { + if (CheckMemoryAccess(vaddr, size, Kernel::DebugWatchpointType::Write)) { + switch (size) { + case sizeof(u64): return m_memory.Write64(vaddr, value); + case sizeof(u32): return m_memory.Write32(vaddr, u32(value)); + case sizeof(u16): return m_memory.Write16(vaddr, u16(value)); + case sizeof(u8): return m_memory.Write8(vaddr, u8(value)); + default: UNREACHABLE(); + } } } -void DynarmicCallbacks32::MemoryWrite16(u32 vaddr, u16 value) { - if (CheckMemoryAccess(vaddr, 2, Kernel::DebugWatchpointType::Write)) { - m_memory.Write16(vaddr, value); - } -} -void DynarmicCallbacks32::MemoryWrite32(u32 vaddr, u32 value) { - if (CheckMemoryAccess(vaddr, 4, Kernel::DebugWatchpointType::Write)) { - m_memory.Write32(vaddr, value); - } -} -void DynarmicCallbacks32::MemoryWrite64(u32 vaddr, u64 value) { - if (CheckMemoryAccess(vaddr, 8, Kernel::DebugWatchpointType::Write)) { - m_memory.Write64(vaddr, value); - } -} - bool DynarmicCallbacks32::MemoryWriteExclusive8(u32 vaddr, u8 value, u8 expected) { return CheckMemoryAccess(vaddr, 1, Kernel::DebugWatchpointType::Write) && m_memory.WriteExclusive8(vaddr, value, expected); diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.h b/src/core/arm/dynarmic/arm_dynarmic_32.h index 623597152f..22655dff47 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.h +++ b/src/core/arm/dynarmic/arm_dynarmic_32.h @@ -30,18 +30,12 @@ class System; class DynarmicCallbacks32 : public Dynarmic::A32::UserCallbacks { public: explicit DynarmicCallbacks32(ArmDynarmic32& parent, Kernel::KProcess* process); - u8 MemoryRead8(u32 vaddr) override; - u16 MemoryRead16(u32 vaddr) override; - u32 MemoryRead32(u32 vaddr) override; - u64 MemoryRead64(u32 vaddr) override; + u64 MemoryRead(u32 vaddr, size_t size) override; std::optional MemoryReadCode(u32 vaddr) override; void InstructionSynchronizationBarrierRaised() override { last_code_addr = u64(-1); //reset back, force refetch } - void MemoryWrite8(u32 vaddr, u8 value) override; - void MemoryWrite16(u32 vaddr, u16 value) override; - void MemoryWrite32(u32 vaddr, u32 value) override; - void MemoryWrite64(u32 vaddr, u64 value) override; + void MemoryWrite(Dynarmic::A32::VAddr vaddr, u64 value, size_t size) override; bool MemoryWriteExclusive8(u32 vaddr, u8 value, u8 expected) override; bool MemoryWriteExclusive16(u32 vaddr, u16 value, u16 expected) override; bool MemoryWriteExclusive32(u32 vaddr, u32 value, u32 expected) override; diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 9db40b9356..894857a86d 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp @@ -10,6 +10,7 @@ #include "core/arm/dynarmic/dynarmic_exclusive_monitor.h" #include "core/core_timing.h" #include "core/hle/kernel/k_process.h" +#include "dynarmic/interface/A64/config.h" namespace Core { @@ -21,21 +22,15 @@ DynarmicCallbacks64::DynarmicCallbacks64(ArmDynarmic64& parent, Kernel::KProcess , m_check_memory_access{m_debugger_enabled || !Settings::values.cpuopt_ignore_memory_aborts.GetValue()} {} -u8 DynarmicCallbacks64::MemoryRead8(u64 vaddr) { - CheckMemoryAccess(vaddr, 1, Kernel::DebugWatchpointType::Read); - return m_memory.Read8(vaddr); -} -u16 DynarmicCallbacks64::MemoryRead16(u64 vaddr) { - CheckMemoryAccess(vaddr, 2, Kernel::DebugWatchpointType::Read); - return m_memory.Read16(vaddr); -} -u32 DynarmicCallbacks64::MemoryRead32(u64 vaddr) { - CheckMemoryAccess(vaddr, 4, Kernel::DebugWatchpointType::Read); - return m_memory.Read32(vaddr); -} -u64 DynarmicCallbacks64::MemoryRead64(u64 vaddr) { - CheckMemoryAccess(vaddr, 8, Kernel::DebugWatchpointType::Read); - return m_memory.Read64(vaddr); +u64 DynarmicCallbacks64::MemoryRead(u64 vaddr, size_t size) { + CheckMemoryAccess(vaddr, size, Kernel::DebugWatchpointType::Read); + switch (size) { + case sizeof(u64): return m_memory.Read64(vaddr); + case sizeof(u32): return m_memory.Read32(vaddr); + case sizeof(u16): return m_memory.Read16(vaddr); + case sizeof(u8): return m_memory.Read8(vaddr); + default: UNREACHABLE(); + } } Dynarmic::A64::Vector DynarmicCallbacks64::MemoryRead128(u64 vaddr) { CheckMemoryAccess(vaddr, 16, Kernel::DebugWatchpointType::Read); @@ -53,24 +48,15 @@ std::optional DynarmicCallbacks64::MemoryReadCode(u64 vaddr) { return cached_code_page.inst[(vaddr & Core::Memory::YUZU_PAGEMASK) / sizeof(u32)]; } -void DynarmicCallbacks64::MemoryWrite8(u64 vaddr, u8 value) { - if (CheckMemoryAccess(vaddr, 1, Kernel::DebugWatchpointType::Write)) { - m_memory.Write8(vaddr, value); - } -} -void DynarmicCallbacks64::MemoryWrite16(u64 vaddr, u16 value) { - if (CheckMemoryAccess(vaddr, 2, Kernel::DebugWatchpointType::Write)) { - m_memory.Write16(vaddr, value); - } -} -void DynarmicCallbacks64::MemoryWrite32(u64 vaddr, u32 value) { - if (CheckMemoryAccess(vaddr, 4, Kernel::DebugWatchpointType::Write)) { - m_memory.Write32(vaddr, value); - } -} -void DynarmicCallbacks64::MemoryWrite64(u64 vaddr, u64 value) { - if (CheckMemoryAccess(vaddr, 8, Kernel::DebugWatchpointType::Write)) { - m_memory.Write64(vaddr, value); +void DynarmicCallbacks64::MemoryWrite(Dynarmic::A64::VAddr vaddr, u64 value, std::size_t size) { + if (CheckMemoryAccess(vaddr, size, Kernel::DebugWatchpointType::Write)) { + switch (size) { + case sizeof(u64): return m_memory.Write64(vaddr, u64(value)); + case sizeof(u32): return m_memory.Write32(vaddr, u32(value)); + case sizeof(u16): return m_memory.Write16(vaddr, u16(value)); + case sizeof(u8): return m_memory.Write8(vaddr, u8(value)); + default: UNREACHABLE(); + } } } void DynarmicCallbacks64::MemoryWrite128(u64 vaddr, Dynarmic::A64::Vector value) { diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.h b/src/core/arm/dynarmic/arm_dynarmic_64.h index 4c8570913f..5ea5dde8a6 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.h +++ b/src/core/arm/dynarmic/arm_dynarmic_64.h @@ -16,6 +16,7 @@ #include "common/hash.h" #include "core/arm/arm_interface.h" #include "core/arm/dynarmic/dynarmic_exclusive_monitor.h" +#include "dynarmic/interface/A64/config.h" namespace Core::Memory { class Memory; @@ -36,19 +37,13 @@ class DynarmicCallbacks64 : public Dynarmic::A64::UserCallbacks { public: explicit DynarmicCallbacks64(ArmDynarmic64& parent, Kernel::KProcess* process); - u8 MemoryRead8(u64 vaddr) override; - u16 MemoryRead16(u64 vaddr) override; - u32 MemoryRead32(u64 vaddr) override; - u64 MemoryRead64(u64 vaddr) override; + u64 MemoryRead(u64 vaddr, size_t size) override; Dynarmic::A64::Vector MemoryRead128(u64 vaddr) override; std::optional MemoryReadCode(u64 vaddr) override; void InstructionSynchronizationBarrierRaised() override { last_code_addr = u64(-1); //reset back, force refetch } - void MemoryWrite8(u64 vaddr, u8 value) override; - void MemoryWrite16(u64 vaddr, u16 value) override; - void MemoryWrite32(u64 vaddr, u32 value) override; - void MemoryWrite64(u64 vaddr, u64 value) override; + void MemoryWrite(Dynarmic::A64::VAddr vaddr, u64 value, std::size_t size) override; void MemoryWrite128(u64 vaddr, Dynarmic::A64::Vector value) override; bool MemoryWriteExclusive8(u64 vaddr, std::uint8_t value, std::uint8_t expected) override; bool MemoryWriteExclusive16(u64 vaddr, std::uint16_t value, std::uint16_t expected) override; diff --git a/src/core/hle/service/jit/jit_context.cpp b/src/core/hle/service/jit/jit_context.cpp index 36bf5d6649..e1e8eeadbe 100644 --- a/src/core/hle/service/jit/jit_context.cpp +++ b/src/core/hle/service/jit/jit_context.cpp @@ -71,17 +71,14 @@ public: void InstructionSynchronizationBarrierRaised() override { last_code_addr = u64(-1); //reset back, force refetch } - u8 MemoryRead8(u64 vaddr) override { - return ReadMemory(vaddr); - } - u16 MemoryRead16(u64 vaddr) override { - return ReadMemory(vaddr); - } - u32 MemoryRead32(u64 vaddr) override { - return ReadMemory(vaddr); - } - u64 MemoryRead64(u64 vaddr) override { - return ReadMemory(vaddr); + u64 MemoryRead(u64 vaddr, size_t size) override { + switch (size) { + case sizeof(u64): return ReadMemory(vaddr); + case sizeof(u32): return ReadMemory(vaddr); + case sizeof(u16): return ReadMemory(vaddr); + case sizeof(u8): return ReadMemory(vaddr); + default: UNREACHABLE(); + } } u128 MemoryRead128(u64 vaddr) override { return ReadMemory(vaddr); @@ -89,22 +86,19 @@ public: std::string MemoryReadCString(u64 vaddr) { std::string result{}; u8 next; - while ((next = MemoryRead8(vaddr++)) != 0) + while ((next = u8(MemoryRead(vaddr++, sizeof(u8)))) != 0) result += char(next); return result; } - void MemoryWrite8(u64 vaddr, u8 value) override { - WriteMemory(vaddr, value); - } - void MemoryWrite16(u64 vaddr, u16 value) override { - WriteMemory(vaddr, value); - } - void MemoryWrite32(u64 vaddr, u32 value) override { - WriteMemory(vaddr, value); - } - void MemoryWrite64(u64 vaddr, u64 value) override { - WriteMemory(vaddr, value); + void MemoryWrite(u64 vaddr, u64 value, size_t size) override { + switch (size) { + case sizeof(u64): WriteMemory(vaddr, u64(value)); break; + case sizeof(u32): WriteMemory(vaddr, u32(value)); break; + case sizeof(u16): WriteMemory(vaddr, u16(value)); break; + case sizeof(u8): WriteMemory(vaddr, u8(value)); break; + default: UNREACHABLE(); + } } void MemoryWrite128(u64 vaddr, u128 value) override { WriteMemory(vaddr, value); @@ -193,14 +187,14 @@ public: // The loaded NRO file has ELF relocations that must be processed before it can run. // Normally this would be processed by RTLD, but in HLE context, we don't have // the linker available, so we have to do it ourselves. - const VAddr mod_offset{callbacks->MemoryRead32(4)}; - if (callbacks->MemoryRead32(mod_offset) != Common::MakeMagic('M', 'O', 'D', '0')) + const VAddr mod_offset{callbacks->MemoryRead(4, sizeof(u32))}; + if (callbacks->MemoryRead(mod_offset, sizeof(u32)) != Common::MakeMagic('M', 'O', 'D', '0')) return false; // For more info about dynamic entries, see the ELF ABI specification: // https://refspecs.linuxbase.org/elf/gabi4+/ch5.dynamic.html // https://refspecs.linuxbase.org/elf/gabi4+/ch4.reloc.html - VAddr dynamic_offset{mod_offset + callbacks->MemoryRead32(mod_offset + 4)}; + VAddr dynamic_offset{mod_offset + callbacks->MemoryRead(mod_offset + 4, sizeof(u32))}; VAddr rela_dyn = 0, relr_dyn = 0; size_t num_rela = 0, num_relr = 0; while (true) { @@ -222,8 +216,8 @@ public: for (size_t i = 0; i < num_rela; i++) { const auto rela{callbacks->ReadMemory(rela_dyn + i * sizeof(Elf64_Rela))}; if (Elf64RelType(rela.r_info) == ElfAArch64Relative) { - const VAddr contents{callbacks->MemoryRead64(rela.r_offset)}; - callbacks->MemoryWrite64(rela.r_offset, contents + rela.r_addend); + const VAddr contents{callbacks->MemoryRead(rela.r_offset, sizeof(u64))}; + callbacks->MemoryWrite(rela.r_offset, contents + rela.r_addend, sizeof(u64)); } } @@ -231,7 +225,7 @@ public: for (size_t i = 0; i < num_relr; i++) { const auto relr = callbacks->ReadMemory(relr_dyn + i * sizeof(Elf64_Relr)); const auto incr = [&](VAddr where) { - callbacks->MemoryWrite64(where, callbacks->MemoryRead64(where) + relocbase); + callbacks->MemoryWrite(where, callbacks->MemoryRead(where, sizeof(u64)) + relocbase, sizeof(u64)); }; if ((relr & 1) == 0) { // where pointer @@ -294,7 +288,7 @@ public: if (argument_stack.size() > 8) { const VAddr new_sp = Common::AlignDown(top_of_stack - (argument_stack.size() - 8) * sizeof(u64), STACK_ALIGN); for (size_t i = 8; i < argument_stack.size(); i++) - callbacks->MemoryWrite64(new_sp + (i - 8) * sizeof(u64), argument_stack[i]); + callbacks->MemoryWrite(new_sp + (i - 8) * sizeof(u64), argument_stack[i], sizeof(u64)); jit->SetSP(new_sp); } // Reset the call state for the next invocation @@ -385,17 +379,17 @@ void DynarmicCallbacks64::CallSVC(u32 swi) { if (dest < src) { for (size_t i = 0; i < n; i++) - MemoryWrite8(dest + i, MemoryRead8(src + i)); + MemoryWrite(dest + i, u8(MemoryRead(src + i, sizeof(u8))), sizeof(u8)); } else { for (size_t i = n; i > 0; i--) - MemoryWrite8(dest + i - 1, MemoryRead8(src + i - 1)); + MemoryWrite(dest + i - 1, u8(MemoryRead(src + i - 1, sizeof(u8))), sizeof(u8)); } } else if (pc == parent.helpers[size_t(HelperFn::Memset)]) { const VAddr dest{parent.jit->GetRegister(0)}; const u64 c{parent.jit->GetRegister(1)}; const size_t n{parent.jit->GetRegister(2)}; for (size_t i = 0; i < n; i++) - MemoryWrite8(dest + i, u8(c)); + MemoryWrite(dest + i, u8(c), sizeof(u8)); } else if (pc == parent.helpers[size_t(HelperFn::Resolve)]) { // X0 contains a char* for a symbol to resolve const auto name{MemoryReadCString(parent.jit->GetRegister(0))}; @@ -422,7 +416,7 @@ void DynarmicCallbacks64::CallSVC(u32 swi) { } void DynarmicCallbacks64::ExceptionRaised(u64 pc, Dynarmic::A64::Exception exception) { - auto const inst = MemoryRead32(pc); + auto const inst = MemoryRead(pc, sizeof(u32)); LOG_CRITICAL(Service_JIT, "{} PC @ {:08x}, data = {:08x}", exception, pc, inst); parent.jit->HaltExecution(); } diff --git a/src/core/tools/freezer.cpp b/src/core/tools/freezer.cpp index 73a86b3c8c..606ac2da42 100644 --- a/src/core/tools/freezer.cpp +++ b/src/core/tools/freezer.cpp @@ -33,18 +33,10 @@ u64 MemoryReadWidth(Core::Memory::Memory& memory, u32 width, VAddr addr) { void MemoryWriteWidth(Core::Memory::Memory& memory, u32 width, VAddr addr, u64 value) { switch (width) { - case 1: - memory.Write8(addr, static_cast(value)); - break; - case 2: - memory.Write16(addr, static_cast(value)); - break; - case 4: - memory.Write32(addr, static_cast(value)); - break; - case 8: - memory.Write64(addr, value); - break; + case sizeof(u64): return memory.Write64(addr, value); + case sizeof(u32): return memory.Write32(addr, u32(value)); + case sizeof(u16): return memory.Write16(addr, u16(value)); + case sizeof(u8): return memory.Write8(addr, u8(value)); default: UNREACHABLE(); } diff --git a/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp index 8b6ec2506e..dc14d16978 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp @@ -82,7 +82,7 @@ static void* EmitExclusiveReadCallTrampoline(oaknut::CodeGenerator& code, const auto fn = [](const A32::UserConfig& conf, A32::VAddr vaddr) -> T { return conf.global_monitor->ReadAndMark(conf.processor_id, vaddr, [&]() -> T { - return (conf.callbacks->*callback)(vaddr); + return (conf.callbacks->*callback)(vaddr, sizeof(T)); }); }; @@ -136,12 +136,9 @@ static void* EmitExclusiveWriteCallTrampoline(oaknut::CodeGenerator& code, const oaknut::Label l_addr, l_this; auto fn = [](const A32::UserConfig& conf, A32::VAddr vaddr, T value) -> u32 { - return conf.global_monitor->DoExclusiveOperation(conf.processor_id, vaddr, - [&](T expected) -> bool { - return (conf.callbacks->*callback)(vaddr, value, expected); - }) - ? 0 - : 1; + return conf.global_monitor->DoExclusiveOperation(conf.processor_id, vaddr, [&](T expected) -> bool { + return (conf.callbacks->*callback)(vaddr, value, expected); + }) ? 0 : 1; }; void* target = code.xptr(); @@ -179,26 +176,14 @@ void A32AddressSpace::EmitPrelude() { UnprotectCodeMemory(); - prelude_info.read_memory_8 = EmitCallTrampoline<&A32::UserCallbacks::MemoryRead8>(code, conf.callbacks); - prelude_info.read_memory_16 = EmitCallTrampoline<&A32::UserCallbacks::MemoryRead16>(code, conf.callbacks); - prelude_info.read_memory_32 = EmitCallTrampoline<&A32::UserCallbacks::MemoryRead32>(code, conf.callbacks); - prelude_info.read_memory_64 = EmitCallTrampoline<&A32::UserCallbacks::MemoryRead64>(code, conf.callbacks); - prelude_info.wrapped_read_memory_8 = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead8>(code, conf.callbacks); - prelude_info.wrapped_read_memory_16 = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead16>(code, conf.callbacks); - prelude_info.wrapped_read_memory_32 = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead32>(code, conf.callbacks); - prelude_info.wrapped_read_memory_64 = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead64>(code, conf.callbacks); - prelude_info.exclusive_read_memory_8 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead8, u8>(code, conf); - prelude_info.exclusive_read_memory_16 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead16, u16>(code, conf); - prelude_info.exclusive_read_memory_32 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead32, u32>(code, conf); - prelude_info.exclusive_read_memory_64 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead64, u64>(code, conf); - prelude_info.write_memory_8 = EmitCallTrampoline<&A32::UserCallbacks::MemoryWrite8>(code, conf.callbacks); - prelude_info.write_memory_16 = EmitCallTrampoline<&A32::UserCallbacks::MemoryWrite16>(code, conf.callbacks); - prelude_info.write_memory_32 = EmitCallTrampoline<&A32::UserCallbacks::MemoryWrite32>(code, conf.callbacks); - prelude_info.write_memory_64 = EmitCallTrampoline<&A32::UserCallbacks::MemoryWrite64>(code, conf.callbacks); - prelude_info.wrapped_write_memory_8 = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite8>(code, conf.callbacks); - prelude_info.wrapped_write_memory_16 = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite16>(code, conf.callbacks); - prelude_info.wrapped_write_memory_32 = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite32>(code, conf.callbacks); - prelude_info.wrapped_write_memory_64 = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite64>(code, conf.callbacks); + prelude_info.read_memory = EmitCallTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks); + prelude_info.wrapped_read_memory = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks); + prelude_info.exclusive_read_memory_8 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead, u8>(code, conf); + prelude_info.exclusive_read_memory_16 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead, u16>(code, conf); + prelude_info.exclusive_read_memory_32 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead, u32>(code, conf); + prelude_info.exclusive_read_memory_64 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead, u64>(code, conf); + prelude_info.write_memory = EmitCallTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks); + prelude_info.wrapped_write_memory = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks); prelude_info.exclusive_write_memory_8 = EmitExclusiveWriteCallTrampoline<&A32::UserCallbacks::MemoryWriteExclusive8, u8>(code, conf); prelude_info.exclusive_write_memory_16 = EmitExclusiveWriteCallTrampoline<&A32::UserCallbacks::MemoryWriteExclusive16, u16>(code, conf); prelude_info.exclusive_write_memory_32 = EmitExclusiveWriteCallTrampoline<&A32::UserCallbacks::MemoryWriteExclusive32, u32>(code, conf); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp index 2dbb7d2e1d..efb9fc538c 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp @@ -81,7 +81,7 @@ static void* EmitExclusiveReadCallTrampoline(oaknut::CodeGenerator& code, const auto fn = [](const A64::UserConfig& conf, A64::VAddr vaddr) -> T { return conf.global_monitor->ReadAndMark(conf.processor_id, vaddr, [&]() -> T { - return (conf.callbacks->*callback)(vaddr); + return (conf.callbacks->*callback)(vaddr, sizeof(T)); }); }; @@ -133,14 +133,10 @@ static void* EmitExclusiveWriteCallTrampoline(oaknut::CodeGenerator& code, const using namespace oaknut::util; oaknut::Label l_addr, l_this; - auto fn = [](const A64::UserConfig& conf, A64::VAddr vaddr, T value) -> u32 { - return conf.global_monitor->DoExclusiveOperation(conf.processor_id, vaddr, - [&](T expected) -> bool { - return (conf.callbacks->*callback)(vaddr, value, expected); - }) - ? 0 - : 1; + return conf.global_monitor->DoExclusiveOperation(conf.processor_id, vaddr, [&](T expected) -> bool { + return (conf.callbacks->*callback)(vaddr, value, expected); + }) ? 0 : 1; }; void* target = code.xptr(); @@ -346,30 +342,18 @@ void A64AddressSpace::EmitPrelude() { UnprotectCodeMemory(); - prelude_info.read_memory_8 = EmitCallTrampoline<&A64::UserCallbacks::MemoryRead8>(code, conf.callbacks); - prelude_info.read_memory_16 = EmitCallTrampoline<&A64::UserCallbacks::MemoryRead16>(code, conf.callbacks); - prelude_info.read_memory_32 = EmitCallTrampoline<&A64::UserCallbacks::MemoryRead32>(code, conf.callbacks); - prelude_info.read_memory_64 = EmitCallTrampoline<&A64::UserCallbacks::MemoryRead64>(code, conf.callbacks); + prelude_info.read_memory = EmitCallTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks); prelude_info.read_memory_128 = EmitRead128CallTrampoline(code, conf.callbacks); - prelude_info.wrapped_read_memory_8 = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead8>(code, conf.callbacks); - prelude_info.wrapped_read_memory_16 = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead16>(code, conf.callbacks); - prelude_info.wrapped_read_memory_32 = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead32>(code, conf.callbacks); - prelude_info.wrapped_read_memory_64 = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead64>(code, conf.callbacks); + prelude_info.wrapped_read_memory = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks); prelude_info.wrapped_read_memory_128 = EmitWrappedRead128CallTrampoline(code, conf.callbacks); - prelude_info.exclusive_read_memory_8 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead8, u8>(code, conf); - prelude_info.exclusive_read_memory_16 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead16, u16>(code, conf); - prelude_info.exclusive_read_memory_32 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead32, u32>(code, conf); - prelude_info.exclusive_read_memory_64 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead64, u64>(code, conf); + prelude_info.exclusive_read_memory_8 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead, u8>(code, conf); + prelude_info.exclusive_read_memory_16 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead, u16>(code, conf); + prelude_info.exclusive_read_memory_32 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead, u32>(code, conf); + prelude_info.exclusive_read_memory_64 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead, u64>(code, conf); prelude_info.exclusive_read_memory_128 = EmitExclusiveRead128CallTrampoline(code, conf); - prelude_info.write_memory_8 = EmitCallTrampoline<&A64::UserCallbacks::MemoryWrite8>(code, conf.callbacks); - prelude_info.write_memory_16 = EmitCallTrampoline<&A64::UserCallbacks::MemoryWrite16>(code, conf.callbacks); - prelude_info.write_memory_32 = EmitCallTrampoline<&A64::UserCallbacks::MemoryWrite32>(code, conf.callbacks); - prelude_info.write_memory_64 = EmitCallTrampoline<&A64::UserCallbacks::MemoryWrite64>(code, conf.callbacks); + prelude_info.write_memory = EmitCallTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks); prelude_info.write_memory_128 = EmitWrite128CallTrampoline(code, conf.callbacks); - prelude_info.wrapped_write_memory_8 = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite8>(code, conf.callbacks); - prelude_info.wrapped_write_memory_16 = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite16>(code, conf.callbacks); - prelude_info.wrapped_write_memory_32 = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite32>(code, conf.callbacks); - prelude_info.wrapped_write_memory_64 = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite64>(code, conf.callbacks); + prelude_info.wrapped_write_memory = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks); prelude_info.wrapped_write_memory_128 = EmitWrappedWrite128CallTrampoline(code, conf.callbacks); prelude_info.exclusive_write_memory_8 = EmitExclusiveWriteCallTrampoline<&A64::UserCallbacks::MemoryWriteExclusive8, u8>(code, conf); prelude_info.exclusive_write_memory_16 = EmitExclusiveWriteCallTrampoline<&A64::UserCallbacks::MemoryWriteExclusive16, u16>(code, conf); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp index 947c50f4c3..7b83e372e6 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp @@ -145,32 +145,42 @@ void AddressSpace::Link(EmittedBlockInfo& block_info) { case LinkTarget::ReturnFromRunCode: c.B(prelude_info.return_from_run_code); break; + // { this, vaddr, size } case LinkTarget::ReadMemory8: - c.BL(prelude_info.read_memory_8); + c.LDR(X2, 1); + c.BL(prelude_info.read_memory); break; case LinkTarget::ReadMemory16: - c.BL(prelude_info.read_memory_16); + c.LDR(X2, 2); + c.BL(prelude_info.read_memory); break; case LinkTarget::ReadMemory32: - c.BL(prelude_info.read_memory_32); + c.LDR(X2, 4); + c.BL(prelude_info.read_memory); break; case LinkTarget::ReadMemory64: - c.BL(prelude_info.read_memory_64); + c.LDR(X2, 8); + c.BL(prelude_info.read_memory); break; case LinkTarget::ReadMemory128: c.BL(prelude_info.read_memory_128); break; + // { this, vaddr, size } case LinkTarget::WrappedReadMemory8: - c.BL(prelude_info.wrapped_read_memory_8); + c.LDR(X2, 1); + c.BL(prelude_info.wrapped_read_memory); break; case LinkTarget::WrappedReadMemory16: - c.BL(prelude_info.wrapped_read_memory_16); + c.LDR(X2, 2); + c.BL(prelude_info.wrapped_read_memory); break; case LinkTarget::WrappedReadMemory32: - c.BL(prelude_info.wrapped_read_memory_32); + c.LDR(X2, 4); + c.BL(prelude_info.wrapped_read_memory); break; case LinkTarget::WrappedReadMemory64: - c.BL(prelude_info.wrapped_read_memory_64); + c.LDR(X2, 8); + c.BL(prelude_info.wrapped_read_memory); break; case LinkTarget::WrappedReadMemory128: c.BL(prelude_info.wrapped_read_memory_128); @@ -190,32 +200,41 @@ void AddressSpace::Link(EmittedBlockInfo& block_info) { case LinkTarget::ExclusiveReadMemory128: c.BL(prelude_info.exclusive_read_memory_128); break; + // { this, vaddr, value, size } case LinkTarget::WriteMemory8: - c.BL(prelude_info.write_memory_8); + c.LDR(X3, 1); + c.BL(prelude_info.write_memory); break; case LinkTarget::WriteMemory16: - c.BL(prelude_info.write_memory_16); + c.LDR(X3, 2); + c.BL(prelude_info.write_memory); break; case LinkTarget::WriteMemory32: - c.BL(prelude_info.write_memory_32); + c.LDR(X3, 4); + c.BL(prelude_info.write_memory); break; case LinkTarget::WriteMemory64: - c.BL(prelude_info.write_memory_64); + c.LDR(X3, 8); + c.BL(prelude_info.write_memory); break; case LinkTarget::WriteMemory128: c.BL(prelude_info.write_memory_128); break; case LinkTarget::WrappedWriteMemory8: - c.BL(prelude_info.wrapped_write_memory_8); + c.LDR(X3, 1); + c.BL(prelude_info.wrapped_write_memory); break; case LinkTarget::WrappedWriteMemory16: - c.BL(prelude_info.wrapped_write_memory_16); + c.LDR(X3, 2); + c.BL(prelude_info.wrapped_write_memory); break; case LinkTarget::WrappedWriteMemory32: - c.BL(prelude_info.wrapped_write_memory_32); + c.LDR(X3, 4); + c.BL(prelude_info.wrapped_write_memory); break; case LinkTarget::WrappedWriteMemory64: - c.BL(prelude_info.wrapped_write_memory_64); + c.LDR(X3, 8); + c.BL(prelude_info.wrapped_write_memory); break; case LinkTarget::WrappedWriteMemory128: c.BL(prelude_info.wrapped_write_memory_128); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/address_space.h b/src/dynarmic/src/dynarmic/backend/arm64/address_space.h index 755b05bd02..73e2c94a19 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/address_space.h +++ b/src/dynarmic/src/dynarmic/backend/arm64/address_space.h @@ -93,30 +93,18 @@ protected: void* return_to_dispatcher; void* return_from_run_code; - void* read_memory_8; - void* read_memory_16; - void* read_memory_32; - void* read_memory_64; + void* read_memory; void* read_memory_128; - void* wrapped_read_memory_8; - void* wrapped_read_memory_16; - void* wrapped_read_memory_32; - void* wrapped_read_memory_64; + void* wrapped_read_memory; void* wrapped_read_memory_128; void* exclusive_read_memory_8; void* exclusive_read_memory_16; void* exclusive_read_memory_32; void* exclusive_read_memory_64; void* exclusive_read_memory_128; - void* write_memory_8; - void* write_memory_16; - void* write_memory_32; - void* write_memory_64; + void* write_memory; void* write_memory_128; - void* wrapped_write_memory_8; - void* wrapped_write_memory_16; - void* wrapped_write_memory_32; - void* wrapped_write_memory_64; + void* wrapped_write_memory; void* wrapped_write_memory_128; void* exclusive_write_memory_8; void* exclusive_write_memory_16; diff --git a/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64_memory.cpp b/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64_memory.cpp index f138b5f137..e866b2acd6 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64_memory.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64_memory.cpp @@ -31,16 +31,16 @@ using namespace Xbyak::util; void A32EmitX64::GenFastmemFallbacks() { const std::initializer_list idxes{0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; const std::array, 4> read_callbacks{{ - {8, Devirtualize<&A32::UserCallbacks::MemoryRead8>(conf.callbacks)}, - {16, Devirtualize<&A32::UserCallbacks::MemoryRead16>(conf.callbacks)}, - {32, Devirtualize<&A32::UserCallbacks::MemoryRead32>(conf.callbacks)}, - {64, Devirtualize<&A32::UserCallbacks::MemoryRead64>(conf.callbacks)}, + {8, Devirtualize<&A32::UserCallbacks::MemoryRead>(conf.callbacks)}, + {16, Devirtualize<&A32::UserCallbacks::MemoryRead>(conf.callbacks)}, + {32, Devirtualize<&A32::UserCallbacks::MemoryRead>(conf.callbacks)}, + {64, Devirtualize<&A32::UserCallbacks::MemoryRead>(conf.callbacks)}, }}; const std::array, 4> write_callbacks{{ - {8, Devirtualize<&A32::UserCallbacks::MemoryWrite8>(conf.callbacks)}, - {16, Devirtualize<&A32::UserCallbacks::MemoryWrite16>(conf.callbacks)}, - {32, Devirtualize<&A32::UserCallbacks::MemoryWrite32>(conf.callbacks)}, - {64, Devirtualize<&A32::UserCallbacks::MemoryWrite64>(conf.callbacks)}, + {8, Devirtualize<&A32::UserCallbacks::MemoryWrite>(conf.callbacks)}, + {16, Devirtualize<&A32::UserCallbacks::MemoryWrite>(conf.callbacks)}, + {32, Devirtualize<&A32::UserCallbacks::MemoryWrite>(conf.callbacks)}, + {64, Devirtualize<&A32::UserCallbacks::MemoryWrite>(conf.callbacks)}, }}; const std::array, 4> exclusive_write_callbacks{{ {8, Devirtualize<&A32::UserCallbacks::MemoryWriteExclusive8>(conf.callbacks)}, @@ -56,12 +56,12 @@ void A32EmitX64::GenFastmemFallbacks() { code.align(); read_fallbacks[std::make_tuple(ordered, bitsize, vaddr_idx, value_idx)] = code.getCurr(); ABI_PushCallerSaveRegistersAndAdjustStackExcept(code, HostLocRegIdx(value_idx)); + // params = { this, vaddr, size } if (vaddr_idx != code.ABI_PARAM2.getIdx()) { code.mov(code.ABI_PARAM2, Xbyak::Reg64{vaddr_idx}); } - if (ordered) { - code.mfence(); - } + code.mov(code.ABI_PARAM3, bitsize / CHAR_BIT); + if (ordered) code.mfence(); callback.EmitCall(code); if (value_idx != code.ABI_RETURN.getIdx()) { code.mov(Xbyak::Reg64{value_idx}, code.ABI_RETURN); @@ -76,6 +76,7 @@ void A32EmitX64::GenFastmemFallbacks() { code.align(); write_fallbacks[std::make_tuple(ordered, bitsize, vaddr_idx, value_idx)] = code.getCurr(); ABI_PushCallerSaveRegistersAndAdjustStack(code); + // params = { this, vaddr, value, size } if (vaddr_idx == code.ABI_PARAM3.getIdx() && value_idx == code.ABI_PARAM2.getIdx()) { code.xchg(code.ABI_PARAM2, code.ABI_PARAM3); } else if (vaddr_idx == code.ABI_PARAM3.getIdx()) { @@ -92,10 +93,9 @@ void A32EmitX64::GenFastmemFallbacks() { } } code.ZeroExtendFrom(bitsize, code.ABI_PARAM3); + code.mov(code.ABI_PARAM4, bitsize / CHAR_BIT); callback.EmitCall(code); - if (ordered) { - code.mfence(); - } + if (ordered) code.mfence(); ABI_PopCallerSaveRegistersAndAdjustStack(code); code.ret(); PerfMapRegister(write_fallbacks[std::make_tuple(ordered, bitsize, vaddr_idx, value_idx)], code.getCurr(), fmt::format("a32_write_fallback_{}", bitsize)); @@ -138,35 +138,35 @@ void A32EmitX64::GenFastmemFallbacks() { #undef Axx void A32EmitX64::EmitA32ReadMemory8(A32EmitContext& ctx, IR::Inst* inst) { - EmitMemoryRead<8, &A32::UserCallbacks::MemoryRead8>(ctx, inst); + EmitMemoryRead<8, &A32::UserCallbacks::MemoryRead>(ctx, inst); } void A32EmitX64::EmitA32ReadMemory16(A32EmitContext& ctx, IR::Inst* inst) { - EmitMemoryRead<16, &A32::UserCallbacks::MemoryRead16>(ctx, inst); + EmitMemoryRead<16, &A32::UserCallbacks::MemoryRead>(ctx, inst); } void A32EmitX64::EmitA32ReadMemory32(A32EmitContext& ctx, IR::Inst* inst) { - EmitMemoryRead<32, &A32::UserCallbacks::MemoryRead32>(ctx, inst); + EmitMemoryRead<32, &A32::UserCallbacks::MemoryRead>(ctx, inst); } void A32EmitX64::EmitA32ReadMemory64(A32EmitContext& ctx, IR::Inst* inst) { - EmitMemoryRead<64, &A32::UserCallbacks::MemoryRead64>(ctx, inst); + EmitMemoryRead<64, &A32::UserCallbacks::MemoryRead>(ctx, inst); } void A32EmitX64::EmitA32WriteMemory8(A32EmitContext& ctx, IR::Inst* inst) { - EmitMemoryWrite<8, &A32::UserCallbacks::MemoryWrite8>(ctx, inst); + EmitMemoryWrite<8, &A32::UserCallbacks::MemoryWrite>(ctx, inst); } void A32EmitX64::EmitA32WriteMemory16(A32EmitContext& ctx, IR::Inst* inst) { - EmitMemoryWrite<16, &A32::UserCallbacks::MemoryWrite16>(ctx, inst); + EmitMemoryWrite<16, &A32::UserCallbacks::MemoryWrite>(ctx, inst); } void A32EmitX64::EmitA32WriteMemory32(A32EmitContext& ctx, IR::Inst* inst) { - EmitMemoryWrite<32, &A32::UserCallbacks::MemoryWrite32>(ctx, inst); + EmitMemoryWrite<32, &A32::UserCallbacks::MemoryWrite>(ctx, inst); } void A32EmitX64::EmitA32WriteMemory64(A32EmitContext& ctx, IR::Inst* inst) { - EmitMemoryWrite<64, &A32::UserCallbacks::MemoryWrite64>(ctx, inst); + EmitMemoryWrite<64, &A32::UserCallbacks::MemoryWrite>(ctx, inst); } void A32EmitX64::EmitA32ClearExclusive(A32EmitContext&, IR::Inst*) { @@ -175,33 +175,33 @@ void A32EmitX64::EmitA32ClearExclusive(A32EmitContext&, IR::Inst*) { void A32EmitX64::EmitA32ExclusiveReadMemory8(A32EmitContext& ctx, IR::Inst* inst) { if (conf.fastmem_exclusive_access) { - EmitExclusiveReadMemoryInline<8, &A32::UserCallbacks::MemoryRead8>(ctx, inst); + EmitExclusiveReadMemoryInline<8, &A32::UserCallbacks::MemoryRead>(ctx, inst); } else { - EmitExclusiveReadMemory<8, &A32::UserCallbacks::MemoryRead8>(ctx, inst); + EmitExclusiveReadMemory<8, &A32::UserCallbacks::MemoryRead>(ctx, inst); } } void A32EmitX64::EmitA32ExclusiveReadMemory16(A32EmitContext& ctx, IR::Inst* inst) { if (conf.fastmem_exclusive_access) { - EmitExclusiveReadMemoryInline<16, &A32::UserCallbacks::MemoryRead16>(ctx, inst); + EmitExclusiveReadMemoryInline<16, &A32::UserCallbacks::MemoryRead>(ctx, inst); } else { - EmitExclusiveReadMemory<16, &A32::UserCallbacks::MemoryRead16>(ctx, inst); + EmitExclusiveReadMemory<16, &A32::UserCallbacks::MemoryRead>(ctx, inst); } } void A32EmitX64::EmitA32ExclusiveReadMemory32(A32EmitContext& ctx, IR::Inst* inst) { if (conf.fastmem_exclusive_access) { - EmitExclusiveReadMemoryInline<32, &A32::UserCallbacks::MemoryRead32>(ctx, inst); + EmitExclusiveReadMemoryInline<32, &A32::UserCallbacks::MemoryRead>(ctx, inst); } else { - EmitExclusiveReadMemory<32, &A32::UserCallbacks::MemoryRead32>(ctx, inst); + EmitExclusiveReadMemory<32, &A32::UserCallbacks::MemoryRead>(ctx, inst); } } void A32EmitX64::EmitA32ExclusiveReadMemory64(A32EmitContext& ctx, IR::Inst* inst) { if (conf.fastmem_exclusive_access) { - EmitExclusiveReadMemoryInline<64, &A32::UserCallbacks::MemoryRead64>(ctx, inst); + EmitExclusiveReadMemoryInline<64, &A32::UserCallbacks::MemoryRead>(ctx, inst); } else { - EmitExclusiveReadMemory<64, &A32::UserCallbacks::MemoryRead64>(ctx, inst); + EmitExclusiveReadMemory<64, &A32::UserCallbacks::MemoryRead>(ctx, inst); } } diff --git a/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64_memory.cpp b/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64_memory.cpp index 4b7054b4b2..8bb2fcfa59 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64_memory.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64_memory.cpp @@ -115,16 +115,16 @@ void A64EmitX64::GenMemory128Accessors() { void A64EmitX64::GenFastmemFallbacks() { const std::initializer_list idxes{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; const std::array, 4> read_callbacks{{ - {8, Devirtualize<&A64::UserCallbacks::MemoryRead8>(conf.callbacks)}, - {16, Devirtualize<&A64::UserCallbacks::MemoryRead16>(conf.callbacks)}, - {32, Devirtualize<&A64::UserCallbacks::MemoryRead32>(conf.callbacks)}, - {64, Devirtualize<&A64::UserCallbacks::MemoryRead64>(conf.callbacks)}, + {8, Devirtualize<&A64::UserCallbacks::MemoryRead>(conf.callbacks)}, + {16, Devirtualize<&A64::UserCallbacks::MemoryRead>(conf.callbacks)}, + {32, Devirtualize<&A64::UserCallbacks::MemoryRead>(conf.callbacks)}, + {64, Devirtualize<&A64::UserCallbacks::MemoryRead>(conf.callbacks)}, }}; const std::array, 4> write_callbacks{{ - {8, Devirtualize<&A64::UserCallbacks::MemoryWrite8>(conf.callbacks)}, - {16, Devirtualize<&A64::UserCallbacks::MemoryWrite16>(conf.callbacks)}, - {32, Devirtualize<&A64::UserCallbacks::MemoryWrite32>(conf.callbacks)}, - {64, Devirtualize<&A64::UserCallbacks::MemoryWrite64>(conf.callbacks)}, + {8, Devirtualize<&A64::UserCallbacks::MemoryWrite>(conf.callbacks)}, + {16, Devirtualize<&A64::UserCallbacks::MemoryWrite>(conf.callbacks)}, + {32, Devirtualize<&A64::UserCallbacks::MemoryWrite>(conf.callbacks)}, + {64, Devirtualize<&A64::UserCallbacks::MemoryWrite>(conf.callbacks)}, }}; const std::array, 4> exclusive_write_callbacks{{ {8, Devirtualize<&A64::UserCallbacks::MemoryWriteExclusive8>(conf.callbacks)}, @@ -204,12 +204,12 @@ void A64EmitX64::GenFastmemFallbacks() { code.align(); read_fallbacks[std::make_tuple(ordered, bitsize, vaddr_idx, value_idx)] = code.getCurr(); ABI_PushCallerSaveRegistersAndAdjustStackExcept(code, HostLocRegIdx(value_idx)); + // params = { this, vaddr, size } if (vaddr_idx != code.ABI_PARAM2.getIdx()) { code.mov(code.ABI_PARAM2, Xbyak::Reg64{vaddr_idx}); } - if (ordered) { - code.mfence(); - } + code.mov(code.ABI_PARAM3, bitsize / CHAR_BIT); + if (ordered) code.mfence(); callback.EmitCall(code); if (value_idx != code.ABI_RETURN.getIdx()) { code.mov(Xbyak::Reg64{value_idx}, code.ABI_RETURN); @@ -224,6 +224,7 @@ void A64EmitX64::GenFastmemFallbacks() { code.align(); write_fallbacks[std::make_tuple(ordered, bitsize, vaddr_idx, value_idx)] = code.getCurr(); ABI_PushCallerSaveRegistersAndAdjustStack(code); + // params = { this, vaddr, value, size } if (vaddr_idx == code.ABI_PARAM3.getIdx() && value_idx == code.ABI_PARAM2.getIdx()) { code.xchg(code.ABI_PARAM2, code.ABI_PARAM3); } else if (vaddr_idx == code.ABI_PARAM3.getIdx()) { @@ -240,10 +241,9 @@ void A64EmitX64::GenFastmemFallbacks() { } } code.ZeroExtendFrom(bitsize, code.ABI_PARAM3); + code.mov(code.ABI_PARAM4, bitsize / CHAR_BIT); callback.EmitCall(code); - if (ordered) { - code.mfence(); - } + if (ordered) code.mfence(); ABI_PopCallerSaveRegistersAndAdjustStack(code); code.ret(); PerfMapRegister(write_fallbacks[std::make_tuple(ordered, bitsize, vaddr_idx, value_idx)], code.getCurr(), fmt::format("a64_write_fallback_{}", bitsize)); @@ -286,19 +286,19 @@ void A64EmitX64::GenFastmemFallbacks() { #undef Axx void A64EmitX64::EmitA64ReadMemory8(A64EmitContext& ctx, IR::Inst* inst) { - EmitMemoryRead<8, &A64::UserCallbacks::MemoryRead8>(ctx, inst); + EmitMemoryRead<8, &A64::UserCallbacks::MemoryRead>(ctx, inst); } void A64EmitX64::EmitA64ReadMemory16(A64EmitContext& ctx, IR::Inst* inst) { - EmitMemoryRead<16, &A64::UserCallbacks::MemoryRead16>(ctx, inst); + EmitMemoryRead<16, &A64::UserCallbacks::MemoryRead>(ctx, inst); } void A64EmitX64::EmitA64ReadMemory32(A64EmitContext& ctx, IR::Inst* inst) { - EmitMemoryRead<32, &A64::UserCallbacks::MemoryRead32>(ctx, inst); + EmitMemoryRead<32, &A64::UserCallbacks::MemoryRead>(ctx, inst); } void A64EmitX64::EmitA64ReadMemory64(A64EmitContext& ctx, IR::Inst* inst) { - EmitMemoryRead<64, &A64::UserCallbacks::MemoryRead64>(ctx, inst); + EmitMemoryRead<64, &A64::UserCallbacks::MemoryRead>(ctx, inst); } void A64EmitX64::EmitA64ReadMemory128(A64EmitContext& ctx, IR::Inst* inst) { @@ -306,23 +306,23 @@ void A64EmitX64::EmitA64ReadMemory128(A64EmitContext& ctx, IR::Inst* inst) { } void A64EmitX64::EmitA64WriteMemory8(A64EmitContext& ctx, IR::Inst* inst) { - EmitMemoryWrite<8, &A64::UserCallbacks::MemoryWrite8>(ctx, inst); + EmitMemoryWrite<8, &A64::UserCallbacks::MemoryWrite>(ctx, inst); } void A64EmitX64::EmitA64WriteMemory16(A64EmitContext& ctx, IR::Inst* inst) { - EmitMemoryWrite<16, &A64::UserCallbacks::MemoryWrite16>(ctx, inst); + EmitMemoryWrite<16, &A64::UserCallbacks::MemoryWrite>(ctx, inst); } void A64EmitX64::EmitA64WriteMemory32(A64EmitContext& ctx, IR::Inst* inst) { - EmitMemoryWrite<32, &A64::UserCallbacks::MemoryWrite32>(ctx, inst); + EmitMemoryWrite<32, &A64::UserCallbacks::MemoryWrite>(ctx, inst); } void A64EmitX64::EmitA64WriteMemory64(A64EmitContext& ctx, IR::Inst* inst) { - EmitMemoryWrite<64, &A64::UserCallbacks::MemoryWrite64>(ctx, inst); + EmitMemoryWrite<64, &A64::UserCallbacks::MemoryWrite>(ctx, inst); } void A64EmitX64::EmitA64WriteMemory128(A64EmitContext& ctx, IR::Inst* inst) { - EmitMemoryWrite<128, &A64::UserCallbacks::MemoryWrite64>(ctx, inst); + EmitMemoryWrite<128, &A64::UserCallbacks::MemoryWrite>(ctx, inst); } void A64EmitX64::EmitA64ClearExclusive(A64EmitContext&, IR::Inst*) { @@ -331,33 +331,33 @@ void A64EmitX64::EmitA64ClearExclusive(A64EmitContext&, IR::Inst*) { void A64EmitX64::EmitA64ExclusiveReadMemory8(A64EmitContext& ctx, IR::Inst* inst) { if (conf.fastmem_exclusive_access) { - EmitExclusiveReadMemoryInline<8, &A64::UserCallbacks::MemoryRead8>(ctx, inst); + EmitExclusiveReadMemoryInline<8, &A64::UserCallbacks::MemoryRead>(ctx, inst); } else { - EmitExclusiveReadMemory<8, &A64::UserCallbacks::MemoryRead8>(ctx, inst); + EmitExclusiveReadMemory<8, &A64::UserCallbacks::MemoryRead>(ctx, inst); } } void A64EmitX64::EmitA64ExclusiveReadMemory16(A64EmitContext& ctx, IR::Inst* inst) { if (conf.fastmem_exclusive_access) { - EmitExclusiveReadMemoryInline<16, &A64::UserCallbacks::MemoryRead16>(ctx, inst); + EmitExclusiveReadMemoryInline<16, &A64::UserCallbacks::MemoryRead>(ctx, inst); } else { - EmitExclusiveReadMemory<16, &A64::UserCallbacks::MemoryRead16>(ctx, inst); + EmitExclusiveReadMemory<16, &A64::UserCallbacks::MemoryRead>(ctx, inst); } } void A64EmitX64::EmitA64ExclusiveReadMemory32(A64EmitContext& ctx, IR::Inst* inst) { if (conf.fastmem_exclusive_access) { - EmitExclusiveReadMemoryInline<32, &A64::UserCallbacks::MemoryRead32>(ctx, inst); + EmitExclusiveReadMemoryInline<32, &A64::UserCallbacks::MemoryRead>(ctx, inst); } else { - EmitExclusiveReadMemory<32, &A64::UserCallbacks::MemoryRead32>(ctx, inst); + EmitExclusiveReadMemory<32, &A64::UserCallbacks::MemoryRead>(ctx, inst); } } void A64EmitX64::EmitA64ExclusiveReadMemory64(A64EmitContext& ctx, IR::Inst* inst) { if (conf.fastmem_exclusive_access) { - EmitExclusiveReadMemoryInline<64, &A64::UserCallbacks::MemoryRead64>(ctx, inst); + EmitExclusiveReadMemoryInline<64, &A64::UserCallbacks::MemoryRead>(ctx, inst); } else { - EmitExclusiveReadMemory<64, &A64::UserCallbacks::MemoryRead64>(ctx, inst); + EmitExclusiveReadMemory<64, &A64::UserCallbacks::MemoryRead>(ctx, inst); } } diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.cpp.inc b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.cpp.inc index 4fa14d504b..8bb8be3d5b 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.cpp.inc +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.cpp.inc @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* This file is part of the dynarmic project. * Copyright (c) 2022 MerryMage * SPDX-License-Identifier: 0BSD @@ -56,16 +59,13 @@ void AxxEmitX64::EmitMemoryRead(AxxEmitContext& ctx, IR::Inst* inst) { // Neither fastmem nor page table: Use callbacks if constexpr (bitsize == 128) { ctx.reg_alloc.HostCall(code, nullptr, {}, args[1]); - if (ordered) { - code.mfence(); - } + if (ordered) code.mfence(); code.CallFunction(memory_read_128); ctx.reg_alloc.DefineValue(code, inst, xmm1); } else { ctx.reg_alloc.HostCall(code, inst, {}, args[1]); - if (ordered) { - code.mfence(); - } + code.mov(code.ABI_PARAM3.cvt32(), bitsize / CHAR_BIT); + if (ordered) code.mfence(); Devirtualize(conf.callbacks).EmitCall(code); code.ZeroExtendFrom(bitsize, code.ABI_RETURN); } @@ -148,12 +148,12 @@ void AxxEmitX64::EmitMemoryWrite(AxxEmitContext& ctx, IR::Inst* inst) { ctx.reg_alloc.HostCall(code, nullptr); code.CallFunction(memory_write_128); } else { + // { this, vaddr, value, size } ctx.reg_alloc.HostCall(code, nullptr, {}, args[1], args[2]); + code.mov(code.ABI_PARAM4.cvt32(), bitsize / CHAR_BIT); Devirtualize(conf.callbacks).EmitCall(code); } - if (ordered) { - code.mfence(); - } + if (ordered) code.mfence(); EmitCheckMemoryAbort(ctx, inst); return; } @@ -230,12 +230,11 @@ void AxxEmitX64::EmitExclusiveReadMemory(AxxEmitContext& ctx, IR::Inst* inst) { if (ordered) { code.mfence(); } - code.CallLambda( - [](AxxUserConfig& conf, Axx::VAddr vaddr) -> T { - return conf.global_monitor->ReadAndMark(conf.processor_id, vaddr, [&]() -> T { - return (conf.callbacks->*callback)(vaddr); - }); + code.CallLambda([](AxxUserConfig& conf, Axx::VAddr vaddr) -> T { + return conf.global_monitor->ReadAndMark(conf.processor_id, vaddr, [&]() -> T { + return (conf.callbacks->*callback)(vaddr, bitsize / CHAR_BIT); }); + }); code.ZeroExtendFrom(bitsize, code.ABI_RETURN); } else { const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(code); @@ -250,12 +249,11 @@ void AxxEmitX64::EmitExclusiveReadMemory(AxxEmitContext& ctx, IR::Inst* inst) { if (ordered) { code.mfence(); } - code.CallLambda( - [](AxxUserConfig& conf, Axx::VAddr vaddr, Vector& ret) { - ret = conf.global_monitor->ReadAndMark(conf.processor_id, vaddr, [&]() -> Vector { - return (conf.callbacks->*callback)(vaddr); - }); + code.CallLambda([](AxxUserConfig& conf, Axx::VAddr vaddr, Vector& ret) { + ret = conf.global_monitor->ReadAndMark(conf.processor_id, vaddr, [&]() -> Vector { + return (conf.callbacks->*callback)(vaddr); }); + }); code.movups(result, xword[rsp + ABI_SHADOW_SPACE]); ctx.reg_alloc.ReleaseStackSpace(code, 16 + ABI_SHADOW_SPACE); diff --git a/src/dynarmic/src/dynarmic/interface/A32/config.h b/src/dynarmic/src/dynarmic/interface/A32/config.h index b93b116164..49063ed619 100644 --- a/src/dynarmic/src/dynarmic/interface/A32/config.h +++ b/src/dynarmic/src/dynarmic/interface/A32/config.h @@ -66,7 +66,9 @@ struct UserCallbacks : public TranslateCallbacks { // All reads through this callback are 4-byte aligned. // Memory must be interpreted as little endian. - std::optional MemoryReadCode(VAddr vaddr) override { return MemoryRead32(vaddr); } + std::optional MemoryReadCode(VAddr vaddr) override { + return std::uint32_t(MemoryRead(vaddr, sizeof(std::uint32_t))); + } // This function is called before the instruction at pc is read. // IR code can be emitted by the callee prior to instruction handling. @@ -80,16 +82,10 @@ struct UserCallbacks : public TranslateCallbacks { // Reads through these callbacks may not be aligned. // Memory must be interpreted as if ENDIANSTATE == 0, endianness will be corrected by the JIT. - virtual std::uint8_t MemoryRead8(VAddr vaddr) = 0; - virtual std::uint16_t MemoryRead16(VAddr vaddr) = 0; - virtual std::uint32_t MemoryRead32(VAddr vaddr) = 0; - virtual std::uint64_t MemoryRead64(VAddr vaddr) = 0; + virtual std::uint64_t MemoryRead(VAddr vaddr, std::size_t size) = 0; // Writes through these callbacks may not be aligned. - virtual void MemoryWrite8(VAddr vaddr, std::uint8_t value) = 0; - virtual void MemoryWrite16(VAddr vaddr, std::uint16_t value) = 0; - virtual void MemoryWrite32(VAddr vaddr, std::uint32_t value) = 0; - virtual void MemoryWrite64(VAddr vaddr, std::uint64_t value) = 0; + virtual void MemoryWrite(VAddr vaddr, std::uint64_t value, std::size_t size) = 0; // Writes through these callbacks may not be aligned. virtual bool MemoryWriteExclusive8(VAddr /*vaddr*/, std::uint8_t /*value*/, std::uint8_t /*expected*/) { return false; } diff --git a/src/dynarmic/src/dynarmic/interface/A64/config.h b/src/dynarmic/src/dynarmic/interface/A64/config.h index 818aed73e7..859aeba709 100644 --- a/src/dynarmic/src/dynarmic/interface/A64/config.h +++ b/src/dynarmic/src/dynarmic/interface/A64/config.h @@ -89,20 +89,16 @@ struct UserCallbacks { // All reads through this callback are 4-byte aligned. // Memory must be interpreted as little endian. - virtual std::optional MemoryReadCode(VAddr vaddr) { return MemoryRead32(vaddr); } + virtual std::optional MemoryReadCode(VAddr vaddr) { + return std::uint32_t(MemoryRead(vaddr, sizeof(std::uint32_t))); + } // Reads through these callbacks may not be aligned. - virtual std::uint8_t MemoryRead8(VAddr vaddr) = 0; - virtual std::uint16_t MemoryRead16(VAddr vaddr) = 0; - virtual std::uint32_t MemoryRead32(VAddr vaddr) = 0; - virtual std::uint64_t MemoryRead64(VAddr vaddr) = 0; + virtual std::uint64_t MemoryRead(VAddr vaddr, std::size_t size) = 0; virtual Vector MemoryRead128(VAddr vaddr) = 0; // Writes through these callbacks may not be aligned. - virtual void MemoryWrite8(VAddr vaddr, std::uint8_t value) = 0; - virtual void MemoryWrite16(VAddr vaddr, std::uint16_t value) = 0; - virtual void MemoryWrite32(VAddr vaddr, std::uint32_t value) = 0; - virtual void MemoryWrite64(VAddr vaddr, std::uint64_t value) = 0; + virtual void MemoryWrite(VAddr vaddr, std::uint64_t value, std::size_t size) = 0; virtual void MemoryWrite128(VAddr vaddr, Vector value) = 0; // Writes through these callbacks may not be aligned. diff --git a/src/dynarmic/src/dynarmic/ir/opt_passes.cpp b/src/dynarmic/src/dynarmic/ir/opt_passes.cpp index 02b8e821da..b32bbd517a 100644 --- a/src/dynarmic/src/dynarmic/ir/opt_passes.cpp +++ b/src/dynarmic/src/dynarmic/ir/opt_passes.cpp @@ -40,7 +40,7 @@ static void ConstantMemoryReads(IR::Block& block, A32::UserCallbacks* cb) { if (inst.AreAllArgsImmediates()) { const u32 vaddr = inst.GetArg(1).GetU32(); if (cb->IsReadOnlyMemory(vaddr)) { - const u8 value_from_memory = cb->MemoryRead8(vaddr); + const u8 value_from_memory = u8(cb->MemoryRead(vaddr, sizeof(u8))); inst.ReplaceUsesWith(IR::Value{value_from_memory}); } } @@ -51,7 +51,7 @@ static void ConstantMemoryReads(IR::Block& block, A32::UserCallbacks* cb) { if (inst.AreAllArgsImmediates()) { const u32 vaddr = inst.GetArg(1).GetU32(); if (cb->IsReadOnlyMemory(vaddr)) { - const u16 value_from_memory = cb->MemoryRead16(vaddr); + const u16 value_from_memory = u16(cb->MemoryRead(vaddr, sizeof(u16))); inst.ReplaceUsesWith(IR::Value{value_from_memory}); } } @@ -62,7 +62,7 @@ static void ConstantMemoryReads(IR::Block& block, A32::UserCallbacks* cb) { if (inst.AreAllArgsImmediates()) { const u32 vaddr = inst.GetArg(1).GetU32(); if (cb->IsReadOnlyMemory(vaddr)) { - const u32 value_from_memory = cb->MemoryRead32(vaddr); + const u32 value_from_memory = u32(cb->MemoryRead(vaddr, sizeof(u32))); inst.ReplaceUsesWith(IR::Value{value_from_memory}); } } @@ -73,7 +73,7 @@ static void ConstantMemoryReads(IR::Block& block, A32::UserCallbacks* cb) { if (inst.AreAllArgsImmediates()) { const u32 vaddr = inst.GetArg(1).GetU32(); if (cb->IsReadOnlyMemory(vaddr)) { - const u64 value_from_memory = cb->MemoryRead64(vaddr); + const u64 value_from_memory = u64(cb->MemoryRead(vaddr, sizeof(u64))); inst.ReplaceUsesWith(IR::Value{value_from_memory}); } } diff --git a/src/dynarmic/tests/A32/fuzz_thumb.cpp b/src/dynarmic/tests/A32/fuzz_thumb.cpp index 67a01daf9c..a29b877f3e 100644 --- a/src/dynarmic/tests/A32/fuzz_thumb.cpp +++ b/src/dynarmic/tests/A32/fuzz_thumb.cpp @@ -503,7 +503,7 @@ TEST_CASE("Fuzz Thumb32 instructions set", "[JitX64][Thumb][Thumb32]") { } } -TEST_CASE("Verify fix for off by one error in MemoryRead32 worked", "[Thumb][Thumb16]") { +TEST_CASE("Verify fix for off by one error in MemoryRead<32> worked", "[Thumb][Thumb16]") { ThumbTestEnv test_env; // Prepare test subjects diff --git a/src/dynarmic/tests/A32/test_arm_instructions.cpp b/src/dynarmic/tests/A32/test_arm_instructions.cpp index 5a27cd499c..ee24131386 100644 --- a/src/dynarmic/tests/A32/test_arm_instructions.cpp +++ b/src/dynarmic/tests/A32/test_arm_instructions.cpp @@ -553,9 +553,9 @@ TEST_CASE("arm: Memory access (fastmem)", "[arm][A32]") { memset(backing_memory, 0, memory_size); memcpy(backing_memory + 0x100, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", 57); - env.MemoryWrite32(0, 0xE5904000); // LDR R4, [R0] - env.MemoryWrite32(4, 0xE5814000); // STR R4, [R1] - env.MemoryWrite32(8, 0xEAFFFFFE); // B . + env.MemoryWrite(0, 0xE5904000, sizeof(u32)); // LDR R4, [R0] + env.MemoryWrite(4, 0xE5814000, sizeof(u32)); // STR R4, [R1] + env.MemoryWrite(8, 0xEAFFFFFE, sizeof(u32)); // B . jit.Regs()[0] = 0x100; jit.Regs()[1] = 0x1F0; jit.Regs()[15] = 0; // PC = 0 diff --git a/src/dynarmic/tests/A32/testenv.h b/src/dynarmic/tests/A32/testenv.h index bebc2566da..a22cc7131e 100644 --- a/src/dynarmic/tests/A32/testenv.h +++ b/src/dynarmic/tests/A32/testenv.h @@ -16,6 +16,7 @@ #include "common/assert.h" #include "common/common_types.h" +#include "dynarmic/frontend/A32/translate/translate_callbacks.h" #include "dynarmic/interface/A32/a32.h" template @@ -59,42 +60,51 @@ public: return infinite_loop_u32; // B . } - std::uint8_t MemoryRead8(u32 vaddr) override { - if (IsInCodeMem(vaddr)) { - return reinterpret_cast(code_mem.data())[vaddr]; + u64 MemoryRead(u32 vaddr, size_t size) override { + switch (size) { + case sizeof(u64): + return MemoryRead(vaddr, sizeof(u32)) + | MemoryRead(vaddr + sizeof(u32), sizeof(u32)) << 32; + case sizeof(u32): + return MemoryRead(vaddr, sizeof(u16)) + | MemoryRead(vaddr + sizeof(u16), sizeof(u16)) << 16; + case sizeof(u16): + return MemoryRead(vaddr, sizeof(u8)) + | MemoryRead(vaddr + sizeof(u8), sizeof(u8)) << 8; + case sizeof(u8): { + if (IsInCodeMem(vaddr)) + return reinterpret_cast(code_mem.data())[vaddr]; + if (auto iter = modified_memory.find(vaddr); iter != modified_memory.end()) + return iter->second; + return u8(vaddr); } - if (auto iter = modified_memory.find(vaddr); iter != modified_memory.end()) { - return iter->second; + default: + std::abort(); } - return static_cast(vaddr); - } - std::uint16_t MemoryRead16(u32 vaddr) override { - return u16(MemoryRead8(vaddr)) | u16(MemoryRead8(vaddr + 1)) << 8; - } - std::uint32_t MemoryRead32(u32 vaddr) override { - return u32(MemoryRead16(vaddr)) | u32(MemoryRead16(vaddr + 2)) << 16; - } - std::uint64_t MemoryRead64(u32 vaddr) override { - return u64(MemoryRead32(vaddr)) | u64(MemoryRead32(vaddr + 4)) << 32; } - void MemoryWrite8(u32 vaddr, std::uint8_t value) override { - if (vaddr < code_mem.size() * sizeof(u32)) { - code_mem_modified_by_guest = true; + void MemoryWrite(Dynarmic::A32::VAddr vaddr, u64 value, size_t size) override { + switch (size) { + case sizeof(u64): + MemoryWrite(vaddr, u32(value), sizeof(u32)); + MemoryWrite(vaddr + 4, u32(value >> 32), sizeof(u32)); + break; + case sizeof(u32): + MemoryWrite(vaddr, u16(value), sizeof(u16)); + MemoryWrite(vaddr + 2, u16(value >> 16), sizeof(u16)); + break; + case sizeof(u16): + MemoryWrite(vaddr, u8(value), sizeof(u8)); + MemoryWrite(vaddr + 1, u8(value >> 8), sizeof(u8)); + break; + case sizeof(u8): + if (vaddr < code_mem.size() * sizeof(u32)) + code_mem_modified_by_guest = true; + modified_memory[vaddr] = value; + break; + default: + std::abort(); } - modified_memory[vaddr] = value; - } - void MemoryWrite16(u32 vaddr, std::uint16_t value) override { - MemoryWrite8(vaddr, static_cast(value)); - MemoryWrite8(vaddr + 1, static_cast(value >> 8)); - } - void MemoryWrite32(u32 vaddr, std::uint32_t value) override { - MemoryWrite16(vaddr, static_cast(value)); - MemoryWrite16(vaddr + 2, static_cast(value >> 16)); - } - void MemoryWrite64(u32 vaddr, std::uint64_t value) override { - MemoryWrite32(vaddr, static_cast(value)); - MemoryWrite32(vaddr + 4, static_cast(value >> 32)); } void CallSVC(std::uint32_t swi) override { @@ -143,46 +153,41 @@ public: return read(vaddr); } - std::uint8_t MemoryRead8(std::uint32_t vaddr) override { - return read(vaddr); - } - std::uint16_t MemoryRead16(std::uint32_t vaddr) override { - return read(vaddr); - } - std::uint32_t MemoryRead32(std::uint32_t vaddr) override { - return read(vaddr); - } - std::uint64_t MemoryRead64(std::uint32_t vaddr) override { - return read(vaddr); + u64 MemoryRead(u32 vaddr, size_t size) override { + switch (size) { + case sizeof(u64): return read(vaddr); + case sizeof(u32): return read(vaddr); + case sizeof(u16): return read(vaddr); + case sizeof(u8): return read(vaddr); + default: + std::abort(); + } } - void MemoryWrite8(std::uint32_t vaddr, std::uint8_t value) override { - write(vaddr, value); - } - void MemoryWrite16(std::uint32_t vaddr, std::uint16_t value) override { - write(vaddr, value); - } - void MemoryWrite32(std::uint32_t vaddr, std::uint32_t value) override { - write(vaddr, value); - } - void MemoryWrite64(std::uint32_t vaddr, std::uint64_t value) override { - write(vaddr, value); + void MemoryWrite(Dynarmic::A32::VAddr vaddr, std::uint64_t value, size_t size) override { + switch (size) { + case sizeof(u64): return write(vaddr, u64(value)); + case sizeof(u32): return write(vaddr, u32(value)); + case sizeof(u16): return write(vaddr, u16(value)); + case sizeof(u8): return write(vaddr, u8(value)); + default: std::abort(); + } } - bool MemoryWriteExclusive8(std::uint32_t vaddr, std::uint8_t value, [[maybe_unused]] std::uint8_t expected) override { - MemoryWrite8(vaddr, value); + bool MemoryWriteExclusive8(Dynarmic::A32::VAddr vaddr, std::uint8_t value, [[maybe_unused]] std::uint8_t expected) override { + MemoryWrite(vaddr, value, sizeof(u8)); return true; } - bool MemoryWriteExclusive16(std::uint32_t vaddr, std::uint16_t value, [[maybe_unused]] std::uint16_t expected) override { - MemoryWrite16(vaddr, value); + bool MemoryWriteExclusive16(Dynarmic::A32::VAddr vaddr, std::uint16_t value, [[maybe_unused]] std::uint16_t expected) override { + MemoryWrite(vaddr, value, sizeof(u16)); return true; } - bool MemoryWriteExclusive32(std::uint32_t vaddr, std::uint32_t value, [[maybe_unused]] std::uint32_t expected) override { - MemoryWrite32(vaddr, value); + bool MemoryWriteExclusive32(Dynarmic::A32::VAddr vaddr, std::uint32_t value, [[maybe_unused]] std::uint32_t expected) override { + MemoryWrite(vaddr, value, sizeof(u32)); return true; } - bool MemoryWriteExclusive64(std::uint32_t vaddr, std::uint64_t value, [[maybe_unused]] std::uint64_t expected) override { - MemoryWrite64(vaddr, value); + bool MemoryWriteExclusive64(Dynarmic::A32::VAddr vaddr, std::uint64_t value, [[maybe_unused]] std::uint64_t expected) override { + MemoryWrite(vaddr, value, sizeof(u64)); return true; } diff --git a/src/dynarmic/tests/A64/a64.cpp b/src/dynarmic/tests/A64/a64.cpp index 99cc9d3d4d..24ddfd4084 100644 --- a/src/dynarmic/tests/A64/a64.cpp +++ b/src/dynarmic/tests/A64/a64.cpp @@ -1006,8 +1006,8 @@ TEST_CASE("A64: 128-bit exclusive read/write", "[a64]") { REQUIRE(jit.GetRegister(1) == 0x7f7e7d7c7b7a7978); REQUIRE(jit.GetRegister(2) == 0x8786858483828180); REQUIRE(jit.GetRegister(4) == 0); - REQUIRE(env.MemoryRead64(0x1234567812345678) == 0xaf00d1e5badcafe0); - REQUIRE(env.MemoryRead64(0x1234567812345680) == 0xd0d0cacad0d0caca); + REQUIRE(env.MemoryRead(0x1234567812345678, sizeof(u64)) == 0xaf00d1e5badcafe0); + REQUIRE(env.MemoryRead(0x1234567812345680, sizeof(u64)) == 0xd0d0cacad0d0caca); } TEST_CASE("A64: CNTPCT_EL0", "[a64]") { @@ -1517,11 +1517,11 @@ TEST_CASE("A64: Memory access (fastmem)", "[a64]") { memset(backing_memory, 0, memory_size); memcpy(backing_memory + 0x100, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", 57); - env.MemoryWrite32(0, 0xA9401404); // LDP X4, X5, [X0] - env.MemoryWrite32(4, 0xF9400046); // LDR X6, [X2] - env.MemoryWrite32(8, 0xA9001424); // STP X4, X5, [X1] - env.MemoryWrite32(12, 0xF9000066); // STR X6, [X3] - env.MemoryWrite32(16, 0x14000000); // B . + env.MemoryWrite(0, 0xA9401404, sizeof(u32)); // LDP X4, X5, [X0] + env.MemoryWrite(4, 0xF9400046, sizeof(u32)); // LDR X6, [X2] + env.MemoryWrite(8, 0xA9001424, sizeof(u32)); // STP X4, X5, [X1] + env.MemoryWrite(12, 0xF9000066, sizeof(u32)); // STR X6, [X3] + env.MemoryWrite(16, 0x14000000, sizeof(u32)); // B . jit.SetRegister(0, 0x100); jit.SetRegister(1, 0x1F0); jit.SetRegister(2, 0x10F); @@ -1788,8 +1788,8 @@ TEST_CASE("A64: rand3", "[a64]") { memset(backing_memory, 0, memory_size); // cat rand2.txt | awk '{print "env.code_mem.emplace_back(0x"$2"); // "$0}' > rand2-out.tx - env.MemoryWrite32(100, 0x58028edd); // 0000000000000084 58028edd ldr x29, #20952 - env.MemoryWrite32(104, 0x14000000); // 0000000000000ea4 14000000 b #0 + env.MemoryWrite(100, 0x58028edd, sizeof(u32)); // 0000000000000084 58028edd ldr x29, #20952 + env.MemoryWrite(104, 0x14000000, sizeof(u32)); // 0000000000000ea4 14000000 b #0 jit.SetPC(100); jit.SetPstate(0xb0000000); @@ -1824,7 +1824,7 @@ TEST_CASE("A64: rand2", "[a64][.]") { // cat rand2.txt | awk '{print "env.code_mem.emplace_back(0x"$2"); // "$0}' > rand2-out.tx const std::array code32 = {0xea80f352, 0x6e65e59d, 0x1e20c343, 0x2e3a7192, 0x2e267249, 0xd500405f, 0x6f01f461, 0x6eb684fc, 0x58028edd, 0x0ea5f5b6, 0x0ea069fb, 0x2e769517, 0x5e066063, 0x1e65c3f5, 0x4f00ff52, 0x93401cf6, 0x1e274248, 0x6f67aaf5, 0x5e0c0782, 0x5ef43f3c, 0x2e6595b7, 0x4e20590f, 0xb35aa451, 0x6ee2c5ed, 0x4e32bf46, 0x2ea1ba8f, 0x2f68a85e, 0x9237d90a, 0x5e23dd10, 0x0e762e32, 0x4e31a8cf, 0xce1f3360, 0x781a4ac0, 0x13834066, 0x5fa8101c, 0x6f7c5594, 0x0e71bb68, 0xbc0b3e8f, 0x785dbbda, 0x6f51e794, 0xce50af75, 0x1ad728ec, 0x6ee0da4c, 0xb84efa14, 0x2eb3f613, 0x4e287ade, 0x4eb8c734, 0x2e83f4e8, 0x0e397c80, 0xd08f93f8, 0xce718e48, 0x0f672a0d, 0x2e9edd40, 0x0e14128b, 0x6f5942e6, 0x8b3a0f03, 0x3c5d16b9, 0x7f7e3743, 0x4f4c54e4, 0x0ea0a9e9, 0x9e59dbe6, 0x6e7ddcd3, 0xcec08377, 0x9ba759f8, 0x2ea5046e, 0x0e24c569, 0xb8979780, 0x4e31b98c, 0x4efe4f46, 0x4ea7c762, 0x7e61c9c6, 0x6e30c880, 0x1ada0c25, 0x4e603a2f, 0xda9d7218, 0x0d40c5d9, 0x5e214b05, 0x9ba9efc5, 0x5e61b81e, 0x6e7bc31c, 0x0e61a163, 0x9e5832d2, 0x4e772248, 0x4e3d17c8, 0x92624f60, 0x7a1a02dc, 0x79891f65, 0x6eb45036, 0x0e321ee8, 0x4e2566f0, 0x4ea02b9b, 0x0f9dcb3d, 0x2e21b9f9, 0x0e21a8c3, 0xda1700bd, 0x6ea0fb38, 0x7e607a0b, 0x72845817, 0x7f61068e, 0x0d60e529, 0x4ea0ca5c, 0x1a94b20f, 0x8b87419d, 0x7ea9ed71, 0x2ea1a86e, 0x4d40c4da, 0x5ea0eada, 0x784ba96e, 0x7eb6ee02, 0x3db1c710, 0x0e217836, 0x7ee0bb96, 0x4e786c08, 0x4e976a08, 0x489ffe86, 0x4e79fc9b, 0x0e21cbce, 0x5ef7fc65, 0x4ea1286d, 0xd29c771e, 0x6f5c2839, 0x0ea00a9d, 0x6ee44c06, 0x5ee1d858, 0x5ef2fda6, 0x7eb0c9fe, 0x7f762791, 0x2e212ae6, 0x4e61c9db, 0x13003c57, 0x5ee1b8f8, 0x0f2396d2, 0x6ea0db1e, 0x0e71ba82, 0xab29c807, 0x6ef8f8b3, 0x1f18d4a1, 0x0e261d15, 0x1e290081, 0x1b0c7d12, 0x4e7771c3, 0xf845f1e4, 0x4d40c9e8, 0xce778452, 0x6eb9879d, 0x6e21c93d, 0xcec0829f, 0x52a0969f, 0x1e772b4f, 0x7ee1da88, 0x5f52fe0a, 0x7f3387b1, 0x5e214850, 0x1e65c025, 0x0e2ca294, 0x2e614829, 0x1e640077, 0x9e240048, 0x4ebe9537, 0x9bb7925e, 0x38b669c5, 0x2840d089, 0x6f43e648, 0x2e662d28, 0x4eabaff3, 0x6e734cc7, 0x0e31baee, 0x7ee0d93c, 0x5e282bde, 0x7e21bba4, 0x4e6c75fa, 0x5ac01217, 0x7f4304af, 0x1e7878ed, 0x1ada2196, 0x7ee1aba3, 0x93407f3c, 0x4f6c34eb, 0x6e3447a9, 0x7e7ae545, 0x5e0802bb, 0x6eeae63a, 0x7ee1da62, 0x5e280bb3, 0xf81d4009, 0x1e603b21, 0x5e281a14, 0x6eb0a99b, 0x1e266a25, 0x0d60cafe, 0x0e0b6194, 0x7a4ed2c5, 0x92b762ec, 0x4e6b5749, 0x3c16a6e5, 0x4ea0a92b, 0x0fa58b6a, 0x5f76148c, 0x6e30c95f, 0x1e6540fd, 0x5e28e40f, 0x0d403fd4, 0x7e30da36, 0x7fda9b51, 0x2ea04bde, 0x1e25c3d2, 0x1ee0434c, 0x5e21d8e7, 0x5ee1ba51, 0x5e61aba9, 0x4e2849fb, 0x5ee098ea, 0x4e60f63d, 0x0f280443, 0x5ee0da27, 0x2e78a6ce, 0x78054afc, 0x4e14286b, 0x4e218bd8, 0x2a3d2551, 0x3a04017a, 0x5f4317cd, 0x0e604a37, 0x9a834614, 0x0e2edf4d, 0x7a51a0a0, 0x5f8e9043, 0x6ea06bb2, 0xaa2857dd, 0x7a1903fc, 0x301ba9ba, 0x9ac929cd, 0x4e061ff0, 0x2e38fcfc, 0x0e2f614a, 0x7ee0d8e4, 0x6e73afda, 0x7f4156f7, 0x0e6078bf, 0x4ee1d9ed, 0x93403fbe, 0xce6f8640, 0x4e3855e3, 0x6f76fe23, 0x112466e8, 0x1e358a90, 0x7f45272c, 0x6ea19a9d, 0x8a696350, 0x1e3900f6, 0x5e61c866, 0x0e3fbfd0, 0x5ee09ad0, 0x0e651d27, 0x4dffc35e, 0x2e20c6ce, 0x0fbe118d, 0x1e656a15, 0xd1357365, 0x0e20a847, 0xce4a835c, 0x4e203905, 0x2e60090d, 0x7f4a27bb, 0x1e64c316, 0xce7d86a4, 0x7ebded2d, 0x6e70a97e, 0x4eb9a42b, 0x0e209bef, 0x6f151730, 0x0e7e30f7, 0x4e724509, 0xd503375f, 0xce58b6ae, 0x5e21a9b8, 0xcb2ca538, 0x5ac01131, 0x6ea19a24, 0xeb40c8b3, 0xc8df7d65, 0x78108341, 0x3218ab9b, 0x0f3da7dd, 0x2e003089, 0x4e21cab5, 0x8aa5c924, 0x1a94950c, 0x123e506f, 0x13117e37, 0x1ee6005b, 0x5ac00647, 0x5eec8cd5, 0x7ef0fb3d, 0x9223272a, 0x5ee0cb02, 0x6e66071d, 0x6ea1dbbf, 0x5e61c903, 0x5ac015ea, 0x93db6206, 0x7e62b5e3, 0x6ea0c87b, 0xdac0090e, 0x48df7d90, 0x6e206ba5, 0x9e2503c2, 0x6e25fc89, 0x4d60e2db, 0x1e3e22a0, 0x2eb81c19, 0x7856ea00, 0x5fbfb22d, 0x1e630244, 0x4e202a83, 0x1f50a722, 0x7f7b55d2, 0x0fae89b9, 0x4e781d73, 0xce738c3a, 0x4f15a591, 0x6e21c7e1, 0x586ff77e, 0x8a5d3592, 0x93401c67, 0x5e61cb86, 0xce6bc2c1, 0x6e393f10, 0x9bb70ec3, 0xdac0098c, 0x4da84b95, 0x7f494476, 0x9ace5c11, 0x7e61ca14, 0x4f7a60ef, 0x1ad32b39, 0x0ea3777f, 0x5e61da7f, 0x4f1404e2, 0x4e3244e2, 0x6e1b1ceb, 0x0dee5aac, 0x4e2f9dc4, 0x5ea1b8c3, 0x1e59f863, 0xd500403f, 0x4e3ae7d0, 0x4ef5c6ea, 0x08dffe3b, 0x6e36f4f6, 0x2e764f29, 0x0e726f23, 0x5f42375b, 0x7f71fc40, 0x6e618aad, 0x93403e5b, 0x0e205976, 0x0e7250c4, 0x6eb0abc9, 0x2e2049f0, 0x5f14754d, 0x7f6ce468, 0x6f950bbe, 0x6e31aa47, 0x4eb83396, 0x0dccc952, 0x2ea1ca90, 0xce69c701, 0xb0bed69e, 0x7c5dec39, 0x4e2868a2, 0x0e591b08, 0x5f34e6dd, 0x3a449184, 0x5e3ce6de, 0x4ea149b7, 0x4e7ad29b, 0xba198503, 0x1f683e8f, 0xfa52f2a7, 0x6e30dffc, 0x4e6c3d17, 0x2eae3248, 0xd503349f, 0x1e60002c, 0x0f180680, 0x9e240049, 0x6f75774e, 0xa90d8678, 0x9ad924c4, 0x7eb0f85b, 0x0e205aaf, 0x7ee08899, 0x5f4bffd8, 0x1b0ff5f3, 0x4ee11dcd, 0x2e218948, 0x0dcb2733, 0x4eac107c, 0x4ea04a53, 0x4e287b44, 0x0e60b82a, 0x5ee0ebbc, 0xce454ff1, 0x5e1761e7, 0x5e09202f, 0x0e0c0754, 0x1e72e6b9, 0x7e21da70, 0x0fbdb20c, 0x5efb8c84, 0xd500401f, 0x3a47526e, 0x1e680acf, 0x7f7375fc, 0xf80522da, 0x4ee60c02, 0x4d40c2e7, 0x6f89096b, 0x7ee1bb6e, 0x5e280b4a, 0x1e3120c8, 0x7eb2ef96, 0x4fd012dd, 0x0f3027ef, 0x4e2078a8, 0xd503201f, 0x2e2312d9, 0x6ebf1c6e, 0x5ee1f8df, 0x4e607a46, 0x6e30c877, 0x6c09d2d1, 0x4e61abd8, 0x0e35267e, 0x6ac17728, 0x0e861aa0, 0x6f63fe26, 0x6f157628, 0x6f30a5f9, 0x4d60cc0c, 0x4e21cb59, 0x2e68a3fb, 0x7efae601, 0x6ea0f82c, 0x9b25ec12, 0x1a1a0305, 0x0e043fe1, 0x6e73c0ed, 0x6ea1b8c0, 0x7e20380b, 0x0f0534e8, 0x1f56bc7d, 0xba0c0128, 0x1e672160, 0x6e7b259b, 0x7ee07b5d, 0x9a820443, 0x4e040581, 0x2f1d87e8, 0x1acd2f5b, 0x6e20794f, 0x2e6a3c93, 0xc8dffe13, 0xce5ab1c6, 0x6eea55f6, 0x4ea039b3, 0x0d602fec, 0x2e246e2f, 0x7857be39, 0xb80608fb, 0x1e67c017, 0x9bcf7f63, 0x0f92d857, 0x5e0812f7, 0x1e210172, 0x7e6128e9, 0x7ea94d41, 0x981179e1, 0x1effb018, 0x2e600828, 0x0eb9c6b2, 0x6ee1baae, 0x4ea0db28, 0x2ea1487b, 0x4ea6c7f0, 0x2e2374c7, 0x7e30d8dd, 0xb9991fa7, 0x4e791e3e, 0x889f7c4b, 0x0e6c753c, 0x1e740ad1, 0x1e244324, 0x1ef33010, 0x5ac01102, 0x9bd97fba, 0x6e290143, 0x1e2220d8, 0x4d8d5aee, 0x6f28570b, 0xfa4ab0c1, 0xdac00b14, 0x7ea1a90e, 0x2e3027d8, 0x6f25a733, 0x4e61a96e, 0x4e1a2fcb, 0x0e22fe0a, 0xc8df7cd0, 0x5e280a55, 0x4e012b20, 0x7e70dbf4, 0x520c5a4e, 0x6ea6c57f, 0x0e861af8, 0xd503233f, 0x889ffe3c, 0x5e274ea9, 0x4e21a89a, 0x0e170c02, 0x6efd4c0b, 0xd5033ebf, 0x6e61a92c, 0x2e205b72, 0x789fb828, 0x0e626e94, 0x2ea6724c, 0x9a10028b, 0x2c6c51fc, 0x5a9de6b9, 0x6e6881f3, 0x5ee0ea6b, 0x0faec36e, 0x0e955bca, 0x1acf206d, 0x7f6f571b, 0x4e286930, 0x12b41ceb, 0x1e770b7a, 0x0ea18ac2, 0x5e282aaf, 0xf2b7fa1e, 0x1ac34311, 0x13167d11, 0x4ea63412, 0x6e758038, 0x2f1d85d6, 0x0f275480, 0x0ead6c71, 0x6e204b69, 0x1e6303f4, 0x5e0031ef, 0x13001e40, 0x7a16006f, 0x6e6ae4c0, 0x0f0f242f, 0x6e674f50, 0x4e606b7a, 0x7e6ee684, 0x1e6b5957, 0x7ea1bbab, 0x7ea0b6cb, 0xce4da241, 0x0ea1b953, 0x0eb2af4b, 0x9ac309d0, 0x6e61d8bd, 0x5ea0d890, 0x5f47d1e7, 0xfa5981ca, 0x1e7f7959, 0x6ef24dd8, 0x0e0a41d1, 0x5ee0e898, 0x4e6038e2, 0x13097d65, 0x6f839088, 0x9e290265, 0x0e208824, 0x2e65af79, 0x6f36a561, 0x9ad3204b, 0x0e21482e, 0x1e24431d, 0xd50330bf, 0x0df641aa, 0x6e602a83, 0xce30505f, 0x5e025238, 0xd503201f, 0x4e608880, 0x4de9c38d, 0x5e0f5348, 0x6eb48ca9, 0x50fda31b, 0x2e251eec, 0x7842ba50, 0xd8a1cd86, 0x2ea09862, 0x0ea09983, 0x2ea333b0, 0x0ea6032c, 0x4f94801b, 0x7e3ee57d, 0x38135e4f, 0xd8fdd9dd, 0x5ee0fcde, 0x9e64033d, 0x6e37f547, 0x6e3dd7ef, 0x13003f3d, 0x0e602f9f, 0x4e7ad014, 0x9b3b6857, 0x5ea0cb67, 0x0eb31c9f, 0x4e7c5372, 0x5e61b8c0, 0x0ea19b23, 0x0ee6e1df, 0x6e63a626, 0x2f139405, 0x7eb0f96d, 0x9e588c63, 0x2e714c3a, 0x6e8c941e, 0x0f61b331, 0x6f01f625, 0x4e78d4ea, 0x6f403709, 0x1a0300da, 0xda0102c8, 0x7e61d9fd, 0xb89469bb, 0x0c838780, 0x2e60a590, 0x4dfd29e1, 0x4e150f2e, 0xce2810bc, 0x5f541591, 0x9ee60259, 0x2eb40e56, 0x5e014027, 0x2ef71faf, 0x4e2d452f, 0x5ee0a813, 0x4eb03301, 0x38443acf, 0x6eabd502, 0x0e2ee71e, 0x5a960364, 0xce7ec596, 0x7efbed09, 0x4ef42ea2, 0x0eb30ea5, 0x5ee0d9f8, 0x6f513552, 0xf89eb3fa, 0x7ea2eca6, 0x9b00cc19, 0xf897409e, 0x1e73485f, 0x381afa77, 0x0f169f3b, 0x5ee1aa70, 0x5e1803ee, 0x0dbf5a4c, 0xce78c7a6, 0x9b0b260c, 0x2ef8fa19, 0x6e70aa4b, 0xce45b805, 0x2ea08e86, 0x4ee0bafd, 0x2ea09a1f, 0x4e218900, 0x6e744f13, 0xce518653, 0xf81b7a68, 0xce45ac5e, 0x7e62e416, 0x1a1b02b6, 0x7e21db48, 0x381daaaf, 0x6b2c0987, 0x0e2ec651, 0x4eae8502, 0x9bde7ca0, 0x6f47201f, 0x7e61a8a3, 0x6e60d5db, 0x4e2879de, 0xf81d194e, 0x4f1b8d05, 0x4d0048b2, 0x6e203be9, 0x4e3e7eb1, 0x0e260ef8, 0x2e688518, 0x7e3fec46, 0xdac00843, 0xf85c8917, 0x2e212a0f, 0x0e8196da, 0xd503359f, 0xce4c81f2, 0x6ee19992, 0x6e21ca79, 0x4d40c1d2, 0x4f5816ef, 0x4e34c3ea, 0x4df7c283, 0x7ef7eeb6, 0x18e276ce, 0xab0d21c0, 0xd5032f7f, 0x4ea00dbf, 0x5ac01251, 0xd0121955, 0x7f1495e4, 0x7ef0fa11, 0x5e24dd9c, 0x9add25b5, 0x0eb2bdef, 0x9e1977c7, 0x6f4b26bd, 0x0e200a9c, 0x9b4f7c00, 0x0ea0392e, 0x7e212a2c, 0x0b248b90, 0x1acc27a1, 0x2e701c90, 0x5ee1b870, 0x5e280aba, 0x5ea0780e, 0x1e264246, 0x4e052d04, 0x0e731dc4, 0xce461997, 0x9a9e9413, 0x3d462048, 0x5ea1fac5, 0x2ea0c8c4, 0x9a030280, 0x2ebda4b8, 0x5eef8614, 0x6eadc4e0, 0xbd035a8f, 0x4e606b84, 0x4eb1aba1, 0x4e286928, 0x4e2858cc, 0x9add0ce9, 0x4e070d65, 0x5fd399d5, 0x0f03fde7, 0x6ee90c74, 0x4ef8e31e, 0x381d986a, 0x5ea0ebf4, 0x5ea0d87e, 0x2e76ac9e, 0x6eb36cd4, 0x2e6e1c4c, 0x2e2feebc, 0x1ace4b03, 0x5ee0db12, 0x5ea0e9b1, 0x2e1c32d5, 0x5fa49a09, 0x0e258737, 0x7e21ca8e, 0xce4f9988, 0x5f7f56a6, 0x0e739766, 0x4e28586c, 0x6e619908, 0xd500401f, 0xf88b9252, 0x6e251c8e, 0x9e20015b, 0x7f1486b9, 0x717c339b, 0x1f31ff70, 0x4ea0eb62, 0x9acb0926, 0x489f7d85, 0x4e209b54, 0x2e84cf03, 0x2e65946c, 0x0e7d80cd, 0xc8dffecc, 0xce668bd8, 0x6e2188af, 0xeb4ada34, 0x2b25ec33, 0x0d40e6e7, 0x4eb2c757, 0x4ec82ad0, 0x7e21cb0a, 0x0e21a847, 0x4e0b1ec0, 0x381e6ac0, 0x6e61c8f5, 0x0f10071c, 0x2ee21daa, 0x5e61ab31, 0x6e218892, 0x2e7e7cb5, 0x6f2826aa, 0x7f6b54df, 0x4eaa2620, 0xdac00034, 0x4f6477be, 0x7e6148ea, 0x4eef1f57, 0x78459aeb, 0x2ebc3f10, 0x2e35f4eb, 0x4fbf19ce, 0xd8d0e58e, 0x2e21bbc7, 0x6ee0cab6, 0x9bc57e3f, 0x2f854037, 0x4e92181c, 0x6e6d1f89, 0x0f305545, 0x4ee19a57, 0x0e887bdf, 0x5e1a4185, 0x7ef0c821, 0x2eb6607c, 0x2ea0d9b8, 0x9e0380f4, 0x2ebf1c83, 0x1e62597d, 0x7f6e2548, 0x5ac00205, 0x4e616adb, 0xce638b8c, 0x5e1653cf, 0x2e6069be, 0x0e2ac641, 0x1e33c76f, 0xce44956d, 0x9bb90d31, 0x1e24c20a, 0x7ee038c1, 0x93407e5e, 0x4e280127, 0xc8df7f7d, 0xba42f263, 0x1e6f199c, 0x6e212889, 0x6e92f60e, 0x6ebdc499, 0x8b9acbf8, 0x4d40c581, 0x3a020250, 0x6e6a6716, 0x9248403b, 0x9081ffea, 0x4e603856, 0x9ad1242b, 0x6f270579, 0x1a070349, 0xcec08133, 0xd503305f, 0x5a1a00ca, 0x2e60b8a2, 0x0e5f28fd, 0x0e31a3da, 0x7e61cbc1, 0xd503399f, 0x5f5e54aa, 0x0eb8bdea, 0x4eba8f10, 0x4e2a2e60, 0x2f3da7d6, 0x1e58e297, 0x6e71aa3e, 0x6b86701a, 0xce4fa5e6, 0x4ee7c463, 0x8a79307f, 0x0ebea541, 0x2e218af4, 0x4e774f8a, 0xb9b95dc5, 0x6e61abd5, 0x4dd1e814, 0x4da72098, 0x98307582, 0x3a512101, 0x7ef95497, 0x1ace5535, 0x5a0c0349, 0x4e28581b, 0x6ebf1c02, 0x5ea1da23, 0x1e274314, 0x5e25dd29, 0x6e75f594, 0x6eaf6ed5, 0x4e214abe, 0x4e064172, 0x2e21c8f4, 0xf84c5b08, 0x1e244312, 0x14000000}; for (size_t i = 0; i < code32.size(); ++i) - env.MemoryWrite32(100 + i, code32[i]); + env.MemoryWrite(100 + i, code32[i], sizeof(u32)); env.ignore_invalid_insn = true; jit.SetRegister(0, 0x866524401a1d4e47); diff --git a/src/dynarmic/tests/A64/fibonacci.cpp b/src/dynarmic/tests/A64/fibonacci.cpp index f52a04e217..8816a89b1c 100644 --- a/src/dynarmic/tests/A64/fibonacci.cpp +++ b/src/dynarmic/tests/A64/fibonacci.cpp @@ -25,48 +25,55 @@ public: u64 ticks_left = 0; ::Common::unordered_map memory{}; - u8 MemoryRead8(u64 vaddr) override { - return memory[vaddr]; - } - - u16 MemoryRead16(u64 vaddr) override { - return u16(MemoryRead8(vaddr)) | u16(MemoryRead8(vaddr + 1)) << 8; - } - - u32 MemoryRead32(u64 vaddr) override { - return u32(MemoryRead16(vaddr)) | u32(MemoryRead16(vaddr + 2)) << 16; - } - - u64 MemoryRead64(u64 vaddr) override { - return u64(MemoryRead32(vaddr)) | u64(MemoryRead32(vaddr + 4)) << 32; + u64 MemoryRead(u64 vaddr, size_t size) override { + switch (size) { + case sizeof(u64): + return MemoryRead(vaddr, sizeof(u32)) + | MemoryRead(vaddr + sizeof(u32), sizeof(u32)) << 32; + case sizeof(u32): + return MemoryRead(vaddr, sizeof(u16)) + | MemoryRead(vaddr + sizeof(u16), sizeof(u16)) << 16; + case sizeof(u16): + return MemoryRead(vaddr, sizeof(u8)) + | MemoryRead(vaddr + sizeof(u8), sizeof(u8)) << 8; + case sizeof(u8): + return memory[vaddr]; + default: + std::abort(); + } } std::array MemoryRead128(u64 vaddr) override { - return {MemoryRead64(vaddr), MemoryRead64(vaddr + 8)}; + return { + MemoryRead(vaddr, sizeof(u64)), + MemoryRead(vaddr + sizeof(u64), sizeof(u64)) + }; } - void MemoryWrite8(u64 vaddr, u8 value) override { - memory[vaddr] = value; + void MemoryWrite(Dynarmic::A64::VAddr vaddr, u64 value, size_t size) override { + switch (size) { + case sizeof(u64): + MemoryWrite(vaddr, u32(value), sizeof(u32)); + MemoryWrite(vaddr + 4, u32(value >> 32), sizeof(u32)); + break; + case sizeof(u32): + MemoryWrite(vaddr, u16(value), sizeof(u16)); + MemoryWrite(vaddr + 2, u16(value >> 16), sizeof(u16)); + break; + case sizeof(u16): + MemoryWrite(vaddr, u8(value), sizeof(u8)); + MemoryWrite(vaddr + 1, u8(value >> 8), sizeof(u8)); + break; + case sizeof(u8): + memory[vaddr] = value; + break; + default: + std::abort(); + } } - - void MemoryWrite16(u64 vaddr, u16 value) override { - MemoryWrite8(vaddr, u8(value)); - MemoryWrite8(vaddr + 1, u8(value >> 8)); - } - - void MemoryWrite32(u64 vaddr, u32 value) override { - MemoryWrite16(vaddr, u16(value)); - MemoryWrite16(vaddr + 2, u16(value >> 16)); - } - - void MemoryWrite64(u64 vaddr, u64 value) override { - MemoryWrite32(vaddr, u32(value)); - MemoryWrite32(vaddr + 4, u32(value >> 32)); - } - void MemoryWrite128(u64 vaddr, std::array value) override { - MemoryWrite64(vaddr, value[0]); - MemoryWrite64(vaddr + 8, value[1]); + MemoryWrite(vaddr, value[0], sizeof(u64)); + MemoryWrite(vaddr + 8, value[1], sizeof(u64)); } void CallSVC(u32) override { @@ -135,9 +142,9 @@ TEST_CASE("A64: fibonacci", "[a64]") { code.RET(); for (size_t i = 0; i < 1024; i++) { - env.MemoryWrite32(i * 4, instructions[i]); + env.MemoryWrite(i * 4, instructions[i], sizeof(u32)); } - env.MemoryWrite32(8888, 0xd4200000); + env.MemoryWrite(8888, 0xd4200000, sizeof(u32)); cpu.SetRegister(30, 8888); cpu.SetRegister(0, 10); diff --git a/src/dynarmic/tests/A64/testenv.h b/src/dynarmic/tests/A64/testenv.h index f4ddc63a6b..11aa6389f8 100644 --- a/src/dynarmic/tests/A64/testenv.h +++ b/src/dynarmic/tests/A64/testenv.h @@ -12,6 +12,7 @@ #include "common/assert.h" #include "common/common_types.h" #include "dynarmic/interface/A64/a64.h" +#include "dynarmic/interface/A64/config.h" using Vector = Dynarmic::A64::Vector; @@ -34,64 +35,79 @@ public: return code_mem[index]; } - std::uint8_t MemoryRead8(u64 vaddr) override { - if (IsInCodeMem(vaddr)) { - return reinterpret_cast(code_mem.data())[vaddr - code_mem_start_address]; + u64 MemoryRead(u64 vaddr, size_t size) override { + switch (size) { + case sizeof(u64): + return MemoryRead(vaddr, sizeof(u32)) + | MemoryRead(vaddr + sizeof(u32), sizeof(u32)) << 32; + case sizeof(u32): + return MemoryRead(vaddr, sizeof(u16)) + | MemoryRead(vaddr + sizeof(u16), sizeof(u16)) << 16; + case sizeof(u16): + return MemoryRead(vaddr, sizeof(u8)) + | MemoryRead(vaddr + sizeof(u8), sizeof(u8)) << 8; + case sizeof(u8): { + if (IsInCodeMem(vaddr)) + return reinterpret_cast(code_mem.data())[vaddr - code_mem_start_address]; + if (auto const it = modified_memory.find(vaddr); it != modified_memory.end()) + return it->second; + return u8(vaddr); + } + default: + std::abort(); } - if (auto const it = modified_memory.find(vaddr); it != modified_memory.end()) - return it->second; - return u8(vaddr); - } - std::uint16_t MemoryRead16(u64 vaddr) override { - return u16(MemoryRead8(vaddr)) | u16(MemoryRead8(vaddr + 1)) << 8; - } - std::uint32_t MemoryRead32(u64 vaddr) override { - return u32(MemoryRead16(vaddr)) | u32(MemoryRead16(vaddr + 2)) << 16; - } - std::uint64_t MemoryRead64(u64 vaddr) override { - return u64(MemoryRead32(vaddr)) | u64(MemoryRead32(vaddr + 4)) << 32; - } - Vector MemoryRead128(u64 vaddr) override { - return {MemoryRead64(vaddr), MemoryRead64(vaddr + 8)}; } - void MemoryWrite8(u64 vaddr, std::uint8_t value) override { - if (IsInCodeMem(vaddr)) { - code_mem_modified_by_guest = true; + Vector MemoryRead128(u64 vaddr) override { + return { + MemoryRead(vaddr, sizeof(u64)), + MemoryRead(vaddr + 8, sizeof(u64)) + }; + } + + void MemoryWrite(Dynarmic::A64::VAddr vaddr, u64 value, size_t size) override { + switch (size) { + case sizeof(u64): + MemoryWrite(vaddr, u32(value), sizeof(u32)); + MemoryWrite(vaddr + 4, u32(value >> 32), sizeof(u32)); + break; + case sizeof(u32): + MemoryWrite(vaddr, u16(value), sizeof(u16)); + MemoryWrite(vaddr + 2, u16(value >> 16), sizeof(u16)); + break; + case sizeof(u16): + MemoryWrite(vaddr, u8(value), sizeof(u8)); + MemoryWrite(vaddr + 1, u8(value >> 8), sizeof(u8)); + break; + case sizeof(u8): + if (IsInCodeMem(vaddr)) { + code_mem_modified_by_guest = true; + } + modified_memory[vaddr] = value; + break; + default: + std::abort(); } - modified_memory[vaddr] = value; - } - void MemoryWrite16(u64 vaddr, std::uint16_t value) override { - MemoryWrite8(vaddr, u8(value)); - MemoryWrite8(vaddr + 1, u8(value >> 8)); - } - void MemoryWrite32(u64 vaddr, std::uint32_t value) override { - MemoryWrite16(vaddr, u16(value)); - MemoryWrite16(vaddr + 2, u16(value >> 16)); - } - void MemoryWrite64(u64 vaddr, std::uint64_t value) override { - MemoryWrite32(vaddr, u32(value)); - MemoryWrite32(vaddr + 4, u32(value >> 32)); } void MemoryWrite128(u64 vaddr, Vector value) override { - MemoryWrite64(vaddr, value[0]); - MemoryWrite64(vaddr + 8, value[1]); + MemoryWrite(vaddr, value[0], sizeof(u64)); + MemoryWrite(vaddr + 8, value[1], sizeof(u64)); } bool MemoryWriteExclusive8(u64 vaddr, std::uint8_t value, [[maybe_unused]] std::uint8_t expected) override { - MemoryWrite8(vaddr, value); + MemoryWrite(vaddr, value, sizeof(u8)); return true; } bool MemoryWriteExclusive16(u64 vaddr, std::uint16_t value, [[maybe_unused]] std::uint16_t expected) override { - MemoryWrite16(vaddr, value); + MemoryWrite(vaddr, value, sizeof(u16)); return true; } bool MemoryWriteExclusive32(u64 vaddr, std::uint32_t value, [[maybe_unused]] std::uint32_t expected) override { - MemoryWrite32(vaddr, value); + MemoryWrite(vaddr, value, sizeof(u32)); return true; } bool MemoryWriteExclusive64(u64 vaddr, std::uint64_t value, [[maybe_unused]] std::uint64_t expected) override { - MemoryWrite64(vaddr, value); + MemoryWrite(vaddr, value, sizeof(u64)); return true; } bool MemoryWriteExclusive128(u64 vaddr, Vector value, [[maybe_unused]] Vector expected) override { @@ -145,52 +161,46 @@ public: return read(vaddr); } - std::uint8_t MemoryRead8(u64 vaddr) override { - return read(vaddr); - } - std::uint16_t MemoryRead16(u64 vaddr) override { - return read(vaddr); - } - std::uint32_t MemoryRead32(u64 vaddr) override { - return read(vaddr); - } - std::uint64_t MemoryRead64(u64 vaddr) override { - return read(vaddr); + u64 MemoryRead(u64 vaddr, size_t size) override { + switch (size) { + case sizeof(u64): return read(vaddr); + case sizeof(u32): return read(vaddr); + case sizeof(u16): return read(vaddr); + case sizeof(u8): return read(vaddr); + default: std::abort(); + } } Vector MemoryRead128(u64 vaddr) override { return read(vaddr); } - void MemoryWrite8(u64 vaddr, std::uint8_t value) override { - write(vaddr, value); - } - void MemoryWrite16(u64 vaddr, std::uint16_t value) override { - write(vaddr, value); - } - void MemoryWrite32(u64 vaddr, std::uint32_t value) override { - write(vaddr, value); - } - void MemoryWrite64(u64 vaddr, std::uint64_t value) override { - write(vaddr, value); + void MemoryWrite(u64 vaddr, std::uint64_t value, size_t size) override { + switch (size) { + case sizeof(u64): return write(vaddr, u64(value)); + case sizeof(u32): return write(vaddr, u32(value)); + case sizeof(u16): return write(vaddr, u16(value)); + case sizeof(u8): return write(vaddr, u8(value)); + default: std::abort(); + } } void MemoryWrite128(u64 vaddr, Vector value) override { write(vaddr, value); } bool MemoryWriteExclusive8(u64 vaddr, std::uint8_t value, [[maybe_unused]] std::uint8_t expected) override { - MemoryWrite8(vaddr, value); + MemoryWrite(vaddr, value, sizeof(u8)); return true; } bool MemoryWriteExclusive16(u64 vaddr, std::uint16_t value, [[maybe_unused]] std::uint16_t expected) override { - MemoryWrite16(vaddr, value); + MemoryWrite(vaddr, value, sizeof(u16)); return true; } bool MemoryWriteExclusive32(u64 vaddr, std::uint32_t value, [[maybe_unused]] std::uint32_t expected) override { - MemoryWrite32(vaddr, value); + MemoryWrite(vaddr, value, sizeof(u32)); return true; } bool MemoryWriteExclusive64(u64 vaddr, std::uint64_t value, [[maybe_unused]] std::uint64_t expected) override { - MemoryWrite64(vaddr, value); + MemoryWrite(vaddr, value, sizeof(u64)); return true; } bool MemoryWriteExclusive128(u64 vaddr, Vector value, [[maybe_unused]] Vector expected) override { diff --git a/src/dynarmic/tests/print_info.cpp b/src/dynarmic/tests/print_info.cpp index 5b1c5cfe63..87f4438ad4 100644 --- a/src/dynarmic/tests/print_info.cpp +++ b/src/dynarmic/tests/print_info.cpp @@ -18,6 +18,7 @@ #include #include #include +#include "dynarmic/frontend/A32/translate/translate_callbacks.h" #include "dynarmic/mcl/bit.hpp" #include "common/common_types.h" @@ -118,36 +119,47 @@ public: u64 ticks_left = 0; std::map memory; - std::uint8_t MemoryRead8(u32 vaddr) override { - if (auto iter = memory.find(vaddr); iter != memory.end()) { - return iter->second; + u64 MemoryRead(Dynarmic::A32::VAddr vaddr, size_t size) override { + switch (size) { + case sizeof(u64): + return MemoryRead(vaddr, sizeof(u32)) + | MemoryRead(vaddr + sizeof(u32), sizeof(u32)) << 32; + case sizeof(u32): + return MemoryRead(vaddr, sizeof(u16)) + | MemoryRead(vaddr + sizeof(u16), sizeof(u16)) << 16; + case sizeof(u16): + return MemoryRead(vaddr, sizeof(u8)) + | MemoryRead(vaddr + sizeof(u8), sizeof(u8)) << 8; + case sizeof(u8): { + if (auto const it = memory.find(vaddr); it != memory.end()) + return it->second; + return 0; + } + default: + std::abort(); } - return 0; - } - std::uint16_t MemoryRead16(u32 vaddr) override { - return u16(MemoryRead8(vaddr)) | u16(MemoryRead8(vaddr + 1)) << 8; - } - std::uint32_t MemoryRead32(u32 vaddr) override { - return u32(MemoryRead16(vaddr)) | u32(MemoryRead16(vaddr + 2)) << 16; - } - std::uint64_t MemoryRead64(u32 vaddr) override { - return u64(MemoryRead32(vaddr)) | u64(MemoryRead32(vaddr + 4)) << 32; } - void MemoryWrite8(u32 vaddr, std::uint8_t value) override { - memory[vaddr] = value; - } - void MemoryWrite16(u32 vaddr, std::uint16_t value) override { - MemoryWrite8(vaddr, static_cast(value)); - MemoryWrite8(vaddr + 1, static_cast(value >> 8)); - } - void MemoryWrite32(u32 vaddr, std::uint32_t value) override { - MemoryWrite16(vaddr, static_cast(value)); - MemoryWrite16(vaddr + 2, static_cast(value >> 16)); - } - void MemoryWrite64(u32 vaddr, std::uint64_t value) override { - MemoryWrite32(vaddr, static_cast(value)); - MemoryWrite32(vaddr + 4, static_cast(value >> 32)); + void MemoryWrite(Dynarmic::A32::VAddr vaddr, u64 value, size_t size) override { + switch (size) { + case sizeof(u64): + MemoryWrite(vaddr, u32(value), sizeof(u32)); + MemoryWrite(vaddr + 4, u32(value >> 32), sizeof(u32)); + break; + case sizeof(u32): + MemoryWrite(vaddr, u16(value), sizeof(u16)); + MemoryWrite(vaddr + 2, u16(value >> 16), sizeof(u16)); + break; + case sizeof(u16): + MemoryWrite(vaddr, u8(value), sizeof(u8)); + MemoryWrite(vaddr + 1, u8(value >> 8), sizeof(u8)); + break; + case sizeof(u8): + memory[vaddr] = value; + break; + default: + std::abort(); + } } void CallSVC(std::uint32_t swi) override { @@ -231,7 +243,7 @@ void ExecuteA32Instruction(u32 instruction) { if (const auto address = get_value()) { fmt::print("value: "); if (const auto value = get_value()) { - env.MemoryWrite32(*address, *value); + env.MemoryWrite(*address, *value, sizeof(u32)); fmt::print("> mem[{:#08x}] = {:#08x}\n", *address, *value); } } @@ -247,8 +259,8 @@ void ExecuteA32Instruction(u32 instruction) { cpu.SetFpscr(fpscr); const u32 initial_pc = regs[15]; - env.MemoryWrite32(initial_pc + 0, instruction); - env.MemoryWrite32(initial_pc + 4, 0xEAFFFFFE); // B +0 + env.MemoryWrite(initial_pc + 0, instruction, sizeof(u32)); + env.MemoryWrite(initial_pc + 4, 0xEAFFFFFE, sizeof(u32)); // B +0 cpu.Run(); fmt::print("{}", fmt::join(cpu.Disassemble(), "\n")); diff --git a/src/dynarmic/tests/unicorn_emu/a32_unicorn.cpp b/src/dynarmic/tests/unicorn_emu/a32_unicorn.cpp index c0e1e13d9b..1fe09cdef0 100644 --- a/src/dynarmic/tests/unicorn_emu/a32_unicorn.cpp +++ b/src/dynarmic/tests/unicorn_emu/a32_unicorn.cpp @@ -290,7 +290,7 @@ bool A32Unicorn::UnmappedMemoryHook(uc_engine* uc, uc_mem_type auto page = std::make_unique(); page->address = base_address; for (size_t i = 0; i < page->data.size(); ++i) - page->data[i] = this_->testenv.MemoryRead8(static_cast(base_address + i)); + page->data[i] = u8(this_->testenv.MemoryRead(u32(base_address + i), sizeof(u8))); uc_err err = uc_mem_map_ptr(uc, base_address, page->data.size(), permissions, page->data.data()); if (err == UC_ERR_MAP) @@ -321,24 +321,7 @@ bool A32Unicorn::UnmappedMemoryHook(uc_engine* uc, uc_mem_type template bool A32Unicorn::MemoryWriteHook(uc_engine* /*uc*/, uc_mem_type /*type*/, u32 start_address, int size, u64 value, void* user_data) { auto* this_ = static_cast(user_data); - - switch (size) { - case 1: - this_->testenv.MemoryWrite8(start_address, static_cast(value)); - break; - case 2: - this_->testenv.MemoryWrite16(start_address, static_cast(value)); - break; - case 4: - this_->testenv.MemoryWrite32(start_address, static_cast(value)); - break; - case 8: - this_->testenv.MemoryWrite64(start_address, value); - break; - default: - UNREACHABLE(); - } - + this_->testenv.MemoryWrite(start_address, value, size); return true; } diff --git a/src/dynarmic/tests/unicorn_emu/a64_unicorn.cpp b/src/dynarmic/tests/unicorn_emu/a64_unicorn.cpp index c9a194d50a..4afb6a6859 100644 --- a/src/dynarmic/tests/unicorn_emu/a64_unicorn.cpp +++ b/src/dynarmic/tests/unicorn_emu/a64_unicorn.cpp @@ -197,7 +197,7 @@ bool A64Unicorn::UnmappedMemoryHook(uc_engine* uc, uc_mem_type /*type*/, u64 sta auto page = std::make_unique(); page->address = base_address; for (size_t i = 0; i < page->data.size(); ++i) - page->data[i] = this_->testenv.MemoryRead8(base_address + i); + page->data[i] = u8(this_->testenv.MemoryRead(base_address + i, sizeof(u8))); uc_err err = uc_mem_map_ptr(uc, base_address, page->data.size(), permissions, page->data.data()); if (err == UC_ERR_MAP) @@ -227,23 +227,6 @@ bool A64Unicorn::UnmappedMemoryHook(uc_engine* uc, uc_mem_type /*type*/, u64 sta bool A64Unicorn::MemoryWriteHook(uc_engine* /*uc*/, uc_mem_type /*type*/, u64 start_address, int size, u64 value, void* user_data) { auto* this_ = static_cast(user_data); - - switch (size) { - case 1: - this_->testenv.MemoryWrite8(start_address, static_cast(value)); - break; - case 2: - this_->testenv.MemoryWrite16(start_address, static_cast(value)); - break; - case 4: - this_->testenv.MemoryWrite32(start_address, static_cast(value)); - break; - case 8: - this_->testenv.MemoryWrite64(start_address, value); - break; - default: - UNREACHABLE(); - } - + this_->testenv.MemoryWrite(start_address, value, size); return true; } From 2d1eb0dab91ec9389870ed6da7d1ef1fd01ab14a Mon Sep 17 00:00:00 2001 From: lizzie Date: Sat, 19 Sep 2026 08:21:39 +0200 Subject: [PATCH 021/198] [common/error] remove preprocessor macros for strerror_r gating (#4450) We use C++, we can just use SFINAE for this. Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4450 Reviewed-by: MaranBr Reviewed-by: Shinmegumi --- src/common/error.cpp | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/common/error.cpp b/src/common/error.cpp index 070c9a5c7e..1d67dad6a9 100644 --- a/src/common/error.cpp +++ b/src/common/error.cpp @@ -17,35 +17,33 @@ namespace Common { +// glibc, mlibc, musl, and newlib all define their own variants of strerror_r +// We don't need to use the preprocessor, we can just select depending on return type +template std::string HandleStrerrorR(T r, char *err_str); +template<> std::string HandleStrerrorR(char* r, char *) { return std::string{r}; } +template<> std::string HandleStrerrorR(const char* r, char *) { return std::string{r}; } +template<> std::string HandleStrerrorR(int r, char *err_str) { + return std::string{r != 0 + ? "(strerror_r failed to format error)" + : err_str}; +} + std::string NativeErrorToString(int e) { #ifdef _WIN32 LPSTR err_str; - DWORD res = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, e, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - reinterpret_cast(&err_str), 1, nullptr); - if (!res) { - return "(FormatMessageA failed to format error)"; + LPSTR(&err_str), 1, nullptr); + if (res) { + std::string ret(err_str); + LocalFree(err_str); + return ret; } - std::string ret(err_str); - LocalFree(err_str); - return ret; + return "(FormatMessageA failed to format error)"; #else char err_str[255]; -#if defined(__ANDROID__) || \ - (defined(__GLIBC__) && (_GNU_SOURCE || (_POSIX_C_SOURCE < 200112L && _XOPEN_SOURCE < 600))) - // Thread safe (GNU-specific) - const char* str = strerror_r(e, err_str, sizeof(err_str)); - return std::string(str); -#else - // Thread safe (XSI-compliant) - int second_err = strerror_r(e, err_str, sizeof(err_str)); - if (second_err != 0) { - return "(strerror_r failed to format error)"; - } - return std::string(err_str); -#endif // GLIBC etc. + return HandleStrerrorR(strerror_r(e, err_str, sizeof(err_str)), err_str); #endif // _WIN32 } From 847e91c3a8ca2d699cc9ce0df68b733dd5f37b97 Mon Sep 17 00:00:00 2001 From: xbzk Date: Sat, 19 Sep 2026 17:44:12 +0200 Subject: [PATCH 022/198] [applet] add post exit cleanups to frontend applets to avoid accumulation (#4457) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Maran reported MK8D if one press Plus button 38 times. This could be impacting other games around, but 4442 already quenched the spontaneous accumulation cases, by avoiding multiple event signals. MK8D is an atypical induced example. The reason was a controller applet accumulation, as we had no proper way to keep track and erase child applets on exit. Now we have. Enjoy your Plus button rushing fetish! Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4457 Reviewed-by: lizzie Reviewed-by: MaranBr --- src/core/hle/service/am/frontend/applets.cpp | 15 +++++++++++---- .../service/am/service/library_applet_creator.cpp | 13 ++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/core/hle/service/am/frontend/applets.cpp b/src/core/hle/service/am/frontend/applets.cpp index 407ca10602..d622c7b7a7 100644 --- a/src/core/hle/service/am/frontend/applets.cpp +++ b/src/core/hle/service/am/frontend/applets.cpp @@ -29,6 +29,7 @@ #include "core/hle/service/am/frontend/applet_web_browser.h" #include "core/hle/service/am/frontend/applets.h" #include "core/hle/service/am/service/storage.h" +#include "core/hle/service/am/window_system.h" #include "core/hle/service/sm/sm.h" namespace Service::AM::Frontend { @@ -72,10 +73,16 @@ void FrontendApplet::PushInteractiveOutData(std::shared_ptr storage) { void FrontendApplet::Exit() { auto applet_ = applet.lock(); - - std::scoped_lock lk{applet_->lock}; - applet_->is_completed = true; - applet_->state_changed_event.Signal(system.Kernel()); + { + std::scoped_lock lk{applet_->lock}; + applet_->is_completed = true; + applet_->state_changed_event.Signal(system.Kernel()); + } + if (auto caller_applet = applet_->caller_applet.lock()) { + std::scoped_lock lk{caller_applet->lock}; + std::erase(caller_applet->child_applets, applet_); + } + if (auto* window_system = system.GetAppletManager().GetWindowSystem()) window_system->RequestUpdate(); } FrontendAppletSet::FrontendAppletSet() = default; diff --git a/src/core/hle/service/am/service/library_applet_creator.cpp b/src/core/hle/service/am/service/library_applet_creator.cpp index ce80ce946f..4ee92908b5 100644 --- a/src/core/hle/service/am/service/library_applet_creator.cpp +++ b/src/core/hle/service/am/service/library_applet_creator.cpp @@ -122,7 +122,10 @@ std::shared_ptr CreateGuestApplet(Core::System& system, auto broker = std::make_shared(system); applet->caller_applet = caller_applet; applet->caller_applet_broker = broker; - caller_applet->child_applets.push_back(applet); + { + std::scoped_lock lk{caller_applet->lock}; + caller_applet->child_applets.push_back(applet); + } window_system.TrackApplet(applet, false); return std::make_shared(system, broker, applet); } @@ -148,10 +151,10 @@ std::shared_ptr CreateFrontendApplet(Core::System& syste applet->caller_applet = caller_applet; applet->caller_applet_broker = storage; applet->frontend = system.GetFrontendAppletHolder().GetApplet(applet, applet_id, mode); - caller_applet->child_applets.push_back(applet); - - window_system.TrackApplet(applet, false); - + { + std::scoped_lock lk{caller_applet->lock}; + caller_applet->child_applets.push_back(applet); + } return std::make_shared(system, storage, applet); } From 908b1e9a3701f142de51e133d910aa058d4b071c Mon Sep 17 00:00:00 2001 From: lizzie Date: Sun, 20 Sep 2026 00:29:28 +0200 Subject: [PATCH 023/198] [dynarmic] fix bad arm codegen on relocations (#4458) In an earlier version I had these as constants which were referred to via `db`, I haphazardly left the LDR and didn't notice. Even still relocations apply to only 1 ins at a time. Fixes regressions on #4158 Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4458 Reviewed-by: CamilleLaVey Reviewed-by: MaranBr --- .../backend/arm64/a32_address_space.cpp | 75 ++++++++++++++++--- .../backend/arm64/a64_address_space.cpp | 74 +++++++++++++++--- .../dynarmic/backend/arm64/address_space.cpp | 51 +++++-------- .../dynarmic/backend/arm64/address_space.h | 20 ++++- 4 files changed, 160 insertions(+), 60 deletions(-) diff --git a/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp index dc14d16978..0cf9bb9fae 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp @@ -24,29 +24,65 @@ namespace Dynarmic::Backend::Arm64 { template -static void* EmitCallTrampoline(oaknut::CodeGenerator& code, T* this_) { +static void* EmitCallReadTrampoline(oaknut::CodeGenerator& code, T* this_, size_t bitsize) { using namespace oaknut::util; - const auto info = Devirtualize(this_); - oaknut::Label l_addr, l_this; - void* target = code.xptr(); + // params = { this, vaddr, bitsize } code.LDR(X0, l_this); + // X1 = vaddr + code.MOV(X2, bitsize); code.LDR(Xscratch0, l_addr); code.BR(Xscratch0); - code.align(8); code.l(l_this); code.dx(info.this_ptr); code.l(l_addr); code.dx(info.fn_ptr); - return target; } template -static void* EmitWrappedReadCallTrampoline(oaknut::CodeGenerator& code, T* this_) { +static void* EmitCallWriteTrampoline(oaknut::CodeGenerator& code, T* this_, size_t bitsize) { + using namespace oaknut::util; + const auto info = Devirtualize(this_); + oaknut::Label l_addr, l_this; + void* target = code.xptr(); + // params = { this, vaddr, value, bitsize } + code.LDR(X0, l_this); + // X1 = vaddr + // X2 = value + code.MOV(X3, bitsize); + code.LDR(Xscratch0, l_addr); + code.BR(Xscratch0); + code.align(8); + code.l(l_this); + code.dx(info.this_ptr); + code.l(l_addr); + code.dx(info.fn_ptr); + return target; +} + +template +static void* EmitCallTrampoline(oaknut::CodeGenerator& code, T* this_) { + using namespace oaknut::util; + const auto info = Devirtualize(this_); + oaknut::Label l_addr, l_this; + void* target = code.xptr(); + code.LDR(X0, l_this); + code.LDR(Xscratch0, l_addr); + code.BR(Xscratch0); + code.align(8); + code.l(l_this); + code.dx(info.this_ptr); + code.l(l_addr); + code.dx(info.fn_ptr); + return target; +} + +template +static void* EmitWrappedReadCallTrampoline(oaknut::CodeGenerator& code, T* this_, size_t bitsize) { using namespace oaknut::util; const auto info = Devirtualize(this_); @@ -59,6 +95,7 @@ static void* EmitWrappedReadCallTrampoline(oaknut::CodeGenerator& code, T* this_ ABI_PushRegisters(code, save_regs, 0); code.LDR(X0, l_this); code.MOV(X1, Xscratch0); + code.MOV(X2, bitsize); code.LDR(Xscratch0, l_addr); code.BLR(Xscratch0); code.MOV(Xscratch0, X0); @@ -101,7 +138,7 @@ static void* EmitExclusiveReadCallTrampoline(oaknut::CodeGenerator& code, const } template -static void* EmitWrappedWriteCallTrampoline(oaknut::CodeGenerator& code, T* this_) { +static void* EmitWrappedWriteCallTrampoline(oaknut::CodeGenerator& code, T* this_, size_t bitsize) { using namespace oaknut::util; const auto info = Devirtualize(this_); @@ -115,6 +152,7 @@ static void* EmitWrappedWriteCallTrampoline(oaknut::CodeGenerator& code, T* this code.LDR(X0, l_this); code.MOV(X1, Xscratch0); code.MOV(X2, Xscratch1); + code.MOV(X3, bitsize); code.LDR(Xscratch0, l_addr); code.BLR(Xscratch0); ABI_PopRegisters(code, save_regs, 0); @@ -176,14 +214,27 @@ void A32AddressSpace::EmitPrelude() { UnprotectCodeMemory(); - prelude_info.read_memory = EmitCallTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks); - prelude_info.wrapped_read_memory = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks); + + prelude_info.read_memory_8 = EmitCallReadTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u8)); + prelude_info.read_memory_16 = EmitCallReadTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u16)); + prelude_info.read_memory_32 = EmitCallReadTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u32)); + prelude_info.read_memory_64 = EmitCallReadTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u64)); + prelude_info.wrapped_read_memory_8 = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u8)); + prelude_info.wrapped_read_memory_16 = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u16)); + prelude_info.wrapped_read_memory_32 = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u32)); + prelude_info.wrapped_read_memory_64 = EmitWrappedReadCallTrampoline<&A32::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u64)); prelude_info.exclusive_read_memory_8 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead, u8>(code, conf); prelude_info.exclusive_read_memory_16 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead, u16>(code, conf); prelude_info.exclusive_read_memory_32 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead, u32>(code, conf); prelude_info.exclusive_read_memory_64 = EmitExclusiveReadCallTrampoline<&A32::UserCallbacks::MemoryRead, u64>(code, conf); - prelude_info.write_memory = EmitCallTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks); - prelude_info.wrapped_write_memory = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks); + prelude_info.write_memory_8 = EmitCallWriteTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u8)); + prelude_info.write_memory_16 = EmitCallWriteTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u16)); + prelude_info.write_memory_32 = EmitCallWriteTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u32)); + prelude_info.write_memory_64 = EmitCallWriteTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u64)); + prelude_info.wrapped_write_memory_8 = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u8)); + prelude_info.wrapped_write_memory_16 = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u16)); + prelude_info.wrapped_write_memory_32 = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u32)); + prelude_info.wrapped_write_memory_64 = EmitWrappedWriteCallTrampoline<&A32::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u64)); prelude_info.exclusive_write_memory_8 = EmitExclusiveWriteCallTrampoline<&A32::UserCallbacks::MemoryWriteExclusive8, u8>(code, conf); prelude_info.exclusive_write_memory_16 = EmitExclusiveWriteCallTrampoline<&A32::UserCallbacks::MemoryWriteExclusive16, u16>(code, conf); prelude_info.exclusive_write_memory_32 = EmitExclusiveWriteCallTrampoline<&A32::UserCallbacks::MemoryWriteExclusive32, u32>(code, conf); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp index efb9fc538c..492242fa73 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp @@ -23,29 +23,65 @@ namespace Dynarmic::Backend::Arm64 { template -static void* EmitCallTrampoline(oaknut::CodeGenerator& code, T* this_) { +static void* EmitCallReadTrampoline(oaknut::CodeGenerator& code, T* this_, size_t bitsize) { using namespace oaknut::util; - const auto info = Devirtualize(this_); - oaknut::Label l_addr, l_this; - void* target = code.xptr(); + // params = { this, vaddr, bitsize } code.LDR(X0, l_this); + // X1 = vaddr + code.MOV(X2, bitsize); code.LDR(Xscratch0, l_addr); code.BR(Xscratch0); - code.align(8); code.l(l_this); code.dx(info.this_ptr); code.l(l_addr); code.dx(info.fn_ptr); - return target; } template -static void* EmitWrappedReadCallTrampoline(oaknut::CodeGenerator& code, T* this_) { +static void* EmitCallWriteTrampoline(oaknut::CodeGenerator& code, T* this_, size_t bitsize) { + using namespace oaknut::util; + const auto info = Devirtualize(this_); + oaknut::Label l_addr, l_this; + void* target = code.xptr(); + // params = { this, vaddr, value, bitsize } + code.LDR(X0, l_this); + // X1 = vaddr + // X2 = value + code.MOV(X3, bitsize); + code.LDR(Xscratch0, l_addr); + code.BR(Xscratch0); + code.align(8); + code.l(l_this); + code.dx(info.this_ptr); + code.l(l_addr); + code.dx(info.fn_ptr); + return target; +} + +template +static void* EmitCallTrampoline(oaknut::CodeGenerator& code, T* this_) { + using namespace oaknut::util; + const auto info = Devirtualize(this_); + oaknut::Label l_addr, l_this; + void* target = code.xptr(); + code.LDR(X0, l_this); + code.LDR(Xscratch0, l_addr); + code.BR(Xscratch0); + code.align(8); + code.l(l_this); + code.dx(info.this_ptr); + code.l(l_addr); + code.dx(info.fn_ptr); + return target; +} + +template +static void* EmitWrappedReadCallTrampoline(oaknut::CodeGenerator& code, T* this_, size_t bitsize) { using namespace oaknut::util; const auto info = Devirtualize(this_); @@ -58,6 +94,7 @@ static void* EmitWrappedReadCallTrampoline(oaknut::CodeGenerator& code, T* this_ ABI_PushRegisters(code, save_regs, 0); code.LDR(X0, l_this); code.MOV(X1, Xscratch0); + code.MOV(X2, bitsize); code.LDR(Xscratch0, l_addr); code.BLR(Xscratch0); code.MOV(Xscratch0, X0); @@ -100,7 +137,7 @@ static void* EmitExclusiveReadCallTrampoline(oaknut::CodeGenerator& code, const } template -static void* EmitWrappedWriteCallTrampoline(oaknut::CodeGenerator& code, T* this_) { +static void* EmitWrappedWriteCallTrampoline(oaknut::CodeGenerator& code, T* this_, size_t bitsize) { using namespace oaknut::util; const auto info = Devirtualize(this_); @@ -114,6 +151,7 @@ static void* EmitWrappedWriteCallTrampoline(oaknut::CodeGenerator& code, T* this code.LDR(X0, l_this); code.MOV(X1, Xscratch0); code.MOV(X2, Xscratch1); + code.MOV(X3, bitsize); code.LDR(Xscratch0, l_addr); code.BLR(Xscratch0); ABI_PopRegisters(code, save_regs, 0); @@ -342,18 +380,30 @@ void A64AddressSpace::EmitPrelude() { UnprotectCodeMemory(); - prelude_info.read_memory = EmitCallTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks); + prelude_info.read_memory_8 = EmitCallReadTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u8)); + prelude_info.read_memory_16 = EmitCallReadTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u16)); + prelude_info.read_memory_32 = EmitCallReadTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u32)); + prelude_info.read_memory_64 = EmitCallReadTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u64)); prelude_info.read_memory_128 = EmitRead128CallTrampoline(code, conf.callbacks); - prelude_info.wrapped_read_memory = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks); + prelude_info.wrapped_read_memory_8 = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u8)); + prelude_info.wrapped_read_memory_16 = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u16)); + prelude_info.wrapped_read_memory_32 = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u32)); + prelude_info.wrapped_read_memory_64 = EmitWrappedReadCallTrampoline<&A64::UserCallbacks::MemoryRead>(code, conf.callbacks, sizeof(u64)); prelude_info.wrapped_read_memory_128 = EmitWrappedRead128CallTrampoline(code, conf.callbacks); prelude_info.exclusive_read_memory_8 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead, u8>(code, conf); prelude_info.exclusive_read_memory_16 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead, u16>(code, conf); prelude_info.exclusive_read_memory_32 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead, u32>(code, conf); prelude_info.exclusive_read_memory_64 = EmitExclusiveReadCallTrampoline<&A64::UserCallbacks::MemoryRead, u64>(code, conf); prelude_info.exclusive_read_memory_128 = EmitExclusiveRead128CallTrampoline(code, conf); - prelude_info.write_memory = EmitCallTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks); + prelude_info.write_memory_8 = EmitCallWriteTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u8)); + prelude_info.write_memory_16 = EmitCallWriteTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u16)); + prelude_info.write_memory_32 = EmitCallWriteTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u32)); + prelude_info.write_memory_64 = EmitCallWriteTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u64)); prelude_info.write_memory_128 = EmitWrite128CallTrampoline(code, conf.callbacks); - prelude_info.wrapped_write_memory = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks); + prelude_info.wrapped_write_memory_8 = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u8)); + prelude_info.wrapped_write_memory_16 = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u16)); + prelude_info.wrapped_write_memory_32 = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u32)); + prelude_info.wrapped_write_memory_64 = EmitWrappedWriteCallTrampoline<&A64::UserCallbacks::MemoryWrite>(code, conf.callbacks, sizeof(u64)); prelude_info.wrapped_write_memory_128 = EmitWrappedWrite128CallTrampoline(code, conf.callbacks); prelude_info.exclusive_write_memory_8 = EmitExclusiveWriteCallTrampoline<&A64::UserCallbacks::MemoryWriteExclusive8, u8>(code, conf); prelude_info.exclusive_write_memory_16 = EmitExclusiveWriteCallTrampoline<&A64::UserCallbacks::MemoryWriteExclusive16, u16>(code, conf); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp index 7b83e372e6..4ef3296c4a 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp @@ -147,44 +147,37 @@ void AddressSpace::Link(EmittedBlockInfo& block_info) { break; // { this, vaddr, size } case LinkTarget::ReadMemory8: - c.LDR(X2, 1); - c.BL(prelude_info.read_memory); + c.BL(prelude_info.read_memory_8); break; case LinkTarget::ReadMemory16: - c.LDR(X2, 2); - c.BL(prelude_info.read_memory); + c.BL(prelude_info.read_memory_16); break; case LinkTarget::ReadMemory32: - c.LDR(X2, 4); - c.BL(prelude_info.read_memory); + c.BL(prelude_info.read_memory_32); break; case LinkTarget::ReadMemory64: - c.LDR(X2, 8); - c.BL(prelude_info.read_memory); + c.BL(prelude_info.read_memory_64); break; case LinkTarget::ReadMemory128: c.BL(prelude_info.read_memory_128); break; // { this, vaddr, size } case LinkTarget::WrappedReadMemory8: - c.LDR(X2, 1); - c.BL(prelude_info.wrapped_read_memory); + c.BL(prelude_info.wrapped_read_memory_8); break; case LinkTarget::WrappedReadMemory16: - c.LDR(X2, 2); - c.BL(prelude_info.wrapped_read_memory); + c.BL(prelude_info.wrapped_read_memory_16); break; case LinkTarget::WrappedReadMemory32: - c.LDR(X2, 4); - c.BL(prelude_info.wrapped_read_memory); + c.BL(prelude_info.wrapped_read_memory_32); break; case LinkTarget::WrappedReadMemory64: - c.LDR(X2, 8); - c.BL(prelude_info.wrapped_read_memory); + c.BL(prelude_info.wrapped_read_memory_64); break; case LinkTarget::WrappedReadMemory128: c.BL(prelude_info.wrapped_read_memory_128); break; + // case LinkTarget::ExclusiveReadMemory8: c.BL(prelude_info.exclusive_read_memory_8); break; @@ -202,43 +195,37 @@ void AddressSpace::Link(EmittedBlockInfo& block_info) { break; // { this, vaddr, value, size } case LinkTarget::WriteMemory8: - c.LDR(X3, 1); - c.BL(prelude_info.write_memory); + c.BL(prelude_info.write_memory_8); break; case LinkTarget::WriteMemory16: - c.LDR(X3, 2); - c.BL(prelude_info.write_memory); + c.BL(prelude_info.write_memory_16); break; case LinkTarget::WriteMemory32: - c.LDR(X3, 4); - c.BL(prelude_info.write_memory); + c.BL(prelude_info.write_memory_32); break; case LinkTarget::WriteMemory64: - c.LDR(X3, 8); - c.BL(prelude_info.write_memory); + c.BL(prelude_info.write_memory_64); break; case LinkTarget::WriteMemory128: c.BL(prelude_info.write_memory_128); break; + // case LinkTarget::WrappedWriteMemory8: - c.LDR(X3, 1); - c.BL(prelude_info.wrapped_write_memory); + c.BL(prelude_info.wrapped_write_memory_8); break; case LinkTarget::WrappedWriteMemory16: - c.LDR(X3, 2); - c.BL(prelude_info.wrapped_write_memory); + c.BL(prelude_info.wrapped_write_memory_16); break; case LinkTarget::WrappedWriteMemory32: - c.LDR(X3, 4); - c.BL(prelude_info.wrapped_write_memory); + c.BL(prelude_info.wrapped_write_memory_32); break; case LinkTarget::WrappedWriteMemory64: - c.LDR(X3, 8); - c.BL(prelude_info.wrapped_write_memory); + c.BL(prelude_info.wrapped_write_memory_64); break; case LinkTarget::WrappedWriteMemory128: c.BL(prelude_info.wrapped_write_memory_128); break; + // case LinkTarget::ExclusiveWriteMemory8: c.BL(prelude_info.exclusive_write_memory_8); break; diff --git a/src/dynarmic/src/dynarmic/backend/arm64/address_space.h b/src/dynarmic/src/dynarmic/backend/arm64/address_space.h index 73e2c94a19..755b05bd02 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/address_space.h +++ b/src/dynarmic/src/dynarmic/backend/arm64/address_space.h @@ -93,18 +93,30 @@ protected: void* return_to_dispatcher; void* return_from_run_code; - void* read_memory; + void* read_memory_8; + void* read_memory_16; + void* read_memory_32; + void* read_memory_64; void* read_memory_128; - void* wrapped_read_memory; + void* wrapped_read_memory_8; + void* wrapped_read_memory_16; + void* wrapped_read_memory_32; + void* wrapped_read_memory_64; void* wrapped_read_memory_128; void* exclusive_read_memory_8; void* exclusive_read_memory_16; void* exclusive_read_memory_32; void* exclusive_read_memory_64; void* exclusive_read_memory_128; - void* write_memory; + void* write_memory_8; + void* write_memory_16; + void* write_memory_32; + void* write_memory_64; void* write_memory_128; - void* wrapped_write_memory; + void* wrapped_write_memory_8; + void* wrapped_write_memory_16; + void* wrapped_write_memory_32; + void* wrapped_write_memory_64; void* wrapped_write_memory_128; void* exclusive_write_memory_8; void* exclusive_write_memory_16; From a277b62fe4328dddaced9a97d324c6e5478d16a0 Mon Sep 17 00:00:00 2001 From: xbzk Date: Sun, 20 Sep 2026 04:40:14 +0200 Subject: [PATCH 024/198] [fs] revert #4319 savedata_factory changes (#4462) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This one reverts part of the PR 4319 which was aimed to allow child titles to inherit bundle settings. The fix seems good so far, but by applying it to save folders caused a trap: Now child's save folders move to bundle folder, hence saves will vanish, and the android/qt save tools are still pointing to old folders. Since the save part was only a compliance fix, instead of fiddle in master i'd rather revert this part now, then only touch this again if any bug show up. No worries. I'll be right here waiting. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4462 Reviewed-by: lizzie Reviewed-by: MaranBr --- src/core/file_sys/savedata_factory.cpp | 22 ++++++++-------------- src/core/file_sys/savedata_factory.h | 1 - 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index 72f022cb41..c756734a43 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp @@ -9,7 +9,6 @@ #include "common/logging.h" #include "common/uuid.h" #include "core/core.h" -#include "core/file_sys/registered_cache.h" #include "core/file_sys/savedata_factory.h" #include "core/file_sys/vfs/vfs.h" @@ -62,24 +61,17 @@ SaveDataFactory::SaveDataFactory(Core::System& system_, ProgramId program_id_, SaveDataFactory::~SaveDataFactory() = default; -std::string SaveDataFactory::GetSaveDataPath(SaveDataSpaceId space, SaveDataType type, u64 title_id, u128 user_id, u64 save_id) const { - if (type == SaveDataType::Account || type == SaveDataType::Device) { - const auto requested_id = title_id != 0 ? title_id : program_id; - const auto parent_id = system.GetContentProvider().GetParentApplicationId(requested_id); - title_id = parent_id.value_or(requested_id); - } - return GetFullPath(program_id, dir, space, type, title_id, user_id, save_id); -} - VirtualDir SaveDataFactory::Create(SaveDataSpaceId space, const SaveDataAttribute& meta) const { - const auto save_directory = GetSaveDataPath(space, meta.type, meta.program_id, meta.user_id, meta.system_save_data_id); + const auto save_directory = GetFullPath(program_id, dir, space, meta.type, meta.program_id, + meta.user_id, meta.system_save_data_id); return dir->CreateDirectoryRelative(save_directory); } VirtualDir SaveDataFactory::Open(SaveDataSpaceId space, const SaveDataAttribute& meta) const { - const auto save_directory = GetSaveDataPath(space, meta.type, meta.program_id, meta.user_id, meta.system_save_data_id); + const auto save_directory = GetFullPath(program_id, dir, space, meta.type, meta.program_id, + meta.user_id, meta.system_save_data_id); auto out = dir->GetDirectoryRelative(save_directory); @@ -162,7 +154,8 @@ std::string SaveDataFactory::GetUserGameSaveDataRoot(u128 user_id, bool future) SaveDataSize SaveDataFactory::ReadSaveDataSize(SaveDataType type, u64 title_id, u128 user_id) const { - const auto path = GetSaveDataPath(SaveDataSpaceId::User, type, title_id, user_id, 0); + const auto path = + GetFullPath(program_id, dir, SaveDataSpaceId::User, type, title_id, user_id, 0); const auto relative_dir = GetOrCreateDirectoryRelative(dir, path); const auto size_file = relative_dir->GetFile(GetSaveDataSizeFileName()); @@ -180,7 +173,8 @@ SaveDataSize SaveDataFactory::ReadSaveDataSize(SaveDataType type, u64 title_id, void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, SaveDataSize new_value) const { - const auto path = GetSaveDataPath(SaveDataSpaceId::User, type, title_id, user_id, 0); + const auto path = + GetFullPath(program_id, dir, SaveDataSpaceId::User, type, title_id, user_id, 0); const auto relative_dir = GetOrCreateDirectoryRelative(dir, path); const auto size_file = relative_dir->CreateFile(GetSaveDataSizeFileName()); diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 36c09ce2ac..c7899f023d 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h @@ -50,7 +50,6 @@ public: void SetAutoCreate(bool state); private: - std::string GetSaveDataPath(SaveDataSpaceId space, SaveDataType type, u64 title_id, u128 user_id, u64 save_id) const; Core::System& system; ProgramId program_id; VirtualDir dir; From 74b5e10dc553bb24ccb3460529b15b3c3198bb10 Mon Sep 17 00:00:00 2001 From: xbzk Date: Sun, 20 Sep 2026 22:56:06 +0200 Subject: [PATCH 025/198] [native] doesUpdateMatchProgram update mask fix (#4465) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Old silly bug i've been neglecting: On Android, installing content to NAND, under some content id conditions (ie MK8D DLC), base/update IDs mismatch, and UI prompts "The content that you selected does not match this game. Install anyway? Useless, yet fixed. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4465 Reviewed-by: lizzie Reviewed-by: MaranBr --- src/android/app/src/main/jni/native.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 746b00ad11..d4f7689934 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -788,7 +788,7 @@ int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_doesUpdateMatchProgram(JNIEnv* env, jobject jobj, jstring jprogramId, jstring jupdatePath) { - u64 program_id = EmulationSession::GetProgramId(env, jprogramId); + const u64 program_id = FileSys::GetBaseTitleID(EmulationSession::GetProgramId(env, jprogramId)); std::string updatePath = Common::Android::GetJString(env, jupdatePath); std::shared_ptr nsp = std::make_shared( EmulationSession::GetInstance().System().GetFilesystem()->OpenFile( @@ -796,7 +796,7 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_doesUpdateMatchProgram(JNIEnv* en for (const auto& item : nsp->GetNCAs()) { for (const auto& nca_details : item.second) { if (nca_details.second->GetName().ends_with(".cnmt.nca")) { - auto update_id = nca_details.second->GetTitleId() & ~0xFFFULL; + const auto update_id = FileSys::GetBaseTitleID(nca_details.second->GetTitleId()); if (update_id == program_id) { return true; } From 9cd24e85c2c24016cfdba50e3533395561536f7e Mon Sep 17 00:00:00 2001 From: Eden CI Date: Mon, 21 Sep 2026 19:25:54 +0200 Subject: [PATCH 026/198] [dist, android] Update translations from Transifex for Sep 21 (#4466) Automatic translation update for Sep 21 Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4466 --- dist/languages/ar.ts | 1211 +++++++++-------- dist/languages/ca.ts | 1049 +++++++------- dist/languages/cs.ts | 1049 +++++++------- dist/languages/da.ts | 1049 +++++++------- dist/languages/de.ts | 1049 +++++++------- dist/languages/el.ts | 1049 +++++++------- dist/languages/es.ts | 1051 +++++++------- dist/languages/fi.ts | 1049 +++++++------- dist/languages/fr.ts | 1049 +++++++------- dist/languages/hu.ts | 1049 +++++++------- dist/languages/id.ts | 1049 +++++++------- dist/languages/it.ts | 1049 +++++++------- dist/languages/ja_JP.ts | 1049 +++++++------- dist/languages/ko_KR.ts | 1049 +++++++------- dist/languages/nb.ts | 1049 +++++++------- dist/languages/nl.ts | 1049 +++++++------- dist/languages/pl.ts | 1049 +++++++------- dist/languages/pt_BR.ts | 1049 +++++++------- dist/languages/pt_PT.ts | 1049 +++++++------- dist/languages/ru_RU.ts | 1049 +++++++------- dist/languages/sv.ts | 1058 +++++++------- dist/languages/tr_TR.ts | 1049 +++++++------- dist/languages/uk.ts | 1049 +++++++------- dist/languages/vi.ts | 1049 +++++++------- dist/languages/vi_VN.ts | 1049 +++++++------- dist/languages/zh_CN.ts | 1100 ++++++++------- dist/languages/zh_TW.ts | 1049 +++++++------- .../app/src/main/res/values-es/strings.xml | 1 + .../app/src/main/res/values-ru/strings.xml | 9 + .../src/main/res/values-zh-rCN/strings.xml | 36 + .../src/main/res/values-zh-rTW/strings.xml | 39 +- 31 files changed, 14962 insertions(+), 13670 deletions(-) diff --git a/dist/languages/ar.ts b/dist/languages/ar.ts index cd37ef9739..bb259d2870 100644 --- a/dist/languages/ar.ts +++ b/dist/languages/ar.ts @@ -313,17 +313,17 @@ This would ban both their forum username and their IP address. Output Engine: - محرك الإخراج: + :محرك الإخراج Output Device: - جهاز الإخراج: + :جهاز الإخراج Input Device: - جهاز الإدخال: + :جهاز الإدخال @@ -333,7 +333,7 @@ This would ban both their forum username and their IP address. Volume: - الصوت: + :الصوت @@ -413,7 +413,7 @@ Can help reduce stuttering at lower framerates. Accuracy: - الدقة: + :الدقة @@ -424,12 +424,12 @@ Can help reduce stuttering at lower framerates. Backend: - الخلفية: + :الخلفية CPU Clocks - ترددات وحدة المعالجة المركزية + سرعات وحدة المعالجة المركزية @@ -528,7 +528,7 @@ Please note this may result in deadlocks and other race conditions. API: - واجهة برمجة التطبيقات: + :واجهة برمجة التطبيقات @@ -540,7 +540,7 @@ Vulkan يُنصح باستخدام Device: - جهاز: + :جهاز @@ -550,7 +550,7 @@ Vulkan يُنصح باستخدام Resolution: - الدقة: + :الدقة @@ -564,7 +564,7 @@ Options lower than 1X can cause artifacts. Window Adapting Filter: - مرشح تكييف النافذة: + :مرشح تكييف النافذة @@ -579,7 +579,7 @@ Options lower than 1X can cause artifacts. Anti-Aliasing Method: - طريقة مضاد التعرج: + :طريقة مضاد التعرج @@ -591,12 +591,22 @@ FXAA can produce a more stable picture in lower resolutions. يُمكن لـ FXAA إنتاج صورة أكثر ثباتًا بدقة أقل. - - Fullscreen Mode: - وضع ملء الشاشة: + + Enable post-processing effects + تفعيل تأثيرات المعالجة اللاحقة - + + Applies post-processing effects to the final image. + يُطبق تأثيرات ما بعد المعالجة على الصورة النهائية. + + + + Fullscreen Mode: + :وضع ملء الشاشة + + + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -605,12 +615,12 @@ Exclusive fullscreen may offer better performance and better Freesync/Gsync supp قد يوفر وضع ملء الشاشة الحصري أداءً أفضل ودعمًا أفضل لتقنيتي Freesync/Gsync. - + Aspect Ratio: - نسبة العرض إلى الارتفاع: + :نسبة العرض إلى الارتفاع - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -619,48 +629,48 @@ Also controls the aspect ratio of captured screenshots. كما يتحكم في نسبة العرض إلى الارتفاع للقطات الشاشة الملتقطة. - + Use persistent pipeline cache استخدام ذاكرة التخزين المؤقتة الدائمة للأنابيب - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. يسمح بحفظ التظليلات في وحدة التخزين لتحميلها بشكل أسرع عند تشغيل اللعبة في المرات التالية. لا يُقصد من تعطيله سوى تصحيح الأخطاء. - + Use asynchronous GPU emulation استخدم محاكاة وحدة معالجة الرسومات غير المتزامنة - + Uses an extra CPU thread for rendering. This option should always remain enabled. يستخدم خيط معالجة إضافي للمعالجة الرسومية. يجب أن يبقى هذا الخيار مُفعّلاً دائماً. - + NVDEC emulation: NVDEC محاكاة: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. يُحدد كيفية فك تشفير الفيديوهات.يمكن استخدام وحدة المعالجة المركزية CPU أو وحدة معالجة الرسومات GPU لفك التشفير، أو عدم فك التشفير إطلاقًا (شاشة سوداء على الفيديوهات).في معظم الحالات، يُوفر فك تشفير وحدة معالجة الرسومات GPU أفضل أداء. - + ASTC Decoding Method: ASTC طريقة فك تشفير: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -672,12 +682,12 @@ stuttering but may present artifacts. وحدة المعالجة المركزية بشكل غير متزامن: استخدمها لفك تشفير قوام ASTC عند الطلب. يزيل هذا الخيار تقطع فك تشفير ASTC، ولكنه قد يُظهر بعض العيوب. - + ASTC Recompression Method: ASTC طريقة إعادة ضغط: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -685,44 +695,44 @@ BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, BC1/BC3: سيتم إعادة ضغط الصيغة الوسيطة إلى صيغة BC1 أو BC3، مما يوفر مساحة على ذاكرة الوصول العشوائي للفيديو VRAM ولكنه يُضعف جودة الصورة. - + Frame Pacing Mode (Vulkan only) (Vulkan فقط) وضع توقيت الإطارات - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. يتحكم في كيفية إدارة المحاكي لسرعة الإطارات لتقليل التقطع وجعل معدل الإطارات أكثر سلاسة واتساقًا. - + VRAM Usage Mode: VRAM وضع استهلاك: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. يُحدد ما إذا كان ينبغي على المُحاكي تفضيل توفير الذاكرة أو الاستفادة القصوى من ذاكرة الفيديو المُتاحة لتحسين الأداء. قد يؤثر الوضع المُكثّف على أداء تطبيقات أخرى، مثل برامج التسجيل. - + Skip CPU Inner Invalidation تخطي إبطال وحدة المعالجة المركزية الداخلية - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. يتخطى بعض عمليات إبطال ذاكرة التخزين المؤقتة أثناء تحديثات الذاكرة، مما يقلل من استخدام وحدة المعالجة المركزية ويحسّن زمن الوصول. قد يؤدي هذا إلى أعطال مؤقتة. - + VSync Mode: VSync وضع: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -733,12 +743,12 @@ Immediate (no synchronization) presents whatever is available and can exhibit te يُظهر الوضع الفوري (بدون مزامنة) كل ما هو متاح، وقد يُظهر تمزقًا. - + Sync Memory Operations مزامنة عمليات الذاكرة - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -747,44 +757,44 @@ Unreal Engine 4 games often see the most significant changes thereof. التغييرات الأكثر أهمية Unreal Engine 4 غالبًا ما تشهد ألعاب. - + Enable asynchronous presentation (Vulkan only) (Vulkan فقط) تمكين العرض التقديمي غير المتزامن - + Slightly improves performance by moving presentation to a separate CPU thread. تحسين الأداء بشكل طفيف عن طريق نقل العرض التقديمي إلى مؤشر ترابط منفصل في وحدة المعالجة المركزية. - + Force maximum clocks (Vulkan only) (Vulkan فقط) فرض الحد الأقصى للساعات - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. يعمل في الخلفية أثناء انتظار أوامر الرسومات لمنع وحدة معالجة الرسومات من خفض سرعة الساعة. - + Anisotropic Filtering: الترشيح المتباين الخواص: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. يتحكم بجودة عرض الملمس بزوايا مائلة. من الآمن ضبطه على 16x على معظم وحدات معالجة الرسومات. - + GPU Mode: وضع وحدة معالجة الرسومات: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -793,12 +803,12 @@ Particles tend to only render correctly with Accurate mode. لا تُعرض الجسيمات بشكل صحيح إلا في وضع «دقيق». - + DMA Accuracy: DMA دقة: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -807,12 +817,12 @@ Default follows the GPU Accuracy setting. يُتبع الإعداد الافتراضي إعداد «دقة وحدة معالجة الرسومات» - + GPU Fence Behavior: :سلوك حاجز وحدة معالجة الرسومات - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -827,56 +837,56 @@ Default follows the GPU Accuracy setting. الإعداد الافتراضي يتبع إعداد دقة وحدة معالجة الرسومات. - + Enable GPU buffer readback تفعيل قراءة مخزن وحدة معالجة الرسومات - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. يحافظ على البيانات المعدلة بواسطة وحدة معالجة الرسومات عن طريق قراءتها قبل رفعها. بعض الألعاب تحتاج هذا لعرض تأثيرات معينة بشكل صحيح. - + Enable asynchronous shader compilation تفعيل تجميع التظليل غير المتزامن - + May reduce shader stutter. قد يقلل من تقطع التظليل. - + GPU Clocks - سرعات معالج الرسوميات + سرعات وحدة معالجة الرسومات - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. يجعل اللعبة تعتقد أن عمل وحدة معالجة الرسومات ينتهي بشكل أسرع مما هو عليه في الواقع، لذلك تتوقف عن خفض الدقة ومسافة العرض لتتناسب مع سرعات جهاز Switch. - + GPU Unswizzle إلغاء ترتيب بيانات وحدة معالجة الرسومات - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. باستخدام حوسبة وحدة معالجة الرسومات BCn 3D يسرع فك تشفير نسيج. قم بتعطيله في حالة حدوث أعطال أو مشاكل في الرسومات. - + GPU Unswizzle Max Texture Size الحد الأقصى لحجم النسيج في وحدة معالجة الرسومات بعد إعادة ترتيب البيانات - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -885,48 +895,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size حجم تدفق إلغاء ترتيب بيانات وحدة معالجة الرسومات - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. يحدد الحد الأقصى لكمية بيانات النسيج (بالميغابايت) التي تتم معالجتها لكل إطار. يمكن أن تقلل القيم الأعلى من التقطع أثناء تحميل النسيج، ولكنها قد تؤثر على اتساق الإطارات. - + GPU Unswizzle Chunk Size حجم كتلة إلغاء ترتيب بيانات وحدة معالجة الرسومات - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. يُحدد هذا الخيار عدد شرائح العمق التي تتم معالجتها في عملية إرسال واحدة. زيادة هذا الخيار قد تُحسّن الإنتاجية على وحدات معالجة الرسومات المتطورة، ولكنها قد تُسبب أخطاء في إعادة تعيين وقت الاستجابة أو انقطاع الاتصال ببرنامج التشغيل على الأجهزة ذات المواصفات الأقل. - + Use Vulkan pipeline cache Vulkan استخدام ذاكرة التخزين المؤقتة لخط أنابيب - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. يُفعّل ذاكرة التخزين المؤقت لخطوط الأنابيب الخاصة ببائع وحدة معالجة الرسومات. بتخزين ملفات ذاكرة التخزين المؤقتة للخطوط الداخلية Vulkan يمكن أن يؤدي هذا الخيار إلى تحسين وقت تحميل التظليل بشكل كبير في الحالات التي لا يقوم فيها برنامج تشغيل. - + Enable Compute Pipelines (Intel Vulkan Only) (Intel Vulkan فقط) تمكين خطوط أنابيب الحوسبة - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -935,192 +945,192 @@ Compute pipelines are always enabled on all other drivers. خطوط أنابيب الحوسبة مفعلة دائمًا على جميع برامج التشغيل الأخرى. - + Enable Reactive Flushing تمكين التنظيف التفاعلي - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. يستخدم التنظيف التفاعلي بدلاً من التنظيف التنبئي، مما يسمح بمزامنة الذاكرة بشكل أكثر دقة. - + Sync to framerate of video playback المزامنة مع معدل الإطارات لتشغيل الفيديو - + Run the game at normal speed during video playback, even when the framerate is unlocked. قم بتشغيل اللعبة بالسرعة العادية أثناء تشغيل الفيديو، حتى عندما يكون معدل الإطارات مفتوحًا. - + Barrier feedback loops حلقات التغذية الراجعة للحواجز - + Improves rendering of transparency effects in specific games. يحسن عرض تأثيرات الشفافية في بعض الألعاب المحددة. - + Enable buffer history تمكين سجل التخزين المؤقت - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. يُتيح هذا الخيار الوصول إلى حالات التخزين المؤقت السابقة. وقد يُحسّن جودة العرض وثبات الأداء في بعض الألعاب. - + Fix bloom effects إصلاح تأثيرات التوهج - + Removes bloom in Burnout. يزيل التوهج في وضع الاحتراق. - + Enable Legacy Rescale Pass تفعيل ميزة إعادة التحجيم القديمة - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. قد يصلح مشاكل إعادة القياس في بعض الألعاب بالاعتماد على سلوك من التنفيذ السابق. حل لسلوك قديم يصلح تشوهات الخطوط على بطاقات AMD وIntel الرسومية، ووميض النسيج الرمادي على بطاقات Nvidia الرسومية في لعبة Luigi's Mansion 3. - + Extended Dynamic State الحالة الديناميكية الموسعة - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. يتحكم في عدد الميزات التي يمكن استخدامها في الحالة الديناميكية الموسعة.تسمح الحالات الأعلى بمزيد من الميزات ويمكن أن تزيد من الأداء، ولكنها قد تسبب مشكلات رسومية إضافية. - + Vertex Input Dynamic State حالة ديناميكية لإدخال الرأس - + Enables vertex input dynamic state feature for better quality and performance. يتيح ميزة الحالة الديناميكية لإدخال الرأس لتحسين الجودة والأداء. - + Sample Shading تظليل العينة - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. يسمح لمظلل الأجزاء بالتنفيذ لكل عينة في جزء متعدد العينات بدلاً من مرة واحدة لكل جزء. يحسن جودة الرسومات على حساب الأداء. القيم الأعلى تحسن الجودة ولكنها تقلل من الأداء. - + RNG Seed مولد الأرقام العشوائية - + Controls the seed of the random number generator. Mainly used for speedrunning. يتحكم في بذرة مولد الأرقام العشوائية. يُستخدم بشكل رئيسي في سباقات السرعة. - + Device Name اسم الجهاز - + The name of the console. اسم وحدة التحكم. - + Homebrew Args Homebrew وسائط - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). (noglsl -مثل) عند التشغيل Homebrew سطر الأوامر الوسائط المُمررة إلى - + Custom RTC Date: - المخصص RTC تاريخ: + :تاريخ التوقيت الحقيقي المخصص - + This option allows to change the clock of the console. Can be used to manipulate time in games. يتيح لك هذا الخيار تغيير ساعة وحدة التحكم. يمكن استخدامه للتحكم بالوقت في الألعاب. - + The number of seconds from the current unix time عدد الثواني من وقت يونكس الحالي - + Language: - اللغة: + :اللغة - + This option can be overridden when region setting is auto-select يمكن تجاوز هذا الخيار عند تحديد إعداد المنطقة تلقائيًا - + Region: - المنطقة: + :المنطقة - + The region of the console. منطقة وحدة التحكم. - + Time Zone: - المنطقة الزمنية: + :المنطقة الزمنية - + The time zone of the console. المنطقة الزمنية لوحدة التحكم. - + Sound Output Mode: - وضع إخراج الصوت: + :وضع إخراج الصوت - + Console Mode: - وضع وحدة التحكم: + :وضع وحدة التحكم - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1129,1042 +1139,1042 @@ Setting to Handheld can help improve performance for low end systems. يُمكن أن يُساعد الضبط على الوضع المحمول على تحسين أداء الأجهزة منخفضة المواصفات. - + Prompt for user profile on boot المطالبة بملف تعريف المستخدم عند التشغيل - + Useful if multiple people use the same PC. مفيد إذا كان هناك عدة أشخاص يستخدمون نفس الكمبيوتر. - + Pause when not in focus توقف عند عدم التركيز - + Pauses emulation when focusing on other windows. يوقف المحاكاة عند التركيز على نوافذ أخرى. - + Confirm before stopping emulation تأكيد قبل إيقاف المحاكاة - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. يتجاوز المطالبات التي تطلب تأكيد إيقاف المحاكاة. يؤدي تمكينه إلى تجاوز هذه المطالبات والخروج مباشرة من المحاكاة. - + Hide mouse on inactivity إخفاء الماوس عند عدم النشاط - + Hides the mouse after 2.5s of inactivity. يخفي الماوس بعد 2.5 ثانية من عدم النشاط. - + Disable controller applet تعطيل تطبيق التحكم - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. يُعطّل استخدام أداة التحكم في البرامج المُحاكاة قسرًا. عند محاولة أي برنامج فتح أداة التحكم، تُغلق فورًا. - + Check for updates التحقق من توفر التحديثات - + Whether or not to check for updates upon startup. ما إذا كان يجب التحقق من التحديثات عند بدء التشغيل أم لا. - + Enable Gamemode تمكين وضع اللعبة - + Force X11 as Graphics Backend كخلفية رسومات X11 فرض - + Custom frontend الواجهة الأمامية المخصصة - + Real applet تطبيق صغير حقيقي - + Never أبداً - + On Load عند التحميل - + Always دائماً - + CPU وحدة المعالجة المركزية - + GPU وحدة معالجة الرسومات - + CPU Asynchronous وحدة المعالجة المركزية غير المتزامنة - + Uncompressed (Best quality) Uncompressed (أفضل جودة) - + BC1 (Low quality) BC1 (جودة منخفضة) - + BC3 (Medium quality) BC3 (جودة متوسطة) - - + + Auto تلقائي - + 30 FPS 30 إطارًا في الثانية - + 60 FPS 60 إطارًا في الثانية - + 90 FPS 90 إطارًا في الثانية - + 120 FPS 120 إطارًا في الثانية - + Conservative محافظ - + Aggressive عدواني - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null لا شيء - + Fast سريع - - - + + + Accurate دقه - - - + + + Default افتراضي - + Unsafe (fast) غير آمن (سريع) - + Safe (stable) آمن (مستقر) - + Immediate فوري - + Balanced متوازن - + Strict صارم - + Unsafe غير آمن - + Paranoid (disables most optimizations) جنون العظمة (يعطل معظم التحسينات) - + Debugging تصحيح الأخطاء - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed نافذة بلا حدود - + Exclusive Fullscreen شاشة كاملة حصرية - + No Video Output لا يوجد إخراج فيديو - + CPU Video Decoding فك تشفير فيديو وحدة المعالجة المركزية - + GPU Video Decoding (Default) فك تشفير فيديو وحدة معالجة الرسومات (افتراضي) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [تجريبي] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [تجريبي] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [تجريبي] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [تجريبي] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [تجريبي] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution دقة فائقة للألعاب من سنابدراغون - + Snapdragon Game Super Resolution EdgeDir دقة فائقة للألعاب من سنابدراغون EdgeDir - + None لا شيء - + FXAA FXAA - + SMAA SMAA - + Default (16:9) (16:9) افتراضي - + Force 4:3 4:3 فرض - + Force 21:9 21:9 فرض - + Force 16:10 16:10 فرض - + Stretch to Window تمديد إلى النافذة - + Automatic تلقائي - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) اليابانية (日本語) - + American English الإنجليزية الأمريكية - + French (français) الفرنسية (français) - + German (Deutsch) الألمانية (Deutsch) - + Italian (italiano) الإيطالية (Italiano) - + Spanish (español) الإسبانية (español) - + Chinese الصينية - + Korean (한국어) الكورية (한국어) - + Dutch (Nederlands) الهولندية (Nederlands) - + Portuguese (português) البرتغالية (Português) - + Russian (Русский) الروسية (Русский) - + Taiwanese تايواني - + British English - الإنكليزية البريطانية + الإنجليزية البريطانية - + Canadian French الكندية الفرنسية - + Latin American Spanish أمريكا اللاتينية الإسبانية - + Simplified Chinese الصينية المبسطة - + Traditional Chinese (正體中文) الصينية التقليدية (正體中文) - + Brazilian Portuguese (português do Brasil) البرتغالية البرازيلية (português do Brasil) - + Polish (polska) البولندية (polska) - + Thai (แบบไทย) التايلاندية (แบบไทย) - - + + Japan اليابان - + USA الولايات المتحدة الأمريكية - + Europe أوروبا - + Australia أستراليا - + China الصين - + Korea كوريا - + Taiwan تايوان - + Auto (%1) Auto select time zone تلقائي (%1) - + Default (%1) Default time zone افتراضي (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba - Cuba + كوبا - + EET EET - + Egypt - Egypt + مصر - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - - - GMT - GMT - - - - GMT+0 - GMT+0 - - - - GMT-0 - GMT-0 - - GMT0 - GMT0 + GMT + توقيت غرينتش - Greenwich - Greenwich + GMT+0 + توقيت غرينتش +0 - Hongkong - Hongkong + GMT-0 + -0 توقيت غرينتش + GMT0 + 0 توقيت غرينتش + + + + Greenwich + غرينتش + + + + Hongkong + هونغ كونغ + + + HST HST - - - Iceland - Iceland - - - - Iran - Iran - - - - Israel - Israel - - Jamaica - Jamaica + Iceland + أيسلندا + + + + Iran + إيران + Israel + إسرائيل + + + + Jamaica + جامايكا + + + Kwajalein Kwajalein - + Libya - Libya + ليبيا - + MET - MET + توقيت وسط أوروبا - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland - Poland + بولندا - + Portugal - Portugal + البرتغال - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore - Singapore + سنغافورة - + Turkey - Turkey + تركيا - + UCT UCT - + Universal عالمي - + UTC UTC - + W-SU W-SU - + WET - WET + توقيت غرب أوروبا - + Zulu Zulu - + Mono أحادي - + Stereo مجسم - + Surround محيطي - + 4GB DRAM (Default) 4GB DRAM (افتراضي) - + 6GB DRAM (Unsafe) 6GB DRAM (غير آمنة) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (غير آمنة) - + 12GB DRAM (Unsafe) 12GB DRAM (غير آمنة) - + Docked الإرساء - + Handheld محمول - - + + Normal - طبيعي + قياسي - - + + Boost تعزيز - - + + Overclock كسر السرعة - + Always ask (Default) اسأل دائمًا (افتراضي) - + Only if game specifies not to stop فقط إذا حددت اللعبة عدم التوقف - + Never ask لا تسأل أبدا - + Very Small (16 MB) صغير جدًا (16 ميغابايت) - + Small (32 MB) صغير (32 ميغابايت) - + Normal (128 MB) قياسي (128 ميغابايت) - + Large (256 MB) كبير (256 ميغابايت) - + Very Large (512 MB) كبير جدًا (512 ميغابايت) - + Very Low (4 MB) منخفض جدًا (4 ميغابايت) - + Low (8 MB) منخفض (8 ميغابايت) - + Normal (16 MB) قياسي (16 ميغابايت) - + Medium (32 MB) متوسط (32 ميغابايت) - + High (64 MB) عالي (64 ميغابايت) - + Very Low (32) منخفض جدًا (32) - + Low (64) منخفض (64) - + Normal (128) قياسي (128) - + Medium (256) متوسط (256) - + High (512) عالي (512) - + Disabled معطل - + ExtendedDynamicState 1 الحالة الديناميكية الممتدة 1 - + ExtendedDynamicState 2 الحالة الديناميكية الممتدة 2 - + ExtendedDynamicState 3 الحالة الديناميكية الممتدة 3 - + Tree View عرض قائمة - + Grid View عرض شبكة @@ -2334,7 +2344,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable block linking - تمكين ربط الكتلة + تفعيل ربط الكتلة @@ -2756,7 +2766,7 @@ When a program attempts to open the controller applet, it is immediately closed. Debug Knobs: - أزرار تصحيح الأخطاء: + :أزرار تصحيح الأخطاء @@ -3096,7 +3106,7 @@ When a program attempts to open the controller applet, it is immediately closed. Choose an action for the save data directory: - اختر إجراءً لمجلد بيانات الحفظ: + :اختر إجراءً لمجلد بيانات الحفظ @@ -3264,33 +3274,38 @@ Would you like to delete the old save data? :لون الخلفية - + % FSR/SGSR sharpening percentage (e.g. 50%) % - + + Configure Effects... + إعداد التأثيرات... + + + Off معطل - + VSync Off VSync معطل - + Recommended مستحسن - + On مفعل - + VSync On VSync مفعل @@ -3410,7 +3425,7 @@ Would you like to delete the old save data? [waiting] - [انتظار] + [جارٍ الانتظار] @@ -3789,12 +3804,12 @@ Would you like to delete the old save data? Enable direct JoyCon driver - تمكين برنامج تشغيل جوي كون المباشر + تفعيل برنامج تشغيل جوي كون المباشر Enable direct Pro Controller driver [EXPERIMENTAL] - المباشر [تجريبي] Pro Controller تمكين برنامج تشغيل + المباشر [تجريبي] Pro Controller تفعيل برنامج تشغيل @@ -4327,7 +4342,7 @@ To invert the axes, first move your joystick vertically, and then horizontally.< [waiting] - [انتظار] + [جارٍ الانتظار] @@ -4337,7 +4352,7 @@ To invert the axes, first move your joystick vertically, and then horizontally.< Enter a profile name: - أدخل اسم ملف التعريف: + :أدخل اسم ملف التعريف @@ -4517,7 +4532,7 @@ To invert the axes, first move your joystick vertically, and then horizontally.< Testing - اختبار + جارٍ الاختبار @@ -4917,103 +4932,118 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. + تُطبق التغييرات فورًا أثناء سير اللعبة. - + Enable post-processing تفعيل المعالجة اللاحقة - + Preset: - الإعداد المسبق: + :الإعداد المسبق - + Apply تطبيق - + Reset Values إعادة تعيين القيم - + Return every effect to the values the preset ships with. إعادة كل تأثير إلى القيم التي تأتي بها الإعدادات المسبقة. - + Save As... حفظ باسم... - + Save Preset حفظ الإعداد المسبق - + Preset name: - اسم الإعداد المسبق: + :اسم الإعداد المسبق - - Delete - حذف + + Clear + مسح - + + Remove every effect in use and deselect the preset. + قم بإزالة جميع المؤثرات قيد الاستخدام وإلغاء تحديد الإعداد المسبق. + + + Add Effect إضافة تأثير - + + None + لا شيء + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + لا توجد تأثيرات قيد الاستخدام. اختر إعدادًا مسبقًا واضغط على تطبيق، أو أضف التأثيرات واحدًا تلو الآخر. + + + Custom chain. Pick a preset above and press Apply to replace it. سلسلة مخصصة. اختر إعدادًا مسبقًا أعلاه واضغط على تطبيق لاستبداله. - + Active preset: %1 (modified). Press Reset Values to go back to how it ships. الإعداد المسبق النشط: 1% (معدّل). اضغط على إعادة تعيين القيم للعودة إلى الإعدادات الافتراضية. - + Active preset: %1 الإعداد المسبق النشط: 1% - + Enabled تفعيل - + Disabled تعطيل - + Reset to defaults إعادة التعيين إلى الإعدادات الافتراضية - + Effect '%1' was not found. لم يتم العثور على التأثير '1%'. - + Effect failed to compile: %1 فشل تجميع التأثير: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -5269,7 +5299,7 @@ UUID: %2 [waiting] - [انتظار] + [جارٍ الانتظار] @@ -5661,7 +5691,7 @@ Drag points to change position, or double-click table cells to edit values. English - الإنجليزية + English @@ -5982,7 +6012,7 @@ Drag points to change position, or double-click table cells to edit values. Connecting - الاتصال + جارٍ الاتصال @@ -7031,7 +7061,7 @@ Debug Message: - + &Pause &إيقاف مؤقت @@ -7182,7 +7212,7 @@ Debug Message: - + &Start &بدء @@ -7193,7 +7223,7 @@ Debug Message: - + R&ecord ت&سجيل @@ -7284,7 +7314,7 @@ Debug Message: - + None لا شيء @@ -7310,400 +7340,405 @@ Debug Message: &عرض دائري - + Small (32x32) صغير (32x32) - + Standard (64x64) قياسي (64x64) - + Large (128x128) كبير (128x128) - + Full Size (256x256) حجم كامل (256x256) - + Broken Vulkan Installation Detected Vulkan تم الكشف عن تلف في تثبيت - + Vulkan initialization failed during boot. أثناء التشغيل Vulkan فشل تهيئة. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping تشغيل لعبة - + Loading Web Applet... جارٍ تحميل تطبيق الويب... - - + + Disable Web Applet تعطيل تطبيق الويب - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) قد يؤدي تعطيل أداة الويب إلى سلوك غير محدد، ويجب استخدامه فقط مع لعبة Super Mario 3D All-Stars. هل أنت متأكد من رغبتك في تعطيل أداة الويب؟ (يمكن إعادة تفعيلها في إعدادات التصحيح.) - + The amount of shaders currently being built كمية التظليلات التي يتم بناؤها حاليًا - + The current selected resolution scaling multiplier. مضاعف قياس الدقة المحددة حالياً. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Switch سرعة المحاكاة الحالية. تشير القيم الأعلى أو الأقل من 100٪ إلى أن المحاكاة تعمل بشكل أسرع أو أبطأ من. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. عدد الإطارات في الثانية التي تعرضها اللعبة حاليًا. يختلف هذا العدد من لعبة إلى أخرى ومن مشهد إلى آخر. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. الوقت المستغرق لمحاكاة إطار على جهاز سويتش، بدون احتساب تحديد الإطارات أو المزامنة العمودية. لمحاكاة بسرعة كاملة، يجب أن يكون هذا في حدود 16.67 مللي ثانية كحد أقصى. - + Unmute إلغاء كتم الصوت - + Mute كتم الصوت - + Reset Volume إعادة تعيين مستوى الصوت - + + Configure Effects... + إعداد التأثيرات... + + + &Clear Recent Files &مسح الملفات الحديثة - + &Continue &متابعة - + Warning: Outdated Game Format تحذير: تنسيق اللعبة قديم - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. أنت تستخدم تنسيق مجلد ROM المُفكك لهذه اللعبة، وهو تنسيق قديم استُبدل بآخر مثل NCA وNAX وXCI وNSP. تفتقر مجلدات ROM المُفككة إلى الأيقونات والبيانات الوصفية ودعم التحديثات. <br>لتوضيح تنسيقات Switch المختلفة التي يدعمها Eden، يُرجى مراجعة دليل المستخدم. لن تظهر هذه الرسالة مرة أخرى. - - + + Error while loading ROM! ROM خطأ أثناء تحميل - + The ROM format is not supported. غير مدعوم ROM تنسيق. - + An error occurred initializing the video core. حدث خطأ أثناء تهيئة نواة الفيديو. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. عادةً ما يحدث هذا بسبب برامج تشغيل بطاقة الرسوميات GPU القديمة. يرجى الاطلاع على ملف السجل لمزيد من التفاصيل. انظر: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'> كيفية الوصول إلى ملفات السجل</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. حدث خطأ أثناء تحميل ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Discord/Stoat يرجى إعادة تحميل ملفاتك أو طلب المساعدة على - + An unknown error occurred. Please see the log for more details. حدث خطأ غير معروف. يرجى الاطلاع على السجل لمزيد من التفاصيل. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... جارٍ إغلاق البرنامج... - + Save Data بيانات الحفظ - + Mod Data بيانات التعديل - + Error Opening %1 Folder خطأ في فتح المجلد %1 - - + + Folder does not exist! المجلد غير موجود! - + Remove Installed Game Contents? إزالة محتويات اللعبة المثبتة؟ - + Remove Installed Game Update? إزالة تحديث اللعبة المثبت؟ - + Remove Installed Game DLC? إزالة المحتوى القابل للتنزيل المثبت للعبة؟ - + Remove Entry إزالة الإدخال - + Delete OpenGL Transferable Shader Cache? OpenGL Shader حذف ذاكرة التخزين المؤقتة القابلة للنقل لـ - + Delete Vulkan Transferable Shader Cache? Vulkan Shader حذف ذاكرة التخزين المؤقتة القابلة للنقل لـ - + Delete All Transferable Shader Caches? حذف جميع مخازن ذاكرة التظليل القابلة للنقل؟ - + Remove Custom Game Configuration? إزالة إعدادات اللعبة المخصص؟ - + Remove Cache Storage? إزالة ذاكرة التخزين المؤقتة؟ - + Remove File إزالة الملف - + Remove Play Time Data إزالة بيانات زمن اللعب - + Reset play time? إعادة تعيين زمن اللعب؟ - - + + RomFS Extraction Failed! RomFS فشل استخراج - + There was an error copying the RomFS files or the user cancelled the operation. أو قام المستخدم بإلغاء العملية RomFS حدث خطأ أثناء نسخ ملفات - + Full كامل - + Skeleton Skeleton - + Select RomFS Dump Mode RomFS حدد وضع تفريغ - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. الرجاء تحديد الطريقة التي تريد بها تفريغ RomFS. <br>سيتم نسخ جميع الملفات إلى المجلد الجديد في أثناء <br>قيام الهيكل العظمي بإنشاء بنية المجلد فقط. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root لا توجد مساحة فارغة كافية في %1 لاستخراج نظام الملفات RomFS. يُرجى تحرير مساحة أو اختيار مجلد تفريغ آخر من: المحاكاة > التكوين > النظام > نظام الملفات > تفريغ الجذر. - + Extracting RomFS... RomFS استخراج... - - + + Cancel إلغاء - + RomFS Extraction Succeeded! بنجاح RomFS تم استخراج! - + The operation completed successfully. تمت العملية بنجاح. - + Error Opening %1 خطأ في فتح %1 - + Select Directory حدد المجلد - + Properties خصائص - + The game properties could not be loaded. تعذر تحميل خصائص اللعبة. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. تشغيل الملف القابل للتنفيذ (%1)؛؛جميع الملفات (*.*) - + Load File تحميل الملف - + Open Extracted ROM Directory المستخرج ROM فتح ملف - + Invalid Directory Selected تم تحديد مجلد غير صالح - + The directory you have selected does not contain a 'main' file. لا يحتوي المجلد الذي حددته على ملف رئيسي - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files تثبيت الملفات - + %n file(s) remaining %n ملف (ملفات) متبقية%n ملف (ملفات) متبقية%n ملف (ملفات) متبقية%n ملف (ملفات) متبقية%n ملف (ملفات) متبقية%n ملف (ملفات) متبقية - + Installing file "%1"... تثبيت الملف ”%1“... - - + + Install Results نتائج التثبيت - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. لتجنب أي تعارضات محتملة، ننصح المستخدمين بعدم تثبيت الألعاب الأساسية على الذاكرة الداخلية. يرجى استخدام هذه الميزة فقط لتثبيت التحديثات والمحتوى القابل للتنزيل. - + %n file(s) were newly installed %n تم تثبيت ملف (ملفات) جديدة @@ -7715,7 +7750,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) were overwritten %n تم استبدال ملف (ملفات) @@ -7727,7 +7762,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) failed to install %n فشل تثبيت ملف (ملفات) @@ -7739,314 +7774,324 @@ Please, only use this feature to install updates and DLC. - + System Application تطبيق النظام - + System Archive أرشيف النظام - + System Application Update تحديث تطبيق النظام - + Firmware Package (Type A) حزمة الفيرموير (النوع أ) - + Firmware Package (Type B) حزمة الفيرموير (النوع ب) - + Game لعبة - + Game Update تحديث اللعبة - + Game DLC الخاص باللعبة DLC الـ - + Delta Title Delta عنوان - + Select NCA Install Type... NCA حدد نوع تثبيت... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) يرجى تحديد نوع اللعبة التي ترغب في تثبيت NCA عليها: (في معظم الحالات، يكون الإعداد الافتراضي "لعبة" مناسبًا.) - + Failed to Install فشل التثبيت - + The title type you selected for the NCA is invalid. غير صالح NCA نوع العنوان الذي حددته لـ. - + File not found لم يتم العثور على الملف - + File "%1" not found لم يتم العثور على الملف "%1" - + OK موافق - + Function Disabled الوظيفة معطلة - + Compatibility list reporting is currently disabled. Check back later! تقارير قائمة التوافق معطلة حاليًا. يرجى التحقق لاحقًا! - + Error opening URL خطأ في فتح الرابط - + Unable to open the URL "%1". تعذر فتح الرابط ”%1“ - + TAS Recording TAS تسجيل - + Overwrite file of player 1? الكتابة فوق ملف اللاعب 1؟ - + Invalid config detected تم اكتشاف إعدادات غير صالح - + Handheld controller can't be used on docked mode. Pro controller will be selected. لا يمكن استخدام وحدة التحكم المحمولة في وضع الإرساء. سيتم اختيار وحدة تحكم احترافية. - - + + Amiibo أميبو - - + + The current amiibo has been removed تمت إزالة أميبو الحالي. - + Error خطأ - - + + The current game is not looking for amiibos اللعبة الحالية لا تبحث عن أميبو - + Amiibo File (%1);; All Files (*.*) جميع الملفات (%1)؛؛ ملف أميبو (*.*) - + Load Amiibo تحميل أميبو - + Error loading Amiibo data خطأ أثناء تحميل بيانات أميبو - + The selected file is not a valid amiibo الملف المحدد ليس أميبو صالح - + The selected file is already on use الملف المحدد قيد الاستخدام بالفعل - + An unknown error occurred حدث خطأ غير معروف - + No firmware available لا يوجد فيرموير متوفر - + Firmware Corrupted الفيرموير تالف - + Unknown applet تطبيق غير معروف - + Applet doesn't map to a known value. لا يرتبط التطبيق المصغر بقيمة معروفة. - + Record not found لم يتم العثور على السجل - + Applet not found. Please reinstall firmware. لم يتم العثور على التطبيق المصغر. يرجى إعادة تثبيت الفيرموير. - + Capture Screenshot التقاط لقطة شاشة - + PNG Image (*.png) PNG Image (*.png) - + TAS state: Running %1/%2 حالة TAS: تشغيل %1/%2 - + TAS state: Recording %1 حالة TAS: تسجيل %1 - + TAS state: Idle %1/%2 حالة TAS: خامل %1/%2 - + TAS State: Invalid حالة TAS: غير صالحة - + &Stop Running &إيقاف التشغيل - + Stop R&ecording إيقاف ال&تسجيل - + Building: %n shader(s) بناء: %n تظليل(ات)بناء: %n تظليل(ات)بناء: %n تظليل(ات)بناء: %n تظليل(ات)بناء: %n تظليل(ات)بناء: %n تظليل(ات) - + Scale: %1x %1 is the resolution scaling factor الدقة: %1x - + Speed: %1% / %2% السرعة: %1% / %2% - + Speed: %1% السرعة: %1% - + Game: %1 FPS اللعبة: %1 FPS - + Frame: %1 ms الإطار: %1 ms - + NO AA NO AA - + + NO FX + NO FX + + + + FX + FX + + + VOLUME: MUTE الصوت: كتم الصوت - + VOLUME: %1% Volume percentage (e.g. 50%) %1% :الصوت - + Derivation Components Missing مكونات الاشتقاق مفقودة - + Decryption keys are missing. Install them now? مفاتيح فك التشفير مفقودة. هل تريد تثبيتها الآن؟ - + Wayland Detected! Wayland تم الكشف عن - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8057,74 +8102,74 @@ Would you like to force it for future launches? هل ترغب في فرض استخدامه في عمليات التشغيل المستقبلية؟ - + Use X11 X11 استخدم - + Continue with Wayland Wayland متابعة مع - + Don't show again لا تعرض مرة أخرى - + Restart Required إعادة التشغيل مطلوبة - + Restart Eden to apply the X11 backend. X11 أعد تشغيل إيدن لتطبيق الخلفية - + Slow بطيء - + Turbo تيربو - + Unlocked إلغاء القفل - + Select RomFS Dump Target RomFS حدد هدف تفريغ - + Please select which RomFS you would like to dump. الذي تريد تفريغه RomFS الرجاء تحديد - + Are you sure you want to close Eden? هل أنت متأكد من أنك تريد إغلاق إيدن؟ - - - + + + Eden إيدن - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. هل أنت متأكد من أنك تريد إيقاف المحاكاة؟ سيتم فقدان أي تقدم لم يتم حفظه. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? @@ -9249,7 +9294,7 @@ p, li { white-space: pre-wrap; } Creation Date - تاريخ الانشاء + تاريخ الإنشاء @@ -9294,7 +9339,7 @@ p, li { white-space: pre-wrap; } No game data present - لا توجد بيانات للعبة + لا توجد بيانات اللعبة @@ -9309,7 +9354,7 @@ p, li { white-space: pre-wrap; } Set nickname and owner: - تعيين الاسم المستعار والمالك + :تعيين الاسم المستعار والمالك @@ -9364,7 +9409,7 @@ p, li { white-space: pre-wrap; } Verification failed for the following files: %1 - فشل التحقق من الملفات التالية: + :فشل التحقق من الملفات التالية %1 @@ -9629,7 +9674,7 @@ OS reported error: %1 %1 To: %2 - تعذر ربط المجلد: + :تعذر ربط المجلد %1 To: %2 @@ -10528,7 +10573,7 @@ Please try again or contact the developer of the software. Select a user: - حدد مستخدمًا: + :حدد مستخدمًا diff --git a/dist/languages/ca.ts b/dist/languages/ca.ts index 6b9f560f4a..df14f1d565 100644 --- a/dist/languages/ca.ts +++ b/dist/languages/ca.ts @@ -569,70 +569,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Mode pantalla completa: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: Relació d'aspecte: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: Emulació NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -641,55 +651,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: Mode de sincronització vertical: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -697,79 +707,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: Filtrat anisotròpic: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: Mode de la GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Precisió DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -779,1327 +789,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Llavor de GNA - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Nom del dispositiu - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Idioma: - + This option can be overridden when region setting is auto-select - + Region: Regió: - + The region of the console. - + Time Zone: Zona horària: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: Mode de la consola - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Ocultar el cursor del ratolí en cas d'inactivitat - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Activa el mode joc - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never Mai - + On Load - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservador - + Aggressive Agressiu - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Ensamblat d'ombrejadors, només NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, només AMD/Mesa) - + Null Nul - + Fast Ràpid - - - + + + Accurate Precís - - - + + + Default Valor predeterminat - + Unsafe (fast) Insegur (ràpid) - + Safe (stable) Segur (estable) - + Immediate - + Balanced Equilibrat - + Strict - + Unsafe Insegur - + Paranoid (disables most optimizations) Paranoic (desactiva la majoria d'optimitzacions) - + Debugging Depuració - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Finestra sense vores - + Exclusive Fullscreen Pantalla completa exclusiva - + No Video Output Sense sortida de vídeo - + CPU Video Decoding Descodificació de vídeo a la CPU - + GPU Video Decoding (Default) Descodificació de vídeo a la GPU (Valor predeterminat) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Veí més proper - + Bilinear Bilineal - + Bicubic Bicúbic - + Gaussian Gaussià - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution Super resolució AMD FidelityFX - + Area Àrea - + MMPX MMPX - + Zero-Tangent Tangència zero - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Cap - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Valor predeterminat (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 - + Stretch to Window Estirar a la finestra - + Automatic Automàtic - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonès (日本語) - + American English Anglès americà - + French (français) Francès (français) - + German (Deutsch) Alemany (Deutsch) - + Italian (italiano) Italià (italiano) - + Spanish (español) Castellà (español) - + Chinese Xinès - + Korean (한국어) Coreà (한국어) - + Dutch (Nederlands) Holandès (Nederlands) - + Portuguese (português) Portuguès (português) - + Russian (Русский) Rus (Русский) - + Taiwanese Taiwanès - + British English Anglès britànic - + Canadian French Francès canadenc - + Latin American Spanish Espanyol llatinoamericà - + Simplified Chinese Xinès simplificat - + Traditional Chinese (正體中文) Xinès tradicional (正體中文) - + Brazilian Portuguese (português do Brasil) Portuguès brasiler (português do Brasil) - + Polish (polska) Polonès (polska) - + Thai (แบบไทย) Tailandès (แบบไทย) - - + + Japan Japó - + USA EUA - + Europe Europa - + Australia Austràlia - + China Xina - + Korea Corea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Per defecte (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland Islàndia - + Iran Iran - + Israel Isreal - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polònia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estèreo - + Surround Envoltant - + 4GB DRAM (Default) 4GB DRAM (Insegur) - + 6GB DRAM (Unsafe) 6GB DRAM (Insegur) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Insegur) - + 12GB DRAM (Unsafe) 12GB DRAM (Insegur) - + Docked Sobretaula - + Handheld Portàtil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop Tan sols si el joc especifica no parar - + Never ask No preguntar mai - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3198,33 +3208,38 @@ Would you like to delete the old save data? Color de fons: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Apagat - + VSync Off Vsync Apagat - + Recommended Recomanat - + On Encés - + VSync On VSync Encés @@ -4845,102 +4860,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6955,7 +6985,7 @@ Debug Message: - + &Pause &Pausar @@ -7106,7 +7136,7 @@ Debug Message: - + &Start &Iniciar @@ -7117,7 +7147,7 @@ Debug Message: - + R&ecord E&nregistrar @@ -7208,7 +7238,7 @@ Debug Message: - + None Cap @@ -7234,722 +7264,737 @@ Debug Message: - + Small (32x32) Petit (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute Desilenciar - + Mute Silenciar - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full Complet - + Skeleton Esquelet - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel Cancel·lar - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties Propietats - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File Carregar arxiu - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files Instal·lar arxius - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game Joc - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK D'acord - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor Escala: %1x - + Speed: %1% / %2% Velocitat: %1% / %2% - + Speed: %1% Velocitat: %1% - + Game: %1 FPS Joc: %1 FPS - + Frame: %1 ms Fotograma: %1 ms - + NO AA SENSE AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) VOLUMEN: %1% - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7957,74 +8002,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow Lent - + Turbo Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/cs.ts b/dist/languages/cs.ts index 875ade6480..3f2a2cffd9 100644 --- a/dist/languages/cs.ts +++ b/dist/languages/cs.ts @@ -569,70 +569,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Režim celé obrazovky: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: Poměr stran: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -641,55 +651,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -697,79 +707,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: Anizotropní filtrování: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -779,1327 +789,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Název Zařízení - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Jazyk: - + This option can be overridden when region setting is auto-select - + Region: Region: - + The region of the console. - + Time Zone: Časové Pásmo: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Potvrzení před zastavením emulace - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Skrýt myš při neaktivitě - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Automatické - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Přesné - - - + + + Default Výchozí - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe Nebezpečné - + Paranoid (disables most optimizations) Paranoidní (zakáže většinu optimizací) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Okno bez okrajů - + Exclusive Fullscreen Exkluzivní - + No Video Output - + CPU Video Decoding - + GPU Video Decoding (Default) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) - + 3X (2160p/3240p) - + 4X (2880p/4320p) - + 5X (3600p/5400p) - + 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor - + Bilinear Bilineární - + Bicubic - + Gaussian - + Lanczos - + ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Žádné - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Výchozí (16:9) - + Force 4:3 Vynutit 4:3 - + Force 21:9 Vynutit 21:9 - + Force 16:10 - + Stretch to Window Roztáhnout podle okna - + Automatic - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonština (日本語) - + American English - + French (français) Francouzština (français) - + German (Deutsch) Nemčina (Deutsch) - + Italian (italiano) Italština (Italiano) - + Spanish (español) Španělština (español) - + Chinese Čínština - + Korean (한국어) Korejština (한국어) - + Dutch (Nederlands) Holandština (Nederlands) - + Portuguese (português) Portugalština (português) - + Russian (Русский) Ruština (Русский) - + Taiwanese Tajwanština - + British English Britská Angličtina - + Canadian French Kanadská Francouzština - + Latin American Spanish Latinsko Americká Španělština - + Simplified Chinese Zjednodušená Čínština - + Traditional Chinese (正體中文) Tradiční Čínština (正體中文) - + Brazilian Portuguese (português do Brasil) Brazilská Portugalština (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonsko - + USA USA - + Europe Evropa - + Australia Austrálie - + China Čína - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egypt - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamajka - + Kwajalein Kwajalein - + Libya Lybie - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polsko - + Portugal Portugalsko - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turecko - + UCT UCT - + Universal Univerzální - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Zadokovaná - + Handheld Příruční - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Vždy se zeptat (Výchozí) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3190,33 +3200,38 @@ Would you like to delete the old save data? Barva Pozadí: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off - + VSync Off - + Recommended - + On - + VSync On @@ -4837,102 +4852,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6945,7 +6975,7 @@ Debug Message: - + &Pause &Pauza @@ -7096,7 +7126,7 @@ Debug Message: - + &Start &Start @@ -7107,7 +7137,7 @@ Debug Message: - + R&ecord @@ -7198,7 +7228,7 @@ Debug Message: - + None @@ -7224,722 +7254,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7947,74 +7992,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/da.ts b/dist/languages/da.ts index 32ebbea332..d4dbe2fa31 100644 --- a/dist/languages/da.ts +++ b/dist/languages/da.ts @@ -571,70 +571,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Fuldskærmstilstand: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: Skærmformat: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: NVDEC-emulering: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -643,55 +653,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -699,79 +709,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: Anisotropisk Filtrering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -781,1327 +791,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG-Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Region - + The region of the console. - + Time Zone: Tidszone - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Skjul mus ved inaktivitet - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Automatisk - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Nøjagtig - - - + + + Default Standard - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe Usikker - + Paranoid (disables most optimizations) Paranoid (deaktiverer de fleste optimeringer) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Uindrammet Vindue - + Exclusive Fullscreen Eksklusiv Fuld Skærm - + No Video Output Ingen Video-Output - + CPU Video Decoding CPU-Video Afkodning - + GPU Video Decoding (Default) GPU-Video Afkodning (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75X (540p/810p) [EKSPERIMENTEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor Nærmeste Nabo - + Bilinear Bilineær - + Bicubic Bikubisk - + Gaussian Gausisk - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tving 4:3 - + Force 21:9 Tving 21:9 - + Force 16:10 - + Stretch to Window Stræk til Vindue - + Automatic - + 2x - + 4x - + 8x - + 16x - + Japanese (日本語) Japansk (日本語) - + American English - + French (français) Fransk (français) - + German (Deutsch) Tysk (Deutsch) - + Italian (italiano) Italiensk (italiano) - + Spanish (español) Spansk (español) - + Chinese Kinesisk - + Korean (한국어) Koreansk (한국어) - + Dutch (Nederlands) Hollandsk (Nederlands) - + Portuguese (português) Portugisisk (português) - + Russian (Русский) Russisk (Русский) - + Taiwanese Taiwanesisk - + British English Britisk Engelsk - + Canadian French Candadisk Fransk - + Latin American Spanish Latinamerikansk Spansk - + Simplified Chinese Forenklet Kinesisk - + Traditional Chinese (正體中文) Traditionelt Kinesisk (正體中文) - + Brazilian Portuguese (português do Brasil) Braziliansk Portugisisk (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China Kina - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ægypten - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Tyrkiet - + UCT UCT - + Universal Universel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Dokket - + Handheld Håndholdt - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3198,33 +3208,38 @@ Would you like to delete the old save data? Baggrundsfarve: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off - + VSync Off - + Recommended - + On - + VSync On @@ -4845,102 +4860,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6953,7 +6983,7 @@ Debug Message: - + &Pause @@ -7104,7 +7134,7 @@ Debug Message: - + &Start @@ -7115,7 +7145,7 @@ Debug Message: - + R&ecord @@ -7206,7 +7236,7 @@ Debug Message: - + None @@ -7232,722 +7262,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7955,74 +8000,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/de.ts b/dist/languages/de.ts index ee57558cee..0c142d2709 100644 --- a/dist/languages/de.ts +++ b/dist/languages/de.ts @@ -591,12 +591,22 @@ SMAA bietet die beste Bildqualität. FXAA liefert bei niedrigeren Auflösungen ein stabileres Bild. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Vollbild-Modus: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -605,12 +615,12 @@ Der randlose Modus bietet die beste Kompatibilität mit der Bildschirmtastatur, Der exklusive Vollbildmodus bietet möglicherweise eine bessere Leistung und eine bessere Freesync-/G-Sync-Unterstützung. - + Aspect Ratio: Seitenverhältnis: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -619,36 +629,36 @@ Die meisten Spiele unterstützen nur das Seitenverhältnis 16:9, sodass Anpassun Steuert außerdem das Seitenverhältnis der aufgenommenen Bildschirmfotos. - + Use persistent pipeline cache Persistenten Rohrleitungs-Cache verwenden - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Ermöglicht das Speichern von Shadern, um sie beim nächsten Spielstart schneller laden zu können. Die Deaktivierung ist ausschließlich für Fehlerbehebungszwecke vorgesehen. - + Use asynchronous GPU emulation Asynchrone GPU-Emulation verwenden - + Uses an extra CPU thread for rendering. This option should always remain enabled. Verwendet einen zusätzlichen CPU-Thread für das Rendern. Diese Option sollte immer aktiviert bleiben. - + NVDEC emulation: NVDEC-Emulation: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -657,12 +667,12 @@ Dabei kann entweder die CPU oder die GPU für die Dekodierung verwendet werden, In den meisten Fällen bietet die GPU-Dekodierung die beste Leistung. - + ASTC Decoding Method: ASTC-Dekodier-Methode: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -675,12 +685,12 @@ CPU asynchron: Die Dekodierung von ASTC-Texturen erfolgt bei Bedarf über die CP kann jedoch zu Artefakten führen. - + ASTC Recompression Method: ASTC-Rekompression-Methode: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -689,44 +699,44 @@ BC1/BC3: Das Zwischenformat wird wieder in das BC1- oder BC3-Format komprimiert, was VRAM spart, jedoch zu Einbußen bei der Bildqualität führt. - + Frame Pacing Mode (Vulkan only) Frame-Pacing-Modus (nur Vulkan) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. Steuert, wie der Emulator das Frame-Pacing verwaltet, um Ruckeln zu reduzieren und die Bildrate flüssiger und gleichmäßiger zu gestalten. - + VRAM Usage Mode: VRAM-Nutzungs Modus: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Legt fest, ob der Emulator vorrangig Speicherplatz sparen oder den verfügbaren Grafikspeicher zur Leistungsoptimierung maximal ausnutzen soll. Der aggressive Modus kann die Leistung anderer Anwendungen, wie z. B. Aufnahmesoftware, beeinträchtigen. - + Skip CPU Inner Invalidation CPU-interne Invalidierung überspringen - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Überspringt bestimmte Cache-Invalidierungen auf CPU-Seite während Speicherupdates, reduziert die CPU-Auslastung und verbessert die Leistung. Dies verursacht vielleicht Abstürze. - + VSync Mode: VSync-Modus: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -737,12 +747,12 @@ Postkasten kann eine geringere Latenz als FIFO aufweisen und verursacht kein Tea Sofort (ohne Synchronisation) zeigt alles an, was verfügbar ist, und kann Tearing verursachen. - + Sync Memory Operations Speicheroperationen synchronisieren - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -751,44 +761,44 @@ Diese Option behebt Probleme in Spielen, kann jedoch zu Leistungseinbußen führ Bei Spielen mit Unreal Engine 4 sind die Auswirkungen oft am deutlichsten spürbar. - + Enable asynchronous presentation (Vulkan only) Aktiviere asynchrone Präsentation (Nur Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Verbessert die Leistung geringfügig, indem die Darstellung auf einen separaten CPU-Thread verlagert wird. - + Force maximum clocks (Vulkan only) Erzwinge Maximale Taktrate (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Lässt im Hintergrund die GPU Aufgaben erledigen während diese auf Grafikbefehle wartet, damit diese nicht herunter taktet. - + Anisotropic Filtering: Anisotrope Filterung: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Steuert die Qualität der Texturwiedergabe bei schrägen Blickwinkeln. Bei den meisten Grafikkarten kann dieser Wert bedenkenlos auf 16x eingestellt werden. - + GPU Mode: GPU-Modus: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -797,12 +807,12 @@ Die meisten Spiele werden im Modus Schnell in Ordnung gerendert, für einige ist Partikel werden in der Regel nur im Modus Akkurat korrekt gerendert. - + DMA Accuracy: DMA-Genauigkeit: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -811,12 +821,12 @@ Unsicher ist schneller, während Sicher stabiler ist und in manchen Spielen Prob Standard folgt der GPU-Genauigkeit Einstellung. - + GPU Fence Behavior: GPU-Zaunobjekt-Verhalten: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -831,56 +841,56 @@ Strikt ist die langsamste Option, kann aber Probleme beheben, die striktere Sync Standard folgt der GPU-Genauigkeit Einstellung. - + Enable GPU buffer readback GPU-Puffer-Rücklesung aktivieren - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. Bewahrt von der GPU modifizierte Pufferdaten, indem diese vor dem Hochladen zurückgelesen werden. Einige Spiele benötigen dies, um bestimmte Effekte korrekt darzustellen. - + Enable asynchronous shader compilation Aktiviere asynchrones Shader-Kompilieren - + May reduce shader stutter. Kann Shader-Ruckler reduzieren. - + GPU Clocks GPU-Takte - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. Führt dazu, dass das Spiel glaubt, die Arbeit der GPU würde früher fertig sein, als sie eigentlich ist. Dadurch hört das Spiel auf die Auflösung und Render-Distanz zu verringern um sich den Takten der Switch anzupassen. - + GPU Unswizzle GPU-Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Beschleunigt die Dekodierung von BCn-3D-Texturen mithilfe von GPU-Rechenleistung. Deaktiviere diese Option, falls Abstürze oder Grafikfehler auftreten. - + GPU Unswizzle Max Texture Size GPU-Unswizzle max. Texturgröße - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -889,48 +899,48 @@ Während die GPU für mittelgroße und große Texturen schneller ist, kann die C Passen Sie diesen Wert an, um das Gleichgewicht zwischen GPU-Beschleunigung und CPU-Overhead zu finden. - + GPU Unswizzle Stream Size GPU-Unswizzle-Streamgröße - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Legt die maximale Menge an Texturdaten (in MiB) fest, die pro Bild verarbeitet wird. Höhere Werte können Ruckeln beim Laden von Texturen verringern, können sich jedoch auf die Bildrate auswirken. - + GPU Unswizzle Chunk Size GPU-Unswizzle Chunk-Größe - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Legt die Anzahl der Tiefenschnitte fest, die in einem einzelnen Durchlauf verarbeitet werden. Eine Erhöhung dieses Werts kann den Durchsatz auf High-End-GPUs verbessern, bei schwächerer Hardware jedoch zu TDR- oder Treiber-Auszeiten führen. - + Use Vulkan pipeline cache Vulkan-Pipeline-Cache verwenden - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Aktiviert den herstellerspezifischen Pipeline-Cache der GPU. Diese Option kann die Ladezeit von Shadern erheblich verkürzen, wenn der Vulkan-Treiber die Pipeline-Cache-Dateien nicht intern speichert. - + Enable Compute Pipelines (Intel Vulkan Only) Aktiviere Compute-Pipelines (Nur Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -939,194 +949,194 @@ Diese Einstellung ist nur bei proprietären Intel-Treibern vorhanden und kann be Bei allen anderen Treibern sind die Rechen-Rohrleitungen immer aktiviert. - + Enable Reactive Flushing Aktiviere Reactives Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Benutzt Reactive-Flushing anstatt Predictive-Flushing, welches akkurateres Speicher-Synchronisieren erlaubt. - + Sync to framerate of video playback Synchronisiere mit Bildrate von Video-Wiedergaben - + Run the game at normal speed during video playback, even when the framerate is unlocked. Lasse das Spiel in der normalen Geschwindigkeit abspielen, trotz freigeschalteter Bildrate - + Barrier feedback loops Barrier-Feedback-Schleifen - + Improves rendering of transparency effects in specific games. Verbessert das Rendering von Transparenzeffekten in bestimmten Spielen. - + Enable buffer history Puffer-Verlauf aktivieren - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Ermöglicht den Zugriff auf frühere Pufferzustände. Diese Option kann in manchen Spielen die Darstellungsqualität und die Leistungsstabilität verbessern. - + Fix bloom effects Bloom-Effekte beheben - + Removes bloom in Burnout. Entfernt Bloom in Burnout. - + Enable Legacy Rescale Pass „Legacy Rescale Pass“ aktivieren - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Behebt möglicherweise Probleme mit der Skalierung in einigen Spielen, indem auf das Verhalten der vorherigen Implementierung zurückgegriffen wird. Eine Umgehungslösung für das alte Verhalten, die Linienartefakte auf AMD- und Intel-GPUs sowie graues Texturflackern auf Nvidia-GPUs in „Luigi’s Mansion 3“ behebt. - + Extended Dynamic State Erweiterter dynamischer Zustand - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Legt die Anzahl der Funktionen fest, die im erweiterten dynamischen Modus verwendet werden können. Höhere Stufen ermöglichen mehr Funktionen und können die Leistung steigern, können jedoch zusätzliche grafische Probleme verursachen. - + Vertex Input Dynamic State Dynamischer Zustand der Scheitelpunkteingabe - + Enables vertex input dynamic state feature for better quality and performance. Aktiviert die Funktion für den dynamischen Status der Scheitelpunkteingabe, um eine bessere Qualität und Leistung zu erzielen. - + Sample Shading Probe-Schattierung - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Ermöglicht es dem Fragment-Shader, pro Abtastwert in einem mehrfach abgetasteten Fragment ausgeführt zu werden, anstatt nur einmal pro Fragment. Verbessert die Grafikqualität auf Kosten der Leistung. Höhere Werte verbessern die Qualität, beeinträchtigen jedoch die Leistung. - + RNG Seed Startwert für den Zufallszahlengenerator - + Controls the seed of the random number generator. Mainly used for speedrunning. Steuert den Startwert des Zufallszahlengenerators. Wird hauptsächlich für Schnelldurchläufe verwendet. - + Device Name Gerätename - + The name of the console. Der Name der Konsole. - + Homebrew Args Homebrew-Argumente - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Befehlszeilenargumente, die beim Start an Homebrew übergeben werden (z. B. -noglsl). - + Custom RTC Date: Benutzerdefinierte Echtzeituhrdatum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Diese Option erlaubt die Änderung der Uhr der Konsole. Kann benutzt werden um Zeit in Spielen zu manipulieren. - + The number of seconds from the current unix time Die Anzahl der Sekunden seit dem aktuellen Unix-Zeitstempel - + Language: Sprache: - + This option can be overridden when region setting is auto-select Diese Option kann überschrieben werden, wenn die Regionseinstellung auf „Automatische Auswahl“ steht - + Region: Region: - + The region of the console. Die Region der Konsole. - + Time Zone: Zeitzone: - + The time zone of the console. Die Zeitzone der Konsole. - + Sound Output Mode: Tonausgangsmodus: - + Console Mode: Konsolenmodus: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1135,1042 +1145,1042 @@ Je nach dieser Einstellung ändern sich bei Spielen die Auflösung, die Detailst Die Einstellung auf „Handgerät“ kann dazu beitragen, die Leistung auf Systemen mit geringerer Leistung zu verbessern. - + Prompt for user profile on boot Beim Systemstart nach dem Benutzerprofil fragen - + Useful if multiple people use the same PC. Nützlich, wenn mehrere Personen denselben PC nutzen. - + Pause when not in focus Pausieren, wenn nicht im Fokus - + Pauses emulation when focusing on other windows. Pausiert die Emulation, wenn der Fokus auf andere Fenster wechselt. - + Confirm before stopping emulation Vor dem Stoppen der Emulation bestätigen - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Überschreibt die Abfragen zur Bestätigung des Beendens der Emulation. Wenn diese Option aktiviert ist, werden solche Abfragen umgangen und die Emulation wird direkt beendet. - + Hide mouse on inactivity Mauszeiger verbergen - + Hides the mouse after 2.5s of inactivity. Verbirgt den Mauszeiger nach 2,5 Sekunden Inaktivität. - + Disable controller applet Controller-Applet deaktivieren - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Deaktiviert die Verwendung des Controller-Applets in emulierten Programmen zwangsweise. Wenn ein Programm versucht, das Controller-Applet zu öffnen, wird es sofort geschlossen. - + Check for updates Auf Aktualisierungen überprüfen - + Whether or not to check for updates upon startup. Ob nach Aktualisierungen während des Startens gesucht werden soll. - + Enable Gamemode Spielmodus aktivieren - + Force X11 as Graphics Backend X11 als Grafik-Backend erzwingen - + Custom frontend Benutzerdefiniertes Frontend - + Real applet Echtes Applet - + Never Niemals - + On Load Beim Laden - + Always Immer - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Asynchron - + Uncompressed (Best quality) Unkomprimiert (Beste Qualität) - + BC1 (Low quality) BC1 (Niedrige Qualität) - + BC3 (Medium quality) BC3 (Mittlere Qualität) - - + + Auto Auto - + 30 FPS 30 BpS - + 60 FPS 60 BpS - + 90 FPS 90 BpS - + 120 FPS 120 BpS - + Conservative Konservativ - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembler-Shader, nur NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (experimentell, nur AMD/Mesa) - + Null Null - + Fast Schnell - - - + + + Accurate Akkurat - - - + + + Default Vorgabe - + Unsafe (fast) Unsicher (schnell) - + Safe (stable) Sicher (stabil) - + Immediate Direkt - + Balanced Ausgeglichen - + Strict Strikt - + Unsafe Unsicher - + Paranoid (disables most optimizations) Paranoid (deaktiviert die meisten Optimierungen) - + Debugging Fehlerbehebung - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Rahmenloses Fenster - + Exclusive Fullscreen Exklusiver Vollbildmodus - + No Video Output Keine Videoausgabe - + CPU Video Decoding CPU Video Dekodierung - + GPU Video Decoding (Default) GPU Video Dekodierung (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5X (360p/540p) [EXPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75X (540p/810p) [EXPERIMENTELL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1,5X (1080p/1620p) [EXPERIMENTELL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest-Neighbor - + Bilinear Bilinear - + Bicubic Bikubisch - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super-Auflösung - + Area Bereich - + MMPX MMPX - + Zero-Tangent Nulltangente - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Spiel-Superauflösung - + Snapdragon Game Super Resolution EdgeDir Snapdragon Spiel-Superauflösung EdgeDir - + None Keiner - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Vorgabe (16:9) - + Force 4:3 4:3 erzwingen - + Force 21:9 21:9 erzwingen - + Force 16:10 16:10 erzwingen - + Stretch to Window Auf Fenster anpassen - + Automatic Automatisch - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japanisch (日本語) - + American English Amerikanisches Englisch - + French (français) Französisch (français) - + German (Deutsch) Deutsch (German) - + Italian (italiano) Italienisch (italiano) - + Spanish (español) Spanisch (español) - + Chinese Chinesisch - + Korean (한국어) Koreanisch (한국어) - + Dutch (Nederlands) Niederländisch (Nederlands) - + Portuguese (português) Portugiesisch (português) - + Russian (Русский) Russisch (Русский) - + Taiwanese Taiwanesisch - + British English Britisches Englisch - + Canadian French Kanadisches Französisch - + Latin American Spanish Lateinamerikanisches Spanisch - + Simplified Chinese Vereinfachtes Chinesisch - + Traditional Chinese (正體中文) Traditionelles Chinesisch (正體中文) - + Brazilian Portuguese (português do Brasil) Brasilianisches Portugiesisch (português do Brasil) - + Polish (polska) Polnisch (Polen) - + Thai (แบบไทย) Thailändisch (Thailändische Version) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China China - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Automatisch (%1) - + Default (%1) Default time zone Standard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Ägypten - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Türkei - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Vorgabe) - + 6GB DRAM (Unsafe) 6GB DRAM (Unsicher) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Unsicher) - + 12GB DRAM (Unsafe) 12GB DRAM (Unsicher) - + Docked Angedockt - + Handheld Handgerät - - + + Normal Normal - - + + Boost Beschleunigung - - + + Overclock Übertaktung - + Always ask (Default) Immer fragen (Vorgabe) - + Only if game specifies not to stop Nur wenn ein Spiel vorgibt, nicht zu stoppen - + Never ask Niemals fragen - + Very Small (16 MB) Sehr klein (16 MB) - + Small (32 MB) Klein (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Groß (256 MB) - + Very Large (512 MB) Sehr groß (512 MB) - + Very Low (4 MB) Sehr niedrig (4 MB) - + Low (8 MB) Niedrig (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Mittel (32 MB) - + High (64 MB) Hoch (64 MB) - + Very Low (32) Sehr niedrig (32) - + Low (64) Niedrig (64) - + Normal (128) Normal (128) - + Medium (256) Mittel (256) - + High (512) Hoch (512) - + Disabled Deaktiviert - + ExtendedDynamicState 1 ErweiterterDynamischerZustand 1 - + ExtendedDynamicState 2 ErweiterterDynamischerZustand 2 - + ExtendedDynamicState 3 ErweiterterDynamischerZustand 3 - + Tree View Baumansicht - + Grid View Rasteransicht @@ -3282,33 +3292,38 @@ Möchtest du die alten Speicherdaten löschen? Hintergrundfarbe: - + % FSR/SGSR sharpening percentage (e.g. 50%) % - + + Configure Effects... + + + + Off Aus - + VSync Off Vsync Aus - + Recommended Empfohlen - + On An - + VSync On Vsync An @@ -4935,102 +4950,117 @@ Einmal gelöscht, können diese nicht wiederhergestellt werden. Bist du dir zu 1 - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -7047,7 +7077,7 @@ Fehlerbehebungs-Meldung: - + &Pause &Pause @@ -7198,7 +7228,7 @@ Fehlerbehebungs-Meldung: - + &Start &Start @@ -7209,7 +7239,7 @@ Fehlerbehebungs-Meldung: - + R&ecord Aufnahme @@ -7300,7 +7330,7 @@ Fehlerbehebungs-Meldung: - + None Keine @@ -7326,400 +7356,405 @@ Fehlerbehebungs-Meldung: &Karussellansicht - + Small (32x32) Klein (32x32) - + Standard (64x64) Standard (64x64) - + Large (128x128) Groß (128x128) - + Full Size (256x256) Volle Größe (256x256) - + Broken Vulkan Installation Detected Defekte Vulkan-Installation erkannt - + Vulkan initialization failed during boot. Initialisierung von Vulkan ist beim Systemstart fehlgeschlagen. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Spiel wird ausgeführt - + Loading Web Applet... Web-Applet wird geladen... - - + + Disable Web Applet Web-Applet deaktivieren - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Das Deaktivieren des Web-Applets kann zu unvorhersehbarem Verhalten führen und sollte nur bei „Super Mario 3D All-Stars“ verwendet werden. Möchtest du das Web-Applet wirklich deaktivieren? (Dies kann in den Fehlerbehebungs-Einstellungen wieder aktiviert werden.) - + The amount of shaders currently being built Die Anzahl der Shader, die derzeit erstellt werden - + The current selected resolution scaling multiplier. Der aktuell ausgewählte Skalierungsfaktor für die Auflösung. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Aktuelle Emulationsgeschwindigkeit. Werte über oder unter 100 % bedeuten, dass die Emulation schneller oder langsamer läuft als auf einer Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Wie viele Bilder pro Sekunde das Spiel derzeit anzeigt. Dies variiert von Spiel zu Spiel und von Szene zu Szene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Die Zeit, die für die Emulation eines Switch-Frames benötigt wird, ohne Berücksichtigung von Framelimiting oder V-Sync. Bei einer Emulation mit voller Geschwindigkeit sollte dieser Wert höchstens 16,67 ms betragen. - + Unmute Stummschaltung aufheben - + Mute Stummschalten - + Reset Volume Lautstärke zurücksetzen - + + Configure Effects... + + + + &Clear Recent Files &Zuletzt verwendete Dateien löschen - + &Continue &Fortfahren - + Warning: Outdated Game Format Warnung: Veraltetes Spielformat - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Du verwendest für dieses Spiel das dekontruierte ROM-Verzeichnisformat - ein veraltetes Format, das durch andere Formate wie NCA, NAX, XCI oder NSP abgelöst wurde. Dekonstruierten ROM-Verzeichnissen fehlen Symbole, Metadaten und die Unterstützung für Aktualisierungen. <br>Eine Erläuterung der verschiedenen Switch-Formate, die Eden unterstützt, findest du in unserem Benutzerhandbuch. Diese Meldung wird nicht erneut angezeigt. - - + + Error while loading ROM! Fehler beim Laden des ROMs! - + The ROM format is not supported. Das ROM-Format wird nicht unterstützt. - + An error occurred initializing the video core. Beim Initialisieren des Videokerns ist ein Fehler aufgetreten. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Fehler beim Laden des ROMs! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Bitte erstelle deine Dateien erneut oder bitte auf Discord/Stoat um Hilfe. - + An unknown error occurred. Please see the log for more details. Es ist ein unbekannter Fehler aufgetreten. Weitere Informationen findest du im Protokoll. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Software wird geschlossen... - + Save Data Speicherdaten - + Mod Data Mod-Daten - + Error Opening %1 Folder Fehler beim Öffnen des Ordners %1 - - + + Folder does not exist! Der Ordner existiert nicht! - + Remove Installed Game Contents? Installierte Spielinhalte entfernen? - + Remove Installed Game Update? Installierte Spielaktualisierung entfernen? - + Remove Installed Game DLC? Installiertes Spiel-DLC entfernen? - + Remove Entry Eintrag entfernen - + Delete OpenGL Transferable Shader Cache? Den übertragbaren Shader-Cache von OpenGL löschen? - + Delete Vulkan Transferable Shader Cache? Den übertragbaren Shader-Cache von Vulkan löschen? - + Delete All Transferable Shader Caches? Alle übertragbaren Shader-Caches löschen? - + Remove Custom Game Configuration? Benutzerdefinierte Spielkonfiguration entfernen? - + Remove Cache Storage? Cache-Speicher löschen? - + Remove File Datei entfernen - + Remove Play Time Data Wiedergabezeitdaten löschen - + Reset play time? Spielzeit zurücksetzen? - - + + RomFS Extraction Failed! RomFS-Extraktion fehlgeschlagen! - + There was an error copying the RomFS files or the user cancelled the operation. Beim Kopieren der RomFS-Dateien ist ein Fehler aufgetreten oder der Benutzer hat den Vorgang abgebrochen. - + Full Vollständig - + Skeleton Skelett - + Select RomFS Dump Mode RomFS-Auslesemodus auswählen - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Bitte wähle aus, wie das RomFS kopiert werden soll. <br>Vollständig kopiert alle Dateien in das neue Verzeichnis, während <br>Skelett lediglich die Verzeichnisstruktur erstellt. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root Unter %1 ist nicht genügend Speicherplatz vorhanden, um das RomFS zu extrahieren. Bitte schaffe Speicherplatz oder wähle unter „Emulation > Konfigurieren > System > Dateisystem > Dump-Stammverzeichnis“ ein anderes Dump-Verzeichnis aus. - + Extracting RomFS... RomFS wird extrahiert... - - + + Cancel Abbrechen - + RomFS Extraction Succeeded! RomFS wurde erfolgreich extrahiert! - + The operation completed successfully. Der Vorgang wurde erfolgreich abgeschlossen. - + Error Opening %1 Fehler beim Öffnen von %1 - + Select Directory Verzeichnis auswählen - + Properties Eigenschaften - + The game properties could not be loaded. Die Spieleigenschaften konnten nicht geladen werden. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Switch-Ausführungsdatei (%1);;Alle Dateien (*.*) - + Load File Datei laden - + Open Extracted ROM Directory Verzeichnis mit dem extrahierten ROM öffnen - + Invalid Directory Selected Ungültiges Verzeichnis ausgewählt - + The directory you have selected does not contain a 'main' file. Das von dir ausgewählte Verzeichnis enthält keine „main“-Datei. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Installierbare Switch-Dateien (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX-Kassetten-Image (*.xci) - + Install Files Dateien installieren - + %n file(s) remaining %n Datei(en) verbleiben%n Datei(en) verbleiben - + Installing file "%1"... Datei „%1“ wird installiert... - - + + Install Results Installationsergebnisse - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Um mögliche Konflikte zu vermeiden, raten wir davon ab, Basisspiele auf dem NAND-Speicher zu installieren. Bitte nutze diese Funktion ausschließlich zur Installation von Aktualisierungen und DLCs. - + %n file(s) were newly installed %n Datei(en) wurden neu installiert @@ -7727,7 +7762,7 @@ Bitte nutze diese Funktion ausschließlich zur Installation von Aktualisierungen - + %n file(s) were overwritten %n Datei(en) wurden überschrieben @@ -7735,7 +7770,7 @@ Bitte nutze diese Funktion ausschließlich zur Installation von Aktualisierungen - + %n file(s) failed to install %n Datei(en) konnten nicht installiert werden @@ -7743,314 +7778,324 @@ Bitte nutze diese Funktion ausschließlich zur Installation von Aktualisierungen - + System Application Systemanwendung - + System Archive Systemarchiv - + System Application Update System-Anwendungsaktualisierung - + Firmware Package (Type A) Firmware-Paket (Typ A) - + Firmware Package (Type B) Firmware-Paket (Typ B) - + Game Spiel - + Game Update Spielaktualisierung - + Game DLC Spiel-DLC - + Delta Title Delta-Titel - + Select NCA Install Type... NCA-Installationstyp auswählen... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Bitte wähle den Titeltyp aus, unter dem du diese NCA installieren möchtest: (In den meisten Fällen ist die Vorgabe „Spiel“ ausreichend.) - + Failed to Install Installation fehlgeschlagen - + The title type you selected for the NCA is invalid. Der von dir für die NCA ausgewählte Titel ist ungültig. - + File not found Datei nicht gefunden - + File "%1" not found Datei „%1“ nicht gefunden - + OK OK - + Function Disabled Funktion deaktiviert - + Compatibility list reporting is currently disabled. Check back later! Die Anzeige der Kompatibilitätsliste ist derzeit deaktiviert. Schaue später noch einmal vorbei! - + Error opening URL Fehler beim Öffnen der URL - + Unable to open the URL "%1". Die URL „%1“ kann nicht geöffnet werden. - + TAS Recording TAS-Aufnahme - + Overwrite file of player 1? Datei von Spieler 1 überschreiben? - + Invalid config detected Ungültige Konfiguration erkannt - + Handheld controller can't be used on docked mode. Pro controller will be selected. Der Handgerät-Controller kann im angedockten Modus nicht verwendet werden. Es wird der Pro-Controller ausgewählt. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Das aktuelle amiibo wurde entfernt - + Error Fehler - - + + The current game is not looking for amiibos Das aktuelle Spiel sucht nicht nach Amiibos - + Amiibo File (%1);; All Files (*.*) Amiibo-Datei (%1);; Alle Dateien (*.*) - + Load Amiibo Amiibo laden - + Error loading Amiibo data Fehler beim Laden der Amiibo-Daten - + The selected file is not a valid amiibo Die ausgewählte Datei ist kein gültiges amiibo - + The selected file is already on use Die ausgewählte Datei wird bereits verwendet - + An unknown error occurred Ein unbekannter Fehler ist aufgetreten - + No firmware available Keine Firmware verfügbar - + Firmware Corrupted Firmware beschädigt - + Unknown applet Unbekanntes Applet - + Applet doesn't map to a known value. „Applet“ lässt sich keinem bekannten Wert zuordnen. - + Record not found Aufnahme nicht gefunden - + Applet not found. Please reinstall firmware. Applet nicht gefunden. Bitte installiere die Firmware neu. - + Capture Screenshot Bildschirmfoto aufnehmen - + PNG Image (*.png) PNG-Bild (*.png) - + TAS state: Running %1/%2 TAS-Status: %1/%2 läuft - + TAS state: Recording %1 TAS-Status: %1 wird aufgenommen - + TAS state: Idle %1/%2 TAS-Status: Leerlauf %1/%2 - + TAS State: Invalid TAS-Status: Ungültig - + &Stop Running &Ausführung beenden - + Stop R&ecording Aufnahme beenden - + Building: %n shader(s) Erstellung: %n SchattiererErstelle: %n Shader - + Scale: %1x %1 is the resolution scaling factor Maßstab: 1:1 - + Speed: %1% / %2% Geschwindigkeit: %1% / %2% - + Speed: %1% Geschwindigkeit: %1% - + Game: %1 FPS Spiel: %1 FPS - + Frame: %1 ms Frame: %1 ms - + NO AA Kein AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE LAUTSTÄRKE: STUMM - + VOLUME: %1% Volume percentage (e.g. 50%) LAUTSTÄRKE: %1% - + Derivation Components Missing Ableitungskomponenten fehlen - + Decryption keys are missing. Install them now? Entschlüsselungsschlüssel fehlen. Möchtest du diese jetzt installieren? - + Wayland Detected! Wayland erkannt! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8061,74 +8106,74 @@ Es wird empfohlen, stattdessen X11 zu verwenden. Möchtest du dies für zukünftige Starts erzwingen? - + Use X11 X11 verwenden - + Continue with Wayland Mit Wayland fortfahren - + Don't show again Nicht mehr anzeigen - + Restart Required Neustart erforderlich - + Restart Eden to apply the X11 backend. Starte Eden neu, um das X11-Backend zu aktivieren. - + Slow Langsam - + Turbo Turbo - + Unlocked Entsperrt - + Select RomFS Dump Target RomFS-Ausleseziel auswählen - + Please select which RomFS you would like to dump. Bitte wähle aus, welches RomFS du auslesen möchtest. - + Are you sure you want to close Eden? Möchtest du Eden wirklich schließen? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Möchtest du die Emulation wirklich beenden? Alle nicht gespeicherten Fortschritte gehen dabei verloren. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/el.ts b/dist/languages/el.ts index 50ec19b094..c579eb7f72 100644 --- a/dist/languages/el.ts +++ b/dist/languages/el.ts @@ -571,70 +571,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Λειτουργία Πλήρους Οθόνης: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: Αναλογία Απεικόνισης: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: Εξομοίωση NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -643,55 +653,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -699,79 +709,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: Ανισοτροπικό Φιλτράρισμα: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -781,1327 +791,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Περιφέρεια: - + The region of the console. - + Time Zone: Ζώνη Ώρας: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Απόκρυψη δρομέα ποντικιού στην αδράνεια - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Αυτόματη - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Ακριβής - - - + + + Default Προεπιλεγμένο - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe Επισφαλής - + Paranoid (disables most optimizations) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Παραθυροποιημένο Χωρίς Όρια - + Exclusive Fullscreen Αποκλειστική Πλήρης Οθόνη - + No Video Output Χωρίς Έξοδο Βίντεο - + CPU Video Decoding Αποκωδικοποίηση Βίντεο CPU - + GPU Video Decoding (Default) Αποκωδικοποίηση Βίντεο GPU (Προεπιλογή) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [ΠΕΙΡΑΜΑΤΙΚΟ] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor Πλησιέστερος Γείτονας - + Bilinear Διγραμμικό - + Bicubic Δικυβικό - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Κανένα - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Προεπιλογή (16:9) - + Force 4:3 Επιβολή 4:3 - + Force 21:9 Επιβολή 21:9 - + Force 16:10 Επιβολή 16:10 - + Stretch to Window Επέκταση στο Παράθυρο - + Automatic Αυτόματα - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Ιαπωνικά (日本語) - + American English - + French (français) Γαλλικά (Français) - + German (Deutsch) Γερμανικά (Deutsch) - + Italian (italiano) Ιταλικά (Italiano) - + Spanish (español) Ισπανικά (Español) - + Chinese Κινέζικα - + Korean (한국어) Κορεάτικα (한국어) - + Dutch (Nederlands) Ολλανδικά (Nederlands) - + Portuguese (português) Πορτογαλικά (Português) - + Russian (Русский) Ρώσικα (Русский) - + Taiwanese Ταϊβανέζικα - + British English Βρετανικά Αγγλικά - + Canadian French Καναδικά Γαλλικά - + Latin American Spanish Λατινοαμερικάνικα Ισπανικά - + Simplified Chinese Απλοποιημένα Κινέζικα - + Traditional Chinese (正體中文) Παραδοσιακά Κινέζικα (正體中文) - + Brazilian Portuguese (português do Brasil) Πορτογαλικά Βραζιλίας (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Ιαπωνία - + USA ΗΠΑ - + Europe Ευρώπη - + Australia Αυστραλία - + China Κίνα - + Korea Κορέα - + Taiwan Ταϊβάν - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Κούβα - + EET EET - + Egypt Αίγυπτος - + Eire - + EST EST - + EST5EDT EST5EDT - + GB - + GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Γκρήνουιτς - + Hongkong Χονγκ Κονγκ - + HST HST - + Iceland Ισλανδία - + Iran Ιράν - + Israel Ισραήλ - + Jamaica Ιαμαϊκή - + Kwajalein - + Libya Λιβύη - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Ναβάχο - + NZ - + NZ-CHAT - + Poland Πολωνία - + Portugal Πορτογαλία - + PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Σιγκαπούρη - + Turkey Τουρκία - + UCT UCT - + Universal Παγκόσμια - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu - + Mono Μονοφωνικό - + Stereo Στέρεοφωνικό - + Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3190,33 +3200,38 @@ Would you like to delete the old save data? Χρώμα Φόντου: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off - + VSync Off - + Recommended - + On - + VSync On @@ -4837,102 +4852,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6944,7 +6974,7 @@ Debug Message: - + &Pause &Παύση @@ -7095,7 +7125,7 @@ Debug Message: - + &Start &Έναρξη @@ -7106,7 +7136,7 @@ Debug Message: - + R&ecord @@ -7197,7 +7227,7 @@ Debug Message: - + None @@ -7223,722 +7253,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7946,74 +7991,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/es.ts b/dist/languages/es.ts index d12a8c2b36..1ae327cff0 100644 --- a/dist/languages/es.ts +++ b/dist/languages/es.ts @@ -592,12 +592,22 @@ SMAA ofrece mejor calidad. FXAA puede producir mejores resultados visuales en resoluciones bajas. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Modo pantalla completa: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -606,12 +616,12 @@ Ventana sin bordes ofrece la mejor compatibilidad con el teclado en pantalla que Pantalla completa exclusiva puede ofrecer mejor rendimiento y mejor soporte para FreeSync/G-Sync/VRR. - + Aspect Ratio: Relación de aspecto: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -620,36 +630,36 @@ La mayoría de los juegos solo admiten 16:9, por lo que se requieren modificacio También controla la relación de aspecto de las capturas de pantalla. - + Use persistent pipeline cache Usar el caché de canalización persistente - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Permite almacenar los sombreadores para que carguen más rápido la próxima vez que inicies el juego. Desactivarlo solo está destinado para depuración. - + Use asynchronous GPU emulation Usar emulación asíncrona de la GPU - + Uses an extra CPU thread for rendering. This option should always remain enabled. Usa un hilo adicional de la CPU para el renderizado. Esta opción siempre debe permanecer activada. - + NVDEC emulation: Emulación NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -658,12 +668,12 @@ Puede usar la CPU, GPU o no descodificar (mostrará una pantalla en negro durant En la mayoría de casos, descodificar mediante la GPU es la mejor opción. - + ASTC Decoding Method: Modo descodificación ASTC: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -675,12 +685,12 @@ GPU: utiliza los sombreadores computables de la GPU para descodificar las textur CPU asíncrona: usa la CPU para descodificar las texturas ASTC bajo demanda. Elimina los tirones causados por la descodificación ASTC, pero puede generar errores visuales. - + ASTC Recompression Method: Modo recompresión ASTC: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -688,44 +698,44 @@ BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, BC1/BC3: El formato intermedio será recomprimido a BC1 o BC3, lo que ahorra VRAM, pero degrada la calidad de la imagen. - + Frame Pacing Mode (Vulkan only) Modo de ritmo de fotogramas (solo Vulkan) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. Controla cómo el emulador gestiona el ritmo de los fotogramas para reducir los tirones y hacer que la velocidad de los fotogramas sea más suave y consistente. - + VRAM Usage Mode: Modo de uso de la VRAM: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Selecciona si el emulador prefiere ahorrar memoria o maximizar el uso de memoria de video disponible para mejorar el rendimiento. El modo agresivo puede afectar al rendimiento de otras aplicaciones, como a los programas de grabación. - + Skip CPU Inner Invalidation Saltar invalidación interna de la CPU - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Omite ciertas invalidaciones de caché durante las actualizaciones de memoria, reduciendo el uso de la CPU y mejorando la latencia. Esto puede causar bloqueos leves. - + VSync Mode: Modo VSync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -736,12 +746,12 @@ Mailbox ofrece menor latencia que FIFO y evita el tearing, aunque puede perder a Immediate (sin sincronización) muestra los fotogramas tan pronto están disponibles, pero puede generar desgarros de imagen. - + Sync Memory Operations Sincronizar operaciones de memoria - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -750,56 +760,56 @@ Esta opción arregla errores en los juegos, pero puede afectar negativamente al Los juegos con Unreal Engine 4 son con frecuencia los que muestran cambios significantes en esto. - + Enable asynchronous presentation (Vulkan only) Activar presentación asíncrona (solo Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Mejora el rendimiento ligeramente al usar un hilo de CPU adicional para la presentación. - + Force maximum clocks (Vulkan only) Forzar relojes al máximo (solo Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Ejecuta los procesos en segundo plano mientras se espera a las instrucciones gráficas para evitar que la GPU reduzca su velocidad de reloj. - + Anisotropic Filtering: Filtrado anisotrópico: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Controla la calidad del renderizado de texturas en ángulos oblicuos. Es seguro configurarlo en 16x en la mayoría de las GPU. - + GPU Mode: Modo de la GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Precisión de DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -808,12 +818,12 @@ Inseguro es más rápido, mientras que seguro es más estable y puede solucionar Predeterminado sigue el ajuste de la precisión de GPU. - + GPU Fence Behavior: Comportamiento de vallado de la GPU: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -823,55 +833,55 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback Activar la lectura del búfer de la GPU - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation Activa la compilación de shaders asincrónicos - + May reduce shader stutter. Puede reducir los tirones causados por la carga de sombreadores. - + GPU Clocks Relojes de GPU - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle Desentrelazado de la GPU - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Acelera la decodificación de texturas 3D BCn mediante computación de la GPU. Desactívela si experimenta problemas o fallos gráficos. - + GPU Unswizzle Max Texture Size Tamaño máximo de textura de desentrelazado de la GPU - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -880,46 +890,46 @@ Aunque la GPU es más rápida para texturas medianas y grandes, la CPU puede ser Ajuste este valor para encontrar el equilibrio entre la aceleración de la GPU y la sobrecarga de la CPU. - + GPU Unswizzle Stream Size Tamaño del flujo de desentrelazado de la GPU - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Establece la cantidad máxima de datos de textura (en MiB) procesados ​​por cada fotograma. Valores más altos pueden reducir la distorsión durante la carga de texturas, pero pueden afectar a la consistencia de los fotogramas. - + GPU Unswizzle Chunk Size Tamaño del trozo de desentrelazado de la GPU - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Determina la cantidad de cortes de profundidad procesados ​​en un solo envío. Aumentar este valor puede mejorar el rendimiento en una GPU de gama alta, pero puede causar tirones y problemas en los tiempos de respuesta en hardware más modesto. - + Use Vulkan pipeline cache Usar caché de canalización de Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Activa la caché de canalización específica del fabricante. Esta opción puede mejorar los tiempos de cargas de sombreadores en el caso de que el controlador de Vulkan no lo almacene internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Activar la canalizaciones de cómputo (solo Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -928,194 +938,194 @@ Este ajuste solo existe para los controladores propietarios de Intel y puede cau En los demás controladores, la canalización de cómputo siempre está activada. - + Enable Reactive Flushing Activar limpieza reactiva - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Usa limpieza de memoria reactiva en vez de predictiva, permitiendo una sincronización de memoria más precisa. - + Sync to framerate of video playback Sincronizar a fotogramas de reproducción de vídeo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Ejecuta el juego a velocidad normal durante la reproducción de vídeos, incluso cuando no hay límite de fotogramas. - + Barrier feedback loops Bucles de feedback de barrera - + Improves rendering of transparency effects in specific games. Mejora la renderización de los efectos de transparencia en ciertos juegos. - + Enable buffer history Activar el historial del búfer - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Habilita el acceso a estados de búfer anteriores. Esta opción puede mejorar la calidad de renderizado y la consistencia en el rendimiento de algunos juegos. - + Fix bloom effects Arreglar efectos de resplandor - + Removes bloom in Burnout. Elimina el resplandor en Burnout. - + Enable Legacy Rescale Pass Activar el pase de reescalado heredado - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Puede arreglar los problemas de reescalado en algunos juegos confiando en el comportamiento de la implementación anterior. Solución alternativa de comportamiento heredado que corrige los artefactos de línea de la GPU AMD y el parpadeo de texturas gris de la GPU Nvidia en Luigis Mansion 3. - + Extended Dynamic State Estado dinámico extendido - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Controla el número de funciones que pueden ser usadas en el Estado Dinámico Extendido. Números más altos permiten úsar más funciones y pueden aumentar el rendimiento, pero tambén pueden causar errores gráficos. - + Vertex Input Dynamic State Estado dinámico de entrada de vértices - + Enables vertex input dynamic state feature for better quality and performance. Activa la función de estado dinámico de entrada de vértices para una mejor calidad y rendimiento. - + Sample Shading Sombreado de muestra - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permite que el sombreador de fragmentos se ejecute por muestra en un fragmento multimuestreado, en lugar de una sola vez por fragmento. Mejora la calidad de los gráficos a costa de rendimiento. Los valores más altos mejoran la calidad, pero reducen el rendimiento. - + RNG Seed Semilla de GNA - + Controls the seed of the random number generator. Mainly used for speedrunning. Controla la semilla del generador de números aleatorios. Usado principalmente para speedrunning. - + Device Name Nombre del dispositivo - + The name of the console. El nombre de la consola - + Homebrew Args Argumentos Homebrew - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Argumentos en la línea de comandos pasados al homebrew al ser lanzado (p.e. -noglsl). - + Custom RTC Date: Fecha Personalizada RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Esta opción permite cambiar el reloj de la consola. Puede ser usado para manipular el tiempo en juegos. - + The number of seconds from the current unix time Número de segundos de la hora actual de Unix - + Language: Idioma: - + This option can be overridden when region setting is auto-select Esta opción puede ser reemplazada cuando la configuración de región está en selección automática. - + Region: Región: - + The region of the console. La Región de la Consola. - + Time Zone: Zona horaria: - + The time zone of the console. La zona horaria de la consola. - + Sound Output Mode: Método de salida de sonido: - + Console Mode: Modo consola: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1124,1041 +1134,1041 @@ Los juegos cambiarán su resolución, detalles y compatibilidad con los mandos s Configurar el modo portátil puede mejorar el rendimiento en sistemas de gama baja. - + Prompt for user profile on boot Solicitud para perfil de usuario al arrancar - + Useful if multiple people use the same PC. Útil si múltiples personas usan la misma PC - + Pause when not in focus Pausar cuando la ventana no esté activa - + Pauses emulation when focusing on other windows. Pausa la emulación cuando otra ventana diferente está activa. - + Confirm before stopping emulation Confirmar detención - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Anula las solicitudes de confirmación para detener la emulación. Al habilitar esta opción, se omiten dichas solicitudes y se sale directamente de la emulación. - + Hide mouse on inactivity Ocultar el cursor por inactividad. - + Hides the mouse after 2.5s of inactivity. Oculta el mouse después de 2.5s de inactividad. - + Disable controller applet Desactivar applet de mandos - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Desactiva forzosamente el uso del applet del controlador en programas emulados. Cuando un programa intenta abrir el applet del controlador, se cierra inmediatamente. - + Check for updates Buscar actualizaciones - + Whether or not to check for updates upon startup. Si se deben buscar actualizaciones al iniciar o no. - + Enable Gamemode Activar Modo Juego - + Force X11 as Graphics Backend Forzar X11 como motor gráfico - + Custom frontend Interfaz personalizada - + Real applet Applet real - + Never Nunca - + On Load Al cargar - + Always Siempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU asíncrona - + Uncompressed (Best quality) Sin compresión (Mejor calidad) - + BC1 (Low quality) BC1 (Calidad baja) - + BC3 (Medium quality) BC3 (Calidad media) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservativo - + Aggressive Agresivo - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Ensamblado de sombreadores, solo NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, solo AMD/Mesa) - + Null Ninguno - + Fast Rápido - - - + + + Accurate Preciso - - - + + + Default Predeterminado - + Unsafe (fast) Inseguro (rápido) - + Safe (stable) Seguro (estable) - + Immediate Inmediato - + Balanced Balanceado - + Strict Estricto - + Unsafe Impreciso - + Paranoid (disables most optimizations) Paranoico (Deshabilita la mayoría de optimizaciones) - + Debugging Depuración - + Dynarmic DynARMic - + NCE NCE - + Borderless Windowed Ventana sin bordes - + Exclusive Fullscreen Pantalla completa - + No Video Output Sin salida de vídeo - + CPU Video Decoding Decodificación de vídeo en la CPU - + GPU Video Decoding (Default) Decodificación de vídeo en GPU (Por defecto) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] x0,5 (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] x0,75 (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) x1 (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] x1,5 (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) x2 (1440p/2160p) - + 3X (2160p/3240p) x3 (2160p/3240p) - + 4X (2880p/4320p) x4 (2880p/4320p) - + 5X (3600p/5400p) x5 (3600p/5400p) - + 6X (4320p/6480p) x6 (4320p/6480p) - + 7X (5040p/7560p) x7 (5040p/7560p) - + 8X (5760p/8640p) x8 (5760p/8640p) - + Nearest Neighbor Vecino más próximo - + Bilinear Bilineal - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution Super Resolución AMD FidelityFX - + Area Área - + MMPX MMPX - + Zero-Tangent Tangente cero - + B-Spline Ranura B - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Super resolución de juego Snapdragon - + Snapdragon Game Super Resolution EdgeDir Filo direcorio de super resolución de juego Snapdragon - + None Ninguno - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Predeterminado (16:9) - + Force 4:3 Forzar 4:3 - + Force 21:9 Forzar 21:9 - + Force 16:10 Forzar 16:10 - + Stretch to Window Estirar a la ventana - + Automatic Automático - + 2x x2 - + 4x x4 - + 8x x8 - + 16x x16 - + Japanese (日本語) Japonés (日本語) - + American English Inglés estadounidense - + French (français) Francés (français) - + German (Deutsch) Alemán (deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Español - + Chinese Chino - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandés (nederlands) - + Portuguese (português) Portugués (português) - + Russian (Русский) Ruso (Русский) - + Taiwanese Taiwanés - + British English Inglés británico - + Canadian French Francés canadiense - + Latin American Spanish Español latinoamericano - + Simplified Chinese Chino simplificado - + Traditional Chinese (正體中文) Chino tradicional (正體中文) - + Brazilian Portuguese (português do Brasil) Portugués brasileño (português do Brasil) - + Polish (polska) Polaco (polska) - + Thai (แบบไทย) Tailandés (แบบไทย) - - + + Japan Japón - + USA EEUU - + Europe Europa - + Australia Australia - + China China - + Korea Corea - + Taiwan Taiwán - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Predeterminada (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipto - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Irán - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polonia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turquía - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulú - + Mono Mono - + Stereo Estéreo - + Surround Envolvente - + 4GB DRAM (Default) 4GB DRAM (Por defecto) - + 6GB DRAM (Unsafe) 6GB DRAM (Inseguro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Inseguro) - + 12GB DRAM (Unsafe) 12GB DRAM (Inseguro) - + Docked Sobremesa - + Handheld Portátil - - + + Normal Normal - - + + Boost Impulso - - + + Overclock Overclock - + Always ask (Default) Preguntar siempre (Por defecto) - + Only if game specifies not to stop Solo si el juego pide no ser cerrado - + Never ask Nunca preguntar - + Very Small (16 MB) Muy pequeño (16 MB) - + Small (32 MB) Pequeño (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Muy grande (512 MB) - + Very Low (4 MB) Muy bajo (4 MB) - + Low (8 MB) Bajo (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Medio (32 MB) - + High (64 MB) Alto (64 MB) - + Very Low (32) Muy bajo (32) - + Low (64) Bajo (64) - + Normal (128) Normal (128) - + Medium (256) Medio (256) - + High (512) Alto (512) - + Disabled Desactivado - + ExtendedDynamicState 1 ModoDynamicoExtendido 1 - + ExtendedDynamicState 2 ModoDynamicoExtendido 2 - + ExtendedDynamicState 3 ModoDynamicoExtendido 3 - + Tree View Vista en árbol - + Grid View Vista en cuadrícula @@ -3270,33 +3280,38 @@ Would you like to delete the old save data? Color de fondo: - + % FSR/SGSR sharpening percentage (e.g. 50%) % - + + Configure Effects... + Configurar efectos... + + + Off Desactivado - + VSync Off VSync Desactivado - + Recommended Recomendado - + On Activado - + VSync On VSync Activado @@ -4922,102 +4937,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply Aplicar - + Reset Values Restablecer valores - + Return every effect to the values the preset ships with. - + Save As... Guardar como... - + Save Preset - + Preset name: - - Delete - Borrar + + Clear + - + + Remove every effect in use and deselect the preset. + + + + Add Effect Añadir efecto - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled Activado - + Disabled Desactivado - + Reset to defaults Restaurar los valores predeterminados - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -7035,7 +7065,7 @@ Mensaje de depuración: - + &Pause &Pausar @@ -7186,7 +7216,7 @@ Mensaje de depuración: - + &Start &Iniciar @@ -7197,7 +7227,7 @@ Mensaje de depuración: - + R&ecord G&rabar @@ -7288,7 +7318,7 @@ Mensaje de depuración: - + None Nada @@ -7314,400 +7344,405 @@ Mensaje de depuración: Vista de &carrusel - + Small (32x32) Pequeño (32x32) - + Standard (64x64) Estandar (64x64) - + Large (128x128) Grande (128x128) - + Full Size (256x256) Tamaño completo (256x256) - + Broken Vulkan Installation Detected Detectada instalación fallida de Vulkan - + Vulkan initialization failed during boot. La inicialización de Vulkan falló durante el arranque. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Ejecutando un juego - + Loading Web Applet... Cargando applet web... - - + + Disable Web Applet Desactivar applet web - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Desactivar el applet web puede causar comportamientos inesperados y debería solo ser usado con Super Mario 3D All-Stars. ¿Está seguro de que quiere desactivar el applet web? (Puede ser activado en las ajustes de depuración.) - + The amount of shaders currently being built La cantidad de sombreadores que se están contruyendo actualmente - + The current selected resolution scaling multiplier. El multiplicador de escalado de resolución seleccionado actualmente. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Velocidad de emulación actual. Los valores superiores o inferiores al 100% indican que la emulación se ejecuta más rápida o más lenta que en una Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. La cantidad de fotogramas por segundo que muestra el juego actualmente. Esto varía según el juego y la escena. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Tiempo empleado en emular un fotograma de la Switch, sin contar la limitación de fotogramas ni la sincronización vertical. Para una emulación a máxima velocidad, debería ser de 16,67 ms como máximo. - + Unmute Desilenciar - + Mute Silenciar - + Reset Volume Restablecer volumen - + + Configure Effects... + + + + &Clear Recent Files &Limpiar archivos recientes - + &Continue &Continuar - + Warning: Outdated Game Format Advertencia: formato del juego obsoleto - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Estás usando el formato de directorio ROM deconstruido para este juego, el cual es un formato obsoleto que ha sido reemplazado por otros como NCA, NAX, XCI o NSP. Los directorios ROM deconstruidos carecen de iconos, metadatos y compatibilidad con actualizaciones.<br>Para obtener una explicación de los distintos formatos de Switch compatibles con Eden, consulta nuestro manual de usuario. Este mensaje no volverá a aparecer de nuevo. - - + + Error while loading ROM! ¡Error al cargar la ROM! - + The ROM format is not supported. El formato de la ROM no está soportado. - + An error occurred initializing the video core. Se produjo un error al inicializar el núcleo de video. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. ¡Error al cargar la ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Por favor vuelva a volcar sus archivos, o pida ayuda en Discord/Stoat. - + An unknown error occurred. Please see the log for more details. Ha ocurrido un error desconocido. Por favor mire el registro para más detalles. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Cerrando el programa... - + Save Data Datos de guardado - + Mod Data Datos del mod - + Error Opening %1 Folder Error abriendo la carpeta %1 - - + + Folder does not exist! ¡La carpeta no existe! - + Remove Installed Game Contents? ¿Eliminar el contenido instalado del juego? - + Remove Installed Game Update? ¿Eliminar la actualización instalada del juego? - + Remove Installed Game DLC? ¿Eliminar el contenido descargable instalado del juego? - + Remove Entry Eliminar entrada - + Delete OpenGL Transferable Shader Cache? ¿Desea eliminar el caché transferible de sombreadores de OpenGL? - + Delete Vulkan Transferable Shader Cache? ¿Desea eliminar el caché transferible de sombreadores de Vulkan? - + Delete All Transferable Shader Caches? ¿Desea eliminar todo el caché transferible de sombreadores? - + Remove Custom Game Configuration? ¿Borrar configuración personalizada del juego? - + Remove Cache Storage? ¿Borrar el almacenamiento de caché? - + Remove File Eliminar archivo - + Remove Play Time Data Eliminar datos del tiempo de juego - + Reset play time? ¿Reiniciar el tiempo de juego? - - + + RomFS Extraction Failed! ¡Fallo al extraer el RomFS! - + There was an error copying the RomFS files or the user cancelled the operation. Ocurrió un error al copiar los archivos de la RomFS o el usuario canceló la operación. - + Full Completo - + Skeleton Esqueleto - + Select RomFS Dump Mode Seleccione el método de volcado del RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Por favor selecciona como quieres que sea volcada la RomFS.<br>Completa copiará todos los archivos en el nuevo directorio mientras que <br>esqueleto solo creará la estructura de los directorios. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root No hay suficiente espacio libre en %1 para extraer la RomFS. Por favor libera espacio o selecciona un directorio de volcado diferente en Emulación > Configurar > Sistema > Sistema de archivos > Volcado raiz - + Extracting RomFS... Extrayendo el RomFS... - - + + Cancel Cancelar - + RomFS Extraction Succeeded! ¡La extracción del RomFS ha sido un éxito! - + The operation completed successfully. La operación se completó con éxito. - + Error Opening %1 Error al abrir %1 - + Select Directory Seleccionar directorio - + Properties Propiedades - + The game properties could not be loaded. No se pudieron cargar las propiedades del juego. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Ejecutable de Switch (%1);;Todos los archivos (*.*) - + Load File Cargar archivo - + Open Extracted ROM Directory Abrir directorio de la ROM extraída - + Invalid Directory Selected Seleccionado directorio inválido - + The directory you have selected does not contain a 'main' file. El directorio seleccionado no contiene un archivo 'main'. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Archivo de Switch instalable (*.nca *.nsp *.xci);;Archivo de contenido de Nintendo (*.nca);;Paquete de envío de Nintendo (*.nsp);;Imagen de cartucho NX (*.xci) - + Install Files Instalar archivos - + %n file(s) remaining %n archivo(s) restantes%n archivo(s) restantes%n archivo(s) restantes - + Installing file "%1"... Instalando el archivo "%1"... - - + + Install Results Resultados de la instalación - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Para evitar posibles conflictos, desaconsejamos instalar juegos base en la NAND. Por favor, use solo esta función para instalar actualizaciones y contenido descargable. - + %n file(s) were newly installed %n archivo(s) se instalaron recientemente @@ -7716,7 +7751,7 @@ Por favor, use solo esta función para instalar actualizaciones y contenido desc - + %n file(s) were overwritten %n archivo(s) fueron sobreescritos @@ -7725,7 +7760,7 @@ Por favor, use solo esta función para instalar actualizaciones y contenido desc - + %n file(s) failed to install fallo al instalar %n archivo(s) @@ -7734,314 +7769,324 @@ Por favor, use solo esta función para instalar actualizaciones y contenido desc - + System Application Aplicación del sistema - + System Archive Archivo del sistema - + System Application Update Actualización de la aplicación del sistema - + Firmware Package (Type A) Paquete de firmware (Tipo A) - + Firmware Package (Type B) Paquete de firmware (Tipo B) - + Game Juego - + Game Update Actualización del juego - + Game DLC Contenido descargable del juego - + Delta Title Título Delta - + Select NCA Install Type... Seleccione el tipo de instalación NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Seleccione el tipo de título en el que desea instalar este NCA: (En la mayoría de los casos, la opción predeterminada "Juego" es suficiente). - + Failed to Install Fallo al instalar - + The title type you selected for the NCA is invalid. El tipo de título que ha seleccionado para el NCA es inválido. - + File not found Archivo no encontrado - + File "%1" not found Archivo "%1" no encontrado - + OK Aceptar - + Function Disabled Función desactivada - + Compatibility list reporting is currently disabled. Check back later! Los informes de la lista de compatibilidad están deshabilitados. ¡Vuelva más tarde! - + Error opening URL Error abriendo URL - + Unable to open the URL "%1". No se pudo abrir URL "%1". - + TAS Recording Grabación TAS - + Overwrite file of player 1? ¿Sobrescribir el archivo del jugador 1? - + Invalid config detected Detectada configuración inválida - + Handheld controller can't be used on docked mode. Pro controller will be selected. El mando del modo portátil no puede usarse en el modo sobremesa. El mando pro será seleccionado en su lugar. - - + + Amiibo Amiibo - - + + The current amiibo has been removed El amiibo actual fue borrado - + Error Error - - + + The current game is not looking for amiibos El juego actual no está buscando amiibos - + Amiibo File (%1);; All Files (*.*) Archivo Amiibo (%1);; Todos los archivos (*.*) - + Load Amiibo Cargar Amiibo - + Error loading Amiibo data Error al cargar los datos del Amiibo - + The selected file is not a valid amiibo El archivo seleccionado no es un amiibo válido - + The selected file is already on use El archivo seleccionado se encuentra en uso - + An unknown error occurred Ha ocurrido un error desconocido - + No firmware available No hay firmware disponible - + Firmware Corrupted Firmware corrompido - + Unknown applet Applet desconocido - + Applet doesn't map to a known value. Applet no asigna a un valor conocido. - + Record not found Grabación no encontrada - + Applet not found. Please reinstall firmware. Apple no encontrado. Por favor vuelva a instalar el firmware. - + Capture Screenshot Captura de pantalla - + PNG Image (*.png) Imagen PNG (*.png) - + TAS state: Running %1/%2 Estado de TAS: Ejecutando %1/%2 - + TAS state: Recording %1 Estado de TAS: Grabando %1 - + TAS state: Idle %1/%2 Estado de TAS: Inactivo %1/%2 - + TAS State: Invalid Estado de TAS: Inválido - + &Stop Running &Parar de ejecutarse - + Stop R&ecording &Parar grabación - + Building: %n shader(s) Construyendo: %n sombreador(es)Construyendo: %n sombreador(es)Construyendo: %n sombreador(es) - + Scale: %1x %1 is the resolution scaling factor Escala: %1x - + Speed: %1% / %2% Velocidad: %1% / %2% - + Speed: %1% Velocidad: %1% - + Game: %1 FPS Juego: %1 FPS - + Frame: %1 ms Fotograma: %1 ms - + NO AA NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE VOLUMEN: SILENCIADO - + VOLUME: %1% Volume percentage (e.g. 50%) VOLUMEN: %1% - + Derivation Components Missing Componentes de derivación ausentes - + Decryption keys are missing. Install them now? Las claves de desencriptado están ausentes. ¿Desea instalarlas ahora? - + Wayland Detected! ¡Wayland detectado! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8052,74 +8097,74 @@ Se recomienda usar X11 en su lugar. ¿Le gustaría forzar a usarlo en futuras ejecuciones? - + Use X11 Usar X11 - + Continue with Wayland Continuar con Wayland - + Don't show again No mostrar de nuevo - + Restart Required Reinicio requerido - + Restart Eden to apply the X11 backend. Reinicie Eden para aplicar el motor X11. - + Slow Lento - + Turbo Turbo - + Unlocked Desbloqueado - + Select RomFS Dump Target Seleccione el destinatario para el volcado del RomFS - + Please select which RomFS you would like to dump. Por favor seleccione que RomFS desea volcar. - + Are you sure you want to close Eden? ¿Está seguro de que quiere cerrar Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. ¿Está seguro de que desea parar la emulación? Cualquier progreso sin guardar se perderá. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/fi.ts b/dist/languages/fi.ts index 3c3ddc5354..bd5898a82f 100644 --- a/dist/languages/fi.ts +++ b/dist/languages/fi.ts @@ -571,70 +571,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -643,55 +653,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -699,79 +709,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -781,1327 +791,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: - + The region of the console. - + Time Zone: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate - - - + + + Default - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe - + Paranoid (disables most optimizations) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed - + Exclusive Fullscreen - + No Video Output - + CPU Video Decoding - + GPU Video Decoding (Default) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) - + 3X (2160p/3240p) - + 4X (2880p/4320p) - + 5X (3600p/5400p) - + 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor - + Bilinear - + Bicubic - + Gaussian - + Lanczos - + ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None - + FXAA - + SMAA - + Default (16:9) - + Force 4:3 - + Force 21:9 - + Force 16:10 - + Stretch to Window - + Automatic - + 2x - + 4x - + 8x - + 16x - + Japanese (日本語) - + American English - + French (français) - + German (Deutsch) - + Italian (italiano) - + Spanish (español) - + Chinese - + Korean (한국어) - + Dutch (Nederlands) - + Portuguese (português) - + Russian (Русский) - + Taiwanese - + British English - + Canadian French - + Latin American Spanish - + Simplified Chinese - + Traditional Chinese (正體中文) - + Brazilian Portuguese (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan - + USA - + Europe - + Australia - + China - + Korea - + Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET - + CST6CDT - + Cuba - + EET - + Egypt - + Eire - + EST - + EST5EDT - + GB - + GB-Eire - + GMT - + GMT+0 - + GMT-0 - + GMT0 - + Greenwich - + Hongkong - + HST - + Iceland - + Iran - + Israel - + Jamaica - + Kwajalein - + Libya - + MET - + MST - + MST7MDT - + Navajo - + NZ - + NZ-CHAT - + Poland - + Portugal - + PRC - + PST8PDT - + ROC - + ROK - + Singapore - + Turkey - + UCT - + Universal - + UTC - + W-SU - + WET - + Zulu - + Mono - + Stereo - + Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked - + Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3169,33 +3179,38 @@ Would you like to delete the old save data? Taustan väri: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off - + VSync Off - + Recommended - + On - + VSync On @@ -4815,102 +4830,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6922,7 +6952,7 @@ Debug Message: - + &Pause &Pysäytä @@ -7073,7 +7103,7 @@ Debug Message: - + &Start &Käynnistä @@ -7084,7 +7114,7 @@ Debug Message: - + R&ecord @@ -7175,7 +7205,7 @@ Debug Message: - + None @@ -7201,722 +7231,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7924,74 +7969,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/fr.ts b/dist/languages/fr.ts index fcee775250..5d9bb8908a 100644 --- a/dist/languages/fr.ts +++ b/dist/languages/fr.ts @@ -592,12 +592,22 @@ SMAA offre la meilleure qualité. FXAA peut produire une image plus stable à des résolutions plus faibles. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Mode Plein écran : - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -606,12 +616,12 @@ Sans bordure offre la meilleure compatibilité avec le clavier à l'écran Le mode plein écran exclusif peut offrir de meilleures performances et un meilleur support Freesync/Gsync. - + Aspect Ratio: Format : - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -620,35 +630,35 @@ La plupart des jeux ne supportent que le format 16:9, donc des modifications son Contrôle également le format des captures d’écran. - + Use persistent pipeline cache Conserver le cache du rendu graphique - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Permet de sauvegarder les shaders sur le stockage pour un chargement plus rapide lors des démarrages ultérieurs du jeu. Le désactiver est uniquement destiné au débogage. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: Émulation NVDEC : - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -657,12 +667,12 @@ Elles peuvent être décodées soit par le CPU, soit par le GPU, ou pas du tout Dans la plupart des cas, le décodage GPU offre les meilleures performances. - + ASTC Decoding Method: Méthode de décodage ASTC : - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -674,12 +684,12 @@ GPU : Utiliser les shaders de calcul du GPU pour décoder les textures ASTC (rec CPU asynchrone : Utiliser le CPU pour décoder les textures ASTC à la demande. Élimine les saccades liées au décodage ASTC, mais peut provoquer des artefacts. - + ASTC Recompression Method: Méthode de recompression ASTC : - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -687,44 +697,44 @@ BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, BC1/BC3 : Le format intermédiaire sera recompressé en BC1 ou BC3, ce qui économise de la VRAM mais dégrade la qualité de l’image. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: Mode d'utilisation de la VRAM : - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Permet de choisir si l’émulateur doit privilégier la conservation de la mémoire ou utiliser au maximum la mémoire vidéo disponible pour les performances. Le mode agressif peut affecter les performances d’autres applications, comme les logiciels d’enregistrement. - + Skip CPU Inner Invalidation Ignorer l'invalidation interne du CPU - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Ignore certaines invalidations de cache lors des mises à jour de la mémoire, réduisant l’utilisation du CPU et améliorant la latence. Cela peut provoquer des plantages légers. - + VSync Mode: Mode VSync : - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -735,12 +745,12 @@ Mailbox peut offrir une latence inférieure à FIFO et n’entraîne pas de déc Immediate (pas de synchronisation) affiche ce qui est disponible et peut provoquer du déchirement. - + Sync Memory Operations Synchroniser les opérations mémoire - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -749,68 +759,68 @@ Cette option corrige des problèmes dans les jeux, mais peut dégrader les perfo Les jeux Unreal Engine 4 sont souvent ceux qui bénéficient le plus de ce réglage. - + Enable asynchronous presentation (Vulkan only) Activer la présentation asynchrone (Vulkan uniquement) - + Slightly improves performance by moving presentation to a separate CPU thread. Améliore légèrement les performances en déplaçant la présentation vers un thread CPU séparé. - + Force maximum clocks (Vulkan only) Forcer la fréquence d'horloge maximale (Vulkan uniquement) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Les exécutions fonctionnent en arrière-plan en attendant les commandes graphiques pour empêcher le GPU de réduire sa vitesse de fréquence d'horloge. - + Anisotropic Filtering: Filtrage anisotropique : - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Contrôle la qualité du rendu des textures sous des angles obliques. Il est sûr de le régler à 16x sur la plupart des GPU. - + GPU Mode: Mode GPU : - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Précision du DMA : - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -820,100 +830,100 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation Activer la compilation asynchrone des shaders - + May reduce shader stutter. Peut réduire les saccades dues aux shaders. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Utiliser le cache de pipeline Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Active le cache de pipeline spécifique au fournisseur de GPU. Cette option peut améliorer considérablement le temps de chargement des shaders dans les cas où le pilote Vulkan ne stocke pas les fichiers de cache de pipeline en interne. - + Enable Compute Pipelines (Intel Vulkan Only) Activer les pipelines de calcul (Vulkan sur Intel uniquement) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -922,95 +932,95 @@ Ce réglage n’existe que pour les pilotes propriétaires Intel et peut provoqu Les pipelines de calcul sont toujours activés sur tous les autres pilotes. - + Enable Reactive Flushing Activer le Vidage Réactif - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Utilise une purge réactive au lieu d'une purge prédictive, permettant une synchronisation de la mémoire plus précise. - + Sync to framerate of video playback Synchro la fréquence d'image de la relecture du vidéo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Éxécuter le jeu à une vitesse normale pendant la relecture du vidéo, même-ci la fréquence d'image est dévérouillée. - + Barrier feedback loops Boucles de rétroaction de barrière - + Improves rendering of transparency effects in specific games. Améliore le rendu des effets de transparence dans des jeux spécifiques. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State État dynamique étendu - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading Échantillonnage de shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permet au shader de fragments de s’exécuter pour chaque échantillon dans un fragment multi-échantillonné, au lieu d’une seule fois par fragment. @@ -1018,96 +1028,96 @@ Améliore la qualité graphique au prix de performances réduites. Des valeurs plus élevées améliorent la qualité mais dégradent les performances. - + RNG Seed Seed RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Contrôle la graine du générateur de nombres aléatoires. Principalement utilisé pour le speedrun. - + Device Name Nom de l'appareil - + The name of the console. Nom de la console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Date RTC personnalisée : - + This option allows to change the clock of the console. Can be used to manipulate time in games. Cette option permet de modifier l’horloge de la console. Peut être utilisée pour manipuler le temps dans les jeux. - + The number of seconds from the current unix time Nombre de secondes écoulées depuis le 1er janvier 1970. - + Language: Langue : - + This option can be overridden when region setting is auto-select Cette option peut être remplacée lorsque la région est sur auto. - + Region: Région : - + The region of the console. Région de la console. - + Time Zone: Fuseau horaire : - + The time zone of the console. Fuseau horaire de la console. - + Sound Output Mode: Mode de sortie sonore : - + Console Mode: Mode console : - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1116,1042 +1126,1042 @@ Les jeux adaptent leur résolution, leurs paramètres graphiques et les manettes Passer en mode Portable peut améliorer les performances sur les systèmes peu puissants. - + Prompt for user profile on boot Choisir l’utilisateur au démarrage. - + Useful if multiple people use the same PC. Utile si plusieurs personnes utilisent le même PC. - + Pause when not in focus Pause lorsque la fenêtre n’est pas active. - + Pauses emulation when focusing on other windows. Met l’émulation en pause dès que l’utilisateur change de fenêtre. - + Confirm before stopping emulation Confirmer avant d'arrêter l'émulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Ignore les demandes de confirmation pour arrêter l’émulation. L’activer permet de contourner ces confirmations et de quitter directement l’émulation. - + Hide mouse on inactivity Cacher la souris en cas d'inactivité - + Hides the mouse after 2.5s of inactivity. Cache le curseur après 2,5 secondes d’inactivité. - + Disable controller applet Désactiver l'applet du contrôleur - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Désactive de force le menu de configuration des manettes dans les programmes émulés. Lorsqu’un programme tente d’ouvrir ce menu, il est immédiatement fermé. - + Check for updates Rechercher des mises à jours - + Whether or not to check for updates upon startup. Vérifier ou non les mises à jour au démarrage. - + Enable Gamemode Activer le mode jeu - + Force X11 as Graphics Backend Forcer X11 comme moteur graphique - + Custom frontend Interface personnalisée - + Real applet Applet réel - + Never Jamais - + On Load Au chargement - + Always Toujours - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Asynchrone - + Uncompressed (Best quality) Non compressé (Meilleure qualité) - + BC1 (Low quality) BC1 (Basse qualité) - + BC3 (Medium quality) BC3 (Qualité moyenne) - - + + Auto Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Conservateur - + Aggressive Agressif - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Nul - + Fast Rapide - - - + + + Accurate Précis - - - + + + Default Par défaut - + Unsafe (fast) Insecure (rapide) - + Safe (stable) Sûr (stable) - + Immediate - + Balanced Moyen - + Strict - + Unsafe Risqué - + Paranoid (disables most optimizations) Paranoïaque (désactive la plupart des optimisations) - + Debugging Débogage - + Dynarmic Dynamique - + NCE NCE - + Borderless Windowed Fenêtré sans bordure - + Exclusive Fullscreen Plein écran exclusif - + No Video Output Pas de sortie vidéo - + CPU Video Decoding Décodage Vidéo sur le CPU - + GPU Video Decoding (Default) Décodage Vidéo sur le GPU (par défaut) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPÉRIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPÉRIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1,25X (900p/1350p) [EXPÉRIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPÉRIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Plus proche voisin - + Bilinear Bilinéaire - + Bicubic Bicubique - + Gaussian Gaussien - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area (Par zone) - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Aucun - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Par défaut (16:9) - + Force 4:3 Forcer le 4:3 - + Force 21:9 Forcer le 21:9 - + Force 16:10 Forcer le 16:10 - + Stretch to Window Étirer à la fenêtre - + Automatic Automatique - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonais (日本語) - + American English Anglais Américain - + French (français) Français (français) - + German (Deutsch) Allemand (Deutsch) - + Italian (italiano) Italien (italiano) - + Spanish (español) Espagnol (español) - + Chinese Chinois - + Korean (한국어) Coréen (한국어) - + Dutch (Nederlands) Néerlandais (Nederlands) - + Portuguese (português) Portugais (português) - + Russian (Русский) Russe (Русский) - + Taiwanese Taïwanais - + British English Anglais Britannique - + Canadian French Français Canadien - + Latin American Spanish Espagnol d'Amérique Latine - + Simplified Chinese Chinois Simplifié - + Traditional Chinese (正體中文) Chinois Traditionnel (正體中文) - + Brazilian Portuguese (português do Brasil) Portugais Brésilien (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japon - + USA É.-U.A. - + Europe Europe - + Australia Australie - + China Chine - + Korea Corée - + Taiwan Taïwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Par défaut (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Égypte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland Islande - + Iran Iran - + Israel Israël - + Jamaica Jamaïque - + Kwajalein Kwajalein - + Libya Libye - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Pologne - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapour - + Turkey Turquie - + UCT UCT - + Universal Universel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stéréo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (Par défaut) - + 6GB DRAM (Unsafe) 6 GB DRAM (Risqué) - + 8GB DRAM 8GO DRAM - + 10GB DRAM (Unsafe) 10GO DRAM (Insecure) - + 12GB DRAM (Unsafe) 12GO DRAM (Insecure) - + Docked Mode TV - + Handheld Mode Portable - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Toujours demander (par défaut) - + Only if game specifies not to stop Uniquement si le jeu précise de ne pas s'arrêter - + Never ask Jamais demander - + Very Small (16 MB) Très petit (16Mo) - + Small (32 MB) Petit (32Mo) - + Normal (128 MB) Normal (128Mo) - + Large (256 MB) Large (256Mo) - + Very Large (512 MB) Très large (512Mo) - + Very Low (4 MB) Très faible (4 Mo) - + Low (8 MB) Faible (8 Mo) - + Normal (16 MB) Normal (16 Mo) - + Medium (32 MB) Moyen (32 Mo) - + High (64 MB) Élevé (64 Mo) - + Very Low (32) Très faible (32) - + Low (64) Faible (64) - + Normal (128) Normal (128) - + Medium (256) Moyen (256) - + High (512) Élevé (512) - + Disabled Désactivé - + ExtendedDynamicState 1 État dynamique étendu 1 - + ExtendedDynamicState 2 État dynamique étendu 2 - + ExtendedDynamicState 3 État dynamique étendu 3 - + Tree View Vue en liste - + Grid View Vue en grille @@ -3251,33 +3261,38 @@ Would you like to delete the old save data? Couleur de l’arrière plan : - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Désactivé - + VSync Off VSync Désactivée - + Recommended Recommandé - + On Activé - + VSync On VSync Activée @@ -4899,102 +4914,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -7012,7 +7042,7 @@ Message de débogage : - + &Pause &Pause @@ -7163,7 +7193,7 @@ Message de débogage : - + &Start &Démarrer @@ -7174,7 +7204,7 @@ Message de débogage : - + R&ecord En&registrer @@ -7265,7 +7295,7 @@ Message de débogage : - + None Aucun @@ -7291,722 +7321,737 @@ Message de débogage : - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute Remettre le son - + Mute Couper le son - + Reset Volume Réinitialiser le volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue &Continuer - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... Fermeture du logiciel... - + Save Data Données de sauvegarde - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? Réinitialiser le temps de jeu ? - - + + RomFS Extraction Failed! L'extraction de la RomFS a échoué ! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel Annuler - + RomFS Extraction Succeeded! Extraction de la RomFS réussi ! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties Propriétés - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game Jeu - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install Échec de l'installation - + The title type you selected for the NCA is invalid. - + File not found Fichier non trouvé - + File "%1" not found - + OK OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo Amiibo - - + + The current amiibo has been removed - + Error Erreur - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo Charger un Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted Firmware corrompu - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE VOLUME : MUET - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! Wayland détecté ! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8014,74 +8059,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/hu.ts b/dist/languages/hu.ts index 11f04195b9..2b5a634afa 100644 --- a/dist/languages/hu.ts +++ b/dist/languages/hu.ts @@ -572,12 +572,22 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Teljes képernyős mód: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -586,47 +596,47 @@ A borderless (szegély nélküli) biztosítja a legjobb kompatibilitást a képe Az exkluzív teljes képernyő jobb teljesítményt és jobb Freesync/Gsync támogatást kínálhat. - + Aspect Ratio: Képarány: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Lehetővé teszi az árnyékolók tárolását a gyorsabb betöltés érdekében a következő játékindításokkor. Kikapcsolása csak hibakeresésre szolgál. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: NVDEC emuláció: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -635,12 +645,12 @@ A dekódoláshoz használhatja a CPU-t vagy a GPU-t, vagy egyáltalán nem vége A legtöbb esetben a GPU dekódolás nyújtja a legjobb teljesítményt. - + ASTC Decoding Method: ASTC dekódoló módszer: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -649,55 +659,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: ASTC újraszűrési módszer: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: VRAM használati mód: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: VSync mód: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -705,79 +715,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Aszinkron prezentálás engedélyezése (csak Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Kicsit javítja a teljesítményt azáltal, hogy a megjelenítést külön CPU szálra helyezi át. - + Force maximum clocks (Vulkan only) Maximális órajelek kényszerítése (csak Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. A háttérben fut, miközben várja a grafikai parancsokat, hogy a GPU ne csökkentse az órajelét. - + Anisotropic Filtering: Anizotropikus szűrés: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -787,1327 +797,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Vulkan pipeline gyorsítótár használata. - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Reaktív ürítés használata - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Reaktív ürítést használ a prediktív ürítés helyett, ami pontosabb memóriaszinkronizálást tesz lehetővé. - + Sync to framerate of video playback Szinkronizálás a videolejátszás képkockasebességéhez - + Run the game at normal speed during video playback, even when the framerate is unlocked. A játék futtatása normál sebességgel videolejátszás közben, még akkor is, ha a képkockasebesség fel van oldva. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. Javítja az átlátszósági effektek megjelenítését bizonyos játékokban. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Eszköznév - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Egyéni RTC dátum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Nyelv: - + This option can be overridden when region setting is auto-select - + Region: Régió: - + The region of the console. - + Time Zone: Időzóna: - + The time zone of the console. - + Sound Output Mode: Hangkimeneti mód: - + Console Mode: Konzol mód: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Emuláció leállításának megerősítése - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Egér elrejtése inaktivitáskor - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Vezérlő applet letiltása - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Játékmód engedélyezése - + Force X11 as Graphics Backend - + Custom frontend Egyéni frontend - + Real applet Valódi applet - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU aszinkron - + Uncompressed (Best quality) Tömörítetlen (legjobb minőség) - + BC1 (Low quality) BC1 (alacsony minőség) - + BC3 (Medium quality) BC3 (közepes minőség) - - + + Auto Automatikus - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Takarékos - + Aggressive Aggresszív - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Pontos - - - + + + Default Alapértelmezett - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe Nem biztonságos - + Paranoid (disables most optimizations) Paranoid (a legtöbb optimalizálást letiltja) - + Debugging - + Dynarmic Dinamikus - + NCE NCE - + Borderless Windowed Szegély nélküli ablak - + Exclusive Fullscreen Exkluzív teljes képernyő - + No Video Output Nincs videokimenet - + CPU Video Decoding CPU videódekódolás - + GPU Video Decoding (Default) GPU videódekódolás (alapértelmezett) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [KÍSÉRLETI] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [KÍSÉRLETI] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [KÍSÉRLETI] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Legközelebbi szomszéd - + Bilinear Bilineáris - + Bicubic Bikubikus - + Gaussian Gauss-féle - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nincs - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Alapértelmezett (16:9) - + Force 4:3 4:3 kényszerítése - + Force 21:9 21:9 kényszerítése - + Force 16:10 16:10 kényszerítése - + Stretch to Window Ablakhoz nyújtás - + Automatic Automatikus - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japán (日本語) - + American English Amerikai angol - + French (français) Francia (français) - + German (Deutsch) Német (Deutsch) - + Italian (italiano) Olasz (italiano) - + Spanish (español) Spanyol (español) - + Chinese Kínai - + Korean (한국어) Koreai (한국어) - + Dutch (Nederlands) Holland (Nederlands) - + Portuguese (português) Portugál (português) - + Russian (Русский) Orosz (Русский) - + Taiwanese Tajvani - + British English Brit Angol - + Canadian French Kanadai francia - + Latin American Spanish Latin-amerikai spanyol - + Simplified Chinese Egyszerűsített kínai - + Traditional Chinese (正體中文) Hagyományos kínai (正體中文) - + Brazilian Portuguese (português do Brasil) Brazíliai portugál (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japán - + USA USA - + Europe Európa - + Australia Ausztrália - + China Kína - + Korea Korea - + Taiwan Tajvan - + Auto (%1) Auto select time zone Automatikus (%1) - + Default (%1) Default time zone Alapértelmezett (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Egyiptom - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Izland - + Iran Irán - + Israel Izrael - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navahó - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Lengyelország - + Portugal Portugália - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Szingapúr - + Turkey Törökország - + UCT UCT - + Universal Univerzális - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Sztereó - + Surround Térhangzás - + 4GB DRAM (Default) 4GB DRAM (Alapértelmezett) - + 6GB DRAM (Unsafe) 6GB DRAM (Nem biztonságos) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Dokkolt - + Handheld Kézi - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Mindig kérdezz rá (alapértelmezett) - + Only if game specifies not to stop Csak akkor, ha a játék kifejezetten kéri a folytatást. - + Never ask Soha ne kérdezz rá - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3180,33 +3190,38 @@ Would you like to delete the old save data? Háttérszín: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Ki - + VSync Off VSync Ki - + Recommended Ajánlott - + On Be - + VSync On VSync Be @@ -4828,102 +4843,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6938,7 +6968,7 @@ Debug Message: - + &Pause &Szünet @@ -7089,7 +7119,7 @@ Debug Message: - + &Start &Indítás @@ -7100,7 +7130,7 @@ Debug Message: - + R&ecord F&elvétel @@ -7191,7 +7221,7 @@ Debug Message: - + None @@ -7217,722 +7247,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7940,74 +7985,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/id.ts b/dist/languages/id.ts index 30f30a8c1d..f2ae975eca 100644 --- a/dist/languages/id.ts +++ b/dist/languages/id.ts @@ -583,12 +583,22 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Mode Layar Penuh: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -597,47 +607,47 @@ Borderless menawarkan kompatibilitas terbaik dengan keyboard di layar yang dimin Layar penuh eksklusif mungkin menawarkan performa yang lebih baik dan dukungan Freesync/Gsync yang lebih baik. - + Aspect Ratio: Rasio Aspek: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Memungkinkan penyimpanan shader untuk mempercepat pengambilan pada saat game berikutnya dimulai. Menonaktifkannya hanya dimaksudkan untuk debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: Emulasi NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -646,12 +656,12 @@ Ini dapat menggunakan CPU atau GPU untuk dekode, atau tidak melakukan dekode sam Dalam kebanyakan kasus, dekode GPU memberikan kinerja terbaik. - + ASTC Decoding Method: ASTC Metode Dekoding: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -660,55 +670,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: ASTC Metode Pemampatan Ulang: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: Mode Penggunaan VRAM: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation Abaikan Invalidasi Internal CPU - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: Mode Sinkronisasi Vertikal - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -716,79 +726,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations Sinkronisasi Operasi Memori - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Aktifkan presentasi asinkron (hanya Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Meningkatkan kinerja sedikit dengan memindahkan presentasi ke thread CPU terpisah. - + Force maximum clocks (Vulkan only) Paksa jam maximum (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Berjalan bekerja di latar belakang sambil menunggu perintah grafis untuk mencegah GPU agar tidak menurunkan kecepatan jamnya. - + Anisotropic Filtering: Anisotropic Filtering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: Mode GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Akurasi DMA - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -798,1328 +808,1328 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation Gunakan kompilasi shader asinkron - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Gunakan pipeline cache Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Memungkinkan cache pipeline spesifik vendor GPU. Opsi ini dapat meningkatkan waktu pemuatan shader secara signifikan dalam kasus di mana driver Vulkan tidak menyimpan file cache pipeline secara internal. - + Enable Compute Pipelines (Intel Vulkan Only) Aktifkan Pipa Komputasi (Hanya Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Aktifkan Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Menggunakan pemadatan reaktif alih-alih pemadatan prediktif, memungkinkan sinkronisasi memori yang lebih akurat. - + Sync to framerate of video playback Sinkronkan dengan kecepatan pemutaran video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Jalankan permainan dengan kecepatan normal selama pemutaran video, bahkan ketika framerate tidak terkunci. - + Barrier feedback loops Loop umpan balik penghalang - + Improves rendering of transparency effects in specific games. Meningkatkan rendering efek transparansi dalam game tertentu. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects Perbaiki efek bloom - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading Pencahayaan Sampel - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Benih RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Nama Perangkat - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Tanggal RTC Kustom: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Bahasa - + This option can be overridden when region setting is auto-select - + Region: Wilayah: - + The region of the console. - + Time Zone: Zona Waktu: - + The time zone of the console. - + Sound Output Mode: Mode keluaran suara. - + Console Mode: Mode Konsol - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Konfirmasi sebelum menghentikan emulasi - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Sembunyikan mouse saat tidak aktif - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Nonaktifkan aplikasi pengontrol - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates Cek Pembaruan - + Whether or not to check for updates upon startup. - + Enable Gamemode Aktifkan Mode Permainan - + Force X11 as Graphics Backend - + Custom frontend Tampilan depan kustom - + Real applet Aplikasi nyata - + Never Tidak Pernah - + On Load - + Always Selalu - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU sinkron - + Uncompressed (Best quality) Tidak terkompresi (Kualitas Terbaik) - + BC1 (Low quality) BC1 (Kualitas rendah) - + BC3 (Medium quality) BC3 (Kualitas sedang) - - + + Auto Otomatis - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Konservatif - + Aggressive Agresif - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast Cepat - - - + + + Accurate Akurat - - - + + + Default Bawaan - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced Seimbang - + Strict - + Unsafe Berbahaya - + Paranoid (disables most optimizations) Paranoid (menonaktifkan sebagian besar optimasi) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Layar Tanpa Batas - + Exclusive Fullscreen Layar Penuh Eksklusif - + No Video Output Tidak ada Keluaran Suara - + CPU Video Decoding Penguraian Video menggunakan CPU - + GPU Video Decoding (Default) Penguraian Video menggunakan GPU (Bawaan) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EKSPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EKSPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EKSPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Biliner - + Bicubic Bikubik - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Tak ada - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Bawaan (16:9) - + Force 4:3 Paksa 4:3 - + Force 21:9 Paksa 21:9 - + Force 16:10 Paksa 16:10 - + Stretch to Window Regangkan ke Layar - + Automatic Otomatis - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Jepang (日本語) - + American English Bahasa Inggris Amerika - + French (français) Prancis (français) - + German (Deutsch) Jerman (Deutsch) - + Italian (italiano) Italia (italiano) - + Spanish (español) Spanyol (español) - + Chinese Cina - + Korean (한국어) Korea (한국어) - + Dutch (Nederlands) Belanda (Nederlands) - + Portuguese (português) Portugis (português) - + Russian (Русский) Rusia (Русский) - + Taiwanese Taiwan - + British English Inggris Britania - + Canadian French Prancis Kanada - + Latin American Spanish Spanyol Amerika Latin - + Simplified Chinese Cina Sederhana - + Traditional Chinese (正體中文) Cina Tradisional (正體中文) - + Brazilian Portuguese (português do Brasil) Portugis Brazil (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Jepang - + USA USA - + Europe Eropa - + Australia Australia - + China Tiongkok - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Bawaan (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Mesir - + Eire Éire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Éire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Iran - + Israel Israel - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polandia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turki - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Bawaan) - + 6GB DRAM (Unsafe) 6GB DRAM (Tidak Aman) - + 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Tidak Aman) - + 12GB DRAM (Unsafe) 12GB DRAM (Tidak Aman) - + Docked Terpasang - + Handheld Jinjing - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Selalu tanyakan (Bawaan) - + Only if game specifies not to stop Hanya jika permainan menentukan untuk tidak berhenti - + Never ask Jangan pernah bertanya - + Very Small (16 MB) Sangat Kecil (16 MB) - + Small (32 MB) Kecil (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Sedang (256) - + High (512) Tinggi (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3218,33 +3228,38 @@ Would you like to delete the old save data? Warna Latar: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Mati - + VSync Off VSync Mati - + Recommended Direkomendasikan - + On Nyala - + VSync On VSync Aktif @@ -4865,102 +4880,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6972,7 +7002,7 @@ Debug Message: - + &Pause &Jeda @@ -7123,7 +7153,7 @@ Debug Message: - + &Start &Mulai @@ -7134,7 +7164,7 @@ Debug Message: - + R&ecord R&ekam @@ -7225,7 +7255,7 @@ Debug Message: - + None @@ -7251,722 +7281,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7974,74 +8019,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/it.ts b/dist/languages/it.ts index bb485065c8..caac64d9ed 100644 --- a/dist/languages/it.ts +++ b/dist/languages/it.ts @@ -592,12 +592,22 @@ SMAA offre la migliore qualità. FXAA può produrre un'immagine più stabile nelle risoluzioni più basse. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Modalità schermo intero: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -606,12 +616,12 @@ Exclusive fullscreen may offer better performance and better Freesync/Gsync supp "Schermo intero esclusivo" può offrire prestazioni maggiori e un supporto migliore al Freesync/Gsync. - + Aspect Ratio: Rapporto d'aspetto: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -620,36 +630,36 @@ La maggior parte dei giochi supporta solo 16:9, quindi le mod sono necessarie pe Controlla anche il rapporto d'aspetto degli screenshot. - + Use persistent pipeline cache Usa la cache persistente delle pipeline - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Permette di salvare gli shader su disco per velocizzarne il caricamento negli avvii successivi del gioco. Disabilitarla ha senso solo quando si effettua il debug. - + Use asynchronous GPU emulation Abilita l'emulazione asincrona della GPU - + Uses an extra CPU thread for rendering. This option should always remain enabled. Utilizza un thread aggiuntivo della CPU per il rendering. Quest'opzione dovrebbe sempre rimanere abilitata. - + NVDEC emulation: Emulazione NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -658,12 +668,12 @@ In most cases, GPU decoding provides the best performance. Nella maggior parte dei casi, la decodifica tramite GPU fornisce prestazioni migliori. - + ASTC Decoding Method: Metodo di decodifica ASTC: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -675,12 +685,12 @@ GPU: Usa i compute shader della GPU per decodificare le texture ASTC (consigliat CPU (Asincrono): Usa la CPU per decodificare le texture ASTC se richiesto. Elimina lo stuttering causato dalla decodifica ma potrebbe generare artefatti visivi. - + ASTC Recompression Method: Metodo di ricompressione ASTC: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -688,44 +698,44 @@ BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, BC1/BC3: Il formato intermedio sarà ricompresso nel formato BC1 o BC3, risparmiando VRAM ma peggiorando la qualità visiva. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: Modalità di utilizzo della VRAM: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Determina se l'emulatore dovrebbe risparmiare memoria o utilizzarne il più possibile per massimizzare le prestazioni. La modalità aggressiva potrebbe impattare sulle prestazioni di altre applicazioni, come i programmi di registrazione. - + Skip CPU Inner Invalidation Salta invalidamento interno CPU - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Salta alcuni invalidamenti della cache durante gli aggiornamenti della memoria, riducendo l'uso della CPU e migliorando la latenza. Questo potrebbe causare soft-crash. - + VSync Mode: Modalità VSync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -736,12 +746,12 @@ Mailbox può avere una latenza minore di FIFO e non ha tearing ma potrebbe perde Immediate (no sincronizzazione) mostra tutto il disponibile, quindi anche tearing. - + Sync Memory Operations Sincronizza operazioni di memoria - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -750,68 +760,68 @@ Questa opzione dovrebbe risolvere problemi in alcuni giochi, ma potrebbe ridurre I giochi con Unreal Engine 4 sembrano essere i più colpiti. - + Enable asynchronous presentation (Vulkan only) Abilita la presentazione asincrona (solo Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Migliora di poco le prestazioni spostando la presentazione su un thread della CPU separato. - + Force maximum clocks (Vulkan only) Forza clock massimi (solo Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Esegue del lavoro in background durante l'attesa dei comandi grafici per evitare che la GPU diminuisca la sua velocità di clock. - + Anisotropic Filtering: Filtro anisotropico: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Controlla la qualità del rendering delle texture negli angoli obliqui. Si può utilizzare in modo sicuro al 16x su quasi tutte le GPU. - + GPU Mode: Modalità GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Precisione DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -821,100 +831,100 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation Abilita la compilazione asincrona degli shader - + May reduce shader stutter. Può ridurre i fenomeni di stuttering (scatti) causati dagli shader. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Usa la cache delle pipeline di Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Abilita la cache delle pipeline specifica del produttore della GPU. Quest'opzione può ridurre di molto i tempi di caricamento degli shader nei casi in cui il driver Vulkan non memorizza la cache delle pipeline internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Abilita le compute pipeline (solo per Vulkan su Intel) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -923,192 +933,192 @@ Quest'impostazione esiste solo per i driver proprietari Intel e potrebbe fa Le compute pipelines sono sempre attivate su tutti gli altri drivers. - + Enable Reactive Flushing Abilita il flushing reattivo - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Utilizza il flushing reattivo invece di quello predittivo, al fine di ottenere una sincronizzazione della memoria più accurata. - + Sync to framerate of video playback Sincronizza il framerate a quello del video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Esegue il gioco a velocità normale durante le cutscene, anche quando il framerate è sbloccato. - + Barrier feedback loops Barrier feedback loops - + Improves rendering of transparency effects in specific games. Migliora il rendering degli effetti di trasparenza in alcuni giochi. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State Stato dinamico esteso - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Controlla il numero di funzionalità che possono essere usate con lo stato dinamico esteso. Gli stati più alti consentono più funzionalità e possono migliorare le prestazioni, ma possono causare ulteriori problemi grafici. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading Sample shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permette al fragment shader di eseguire per campione in un frammento multi-campione invece che una volta per frammento. Migliora la qualità grafica a scapito delle prestazioni. Alti valori migliorano la qualità ma peggiorano le prestazioni. - + RNG Seed Seed RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Controlla il seme del generatore di numeri casuali. Principalmente utilizzato per le speedrun. - + Device Name Nome del dispositivo - + The name of the console. Il nome della console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Data RTC personalizzata: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Quest'opzione permette di modificare l'orologio della console. Può essere usato per manipolare il tempo nei giochi. - + The number of seconds from the current unix time Il numero di secondi dal tempo Unix attuale - + Language: Lingua: - + This option can be overridden when region setting is auto-select Può essere rimpiazzato se il fuso orario della Regione è impostato su Auto - + Region: Regione: - + The region of the console. La regione della console. - + Time Zone: Fuso orario: - + The time zone of the console. Il fuso orario della console. - + Sound Output Mode: Modalità di output del suono: - + Console Mode: Modalità console: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1117,1042 +1127,1042 @@ I giochi ne terranno conto e modificheranno la risoluzione, i dettagli e i contr Impostare l'opzione su "Portatile" può aiutare a migliorare le prestazioni sui sistemi meno potenti. - + Prompt for user profile on boot Scegli il profilo utente all'avvio - + Useful if multiple people use the same PC. Utile se più persone utilizzano lo stesso PC. - + Pause when not in focus Metti in pausa quando la finestra non è in primo piano - + Pauses emulation when focusing on other windows. Mette in pausa l'emulazione quando altre finestre sono in primo piano. - + Confirm before stopping emulation Chiedi conferma prima di arrestare l'emulazione - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Sovrascrive le richieste di conferma per fermare l'emulazione. Abilitarla bypassa queste richieste e l'emulazione cesserà immediatamente. - + Hide mouse on inactivity Nascondi il puntatore del mouse se inattivo - + Hides the mouse after 2.5s of inactivity. Nasconde il mouse dopo 2,5 secondi di inattività. - + Disable controller applet Disabilita l'applet controller - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Disabilita forzatamente l'uso dell'applet del controller nei programmi emulati. Quando un programma proverà ad aprire l'applet del controller, quest'ultimo verrà immediatamente chiuso. - + Check for updates Controlla la presenza di aggiornamenti - + Whether or not to check for updates upon startup. Determina se controllare o meno la presenza di aggiornamenti all'avvio. - + Enable Gamemode Abilita Gamemode - + Force X11 as Graphics Backend Forza l'uso del back-end grafico X11 - + Custom frontend Frontend personalizzato - + Real applet Applet reale - + Never Mai - + On Load Al caricamento - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU (Asincrono) - + Uncompressed (Best quality) Nessuna compressione (qualità migliore) - + BC1 (Low quality) BC1 (qualità bassa) - + BC3 (Medium quality) BC3 (qualità media) - - + + Auto Automatico - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservativa - + Aggressive Aggressiva - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (shader assembly, solo NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (sperimentale, solo AMD/MESA) - + Null Nullo - + Fast Veloce - - - + + + Accurate Accurata - - - + + + Default Predefinito - + Unsafe (fast) Non sicuro (veloce) - + Safe (stable) Sicuro (stabile) - + Immediate - + Balanced Bilanciata - + Strict - + Unsafe Non sicura - + Paranoid (disables most optimizations) Paranoica (disabilita la maggior parte delle ottimizzazioni) - + Debugging Debug - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Finestra senza bordi - + Exclusive Fullscreen Schermo intero esclusivo - + No Video Output Nessun output video - + CPU Video Decoding Decodifica video CPU - + GPU Video Decoding (Default) Decodifica video GPU (predefinita) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [SPERIMENTALE] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [SPERIMENTALE] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [SPERIMENTALE] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [SPERIMENTALE] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [SPERIMENTALE] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest neighbor - + Bilinear Bilineare - + Bicubic Bicubico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nessuna - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Predefinito (16:9) - + Force 4:3 Forza 4:3 - + Force 21:9 Forza 21:9 - + Force 16:10 Forza 16:10 - + Stretch to Window Allunga a finestra - + Automatic Automatico - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Giapponese (日本語) - + American English Inglese americano - + French (français) Francese (français) - + German (Deutsch) Tedesco (Deutsch) - + Italian (italiano) Italiano - + Spanish (español) Spagnolo (español) - + Chinese Cinese - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Olandese (Nederlands) - + Portuguese (português) Portoghese (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanese - + British English Inglese britannico - + Canadian French Francese canadese - + Latin American Spanish Spagnolo latino-americano - + Simplified Chinese Cinese semplificato - + Traditional Chinese (正體中文) Cinese tradizionale (正體中文) - + Brazilian Portuguese (português do Brasil) Portoghese brasiliano (português do Brasil) - + Polish (polska) Polacco (polska) - + Thai (แบบไทย) Thailandese (แบบไทย) - - + + Japan Giappone - + USA USA - + Europe Europa - + Australia Australia - + China Cina - + Korea Corea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Automatico (%1) - + Default (%1) Default time zone Predefinito (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egitto - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islanda - + Iran Iran - + Israel Israele - + Jamaica Giamaica - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polonia - + Portugal Portogallo - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turchia - + UCT UCT - + Universal Universale - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Predefinito) - + 6GB DRAM (Unsafe) 6GB DRAM (Non sicuro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Non sicuro) - + 12GB DRAM (Unsafe) 12GB DRAM (Non sicuro) - + Docked Dock - + Handheld Portatile - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Chiedi sempre (Predefinito) - + Only if game specifies not to stop Solo se il gioco richiede di non essere arrestato - + Never ask Non chiedere mai - + Very Small (16 MB) Molto piccola (16 MB) - + Small (32 MB) Piccola (32 MB) - + Normal (128 MB) Normale (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Molto grande (512 MB) - + Very Low (4 MB) Molto bassa (4 MB) - + Low (8 MB) Bassa (8 MB) - + Normal (16 MB) Normale (16 MB) - + Medium (32 MB) Media (32 MB) - + High (64 MB) Alta (64 MB) - + Very Low (32) Molto basso (32) - + Low (64) Basso (64) - + Normal (128) Normale (128) - + Medium (256) Medio (256) - + High (512) Alto (512) - + Disabled Disabilitato - + ExtendedDynamicState 1 Stato dinamico esteso 1 - + ExtendedDynamicState 2 Stato dinamico esteso 2 - + ExtendedDynamicState 3 Stato dinamico esteso 3 - + Tree View Vista ad albero - + Grid View Vista a griglia @@ -3262,33 +3272,38 @@ Vuoi cancellare i dati precedenti? Colore dello sfondo: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Disattivato - + VSync Off VSync disattivato - + Recommended Consigliata - + On Attivato - + VSync On VSync attivato @@ -4919,102 +4934,117 @@ Una volta rimosse, non potranno più essere recuperate. Sei assolutamente sicuro - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -7032,7 +7062,7 @@ Messaggio debug: - + &Pause &Pausa @@ -7183,7 +7213,7 @@ Messaggio debug: - + &Start &Avvia @@ -7194,7 +7224,7 @@ Messaggio debug: - + R&ecord R&egistra @@ -7285,7 +7315,7 @@ Messaggio debug: - + None Nessuno @@ -7311,400 +7341,405 @@ Messaggio debug: - + Small (32x32) Piccola (32x32) - + Standard (64x64) Normale (64x64) - + Large (128x128) Grande (128x128) - + Full Size (256x256) Intera (256x256) - + Broken Vulkan Installation Detected Rilevata installazione di Vulkan non funzionante - + Vulkan initialization failed during boot. L'inizializzazione di Vulkan è fallita durante l'avvio. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Gioco in esecuzione - + Loading Web Applet... Caricamento dell'applet web... - - + + Disable Web Applet Disabilita l'applet web - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Disabilitare l'applet web potrebbe causare dei comportamenti indesiderati e andrebbe fatto solo con Super Mario 3D All-Stars. Sei sicuro di voler procedere? (Puoi riabilitarlo quando vuoi nelle impostazioni di debug.) - + The amount of shaders currently being built Il numero di shader in fase di compilazione - + The current selected resolution scaling multiplier. Il moltiplicatore attuale della risoluzione. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Velocità attuale dell'emulazione. Valori più alti o più bassi di 100% indicano che l'emulazione sta funzionando più velocemente o lentamente rispetto a una Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Il numero di fotogrammi al secondo che il gioco sta attualmente renderizzando. Può variare in base al gioco e alla situazione. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Tempo necessario per emulare un fotogramma della Switch, senza tenere conto del limite al framerate o del V-Sync. Per un'emulazione alla massima velocità, il valore non dovrebbe essere superiore a 16.67 ms. - + Unmute Riattiva - + Mute Silenzia - + Reset Volume Reimposta volume - + + Configure Effects... + + + + &Clear Recent Files &Cancella i file recenti - + &Continue &Continua - + Warning: Outdated Game Format Attenzione: Formato del gioco obsoleto - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Stai usando una cartella contenente una ROM decostruita per avviare questo gioco, che è un formato obsoleto e sostituito da NCA, NAX, XCI o NSP. Le ROM decostruite non hanno icone né metadati e non supportano gli aggiornamenti.<br>Per una spiegazione sui vari formati della console Switch supportati da Eden, consulta il manuale utente. Non riceverai di nuovo questo avviso. - - + + Error while loading ROM! Errore nel caricamento della ROM! - + The ROM format is not supported. Il formato della ROM non è supportato. - + An error occurred initializing the video core. Errore durante l'inizializzazione del componente video di base - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Errore nel caricamento della ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Esegui un nuovo dump dei tuoi file o chiedi aiuto su Discord/Stoat. - + An unknown error occurred. Please see the log for more details. Si è verificato un errore sconosciuto. Consulta il log per maggiori dettagli. - - + + (64-bit) (64 bit) - - + + (32-bit) (32 bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Chiusura del software in corso... - + Save Data Dati di salvataggio - + Mod Data Dati delle mod - + Error Opening %1 Folder Impossibile aprire la cartella %1 - - + + Folder does not exist! La cartella non esiste! - + Remove Installed Game Contents? Rimuovere il contenuto del gioco installato? - + Remove Installed Game Update? Rimuovere l'aggiornamento installato? - + Remove Installed Game DLC? Rimuovere il DLC installato? - + Remove Entry Rimuovi voce - + Delete OpenGL Transferable Shader Cache? Vuoi rimuovere la cache trasferibile degli shader OpenGL? - + Delete Vulkan Transferable Shader Cache? Vuoi rimuovere la cache trasferibile degli shader Vulkan? - + Delete All Transferable Shader Caches? Vuoi rimuovere tutte le cache trasferibili degli shader? - + Remove Custom Game Configuration? Rimuovere la configurazione personalizzata del gioco? - + Remove Cache Storage? Rimuovere la cache del gioco? - + Remove File Rimuovi file - + Remove Play Time Data Reimposta il tempo di gioco - + Reset play time? Vuoi reimpostare il tempo di gioco? - - + + RomFS Extraction Failed! Estrazione RomFS fallita! - + There was an error copying the RomFS files or the user cancelled the operation. Si è verificato un errore durante la copia dei file del RomFS o l'operazione è stata annullata dall'utente. - + Full Completa - + Skeleton Cartelle - + Select RomFS Dump Mode Seleziona la modalità di estrazione del RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Seleziona come vorresti estrarre il RomFS. <br>La modalità Completa copierà tutti i file in una nuova cartella mentre<br>la modalità Cartelle creerà solamente la struttura delle cartelle. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root Non c'è abbastanza spazio disponibile in %1 per estrarre il RomFS. Libera lo spazio o seleziona una cartella di estrazione diversa in Emulazione > Configura > Sistema > File system > Cartella di estrazione - + Extracting RomFS... Estrazione RomFS in corso... - - + + Cancel Annulla - + RomFS Extraction Succeeded! Estrazione RomFS riuscita! - + The operation completed successfully. L'operazione è stata completata con successo. - + Error Opening %1 Impossibile aprire %1 - + Select Directory Seleziona cartella - + Properties Proprietà - + The game properties could not be loaded. Non è stato possibile caricare le proprietà del gioco. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Eseguibile Switch (%1);;Tutti i file (*.*) - + Load File Carica file - + Open Extracted ROM Directory Apri la cartella della ROM estratta - + Invalid Directory Selected Cartella selezionata non valida - + The directory you have selected does not contain a 'main' file. La cartella che hai selezionato non contiene un file "main". - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) File Switch installabili (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files Installa file - + %n file(s) remaining %n file rimanente%n di file rimanenti%n file rimanenti - + Installing file "%1"... Installazione del file "%1"... - - + + Install Results Risultati dell'installazione - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Per evitare possibli conflitti, sconsigliamo di installare i giochi base su NAND. Usa questa funzione solo per installare aggiornamenti e DLC. - + %n file(s) were newly installed %n nuovo file è stato installato @@ -7713,7 +7748,7 @@ Usa questa funzione solo per installare aggiornamenti e DLC. - + %n file(s) were overwritten %n file è stato sovrascritto @@ -7722,7 +7757,7 @@ Usa questa funzione solo per installare aggiornamenti e DLC. - + %n file(s) failed to install %n file non è stato installato a causa di errori @@ -7731,314 +7766,324 @@ Usa questa funzione solo per installare aggiornamenti e DLC. - + System Application Applicazione di sistema - + System Archive Archivio di sistema - + System Application Update Aggiornamento di un'applicazione di sistema - + Firmware Package (Type A) Pacchetto firmware (tipo A) - + Firmware Package (Type B) Pacchetto firmware (tipo B) - + Game Gioco - + Game Update Aggiornamento di gioco - + Game DLC DLC - + Delta Title Titolo delta - + Select NCA Install Type... Seleziona il tipo di installazione NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Seleziona il tipo del file NCA da installare: (Nella maggior parte dei casi, il valore predefinito "Gioco" va bene) - + Failed to Install Installazione fallita - + The title type you selected for the NCA is invalid. Il tipo che hai selezionato per il file NCA non è valido. - + File not found File non trovato - + File "%1" not found File "%1" non trovato - + OK OK - + Function Disabled Funzionalità disabilitata - + Compatibility list reporting is currently disabled. Check back later! La segnalazione della compatibilità è al momento disabilitata. Torna a controllare più avanti! - + Error opening URL Impossibile aprire l'URL - + Unable to open the URL "%1". Non è stato possibile aprire l'URL "%1". - + TAS Recording Registrazione TAS - + Overwrite file of player 1? Vuoi sovrascrivere il file del giocatore 1? - + Invalid config detected Rilevata configurazione non valida - + Handheld controller can't be used on docked mode. Pro controller will be selected. Il controller portatile non può essere utilizzato in modalità dock. Verrà selezionato il controller Pro. - - + + Amiibo Amiibo - - + + The current amiibo has been removed L'Amiibo corrente è stato rimosso - + Error Errore - - + + The current game is not looking for amiibos Il gioco in uso non è alla ricerca di Amiibo - + Amiibo File (%1);; All Files (*.*) File Amiibo (%1);; Tutti i file (*.*) - + Load Amiibo Carica Amiibo - + Error loading Amiibo data Impossibile caricare i dati dell'Amiibo - + The selected file is not a valid amiibo Il file selezionato non è un Amiibo valido - + The selected file is already on use Il file selezionato è già in uso - + An unknown error occurred Si è verificato un errore sconosciuto - + No firmware available Nessun firmware disponibile - + Firmware Corrupted Firmware corrotto - + Unknown applet Applet sconosciuto - + Applet doesn't map to a known value. L'applet non è associato a un valore noto. - + Record not found Non trovato - + Applet not found. Please reinstall firmware. Applet non trovato. Reinstalla il firmware. - + Capture Screenshot Cattura screenshot - + PNG Image (*.png) Immagine PNG (*.png) - + TAS state: Running %1/%2 Stato TAS: In esecuzione (%1/%2) - + TAS state: Recording %1 Stato TAS: Registrazione in corso (%1) - + TAS state: Idle %1/%2 Stato TAS: In attesa (%1/%2) - + TAS State: Invalid Stato TAS: Non valido - + &Stop Running &Interrompi esecuzione - + Stop R&ecording Interrompi r&egistrazione - + Building: %n shader(s) Compilazione di %n shaderCompilazione di %n shaderCompilazione di %n shader - + Scale: %1x %1 is the resolution scaling factor Risoluzione: %1x - + Speed: %1% / %2% Velocità: %1% / %2% - + Speed: %1% Velocità: %1% - + Game: %1 FPS Gioco: %1 FPS - + Frame: %1 ms Frame: %1 ms - + NO AA NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE VOLUME: MUTO - + VOLUME: %1% Volume percentage (e.g. 50%) VOLUME: %1% - + Derivation Components Missing Componenti di derivazione mancanti - + Decryption keys are missing. Install them now? Chiavi di crittografia mancanti. Vuoi installarle ora? - + Wayland Detected! Wayland rilevato! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8049,74 +8094,74 @@ Si consiglia invece di usare X11. Vuoi forzare l'uso di quest'ultimo per i prossimi avvii? - + Use X11 Usa X11 - + Continue with Wayland Continua con Wayland - + Don't show again Non mostrare di nuovo - + Restart Required Riavvio richiesto - + Restart Eden to apply the X11 backend. Riavvia Eden per usare il back-end X11. - + Slow Lento - + Turbo Turbo - + Unlocked Sbloccato - + Select RomFS Dump Target Seleziona RomFS da estrarre - + Please select which RomFS you would like to dump. Seleziona quale RomFS vorresti estrarre. - + Are you sure you want to close Eden? Sei sicuro di voler uscire da Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Sei sicuro di voler arrestare l'emulazione? Tutti i progressi non salvati verranno perduti. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/ja_JP.ts b/dist/languages/ja_JP.ts index 01de70d2b2..8aa2c78060 100644 --- a/dist/languages/ja_JP.ts +++ b/dist/languages/ja_JP.ts @@ -571,70 +571,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: フルスクリーンモード: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: アスペクト比: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: NVDEC エミュレーション: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: ASTC デコード方式: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -643,55 +653,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: ASTC 再圧縮方式: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: 垂直同期: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -702,79 +712,79 @@ Mailbox は FIFO よりも遅延が小さくティアリングがありません Immediate (no synchronization) は表示可能なものをすべて表示し, ティアリング発生の可能性があります. - + Sync Memory Operations メモリ操作の同期 - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) 非同期プレゼンテーション (Vulkan のみ) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) 最大クロック強制 (Vulkan のみ) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. GPUのクロックスピードを下げないように、グラフィックコマンドを待っている間、バックグラウンドで作業を実行させます。 - + Anisotropic Filtering: 異方性フィルタリング: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: GPUモード: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: DMA精度: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -784,1327 +794,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Vulkan パイプラインキャッシュを使用 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) コンピュート・パイプラインの有効化(インテル Vulkan のみ) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback ビデオ再生のフレームレートに同期する - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. 特定のゲームにおける透明エフェクトのレンダリングを改善します。 - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed 乱数シード値の変更 - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name デバイス名 - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: 言語: - + This option can be overridden when region setting is auto-select - + Region: 地域: - + The region of the console. - + Time Zone: タイムゾーン: - + The time zone of the console. - + Sound Output Mode: 音声出力モード: - + Console Mode: コンソールモード: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation エミュレーションを停止する前に確認する - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity 非アクティブ時にマウスカーソルを隠す - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet コントローラーアプレットの無効化 - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 非同期 - + Uncompressed (Best quality) 圧縮しない (最高品質) - + BC1 (Low quality) BC1 (低品質) - + BC3 (Medium quality) BC3 (中品質) - - + + Auto 自動 - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (アセンブリシェーダー、NVIDIA のみ) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V(実験的、AMD/Mesaのみ) - + Null - + Fast - - - + + + Accurate 正確 - - - + + + Default デフォルト - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe 不安定 - + Paranoid (disables most optimizations) パラノイド (ほとんどの最適化を無効化) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed ボーダーレスウィンドウ - + Exclusive Fullscreen 排他的フルスクリーン - + No Video Output ビデオ出力しない - + CPU Video Decoding ビデオをCPUでデコード - + GPU Video Decoding (Default) ビデオをGPUでデコード (デフォルト) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [実験的] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [実験的] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [実験的] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area - + MMPX MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None なし - + FXAA FXAA - + SMAA SMAA - + Default (16:9) デフォルト (16:9) - + Force 4:3 強制 4:3 - + Force 21:9 強制 21:9 - + Force 16:10 強制 16:10 - + Stretch to Window ウィンドウに合わせる - + Automatic 自動 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日本語 - + American English アメリカ英語 - + French (français) フランス語 (français) - + German (Deutsch) ドイツ語 (Deutsch) - + Italian (italiano) イタリア語 (italiano) - + Spanish (español) スペイン語 (español) - + Chinese 中国語 - + Korean (한국어) 韓国語 (한국어) - + Dutch (Nederlands) オランダ語 (Nederlands) - + Portuguese (português) ポルトガル語 (português) - + Russian (Русский) ロシア語 (Русский) - + Taiwanese 台湾語 - + British English イギリス英語 - + Canadian French カナダフランス語 - + Latin American Spanish ラテンアメリカスペイン語 - + Simplified Chinese 簡体字中国語 - + Traditional Chinese (正體中文) 繁体字中国語 (正體中文) - + Brazilian Portuguese (português do Brasil) ブラジルポルトガル語 (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan 日本 - + USA アメリカ - + Europe ヨーロッパ - + Australia オーストラリア - + China 中国 - + Korea 韓国 - + Taiwan 台湾 - + Auto (%1) Auto select time zone 自動 (%1) - + Default (%1) Default time zone 既定 (%1) - + CET 中央ヨーロッパ時間 - + CST6CDT CST6CDT - + Cuba キューバ - + EET 東ヨーロッパ標準時 - + Egypt エジプト - + Eire アイルランド - + EST アメリカ東部標準時 - + EST5EDT EST5EDT - + GB GB - + GB-Eire イギリス-アイルランド - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich グリニッジ - + Hongkong 香港 - + HST ハワイ標準時 - + Iceland アイスランド - + Iran イラン - + Israel イスラエル - + Jamaica ジャマイカ - + Kwajalein クェゼリン - + Libya リビア - + MET 中東時間 - + MST MST - + MST7MDT MST7MDT - + Navajo ナバホ - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland ポーランド - + Portugal ポルトガル - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore シンガポール - + Turkey トルコ - + UCT UCT - + Universal ユニバーサル - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu ズールー - + Mono モノラル - + Stereo ステレオ - + Surround サラウンド - + 4GB DRAM (Default) 4GB DRAM (デフォルト) - + 6GB DRAM (Unsafe) 6GB DRAM (不安定) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld 携帯モード - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) 常に確認する (デフォルト) - + Only if game specifies not to stop ゲームが停止しないように指定しているときのみ - + Never ask 確認しない - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled 無効 - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3204,33 +3214,38 @@ Would you like to delete the old save data? 背景色: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off オフ - + VSync Off VSync オフ - + Recommended 推奨 - + On オン - + VSync On VSync オン @@ -4851,102 +4866,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6961,7 +6991,7 @@ Debug Message: - + &Pause 中断(&P) @@ -7112,7 +7142,7 @@ Debug Message: - + &Start 実行(&S) @@ -7123,7 +7153,7 @@ Debug Message: - + R&ecord 記録(&R) @@ -7214,7 +7244,7 @@ Debug Message: - + None @@ -7240,722 +7270,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7963,74 +8008,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/ko_KR.ts b/dist/languages/ko_KR.ts index ecb5a29660..e636dc2030 100644 --- a/dist/languages/ko_KR.ts +++ b/dist/languages/ko_KR.ts @@ -594,12 +594,22 @@ SMAA는 최고의 화질을 제공합니다. FXAA는 저해상도에서 더 안정적인 화면을 구현할 수 있습니다. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: 전체 화면 모드: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -608,12 +618,12 @@ Exclusive fullscreen may offer better performance and better Freesync/Gsync supp 전체 화면 전용 모드는 더 나은 성능과 FreeSync/GSync 지원을 제공할 수 있습니다. - + Aspect Ratio: 화면 비율: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -622,36 +632,36 @@ Also controls the aspect ratio of captured screenshots. 또한 캡처된 스크린샷의 화면 비율도 제어합니다. - + Use persistent pipeline cache 지속적 파이프라인 캐시 사용 - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. 셰이더를 저장소에 저장하여 다음 게임 실행 시 더 빠르게 불러올 수 있도록 합니다. 이 옵션을 비활성화하는 것은 디버깅 목적으로만 사용하세요. - + Use asynchronous GPU emulation 비동기 GPU 에뮬레이션 사용 - + Uses an extra CPU thread for rendering. This option should always remain enabled. 렌더링에 추가 CPU 스레드를 사용합니다. 이 옵션은 항상 활성화된 상태로 유지해야 합니다. - + NVDEC emulation: NVDEC 에뮬레이션: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -660,12 +670,12 @@ In most cases, GPU decoding provides the best performance. 대부분의 경우 GPU 디코딩이 가장 좋은 성능을 제공합니다. - + ASTC Decoding Method: ASTC 디코딩 방식: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -677,12 +687,12 @@ GPU: GPU의 컴퓨트 셰이더를 사용하여 ASTC 텍스처를 디코딩합 CPU 비동기: 필요에 따라 CPU를 사용하여 ASTC 텍스처를 디코딩합니다. ASTC 디코딩으로 인한 끊김 현상이 없어지지만, 아티팩트가 발생할 수 있습니다. - + ASTC Recompression Method: ASTC 재압축 방식: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -691,44 +701,44 @@ BC1/BC3: 중간 형식은 BC1 또는 BC3 형식으로 재압축되어 VRAM을 절약하지만 이미지 품질이 저하됩니다. - + Frame Pacing Mode (Vulkan only) 프레임 페이싱 모드(Vulkan 전용) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. 에뮬레이터가 프레임 페이싱을 관리하는 방식을 제어하여 끊김 현상을 줄이고 프레임 속도를 더욱 부드럽고 일관되게 만듭니다. - + VRAM Usage Mode: VRAM 사용 모드: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. 에뮬레이터가 메모리를 절약할지, 아니면 사용 가능한 비디오 메모리를 최대한 활용하여 성능을 향상시킬지 선택합니다. 적극적 모드는 녹화 소프트웨어와 같은 다른 애플리케이션의 성능에 영향을 줄 수 있습니다. - + Skip CPU Inner Invalidation CPU 내부 무효화 건너뛰기 - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. 메모리 업데이트 중 특정 캐시 무효화를 건너뛰어 CPU 사용량을 줄이고 지연 시간을 개선합니다. 하지만 이로 인해 소프트 크래시가 발생할 수 있습니다. - + VSync Mode: 수직 동기화 모드: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -739,12 +749,12 @@ Mailbox는 FIFO보다 지연 시간이 짧고 화면 찢김 현상이 없지만 즉각적(동기화 없음)는 사용 가능한 모든 화면을 표시하며 화면 찢김 현상이 발생할 수 있습니다. - + Sync Memory Operations 메모리 작업 동기화 - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -753,44 +763,44 @@ Unreal Engine 4 games often see the most significant changes thereof. 대개 언리얼 엔진 4 게임에서 이러한 변경 사항이 가장 두드러지게 나타납니다. - + Enable asynchronous presentation (Vulkan only) 비동기 프레젠테이션 활성화(Vulkan 전용) - + Slightly improves performance by moving presentation to a separate CPU thread. 프레젠테이션을 별도의 CPU 스레드로 이동시켜 성능을 약간 향상시킵니다. - + Force maximum clocks (Vulkan only) 최대 클럭 강제 적용(Vulkan 전용) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. 그래픽 명령을 기다리는 동안 백그라운드에서 작업을 실행하여 GPU 클럭 속도가 저하되는 것을 방지합니다. - + Anisotropic Filtering: 비등방성 필터링: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. 비스듬한 각도에서의 텍스처 렌더링 품질을 제어합니다. 대부분의 GPU에서 16x로 설정해도 안전합니다. - + GPU Mode: GPU 모드: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -799,12 +809,12 @@ Particles tend to only render correctly with Accurate mode. 특히 조각들은 정확 모드에서만 제대로 렌더링되는 경향이 있습니다. - + DMA Accuracy: DMA 정확도: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -813,12 +823,12 @@ Default follows the GPU Accuracy setting. 기본값은 GPU 정확도 설정을 따릅니다. - + GPU Fence Behavior: GPU 펜스 동작: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -833,56 +843,56 @@ Default follows the GPU Accuracy setting. 기본값은 GPU 정확도 설정을 따릅니다. - + Enable GPU buffer readback GPU 버퍼 되읽기 활성화 - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. 수정된 GPU 데이터를 업로드하기 전에 다시 읽어들여 보존합니다. 일부 게임에서는 특정 효과를 제대로 렌더링하기 위해 이 기능이 필요합니다. - + Enable asynchronous shader compilation 비동기 셰이더 컴파일 활성화 - + May reduce shader stutter. 셰이더 끊김 현상을 줄일 수 있습니다. - + GPU Clocks GPU 클럭 - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. 게임이 GPU 작업이 실제보다 더 빨리 완료된다고 착각하게 만들어, 스위치의 클럭 속도에 맞추기 위해 해상도와 렌더 거리를 낮추는 작업을 중단하게 합니다. - + GPU Unswizzle GPU 언스위즐 - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. GPU 컴퓨팅을 사용하여 BCn 3D 텍스처 디코딩을 가속화합니다. 충돌이나 그래픽 결함이 발생하는 경우 이 기능을 비활성화하세요. - + GPU Unswizzle Max Texture Size GPU 언스위즐 최대 텍스처 크기 - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -891,48 +901,48 @@ GPU는 중간 및 큰 크기의 텍스처에서 더 빠르지만, 매우 작은 이 값을 조정하여 GPU 가속과 CPU 오버헤드 간의 균형을 찾으세요. - + GPU Unswizzle Stream Size GPU 언스위즐 스트림 크기 - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. 프레임당 처리할 최대 텍스처 데이터 양(MiB 단위)을 설정합니다. 값이 높을수록 텍스처 로딩 중 끊김 현상을 줄일 수 있지만 프레임 일관성에 영향을 미칠 수 있습니다. - + GPU Unswizzle Chunk Size GPU 언스위즐 청크 크기 - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. 단일 디스패치에서 처리할 깊이 슬라이스 수를 결정합니다. 이 값을 높이면 고성능 GPU에서 처리량이 향상될 수 있지만, 성능이 낮은 하드웨어에서는 TDR 오류나 드라이버 시간 초과가 발생할 수 있습니다. - + Use Vulkan pipeline cache Vulkan 파이프라인 캐시 사용 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. GPU 제조사별 파이프라인 캐시를 활성화합니다. 이 옵션은 Vulkan 드라이버가 파이프라인 캐시 파일을 내부에 저장하지 않는 경우 셰이더 로딩 시간을 크게 향상시킬 수 있습니다. - + Enable Compute Pipelines (Intel Vulkan Only) 컴퓨트 파이프라인 활성화(인텔 Vulkan 전용) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -941,194 +951,194 @@ Compute pipelines are always enabled on all other drivers. 다른 모든 드라이버에서는 컴퓨트 파이프라인이 항상 활성화됩니다. - + Enable Reactive Flushing 반응형 플러싱 활성화 - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. 예측형 플러싱 대신 반응형 플러싱을 사용하여 보다 정확한 메모리 동기화를 가능하게 합니다. - + Sync to framerate of video playback 비디오 재생 프레임 속도에 동기화 - + Run the game at normal speed during video playback, even when the framerate is unlocked. 프레임률 제한이 해제된 경우에도 비디오 재생 중에는 게임을 정상 속도로 실행합니다. - + Barrier feedback loops 피드백 루프 차단 - + Improves rendering of transparency effects in specific games. 특정 게임에서 투명 효과 렌더링을 개선합니다. - + Enable buffer history 버퍼 기록 활성화 - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. 이전 버퍼 상태에 접근할 수 있도록 합니다. 이 옵션은 일부 게임에서 렌더링 품질과 성능 일관성을 향상시킬 수 있습니다. - + Fix bloom effects 블룸 효과 수정 - + Removes bloom in Burnout. Burnout에서의 블룸 현상을 제거합니다. - + Enable Legacy Rescale Pass 기존 크기 조정 무시 활성화 - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. 이전 구현의 동작을 활용하여 일부 게임에서 발생하는 크기 조정 문제를 해결할 수 있습니다. 루이지 맨션 3에서 발생했던 AMD 및 인텔 GPU의 선 아티팩트 현상과 Nvidia GPU의 회색 텍스처 깜빡임 현상을 해결하는 기존 반응에 대한 예비 해결책입니다. - + Extended Dynamic State 확장된 동적 상태 - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. 확장된 동적 상태에서 사용할 수 있는 기능의 수를 제어합니다. 상태 수가 많을수록 더 많은 기능을 사용할 수 있고 성능이 향상될 수 있지만, 추가적인 그래픽 문제가 발생할 수 있습니다. - + Vertex Input Dynamic State 정점 입력 동적 상태 - + Enables vertex input dynamic state feature for better quality and performance. 정점 입력의 동적 상태 기능을 활성화하여 품질과 성능을 향상시킵니다. - + Sample Shading 샘플 셰이딩 - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. 조각 셰이더가 다중샘플 조각에서 한 번당 한 조각이 아닌 샘플별로 실행될 수 있도록 합니다. 성능 저하를 감수하고 그래픽 품질을 향상시킵니다. 값이 높을수록 품질은 향상되지만 성능은 저하됩니다. - + RNG Seed RNG 시드 - + Controls the seed of the random number generator. Mainly used for speedrunning. 난수 생성기의 시드 값을 제어합니다. 주로 스피드런에 사용됩니다. - + Device Name 장치 이름 - + The name of the console. 콘솔의 이름 - + Homebrew Args 홈브루 인수 - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). 홈브루 실행 시 전달되는 명령줄 인수(예: -noglsl). - + Custom RTC Date: 사용자 지정 RTC 날짜: - + This option allows to change the clock of the console. Can be used to manipulate time in games. 이 옵션을 사용하면 콘솔의 시간을 변경할 수 있습니다. 게임 내 시간을 조작하는 데 사용할 수 있습니다. - + The number of seconds from the current unix time 현재 unix 시간으로부터 경과한 초 수 - + Language: 언어: - + This option can be overridden when region setting is auto-select 이 옵션은 지역 설정이 자동 선택으로 되어 있을 경우 번복될 수 있습니다. - + Region: 지역: - + The region of the console. 콘솔의 지역 - + Time Zone: 시간대: - + The time zone of the console. 콘솔의 시간대 - + Sound Output Mode: 소리 출력 모드: - + Console Mode: 콘솔 모드: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1137,1042 +1147,1042 @@ Setting to Handheld can help improve performance for low end systems. 휴대 모드로 설정하면 저사양 시스템의 성능을 향상시키는 데 도움이 될 수 있습니다. - + Prompt for user profile on boot 부팅 시 유저 프로필 입력 요청 - + Useful if multiple people use the same PC. 여러 사람이 같은 PC를 사용할 때 유용합니다. - + Pause when not in focus 초점이 맞지 않을 때 일시 중지 - + Pauses emulation when focusing on other windows. 다른 창에 초점을 맞출 때 에뮬레이션을 일시 중지합니다. - + Confirm before stopping emulation 에뮬레이션을 중지하기 전에 확인 - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. 에뮬레이션 중지를 확인하는 메시지를 무시합니다. 이 옵션을 활성화하면 이러한 메시지를 건너뛰고 에뮬레이션을 바로 종료합니다. - + Hide mouse on inactivity 마우스 커서가 비활동 상태일 때 숨기기 - + Hides the mouse after 2.5s of inactivity. 마우스 커서가 2.5초 동안 활동이 없으면 숨깁니다. - + Disable controller applet 컨트롤러 애플릿 비활성화 - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. 에뮬레이트된 프로그램에서 컨트롤러 애플릿 사용을 강제적으로 비활성화합니다. 프로그램이 컨트롤러 애플릿을 열려고 하면 즉시 닫힙니다. - + Check for updates 업데이트 확인 - + Whether or not to check for updates upon startup. 시작 시 업데이트를 확인할지 여부. - + Enable Gamemode 게임 모드 활성화 - + Force X11 as Graphics Backend X11을 그래픽 백엔드로 강제 설정 - + Custom frontend 사용자 정의 프론트엔드 - + Real applet 실제 애플릿 - + Never 안 함 - + On Load 로드 시 - + Always 항상 - + CPU CPU - + GPU GPU - + CPU Asynchronous 비동기 CPU - + Uncompressed (Best quality) 비압축(최고 품질) - + BC1 (Low quality) BC1(저품질) - + BC3 (Medium quality) BC3(중간 품질) - - + + Auto 자동 - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative 소극적 - + Aggressive 적극적 - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM(어셈블리 셰이더, NVIDIA 전용) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V(실험적, AMD/Mesa 전용) - + Null Null - + Fast 고속 - - - + + + Accurate 정확 - - - + + + Default 기본값 - + Unsafe (fast) 불안전(빠름) - + Safe (stable) 안전(안정적) - + Immediate 즉시 - + Balanced 균형 - + Strict 염격 - + Unsafe 불안전 - + Paranoid (disables most optimizations) 편집증적(대부분의 최적화를 비활성화함) - + Debugging 디버깅 - + Dynarmic 동적 - + NCE NCE - + Borderless Windowed 테두리 없는 창 - + Exclusive Fullscreen 독점 전체 화면 - + No Video Output 비디오 출력 없음 - + CPU Video Decoding CPU 비디오 디코딩 - + GPU Video Decoding (Default) GPU 비디오 디코딩(기본값) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [실험적] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [실험적] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [실험적] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [실험적] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [실험적] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 최단입점 - + Bilinear 쌍선형 - + Bicubic 쌍입방 - + Gaussian 가우시안 - + Lanczos 란초스 - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area 영역 - + MMPX MMPX - + Zero-Tangent 제로탄젠트 - + B-Spline B-스플라인 - + Mitchell 미첼 - + Spline-1 스플라인-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None 없음 - + FXAA FXAA - + SMAA SMAA - + Default (16:9) 기본(16:9) - + Force 4:3 강제 4:3 - + Force 21:9 강제 21:9 - + Force 16:10 강제 16:10 - + Stretch to Window 화면 늘리기 - + Automatic 자동 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 일본어(日本語) - + American English 미국식 영어 - + French (français) 프랑스어(français) - + German (Deutsch) 독일어(Deutsch) - + Italian (italiano) 이탈리아어(italiano) - + Spanish (español) 스페인어(español) - + Chinese 중국어 - + Korean (한국어) 한국어(Korean) - + Dutch (Nederlands) 네덜란드어(Nederlands) - + Portuguese (português) 포르투갈어(português) - + Russian (Русский) 러시아어(Русский) - + Taiwanese 대만어 - + British English 영국식 영어 - + Canadian French 캐나다 프랑스어 - + Latin American Spanish 라틴아메리카 스페인어 - + Simplified Chinese 중국어 간체 - + Traditional Chinese (正體中文) 중국어 번체(正體中文) - + Brazilian Portuguese (português do Brasil) 브라질 포르투갈어(português do Brasil) - + Polish (polska) 폴란드어(polska) - + Thai (แบบไทย) 태국어(แบบไทย) - - + + Japan 일본 - + USA 미국 - + Europe 유럽 - + Australia 호주 - + China 중국 - + Korea 대한민국 - + Taiwan 대만 - + Auto (%1) Auto select time zone 자동(%1) - + Default (%1) Default time zone 기본(%1) - + CET CET - + CST6CDT CST6CDT - + Cuba 쿠바 - + EET EET - + Egypt 이집트 - + Eire 아일랜드 - + EST EST - + EST5EDT EST5EDT - + GB 영국 - + GB-Eire 영국-아일랜드 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 그리니치 - + Hongkong 홍콩 - + HST HST - + Iceland 아이슬란드 - + Iran 이란 - + Israel 이스라엘 - + Jamaica 자메이카 - + Kwajalein 콰잘레인 - + Libya 리비아 - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo 나바호 - + NZ 뉴질랜드 - + NZ-CHAT 뉴질랜드-채텀 - + Poland 폴란드 - + Portugal 포르투갈 - + PRC 중국 - + PST8PDT PST8PDT - + ROC 대만 - + ROK 대한민국 - + Singapore 싱가포르 - + Turkey 터키 - + UCT UCT - + Universal 세계 - + UTC UTC - + W-SU 모스크바 - + WET WET - + Zulu Zulu - + Mono 모노 - + Stereo 스테레오 - + Surround 서라운드 - + 4GB DRAM (Default) 4GB DRAM(기본값) - + 6GB DRAM (Unsafe) 6GB DRAM(불안전) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM(불안전) - + 12GB DRAM (Unsafe) 12GB DRAM(불안전) - + Docked 독 모드 - + Handheld 휴대 모드 - - + + Normal 보통 - - + + Boost 부스트 - - + + Overclock 오버클럭 - + Always ask (Default) 항상 묻기(기본값) - + Only if game specifies not to stop 게임에서 멈추지 말라고 명시한 경우에만 - + Never ask 절대 묻지 않음 - + Very Small (16 MB) 아주 작은 크기(16 MB) - + Small (32 MB) 작은 크기(32 MB) - + Normal (128 MB) 보통 크기(128 MB) - + Large (256 MB) 큰 크기(256 MB) - + Very Large (512 MB) 아주 큰 크기(512 MB) - + Very Low (4 MB) 매우 낮은 크기(4 MB) - + Low (8 MB) 낮은 크기(8 MB) - + Normal (16 MB) 보통 크기(16 MB) - + Medium (32 MB) 중간 크기(32 MB) - + High (64 MB) 높은 크기(64 MB) - + Very Low (32) 매우 낮은 크기(32) - + Low (64) 낮은 크기(64) - + Normal (128) 보통 크기(128) - + Medium (256) 보통(256) - + High (512) 빠름(512) - + Disabled 비활성화됨 - + ExtendedDynamicState 1 확장된 동적 상태 1 - + ExtendedDynamicState 2 확장된 동적 상태 2 - + ExtendedDynamicState 3 확장된 동적 상태 3 - + Tree View 트리 보기 - + Grid View 격자 보기 @@ -3284,33 +3294,38 @@ Would you like to delete the old save data? 배경색: - + % FSR/SGSR sharpening percentage (e.g. 50%) % - + + Configure Effects... + + + + Off 끔 - + VSync Off 수직 동기화 끔 - + Recommended 권장 - + On 켬 - + VSync On 수직 동기화 켬 @@ -4936,102 +4951,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -7049,7 +7079,7 @@ Debug Message: - + &Pause 일시중지(&P) @@ -7200,7 +7230,7 @@ Debug Message: - + &Start 시작(&S) @@ -7211,7 +7241,7 @@ Debug Message: - + R&ecord 기록(&e) @@ -7302,7 +7332,7 @@ Debug Message: - + None 없음 @@ -7328,728 +7358,743 @@ Debug Message: 캐러셀 보기(&C) - + Small (32x32) 작은 크기(32x32) - + Standard (64x64) 기본 크기(64x64) - + Large (128x128) 큰 크기(128x128) - + Full Size (256x256) 전체 크기(256x256) - + Broken Vulkan Installation Detected 손상된 Vulkan 설치가 발견됨 - + Vulkan initialization failed during boot. 부팅 중 Vulkan 초기화에 실패했습니다. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping 게임 실행 중 - + Loading Web Applet... 웹 애플릿을 불러오는 중... - - + + Disable Web Applet 웹 애플릿 비활성화 - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) 웹 애플릿을 비활성화하면 예기치 않은 동작이 발생할 수 있으며 슈퍼 마리오 3D 컬렉션에서만 사용해야 합니다. 웹 애플릿을 비활성화하겠습니까? (디버그 설정에서 다시 활성화할 수 있습니다.) - + The amount of shaders currently being built 현재 구축 중인 셰이더 수 - + The current selected resolution scaling multiplier. 현재 선택된 해상도 조정 배율입니다. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. 현재 에뮬레이션 속도입니다. 100%보다 높거나 낮은 값은 에뮬레이션이 스위치보다 빠르거나 느리게 실행되고 있음을 나타냅니다. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. 현재 게임이 표시하는 초당 프레임 수입니다. 이 값은 게임 및 장면에 따라 다릅니다. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. 프레임 제한이나 수직 동기화를 제외하고 스위치 프레임을 에뮬레이션하는 데 걸리는 시간입니다. 최고 속도 에뮬레이션의 경우 최대 16.67 밀리초입니다. - + Unmute 음소거 해제 - + Mute 음소거 - + Reset Volume 볼륨 재설정 - + + Configure Effects... + + + + &Clear Recent Files 최근 파일 지우기(&C) - + &Continue 재개(&C) - + Warning: Outdated Game Format 경고: 구식 게임 형식입니다 - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. 현재 이 게임에 대해 구형 형식인 분해된 ROM 디렉터리 형식을 사용하고 있습니다. 이 형식은 NCA, NAX, XCI 또는 NSP와 같은 다른 형식으로 대체되었습니다. 분해된 ROM 디렉터리에는 아이콘, 메타데이터 및 업데이트 지원 기능이 없습니다.<br>Eden에서 지원하는 다양한 스위치 형식에 대한 자세한 내용은 사용자 설명서를 참조해 주세요. 이 메시지는 다시 표시되지 않습니다. - - + + Error while loading ROM! ROM 불러오는 중 오류 발생! - + The ROM format is not supported. 해당 ROM 형식은 지원되지 않습니다. - + An error occurred initializing the video core. 비디오 코어 초기화 중 오류가 발생했습니다. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. ROM 불러오는 중 오류 발생! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>파일을 다시 덤프하거나 디스코드/Stoat에서 도움을 요청해 주세요. - + An unknown error occurred. Please see the log for more details. 알 수 없는 오류가 발생했습니다. 자세한 내용은 로그를 참조해 주세요. - - + + (64-bit) (64비트) - - + + (32-bit) (32비트) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... 소프트웨어 닫는 중... - + Save Data 저장 데이터 - + Mod Data 모드 데이터 - + Error Opening %1 Folder %1 폴더 여는 중 오류 발생 - - + + Folder does not exist! 폴더가 존재하지 않습니다! - + Remove Installed Game Contents? 설치된 게임 콘텐츠를 제거하겠습니까? - + Remove Installed Game Update? 설치된 게임 업데이트를 제거하겠습니까? - + Remove Installed Game DLC? 설치된 게임 DLC를 제거하겠습니까? - + Remove Entry 항목 제거 - + Delete OpenGL Transferable Shader Cache? OpenGL 이동 가능한 셰이더 캐시를 삭제하겠습니까? - + Delete Vulkan Transferable Shader Cache? Vulkan 이동 가능한 셰이더 캐시를 삭제하겠습니까? - + Delete All Transferable Shader Caches? 이동 가능한 셰이더 캐시를 모두 삭제하겠습니까? - + Remove Custom Game Configuration? 사용자 지정 게임 구성을 제거하겠습니까? - + Remove Cache Storage? 캐시 저장소를 제거하겠습니까? - + Remove File 파일 제거 - + Remove Play Time Data 플레이 시간 데이터 제거 - + Reset play time? 플레이 시간을 재설정하겠습니까? - - + + RomFS Extraction Failed! RomFS 추출 실패! - + There was an error copying the RomFS files or the user cancelled the operation. RomFS 파일을 복사하는 중에 오류가 발생했거나 사용자가 작업을 취소했습니다. - + Full 전체 - + Skeleton 뼈대 - + Select RomFS Dump Mode RomFS 덤프 모드 선택 - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. RomFS 덤프 방식을 선택해 주세요. 전체를 선택하면 모든 파일이 새 디렉터리로 복사되고, 뼈대를 선택하면 디렉터리 구조만 생성됩니다. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root %1 위치에 RomFS를 추출할 수 있는 여유 공간이 부족합니다. 공간을 확보하거나 에뮬레이션 > 구성 > 시스템 > 파일 시스템 > 덤프 경로에서 다른 덤프 디렉터리를 선택해 주세요. - + Extracting RomFS... RomFS 추출 중... - - + + Cancel 취소 - + RomFS Extraction Succeeded! RomFS 추출 성공! - + The operation completed successfully. 작업이 성공적으로 완료되었습니다. - + Error Opening %1 %1을(를) 여는 중 오류 발생 - + Select Directory 디렉터리 선택 - + Properties 속성 - + The game properties could not be loaded. 게임 속성을 불러올 수 없습니다. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. 스위치 실행 파일(%1);;모든 파일(*.*) - + Load File 파일 불러오기 - + Open Extracted ROM Directory 추출된 ROM 디렉터리 열기 - + Invalid Directory Selected 유효하지 않은 디렉터리 선택됨 - + The directory you have selected does not contain a 'main' file. 선택한 디렉터리에는 'main' 파일이 없습니다. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) 설치 가능한 스위치 파일(*.nca, *.nsp, *.xci);;닌텐도 콘텐츠 아카이브(*.nca);;닌텐도 제출 패키지(*.nsp);;NX 카트리지 이미지(*.xci) - + Install Files 파일 설치 - + %n file(s) remaining %n개 파일 남음 - + Installing file "%1"... "%1" 파일 설치 중... - - + + Install Results 설치 결과 - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. 잠재적인 충돌을 방지하기 위해 저희는 사용자가 기본 게임을 NAND에 설치하는 것은 권장하지 않습니다. 이 기능은 업데이트 및 DLC 설치에만 사용해 주세요. - + %n file(s) were newly installed %n개 파일이 새로 설치됨 - + %n file(s) were overwritten %n개 파일이 덮어쓰기됨 - + %n file(s) failed to install %n개 파일 설치 실패 - + System Application 시스템 애플리케이션 - + System Archive 시스템 아카이브 - + System Application Update 시스템 애플리케이션 업데이트 - + Firmware Package (Type A) 펌웨어 패키지(A타입) - + Firmware Package (Type B) 펌웨어 패키지(B타입) - + Game 게임 - + Game Update 게임 업데이트 - + Game DLC 게임 DLC - + Delta Title 델타 타이틀 - + Select NCA Install Type... NCA 설치 유형 선택... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) 이 NCA를 설치할 타이틀 유형을 선택해 주세요: (대부분의 경우 기본값인 '게임'을 선택하면 됩니다.) - + Failed to Install 설치 실패 - + The title type you selected for the NCA is invalid. NCA에 대해 선택한 타이틀 유형이 유효하지 않습니다. - + File not found 파일을 찾을 수 없음 - + File "%1" not found "%1" 파일을 찾을 수 없음 - + OK 확인 - + Function Disabled 기능 비활성화됨 - + Compatibility list reporting is currently disabled. Check back later! 호환성 목록 보고 옵션이 현재 비활성화되어 있습니다. 나중에 다시 확인해 주세요! - + Error opening URL URL 여는 중 오류 발생 - + Unable to open the URL "%1". "%1" URL을 열 수 없습니다. - + TAS Recording TAS 녹화 - + Overwrite file of player 1? 플레이어 1의 파일을 덮어쓰겠습니까? - + Invalid config detected 무효한 구성이 발견됨 - + Handheld controller can't be used on docked mode. Pro controller will be selected. 휴대 모드 컨트롤러는 독 모드에서 사용할 수 없습니다. Pro 컨트롤러로 선택됩니다. - - + + Amiibo Amiibo - - + + The current amiibo has been removed 현재 amiibo가 제거됨 - + Error 오류 - - + + The current game is not looking for amiibos 현재 게임은 amiibo를 찾고 있지 않습니다 - + Amiibo File (%1);; All Files (*.*) Amiibo 파일(%1);; 모든 파일(*.*) - + Load Amiibo Amiibo 불러오기 - + Error loading Amiibo data Amiibo 데이터 불러오는 중 오류 발생 - + The selected file is not a valid amiibo 선택한 파일은 유효한 amiibo가 아닙니다 - + The selected file is already on use 선택한 파일은 이미 사용 중입니다 - + An unknown error occurred 알 수 없는 오류 발생 - + No firmware available 사용 가능한 펌웨어 없음 - + Firmware Corrupted 펌웨어 손상됨 - + Unknown applet 알 수 없는 애플릿 - + Applet doesn't map to a known value. 애플릿이 알려진 값에 매핑되지 않습니다. - + Record not found 기록을 찾을 수 없음 - + Applet not found. Please reinstall firmware. 애플릿을 찾을 수 없습니다. 펌웨어를 다시 설치해 주세요. - + Capture Screenshot 스크린샷 캡처 - + PNG Image (*.png) PNG 이미지(*.png) - + TAS state: Running %1/%2 TAS 상태: %1/%2 실행 중 - + TAS state: Recording %1 TAS 상태: %1 녹화 중 - + TAS state: Idle %1/%2 TAS 상태: %1/%2 유휴 - + TAS State: Invalid TAS 상태: 무효 - + &Stop Running 실행 중지(&S) - + Stop R&ecording 녹화 중지(&e) - + Building: %n shader(s) 구축 중: %n개 셰이더 - + Scale: %1x %1 is the resolution scaling factor 크기: %1x - + Speed: %1% / %2% 속도: %1% / %2% - + Speed: %1% 속도: %1% - + Game: %1 FPS 게임: %1 FPS - + Frame: %1 ms 프레임: %1 밀리초 - + NO AA AA 없음 - + + NO FX + + + + + FX + + + + VOLUME: MUTE 볼륨: 음소거 - + VOLUME: %1% Volume percentage (e.g. 50%) 볼륨: %1% - + Derivation Components Missing 파생 구성 요소 누락 - + Decryption keys are missing. Install them now? 복호화 키가 없습니다. 지금 설치하겠습니까? - + Wayland Detected! Wayland 발견됨! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8060,74 +8105,74 @@ Would you like to force it for future launches? 향후 출시를 위해 Wayland 사용을 강제하겠습니까? - + Use X11 X11 사용 - + Continue with Wayland Wayland와 계속 - + Don't show again 다시 보지 않기 - + Restart Required 재시작이 필요함 - + Restart Eden to apply the X11 backend. X11 백엔드를 적용하려면 Eden을 다시 시작하세요. - + Slow 저속 - + Turbo 터보 - + Unlocked 제한 해제 - + Select RomFS Dump Target RomFS 덤프 대상 선택 - + Please select which RomFS you would like to dump. 덤프할 RomFS를 선택하세요. - + Are you sure you want to close Eden? 정말 Eden을 닫겠습니까? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. 정말 에뮬레이션을 중지하겠습니까? 저장되지 않은 진행 상황은 모두 손실됩니다. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/nb.ts b/dist/languages/nb.ts index 5b5d8d6ba4..0965db5041 100644 --- a/dist/languages/nb.ts +++ b/dist/languages/nb.ts @@ -571,70 +571,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Fullskjermmodus: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: Bildeforhold: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: NVDEC-emulering: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -643,55 +653,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: VSync-modus: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -699,79 +709,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Aktiver asynkron presentasjon (kun Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) Tving maksikal klokkehastighet (kun Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Kjører arbeid i bakgrunnen mens den venter på grafikkommandoer for å forhindre at GPU-en senker klokkehastigheten. - + Anisotropic Filtering: Anisotropisk filtrering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: GPU-modus: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: DMA-nøyaktighet: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -781,1327 +791,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Bruk Vulkan-rørledningsbuffer - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Aktiver Reaktiv Tømming - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback Synkroniser med bildefrekvensen for videoavspilling - + Run the game at normal speed during video playback, even when the framerate is unlocked. Kjør spillet i normal hastighet under videoavspilling, selv når bildefrekvensen er låst opp. - + Barrier feedback loops Tilbakekoblingssløyfer for barrierer - + Improves rendering of transparency effects in specific games. Forbedrer gjengivelsen av transparenseffekter i spesifikke spill. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG-frø - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Enhetsnavn - + The name of the console. Konsollens navn. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Selvvalgt RTC-dato: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Språk: - + This option can be overridden when region setting is auto-select - + Region: Region: - + The region of the console. Konsollens region. - + Time Zone: Tidssone: - + The time zone of the console. Konsollens tidssone. - + Sound Output Mode: Lydutdatamodus: - + Console Mode: Konsollmodus: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Bekreft før stopping av emulering - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Gjem mus under inaktivitet - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Deaktiver kontroller-appleten - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates Se etter oppdateringer - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never Aldri - + On Load - + Always Alltid - + CPU CPU - + GPU Skjermkort - + CPU Asynchronous - + Uncompressed (Best quality) Ukomprimert (Best kvalitet) - + BC1 (Low quality) BC1 (Lav kvalitet) - + BC3 (Medium quality) BC3 (Middels kvalitet) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (eksperimentelt, kun AMD/Mesa) - + Null Null - + Fast Rask - - - + + + Accurate Nøyaktig - - - + + + Default Standard - + Unsafe (fast) Utrygg (raskt) - + Safe (stable) Trygg (stabil) - + Immediate - + Balanced Balansert - + Strict - + Unsafe Utrygt - + Paranoid (disables most optimizations) Paranoid (deaktiverer de fleste optimaliseringer) - + Debugging - + Dynarmic - + NCE NCE - + Borderless Windowed Rammeløst vindu - + Exclusive Fullscreen Eksklusiv fullskjerm - + No Video Output Ingen videoutdata - + CPU Video Decoding CPU-videodekoding - + GPU Video Decoding (Default) GPU-videodekoding (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0,25× (180p/270p) [EKSPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5× (360p/540p) [EKSPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75× (540p/810p) [EKSPERIMENTELL] - + 1X (720p/1080p) 1× (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1,25× (900p/1350p) [EKSPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1,5× (1080p/1620p) [EKSPERIMENTELL] - + 2X (1440p/2160p) 2× (1440p/2160p) - + 3X (2160p/3240p) 3× (2160p/3240p) - + 4X (2880p/4320p) 4× (2880p/4320p) - + 5X (3600p/5400p) 5× (3600p/5400p) - + 6X (4320p/6480p) 6× (4320p/6480p) - + 7X (5040p/7560p) 7× (5040p/7560p) - + 8X (5760p/8640p) 8× (5760p/8640p) - + Nearest Neighbor Nærmeste nabo - + Bilinear Bilineær - + Bicubic Bikubisk - + Gaussian Gaussisk - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Område - + MMPX MMPX - + Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tving 4:3 - + Force 21:9 Tving 21:9 - + Force 16:10 Tving 16:10 - + Stretch to Window Strekk til vinduet - + Automatic Automatisk - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japansk (日本語) - + American English Amerikansk engelsk - + French (français) Fransk (français) - + German (Deutsch) Tysk (Deutsch) - + Italian (italiano) Italiensk (italiano) - + Spanish (español) Spansk (español) - + Chinese Kinesisk - + Korean (한국어) Koreansk (한국어) - + Dutch (Nederlands) Nederlandsk (Nederlands) - + Portuguese (português) Portugisisk (português) - + Russian (Русский) Russisk (Русский) - + Taiwanese Taiwansk - + British English Britisk engelsk - + Canadian French Kanadisk fransk - + Latin American Spanish Latinamerikansk spansk - + Simplified Chinese Forenklet kinesisk - + Traditional Chinese (正體中文) Tradisjonell kinesisk (正體中文) - + Brazilian Portuguese (português do Brasil) Brasiliansk portugisisk (português do Brasil) - + Polish (polska) Polsk (polska) - + Thai (แบบไทย) Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australia - + China Folkerepublikken Kina - + Korea Korea - + Taiwan Taiwan (Republikken Kina) - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standard (%1) - + CET Sentraleuropeisk tid - + CST6CDT CST6CDT - + Cuba Cuba - + EET Østeuropeisk tid - + Egypt Egypt - + Eire Republikken Irland - + EST EST - + EST5EDT EST5EDT - + GB Storbritannia - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC Folkerepublikken Kina - + PST8PDT PST8PDT - + ROC Taiwan (Republikken Kina) - + ROK Sør-Korea - + Singapore Singapore - + Turkey Tyrkia - + UCT UCT - + Universal Universalt - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (Standard) - + 6GB DRAM (Unsafe) 6 GB DRAM (Utrygt) - + 8GB DRAM 8 GB DRAM - + 10GB DRAM (Unsafe) 10 GB DRAM (Utrygt) - + 12GB DRAM (Unsafe) 12 GB DRAM (Utrygt) - + Docked I dokking - + Handheld Håndholdt - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Spør alltid (Standard) - + Only if game specifies not to stop - + Never ask Aldri spør - + Very Small (16 MB) Veldig liten (16 MB) - + Small (32 MB) Liten (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Stor (256 MB) - + Very Large (512 MB) Veldig stor (512 MB) - + Very Low (4 MB) Veldig lav (4 MB) - + Low (8 MB) Lav (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Middels (32 MB) - + High (64 MB) Høy (64 MB) - + Very Low (32) Svært lav (32) - + Low (64) Lav (64) - + Normal (128) Normal (128) - + Medium (256) Middels (256) - + High (512) Høy (512) - + Disabled Skrudd av - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3201,33 +3211,38 @@ Would you like to delete the old save data? Bakgrunnsfarge: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Av - + VSync Off VSync Av - + Recommended Anbefalt - + On På - + VSync On VSync På @@ -4849,102 +4864,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6958,7 +6988,7 @@ Debug Message: - + &Pause &Pause @@ -7109,7 +7139,7 @@ Debug Message: - + &Start &Start @@ -7120,7 +7150,7 @@ Debug Message: - + R&ecord T&a opp @@ -7211,7 +7241,7 @@ Debug Message: - + None Ingen @@ -7237,722 +7267,737 @@ Debug Message: - + Small (32x32) Liten (32x32) - + Standard (64x64) Standard (64x64) - + Large (128x128) Stor (128x128) - + Full Size (256x256) Full størrelse (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Kjører et spill - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute Slå på lyd - + Mute Demp - + Reset Volume Tilbakestill volum - + + Configure Effects... + + + + &Clear Recent Files &Tøm nylige filer - + &Continue &Fortsett - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... Lukker programvare ... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! Mappen finnes ikke! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File Fjern fil - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full Full - + Skeleton Skjelett - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... Utvinner RomFS... - - + + Cancel Avbryt - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory Velg mappe - + Properties Egenskaper - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... Installerer filen «%1» ... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application Systemapp - + System Archive Systemarkiv - + System Application Update - + Firmware Package (Type A) Fastvarepakke (Type A) - + Firmware Package (Type B) Fastvarepakke (Type B) - + Game Spill - + Game Update Spilloppdatering - + Game DLC Spill-DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found Filen ble ikke funnet - + File "%1" not found - + OK OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL Feil under åpning av URL - + Unable to open the URL "%1". - + TAS Recording TAS-opptak - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo amiibo - - + + The current amiibo has been removed - + Error Feil - - + + The current game is not looking for amiibos Det nåværende spillet ser ikke etter amiiboer - + Amiibo File (%1);; All Files (*.*) amiibo-fil (%1);; Alle filer (*.*) - + Load Amiibo Last inn amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available Ingen fastvare tilgjengelig - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot Ta skjermklipp - + PNG Image (*.png) PNG-bilde (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor Skala: %1x - + Speed: %1% / %2% Hastighet: %1% / %2% - + Speed: %1% Hastighet: %1% - + Game: %1 FPS Spill: %1 FPS - + Frame: %1 ms Ramme: %1 ms - + NO AA INGEN AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE VOLUM: DEMP - + VOLUME: %1% Volume percentage (e.g. 50%) VOLUM: %1% - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7960,74 +8005,74 @@ Would you like to force it for future launches? - + Use X11 Bruk X11 - + Continue with Wayland - + Don't show again Ikke vis igjen - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow Treg - + Turbo Turbo - + Unlocked Ubegrenset - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/nl.ts b/dist/languages/nl.ts index 3e2831b876..6a6f9b21b3 100644 --- a/dist/languages/nl.ts +++ b/dist/languages/nl.ts @@ -578,70 +578,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Volledig scherm modus: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: Aspect Ratio: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: NVDEC-emulatie: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: ASTC Decodeer Methode: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -650,55 +660,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: VSync-modus: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -706,79 +716,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Schakel asynchrone presentatie in (alleen Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) Forceer maximale klokken (alleen Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Werkt op de achtergrond terwijl er wordt gewacht op grafische opdrachten om te voorkomen dat de GPU zijn kloksnelheid verlaagt. - + Anisotropic Filtering: Anisotrope Filtering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -788,1327 +798,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Gebruik Vulkan-pijplijn-cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Schakel Reactive Flushing In - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Apparaatnaam - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Aangepaste RTC Datum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Taal: - + This option can be overridden when region setting is auto-select - + Region: Regio: - + The region of the console. - + Time Zone: Tijdzone: - + The time zone of the console. - + Sound Output Mode: Geluidsuitvoermodus: - + Console Mode: Console Modus: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Bevestig voordat u de emulatie stopt - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Verberg muis wanneer inactief - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Controller-applet uitschakelen - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) BC1 (Lage Kwaliteit) - + BC3 (Medium quality) BC3 (Gemiddelde kwaliteit) - - + + Auto Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Accuraat - - - + + + Default Standaard - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe Onveilig - + Paranoid (disables most optimizations) Paranoid (schakelt de meeste optimalisaties uit) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Randloos Venster - + Exclusive Fullscreen Exclusief Volledig Scherm - + No Video Output Geen Video-uitvoer - + CPU Video Decoding CPU Videodecodering - + GPU Video Decoding (Default) GPU Videodecodering (Standaard) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTEEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTEEL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Geen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standaart (16:9) - + Force 4:3 Forceer 4:3 - + Force 21:9 Forceer 21:9 - + Force 16:10 Forceer 16:10 - + Stretch to Window Uitrekken naar Venster - + Automatic Automatisch - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japans (日本語) - + American English Amerikaans-Engels - + French (français) Frans (Français) - + German (Deutsch) Duits (Deutsch) - + Italian (italiano) Italiaans (italiano) - + Spanish (español) Spaans (Español) - + Chinese Chinees - + Korean (한국어) Koreaans (한국어) - + Dutch (Nederlands) Nederlands (Nederlands) - + Portuguese (português) Portugees (português) - + Russian (Русский) Russisch (Русский) - + Taiwanese Taiwanese - + British English Brits-Engels - + Canadian French Canadees-Frans - + Latin American Spanish Latijns-Amerikaans Spaans - + Simplified Chinese Vereenvoudigd Chinees - + Traditional Chinese (正體中文) Traditioneel Chinees (正體中文) - + Brazilian Portuguese (português do Brasil) Braziliaans-Portugees (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australië - + China China - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standaard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egypte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Ijsland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libië - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turkije - + UCT UCT - + Universal Universeel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3196,33 +3206,38 @@ Would you like to delete the old save data? Achtergrondkleur: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Uit - + VSync Off VSync Uit - + Recommended Aanbevolen - + On Aan - + VSync On VSync Aan @@ -4844,102 +4859,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6954,7 +6984,7 @@ Debug Message: - + &Pause &Onderbreken @@ -7105,7 +7135,7 @@ Debug Message: - + &Start &Start @@ -7116,7 +7146,7 @@ Debug Message: - + R&ecord Opnemen @@ -7207,7 +7237,7 @@ Debug Message: - + None @@ -7233,722 +7263,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7956,74 +8001,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/pl.ts b/dist/languages/pl.ts index 14da962f1a..6ab9b388b4 100644 --- a/dist/languages/pl.ts +++ b/dist/languages/pl.ts @@ -592,12 +592,22 @@ SMAA oferuje najlepszą jakość. FXAA może zapewnić stabilniejszy obraz w niższych rozdzielczościach. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Tryb Pełnoekranowy: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -606,12 +616,12 @@ Tryb bez ramek zapewnia najlepszą zgodność z klawiaturą ekranową wymaganą Pełny ekran wyłączny może oferować lepszą wydajność i lepsze wsparcie FreeSync/G-Sync. - + Aspect Ratio: Format obrazu: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -620,35 +630,35 @@ Większość gier obsługuje wyłącznie 16:9, więc inne proporcje wymagają mo Kontroluje także proporcje przechwytywanych zrzutów ekranu. - + Use persistent pipeline cache Używaj trwałej pamięci podręcznej (cache) potoków - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Pozwala zapisywać shadery w pamięci masowej, aby przyspieszyć ładowanie przy kolejnych uruchomieniach gry. Wyłączanie tej opcji jest przeznaczone do debugowania. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: Emulacja NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -657,12 +667,12 @@ Dekodowanie może być wykonywane przez CPU albo GPU, albo może być całkowici W większości przypadków najlepszą wydajność zapewnia dekodowanie na GPU. - + ASTC Decoding Method: Metoda dekodowania ASTC: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -674,12 +684,12 @@ GPU: użyj shaderów obliczeniowych GPU do dekodowania tekstur ASTC (zalecane). CPU asynchronicznie: użyj CPU do dekodowania na żądanie. Eliminuje zacięcia podczas dekodowania ASTC, ale może powodować artefakty. - + ASTC Recompression Method: Metoda rekompresji ASTC: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -687,44 +697,44 @@ BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, BC1/BC3: format pośredni zostanie ponownie skompresowany do BC1 lub BC3 — oszczędza VRAM kosztem jakości obrazu. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: Tryb wykorzystania VRAM: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Określa, czy emulator ma oszczędzać pamięć, czy maksymalnie wykorzystywać dostępną pamięć wideo dla wydajności. Tryb agresywny może pogorszyć działanie innych aplikacji, np. oprogramowania do nagrywania. - + Skip CPU Inner Invalidation Pomiń wewnętrzne unieważnienie procesora CPU - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Pomija niektóre unieważnienia pamięci podręcznej po stronie CPU podczas aktualizacji pamięci, zmniejszając użycie CPU i poprawiając jego wydajność. Może powodować błędy lub awarie w niektórych grach. - + VSync Mode: Tryb synchronizacji pionowej: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -735,12 +745,12 @@ Mailbox może mieć niższe opóźnienia niż FIFO i nie powoduje tearingu, ale Immediate (bez synchronizacji) wyświetla wszystko, co jest dostępne, i może powodować tearing. - + Sync Memory Operations Synchronizuj operacje pamięci - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -748,68 +758,68 @@ Unreal Engine 4 games often see the most significant changes thereof. Gry z Unreal Engine 4 mogą być najbardziej dotknięte. - + Enable asynchronous presentation (Vulkan only) Włącz asynchroniczną prezentację (tylko Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Nieznacznie poprawia wydajność, przenosząc prezentację na oddzielny wątek CPU. - + Force maximum clocks (Vulkan only) Wymuś maksymalne zegary (Tylko Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Uruchamia pracę w tle podczas oczekiwania na komendy graficzne aby GPU nie obniżało taktowania. - + Anisotropic Filtering: Filtrowanie anizotropowe: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Steruje jakością renderowania tekstur pod ostrymi kątami. Na większości GPU bezpieczną wartością jest 16x. - + GPU Mode: Tryb GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Dokładność DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -819,100 +829,100 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation Włącz asynchroniczną kompilację shaderów - + May reduce shader stutter. Może zmniejszyć zacięcia spowodowane kompilacją shaderów. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Użyj pamięci podręcznej strumienia dla Vulkana - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Włącza specyficzną dla producenta GPU pamięć podręczną potoków. Ta opcja może znacząco skrócić czas ładowania shaderów w przypadkach, gdy sterownik Vulkan nie przechowuje wewnętrznie plików pamięci podręcznej potoków. - + Enable Compute Pipelines (Intel Vulkan Only) Włącz potoki obliczeniowe (tylko Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -921,192 +931,192 @@ To ustawienie istnieje wyłącznie dla sterowników Intela i może spowodować b Na wszystkich pozostałych sterownikach potoki obliczeniowe są zawsze włączone. - + Enable Reactive Flushing Włącz reaktywne opróżnianie buforów - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Używa opróżniania reaktywnego zamiast predykcyjnego, co umożliwia dokładniejsze synchronizowanie pamięci. - + Sync to framerate of video playback Synchronizuj do liczby klatek odtwarzanego wideo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Uruchamiaj grę z normalną prędkością podczas odtwarzania wideo, nawet przy odblokowanej liczbie klatek na sekundę. - + Barrier feedback loops Pętle sprzężenia zwrotnego barier - + Improves rendering of transparency effects in specific games. Poprawia renderowanie efektów przezroczystości w niektórych grach. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State Rozszerzony stan dynamiczny - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Kontroluje liczbę funkcji, które mogą być używane w Extended Dynamic State. Wyższe poziomy pozwalają na użycie większej liczby funkcji i mogą zwiększyć wydajność, ale mogą powodować dodatkowe problemy z grafiką. - + Vertex Input Dynamic State Dynamiczny stan wejścia wierzchołków - + Enables vertex input dynamic state feature for better quality and performance. Włącza funkcję dynamicznego stanu wejścia wierzchołków, poprawiając jakość i wydajność. - + Sample Shading Cieniowanie próbkowe - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Pozwala wykonywać shader fragmentów dla każdej próbki we fragmencie wielokrotnie próbkowanym zamiast raz dla każdego fragmentu. Poprawia jakość grafiki kosztem wydajności. Wyższe wartości poprawiają jakość, ale obniżają wydajność. - + RNG Seed Ziarno RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Ustala ziarno generatora liczb losowych. Głównie używane do speedrunów. - + Device Name Nazwa urządzenia - + The name of the console. The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Własna data RTC - + This option allows to change the clock of the console. Can be used to manipulate time in games. Ta opcja pozwala zmienić zegar konsoli. Może służyć do manipulowania czasem w grach. - + The number of seconds from the current unix time Liczba sekund od bieżącego czasu Unix - + Language: Język: - + This option can be overridden when region setting is auto-select Ta opcja może zostać nadpisana, gdy ustawienie regionu to automatyczny wybór. - + Region: Region: - + The region of the console. Region konsoli. - + Time Zone: Strefa czasowa: - + The time zone of the console. Strefa czasowa konsoli. - + Sound Output Mode: Tryb wyjścia dźwięku: - + Console Mode: Tryb konsoli - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1115,1042 +1125,1042 @@ W zależności od tego ustawienia gry zmienią swoją rozdzielczość, szczegó Ustawienie na Handheld może poprawić wydajność na słabszych komputerach. - + Prompt for user profile on boot Pytaj o profil użytkownika przy uruchomieniu. - + Useful if multiple people use the same PC. Przydatne, gdy z tego samego PC korzysta wiele osób. - + Pause when not in focus Wstrzymuj, gdy okno nie jest aktywne - + Pauses emulation when focusing on other windows. Wstrzymuje emulację po przełączeniu na inne okna. - + Confirm before stopping emulation Potwierdzaj przed zatrzymaniem emulacji - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Nadpisuje monity z prośbą o potwierdzenie zatrzymania emulacji. Włączenie powoduje pominięcie takich monitów i bezpośrednie wyjście z emulacji. - + Hide mouse on inactivity Ukryj mysz przy braku aktywności - + Hides the mouse after 2.5s of inactivity. Ukrywa kursor po 2,5 s bezczynności. - + Disable controller applet Wyłącz aplet kontrolera - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Wymusza wyłączenie użycia apletu kontrolera w oprogramowaniu uruchamianym w emulacji. Jeśli emulowane oprogramowanie próbuje otworzyć aplet kontrolera, jest on natychmiast zamykany. - + Check for updates Sprawdź aktualizacje - + Whether or not to check for updates upon startup. Czy sprawdzać aktualizacje przy uruchomieniu. - + Enable Gamemode Włącz Tryb gry - + Force X11 as Graphics Backend Wymuś X11 jako backend grafiki - + Custom frontend Niestandardowy frontend - + Real applet Prawdziwy aplet - + Never Nigdy - + On Load Przy wczytywaniu - + Always Zawsze - + CPU CPU - + GPU GPU - + CPU Asynchronous Asynchroniczne CPU - + Uncompressed (Best quality) Brak (najlepsza jakość) - + BC1 (Low quality) BC1 (niska jakość) - + BC3 (Medium quality) BC3 (średnia jakość) - - + + Auto Automatyczny - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Konserwatywny - + Aggressive Agresywny - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast Szybkie - - - + + + Accurate Dokładny - - - + + + Default Domyślny - + Unsafe (fast) Niezalecane (szybkie) - + Safe (stable) Bezpieczne (stabilne) - + Immediate - + Balanced Zrównoważony - + Strict - + Unsafe Niebezpieczny - + Paranoid (disables most optimizations) Paranoiczne (wyłącza większość optymalizacji) - + Debugging Debugowanie - + Dynarmic Dynamiczny - + NCE NCE - + Borderless Windowed W oknie (Bezramkowy) - + Exclusive Fullscreen Exclusive Fullscreen - + No Video Output Brak wyjścia wideo - + CPU Video Decoding Dekodowanie Wideo przez CPU - + GPU Video Decoding (Default) Dekodowanie Wideo przez GPU (Domyślne) - + 0.25X (180p/270p) [EXPERIMENTAL] 0,25x (180p/270p) [EKSPERYMENTALNE] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5x (360p/540p) [EKSPERYMENTALNE] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EKSPERYMENTALNE] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EKSPERYMENTALNE] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [Ekperymentalnie] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Najbliższy sąsiadujący - + Bilinear Bilinearny - + Bicubic Bikubiczny - + Gaussian Kulisty - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Obszar - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Żadna (wyłączony) - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Domyślne (16:9) - + Force 4:3 Wymuś 4:3 - + Force 21:9 Wymuś 21:9 - + Force 16:10 Wymuś 16:10 - + Stretch to Window Rozciągnij do Okna - + Automatic Automatyczne - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japoński (日本語) - + American English Angielski Amerykański - + French (français) Francuski (français) - + German (Deutsch) Niemiecki (Niemcy) - + Italian (italiano) Włoski (italiano) - + Spanish (español) Hiszpański (español) - + Chinese Chiński - + Korean (한국어) Koreański (한국어) - + Dutch (Nederlands) Duński (Holandia) - + Portuguese (português) Portugalski (português) - + Russian (Русский) Rosyjski (Русский) - + Taiwanese Tajwański - + British English Angielski Brytyjski - + Canadian French Fancuski (Kanada) - + Latin American Spanish Hiszpański (Latin American) - + Simplified Chinese Chiński (Uproszczony) - + Traditional Chinese (正體中文) Chiński tradycyjny (正體中文) - + Brazilian Portuguese (português do Brasil) Portugalski (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonia - + USA USA - + Europe Europa - + Australia Australia - + China Chiny - + Korea Korea - + Taiwan Tajwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Domyślne (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipt - + Eire Irlandia - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Iran - + Israel Izrael - + Jamaica Jamajka - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polska - + Portugal Portugalia - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turcja - + UCT UCT - + Universal Uniwersalny - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Domyślne) - + 6GB DRAM (Unsafe) 6GB DRAM (NIebezpieczne) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (NIebezpieczne) - + 12GB DRAM (Unsafe) 12GB DRAM (NIebezpieczne) - + Docked Zadokowany - + Handheld Przenośnie - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Zawsze pytaj (Domyślne) - + Only if game specifies not to stop Tylko jeśli gra określa, aby nie zatrzymywać - + Never ask Nie pytaj więcej - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Średnie (256) - + High (512) Wysokie (512) - + Disabled Wyłączone - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3260,33 +3270,38 @@ Czy chcesz usunąć stare dane zapisu? Kolor tła - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Wyłączone - + VSync Off VSync wyłączony - + Recommended Zalecane - + On Włączone - + VSync On VSync aktywny @@ -4908,102 +4923,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -7021,7 +7051,7 @@ Komunikat debugowania: - + &Pause &Pauza @@ -7172,7 +7202,7 @@ Komunikat debugowania: - + &Start &Start @@ -7183,7 +7213,7 @@ Komunikat debugowania: - + R&ecord &Nagraj @@ -7274,7 +7304,7 @@ Komunikat debugowania: - + None Żadna (wyłączony) @@ -7300,401 +7330,406 @@ Komunikat debugowania: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected Wykryto uszkodzoną instalację Vulkan - + Vulkan initialization failed during boot. Inicjalizacja Vulkana nie powiodła się podczas uruchamiania. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Gra uruchomiona - + Loading Web Applet... Ładowanie apletu internetowego... - - + + Disable Web Applet Wyłącz Aplet sieciowy - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Wyłączenie apletu sieciowego może prowadzić do nieprzewidywalnego działania i powinno być używane wyłącznie z Super Mario 3D All-Stars. Na pewno chcesz wyłączyć aplet sieciowy? (Tę opcję można ponownie włączyć w ustawieniach debugowania). - + The amount of shaders currently being built Liczba shaderów aktualnie budowanych - + The current selected resolution scaling multiplier. Aktualnie wybrany mnożnik skalowania rozdzielczości. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Bieżąca prędkość emulacji. Wartości wyższe lub niższe niż 100% oznaczają, że emulacja działa odpowiednio szybciej lub wolniej niż na Switchu. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Liczba klatek na sekundę aktualnie wyświetlanych przez grę. Wartość ta zależy od gry oraz od konkretnej sceny. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Czas potrzebny na emulację jednej klatki Switcha, bez uwzględniania ogranicznika klatek i synchronizacji pionowej. Dla emulacji z pełną prędkością powinno to być maksymalnie 16,67 ms. - + Unmute Wyłącz wyciszenie - + Mute Wycisz - + Reset Volume Zresetuj głośność - + + Configure Effects... + + + + &Clear Recent Files &Usuń Ostatnie pliki - + &Continue &Kontynuuj - + Warning: Outdated Game Format Ostrzeżenie: Nieaktualny format gry - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Używasz dla tej gry formatu katalogu zdekonstruowanego ROM-u, który jest przestarzały i został zastąpiony innymi formatami, takimi jak NCA, NAX, XCI czy NSP. Katalogi takich ROM-ów nie zawierają ikon, metadanych ani nie obsługują aktualizacji.<br>Aby uzyskać wyjaśnienie dotyczące różnych formatów Switcha obsługiwanych przez Eden, zajrzyj do naszego podręcznika użytkownika. Ten komunikat nie zostanie wyświetlony ponownie. - - + + Error while loading ROM! Błąd podczas wczytywania ROMu! - + The ROM format is not supported. Ten format ROMu nie jest wspierany. - + An error occurred initializing the video core. Wystąpił błąd podczas inicjowania rdzenia wideo. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Błąd podczas wczytywania ROMu! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Proszę ponownie zrzucić pliki lub poprosić o pomoc na Discordzie/Stoat. - + An unknown error occurred. Please see the log for more details. Wystąpił nieznany błąd. Więcej informacji można znaleźć w pliku log. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Zamykanie aplikacji... - + Save Data Zapis danych - + Mod Data Dane modów - + Error Opening %1 Folder Błąd podczas otwierania folderu %1 - - + + Folder does not exist! Folder nie istnieje! - + Remove Installed Game Contents? Usunąć zainstalowaną zawartość gry? - + Remove Installed Game Update? Usunąć zainstalowaną aktualizację gry? - + Remove Installed Game DLC? Usunąć zainstalowane DLC gry? - + Remove Entry Usuń wpis - + Delete OpenGL Transferable Shader Cache? Usunąć przenośną pamięć podręczną shaderów OpenGL? - + Delete Vulkan Transferable Shader Cache? Usunąć przenośną pamięć podręczną shaderów Vulkan? - + Delete All Transferable Shader Caches? Usunąć wszystkie przenośne pamięci podręczne shaderów? - + Remove Custom Game Configuration? Usunąć niestandardową konfigurację gry? - + Remove Cache Storage? Usunąć pamięć podręczną? - + Remove File Usuń plik - + Remove Play Time Data Usuń dane czasu gry - + Reset play time? Zresetować czas gry? - - + + RomFS Extraction Failed! Wyodrębnianie RomFS nie powiodło się! - + There was an error copying the RomFS files or the user cancelled the operation. Wystąpił błąd podczas kopiowania plików RomFS lub użytkownik przerwał operację. - + Full Pełny - + Skeleton Szkielet - + Select RomFS Dump Mode Wybierz tryb zrzutu RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Wybierz sposób wykonania zrzutu RomFS. <br>Tryb „Pełny” skopiuje wszystkie pliki do nowego katalogu, <br>natomiast „Szkielet” utworzy jedynie strukturę katalogów. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root Nie ma wystarczająco miejsca w %1 aby wyodrębnić RomFS. Zwolnij trochę miejsca, albo zmień ścieżkę zrzutu RomFs w Emulacja > Konfiguruj > System > System Plików > Źródło Zrzutu - + Extracting RomFS... Wypakowywanie RomFS... - - + + Cancel Anuluj - + RomFS Extraction Succeeded! Wypakowanie RomFS zakończone pomyślnie! - + The operation completed successfully. Operacja zakończona pomyślnie. - + Error Opening %1 Błąd podczas otwierania %1 - + Select Directory Wybierz folder - + Properties Właściwości - + The game properties could not be loaded. Właściwości tej gry nie mogły zostać załadowane. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Plik wykonywalny Switcha (%1);;Wszystkie pliki (*.*) - + Load File Załaduj plik - + Open Extracted ROM Directory Otwórz folder wypakowanego ROMu - + Invalid Directory Selected Wybrano niewłaściwy folder - + The directory you have selected does not contain a 'main' file. Wybrany folder nie zawiera 'głównego' pliku. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Instalacyjne pliki Switch'a (*.nca *.nsp *.xci);;Archiwum zawartości Nintendo (*.nca);;Pakiet poddany Nintendo (*.nsp);;Obraz z kartridża NX (*.xci) - + Install Files Zainstaluj pliki - + %n file(s) remaining Pozostał %n plikPozostały %n plikiPozostało %n plikówPozostało %n plików - + Installing file "%1"... Instalowanie pliku "%1"... - - + + Install Results Wynik instalacji - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Aby uniknąć ewentualnych konfliktów, odradzamy użytkownikom instalowanie gier na NAND. Proszę, używaj tej funkcji tylko do instalowania łatek i DLC. - + %n file(s) were newly installed %n plik został nowo zainstalowany @@ -7704,7 +7739,7 @@ Proszę, używaj tej funkcji tylko do instalowania łatek i DLC. - + %n file(s) were overwritten %n plik został nadpisany @@ -7714,7 +7749,7 @@ Proszę, używaj tej funkcji tylko do instalowania łatek i DLC. - + %n file(s) failed to install Nie udało się zainstalować %n pliku @@ -7724,314 +7759,324 @@ Proszę, używaj tej funkcji tylko do instalowania łatek i DLC. - + System Application Aplikacja systemowa - + System Archive Archiwum systemu - + System Application Update Aktualizacja aplikacji systemowej - + Firmware Package (Type A) Paczka systemowa (Typ A) - + Firmware Package (Type B) Paczka systemowa (Typ B) - + Game Gra - + Game Update Aktualizacja gry - + Game DLC Dodatek do gry - + Delta Title Tytuł Delta - + Select NCA Install Type... Wybierz typ instalacji NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Wybierz typ tytułu, do którego chcesz zainstalować ten NCA, jako: (W większości przypadków domyślna "gra" jest w porządku.) - + Failed to Install Instalacja nieudana - + The title type you selected for the NCA is invalid. Typ tytułu wybrany dla NCA jest nieprawidłowy. - + File not found Nie znaleziono pliku - + File "%1" not found Nie znaleziono pliku "%1" - + OK OK - + Function Disabled Funkcja wyłączona - + Compatibility list reporting is currently disabled. Check back later! Zgłaszanie do listy kompatybilności jest obecnie wyłączone. Spróbuj ponownie później! - + Error opening URL Błąd otwierania adresu URL - + Unable to open the URL "%1". Nie można otworzyć adresu URL "%1". - + TAS Recording Nagrywanie TAS - + Overwrite file of player 1? Nadpisać plik gracza 1? - + Invalid config detected Wykryto nieprawidłową konfigurację - + Handheld controller can't be used on docked mode. Pro controller will be selected. Nie można używać kontrolera handheld w trybie zadokowanym. Zostanie wybrany kontroler Pro. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Amiibo zostało "zdjęte" - + Error Błąd - - + + The current game is not looking for amiibos Ta gra nie szuka amiibo - + Amiibo File (%1);; All Files (*.*) Plik Amiibo (%1);;Wszyskie pliki (*.*) - + Load Amiibo Zamontuj Amiibo - + Error loading Amiibo data Błąd podczas ładowania danych Amiibo - + The selected file is not a valid amiibo Wybrany plik nie jest poprawnym amiibo - + The selected file is already on use Wybrany plik jest już w użyciu - + An unknown error occurred Wystąpił nieznany błąd - + No firmware available Brak dostępnego firmware'u - + Firmware Corrupted Uszkodzony Firmware - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot Zrób zrzut ekranu - + PNG Image (*.png) Obrazek PNG (*.png) - + TAS state: Running %1/%2 Status TAS: Działa %1%2 - + TAS state: Recording %1 Status TAS: Nagrywa %1 - + TAS state: Idle %1/%2 Status TAS: Bezczynny %1%2 - + TAS State: Invalid Status TAS: Niepoprawny - + &Stop Running &Wyłącz - + Stop R&ecording Przestań &Nagrywać - + Building: %n shader(s) Budowanie: %n shaderBudowanie: %n shaderyBudowanie: %n shaderówBudowanie: %n shaderów - + Scale: %1x %1 is the resolution scaling factor Skala: %1x - + Speed: %1% / %2% Prędkość: %1% / %2% - + Speed: %1% Prędkość: %1% - + Game: %1 FPS Gra: %1 FPS - + Frame: %1 ms Klatka: %1 ms - + NO AA BEZ AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE Głośność: Wyciszony - + VOLUME: %1% Volume percentage (e.g. 50%) Głośność: %1% - + Derivation Components Missing Brak komponentów wyprowadzania - + Decryption keys are missing. Install them now? - + Wayland Detected! Wykryto Waylanda! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8041,74 +8086,74 @@ Zaleca się zamiast tego używać X11. Czy chcesz wymusić jego użycie przy przyszłych uruchomieniach? - + Use X11 Używaj X11 - + Continue with Wayland Kontynuuj z Waylandem - + Don't show again Nie pokazuj ponownie - + Restart Required Wymagane ponowne uruchomienie - + Restart Eden to apply the X11 backend. Uruchom ponownie Edena, aby zastosować backend X11. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target Wybierz cel zrzutu RomFS - + Please select which RomFS you would like to dump. Proszę wybrać RomFS, jakie chcesz zrzucić. - + Are you sure you want to close Eden? Czy na pewno chcesz zamknąć Edena? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Czy na pewno chcesz zatrzymać emulację? Wszystkie niezapisane postępy zostaną utracone. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/pt_BR.ts b/dist/languages/pt_BR.ts index 36b5181730..7113730221 100644 --- a/dist/languages/pt_BR.ts +++ b/dist/languages/pt_BR.ts @@ -590,12 +590,22 @@ SMAA oferece a melhor qualidade. FXAA pode produzir uma imagem mais estável em resoluções mais baixas. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Tela Cheia - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -604,12 +614,12 @@ Sem borda oferece a melhor compatibilidade com o teclado na tela que alguns jogo Tela cheia exclusiva pode oferecer melhor desempenho e melhor suporte a Freesync/Gsync. - + Aspect Ratio: Proporção do Ecrã: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -618,36 +628,36 @@ A maioria dos jogos suporta apenas 16:9, sendo necessárias modificações para Também controla a proporção das capturas de tela. - + Use persistent pipeline cache Usar cache persistente de pipeline - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Permite guardar os shaders para carregar os jogos nas execuções seguintes. Desabiltar essa opção só serve para propósitos de depuração. - + Use asynchronous GPU emulation Usar emulação assíncrona de GPU - + Uses an extra CPU thread for rendering. This option should always remain enabled. Usa uma thread de CPU extra para renderização. Esta opção deve estar sempre habilitada. - + NVDEC emulation: Emulação NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -656,12 +666,12 @@ Tanto a CPU quanto a GPU podem ser utilizadas para decodificação, ou não deco Na maioria dos casos, a decodificação pela GPU fornece um melhor desempenho. - + ASTC Decoding Method: Método de Decodificação ASTC: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -674,56 +684,56 @@ CPU Assíncrona: Usa a CPU para decodificar texturas ASTC sob demanda. Elimina t mas pode apresentar artefatos visuais. - + ASTC Recompression Method: Método de Recompressão ASTC: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. A maioria das GPUs não suporta texturas ASTC e precisa descompactá-las para um formato intermediário: RGBA8.BC1/BC3: O formato intermediário será recomprimido para BC1 ou BC3, economizando VRAM mas degradando a qualidade da imagem. - + Frame Pacing Mode (Vulkan only) Modo de Ritmo de Quadros (apenas Vulkan) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. Controle como o emulador gerencia o ritmo de quadros para reduzir travamentos (engasgos) e deixar a taxa de quadros mais suave e consistente. - + VRAM Usage Mode: Modo de Uso da VRAM: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Define se o emulador deve priorizar a economia de memória ou fazer o uso máximo da memória de vídeo disponível para melhorar o desempenho. O modo agressivo pode impactar a performance de outros aplicativos, como softwares de gravação. - + Skip CPU Inner Invalidation Ignorar invalidação interna da CPU - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Ignora certas invalidações de cache durante atualizações de memória, reduzindo o uso da CPU e melhorando a latência. Isso pode causar travamentos leves. - + VSync Mode: Modo de Sincronização vertical: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -734,12 +744,12 @@ Mailbox pode ter menor latência que FIFO e não apresenta cortes, mas pode perd Immediate (sem sincronização) exibe o que estiver disponível e pode apresentar cortes. - + Sync Memory Operations Sincronizar operações de memória - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -748,68 +758,68 @@ Esta opção corrige problemas em diversos jogos, mas pode reduzir o desempenho. Jogos baseados na Unreal Engine 4 costumam apresentar as mudanças mais significativas. - + Enable asynchronous presentation (Vulkan only) Ativar apresentação assíncrona (Somente Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Melhora ligeiramente o desempenho ao mover a apresentação para uma thread de CPU separada. - + Force maximum clocks (Vulkan only) Forçar clock máximo (somente Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Executa trabalho em segundo plano aguardando pelos comandos gráficos para evitar a GPU de reduzir seu clock. - + Anisotropic Filtering: Filtro Anisotrópico: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Controla a qualidade da renderização de texturas em ângulos oblíquos. Seguro definir em 16x na maioria das GPUs. - + GPU Mode: Modo da GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Precisão do DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -819,55 +829,55 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation Ativar compilação assíncrona de shaders - + May reduce shader stutter. Pode reduzir travamentos de shaders. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Acelera a decodificação de texturas 3D BCn usando processamento da GPU. Desative se ocorrerem travamentos ou falhas gráficas. - + GPU Unswizzle Max Texture Size Tamanho Máximo de Textura para GPU Unswizzle - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -876,48 +886,48 @@ A GPU é mais rápida para texturas médias e grandes, mas a CPU pode ser mais e Ajuste para encontrar o equilíbrio entre aceleração da GPU e sobrecarga da CPU. - + GPU Unswizzle Stream Size Tamanho do Fluxo de GPU Unswizzle - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Define a quantidade máxima de dados de textura (em MiB) processados por quadro. Valores mais altos podem reduzir travamentos durante o carregamento de texturas, mas podem afetar a consistência dos quadros. - + GPU Unswizzle Chunk Size Tamanho do Bloco de GPU Unswizzle - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Determina o número de fatias de profundidade processadas em uma única execução. Aumentar esse valor pode melhorar o desempenho em GPUs avançadas, mas pode causar TDR ou tempo limite do driver em hardwares mais fracos. - + Use Vulkan pipeline cache Utilizar cache de pipeline do Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Habilita o cache de pipeline da fabricante da GPU. Esta opção pode melhorar o tempo de carregamento de shaders significantemente em casos onde o driver Vulkan não armazena o cache de pipeline internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Habilitar Pipeline de Computação (Somente Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -926,194 +936,194 @@ Esta configuração existe apenas para drivers proprietários da Intel e pode ca Pipelines de computação estão sempre habilitados em outros drivers. - + Enable Reactive Flushing Habilitar Flushing Reativo - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Usa flushing reativo ao invés de flushing preditivo, permitindo mais precisão na sincronização da memória. - + Sync to framerate of video playback Sincronizar com o framerate da reprodução de vídeo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Executa o jogo na velocidade normal durante a reprodução de vídeo, mesmo se o framerate estiver desbloqueado. - + Barrier feedback loops Ciclos de feedback de barreira - + Improves rendering of transparency effects in specific games. Melhora a renderização de efeitos de transparência em jogos específicos. - + Enable buffer history Ativar histórico de buffer - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Permite acesso a estados anteriores do buffer. Esta opção pode melhorar a qualidade de renderização e a consistência de desempenho em alguns jogos. - + Fix bloom effects Corrigir efeitos de bloom - + Removes bloom in Burnout. Remove o bloom no Burnout. - + Enable Legacy Rescale Pass Ativar Passagem de Redimensionamento Legada - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Pode corrigir problemas de redimensionamento em alguns jogos, baseando-se no comportamento da implementação anterior. Solução legada que corrige artefatos de linha em GPUs AMD e Intel, e cintilação de texturas cinzas em GPUs Nvidia no Luigi's Mansion 3. - + Extended Dynamic State Estado Dinâmico Estendido - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Controla o número de recursos que podem ser usados no Estado Dinâmico Estendido. Estados mais altos permitem mais recursos e podem aumentar o desempenho, mas também podem causar problemas gráficos adicionais. - + Vertex Input Dynamic State Estado Dinâmico de Entrada de Vértices - + Enables vertex input dynamic state feature for better quality and performance. Ativa o recurso de estado dinâmico de entrada de vértices para melhor qualidade e desempenho. - + Sample Shading Sombreamento por Amostragem - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permite que o shader de fragmento seja processado por cada amostra em fragmentos multiamostrados, em vez de uma única vez por fragmento. Melhora a qualidade gráfica ao custo de desempenho. Valores mais altos aumentam a qualidade, mas reduzem a performance. - + RNG Seed Semente de RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Controla a semente do gerador de números aleatórios. Usado principalmente em speedruns. - + Device Name Nome do Dispositivo - + The name of the console. O nome do console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Data personalizada do RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Esta opção permite alterar o relógio do console. Pode ser usada para manipular o tempo nos jogos. - + The number of seconds from the current unix time Número de segundos a partir do tempo Unix atual - + Language: Idioma: - + This option can be overridden when region setting is auto-select Esta opção pode ser substituída quando a configuração de região estiver em seleção automática - + Region: Região: - + The region of the console. A região do console. - + Time Zone: Fuso Horário: - + The time zone of the console. O fuso horário do console. - + Sound Output Mode: Modo de saída de som - + Console Mode: Modo Console: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1122,1042 +1132,1042 @@ Os jogos ajustarão resolução, detalhes e controladores suportados conforme es Definir como Portátil pode ajudar a melhorar o desempenho em sistemas mais fracos. - + Prompt for user profile on boot Solicitar perfil de usuário na inicialização - + Useful if multiple people use the same PC. Útil se várias pessoas usam o mesmo PC. - + Pause when not in focus Pausar quando não estiver em foco - + Pauses emulation when focusing on other windows. Pausa a emulação ao focar em outras janelas. - + Confirm before stopping emulation Confirmar antes de parar a emulação - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Substitui as confirmações ao parar a emulação. Ao ativar, ignora esses avisos e encerra diretamente a emulação. - + Hide mouse on inactivity Esconder rato quando inactivo. - + Hides the mouse after 2.5s of inactivity. Oculta o mouse após 2,5s de inatividade. - + Disable controller applet Desabilitar applet de controle - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Desativa forçadamente o uso do applet de controle em programas emulados. Quando um programa tenta abrir o applet, ele é imediatamente fechado. - + Check for updates Verificar atualizações - + Whether or not to check for updates upon startup. Define se deve verificar atualizações na inicialização. - + Enable Gamemode Habilitar Gamemode - + Force X11 as Graphics Backend Forçar X11 como backend gráfico - + Custom frontend Frontend customizado - + Real applet Applet real - + Never Nunca - + On Load Ao carregar - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Assíncrona - + Uncompressed (Best quality) Descompactado (Melhor Qualidade) - + BC1 (Low quality) BC1 (Baixa qualidade) - + BC3 (Medium quality) BC3 (Média qualidade) - - + + Auto Automático - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservador - + Aggressive Agressivo - + Vulkan Vulcano - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Shaders em Assembly, apenas NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, apenas AMD/Mesa) - + Null Nenhum - + Fast Rápido - - - + + + Accurate Preciso - - - + + + Default Padrão - + Unsafe (fast) Inseguro (rápido) - + Safe (stable) Seguro (estável) - + Immediate - + Balanced Balanceado - + Strict - + Unsafe Inseguro - + Paranoid (disables most optimizations) Paranoia (desativa a maioria das otimizações) - + Debugging Depuração - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Janela sem bordas - + Exclusive Fullscreen Tela cheia exclusiva - + No Video Output Sem saída de vídeo - + CPU Video Decoding Decodificação de vídeo pela CPU - + GPU Video Decoding (Default) Decodificação de vídeo pela GPU (Padrão) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Vizinho mais próximo - + Bilinear Bilinear - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Área - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nenhum - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Padrão (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 Forçar 16:10 - + Stretch to Window Esticar à Janela - + Automatic Automático - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonês (日本語) - + American English Inglês Americano - + French (français) Francês (français) - + German (Deutsch) Alemão (Deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Espanhol (español) - + Chinese Chinês - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandês (Nederlands) - + Portuguese (português) Português (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanês - + British English Inglês Britânico - + Canadian French Francês Canadense - + Latin American Spanish Espanhol Latino-Americano - + Simplified Chinese Chinês Simplificado - + Traditional Chinese (正體中文) Chinês Tradicional (正 體 中文) - + Brazilian Portuguese (português do Brasil) Português do Brasil (Brazilian Portuguese) - + Polish (polska) Polonês (polska) - + Thai (แบบไทย) Tailandês (แบบไทย) - - + + Japan Japão - + USA EUA - + Europe Europa - + Australia Austrália - + China China - + Korea Coreia - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Padrão (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egito - + Eire Irlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islândia - + Iran Irã - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polônia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estéreo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Padrão) - + 6GB DRAM (Unsafe) 6GB DRAM (Não seguro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Inseguro) - + 12GB DRAM (Unsafe) 12GB DRAM (Inseguro) - + Docked Ancorado - + Handheld Portátil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Sempre perguntar (Padrão) - + Only if game specifies not to stop Somente se o jogo especificar para não parar - + Never ask Nunca perguntar - + Very Small (16 MB) Muito Pequeno (16 MB) - + Small (32 MB) Pequeno (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Muito Grande (512 MB) - + Very Low (4 MB) Muito Baixo (4 MB) - + Low (8 MB) Baixo (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Médio (32 MB) - + High (64 MB) Alto (64 MB) - + Very Low (32) Muito Baixo (32) - + Low (64) Baixo (64) - + Normal (128) Normal (128) - + Medium (256) Médio (256) - + High (512) Alto (512) - + Disabled Desativado - + ExtendedDynamicState 1 Estado Dinâmico Estendido 1 - + ExtendedDynamicState 2 Estado Dinâmico Estendido 2 - + ExtendedDynamicState 3 Estado Dinâmico Estendido 3 - + Tree View Visualização em Árvore - + Grid View Visualização em Grade @@ -3262,33 +3272,38 @@ Gostaria de deletar o salvamento antigo? Cor de fundo: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Desligado - + VSync Off Sincronização vertical desligada - + Recommended Recomendado - + On Ligado - + VSync On Sincronização vertical ligada @@ -4915,102 +4930,117 @@ Uma vez deletado, esses NÃO podem ser recuperados. Você tem 100% de certeza qu - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -7028,7 +7058,7 @@ Mensagem de Depuração: - + &Pause &Pausa @@ -7179,7 +7209,7 @@ Mensagem de Depuração: - + &Start &Começar @@ -7190,7 +7220,7 @@ Mensagem de Depuração: - + R&ecord G&ravar @@ -7281,7 +7311,7 @@ Mensagem de Depuração: - + None Nenhum @@ -7307,723 +7337,738 @@ Mensagem de Depuração: - + Small (32x32) Pequeno (32x32) - + Standard (64x64) Padrão (64x64) - + Large (128x128) Grande (128x128) - + Full Size (256x256) Tamanho completo (256x256) - + Broken Vulkan Installation Detected Detectada Instalação Defeituosa do Vulkan - + Vulkan initialization failed during boot. Inicialização do Vulkan falhou durante o boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Rodando um jogo - + Loading Web Applet... Carregando Applet Web... - - + + Disable Web Applet Desativar Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Desativar o Applet Web pode problemas indefinidos e deverá apenas ser usando com o Super Mario 3D All-Stars. Você tem certeza que quer desativar o Applet Web? (Isso pode ser reativado nas Configurações de Depuração.) - + The amount of shaders currently being built A Quantidade total de Shaders está sendo atualmente construída - + The current selected resolution scaling multiplier. A atual multiplicação de escala de resolução selecionada. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Velocidade atual da emulação. Valores altos ou mais baixo que 100% indicam que o emulador está rodando mais rápido ou mais lento que um Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Quantos quadros por segundo o jogo está mostrando atualmente. Isto varia de jogo para jogo e de cena a cena. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory Selecionar Diretório - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory Abrir o Diretório da ROM extraída - + Invalid Directory Selected Diretório selecionado inválido - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo Amiibo - - + + The current amiibo has been removed O Amiibo atual foi removido - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8031,74 +8076,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/pt_PT.ts b/dist/languages/pt_PT.ts index beef4e100c..e637008132 100644 --- a/dist/languages/pt_PT.ts +++ b/dist/languages/pt_PT.ts @@ -573,12 +573,22 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Tela Cheia - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -587,47 +597,47 @@ Sem borda oferece a melhor compatibilidade com o teclado na tela que alguns jogo Tela cheia exclusiva pode oferecer melhor performance e melhor suporte a Freesync/Gsync. - + Aspect Ratio: Proporção do Ecrã: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Permite guardar os shaders para carregar os jogos nas execuções seguintes. Desabiltar essa opção só serve para propósitos de depuração. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: Emulação NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -636,12 +646,12 @@ Tanto a CPU quanto a GPU podem ser utilizadas para decodificação, ou não deco Na maioria dos casos, a decodificação pela GPU fornece uma melhor performance. - + ASTC Decoding Method: Método de Decodificação ASTC: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -650,55 +660,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: Método de Recompressão ASTC: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: Modo de Uso da VRAM: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: Modo de Sincronização vertical: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -706,79 +716,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Ativar apresentação assíncrona (Somente Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Melhora ligeiramente o desempenho ao mover a apresentação para uma thread de CPU separada. - + Force maximum clocks (Vulkan only) Forçar clock máximo (somente Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Executa trabalho em segundo plano aguardando pelos comandos gráficos para evitar a GPU de reduzir seu clock. - + Anisotropic Filtering: Filtro Anisotrópico: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -788,1328 +798,1328 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Utilizar cache de pipeline do Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Habilita o cache de pipeline da fabricante da GPU. Esta opção pode melhorar o tempo de carregamento de shaders significantemente em casos onde o driver Vulkan não armazena o cache de pipeline internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Habilitar Pipeline de Computação (Somente Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Habilitar Flushing Reativo - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Usa flushing reativo ao invés de flushing preditivo, permitindo mais precisão na sincronização da memória. - + Sync to framerate of video playback Sincronizar com o framerate da reprodução de vídeo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Executa o jogo na velocidade normal durante a reprodução de vídeo, mesmo se o framerate estiver desbloqueado. - + Barrier feedback loops Ciclos de feedback de barreira - + Improves rendering of transparency effects in specific games. Melhora a renderização de efeitos de transparência em jogos específicos. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Semente de RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Nome do Dispositivo - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Data personalizada do RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Idioma: - + This option can be overridden when region setting is auto-select - + Region: Região: - + The region of the console. - + Time Zone: Fuso Horário: - + The time zone of the console. - + Sound Output Mode: Modo de saída de som - + Console Mode: Modo Console: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Confirmar antes de parar a emulação - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Esconder rato quando inactivo. - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Desabilitar miniaplicativo de controle - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Habilitar Gamemode - + Force X11 as Graphics Backend - + Custom frontend Frontend customizado - + Real applet Miniaplicativo real - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Assíncrona - + Uncompressed (Best quality) Descompactado (Melhor Q - + BC1 (Low quality) BC1 (Baixa qualidade) - + BC3 (Medium quality) BC3 (Média qualidade) - - + + Auto Automático - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Conservador - + Aggressive Agressivo - + Vulkan Vulcano - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Nenhum (desativado) - + Fast - - - + + + Accurate Preciso - - - + + + Default Padrão - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe Inseguro - + Paranoid (disables most optimizations) Paranoia (desativa a maioria das otimizações) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Janela sem bordas - + Exclusive Fullscreen Tela cheia exclusiva - + No Video Output Sem saída de vídeo - + CPU Video Decoding Decodificação de vídeo pela CPU - + GPU Video Decoding (Default) Decodificação de vídeo pela GPU (Padrão) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Vizinho mais próximo - + Bilinear Bilinear - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nenhum - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Padrão (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 Forçar 16:10 - + Stretch to Window Esticar à Janela - + Automatic Automático - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonês (日本語) - + American English Inglês Americano - + French (français) Francês (français) - + German (Deutsch) Alemão (Deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Espanhol (español) - + Chinese Chinês - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandês (Nederlands) - + Portuguese (português) Português (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanês - + British English Inglês Britânico - + Canadian French Francês Canadense - + Latin American Spanish Espanhol Latino-Americano - + Simplified Chinese Chinês Simplificado - + Traditional Chinese (正體中文) Chinês Tradicional (正 體 中文) - + Brazilian Portuguese (português do Brasil) Português do Brasil (Brazilian Portuguese) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japão - + USA EUA - + Europe Europa - + Australia Austrália - + China China - + Korea Coreia - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Padrão (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipto - + Eire Irlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islândia - + Iran Irão - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polónia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estéreo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Padrão) - + 6GB DRAM (Unsafe) 6GB DRAM (Não seguro) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Ancorado - + Handheld Portátil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Sempre perguntar (Padrão) - + Only if game specifies not to stop Somente se o jogo especificar para não parar - + Never ask Nunca perguntar - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3201,33 +3211,38 @@ Would you like to delete the old save data? Cor de fundo: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Desligado - + VSync Off Sincronização vertical desligada - + Recommended Recomendado - + On Ligado - + VSync On Sincronização vertical ligada @@ -4849,102 +4864,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6959,7 +6989,7 @@ Debug Message: - + &Pause &Pausa @@ -7110,7 +7140,7 @@ Debug Message: - + &Start &Começar @@ -7121,7 +7151,7 @@ Debug Message: - + R&ecord G&ravar @@ -7212,7 +7242,7 @@ Debug Message: - + None @@ -7238,722 +7268,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7961,74 +8006,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/ru_RU.ts b/dist/languages/ru_RU.ts index 9488e6f43b..5d0bfe8ea0 100644 --- a/dist/languages/ru_RU.ts +++ b/dist/languages/ru_RU.ts @@ -592,12 +592,22 @@ SMAA обеспечивает лучшее качество. FXAA может давать более стабильное изображение на низком разрешении. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Полноэкранный режим: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -606,12 +616,12 @@ Exclusive fullscreen may offer better performance and better Freesync/Gsync supp Эксклюзивный полноэкранный режим может иметь лучшую производительность и лучшую поддержку Freesync/G-Sync. - + Aspect Ratio: Соотношение сторон: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -620,35 +630,35 @@ Also controls the aspect ratio of captured screenshots. Также управляет соотношением сторон скриншотов. - + Use persistent pipeline cache Использовать постоянный кэш конвейера - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Позволяет сохранять шейдеры на диск для более быстрой загрузки при последующем запуске игры. Отключение этой функции предназначено только для отладки. - + Use asynchronous GPU emulation Использовать асинхронную эмуляцию GPU - + Uses an extra CPU thread for rendering. This option should always remain enabled. Использует дополнительный поток CPU для рендеринга. Эта опция всегда должна оставаться включенной. - + NVDEC emulation: Эмуляция NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -657,12 +667,12 @@ In most cases, GPU decoding provides the best performance. В большинстве случаев декодирование с использованием ГП обеспечивает лучшую производительность. - + ASTC Decoding Method: Метод декодирования ASTC: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -674,12 +684,12 @@ GPU: использовать вычислительные шейдеры ГП Асинхронный CPU: использовать ЦП для декодирования текстур ASTC по мере необходимости. Устраняет фризы при декодировании ASTC, но может вызывать артефакты. - + ASTC Recompression Method: Метод пересжатия ASTC: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -687,44 +697,44 @@ BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, BC1/BC3: промежуточный формат будет перекодирован в BC1 или BC3, экономя видеопамять, но снижая качество изображения. - + Frame Pacing Mode (Vulkan only) Режим стабилизации кадров (только Vulkan) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. Определяет способ управления выводом кадров для уменьшения подергиваний и повышения плавности и стабильности частоты кадров. - + VRAM Usage Mode: Режим VRAM: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Определяет, должен ли эмулятор экономить память или использовать всю доступную видеопамять для повышения производительности. Агрессивный режим может негативно сказаться на производительности других приложений, например программ записи. - + Skip CPU Inner Invalidation Пропуск внутренней инвалидизации CPU - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Пропускает некоторые операции сброса кэша при обновлении памяти, снижая нагрузку на ЦП и уменьшая задержку. Может вызывать сбои в работе игр. - + VSync Mode: Режим VSync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -735,12 +745,12 @@ Mailbox может обеспечивать меньшую задержку, ч Immediate (без синхронизации) выводит все доступные кадры и может иметь разрывы. - + Sync Memory Operations Синхронизация операций памяти - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -749,56 +759,56 @@ Unreal Engine 4 games often see the most significant changes thereof. Игры на Unreal Engine 4 чаще всего демонстрируют заметные изменения. - + Enable asynchronous presentation (Vulkan only) Включить асинхронный вывод (только Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Немного повышает производительность, перенося вывод кадра в отдельный поток CPU. - + Force maximum clocks (Vulkan only) Принудительно зафиксировать максимальную тактовую частоту (только для Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Выполняет фоновые операции во время ожидания графических команд, предотвращая снижение тактовой частоты GPU. - + Anisotropic Filtering: Анизотропная фильтрация: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Управляет качеством отображения текстур под наклонными углами. На большинстве GPU безопасно использовать значение 16x. - + GPU Mode: Режим GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. Управляет режимом эмуляции ГПУ. Большинство игр нормально отображаются в режиме Быстрый, но для некоторых требуется режим Точный. Частицы обычно корректно отображаются только в режиме Точный. - + DMA Accuracy: Точность DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -807,12 +817,12 @@ Default follows the GPU Accuracy setting. По умолчанию соответствует настройке точности ГПУ. - + GPU Fence Behavior: Поведение барьеров ГПУ: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -827,56 +837,56 @@ Default follows the GPU Accuracy setting. По умолчанию соответствует настройке точности ГПУ. - + Enable GPU buffer readback Включить обратное чтение буфера ГПУ - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. Сохраняет измененные ГПУ данные путем чтения их обратно перед выгрузками. Некоторые игры требуют этого, чтобы рендерить определенные эффекты правильно. - + Enable asynchronous shader compilation Включить асинхронную компиляцию шейдеров - + May reduce shader stutter. Может уменьшить фризы, вызванные компиляцией шейдеров. - + GPU Clocks Частоты GPU - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. Заставляет игру думать, что GPU завершает свою работу быстрее, чем на самом деле, чтобы она перестала подстраиваться под частоты Switch, понижать разрешение и дальность прорисовки. - + GPU Unswizzle GPU-десвиззлинг (GPU Unswizzle) - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Ускоряет декодирование 3D-текстур BCn с использованием вычислений GPU. Отключите при возникновении сбоев или графических артефактов. - + GPU Unswizzle Max Texture Size Максимальный размер текстур для GPU-десвиззлинга - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -885,48 +895,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size Размер потока GPU-десвиззлинга - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Задает максимальный объем данных текстур (в МиБ), обрабатываемый за кадр. Более высокие значения могут уменьшить подергивания при загрузке текстур, но это может повлиять на стабильность кадров. - + GPU Unswizzle Chunk Size Размер блока GPU-десвиззлинга - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Определяет количество слоев глубины, обрабатываемых за один вызов. Увеличение этого значения может повысить пропускную способность на производительных GPU, но на слабом оборудовании способно вызвать TDR или тайм-ауты драйвера. - + Use Vulkan pipeline cache Использовать кэш конвейеров Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Включает кэш конвейеров, зависящий от производителя GPU. Эта опция может значительно ускорить загрузку шейдеров в тех случаях, когда драйвер Vulkan не сохраняет такие файлы кэша внутри себя. - + Enable Compute Pipelines (Intel Vulkan Only) Включить вычислительные конвейеры (только для Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -935,194 +945,194 @@ Compute pipelines are always enabled on all other drivers. На остальных драйверах вычислительные конвейеры всегда включены. - + Enable Reactive Flushing Включить реактивный сброс - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Использует реактивный сброс (Reactive Flushing) вместо прогнозирующего, обеспечивая более точную синхронизацию памяти. - + Sync to framerate of video playback Синхронизировать с частотой кадров видео - + Run the game at normal speed during video playback, even when the framerate is unlocked. Поддерживать нормальную скорость игры во время воспроизведения видео, даже если частота кадров разблокирована. - + Barrier feedback loops Циклы обратной связи барьеров - + Improves rendering of transparency effects in specific games. Улучшает отрисовку эффектов прозрачности в некоторых играх. - + Enable buffer history Включить историю буфера - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Предоставляет доступ к предыдущим состояниям буфера. В некоторых играх может повысить качество рендеринга и стабильность производительности. - + Fix bloom effects Исправить эффекты bloom - + Removes bloom in Burnout. Удаляет эффект bloom в игре Burnout. - + Enable Legacy Rescale Pass Включить устаревший режим масштабирования - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Может исправить проблемы масштабирования в некоторых играх, используя поведение предыдущей реализации. Это обходное решение устраняет артефакты линий на GPU AMD и Intel, а также мерцание серых текстур на GPU Nvidia в Luigis Mansion 3. - + Extended Dynamic State Расширенное динамическое состояние (Extended Dynamic State) - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Определяет количество функций, доступных в Extended Dynamic State. Более высокие значения позволяют использовать больше функций и иногда повышают производительность, но могут вызвать дополнительные графические проблемы. - + Vertex Input Dynamic State Динамическое состояние ввода вершин (Vertex Input Dynamic State) - + Enables vertex input dynamic state feature for better quality and performance. Включает функцию динамического состояния ввода вершин для улучшения качества и производительности. - + Sample Shading Множественное затенение (Sample Shading) - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Позволяет фрагментному шейдеру выполняться для каждого сэмпла в мультисемплированном фрагменте вместо одного раза. Повышает качество графики за счет снижения производительности. Более высокие значения повышают качество, но сильнее снижают производительность. - + RNG Seed Сид RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Задает начальное значение генератора случайных чисел. В основном используется для спидранов. - + Device Name Название устройства - + The name of the console. Имя консоли. - + Homebrew Args Аргументы Homebrew - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Аргументы командной строки при запуске homebrew (например, -noglsl). - + Custom RTC Date: Пользовательская RTC-дата: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Позволяет изменить системные часы консоли. Может использоваться для изменения времени в играх. - + The number of seconds from the current unix time Количество секунд от текущего UNIX-времени. - + Language: Язык: - + This option can be overridden when region setting is auto-select Эта настройка может быть переопределена при автоматическом выборе региона. - + Region: Регион: - + The region of the console. Регион консоли. - + Time Zone: Часовой пояс: - + The time zone of the console. Часовой пояс консоли. - + Sound Output Mode: Режим вывода звука: - + Console Mode: Консольный режим: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1131,1042 +1141,1042 @@ Setting to Handheld can help improve performance for low end systems. Установка в портативный режим может повысить производительность на слабых системах. - + Prompt for user profile on boot Запрашивать профиль пользователя при запуске игры - + Useful if multiple people use the same PC. Полезно, если одним ПК пользуются несколько человек. - + Pause when not in focus Приостанавливать, если окно не активно - + Pauses emulation when focusing on other windows. Приостанавливает эмуляцию при переключении на другие окна. - + Confirm before stopping emulation Запрашивать подтверждение перед остановкой эмуляции - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Убирает запросы на подтверждение остановки эмуляции. При включении этой настройки эмуляция завершается сразу, без подтверждения. - + Hide mouse on inactivity Скрывать курсор при бездействии - + Hides the mouse after 2.5s of inactivity. Скрывает курсор мыши после 2,5 секунд бездействия. - + Disable controller applet Отключить апплет контроллера - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Принудительно отключает использование апплета контроллера в эмулируемых программах. При попытке открыть апплет он сразу закрывается. - + Check for updates Проверять обновления - + Whether or not to check for updates upon startup. Проверять обновления при запуске. - + Enable Gamemode Включить режим игры - + Force X11 as Graphics Backend Принудительно использовать X11 как графический бэкенд - + Custom frontend Собственный интерфейс эмулятора - + Real applet Приложение из прошивки - + Never Никогда - + On Load При загрузке - + Always Всегда - + CPU CPU - + GPU GPU - + CPU Asynchronous Асинхронный CPU - + Uncompressed (Best quality) Без сжатия (наилучшее качество) - + BC1 (Low quality) BC1 (низкое качество) - + BC3 (Medium quality) BC3 (среднее качество) - - + + Auto Авто - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Консервативный - + Aggressive Агрессивный - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (ассемблерные шейдеры, только для NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (экспериментальный, только для AMD/Mesa) - + Null Null - + Fast Производительность - - - + + + Accurate Точность - - - + + + Default По умолчанию - + Unsafe (fast) Небезопасно (быстро) - + Safe (stable) Безопасно (стабильно) - + Immediate Мгновенный - + Balanced Баланс - + Strict Строгий - + Unsafe Небезопасно - + Paranoid (disables most optimizations) Параноик (отключает большинство оптимизаций) - + Debugging Отладка - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Безрамочный режим - + Exclusive Fullscreen Эксклюзивный полноэкранный - + No Video Output Отсутствие видеовыхода - + CPU Video Decoding Декодирование видео на CPU - + GPU Video Decoding (Default) Декодирование видео на GPU (По умолчанию) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [Экспериментально] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [Экспериментально] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [Экспериментально] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [ЭКПЕРИМЕНТАЛЬНО] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [Экспериментально] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Ближайший сосед (Nearest Neighbor) - + Bilinear Билинейный - + Bicubic Бикубический - + Gaussian По Гауссу - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX™️ Super Resolution - + Area Область (Area) - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Никакой - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Стандартное (16:9) - + Force 4:3 Принудительно 4:3 - + Force 21:9 Принудительно 21:9 - + Force 16:10 Принудительно 16:10 - + Stretch to Window Растянуть до окна - + Automatic Автоматически - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Японский (日本語) - + American English Американский английский - + French (français) Французский (français) - + German (Deutsch) Немецкий (Deutsch) - + Italian (italiano) Итальянский (italiano) - + Spanish (español) Испанский (español) - + Chinese Китайский - + Korean (한국어) Корейский (한국어) - + Dutch (Nederlands) Голландский (Nederlands) - + Portuguese (português) Португальский (português) - + Russian (Русский) Русский - + Taiwanese Тайваньский - + British English Британский английский - + Canadian French Канадский французский - + Latin American Spanish Латиноамериканский испанский - + Simplified Chinese Упрощённый китайский - + Traditional Chinese (正體中文) Традиционный китайский (正體中文) - + Brazilian Portuguese (português do Brasil) Бразильский португальский (português do Brasil) - + Polish (polska) Польский (polska) - + Thai (แบบไทย) Тайский (แบบไทย) - - + + Japan Япония - + USA США - + Europe Европа - + Australia Австралия - + China Китай - + Korea Корея - + Taiwan Тайвань - + Auto (%1) Auto select time zone Авто (%1) - + Default (%1) Default time zone По умолчанию (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Куба - + EET EET - + Egypt Египет - + Eire Эйре - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Эйре - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Гринвич - + Hongkong Гонконг - + HST HST - + Iceland Исландия - + Iran Иран - + Israel Израиль - + Jamaica Ямайка - + Kwajalein Кваджалейн - + Libya Ливия - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Навахо - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Польша - + Portugal Португалия - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Сингапур - + Turkey Турция - + UCT UCT - + Universal Универсальный - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Зулу - + Mono Моно - + Stereo Стерео - + Surround Объемный звук - + 4GB DRAM (Default) 4 ГБ ОЗУ (По умолчанию) - + 6GB DRAM (Unsafe) 6 ГБ ОЗУ (Небезопасно) - + 8GB DRAM 8 ГБ ОЗУ - + 10GB DRAM (Unsafe) 10 ГБ ОЗУ (Небезопасно) - + 12GB DRAM (Unsafe) 12 ГБ ОЗУ (Небезопасно) - + Docked В док-станции - + Handheld Портативный - - + + Normal Нормальная - - + + Boost Ускоренная - - + + Overclock Разгон - + Always ask (Default) Всегда спрашивать (По умолчанию) - + Only if game specifies not to stop Только если игра указывает не останавливать - + Never ask Никогда не спрашивать - + Very Small (16 MB) Очень маленький (16 МБ) - + Small (32 MB) Маленький (32 МБ) - + Normal (128 MB) Нормальный (128 МБ) - + Large (256 MB) Большой (256 МБ) - + Very Large (512 MB) Очень большой (512 МБ) - + Very Low (4 MB) Очень низкий (4 МБ) - + Low (8 MB) Низкий (8 МБ) - + Normal (16 MB) Нормальный (16 МБ) - + Medium (32 MB) Средний (32 МБ) - + High (64 MB) Высокий (64 МБ) - + Very Low (32) Очень низкий (32) - + Low (64) Низкий (64) - + Normal (128) Нормальный (128) - + Medium (256) Средний (256) - + High (512) Высокий (512) - + Disabled Отключено - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View Древовидный - + Grid View Сетчатый @@ -3278,33 +3288,38 @@ Would you like to delete the old save data? Цвет фона: - + % FSR/SGSR sharpening percentage (e.g. 50%) % - + + Configure Effects... + + + + Off Отключена - + VSync Off VSync Off - + Recommended Рекомендуется - + On Включена - + VSync On VSync On @@ -4932,102 +4947,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -7045,7 +7075,7 @@ Debug Message: - + &Pause &Пауза @@ -7196,7 +7226,7 @@ Debug Message: - + &Start &Запустить @@ -7207,7 +7237,7 @@ Debug Message: - + R&ecord З&апись @@ -7298,7 +7328,7 @@ Debug Message: - + None Никакой @@ -7324,400 +7354,405 @@ Debug Message: &В Виде Карусели - + Small (32x32) Маленький (32х32) - + Standard (64x64) Стандартный (64х64) - + Large (128x128) Большой (128х128) - + Full Size (256x256) Полноразмерный (256х256) - + Broken Vulkan Installation Detected Обнаружена поврежденная установка Vulkan - + Vulkan initialization failed during boot. Не удалось выполнить инициализацию Vulkan во время загрузки. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Запущена игра - + Loading Web Applet... Загрузка веб-апплета... - - + + Disable Web Applet Отключить веб-апплет - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Отключение веб-апплета может привести к неожиданному поведению и должно использоваться только, если вы хотите запустить Super Mario 3D All-Stars. Вы уверены, что хотите отключить веб-апплет? (Его можно снова включить в настройках отладки.) - + The amount of shaders currently being built Количество создаваемых шейдеров на данный момент - + The current selected resolution scaling multiplier. Текущий выбранный множитель масштабирования разрешения. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Текущая скорость эмуляции. Значения выше или ниже 100% указывают на то, что эмуляция идет быстрее или медленнее, чем на Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Количество кадров в секунду в данный момент. Значение будет различаться между играми и сценами. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Время, которое нужно для эмуляции одного кадра Switch, не принимая во внимание ограничение FPS или вертикальную синхронизацию. Для эмуляции в полной скорости значение должно быть не больше 16,67 мс. - + Unmute Включить звук - + Mute Выключить звук - + Reset Volume Сбросить громкость - + + Configure Effects... + + + + &Clear Recent Files &Очистить недавние файлы - + &Continue &Продолжить - + Warning: Outdated Game Format Предупреждение: устаревший формат игры - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Для этой игры вы используете разархивированный формат ROM'а, который является устаревшим и был заменен другими, такими как NCA, NAX, XCI или NSP. В разархивированных каталогах ROM'а отсутствуют иконки, метаданные и поддержка обновлений.<br><br>Для получения информации о различных форматах Switch, поддерживаемых Eden, ознакомьтесь с руководством пользователя. Это сообщение больше не будет отображаться. - - + + Error while loading ROM! Ошибка при загрузке ROM'а! - + The ROM format is not supported. Формат ROM'а не поддерживается. - + An error occurred initializing the video core. Произошла ошибка при инициализации видеоядра. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Ошибка при загрузке ROM'а! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Пожалуйста, пересоздайте дампы ваших файлов или обратитесь за помощью в Discord/Stoat. - + An unknown error occurred. Please see the log for more details. Произошла неизвестная ошибка. Пожалуйста, проверьте журнал для подробностей. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Закрываем программу... - + Save Data Сохранения - + Mod Data Данные модов - + Error Opening %1 Folder Ошибка при открытии папки %1 - - + + Folder does not exist! Папка не существует! - + Remove Installed Game Contents? Удалить установленное содержимое игр? - + Remove Installed Game Update? Удалить установленное обновление игры? - + Remove Installed Game DLC? Удалить установленные DLC игры? - + Remove Entry Удалить запись - + Delete OpenGL Transferable Shader Cache? Удалить переносной кэш шейдеров OpenGL? - + Delete Vulkan Transferable Shader Cache? Удалить переносной кэш шейдеров Vulkan? - + Delete All Transferable Shader Caches? Удалить весь переносной кэш шейдеров? - + Remove Custom Game Configuration? Удалить пользовательскую настройку игры? - + Remove Cache Storage? Удалить кэш-хранилище? - + Remove File Удалить файл - + Remove Play Time Data Удалить данные игрового времени - + Reset play time? Сбросить время игры? - - + + RomFS Extraction Failed! Не удалось извлечь RomFS! - + There was an error copying the RomFS files or the user cancelled the operation. Произошла ошибка при копировании файлов RomFS или пользователь отменил операцию. - + Full Полный - + Skeleton Скелет - + Select RomFS Dump Mode Выберите режим дампа RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Пожалуйста, выберите, как вы хотите выполнить дамп RomFS. <br>Полный скопирует все файлы в новую папку, в то время как <br>скелет создаст только структуру папок. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root В %1 недостаточно свободного места для извлечения RomFS. Пожалуйста, освободите место или выберите другую папку для дампа в Эмуляция > Параметры > Система > Файловая система > Корень дампа - + Extracting RomFS... Извлечение RomFS... - - + + Cancel Отмена - + RomFS Extraction Succeeded! Извлечение RomFS прошло успешно! - + The operation completed successfully. Операция выполнена успешно. - + Error Opening %1 Ошибка при открытии %1 - + Select Directory Выбрать папку - + Properties Свойства - + The game properties could not be loaded. Не удалось загрузить свойства игры. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Исполняемый файл Switch (%1);;Все файлы (*.*) - + Load File Загрузить файл - + Open Extracted ROM Directory Открыть папку извлеченного ROM'а - + Invalid Directory Selected Выбрана недопустимая папка - + The directory you have selected does not contain a 'main' file. Папка, которую вы выбрали, не содержит файла 'main'. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Устанавливаемый файл Switch (*.nca *.nsp *.xci);;Архив контента Nintendo (*.nca);;Пакет подачи Nintendo (*.nsp);;Образ картриджа NX (*.xci) - + Install Files Установить файлы - + %n file(s) remaining %n файл(ов) осталось%n файл(ов) осталось%n файл(ов) осталось%n файл(ов) осталось - + Installing file "%1"... Установка "%1"... - - + + Install Results Результаты - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Чтобы избежать возможных конфликтов, мы не рекомендуем пользователям устанавливать игры в NAND. Пожалуйста, используйте эту функцию только для установки обновлений и DLC. - + %n file(s) were newly installed %n файл(ов) были установлены недавно @@ -7727,7 +7762,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) were overwritten %n файл(ов) были перезаписаны @@ -7737,7 +7772,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) failed to install %n файл(ов) не удалось установить @@ -7747,314 +7782,324 @@ Please, only use this feature to install updates and DLC. - + System Application Системное приложение - + System Archive Системный архив - + System Application Update Обновление системного приложения - + Firmware Package (Type A) Пакет прошивки (Тип А) - + Firmware Package (Type B) Пакет прошивки (Тип Б) - + Game Игра - + Game Update Обновление игры - + Game DLC DLC игры - + Delta Title Дельта-титул - + Select NCA Install Type... Выберите тип установки NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Пожалуйста, выберите тип приложения, который вы хотите установить для этого NCA: (В большинстве случаев, подходит стандартный выбор «Игра».) - + Failed to Install Ошибка установки - + The title type you selected for the NCA is invalid. Тип приложения, который вы выбрали для NCA, недействителен. - + File not found Файл не найден - + File "%1" not found Файл "%1" не найден - + OK ОК - + Function Disabled Функция отключена - + Compatibility list reporting is currently disabled. Check back later! Отправка отчетов о совместимости временно отключена. Доступ будет восстановлен позднее! - + Error opening URL Ошибка при открытии URL - + Unable to open the URL "%1". Не удалось открыть URL: "%1". - + TAS Recording Запись TAS - + Overwrite file of player 1? Перезаписать файл игрока 1? - + Invalid config detected Обнаружена недопустимая конфигурация - + Handheld controller can't be used on docked mode. Pro controller will be selected. Портативный контроллер не может быть использован в режиме док-станции. Будет выбран контроллер Pro. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Текущий amiibo был удален - + Error Ошибка - - + + The current game is not looking for amiibos Текущая игра не ищет amiibo - + Amiibo File (%1);; All Files (*.*) Файл Amiibo (%1);; Все Файлы (*.*) - + Load Amiibo Загрузить Amiibo - + Error loading Amiibo data Ошибка загрузки данных Amiibo - + The selected file is not a valid amiibo Выбранный файл не является допустимым amiibo - + The selected file is already on use Выбранный файл уже используется - + An unknown error occurred Произошла неизвестная ошибка - + No firmware available Прошивка недоступна - + Firmware Corrupted Прошивка повреждена - + Unknown applet Неизвестный апплет - + Applet doesn't map to a known value. Апплет не соответствует ни одному известному значению. - + Record not found Запись не найдена - + Applet not found. Please reinstall firmware. Апплет не найден. Пожалуйста, переустановите прошивку. - + Capture Screenshot Сделать скриншот - + PNG Image (*.png) Изображение PNG (*.png) - + TAS state: Running %1/%2 Состояние TAS: Выполняется %1/%2 - + TAS state: Recording %1 Состояние TAS: Записывается %1 - + TAS state: Idle %1/%2 Состояние TAS: Простой %1/%2 - + TAS State: Invalid Состояние TAS: Неверное - + &Stop Running &Остановка - + Stop R&ecording &Закончить запись - + Building: %n shader(s) Компиляция %n шейдер(ов)Компиляция %n шейдер(ов)Компиляция %n шейдер(ов)Компиляция %n шейдер(ов) - + Scale: %1x %1 is the resolution scaling factor Масштаб: %1x - + Speed: %1% / %2% Скорость: %1% / %2% - + Speed: %1% Скорость: %1% - + Game: %1 FPS Игра: %1 FPS - + Frame: %1 ms Кадр: %1 мс - + NO AA БЕЗ СГЛАЖИВАНИЯ - + + NO FX + + + + + FX + + + + VOLUME: MUTE ГРОМКОСТЬ: ЗАГЛУШЕНА - + VOLUME: %1% Volume percentage (e.g. 50%) ГРОМКОСТЬ: %1% - + Derivation Components Missing Отсутствуют необходимые компоненты - + Decryption keys are missing. Install them now? Ключи дешифрования отсутствуют. Хотите установить их? - + Wayland Detected! Обнаружен Wayland! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8065,74 +8110,74 @@ Would you like to force it for future launches? Хотите включить X11 для последующих запусков? - + Use X11 Использовать X11 - + Continue with Wayland Продолжить с Wayland - + Don't show again Больше не показывать - + Restart Required Требуется перезапуск - + Restart Eden to apply the X11 backend. Перезапустите Eden, чтобы применить X11. - + Slow Замедлено - + Turbo Турбо - + Unlocked Разблокировано - + Select RomFS Dump Target Выбор цели для дампа RomFS - + Please select which RomFS you would like to dump. Выберите RomFS, который вы хотите извлечь. - + Are you sure you want to close Eden? Вы уверены, что хотите закрыть Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Вы уверены, что хотите остановить эмуляцию? Любой несохраненный прогресс будет потерян. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/sv.ts b/dist/languages/sv.ts index d916eb4d86..1b20b42158 100644 --- a/dist/languages/sv.ts +++ b/dist/languages/sv.ts @@ -594,12 +594,22 @@ SMAA erbjuder den bästa kvaliteten. FXAA kan ge en stabilare bild i lägre upplösningar. - + + Enable post-processing effects + Aktivera efterbehandlingseffekter + + + + Applies post-processing effects to the final image. + Tillämpar efterbehandlingseffekter på den slutliga bilden. + + + Fullscreen Mode: Helskärmsläge: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -608,12 +618,12 @@ Borderless ger bäst kompatibilitet med skärmtangentbordet som vissa spel kräv Exklusiv helskärm kan ge bättre prestanda och bättre stöd för Freesync/Gsync. - + Aspect Ratio: Bildförhållande: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -622,36 +632,36 @@ De flesta spel stöder endast 16:9, så modifieringar krävs för att få andra Kontrollerar även bildförhållandet för tagna skärmdumpar. - + Use persistent pipeline cache Använd permanent pipeline-cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Gör det möjligt att spara shaders i lagringsutrymmet för snabbare laddning vid nästa spelstart. Att inaktivera detta är endast avsett för felsökning. - + Use asynchronous GPU emulation Använd asynkron GPU-emulering - + Uses an extra CPU thread for rendering. This option should always remain enabled. Använder en extra CPU-tråd för rendering. Detta alternativ bör alltid vara aktiverat. - + NVDEC emulation: NVDEC-emulering: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -660,12 +670,12 @@ Den kan antingen använda CPU eller GPU för avkodning, eller inte utföra någo I de flesta fall ger GPU-avkodning bäst prestanda. - + ASTC Decoding Method: ASTC-avkodningsmetod: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -678,12 +688,12 @@ CPU asynkront: Använd CPU:n för att avkoda ASTC-texturer vid behov. Eliminerar men kan ge artefakter. - + ASTC Recompression Method: ASTC-återkomprimeringsmetod: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -692,44 +702,44 @@ BC1/BC3: Det mellanliggande formatet kommer att komprimeras om till BC1- eller B vilket sparar VRAM men försämrar bildkvaliteten. - + Frame Pacing Mode (Vulkan only) Frame Pacing Mode (endast Vulkan) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. Styr hur emulatorn hanterar bildhastigheten för att minska hackighet och göra bildfrekvensen jämnare och mer konsekvent. - + VRAM Usage Mode: VRAM-användningsläge: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Väljer om emulatorn ska prioritera att spara minne eller utnyttja tillgängligt videominne maximalt för prestanda. Aggressivt läge kan påverka prestandan hos andra program, till exempel inspelningsprogram. - + Skip CPU Inner Invalidation Hoppa över CPU:ns interna ogiltigförklaring - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Hoppar över vissa cache-ogiltigförklaringar under minnesuppdateringar, vilket minskar CPU-användningen och förbättrar latensen. Detta kan orsaka mjuka krascher. - + VSync Mode: VSync-läge: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -740,61 +750,58 @@ Mailbox kan ha lägre latens än FIFO och uppvisar inte tearing, men kan tappa b Immediate (ingen synkronisering) visar allt som är tillgängligt och kan uppvisa tearing. - + Sync Memory Operations Synkronisera minnesoperationer - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. Kontrollerar datakonsistens mellan beräknings- och minnesoperationer. - Det här alternativet åtgärdar problem i spel, men kan försämra prestandan. - Unreal Engine 4-spel upplever ofta de mest betydande förändringarna av detta. - + Enable asynchronous presentation (Vulkan only) Aktivera asynkron presentation (endast Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Förbättrar prestandan något genom att flytta presentationen till en separat CPU-tråd. - + Force maximum clocks (Vulkan only) Tvinga fram maximal klockfrekvens (endast Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Körs i bakgrunden i väntan på grafikkommandon för att förhindra att GPU:n sänker sin klockhastighet. - + Anisotropic Filtering: Anisotropisk filtrering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Kontrollerar kvaliteten på texturrendering vid sneda vinklar. - Säker att ställa in på 16x på de flesta GPU:er. - + GPU Mode: GPU-läge: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -803,12 +810,12 @@ De flesta spel återges bra med Snabb, men Exakt krävs fortfarande för vissa. Partiklar återges ofta korrekt endast i läget Exakt. - + DMA Accuracy: DMA-noggrannhet: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -817,12 +824,12 @@ Osäker är snabbare, medan Säker är stabilare och kan lösa problem i vissa s Standard följer inställningen för GPU-noggrannhet. - + GPU Fence Behavior: Beteende för GPU-staket: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -837,56 +844,56 @@ Strikt är långsammast, men kan lösa problem som kräver striktare synkroniser Standard följer inställningen för GPU-noggrannhet. - + Enable GPU buffer readback Aktivera återläsning av GPU-buffert - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. Bevarar data som ändrats av GPU:n genom att läsa tillbaka dem före uppladdning. Vissa spel kräver detta för att vissa effekter ska återges korrekt. - + Enable asynchronous shader compilation Aktivera asynkron shaderkompilering - + May reduce shader stutter. Kan minska shader-hackighet. - + GPU Clocks GPU-klockfrekvenser - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. Får spelet att tro att GPU-arbetet avslutas snabbare än det gör, så att det slutar sänka upplösning och ritaravstånd för att passa Switch-klockfrekvenserna. - + GPU Unswizzle GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Accelererar avkodning av BCn 3D-texturer med hjälp av GPU-beräkningar. Inaktivera om du upplever krascher eller grafiska fel. - + GPU Unswizzle Max Texture Size Maximal texturstorlek för GPU Unswizzle - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -895,48 +902,48 @@ GPU är snabbare för medelstora och stora texturer, men CPU kan vara effektivar Justera detta för att hitta balansen mellan GPU-acceleration och CPU-överbelastning. - + GPU Unswizzle Stream Size Strömstorlek för GPU Unswizzle - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Ställer in den maximala mängden texturdata (i MiB) som bearbetas per bildruta. Högre värden kan minska hackighet under texturinläsning men kan påverka bildrutans konsistens. - + GPU Unswizzle Chunk Size Chunk-storlek för GPU Unswizzle - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Bestämmer antalet djupskivor som bearbetas i en enda sändning. Att öka detta kan förbättra genomströmningen på avancerade GPU:er, men kan orsaka TDR eller drivrutinstidsgränser på svagare hårdvara. - + Use Vulkan pipeline cache Använda Vulkan pipeline-cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Aktiverar GPU-leverantörsspecifik pipeline-cache. Det här alternativet kan förbättra laddningstiden för shaders avsevärt i fall där Vulkan-drivrutinen inte lagrar pipeline-cache-filer internt. - + Enable Compute Pipelines (Intel Vulkan Only) Aktivera compute pipelines (endast Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -945,194 +952,194 @@ Denna inställning finns endast för Intels egna drivrutiner och kan orsaka kras Beräkningspipelines är alltid aktiverade på alla andra drivrutiner. - + Enable Reactive Flushing Aktivera Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Använder reaktiv rensning i stället för prediktiv rensning, vilket ger mer exakt minnessynkning. - + Sync to framerate of video playback Synkronisera med bildfrekvensen för videouppspelning - + Run the game at normal speed during video playback, even when the framerate is unlocked. Kör spelet i normal hastighet under videouppspelning, även när bildfrekvensen är upplåst. - + Barrier feedback loops Återkopplingsloopar för barriärer - + Improves rendering of transparency effects in specific games. Förbättrar renderingen av transparenseffekter i vissa spel. - + Enable buffer history Aktivera bufferthistorik - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Aktiverar åtkomst till tidigare bufferttillstånd. Det här alternativet kan förbättra renderingskvaliteten och prestandakonsistensen i vissa spel. - + Fix bloom effects Korrigera bloom-effekter - + Removes bloom in Burnout. Tar bort bloom i Burnout. - + Enable Legacy Rescale Pass Aktivera äldre omskalningspass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Kan åtgärda skalningsproblem i vissa spel genom att förlita sig på beteendet från den tidigare implementeringen. Äldre beteende som åtgärdar linjeartefakter på AMD- och Intel-GPU:er och grå texturflimmer på Nvidia-GPU:er i Luigis Mansion 3. - + Extended Dynamic State Utökad dynamisk status - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Kontrollerar antalet funktioner som kan användas i utökat dynamiskt tillstånd. Högre tillstånd möjliggör fler funktioner och kan öka prestandan, men kan orsaka ytterligare grafiska problem. - + Vertex Input Dynamic State Dynamiskt tillstånd för vertexinmatning - + Enables vertex input dynamic state feature for better quality and performance. Aktiverar funktionen för dynamiskt tillstånd för vertexinmatning för bättre kvalitet och prestanda. - + Sample Shading Provskuggning - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Tillåter fragment-shadern att exekveras per prov i ett multisamplade fragment istället för en gång per fragment. Förbättrar grafikens kvalitet på bekostnad av prestanda. Högre värden förbättrar kvaliteten men försämrar prestandan. - + RNG Seed RNG-frö - + Controls the seed of the random number generator. Mainly used for speedrunning. Att kontrollera fröet till slumptalsgeneratorn. Används främst för speedrunning. - + Device Name Enhetsnamn - + The name of the console. Konsolens namn. - + Homebrew Args Homebrew-argument - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Kommandoradsargument som skickas till homebrew vid start (t.ex. -noglsl). - + Custom RTC Date: Anpassat RTC-datum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Med det här alternativet kan du ändra klockan på konsolen. Kan användas för att manipulera tiden i spel. - + The number of seconds from the current unix time Antalet sekunder från aktuell Unix-tid - + Language: Språk: - + This option can be overridden when region setting is auto-select Det här alternativet kan åsidosättas när regioninställningen är automatiskt vald. - + Region: Region: - + The region of the console. Konsolens region. - + Time Zone: Tidszon: - + The time zone of the console. Konsolens tidszon. - + Sound Output Mode: Ljudutmatningsläge: - + Console Mode: Konsolläge: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1141,1042 +1148,1042 @@ Spel ändrar upplösning, detaljer och stödda kontroller beroende på denna ins Inställningen Handhållen kan förbättra prestandan för enklare system. - + Prompt for user profile on boot Fråga efter användarprofil vid uppstart - + Useful if multiple people use the same PC. Användbart om flera personer använder samma dator. - + Pause when not in focus Pausa när inte i fokus - + Pauses emulation when focusing on other windows. Pausar emulering när fokus är på andra fönster. - + Confirm before stopping emulation Bekräfta innan emuleringen stoppas - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Åsidosätter frågor om att bekräfta att emuleringen ska avslutas. Om du aktiverar den hoppar du över sådana uppmaningar och avslutar emuleringen direkt. - + Hide mouse on inactivity Dölj musen vid inaktivitet - + Hides the mouse after 2.5s of inactivity. Döljer musen efter 2,5 sekunders inaktivitet. - + Disable controller applet Inaktivera kontroller-appleten - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Inaktiverar med tvång användningen av kontrollerappletten i emulerade program. När ett program försöker öppna kontrollerappletten stängs den omedelbart. - + Check for updates Leta efter uppdateringar - + Whether or not to check for updates upon startup. Om uppdateringar ska sökas vid start eller inte. - + Enable Gamemode Aktivera Gamemode - + Force X11 as Graphics Backend Tvinga X11 som grafikbackend - + Custom frontend Anpassad frontend - + Real applet Verklig applet - + Never Aldrig - + On Load Vid inläsning - + Always Alltid - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU asynkron - + Uncompressed (Best quality) Okomprimerad (bästa kvalitet) - + BC1 (Low quality) BC1 (låg kvalitet) - + BC3 (Medium quality) BC3 (medelhög kvalitet) - - + + Auto Auto - + 30 FPS 30 bilder/s - + 60 FPS 60 bilder/s - + 90 FPS 90 bilder/s - + 120 FPS 120 bilder/s - + Conservative Konservativ - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembly Shaders, endast NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimentell, endast AMD/Mesa) - + Null Null - + Fast Snabb - - - + + + Accurate Exakt - - - + + + Default Standard - + Unsafe (fast) Osäker (snabb) - + Safe (stable) Säker (stabil) - + Immediate Omedelbar - + Balanced Balanserad - + Strict Strikt - + Unsafe Inte säker - + Paranoid (disables most optimizations) Paranoid (inaktiverar de flesta optimeringar) - + Debugging Felsökning - + Dynarmic Dynarmisk - + NCE NCE - + Borderless Windowed Ramlöst fönsterläge - + Exclusive Fullscreen Exklusiv helskärm - + No Video Output Ingen videoutgång - + CPU Video Decoding CPU-videoavkodning - + GPU Video Decoding (Default) GPU videoavkodning (standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTELL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTELL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Närmsta granne - + Bilinear Bilinjär - + Bicubic Bikubisk - + Gaussian Gaussisk - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Område - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tvinga 4:3 - + Force 21:9 Tvinga 21:9 - + Force 16:10 Tvinga 16:10 - + Stretch to Window Sträck ut till fönster - + Automatic Automatiskt - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japanska (日本語) - + American English Amerikansk engelska - + French (français) Franska (français) - + German (Deutsch) Tyska (Deutsch) - + Italian (italiano) Italienska (italiano) - + Spanish (español) Spanska (español) - + Chinese Kinesiska - + Korean (한국어) Koreanska (한국어) - + Dutch (Nederlands) Nederländska (Nederlands) - + Portuguese (português) Portugisiska (português) - + Russian (Русский) Ryska (Русский) - + Taiwanese Taiwanesiska - + British English Brittisk engelska - + Canadian French Kanadensisk franska - + Latin American Spanish Latinamerikansk spanska - + Simplified Chinese Förenklad kinesiska - + Traditional Chinese (正體中文) Traditionell kinesiska (正體中文) - + Brazilian Portuguese (português do Brasil) Brasiliansk portugisiska (português do Brasil) - + Polish (polska) Polska (polska) - + Thai (แบบไทย) Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China Kina - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Egypten - + Eire Irland - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irland - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turkiet - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET VÅT - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (standard) - + 6GB DRAM (Unsafe) 6 GB DRAM (osäker) - + 8GB DRAM 8 GB DRAM - + 10GB DRAM (Unsafe) 10 GB DRAM (osäker) - + 12GB DRAM (Unsafe) 12 GB DRAM (osäker) - + Docked Dockad - + Handheld Handhållen - - + + Normal Normal - - + + Boost Förstärk - - + + Overclock Överklocka - + Always ask (Default) Fråga alltid (standard) - + Only if game specifies not to stop Endast om spelet anger att det inte ska stoppas - + Never ask Fråga aldrig - + Very Small (16 MB) Mycket liten (16 MB) - + Small (32 MB) Liten (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Stor (256 MB) - + Very Large (512 MB) Mycket stor (512 MB) - + Very Low (4 MB) Mycket låg (4 MB) - + Low (8 MB) Låg (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Medium (32 MB) - + High (64 MB) Hög (64 MB) - + Very Low (32) Mycket låg (32) - + Low (64) Låg (64) - + Normal (128) Normal (128) - + Medium (256) Medium (256) - + High (512) Hög (512) - + Disabled Inaktiverad - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View Trädvy - + Grid View Rutnätsvy @@ -3288,33 +3295,38 @@ Vill du ta bort gammalt sparat data? Bakgrundsfärg: - + % FSR/SGSR sharpening percentage (e.g. 50%) % - + + Configure Effects... + Konfigurera effekter... + + + Off Av - + VSync Off VSync Av - + Recommended Rekommenderad - + On På - + VSync On VSync På @@ -4941,103 +4953,118 @@ När de har tagits bort kan de INTE återställas. Är du 100% säker på att du - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. - ReShade FX-effekter läses in från mappen post_shaders i Eden-datakatalogen. Ändringar tillämpas direkt medan ett spel körs. + Changes apply immediately while a game is running. + Ändringarna tillämpas omedelbart medan ett spel körs. - + Enable post-processing Aktivera efterbearbetning - + Preset: Förinställning: - + Apply Tillämpa - + Reset Values Återställ värden - + Return every effect to the values the preset ships with. Återställ varje effekt till de värden som förinställningen levereras med. - + Save As... Spara som… - + Save Preset Spara förinställning - + Preset name: Förinställningsnamn: - - Delete - Ta bort + + Clear + Rensa - + + Remove every effect in use and deselect the preset. + Ta bort alla använda effekter och avmarkera förinställningen. + + + Add Effect Lägg till effekt - + + None + Ingen + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Inga effekter används. Välj en förinställning och tryck på Verkställ, eller lägg till effekter en i taget. + + + Custom chain. Pick a preset above and press Apply to replace it. Anpassad kedja. Välj en förinställning ovan och tryck på Tillämpa för att ersätta den. - + Active preset: %1 (modified). Press Reset Values to go back to how it ships. Aktiv förinställning: %1 (ändrad). Tryck på Återställ värden för att återgå till ursprungsvärdena. - + Active preset: %1 Aktiv förinställning: %1 - + Enabled Aktiverad - + Disabled Inaktiverad - + Reset to defaults Återställ standardvärden - + Effect '%1' was not found. Effekten ”%1” hittades inte. - + Effect failed to compile: %1 Effekten kunde inte kompileras: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. Inga användbara ReShade FX-effekter hittades. Placera .fx-filer i mappen post_shaders. @@ -7055,7 +7082,7 @@ Felsökningsmeddelande: - + &Pause &Paus @@ -7206,7 +7233,7 @@ Felsökningsmeddelande: - + &Start &Starta @@ -7217,7 +7244,7 @@ Felsökningsmeddelande: - + R&ecord Spela &in @@ -7308,7 +7335,7 @@ Felsökningsmeddelande: - + None Ingen @@ -7334,400 +7361,405 @@ Felsökningsmeddelande: &Karusellvy - + Small (32x32) Liten (32x32) - + Standard (64x64) Standard (64x64) - + Large (128x128) Stor (128x128) - + Full Size (256x256) Full storlek (256x256) - + Broken Vulkan Installation Detected Felaktig Vulkan-installation upptäcktes - + Vulkan initialization failed during boot. Vulkan-initialiseringen misslyckades under uppstarten. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Kör ett spel - + Loading Web Applet... Läser in webbapplet... - - + + Disable Web Applet Inaktivera webbapplet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Att inaktivera webbappletten kan leda till odefinierat beteende och bör endast användas med Super Mario 3D All-Stars. Är du säker på att du vill inaktivera webbappletten? (Detta kan återaktiveras i felsökningsinställningarna.) - + The amount of shaders currently being built Antalet shaders som för närvarande byggs - + The current selected resolution scaling multiplier. Den aktuella valda multiplikatorn för upplösningsskalning. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Aktuell emuleringshastighet. Värden högre eller lägre än 100% indikerar att emuleringen körs snabbare eller långsammare än en Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Hur många bildrutor per sekund spelet för närvarande visar. Detta varierar från spel till spel och från scen till scen. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Tid som krävs för att emulera en Switch-bildruta, exklusive bildbegränsning eller v-synkronisering. För emulering i full hastighet bör detta vara högst 16,67 ms. - + Unmute Aktivera ljud - + Mute Tyst - + Reset Volume Återställ volym - + + Configure Effects... + Konfigurera effekter... + + + &Clear Recent Files &Töm tidigare filer - + &Continue &Fortsätt - + Warning: Outdated Game Format Varning: Föråldrat spelformat - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Du använder det dekonstruerade ROM-katalogformatet för detta spel, vilket är ett föråldrat format som har ersatts av andra format såsom NCA, NAX, XCI eller NSP. Dekonstruerade ROM-kataloger saknar ikoner, metadata och uppdateringsstöd.<br> För en förklaring av de olika Switch-format som Eden har stöd för, se vår användarhandbok. Detta meddelande kommer inte att visas igen. - - + + Error while loading ROM! Fel vid inläsning av ROM! - + The ROM format is not supported. ROM-formatet stöds inte. - + An error occurred initializing the video core. Ett fel uppstod vid initialiseringen av videokärnan. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. Detta orsakas vanligtvis av inaktuella grafikdrivrutiner. Se loggen för mer information. Se: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>Så här kommer du åt loggfiler</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Fel vid inläsning av ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Dumpa dina filer igen eller fråga på Discord/Stoat för hjälp. - + An unknown error occurred. Please see the log for more details. Ett okänt fel har uppstått. Se loggen för mer information. - - + + (64-bit) (64-bitar) - - + + (32-bit) (32-bitar) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Stänger programvara... - + Save Data Sparat data - + Mod Data Mod-data - + Error Opening %1 Folder Fel vid öppning av mappen %1 - - + + Folder does not exist! Mappen finns inte! - + Remove Installed Game Contents? Ta bort installerat spelinnehåll? - + Remove Installed Game Update? Ta bort installerad speluppdatering? - + Remove Installed Game DLC? Ta bort installerat spel-DLC? - + Remove Entry Ta bort post - + Delete OpenGL Transferable Shader Cache? Ta bort OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? Ta bort Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? Ta bort alla Transferable Shader Caches? - + Remove Custom Game Configuration? Ta bort anpassad spelkonfiguration? - + Remove Cache Storage? Ta bort cachelagring? - + Remove File Ta bort fil - + Remove Play Time Data Ta bort data om speltid - + Reset play time? Nollställ speltid? - - + + RomFS Extraction Failed! Extrahering av RomFS misslyckades! - + There was an error copying the RomFS files or the user cancelled the operation. Det uppstod ett fel vid kopieringen av RomFS-filerna eller så avbröt användaren åtgärden. - + Full Fullständigt - + Skeleton Skelett - + Select RomFS Dump Mode Välj dumpläge för RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Välj hur du vill att RomFS ska dumpas. <br>Fullständigt kopierar alla filer till den nya katalogen, medan <br>skelett endast skapar katalogstrukturen. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root Det finns inte tillräckligt med ledigt utrymme på %1 för att extrahera RomFS. Frigör utrymme eller välj en annan dumpkatalog under Emulering > Konfigurera > System > Filsystem > Dumprot. - + Extracting RomFS... Extraherar RomFS... - - + + Cancel Avbryt - + RomFS Extraction Succeeded! Extrahering av RomFS lyckades! - + The operation completed successfully. Operationen slutfördes. - + Error Opening %1 Fel vid öppning av %1 - + Select Directory Välj katalog - + Properties Egenskaper - + The game properties could not be loaded. Spelegenskaperna kunde inte läsas in. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Körbar Switch-fil (%1);;Alla filer (*.*) - + Load File Läs in fil - + Open Extracted ROM Directory Öppna katalog för extraherad ROM - + Invalid Directory Selected Ogiltig katalog valdes - + The directory you have selected does not contain a 'main' file. Den katalog du har valt innehåller ingen ”main”-fil. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Installerbar Switch-fil (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files Installera filer - + %n file(s) remaining %n fil återstår%n filer återstår - + Installing file "%1"... Installerar filen "%1"... - - + + Install Results Installationsresultat - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. För att undvika eventuella konflikter avråder vi användare från att installera basspel på NAND. Använd endast denna funktion för att installera uppdateringar och DLC. - + %n file(s) were newly installed %n ny fil installerades @@ -7735,7 +7767,7 @@ Använd endast denna funktion för att installera uppdateringar och DLC. - + %n file(s) were overwritten %n fil skrevs över @@ -7743,7 +7775,7 @@ Använd endast denna funktion för att installera uppdateringar och DLC. - + %n file(s) failed to install %n fil gick inte att installera @@ -7751,314 +7783,324 @@ Använd endast denna funktion för att installera uppdateringar och DLC. - + System Application Systemapplikation - + System Archive Systemarkiv - + System Application Update Uppdatering för systemapplikation - + Firmware Package (Type A) Firmware-paket (Type A) - + Firmware Package (Type B) Firmware-paket (Type B) - + Game Spel - + Game Update Speluppdatering - + Game DLC DLC för spel - + Delta Title Deltatitel - + Select NCA Install Type... Välj NCA-installationstyp... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Välj vilken typ av titel du vill installera denna NCA som: (I de flesta fall är standardinställningen ”Spel” tillräcklig.) - + Failed to Install Misslyckades med att installera - + The title type you selected for the NCA is invalid. Den titeltypen du valt för NCA är ogiltig. - + File not found Filen hittades inte - + File "%1" not found Filen "%1" hittades inte - + OK Ok - + Function Disabled Funktion inaktiverad - + Compatibility list reporting is currently disabled. Check back later! Rapportering till kompatibilitetslistan är för närvarande inaktiverad. Kom tillbaka senare! - + Error opening URL Fel vid öppning av URL - + Unable to open the URL "%1". Det går inte att öppna URL:en ”%1”. - + TAS Recording TAS-inspelning - + Overwrite file of player 1? Skriv över fil för spelare 1? - + Invalid config detected Ogiltig konfiguration upptäcktes - + Handheld controller can't be used on docked mode. Pro controller will be selected. Handhållen kontroller kan inte användas i dockat läge. Pro-kontrollern kommer att väljas. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Den aktuella amiibo har tagits bort. - + Error Fel - - + + The current game is not looking for amiibos Det aktuella spelet letar inte efter amiibos - + Amiibo File (%1);; All Files (*.*) Amiibo-fil (%1);; Alla filer (*.*) - + Load Amiibo Läs in Amiibo - + Error loading Amiibo data Fel vid läsning av Amiibo-data - + The selected file is not a valid amiibo Den valda filen är inte en giltig amiibo. - + The selected file is already on use Den valda filen används redan - + An unknown error occurred Ett okänt fel uppstod - + No firmware available Ingen firmware tillgänglig - + Firmware Corrupted Firmware är skadat - + Unknown applet Okänd applet - + Applet doesn't map to a known value. Appleten mappar inte till ett känt värde. - + Record not found Posten hittades inte - + Applet not found. Please reinstall firmware. Appleten hittades inte. Installera om fast programvara. - + Capture Screenshot Ta skärmbild - + PNG Image (*.png) PNG-bild (*.png) - + TAS state: Running %1/%2 TAS-tillstånd: Kör %1/%2 - + TAS state: Recording %1 TAS-tillstånd: Spelar in %1 - + TAS state: Idle %1/%2 TAS-tillstånd: Overksam %1/%2 - + TAS State: Invalid TAS-tillstånd: Ogiltig - + &Stop Running &Stoppa körning - + Stop R&ecording Stoppa i&nspelning - + Building: %n shader(s) Bygger: %n shaderBygger: %n shaders - + Scale: %1x %1 is the resolution scaling factor Skala: %1x - + Speed: %1% / %2% Hastighet: %1% / %2% - + Speed: %1% Hastighet: %1% - + Game: %1 FPS Spel: %1 bilder/s - + Frame: %1 ms Bildruta: %1 ms - + NO AA NO AA - + + NO FX + INGA FX + + + + FX + FX + + + VOLUME: MUTE VOLYM: TYST - + VOLUME: %1% Volume percentage (e.g. 50%) VOLYM: %1% - + Derivation Components Missing Deriveringskomponenter saknas - + Decryption keys are missing. Install them now? Avkrypteringsnycklar saknas. Installera dem nu? - + Wayland Detected! Wayland upptäcktes! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8069,74 +8111,74 @@ Det rekommenderas att använda X11 istället. Vill du tvinga det för framtida starter? - + Use X11 Använd X11 - + Continue with Wayland Fortsätt med Wayland - + Don't show again Visa inte igen - + Restart Required Omstart krävs - + Restart Eden to apply the X11 backend. Starta om Eden för att tillämpa X11-backend. - + Slow Långsam - + Turbo Turbo - + Unlocked Upplåst - + Select RomFS Dump Target Välj RomFS-dumpmål - + Please select which RomFS you would like to dump. Välj vilken RomFS du vill dumpa. - + Are you sure you want to close Eden? Är du säker på att du vill stänga Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Är du säker på att du vill stoppa emuleringen? Alla osparade framsteg kommer att gå förlorade. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? @@ -9442,7 +9484,7 @@ p, li { white-space: pre-wrap; } UNEXPECTED BAD THINGS MAY HAPPEN IF YOU DON'T READ THIS!<br>Eden has detected the following save directories with no attached profile:<br>%1<br><br>The following profiles are valid:<br>%2<br><br>Click "OK" to open your save folder and fix up your profiles.<br>Hint: copy the contents of the largest or last-modified folder elsewhere, delete all orphaned profiles, and move your copied contents to the good profile.<br><br>Still confused? See the <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/Orphaned.md'>help page</a>.<br> - OVÄNTADE PROBLEM KAN UPPSTÅ OM DU INTE LÄSER DETTA! <br>Eden har upptäckt följande sparningskataloger utan bifogade profiler:<br>%1<br><br>Följande profiler är giltiga:<br>%2<br><br>Klicka på ”OK” för att öppna din sparningsmapp och fixa dina profiler.<br>Tips: kopiera innehållet i den största eller senast ändrade mappen till en annan plats, ta bort alla övergivna profiler och flytta det kopierade innehållet till den giltiga profilen.<br><br>Fortfarande förvirrad? Se hjälpsidan<a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/Orphaned.md'>.<br> + OVÄNTADE PROBLEM KAN UPPSTÅ OM DU INTE LÄSER DETTA!<br>Eden har upptäckt följande sparningskataloger utan bifogade profiler:<br>%1<br><br>Följande profiler är giltiga:<br>%2<br><br>Klicka på ”OK” för att öppna din sparningsmapp och fixa dina profiler.<br>Tips: kopiera innehållet i den största eller senast ändrade mappen till en annan plats, ta bort alla övergivna profiler och flytta det kopierade innehållet till den giltiga profilen.<br><br>Fortfarande förvirrad? Se <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/Orphaned.md'>hjälpsidan</a>.<br> diff --git a/dist/languages/tr_TR.ts b/dist/languages/tr_TR.ts index 1aea55d216..d200ff2994 100644 --- a/dist/languages/tr_TR.ts +++ b/dist/languages/tr_TR.ts @@ -585,24 +585,34 @@ FXAA can produce a more stable picture in lower resolutions. Kullanılacak kenar yumuşatma yöntemi. SMAA en iyi kaliteyi sunar. FXAA, düşük çözünürlüklerde daha kararlı bir görüntü oluşturabilir. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Tam Ekran Modu: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. Pencereyi tam ekranda işlemek için kullanılan yöntem. Sınırsız, bazı oyunların giriş için istediği ekran klavyesi ile en iyi uyumluluğu sunar. Özel tam ekran, daha iyi performans ve daha iyi Freesync/Gsync desteği sağlayabilir. - + Aspect Ratio: En-Boy Oranı: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -611,46 +621,46 @@ Also controls the aspect ratio of captured screenshots. Ayrıca, yakalanan ekran görüntülerinin en-boy oranını da kontrol eder. - + Use persistent pipeline cache Kalıcı işlem hattı önbelleğini kullan - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Gölgelendiriclerin sonraki oyun açılışlarında daha hızlı yüklenmesi için depolama alanına kaydedilmesine olanak tanır. Devre dışı bırakılması yalnızca hata ayıklama amaçlıdır. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: NVDEC emülasyonu: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. Videoların nasıl çözüleceğini belirtir. Kod çözme için CPU veya GPU kullanabilir veya hiç kod çözme işlemi yapmayabilir (videolarda siyah ekran). Çoğu durumda GPU ile kod çözme en iyi performansı sağlar. - + ASTC Decoding Method: ASTC Kod Çözme Yöntemi - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -659,55 +669,55 @@ stuttering but may present artifacts. Bu seçenek ASTC dokularının nasıl çözüleceğini kontrol eder. CPU: Kod çözme için işlemciyi kullanır. GPU: ASTC dokularını çözmek için GPU'nun hesaplama gölgelendiricilerini kullanır (önerilir). CPU Asenkron: ASTC dokularını talep üzerine çözmek için işlemciyi kullanır. ASTC kod çözme kaynaklı takılmaları giderir ancak görsel bozulmalara neden olabilir. - + ASTC Recompression Method: ASTC Yeniden Sıkıştırma Yöntemi - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. Çoğu GPU, ASTC dokuları için doğrudan desteğe sahip değildir ve bir ara formata (RGBA8) açılmalıdır. BC1/BC3: Ara format BC1 veya BC3 formatında yeniden sıkıştırılarak VRAM tasarrufu sağlar ancak görüntü kalitesini düşürür. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: VRAM Kullanım Modu - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Emülatörün belleği korumayı mı yoksa performans için mevcut video belleğini maksimum düzeyde kullanmayı mı tercih edeceğini seçer. Agresif mod, kayıt yazılımları gibi diğer uygulamaların performansını etkileyebilir. - + Skip CPU Inner Invalidation CPU Geçersiz Kılma'yı Atla - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Bellek güncellemeleri sırasında belirli önbellek geçersiz kılma işlemlerini atlayarak işlemci kullanımını azaltır ve gecikmeyi iyileştirir. Bu, hafif çökmelere neden olabilir. - + VSync Mode: VSync Modu: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -715,79 +725,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te FIFO (VSync) kare düşürmez veya yırtılma göstermez ancak ekran yenileme hızıyla sınırlıdır. FIFO Relaxed, yavaşlamadan toparlanırken yırtılmaya izin verir. Mailbox, FIFO'dan daha düşük gecikmeye sahip olabilir ve yırtılma yapmaz ancak kare düşürebilir. Immediate (senkronizasyon yok), mevcut olanı anında sunar ve yırtılmalara neden olabilir. - + Sync Memory Operations Bellek İşlemlerini Senkronize Et - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. Hesaplama ve bellek işlemleri arasında veri tutarlılığı sağlar. Bu seçenek oyunlardaki sorunları giderir ancak performansı düşürebilir. Unreal Engine 4 oyunları genellikle bundan en önemli ölçüde etkilenenlerdir. - + Enable asynchronous presentation (Vulkan only) Asenkron sunumu etkinleştir (Yalnızca Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Sunum işlemini ayrı bir işlemci iş parçacığına taşıyarak performansı biraz artırır. - + Force maximum clocks (Vulkan only) En yüksek hızı zorla (Yalnızca Vulkan için) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Grafik komutlarını beklerken GPU'nun hızının düşmesini engellemek için arka planda görev yürütür - + Anisotropic Filtering: Anisotropic Filtering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Eğik açılardaki doku oluşturma kalitesini kontrol eder. Çoğu grafik kartında 16x olarak ayarlanması güvenlidir. - + GPU Mode: Grafik Kartı Modu - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: DMA Doğruluğu: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -797,1328 +807,1328 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation Asenkron gölgelendirici derlemeyi etkinleştir - + May reduce shader stutter. Gölgelendirici/shader takılmalarını azaltabilir. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Vulkan pipeline önbelleği kullan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Grafik kartı üreticisine özel işlem hattı önbelleğini etkinleştirir. Bu seçenek, Vulkan sürücüsünün işlem hattı önbellek dosyalarını dahili olarak saklamadığı durumlarda gölgelendirici yükleme süresini önemli ölçüde iyileştirebilir. - + Enable Compute Pipelines (Intel Vulkan Only) Hesaplama İşlem Hatlarını Etkinleştir (Yalnızca Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. Bazı oyunlar için gereklidir. Bu ayar yalnızca Intel'in tescilli sürücüleri için mevcuttur ve etkinleştirilirse çökmeye neden olabilir. Hesaplama işlem hatları diğer tüm sürücülerde her zaman etkindir. - + Enable Reactive Flushing Reaktif Temizlemeyi Etkinleştir - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Tahminli temizleme yerine reaktif temizleme kullanarak daha doğru bellek senkronizasyonu sağlar. - + Sync to framerate of video playback Video oynatma kare hızına senkronize et - + Run the game at normal speed during video playback, even when the framerate is unlocked. Kare hızı kilidi açık olsa bile video oynatımı sırasında oyunu normal hızda çalıştırır. - + Barrier feedback loops Bariyer geri besleme döngüleri - + Improves rendering of transparency effects in specific games. Belirli oyunlarda şeffaflık efektlerinin oluşturulmasını iyileştirir. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State Genişletilmiş Dinamik Durum - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Genişletilmiş Dinamik Durumda kullanılabilecek özelliklerin sayısını kontrol eder. Daha yüksek durumlar daha fazla özelliğe izin verir ve performansı artırabilir, ancak ek grafik sorunlarına neden olabilir. - + Vertex Input Dynamic State Vertex Dinamik Durumu - + Enables vertex input dynamic state feature for better quality and performance. Daha iyi kalite ve performans için Vertex dinamik durum özelliğini etkinleştirir. - + Sample Shading Örnek Gölgelendirme - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Parça gölgelendiricinin, her parça için bir kez yerine çoklu örneklenmiş bir parçadaki her örnek için yürütülmesine olanak tanır. Performans pahasına grafik kalitesini artırır. Daha yüksek değerler kaliteyi artırır ancak performansı düşürür. - + RNG Seed RNG çekirdeği - + Controls the seed of the random number generator. Mainly used for speedrunning. Rastgele sayı üretecinin tohumunu kontrol eder. Esas olarak hızlı bitirme denemeleri için kullanılır. - + Device Name Cihaz İsmi - + The name of the console. Konsolun adı - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Özel RTC Tarihi - + This option allows to change the clock of the console. Can be used to manipulate time in games. Bu seçenek konsolun saatini değiştirmeye olanak tanır. Oyunlarda zamanı manipüle etmek için kullanılabilir. - + The number of seconds from the current unix time Mevcut unix zamanından itibaren saniye sayısı - + Language: Dil: - + This option can be overridden when region setting is auto-select Bölge ayarı otomatik seçim olduğunda bu seçenek geçersiz kılınabilir. - + Region: Bölge: - + The region of the console. Konsolun bölgesi - + Time Zone: Saat Dilimi: - + The time zone of the console. Konsolun saat dilimi - + Sound Output Mode: Ses Çıkış Modu: - + Console Mode: Konsol Modu: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. Konsolun Yerleşik veya El Modunda olup olmadığını seçer. Oyunlar bu ayara bağlı olarak çözünürlüklerini, detaylarını ve desteklenen kontrolcülerini değiştirecektir. El Moduna ayarlamak, düşük seviyeli sistemler için performansı artırmaya yardımcı olabilir. - + Prompt for user profile on boot Açılışta kullanıcı profili için sor - + Useful if multiple people use the same PC. Aynı bilgisayarı birden fazla kişi kullanıyorsa yararlıdır. - + Pause when not in focus Odaklı değilken duraklat - + Pauses emulation when focusing on other windows. Diğer pencerelere odaklanıldığında emülasyonu duraklatır. - + Confirm before stopping emulation Emülasyonu durdurmadan önce onayla - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Emülasyonu durdurma onayı isteklerini/istemlerini geçersiz kılar. Etkinleştirildiğinde, bu tür istekleri/istemleri atlar ve emülasyonu doğrudan/dirket olarak kapatır. - + Hide mouse on inactivity Hareketsizlik durumunda imleci gizle - + Hides the mouse after 2.5s of inactivity. 2,5 saniye hareketsizlikten sonra fareyi gizler. - + Disable controller applet Kontrolcü aplikasyonunu devre dışı bırak - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Emüle edilen programlarda kontrolcü aplikasyonunun kullanımını zorla devre dışı bırakır. Bir program kontrolcü aplikasyonunu açmaya çalıştığında, aplikasyon anında kapatılır. - + Check for updates Güncellemeleri Kontrol Et - + Whether or not to check for updates upon startup. Başlangıçta güncellemelerin kontrol edilip edilmeyeceği. - + Enable Gamemode Oyun Modunu/Gamemode Etkinleştir - + Force X11 as Graphics Backend Grafik arka ucu olarak X11'i zorla - + Custom frontend Özel ön yüz - + Real applet Gerçek aplikasyon - + Never Asla - + On Load Yüklemede - + Always Her zaman - + CPU CPU - + GPU GPU - + CPU Asynchronous Asenkron CPU - + Uncompressed (Best quality) Sıkıştırılmamış (En iyi kalite) - + BC1 (Low quality) BC1 (Düşük kalite) - + BC3 (Medium quality) BC3 (Orta kalite) - - + + Auto Otomatik - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Muhafazakar - + Aggressive Agresif - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Boş - + Fast Hızlı - - - + + + Accurate Doğru - - - + + + Default Varsayılan - + Unsafe (fast) Güvenli Değil (hızlı) - + Safe (stable) Güvenli (Stabil) - + Immediate - + Balanced Dengeli - + Strict - + Unsafe Güvensiz - + Paranoid (disables most optimizations) Paranoya (çoğu optimizasyonu kapatır) - + Debugging Hata ayıklama - + Dynarmic Dinamik - + NCE NCE - + Borderless Windowed Kenarlıksız Tam Ekran - + Exclusive Fullscreen Ayrılmış Tam Ekran - + No Video Output Video Çıkışı Yok - + CPU Video Decoding CPU Video Decoding - + GPU Video Decoding (Default) GPU Video Decoding (Varsayılan) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [DENEYSEL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [DENEYSEL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [DENEYSEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [DENEYSEL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [DENEYSEL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor En Yakın Komşu Algoritması - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gausyen - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Süper Çözünürlük - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Yok - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Varsayılan (16:9) - + Force 4:3 4:3'e Zorla - + Force 21:9 21:9'a Zorla - + Force 16:10 16:10'a Zorla - + Stretch to Window Ekrana Sığdır - + Automatic Otomatik - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonca (日本語) - + American English Amerikan İngilizcesi - + French (français) Fransızca (français) - + German (Deutsch) Almanca (Deutsch) - + Italian (italiano) İtalyanca (italiano) - + Spanish (español) İspanyolca (español) - + Chinese Çince - + Korean (한국어) Korece (한국어) - + Dutch (Nederlands) Flemenkçe (Nederlands) - + Portuguese (português) Portekizce (português) - + Russian (Русский) Rusça (Русский) - + Taiwanese Tayvanca - + British English İngiliz İngilizcesi - + Canadian French Kanada Fransızcası - + Latin American Spanish Latin Amerika İspanyolcası - + Simplified Chinese Basitleştirilmiş Çince - + Traditional Chinese (正體中文) Geleneksel Çince (正體中文) - + Brazilian Portuguese (português do Brasil) Brezilya Portekizcesi (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonya - + USA ABD - + Europe Avrupa - + Australia Avustralya - + China Çin - + Korea Kore - + Taiwan Tayvan - + Auto (%1) Auto select time zone Otomatik (%1) - + Default (%1) Default time zone Varsayılan (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Küba - + EET EET - + Egypt Mısır - + Eire İrlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-İrlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 MT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland İzlanda - + Iran İran - + Israel İsrail - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navaho - + NZ Yeni Zelanda - + NZ-CHAT Chatham Adaları - + Poland Polonya - + Portugal Portekiz - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Türkiye - + UCT UCT - + Universal Evrensel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Varsayılan) - + 6GB DRAM (Unsafe) 6GB DRAM (Güvenli Değil) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Güvenli Değil) - + 12GB DRAM (Unsafe) 12GB DRAM (Güvenli Değil) - + Docked Dock Modu Aktif - + Handheld Taşınabilir - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Her zaman sor (Varsayılan) - + Only if game specifies not to stop Sadece oyun durdurulmamasını belirtirse - + Never ask Asla sorma - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Orta (256) - + High (512) Yüksek (512) - + Disabled Devre Dışı - + ExtendedDynamicState 1 Genişletilmiş Dinamik Durum 1 - + ExtendedDynamicState 2 Genişletilmiş Dinamik Durum 2 - + ExtendedDynamicState 3 Genişletilmiş Dinamik Durum 3 - + Tree View - + Grid View @@ -3228,33 +3238,38 @@ Eski kayıt verilerini silmek ister misiniz? Arkaplan Rengi: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Kapalı - + VSync Off VSync Kapalı - + Recommended Önerilen - + On Açık - + VSync On Vsync Açık @@ -4876,102 +4891,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6986,7 +7016,7 @@ Debug Message: - + &Pause &Duraklat @@ -7137,7 +7167,7 @@ Debug Message: - + &Start B&aşlat @@ -7148,7 +7178,7 @@ Debug Message: - + R&ecord K&aydet @@ -7239,7 +7269,7 @@ Debug Message: - + None @@ -7265,722 +7295,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected Bozuk Vulkan Kurulumu Algılandı - + Vulkan initialization failed during boot. Açılış sırasında Vulkan başlatma işlemi başarısız oldu. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Bir oyun çalıştırılıyor - + Loading Web Applet... Web Uygulaması Yükleniyor... - - + + Disable Web Applet Web Uygulamasını Devre Dışı Bırak - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute Sesi aç - + Mute Sessize al - + Reset Volume Sesi Sıfırla - + + Configure Effects... + + + + &Clear Recent Files &Son Dosyaları Temizle - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL URL açılırken hata oluştu - + Unable to open the URL "%1". - + TAS Recording TAS İşlemi Kaydı - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Mevcut Amiibo kaldırıldı - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted Donanım Yazılımı/Firmware Bozuk - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 TAS durumu: %1/%2 Çalışıyor - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor Ölçek: %1x - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7988,74 +8033,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/uk.ts b/dist/languages/uk.ts index ecaec4fa23..055787457d 100644 --- a/dist/languages/uk.ts +++ b/dist/languages/uk.ts @@ -593,12 +593,22 @@ SMAA забезпечує найкращу якість. FXAA може створювати стабільніше зображення при низьких роздільностях. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Повноекранний режим: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -607,12 +617,12 @@ Exclusive fullscreen may offer better performance and better Freesync/Gsync supp «Ексклюзивний повноекранний» може надати кращі продуктивність і підтримку Freesync/Gsync. - + Aspect Ratio: Співвідношення сторін: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -621,36 +631,36 @@ Also controls the aspect ratio of captured screenshots. Також керує співвідношеням сторін знімків екрана. - + Use persistent pipeline cache Використовувати стійкий кеш конвеєра - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. Дозволяє зберігати шейдери на накопичувачі для швидшого завантаження під час наступних запусків гри. Вимкнення цього налаштування задумане лише для зневадження. - + Use asynchronous GPU emulation Використовувати асинхронну емуляцію ГП - + Uses an extra CPU thread for rendering. This option should always remain enabled. Використовує додатковий потік ЦП для візуалізації. Це налаштування повинно завжди залишатися увімкненим. - + NVDEC emulation: Емуляція NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -659,12 +669,12 @@ In most cases, GPU decoding provides the best performance. У більшості випадків декодування за допомогою ГП забезпечує найкращу продуктивність. - + ASTC Decoding Method: Метод декодування ASTC: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -676,12 +686,12 @@ stuttering but may present artifacts. Асинхронно ЦП: Використання ЦП для декодування ASTC-текстур по мірі їх викликів. Повністю усуває затримки декодування ASTC ціною проблем з візуалізацією, поки текстури декодуються. - + ASTC Recompression Method: Метод перестиснення ASTC: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -689,44 +699,44 @@ BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, BC1/BC3: Проміжний формат буде перепаковано у формат BC1 або BC3 для збереження відеопам’яті, але це негатривно вплине на якість зображення. - + Frame Pacing Mode (Vulkan only) Режим виведення кадрів (лише Vulkan) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. Керує тим, як емулятор виконує виведення кадрів, щоб зменшити затримки й забезпечити плавнішу й стабільнішу частоту кадрів. - + VRAM Usage Mode: Режим використання відеопам’яті: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. Це налаштування вибирає, чи повинен емулятор надавати перевагу заощадженню пам’яті, чи по максимуму використовувати доступну відеопам’ять задля продуктивності. Режим «Агресивно» може вплинути на продуктивність інших застосунків, як-от засоби запису. - + Skip CPU Inner Invalidation Пропускати внутрішнє анулювання ЦП - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. Пропускає деякі анулювання кешу під час оновлень пам’яті, зменшуючи використання ЦП й виправляючи затримки. Це може спричинити збої. - + VSync Mode: Режим вертикальної синхронізації: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -737,12 +747,12 @@ Mailbox може мати меншу затримку, ніж FIFO, і не ма Immediate (без синхронізації) показує всі кадри й може створювати розриви. - + Sync Memory Operations Синхронізувати операції з пам’яттю - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -751,44 +761,44 @@ Unreal Engine 4 games often see the most significant changes thereof. Ігри на Unreal Engine 4 часто зазнають найзначніших змін. - + Enable asynchronous presentation (Vulkan only) Увімкнути асинхронне подання (лише Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Трохи покращує продуктивність завдяки переміщенню подання на окремий потік ЦП. - + Force maximum clocks (Vulkan only) Примусово максимальна тактова частота (лише Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Виконує роботу у фоновому режимі в очікуванні графічних команд, не даючи змоги ГП знижувати тактову частоту. - + Anisotropic Filtering: Анізотропна фільтрація: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Керує якістю візуалізації текстур під непрямими кутами. Для більшості ГП можна вільно вибирати 16x. - + GPU Mode: Режим ГП: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -797,24 +807,24 @@ Particles tend to only render correctly with Accurate mode. Частинки зазвичай правильно візуалізуються лише з режимом «Точно». - + DMA Accuracy: Точність DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -824,55 +834,55 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation Увімкнути асинхронну компіляцію шейдерів - + May reduce shader stutter. Може зменшити шейдерні затримки. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle Розпакування за допомогою ГП - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Прискорює декодування 3D-текстур BCn застосовуючи обчислення за допомогою ГП. Вимкніть у разі збоїв або проблем із графікою. - + GPU Unswizzle Max Texture Size Максимальний розмір текстур для розпакування за допомогою ГП - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -881,48 +891,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size Розмір потоку розпакування за допомогою ГП - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Встановлює максимальний обсяг даних текстур (у МіБ) для обробки на кадр. Вищі значення здатні зменшити затримки під час завантаження текстур, але можуть вплинути на стабільність кадрів. - + GPU Unswizzle Chunk Size Розмір блоків розпакування за допомогою ГП - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Визначає кількість зрізів глибини, оброблених за одне відправлення. Збільшення здатне покращити пропускну здатність на потужних ГП, але може призвести до TDR або затримок драйвера зі слабшим устаткуванням. - + Use Vulkan pipeline cache Використовувати кеш конвеєра Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Вмикає особливий для різних виробників ГП кеш конвеєра. Це налаштування може значно зменшити час завантаження шейдерів у випадках, коли драйвер Vulkan не зберігає власний кеш конвеєра. - + Enable Compute Pipelines (Intel Vulkan Only) Увімкнути обчислювальні конвеєри (лише Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -931,194 +941,194 @@ Compute pipelines are always enabled on all other drivers. Обчислювальні конвеєри завжди увімкнені у всіх інших драйверах. - + Enable Reactive Flushing Увімкнути реактивне очищення - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Використовує реактивне очищення замість прогнозованого, забезпечуючи точнішу синхронізацію пам’яті. - + Sync to framerate of video playback Синхронізувати частоту кадрів з відтворенням відео - + Run the game at normal speed during video playback, even when the framerate is unlocked. Відтворювати гру з нормальною швидкістю під час відтворення відео навіть при розблокованій частоті кадрів. - + Barrier feedback loops Бар’єрні цикли відгуку - + Improves rendering of transparency effects in specific games. Покращує візуалізацію ефектів прозорості в деяких іграх. - + Enable buffer history Увімкнути історію буфера - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Вмикає доступ до попередніх станів буфера. Цей параметр може покращити якість візуалізації та стабільну продуктивність у деяких іграх. - + Fix bloom effects Виправити ефекти світіння - + Removes bloom in Burnout. Прибирає світіння в Burnout. - + Enable Legacy Rescale Pass Увімкнути застаріле масштабування - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Може виправити проблеми з масштабуванням в іграх, покладаючись на поведінку з попередньої імплементації. Застаріле масштабування виправляє артефакти з лініями на ГП від AMD та Intel, а також сіре блимання текстур на ГП від Nvidia в Luigis Mansion 3. - + Extended Dynamic State Розширений динамічний стан - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Керує кількістю функцій, які можна використовувати в «Розширеному динамічному стані». Вищі значення допускають більше функцій і можуть збільшити продуктивність, але можуть спричинити додаткові проблеми з графікою. - + Vertex Input Dynamic State Динамічний стан введення вершин - + Enables vertex input dynamic state feature for better quality and performance. Вмикає можливість динамічного стану введення вершин для кращих якості й продуктивності. - + Sample Shading Шейдинг зразків - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Дозволяє виконувати фрагмент шейдера для кожного зразка в багатозразковому фрагменті замість одного разу для кожного фрагмента. Покращує якість графікі ціною втрати продуктивності. Вищі значення покращують якість, але погіршують продуктивність. - + RNG Seed Початкове значення RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Керує початковим значення генератора випадкових чисел. Зазвичай використовується в спідранах. - + Device Name Назва пристрою - + The name of the console. Назва консолі. - + Homebrew Args Параметри запуску Homebrew - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Параметри командного рядка, що передаються Homebrew при запуску (як-от noglsl). - + Custom RTC Date: Користувацька дата RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Це налаштування дозволяє змінити час годинника консолі. Можна використовувати для маніпуляцій із часом в іграх. - + The number of seconds from the current unix time Кількість секунд від поточного unix-часу. - + Language: Мова: - + This option can be overridden when region setting is auto-select Це налаштування може перевизначитися, якщо налаштування регіону вибирається автоматично - + Region: Регіон: - + The region of the console. Регіон консолі. - + Time Zone: Часовий пояс: - + The time zone of the console. Часовий пояс консолі. - + Sound Output Mode: Режим виведення звуку: - + Console Mode: Режим консолі: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1127,1042 +1137,1042 @@ Setting to Handheld can help improve performance for low end systems. Налаштування «Портативний» може покращити продуктивність на слабких системах. - + Prompt for user profile on boot Запитувати профіль користувача під час запуску - + Useful if multiple people use the same PC. Корисно, якщо одним комп’ютером користуються кілька користувачів. - + Pause when not in focus Призупиняти, якщо не у фокусі - + Pauses emulation when focusing on other windows. Призупиняє емуляцію при фокусування на інших вікнах. - + Confirm before stopping emulation Підтверджувати зупинку емуляції - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Перевизначає запити на підтвердження зупинки емуляції. Увімкнення обходить такі запити й одразу зупиняє емуляцію. - + Hide mouse on inactivity Приховувати курсор миші при бездіяльності - + Hides the mouse after 2.5s of inactivity. Приховує курсор миші після 2,5 с її бездіяльності. - + Disable controller applet Вимкнути аплет контролера - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Примусово вимикає використання в емульованих програмах аплета контролера. Якщо програма спробує відкрити аплет контролера, він одразу закриється. - + Check for updates Перевіряти оновлення - + Whether or not to check for updates upon startup. Чи перевіряти оновлення при запуску. - + Enable Gamemode Увімкнути ігровий режим - + Force X11 as Graphics Backend Примусово використовувати X11 як графічний бекенд - + Custom frontend Користувацький фронтенд - + Real applet Справжній аплет - + Never Ніколи - + On Load При завантаженні - + Always Завжди - + CPU ЦП - + GPU ГП - + CPU Asynchronous Асинхронно ЦП - + Uncompressed (Best quality) Без стиснення (Найкраща якість) - + BC1 (Low quality) ВС1 (Низька якість) - + BC3 (Medium quality) ВС3 (Середня якість) - - + + Auto Автоматично - + 30 FPS 30 к/с - + 60 FPS 60 к/с - + 90 FPS 90 к/с - + 120 FPS 120 к/с - + Conservative Заощадження - + Aggressive Агресивно - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (асемблерні шейдери, лише NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (експериментально, лише AMD/Mesa) - + Null Нічого - + Fast Швидко - - - + + + Accurate Точно - - - + + + Default Стандартно - + Unsafe (fast) Небезпечно (швидко) - + Safe (stable) Безпечно (стабільно) - + Immediate - + Balanced Збалансовано - + Strict - + Unsafe Небезпечно - + Paranoid (disables most optimizations) Параноїк (вимикає більшість оптимізацій) - + Debugging Зневадження - + Dynarmic Динамічно - + NCE NCE - + Borderless Windowed Безрамкове вікно - + Exclusive Fullscreen Ексклюзивний повноекранний - + No Video Output Виведення відео відсутнє - + CPU Video Decoding Декодування відео на ЦП - + GPU Video Decoding (Default) Декодування відео на ГП (стандатно) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [ЕКСПЕРИМЕНТАЛЬНО] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [ЕКСПЕРИМЕНТАЛЬНО] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [ЕКСПЕРИМЕНТАЛЬНО] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [ЕКСПЕРИМЕНТАЛЬНО] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [ЕКСПЕРИМЕНТАЛЬНО] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Найближчий сусід - + Bilinear Білінійний - + Bicubic Бікубічний - + Gaussian Ґаусса - + Lanczos Ланцоша - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Області - + MMPX MMPX - + Zero-Tangent Нульовий тангенс - + B-Spline B-Spline - + Mitchell Мітчелла - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Немає - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Стандартно (16:9) - + Force 4:3 Примусово 4:3 - + Force 21:9 Примусово 21:9 - + Force 16:10 Примусово 16:10 - + Stretch to Window Розтягнути до вікна - + Automatic Автоматично - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Японська (日本語) - + American English Американська англійська - + French (français) Французька (français) - + German (Deutsch) Німецька (Deutsch) - + Italian (italiano) Італійська (italiano) - + Spanish (español) Іспанська (español) - + Chinese Китайська - + Korean (한국어) Корейська (한국어) - + Dutch (Nederlands) Нідерландська (Nederlands) - + Portuguese (português) Португальська (português) - + Russian (Русский) Російська (Русский) - + Taiwanese Тайванська - + British English Британська англійська - + Canadian French Канадська французька - + Latin American Spanish Латиноамериканська іспанська - + Simplified Chinese Спрощена китайська - + Traditional Chinese (正體中文) Традиційна китайська (正體中文) - + Brazilian Portuguese (português do Brasil) Бразильська португальська (português do Brasil) - + Polish (polska) Польська (polska) - + Thai (แบบไทย) Тайська (แบบไทย) - - + + Japan Японія - + USA США - + Europe Європа - + Australia Австралія - + China Китай - + Korea Корея - + Taiwan Тайвань - + Auto (%1) Auto select time zone Автоматично (%1) - + Default (%1) Default time zone Стандартно (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Куба - + EET EET - + Egypt Єгипет - + Eire Ейре - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Гринвіч - + Hongkong Гонконг - + HST HST - + Iceland Ісландія - + Iran Іран - + Israel Ізраїль - + Jamaica Ямайка - + Kwajalein Кваджалейн - + Libya Лівія - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Навахо - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Польща - + Portugal Португалія - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Сінгапур - + Turkey Туреччина - + UCT UCT - + Universal Універсальний - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Зулу - + Mono Моно - + Stereo Стерео - + Surround Об’ємний - + 4GB DRAM (Default) 4GB DRAM (стандартно) - + 6GB DRAM (Unsafe) 6GB DRAM (небезпечно) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (небезпечно) - + 12GB DRAM (Unsafe) 12GB DRAM (небезпечно) - + Docked У докстанції - + Handheld Портативний - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Завжди запитувати (стандартно) - + Only if game specifies not to stop Лише якщо гра вказує не зупиняти - + Never ask Ніколи не запитувати - + Very Small (16 MB) Дуже малий (16 МБ) - + Small (32 MB) Малий (32 МБ) - + Normal (128 MB) Нормальний (128 МБ) - + Large (256 MB) Великий (256 МБ) - + Very Large (512 MB) Дуже великий (512 МБ) - + Very Low (4 MB) Дуже низький (4 МБ) - + Low (8 MB) Низький (8 МБ) - + Normal (16 MB) Нормальний (16 МБ) - + Medium (32 MB) Середній (32 МБ) - + High (64 MB) Високий (64 МБ) - + Very Low (32) Дуже низький (32) - + Low (64) Низький (64) - + Normal (128) Нормальний (128) - + Medium (256) Середньо (256) - + High (512) Високо (512) - + Disabled Вимкнено - + ExtendedDynamicState 1 Розширений динамічний стан 1 - + ExtendedDynamicState 2 Розширений динамічний стан 2 - + ExtendedDynamicState 3 Розширений динамічний стан 3 - + Tree View Дерево вибору - + Grid View Таблиця @@ -3274,33 +3284,38 @@ Would you like to delete the old save data? Колір тла: - + % FSR/SGSR sharpening percentage (e.g. 50%) % - + + Configure Effects... + + + + Off Вимкнено - + VSync Off Вертикальну синхронізацію вимкнено - + Recommended Рекомендовано - + On Увімкнено - + VSync On Вертикальну синхронізацію увімкнено @@ -4927,102 +4942,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -7040,7 +7070,7 @@ Debug Message: - + &Pause [&P] Призупинити @@ -7191,7 +7221,7 @@ Debug Message: - + &Start [&S] Запустити @@ -7202,7 +7232,7 @@ Debug Message: - + R&ecord [&E] Запис @@ -7293,7 +7323,7 @@ Debug Message: - + None Жодного @@ -7319,400 +7349,405 @@ Debug Message: - + Small (32x32) Маленький (32х32) - + Standard (64x64) Стандартний (64х64) - + Large (128x128) Великий (128х128) - + Full Size (256x256) Повнорозмірний (256х256) - + Broken Vulkan Installation Detected Виявлено пошкоджене встановлення Vulkan - + Vulkan initialization failed during boot. Не вдалося ініціалізувати Vulkan під час запуску. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Запущено гру - + Loading Web Applet... Завантаження вебаплета... - - + + Disable Web Applet Вимкнути вебаплет - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Вимкнення вебапплета може призвести до несподіваної поведінки, і це слід робити лише для Super Mario 3D All-Stars. Ви впевнені, що хочете вимкнути вебапплет? (Його можна знову увімкнути в налаштуваннях зневадження.) - + The amount of shaders currently being built Кількість наразі створених шейдерів - + The current selected resolution scaling multiplier. Наразі вибраний множник масштабування роздільності. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Поточна швидкість емуляції. Значення вище або нижче 100% вказують на те, що емуляція йде швидше або повільніше, ніж на Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Частота кадрів, яку наразі показує гра. Значення змінюватиметься залежно від гри та з кожною сценою. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Час, потрібний для емуляції 1 кадру Switch, не враховуючи обмеження частоти кадрів або вертикальну синхронізацію. Для повношвидкісної емуляції значення повинно бути не вище 16,67 мс. - + Unmute Увімкнути звук - + Mute Вимкнути звук - + Reset Volume Скинути гучність - + + Configure Effects... + + + + &Clear Recent Files [&C] Очистити нещодавні файли - + &Continue [&C] Продовжити - + Warning: Outdated Game Format Увага: Застарілий формат гри - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Для цієї гри ви використовуєте формат теки з деконструйованим ROM, який є застарілим форматом, заміненим на інші, як-от NCA, NAX, XCI, або NSP. У тек із деконструйованими ROM немає значків, метаданих, а також вони не підтримують оновлення.<br>Для подробиць стосовно різноманітних форматів Switch, які підтримує Eden, ознайомтеся з нашим посібником користувача. Це повідомлення не буде показано знову. - - + + Error while loading ROM! Помилка під час завантаження ROM! - + The ROM format is not supported. Непідтримуваний формат ROM. - + An error occurred initializing the video core. Сталася помилка під час ініціалізації відеоядра. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Помилка під час завантаження ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Створіть новий дамп файлів або зверніться по допомогу в Discord/Stoat. - + An unknown error occurred. Please see the log for more details. Сталася невідома помилка. Ознайомтеся з журналом, щоб дізнатися подробиці. - - + + (64-bit) (64-бітовий) - - + + (32-bit) (32-бітовий) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Закриття програмного засобу... - + Save Data Дані збережень - + Mod Data Дані модів - + Error Opening %1 Folder Помилка під час відкриття теки «%1» - - + + Folder does not exist! Теки не існує! - + Remove Installed Game Contents? Вилучити встановлений вміст гри? - + Remove Installed Game Update? Вилучити встановлені оновлення гри? - + Remove Installed Game DLC? Вилучити встановлені доповнення гри? - + Remove Entry Вилучити запис - + Delete OpenGL Transferable Shader Cache? Видалити переміщуваний кеш шейдерів OpenGL? - + Delete Vulkan Transferable Shader Cache? Видалити переміщуваний кеш шейдерів Vulkan? - + Delete All Transferable Shader Caches? Видалити весь переміщуваний кеш шейдерів? - + Remove Custom Game Configuration? Вилучити користувацькі налаштування гри? - + Remove Cache Storage? Вилучити сховище кешу? - + Remove File Вилучити файл - + Remove Play Time Data Вилучити дані награного часу - + Reset play time? Скинути награний час? - - + + RomFS Extraction Failed! Не вдалося видобути RomFS! - + There was an error copying the RomFS files or the user cancelled the operation. Під час копіювання файлів RomFS сталася помилка або користувач скасував операцію. - + Full Повний - + Skeleton Скелет - + Select RomFS Dump Mode Виберіть режим створення дампу RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Виберіть, як ви хочете виконати дамп RomFS <br>Повний скопіює всі файли до нової теки, тоді як <br>скелет створить лише структуру тек. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root За адресою «%1» недостатньо вільного місця для видобування RomFS. Звільніть місце або виберіть іншу теку для створення дампу в «Емуляція» → «Налаштувати» → «Система» → «Файлова система» → «Коренева тека дампів». - + Extracting RomFS... Видобування RomFS... - - + + Cancel Скасувати - + RomFS Extraction Succeeded! RomFS видобуто успішно! - + The operation completed successfully. Операцію успішно виконано. - + Error Opening %1 Помилка під час відкриття «%1» - + Select Directory Вибрати теку - + Properties Властивості - + The game properties could not be loaded. Неможливо завантажити властивості гри. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Виконуваний файл Switch (%1);;Усі файли (*.*) - + Load File Завантажити файл - + Open Extracted ROM Directory Відкрити теку видобутого ROM - + Invalid Directory Selected Вибрано неправильну теку - + The directory you have selected does not contain a 'main' file. Вибрана тека не містить файлу «main». - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Встановлюваний файл Switch (*.nca, *.nsp, *.xci);;Архів вмісту Nintendo (*.nca);;Пакет подання Nintendo (*.nsp);;Образ картриджа NX (*.xci) - + Install Files Встановити файли - + %n file(s) remaining Лишився 1 файлЛишилося %n файлиЛишилося %n файлівЛишилося %n файлів - + Installing file "%1"... Встановлення файлу «%1»... - - + + Install Results Результати встановлення - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Щоб уникнути можливих конфліктів, ми не радимо користувачам встановлювати ігри в NAND. Користуйтеся цією функцією лише для встановлення оновлень і доповнень. - + %n file(s) were newly installed Щойно встановлено %n файл @@ -7722,7 +7757,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) were overwritten Перезаписано %n файл @@ -7732,7 +7767,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) failed to install Не вдалося встановити %n файл @@ -7742,314 +7777,324 @@ Please, only use this feature to install updates and DLC. - + System Application Системний застосунок - + System Archive Системний архів - + System Application Update Оновлення системного застосунку - + Firmware Package (Type A) Пакет прошивки (Тип А) - + Firmware Package (Type B) Пакет прошивки (Тип Б) - + Game Гра - + Game Update Оновлення гри - + Game DLC Доповнення гри - + Delta Title Проєкт «Дельта» - + Select NCA Install Type... Виберіть тип встановлення NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Виберіть тип проєкту, який ви хочете встановити для цього NCA: (У більшості випадків підходить стандартний вибір «Гра».) - + Failed to Install Не вдалося встановити - + The title type you selected for the NCA is invalid. Тип проєкту, який ви вибрали для NCA, неправильний. - + File not found Файл не виявлено - + File "%1" not found Файл «%1» не виявлено - + OK Гаразд - + Function Disabled Функцію вимкнену - + Compatibility list reporting is currently disabled. Check back later! Звітування для переліку сумісності наразі вимкнено. Зазирніть пізніше! - + Error opening URL Помилка під час відкриття URL - + Unable to open the URL "%1". Не вдалося відкрити URL: «%1». - + TAS Recording Записування TAS - + Overwrite file of player 1? Перезаписати файл гравця 1? - + Invalid config detected Виявлено неправильне налаштування - + Handheld controller can't be used on docked mode. Pro controller will be selected. Портативний контролер неможливо використовувати в режимі докстанції. Буде вибрано контролер Pro. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Поточний amiibo вилучено - + Error Помилка - - + + The current game is not looking for amiibos Поточна гра не очікує amiibo - + Amiibo File (%1);; All Files (*.*) Файл amiibo (%1);; Усі файли (*.*) - + Load Amiibo Завантажити amiibo - + Error loading Amiibo data Помилка під час завантаження даних amiibo - + The selected file is not a valid amiibo Вибраний файл не є дійсним amiibo - + The selected file is already on use Вибраний файл уже використовується - + An unknown error occurred Сталася невідома помилка - + No firmware available Немає доступних прошивок - + Firmware Corrupted Прошивка пошкоджена - + Unknown applet Невідомий аплет - + Applet doesn't map to a known value. Аплет не призначено до відомого значення. - + Record not found Запис не виявлено - + Applet not found. Please reinstall firmware. Аплет не виявлено. Перевстановіть прошивку. - + Capture Screenshot Зробити знімок екрана - + PNG Image (*.png) Зображення PNG (*.png) - + TAS state: Running %1/%2 Стан TAS: Працює %1/%2 - + TAS state: Recording %1 Стан TAS: Триває запис %1 - + TAS state: Idle %1/%2 Стан TAS: Бездіяльність %1/%2 - + TAS State: Invalid Стан TAS: Неправильний - + &Stop Running [&S] Зупинити - + Stop R&ecording [&E] Зупинити запис - + Building: %n shader(s) Компіляція: %n шейдерКомпіляція: %n шейдериКомпіляція: %n шейдерівКомпіляція: %n шейдерів - + Scale: %1x %1 is the resolution scaling factor Масштаб: %1x - + Speed: %1% / %2% Швидкість: %1% / %2% - + Speed: %1% Швидкість: %1% - + Game: %1 FPS Гра: %1 к/с - + Frame: %1 ms Кадр: %1 мс - + NO AA БЕЗ ЗГЛАДЖУВАННЯ - + + NO FX + + + + + FX + + + + VOLUME: MUTE ГУЧНІСТЬ: ВИМКНЕНО - + VOLUME: %1% Volume percentage (e.g. 50%) ГУЧНІСТЬ: %1% - + Derivation Components Missing Відсутні компоненти виведення - + Decryption keys are missing. Install them now? Відсутні ключі шифрування. Встановити їх зараз? - + Wayland Detected! Виявлено Wayland! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8060,74 +8105,74 @@ Would you like to force it for future launches? Хочете примусово увімкнути його для наступних запусків? - + Use X11 Використовувати X11 - + Continue with Wayland Продовжити з Wayland - + Don't show again Не показувати знову - + Restart Required Потрібен перезапуск - + Restart Eden to apply the X11 backend. Перезапуск Eden для застосування бекенду X11. - + Slow Сповільнення - + Turbo Прискорення - + Unlocked Розблоковано - + Select RomFS Dump Target Виберіть розташування для створення дампу RomFS - + Please select which RomFS you would like to dump. Виберіть, який дамп RomFS ви хочете створити. - + Are you sure you want to close Eden? Ви впевнені, що хочете закрити Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Ви впевнені, що хочете зупинити емуляцію? Увесь незбережений поступ буде втрачено. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/vi.ts b/dist/languages/vi.ts index 2fc96b21fe..a65e346ea0 100644 --- a/dist/languages/vi.ts +++ b/dist/languages/vi.ts @@ -571,70 +571,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Chế độ toàn màn hình: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: Tỉ lệ khung hình: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: Giả lập NVDEC: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -643,55 +653,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: Chế độ Vsync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -699,79 +709,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Bật hiển thị bất đồng bộ (chỉ cho Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) Buộc chạy ở xung nhịp tối đa (chỉ cho Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Chạy các công việc trong nền trong khi đang chờ lệnh đồ họa để giữ cho GPU không giảm xung nhịp. - + Anisotropic Filtering: Lọc bất đẳng hướng: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -781,1327 +791,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Dùng bộ nhớ đệm pipeline Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Bật xả tương ứng - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback Đồng bộ hóa với tốc độ khung hình khi phát video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Chạy game với tốc độ bình thường trong quá trình phát video, ngay cả khi tốc độ khung hình được mở khóa. - + Barrier feedback loops Vòng lặp phản hồi rào cản - + Improves rendering of transparency effects in specific games. Cải thiện hiệu quả kết xuất của hiệu ứng trong suốt trong một số game. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Hạt giống RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Tên thiết bị - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Vùng: - + The region of the console. - + Time Zone: Múi giờ: - + The time zone of the console. - + Sound Output Mode: Chế độ đầu ra âm thanh: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Ẩn con trỏ chuột khi không dùng - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Vô hiệu hoá applet tay cầm - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) Không nén (Chất lượng tốt nhất) - + BC1 (Low quality) BC1 (Chất lượng thấp) - + BC3 (Medium quality) BC3 (Chất lượng trung bình) - - + + Auto Tự động - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Chính xác - - - + + + Default Mặc định - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe Không an toàn - + Paranoid (disables most optimizations) Paranoid (vô hiệu hoá hầu hết sự tối ưu) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Cửa sổ không viền - + Exclusive Fullscreen Toàn màn hình - + No Video Output Không có đầu ra video - + CPU Video Decoding Giải mã video bằng CPU - + GPU Video Decoding (Default) Giải mã video bằng GPU (Mặc định) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [THỬ NGHIỆM] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [THỬ NGHIỆM] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Không có - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Mặc định (16:9) - + Force 4:3 Dùng 4:3 - + Force 21:9 Dùng 21:9 - + Force 16:10 Dùng 16:10 - + Stretch to Window Mở rộng đến cửa sổ - + Automatic Tự động - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Tiếng Nhật (日本語) - + American English Tiếng Anh Mỹ - + French (français) Tiếng Pháp (French) - + German (Deutsch) Tiếng Đức (Deutsch) - + Italian (italiano) Tiếng Ý (italiano) - + Spanish (español) Tiếng Tây Ban Nha (Español) - + Chinese Tiếng Trung - + Korean (한국어) Tiếng Hàn (한국어) - + Dutch (Nederlands) Tiếng Hà Lan (Nederlands) - + Portuguese (português) Tiếng Bồ Đào Nha (Portuguese) - + Russian (Русский) Tiếng Nga (Русский) - + Taiwanese Tiếng Đài Loan - + British English Tiếng Anh Anh - + Canadian French Tiếng Pháp Canada - + Latin American Spanish Tiếng Tây Ban Nha Mỹ Latinh - + Simplified Chinese Tiếng Trung giản thể - + Traditional Chinese (正體中文) Tiếng Trung phồn thể (正體中文) - + Brazilian Portuguese (português do Brasil) Tiếng Bồ Đào Nha Brasil (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Nhật Bản - + USA Hoa Kỳ - + Europe Châu Âu - + Australia Úc - + China Trung Quốc - + Korea Hàn Quốc - + Taiwan Đài Loan - + Auto (%1) Auto select time zone Tự động (%1) - + Default (%1) Default time zone Mặc định (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ai Cập - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hồng Kông - + HST HST - + Iceland Iceland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Ba Lan - + Portugal Bồ Đào Nha - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Thổ Nhĩ Kỳ - + UCT UCT - + Universal Quốc tế - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3201,33 +3211,38 @@ Would you like to delete the old save data? Màu nền: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Tắt - + VSync Off Tắt Vsync - + Recommended Đề xuất - + On Bật - + VSync On Bật Vsync @@ -4849,102 +4864,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6959,7 +6989,7 @@ Debug Message: - + &Pause &Tạm dừng @@ -7110,7 +7140,7 @@ Debug Message: - + &Start &Bắt đầu @@ -7121,7 +7151,7 @@ Debug Message: - + R&ecord G&hi lại @@ -7212,7 +7242,7 @@ Debug Message: - + None @@ -7238,722 +7268,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7961,74 +8006,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/vi_VN.ts b/dist/languages/vi_VN.ts index e81053b393..3dd8f18281 100644 --- a/dist/languages/vi_VN.ts +++ b/dist/languages/vi_VN.ts @@ -571,70 +571,80 @@ FXAA can produce a more stable picture in lower resolutions. - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: Chế độ Toàn màn hình: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. - + Aspect Ratio: Tỉ lệ khung hình: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: Giả lập NVDEC - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. - + ASTC Decoding Method: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -643,55 +653,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: Chế độ Vsync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -699,79 +709,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Bật hiển thị bất đồng bộ (chỉ dành cho Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) Buộc chạy ở xung nhịp tối đa (chỉ Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Chạy các công việc trong nền trong khi đang chờ lệnh đồ họa để giữ cho GPU không giảm xung nhịp. - + Anisotropic Filtering: Bộ lọc góc nghiêng: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -781,1327 +791,1327 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Dùng Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Bật xả tương ứng - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback Đồng bộ hóa với tốc độ khung hình khi phát video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Chạy game với tốc độ bình thường trong quá trình phát video, ngay cả khi tốc độ khung hình được mở khóa. - + Barrier feedback loops Vòng lặp phản hồi rào cản - + Improves rendering of transparency effects in specific games. Cải thiện hiệu quả hiển thị của hiệu ứng trong suốt trong một số trò chơi. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Hạt giống RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Tên thiết bị - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Vùng: - + The region of the console. - + Time Zone: Múi giờ: - + The time zone of the console. - + Sound Output Mode: Chế độ đầu ra âm thanh - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Ẩn con trỏ chuột khi không dùng - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Vô hiệu hoá applet tay cầm - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) Không nén (Chất lượng tốt nhất) - + BC1 (Low quality) BC1 (Chất lượng thấp) - + BC3 (Medium quality) BC3 (Chất lượng trung bình) - - + + Auto Tự động - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Tuyệt đối - - - + + + Default Mặc định - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe Tương đối - + Paranoid (disables most optimizations) Paranoid (vô hiệu hoá hầu hết sự tối ưu) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Cửa sổ không viền - + Exclusive Fullscreen Toàn màn hình - + No Video Output Không Video Đầu Ra - + CPU Video Decoding Giải mã video bằng CPU - + GPU Video Decoding (Default) Giải mã video bằng GPU (Mặc định) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [THỬ NGHIỆM] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [THỬ NGHIỆM] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian ScaleForce - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Trống - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Mặc định (16:9) - + Force 4:3 Dùng 4:3 - + Force 21:9 Dùng 21:9 - + Force 16:10 Dung 16:10 - + Stretch to Window Kéo dãn đến cửa sổ phần mềm - + Automatic Tự động - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Tiếng Nhật (日本語) - + American English Tiếng Anh Mỹ - + French (français) Tiếng Pháp (French) - + German (Deutsch) Tiếng Đức (Deutsch) - + Italian (italiano) Tiếng Ý (italiano) - + Spanish (español) Tiếng Tây Ban Nha (Spanish) - + Chinese Tiếng Trung - + Korean (한국어) Tiếng Hàn (한국어) - + Dutch (Nederlands) Tiếng Hà Lan (Dutch) - + Portuguese (português) Tiếng Bồ Đào Nha (Portuguese) - + Russian (Русский) Tiếng Nga (Русский) - + Taiwanese Tiếng Đài Loan - + British English Tiếng Anh UK (British English) - + Canadian French Tiếng Pháp Canada - + Latin American Spanish Tiếng Mỹ La-tinh - + Simplified Chinese Tiếng Trung giản thể - + Traditional Chinese (正體中文) Tiếng Trung phồn thể (正體中文) - + Brazilian Portuguese (português do Brasil) Tiếng Bồ Đào Nha của người Brazil (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Nhật Bản - + USA Hoa Kỳ - + Europe Châu Âu - + Australia Châu Úc - + China Trung Quốc - + Korea Hàn Quốc - + Taiwan Đài Loan - + Auto (%1) Auto select time zone Tự động (%1) - + Default (%1) Default time zone Mặc định (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ai Cập - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hồng Kông - + HST HST - + Iceland Iceland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Ba Lan - + Portugal Bồ Đào Nha - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Thổ Nhĩ Kỳ - + UCT UCT - + Universal Quốc tế - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Chế độ cắm TV - + Handheld Cầm tay - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3201,33 +3211,38 @@ Would you like to delete the old save data? Màu nền: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off Tắt - + VSync Off Tắt Vsync - + Recommended Đề xuất - + On Bật - + VSync On Bật Vsync @@ -4849,102 +4864,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6959,7 +6989,7 @@ Debug Message: - + &Pause &Tạm dừng @@ -7110,7 +7140,7 @@ Debug Message: - + &Start &Bắt đầu @@ -7121,7 +7151,7 @@ Debug Message: - + R&ecord G&hi @@ -7212,7 +7242,7 @@ Debug Message: - + None @@ -7238,722 +7268,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7961,74 +8006,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/zh_CN.ts b/dist/languages/zh_CN.ts index 2321ff89e0..29ff0fe772 100644 --- a/dist/languages/zh_CN.ts +++ b/dist/languages/zh_CN.ts @@ -594,12 +594,22 @@ SMAA 提供最佳质量。 FXAA 可以在较低分辨率下产生更稳定的画面。 - + + Enable post-processing effects + 开启后处理效果 + + + + Applies post-processing effects to the final image. + 给最终图像加上后处理效果。 + + + Fullscreen Mode: 全屏模式: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -608,12 +618,12 @@ Exclusive fullscreen may offer better performance and better Freesync/Gsync supp 独占全屏提供更好的性能和 Freesync/Gsync 支持。 - + Aspect Ratio: 屏幕纵横比: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. @@ -622,36 +632,36 @@ Also controls the aspect ratio of captured screenshots. 此设置同时控制捕获截图的高宽比。 - + Use persistent pipeline cache 使用持久管道缓存 - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. 将生成的着色器保存到硬盘,提高后续游戏过程中的着色器加载速度。 请仅在调试时禁用此项。 - + Use asynchronous GPU emulation 使用异步 GPU 模拟 - + Uses an extra CPU thread for rendering. This option should always remain enabled. 使用额外的 CPU 线程进行渲染。 此选项应始终保持启用状态。 - + NVDEC emulation: NVDEC 模拟方式: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -660,12 +670,12 @@ In most cases, GPU decoding provides the best performance. 大多数情况下,使用 GPU 解码将提供最好的性能。 - + ASTC Decoding Method: ASTC 纹理解码方式: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -678,12 +688,12 @@ CPU 异步模拟:使用 CPU 在 ASTC 纹理到达时对其进行解码。 消除 ASTC 解码带来的卡顿,但在解码时可能出现渲染问题。 - + ASTC Recompression Method: ASTC 纹理重压缩方式: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. @@ -692,44 +702,44 @@ BC1/BC3: 中间格式将被重新压缩为 BC1 或 BC3 格式,从而节省显存 但会降低图像质量。 - + Frame Pacing Mode (Vulkan only) 帧同步模式 (仅限 Vulkan) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. 控制模拟器如何管理帧同步,以减少卡顿,使帧率表现更加平稳顺滑。 - + VRAM Usage Mode: VRAM 使用模式: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. 选择模拟器是应优先节省内存还是最大限度地使用可用视频内存以提高性能。 激进模式可能会影响诸如录屏软件等其他应用程序的性能,。 - + Skip CPU Inner Invalidation 跳过 CPU 内部失效处理 - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. 在内存更新期间跳过某些缓存失效,从而降低 CPU 使用率并改善延迟。这可能导致软件崩溃。 - + VSync Mode: 垂直同步模式: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -740,12 +750,12 @@ Mailbox 的延迟可能比 FIFO 低且不会导致撕裂,但可能会丢帧。 Immediate (不同步) 会呈现全部可用内容,并可能出现撕裂。 - + Sync Memory Operations 同步内存操作 - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -754,44 +764,44 @@ Unreal Engine 4 games often see the most significant changes thereof. 虚幻 4 引擎的游戏通常会看到最显著的变化。 - + Enable asynchronous presentation (Vulkan only) 启用异步帧提交 (仅限 Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. 将帧提交移动到单独的 CPU 线程,略微提高性能。 - + Force maximum clocks (Vulkan only) 强制最大时钟 (仅限 Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. 在后台运行的同时等待图形命令,以防止 GPU 降低时钟速度。 - + Anisotropic Filtering: 各向异性过滤: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. 控制在斜角下纹理渲染的质量。 大多数 GPU 上设置为 16 倍是安全的。 - + GPU Mode: GPU 模式: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -799,12 +809,12 @@ Particles tend to only render correctly with Accurate mode. 大多数游戏在“快速”模式下渲染效果良好,但有些游戏仍需使用“精确”模式。而粒子效果通常只有在“精确”模式下才能正确渲染。 - + DMA Accuracy: DMA 精度: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -813,12 +823,12 @@ Default follows the GPU Accuracy setting. 默认使用 GPU 精度设置。 - + GPU Fence Behavior: GPU 围栏行为: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -833,55 +843,55 @@ Default follows the GPU Accuracy setting. 默认遵循 GPU “精确”设定。 - + Enable GPU buffer readback 开启 GPU 缓冲区回读 - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. 通过在上传前读取来保留 GPU 修改的数据。 某些游戏需要这样才能正确渲染某些效果。 - + Enable asynchronous shader compilation 开启异步着色器编译 - + May reduce shader stutter. 可能减少着色器卡顿。 - + GPU Clocks GPU 时钟频率 - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. 通过让游戏误以为 GPU 的处理速度比实际更快,以避免游戏为了适应 Switch 的时钟频率而降低分辨率和渲染距离。 - + GPU Unswizzle GPU 还原 - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. 利用 GPU 计算来加速 BCn 格式 3D 纹理的解码。如果遇到崩溃或画面花屏,请禁用此项。 - + GPU Unswizzle Max Texture Size GPU 还原最大纹理尺寸 - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -890,48 +900,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size GPU 还原流大小 - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. 设置每帧处理的纹理数据最大量(单位:MiB)。 较高的数值可以减少纹理加载时的卡顿,但可能会影响帧率的稳定性(即造成帧时间波动)。 - + GPU Unswizzle Chunk Size GPU 还原块大小 - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. 确定在单次调度(Dispatch)中处理的深度切片(Depth Slices)数量。 增加此数值可以提高高端 GPU 的吞吐量(处理效率),但在性能较弱的硬件上可能会引发 TDR(驱动程序重置)或驱动超时。 - + Use Vulkan pipeline cache 启用 Vulkan 管线缓存 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. 启用 GPU 供应商专用的管线缓存。 在 Vulkan 驱动程序内部不存储管线缓存的情况下,此选项可显著提高着色器加载速度。 - + Enable Compute Pipelines (Intel Vulkan Only) 启用计算管线 (仅限 Intel 显卡 Vulkan 模式) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -940,193 +950,193 @@ Compute pipelines are always enabled on all other drivers. 在所有其他驱动程序上始终启用计算管线。 - + Enable Reactive Flushing 启用反应性刷新 - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. 使用反应性刷新取代预测性刷新,从而更精确地同步内存。 - + Sync to framerate of video playback 播放视频时帧率同步 - + Run the game at normal speed during video playback, even when the framerate is unlocked. 在视频播放期间以正常速度运行游戏,即使帧率未锁定。 - + Barrier feedback loops 屏障反馈环路 - + Improves rendering of transparency effects in specific games. 改进某些游戏中透明效果的渲染。 - + Enable buffer history 启用缓冲区历史 - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. 允许访问之前的缓冲状态。 这个选项可能会提升某些游戏的渲染质量和性能一致性。 - + Fix bloom effects 修复泛光效果 - + Removes bloom in Burnout. 去除《火爆狂飙》中的泛光特效。 - + Enable Legacy Rescale Pass 启用旧版缩放 - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. 通过依赖之前实现的行为,可能会修复部分游戏的缩放重叠问题。 修复 AMD 和 Intel 显卡上的线条伪影,以及《路易斯洋楼3》中 Nvidia 显卡的灰色纹理闪烁的遗留行为变通方法。 - + Extended Dynamic State 扩展动态状态 - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. 控制在扩展动态状态中可使用的函数数量。更高的数值允许启用更多功能,并可能提升性能,但同时也可能导致额外的图形问题。 - + Vertex Input Dynamic State 顶点输入动态状态 - + Enables vertex input dynamic state feature for better quality and performance. 开启顶点输入动态状态功能来获得更好的质量和性能。 - + Sample Shading 采样着色 - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. 允许片段着色器在多重采样的片段中每个样本执行一次而不是每个片段执行一次。可以提高图形质量,但会降低性能。 更高的值可以提高质量但会降低性能。 - + RNG Seed 随机数生成器种子 - + Controls the seed of the random number generator. Mainly used for speedrunning. 控制随机数生成器的种子。 主要用于竞速游戏。 - + Device Name 设备名称 - + The name of the console. 主机的数量。 - + Homebrew Args 自制软件参数 - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). 启动 homebrew 时需要传递的命令行参数 (例如 -noglsl)。 - + Custom RTC Date: 自定义系统时间: - + This option allows to change the clock of the console. Can be used to manipulate time in games. 此选项允许更改控制台的时钟。 可用于操纵游戏中的时间。 - + The number of seconds from the current unix time 来自当前 unix 时间的秒数。 - + Language: 语言: - + This option can be overridden when region setting is auto-select 当区域设置为自动选择时可以使用此选项替代。 - + Region: 地区: - + The region of the console. 主机的区域。 - + Time Zone: 时区: - + The time zone of the console. 主机的时区。 - + Sound Output Mode: 声音输出模式: - + Console Mode: 控制台模式: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1135,1042 +1145,1042 @@ Setting to Handheld can help improve performance for low end systems. 将设置为掌机模式可以帮助低端系统提高性能。 - + Prompt for user profile on boot 启动时提示选择用户账户 - + Useful if multiple people use the same PC. 在多人使用相同的 PC 时有效。 - + Pause when not in focus 在丢失焦点时暂停 - + Pauses emulation when focusing on other windows. 当焦点位于其它窗口时暂停模拟器。 - + Confirm before stopping emulation 停止模拟时需要确认 - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. 替代提示以确认停止模拟。 启用它将绕过此类提示并直接退出模拟。 - + Hide mouse on inactivity 自动隐藏鼠标光标 - + Hides the mouse after 2.5s of inactivity. 在 2.5 秒无活动后隐藏鼠标。 - + Disable controller applet 禁用控制器小程序 - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. 强制禁止在模拟程序中使用控制器小程序。 当程序尝试打开控制器小程序时,它会立即被关闭。 - + Check for updates 检查更新 - + Whether or not to check for updates upon startup. 在启动时是否检查更新。 - + Enable Gamemode 启用游戏模式 - + Force X11 as Graphics Backend 强制使用 X11 作为图形后端 - + Custom frontend 自定义前端 - + Real applet 真实的小程序 - + Never 永不 - + On Load 加载时 - + Always 总是 - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 异步模拟 - + Uncompressed (Best quality) 不压缩 (最高质量) - + BC1 (Low quality) BC1 (低质量) - + BC3 (Medium quality) BC3 (中等质量) - - + + Auto 自动 - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative 保守模式 - + Aggressive 激进模式 - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (汇编着色器,仅限 NVIDIA 显卡) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (实验性,仅限 AMD/Mesa) - + Null 无 - + Fast 高速 - - - + + + Accurate 高精度 - - - + + + Default 系统默认 - + Unsafe (fast) 不安全(快速) - + Safe (stable) 安全(稳定) - + Immediate 即时 - + Balanced 平衡 - + Strict 严格 - + Unsafe 低精度 - + Paranoid (disables most optimizations) 偏执模式 (禁用绝大多数优化项) - + Debugging 调试 - + Dynarmic 动态编译 - + NCE 本机代码执行 - + Borderless Windowed 无边框窗口 - + Exclusive Fullscreen 独占全屏 - + No Video Output 无视频输出 - + CPU Video Decoding CPU 视频解码 - + GPU Video Decoding (Default) GPU 视频解码 (默认) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [实验性] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [实验性] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [实验性] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [实验性] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [实验性] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 近邻取样 - + Bilinear 双线性过滤 - + Bicubic 双三线过滤 - + Gaussian 高斯模糊 - + Lanczos Lanczos - + ScaleForce 强制缩放 - + AMD FidelityFX Super Resolution AMD FidelityFX 超级分辨率 - + Area 区域 - + MMPX MMPX - + Zero-Tangent 零切线 - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution 骁龙游戏超级分辨率 - + Snapdragon Game Super Resolution EdgeDir 骁龙游戏超级分辨率 EdgeDir - + None 无 - + FXAA 快速近似抗锯齿 - + SMAA 子像素形态学抗锯齿 - + Default (16:9) 默认 (16:9) - + Force 4:3 强制 4:3 - + Force 21:9 强制 21:9 - + Force 16:10 强制 16:10 - + Stretch to Window 拉伸窗口 - + Automatic 自动 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日语 (日本語) - + American English 美式英语 - + French (français) 法语 (français) - + German (Deutsch) 德语 (Deutsch) - + Italian (italiano) 意大利语 (italiano) - + Spanish (español) 西班牙语 (español) - + Chinese 中文 - + Korean (한국어) 韩语 (한국어) - + Dutch (Nederlands) 荷兰语 (Nederlands) - + Portuguese (português) 葡萄牙语 (português) - + Russian (Русский) 俄语 (Русский) - + Taiwanese 台湾中文 - + British English 英式英语 - + Canadian French 加拿大法语 - + Latin American Spanish 拉美西班牙语 - + Simplified Chinese 简体中文 - + Traditional Chinese (正體中文) 繁体中文 (正體中文) - + Brazilian Portuguese (português do Brasil) 巴西-葡萄牙语 (português do Brasil) - + Polish (polska) 波兰语(波兰语) - + Thai (แบบไทย) 泰语 - - + + Japan 日本 - + USA 美国 - + Europe 欧洲 - + Australia 澳大利亚 - + China 中国 - + Korea 韩国 - + Taiwan 台湾地区 - + Auto (%1) Auto select time zone 自动 (%1) - + Default (%1) Default time zone 默认 (%1) - + CET 欧洲中部时间 - + CST6CDT 古巴标准时间&古巴夏令时 - + Cuba 古巴 - + EET 东欧时间 - + Egypt 埃及 - + Eire 爱尔兰 - + EST 东部标准时间 - + EST5EDT 东部标准时间&东部夏令时 - + GB 英国 - + GB-Eire 英国-爱尔兰时间 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 格林威治 - + Hongkong 香港 - + HST 美国夏威夷时间 - + Iceland 冰岛 - + Iran 伊朗 - + Israel 以色列 - + Jamaica 牙买加 - + Kwajalein 夸贾林环礁 - + Libya 利比亚 - + MET 中欧时间 - + MST 山区标准时间 (北美) - + MST7MDT 山区标准时间&山区夏令时 (北美) - + Navajo 纳瓦霍 - + NZ 新西兰时间 - + NZ-CHAT NZ-CHAT - + Poland 波兰 - + Portugal 葡萄牙 - + PRC 中国标准时间 - + PST8PDT 太平洋标准时间&太平洋夏令时 - + ROC 台湾时间 - + ROK 韩国时间 - + Singapore 新加坡 - + Turkey 土耳其 - + UCT UCT - + Universal 世界时间 - + UTC 协调世界时 - + W-SU 欧洲-莫斯科时间 - + WET 西欧时间 - + Zulu 祖鲁 - + Mono 单声道 - + Stereo 立体声 - + Surround 环绕声 - + 4GB DRAM (Default) 4GB DRAM (默认) - + 6GB DRAM (Unsafe) 6GB DRAM (不安全) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (不安全) - + 12GB DRAM (Unsafe) 12GB DRAM (不安全) - + Docked 主机模式 - + Handheld 掌机模式 - - + + Normal 正常 - - + + Boost 升频 - - + + Overclock 超频 - + Always ask (Default) 总是询问 (默认) - + Only if game specifies not to stop 仅当游戏不希望停止时 - + Never ask 从不询问 - + Very Small (16 MB) 很小 (16 MB) - + Small (32 MB) 较小 (32 MB) - + Normal (128 MB) 正常 (128 MB) - + Large (256 MB) 较大 (256 MB) - + Very Large (512 MB) 很大 (512 MB) - + Very Low (4 MB) 很低 (4 MB) - + Low (8 MB) 低 (8 MB) - + Normal (16 MB) 正常 (16 MB) - + Medium (32 MB) 中 (32 MB) - + High (64 MB) 高 (64 MB) - + Very Low (32) 很低 (32) - + Low (64) 低 (64) - + Normal (128) 正常 (128) - + Medium (256) 中(256) - + High (512) 高(512) - + Disabled 禁用 - + ExtendedDynamicState 1 扩展动态状态 1 - + ExtendedDynamicState 2 扩展动态状态 2 - + ExtendedDynamicState 3 扩展动态状态 3 - + Tree View 树景视图 - + Grid View 网格视图 @@ -3270,33 +3280,38 @@ Would you like to delete the old save data? 背景颜色: - + % FSR/SGSR sharpening percentage (e.g. 50%) % - + + Configure Effects... + 配置效果... + + + Off 关闭 - + VSync Off 垂直同步关 - + Recommended 推荐 - + On 开启 - + VSync On 垂直同步开 @@ -4918,108 +4933,124 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t Post-Processing Effects - + 后处理效果 - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. - + Changes apply immediately while a game is running. + 更改会在游戏运行时立即生效。 - + Enable post-processing - + 开启后处理 - + Preset: - + 预设: - + Apply - + 应用 - + Reset Values - + 重置值 - + Return every effect to the values the preset ships with. - + 把每个效果恢复到预设的默认值 - + Save As... - + 另存为... - + Save Preset - + 保存预设 - + Preset name: - + 预设名称: - - Delete - + + Clear + 清除 - + + Remove every effect in use and deselect the preset. + 移除所有使用中的效果并取消选择预设。 + + + Add Effect - + 添加效果 - - Custom chain. Pick a preset above and press Apply to replace it. - + + None + 无 + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + 没有使用中的效果。请选择一个预设并点击应用,或一个一个地添加效果。 + Custom chain. Pick a preset above and press Apply to replace it. + 自定义链。选择上面的预设并点击应用替换它。 + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + 活动的预设: %1 (已修改)。按重置值可以恢复出厂设置。 - + Active preset: %1 - + 活动的预设: %1 - + Enabled - + 开启 - + Disabled - + 关闭 - + Reset to defaults - + 重置为默认值 - + Effect '%1' was not found. - + 找不到效果 '%1'。 - + Effect failed to compile: %1 - + 编译效果失败: +%1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. - + 找不到可用的 ReShade FX 效果。请将 .fx 文件放到 post_shaders 文件夹中。 @@ -7033,7 +7064,7 @@ Debug Message: - + &Pause 暂停 (&P) @@ -7135,7 +7166,7 @@ Debug Message: &User Handbook - + 用户手册(&U) @@ -7184,7 +7215,7 @@ Debug Message: - + &Start 开始 (&S) @@ -7195,7 +7226,7 @@ Debug Message: - + R&ecord 录制 (&E) @@ -7286,7 +7317,7 @@ Debug Message: - + None 无 @@ -7304,7 +7335,7 @@ Debug Message: Post-Processing &Shaders... - + 后处理效果着色器(&S)... @@ -7312,727 +7343,742 @@ Debug Message: 轮播视图(&C) - + Small (32x32) 小 (32x32) - + Standard (64x64) 标准 (64x64) - + Large (128x128) 大 (128x128) - + Full Size (256x256) 最大 (256x256) - + Broken Vulkan Installation Detected 检测到损坏的 Vulkan 安装 - + Vulkan initialization failed during boot. 在启动时初始化 Vulkan 失败。 - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping 运行游戏 - + Loading Web Applet... 正在加载 Web 小程序... - - + + Disable Web Applet 禁用 Web 小程序 - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) 禁用网页小程序可能会导致未定义的行为并且应仅在 超级马里奥 3D 全明星中使用。您确定要禁用网页小程序吗? (这可以在调试设置中重新启用。) - + The amount of shaders currently being built 当前正在构建的着色器数量 - + The current selected resolution scaling multiplier. 当前选择的分辨率缩放倍数。 - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. 当前模拟速度。高于或低于 100% 的数值表示模拟运行比 Switch 快或慢。 - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. 游戏当前显示的每秒帧数。这个数值会因游戏和场景的不同而有所变化。 - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. 模拟 Switch 一帧所需的时间,不包括帧限制或垂直同步。为了全速模拟这个时间最多应为 16.67 毫秒。 - + Unmute 取消静音 - + Mute 静音 - + Reset Volume 重置音量 - + + Configure Effects... + 配置效果... + + + &Clear Recent Files 清除最近的文件(&C) - + &Continue 继续(&C) - + Warning: Outdated Game Format 警告: 游戏格式过时 - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. 您正在为此游戏使用解包 ROM 目录格式,这是一种已过时的格式,它已被 NCA、NAX、XCI 或 NSP 等其他格式取代。解包 ROM 目录缺少图标、元数据和更新支持。<br>有关 Eden 支持的各种 Switch 格式的说明请查阅我们的用户手册。此消息将不再显示。 - - + + Error while loading ROM! 加载 ROM 时出错! - + The ROM format is not supported. 不支持该 ROM 格式。 - + An error occurred initializing the video core. 初始化视频核心时发生错误。 - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + 这通常是因为过时的 GPU 驱动所导致的。具体情况请查看日志。请查阅: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>如何访问日志文件</a>。 - + Error while loading ROM! %1 %1 signifies a numeric error code. 加载 ROM 时出错! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>请重新导出您的文件,或在 Discord/Stoat 上寻求帮助。 - + An unknown error occurred. Please see the log for more details. 发生未知错误。请查看日志以获取更多详情。 - - + + (64-bit) (64 位) - - + + (32-bit) (32 位) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... 正在关闭软件... - + Save Data 存档数据 - + Mod Data Mod 数据 - + Error Opening %1 Folder 打开 %1 文件夹出错 - - + + Folder does not exist! 文件夹不存在! - + Remove Installed Game Contents? 是否移除已安装的游戏内容? - + Remove Installed Game Update? 是否移除已安装的游戏更新? - + Remove Installed Game DLC? 是否移除已安装的游戏 DLC? - + Remove Entry 删除条目 - + Delete OpenGL Transferable Shader Cache? 要删除 OpenGL 可传输着色器缓存吗? - + Delete Vulkan Transferable Shader Cache? 要删除 Vulkan 可传输着色器缓存吗? - + Delete All Transferable Shader Caches? 删除所有可传输的着色器缓存? - + Remove Custom Game Configuration? 是否移除自定义游戏配置? - + Remove Cache Storage? 要清除缓存存储吗? - + Remove File 删除文件 - + Remove Play Time Data 删除游戏时间数据 - + Reset play time? 要重置播放时间吗? - - + + RomFS Extraction Failed! RomFS 提取失败! - + There was an error copying the RomFS files or the user cancelled the operation. 复制 RomFS 文件时出错或用户取消了操作。 - + Full 完整 - + Skeleton 结构 - + Select RomFS Dump Mode 选择 RomFS 转储模式 - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. 请选择您希望如何导出 RomFS。<br>&quot;完整&quot; 将把所有文件复制到新的目录中,而<br>&quot;结构&quot; 仅会创建目录结构。</br></br> - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root %1 的可用空间不足,无法提取 RomFS。请释放空间或在模拟 > 配置 > 系统 > 文件系统 > 转储根目录,中选择其它目录 - + Extracting RomFS... 正在提取 RomFS... - - + + Cancel 取消 - + RomFS Extraction Succeeded! RomFS 提取成功! - + The operation completed successfully. 操作已成功完成。 - + Error Opening %1 打开 %1 时出错 - + Select Directory 选择目录 - + Properties 属性 - + The game properties could not be loaded. 无法加载游戏属性。 - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Switch 可执行文件 (%1);;所有文件 (*.*) - + Load File 加载文件 - + Open Extracted ROM Directory 打开已提取的 ROM 目录 - + Invalid Directory Selected 选择的目录无效 - + The directory you have selected does not contain a 'main' file. 您选择的目录不包含 'main' 文件。 - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) 可安装的 Switch 文件 (*.nca *.nsp *.xci);;任天堂内容档案 (*.nca);;任天堂提交包 (*.nsp);;NX 卡带镜像 (*.xci) - + Install Files 安装文件 - + %n file(s) remaining 剩余 %n 个文件 - + Installing file "%1"... 正在安装文件 "%1"... - - + + Install Results 安装结果 - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. 为了避免可能的冲突,我们不鼓励用户将基础游戏安装到 NAND。 请仅使用此功能来安装更新和 DLC。 - + %n file(s) were newly installed 已新安装 %n 个文件 - + %n file(s) were overwritten 已覆盖了 %n 个文件 - + %n file(s) failed to install %n 个文件安装失败 - + System Application 系统应用 - + System Archive 系统档案 - + System Application Update 系统应用更新 - + Firmware Package (Type A) 固件包 (类型 A) - + Firmware Package (Type B) 固件包 (类型 B) - + Game 游戏 - + Game Update 游戏更新 - + Game DLC 游戏可下载内容 - + Delta Title Delta 标题 - + Select NCA Install Type... 选择 NCA 安装类型... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) 请选择您希望将此 NCA 安装为的标题类型: (在大多数情况下,默认的 '游戏' 就可以。) - + Failed to Install 安装失败 - + The title type you selected for the NCA is invalid. 您为 NCA 选择的标题类型无效。 - + File not found 找不到文件 - + File "%1" not found 未找到文件 "%1" - + OK 确定 - + Function Disabled 功能已被关闭 - + Compatibility list reporting is currently disabled. Check back later! 兼容性列表报告目前已被禁用。请稍后再查看! - + Error opening URL 打开网址出错 - + Unable to open the URL "%1". 无法打开 URL "%1"。 - + TAS Recording TAS 录像 - + Overwrite file of player 1? 要覆盖玩家 1 的文件吗? - + Invalid config detected 检测到无效配置 - + Handheld controller can't be used on docked mode. Pro controller will be selected. 手柄在主机模式下无法使用。将选择 Pro 手柄。 - - + + Amiibo Amiibo - - + + The current amiibo has been removed 当前的 amiibo 已被移除 - + Error 错误 - - + + The current game is not looking for amiibos 当前游戏不支持寻找 amiibo - + Amiibo File (%1);; All Files (*.*) Amiibo 文件 (%1);; 所有文件 (*.*) - + Load Amiibo 读取 Amiibo - + Error loading Amiibo data 加载 Amiibo 数据出错 - + The selected file is not a valid amiibo 所选文件不是有效的 amiibo - + The selected file is already on use 所选文件正在使用中 - + An unknown error occurred 发生未知错误 - + No firmware available 没有可用的固件 - + Firmware Corrupted 固件已损坏 - + Unknown applet 未知小程序 - + Applet doesn't map to a known value. 无法识别该小程序对应的值。 - + Record not found 找不到记录程序 - + Applet not found. Please reinstall firmware. 找不到小程序。请重新安装固件。 - + Capture Screenshot 截取屏幕截图 - + PNG Image (*.png) PNG 图像 (*.png) - + TAS state: Running %1/%2 TAS 状态: 正在运行 %1/%2 - + TAS state: Recording %1 TAS 状态: 正在录制 %1 - + TAS state: Idle %1/%2 TAS 状态: 空闲 %1/%2 - + TAS State: Invalid TAS 状态: 无效 - + &Stop Running 停止运行(&S) - + Stop R&ecording 停止录制(&A) - + Building: %n shader(s) 正在编译:%n 个着色器 - + Scale: %1x %1 is the resolution scaling factor 缩放: %1x - + Speed: %1% / %2% 速度: %1% / %2% - + Speed: %1% 速度: %1% - + Game: %1 FPS 游戏: %1 FPS - + Frame: %1 ms 帧: %1 ms - + NO AA 无 AA - + + NO FX + 无 FX + + + + FX + FX + + + VOLUME: MUTE 音量: 静音 - + VOLUME: %1% Volume percentage (e.g. 50%) 音量: %1% - + Derivation Components Missing 缺少派生组件 - + Decryption keys are missing. Install them now? 缺少解密密钥。现在安装吗? - + Wayland Detected! 检测到 Wayland! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8043,74 +8089,74 @@ Would you like to force it for future launches? 您想要在未来的启动中强制执行吗? - + Use X11 使用 X11 - + Continue with Wayland 继续使用 Wayland - + Don't show again 不再显示 - + Restart Required 需要重新启动 - + Restart Eden to apply the X11 backend. 重新启动 Eden 以应用 X11 后端。 - + Slow 慢速 - + Turbo 加速 - + Unlocked 解锁 - + Select RomFS Dump Target 选择 RomFS 转储目标 - + Please select which RomFS you would like to dump. 请选择您想要转储的 RomFS。 - + Are you sure you want to close Eden? 您确实要关闭 Eden 吗? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. 您确定要停止模拟吗?任何未保存的进度将会丢失。 - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? @@ -9313,7 +9359,7 @@ p, li { white-space: pre-wrap; } This game may require firmware to function properly, and you don't have any installed. Please install firmware before launching, or press "OK" to launch anyways. - + 这个游戏可能需要固件才能正常运行,但您还没有安装任何固件。请在启动前安装固件,或者按 “确定” 继续启动。 diff --git a/dist/languages/zh_TW.ts b/dist/languages/zh_TW.ts index 3aa6892ac9..50b1b30118 100644 --- a/dist/languages/zh_TW.ts +++ b/dist/languages/zh_TW.ts @@ -592,12 +592,22 @@ SMAA的品質最佳 FXAA在低解析度下可以產生較穩定的畫面 - + + Enable post-processing effects + + + + + Applies post-processing effects to the final image. + + + + Fullscreen Mode: 全螢幕模式: - + The method used to render the window in fullscreen. Borderless offers the best compatibility with the on-screen keyboard that some games request for input. Exclusive fullscreen may offer better performance and better Freesync/Gsync support. @@ -606,47 +616,47 @@ Exclusive fullscreen may offer better performance and better Freesync/Gsync supp 獨佔全螢幕將提供更好的性能以及更佳的FreeSync/G-Sync支援 - + Aspect Ratio: 長寬比: - + Stretches the renderer to fit the specified aspect ratio. Most games only support 16:9, so modifications are required to get other ratios. Also controls the aspect ratio of captured screenshots. - + Use persistent pipeline cache - + Allows saving shaders to storage for faster loading on following game boots. Disabling it is only intended for debugging. 將產生的著色器快取儲存至硬碟,讓遊戲在後續過程中不需再次產生以提高速度 建議僅在偵錯時才停用此選項 - + Use asynchronous GPU emulation - + Uses an extra CPU thread for rendering. This option should always remain enabled. - + NVDEC emulation: NVDEC 模擬: - + Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance. @@ -655,12 +665,12 @@ In most cases, GPU decoding provides the best performance. GPU解碼在大多數情況下提供最好的性能 - + ASTC Decoding Method: ASTC解碼方式: - + This option controls how ASTC textures should be decoded. CPU: Use the CPU for decoding. GPU: Use the GPU's compute shaders to decode ASTC textures (recommended). @@ -669,55 +679,55 @@ stuttering but may present artifacts. - + ASTC Recompression Method: ASTC重新壓縮方式: - + Most GPUs lack support for ASTC textures and must decompress to anintermediate format: RGBA8. BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format, saving VRAM but degrading image quality. - + Frame Pacing Mode (Vulkan only) - + Controls how the emulator manages frame pacing to reduce stuttering and make the frame rate smoother and more consistent. - + VRAM Usage Mode: VRAM 使用模式: - + Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Aggressive mode may impact performance of other applications such as recording software. - + Skip CPU Inner Invalidation 跳過CPU內部失效處理 - + Skips certain cache invalidations during memory updates, reducing CPU usage and improving latency. This may cause soft-crashes. - + VSync Mode: 垂直同步: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -725,79 +735,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations 同步記憶體操作 - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) 啟用非同步顯示(僅限Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. 透過將畫面顯示移至獨立的CPU執行緒來略微提升性能。 - + Force maximum clocks (Vulkan only) 強制使用最大時脈(僅限Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. 在等待圖形命令時於背景執行任務以防GPU降低時脈 - + Anisotropic Filtering: 各向異性過濾: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -807,1328 +817,1328 @@ Default follows the GPU Accuracy setting. - + Enable GPU buffer readback - + Preserves GPU-modified data by reading it back before uploading. Some games require this to render certain effects properly. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache 启用 Vulkan 管线缓存 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. 启用 GPU 供应商专用的管线缓存。 在 Vulkan 驱动程序内部不存储管线缓存的情况下,此选项可显著提高着色器加载速度。 - + Enable Compute Pipelines (Intel Vulkan Only) 启用计算管线 (仅限 Intel 显卡 Vulkan 模式) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing 启用反应性刷新 - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. 使用反应性刷新取代预测性刷新,从而更精确地同步内存。 - + Sync to framerate of video playback 播放视频时帧率同步 - + Run the game at normal speed during video playback, even when the framerate is unlocked. 在视频播放期间以正常速度运行游戏,即使帧率未锁定。 - + Barrier feedback loops 屏障反馈循环 - + Improves rendering of transparency effects in specific games. 改进某些游戏中透明效果的渲染。 - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed 隨機種子 - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name 裝置名稱 - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: 自定义系统时间: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: 语言: - + This option can be overridden when region setting is auto-select - + Region: 區域: - + The region of the console. - + Time Zone: 時區: - + The time zone of the console. - + Sound Output Mode: 音訊輸出模式: - + Console Mode: 控制台模式: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation 停止模拟时需要确认 - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity 滑鼠閒置時自動隱藏 - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet 禁用控制器程序 - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode 启用游戏模式 - + Force X11 as Graphics Backend - + Custom frontend 自定义前端 - + Real applet 真实的小程序 - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 异步模拟 - + Uncompressed (Best quality) 不壓縮 (最高品質) - + BC1 (Low quality) BC1 (低品質) - + BC3 (Medium quality) BC3 (中品質) - - + + Auto 自動 - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative 保守模式(节省 VRAM) - + Aggressive 激进模式 - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null 無 - + Fast - - - + + + Accurate 高精度 - - - + + + Default 預設 - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Strict - + Unsafe 低精度 - + Paranoid (disables most optimizations) 偏执模式 (禁用绝大多数优化项) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed 無邊框視窗 - + Exclusive Fullscreen 全螢幕獨占 - + No Video Output 無視訊輸出 - + CPU Video Decoding CPU 視訊解碼 - + GPU Video Decoding (Default) GPU 視訊解碼(預設) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [实验性] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [實驗性] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [實驗性] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 最近鄰 - + Bilinear 雙線性 - + Bicubic 雙立方 - + Gaussian 高斯 - + Lanczos - + ScaleForce 強制縮放 - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None 無 - + FXAA FXAA - + SMAA SMAA - + Default (16:9) 預設 (16:9) - + Force 4:3 強制 4:3 - + Force 21:9 強制 21:9 - + Force 16:10 強制 16:10 - + Stretch to Window 延伸視窗 - + Automatic 自動 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日文 (日本語) - + American English 美式英语 - + French (français) 法文 (français) - + German (Deutsch) 德文 (Deutsch) - + Italian (italiano) 義大利文 (italiano) - + Spanish (español) 西班牙文 (español) - + Chinese 中文 - + Korean (한국어) 韓文 (한국어) - + Dutch (Nederlands) 荷蘭文 (Nederlands) - + Portuguese (português) 葡萄牙文 (português) - + Russian (Русский) 俄文 (Русский) - + Taiwanese 台灣中文 - + British English 英式英文 - + Canadian French 加拿大法文 - + Latin American Spanish 拉丁美洲西班牙文 - + Simplified Chinese 簡體中文 - + Traditional Chinese (正體中文) 正體中文 (正體中文) - + Brazilian Portuguese (português do Brasil) 巴西-葡萄牙語 (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan 日本 - + USA 美國 - + Europe 歐洲 - + Australia 澳洲 - + China 中國 - + Korea 南韓 - + Taiwan 台灣 - + Auto (%1) Auto select time zone 自動 (%1) - + Default (%1) Default time zone 預設 (%1) - + CET 中歐 - + CST6CDT CST6CDT - + Cuba 古巴 - + EET EET - + Egypt 埃及 - + Eire 愛爾蘭 - + EST 北美東部 - + EST5EDT EST5EDT - + GB GB - + GB-Eire 英國-愛爾蘭 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 格林威治 - + Hongkong 香港 - + HST 夏威夷 - + Iceland 冰島 - + Iran 伊朗 - + Israel 以色列 - + Jamaica 牙買加 - + Kwajalein 瓜加林環礁 - + Libya 利比亞 - + MET 中歐 - + MST 北美山區 - + MST7MDT MST7MDT - + Navajo 納瓦霍 - + NZ 紐西蘭 - + NZ-CHAT 紐西蘭-查塔姆群島 - + Poland 波蘭 - + Portugal 葡萄牙 - + PRC 中國 - + PST8PDT 太平洋 - + ROC 臺灣 - + ROK 韓國 - + Singapore 新加坡 - + Turkey 土耳其 - + UCT UCT - + Universal 世界 - + UTC UTC - + W-SU 莫斯科 - + WET 西歐 - + Zulu 協調世界時 - + Mono 單聲道 - + Stereo 立體聲 - + Surround 環繞音效 - + 4GB DRAM (Default) 4GB DRAM (默认) - + 6GB DRAM (Unsafe) 6GB DRAM (不安全) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked TV - + Handheld 掌機模式 - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) 总是询问 (默认) - + Only if game specifies not to stop 仅当游戏不希望停止时 - + Never ask 从不询问 - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -3227,33 +3237,38 @@ Would you like to delete the old save data? 背景顏色: - + % FSR/SGSR sharpening percentage (e.g. 50%) - + + Configure Effects... + + + + Off 關閉 - + VSync Off 垂直同步關 - + Recommended 推薦 - + On 開啟 - + VSync On 垂直同步開 @@ -4875,102 +4890,117 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t - ReShade FX effects are loaded from the post_shaders folder in the Eden data directory. Changes apply immediately while a game is running. + Changes apply immediately while a game is running. - + Enable post-processing - + Preset: - + Apply - + Reset Values - + Return every effect to the values the preset ships with. - + Save As... - + Save Preset - + Preset name: - - Delete + + Clear - + + Remove every effect in use and deselect the preset. + + + + Add Effect - - Custom chain. Pick a preset above and press Apply to replace it. + + None + + + + + No effects in use. Pick a preset and press Apply, or add effects one by one. + Custom chain. Pick a preset above and press Apply to replace it. + + + + Active preset: %1 (modified). Press Reset Values to go back to how it ships. - + Active preset: %1 - + Enabled - + Disabled - + Reset to defaults - + Effect '%1' was not found. - + Effect failed to compile: %1 - + No usable ReShade FX effects were found. Place .fx files in the post_shaders folder. @@ -6984,7 +7014,7 @@ Debug Message: - + &Pause 暫停(&P) @@ -7135,7 +7165,7 @@ Debug Message: - + &Start 開始(&S) @@ -7146,7 +7176,7 @@ Debug Message: - + R&ecord 錄製 (&E) @@ -7237,7 +7267,7 @@ Debug Message: - + None @@ -7263,722 +7293,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + + Configure Effects... + + + + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + + NO FX + + + + + FX + + + + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7986,74 +8031,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/src/android/app/src/main/res/values-es/strings.xml b/src/android/app/src/main/res/values-es/strings.xml index 448d55b92b..3444ccaa71 100644 --- a/src/android/app/src/main/res/values-es/strings.xml +++ b/src/android/app/src/main/res/values-es/strings.xml @@ -289,6 +289,7 @@ Obtenedor de controladores de la GPU Gestor de controladores de la GPU Instale los controladores alternativos para obtener un posible mejor rendimiento o precisión + Añadir efecto Abrir lista Cerrar lista Restablecer a predeterminado diff --git a/src/android/app/src/main/res/values-ru/strings.xml b/src/android/app/src/main/res/values-ru/strings.xml index 7a4b6cf91e..7bfe003317 100644 --- a/src/android/app/src/main/res/values-ru/strings.xml +++ b/src/android/app/src/main/res/values-ru/strings.xml @@ -318,6 +318,13 @@ Целевая частота кадров Выберите значение под ваш дисплей. Множитель подстроится сам, чтобы его держать, и откатит изменения, если игра начнёт тормозить. Использовать фиксированный множитель + Вкл. + Выкл. + Фикс. + Авто + Включите или выключите генерацию кадров и выберите множитель кадров. + Генерация кадров с заданной частотой кадров. Множитель регулируется автоматически. + Разрешение, используемое для оценки движения между кадрами. Меньшие значения экономят время ГПУ. Целевой размер очереди кадров Сколько готовых кадров может ожидать перед выводом на экран. Более длинные очереди сглаживают скачки ГПУ ценой задержки ввода. Минимальная задержка (Без буферизации) @@ -328,12 +335,14 @@ Разрешение оценки движения Разрешение прохода оптического потока в долях от выходного разрешения. Его понижение — самый дешёвый способ вернуть производительность. Генерация кадров недоступна + В этом ГПУ драйвере отсутствует поддержка модели памяти Vulkan или половинной точности (float16), которая требуется шейдерам Lossless Scaling. Опционально. Укажите свой Lossless.dll для включения генерации кадров позже. Установить Lossless.dll Для генерации кадров требуется ваша собственная легальная копия Lossless.dll из Lossless Scaling Выбрать другой файл Lossless.dll Генерация кадров Поддерживается + Не поддерживается (нет модели памяти Vulkan или float16) Предоставьте свою копию Lossless.dll для включения генерации кадров Установлена Не установлена 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 index 193d00c3d1..2f41b5d65a 100644 --- a/src/android/app/src/main/res/values-zh-rCN/strings.xml +++ b/src/android/app/src/main/res/values-zh-rCN/strings.xml @@ -1,6 +1,7 @@ + 本软件可以运行用于 Nintendo Switch 游戏机的游戏。不包含任何游戏或密钥。

在您开始之前, 请定位您设备存储上的 prod.keys ]]> 文件。

了解更多]]>
错误与注意事项 当发生错误时显示通知。 未授予通知权限! @@ -290,6 +291,25 @@ GPU驱动获取器 GPU 驱动管理器 安装替代的驱动程序以获得更好的性能和精度 + 后处理效果 + 在渲染完成后应用 ReShade FX 效果 + 配置此游戏的效果链 + 添加效果 + 移除 + 打开列表 + 关闭列表 + 移除效果 + 预设已激活。在开始游戏前可以在后处理效果中编辑它。 + 数值已从原始预设被更改。 + 预设 + 新建预设 + 把您加载的效果及当前数值保存为一个预设,以便今后选用。 + 请给预设起一个不含等号的名称。 + 无预设 + 删除预设 + 重置预设值 + 重置为默认值 + 找不到效果。请在此文件中放置 .fx 文件: 帧生成 配置针对此游戏的帧生成设定 设定要在使用无损缩放渲染的帧之间应用的插帧。启用后强制采用FIFO呈现模式 。 @@ -304,6 +324,13 @@ 60 FPS 90 FPS 120 FPS + 开 + 关 + 固定 + 自动 + 打开或关闭帧生成并选择帧生成倍数。 + 生成帧到目标帧率。倍率会自动调整。 + 用来估算帧间运动的分辨率。较低的值可以节省 GPU 时间。 帧队列目标 在显示之前有多少已完成渲染的帧正在等待。较大的队列可以缓解 GPU 突发的压力,但会增加输入延迟。 最低延迟 (无缓冲) @@ -314,12 +341,14 @@ 运动预估分辨率 光流通道的分辨率,以输出的比例表示。降低它是提升性能最经济的做法。 帧生成不可用 + 这个 GPU 驱动缺少 Lossless Scaling 着色器所需的 Vulkan 内存模型或半精度 (float16) 支持。 作为可选项。请提供您自己的 Lossless.dll 以便在之后可以启用帧生成。 安装 Lossless.dll 帧生成需要您自己从 Lossless Scaling 获得合法的 Lossless.dll 副本 选择其它 Lossless.dll 副本 帧生成 支持 + 不支持 (无 Vulkan 内存模型或 float16) 无损缩放 提供您自己的 Lossless.dll 文件以启用帧生成 已安装 @@ -611,6 +640,11 @@ 日志记录 按行刷新调试日志 在每行写入时刷新调试日志,使在崩溃或冻结时调试更容易。 + 开启扩展日志 + 将最大日志文件大小从 100 MiB 提升至 1GiB。 + 日志筛选器 + 控制 Eden 的日志类别。例如: *:Info Service.LM:Debug + GPU 日志 日志等级 @@ -894,6 +928,8 @@ ROM 文件不存在 游戏需要固件 + + 正在搜索游戏... 未找到标题ID的游戏: %1$s 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 index 0a1c3ba4c2..5db1e31a2b 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -229,7 +229,7 @@ 遊戲目錄新增成功 檢查更新 在Eden啟動時檢查有無新版本並選擇是否要下載與安裝更新 - 偵測到新版本 + 發現新版本 有更新可供安裝:%1$s\n\n您要進行更新嗎? 下載更新中 更新下載失敗 @@ -1020,9 +1020,40 @@ 6GB (不穩定) 8GB (不穩定) + + 正常 + 加速 + 超頻 + + + 正常 + 加速 + 超頻 + + + 極小 (16MB) + 小(32MB) + 正常(128MB) + 大(256MB) + 極大(512MB) + + + 極小(4MB) + 小(8MB) + 正常(16MB) + 中(32MB) + 大(64MB) + + + 極小(32) + 小(64) + 正常(128) + 中(256) + 大(512) + - 攝氏度 - 華氏度 + 攝氏 + 華氏 B @@ -1035,6 +1066,8 @@ 無 + + 效能 準確 From 3266c20e3f27a459449b77214182be3f0332e8f4 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Wed, 23 Sep 2026 00:36:47 +0200 Subject: [PATCH 027/198] [ips_layer] read magic from IPS file and fix EOF check (#4469) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- PatchIPS was reading the magic bytes from the target file instead of the IPS patch, and IsEOF used a strict > comparison that never matched for 3-byte IPS EOF markers. This caused IPS patches to be silently skipped, breaking the Russian localization mod for Persona 5. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4469 Reviewed-by: lizzie Reviewed-by: CamilleLaVey --- src/core/file_sys/ips_layer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index 5a0ddb44f8..32e9041017 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp @@ -35,19 +35,22 @@ static IPSFileType IdentifyMagic(std::span magic) { } static bool IsEOF(IPSFileType type, std::span magic) { - return (type == IPSFileType::IPS && magic.size() > 3 && std::memcmp(magic.data(), "EOF", 3) == 0) - || (type == IPSFileType::IPS32 && magic.size() > 4 && std::memcmp(magic.data(), "EEOF", 4) == 0); + return (type == IPSFileType::IPS && magic.size() >= 3 && std::memcmp(magic.data(), "EOF", 3) == 0) + || (type == IPSFileType::IPS32 && magic.size() >= 4 && std::memcmp(magic.data(), "EEOF", 4) == 0); } VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips) { if (in == nullptr || ips == nullptr) return nullptr; - auto in_data = in->ReadAllBytes(); - auto const type = IdentifyMagic(in_data); + const auto type = IdentifyMagic(ips->ReadBytes(0x5)); if (type == IPSFileType::Error) return nullptr; + auto in_data = in->ReadAllBytes(); + if (in_data.size() == 0) + return nullptr; + std::vector temp(type == IPSFileType::IPS ? 3 : 4); u64 offset = 5; // After header while (ips->Read(temp.data(), temp.size(), offset) == temp.size()) { From 38df54edfe7b861d0a0a1ee305836049a39d42ef Mon Sep 17 00:00:00 2001 From: Exverge Date: Wed, 23 Sep 2026 13:52:29 +0200 Subject: [PATCH 028/198] [common/sparse_large_vector] decommit unused pages + fix first page in zeroed region (#4471) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Fixes a bug where the first page of a zeroed out region would not be properly zeroed, and now frees unused memory. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4471 Reviewed-by: lizzie Reviewed-by: MaranBr --- src/common/sparse_large_vector.cpp | 15 +++++++++++++++ src/common/sparse_large_vector.h | 20 +++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/common/sparse_large_vector.cpp b/src/common/sparse_large_vector.cpp index ce6455a235..745575a880 100644 --- a/src/common/sparse_large_vector.cpp +++ b/src/common/sparse_large_vector.cpp @@ -96,6 +96,21 @@ bool CommitVectorPage(uintptr_t addr, bool write) noexcept { #ifndef MAP_NOCORE #define MAP_NOCORE 0 #endif +#ifndef MADV_FREE +#define MADV_FREE MADV_DONTNEED +#endif + +void DecommitVectorPage(uintptr_t base) noexcept { +#if defined(_WIN32) + VirtualFree(reinterpret_cast(base), HostPageSize, MEM_DECOMMIT); +#elif defined(__linux__) + // Linux's MADV_DONTNEED zeros out pages for us + madvise(reinterpret_cast(base), HostPageSize, MADV_DONTNEED); +#else + madvise(reinterpret_cast(base), HostPageSize, MADV_FREE); + std::memset(reinterpret_cast(base), 0, HostPageSize); +#endif +} void* AllocateMemoryPages(std::size_t size) noexcept { if (auto page = HostPageSize; size % page != 0) { diff --git a/src/common/sparse_large_vector.h b/src/common/sparse_large_vector.h index dad3aea97e..86f0be7866 100644 --- a/src/common/sparse_large_vector.h +++ b/src/common/sparse_large_vector.h @@ -35,6 +35,7 @@ const u64 HostPageMask = ~(HostPageSize - 1); void* AllocateMemoryPages(std::size_t size) noexcept; void FreeMemoryPages(void* base, std::size_t size) noexcept; +void DecommitVectorPage(uintptr_t base) noexcept; /// A large page-aligned buffer that has optimized memory usage for zero-writes. template @@ -114,7 +115,7 @@ public: const u64 end_page = AlignUp(base, HostPageSize); const u64 first_size = (std::min)(end_page, end) - base; - if (IsCommittedPage(start / sizeof(T))) { + if (IsCommittedPage(start)) { std::memset(reinterpret_cast(base), 0, first_size); } @@ -124,11 +125,16 @@ public: base = end_page; for (u64 page = base; page < end; page += HostPageSize) { - if (!IsCommittedPage((page - reinterpret_cast(base_ptr)) / sizeof(T))) { + auto index = (page - reinterpret_cast(base_ptr)) / sizeof(T); + if (!IsCommittedPage(index)) { continue; } - std::memset(reinterpret_cast(page), 0, (std::min)( HostPageSize, end - page)); + if (end - page >= HostPageSize) { + DecommitPage(index); + } else { + std::memset(reinterpret_cast(page), 0, end - page); + } } } @@ -183,6 +189,14 @@ private: committed_pages[page_index >> 6].fetch_or(1ULL << (page_index & 63), std::memory_order_release); } + constexpr void DecommitPage(std::size_t index) noexcept { + auto page_index = (index * sizeof(T)) >> HostPageBits; + auto page = reinterpret_cast(base_ptr + index) & HostPageMask; + + committed_pages[page_index >> 6].fetch_and(~(1ULL << (page_index & 63)), std::memory_order_release); + DecommitVectorPage(page); + } + std::size_t alloc_size{}; T* base_ptr{}; From a25e32676fd3da5b66600e15045dfa699d93d989 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 23 Sep 2026 14:39:12 +0200 Subject: [PATCH 029/198] [hle] Use correct `audren:d` service framework (#4472) Trivial change. Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4472 Reviewed-by: MaranBr Reviewed-by: Maufeat --- src/core/hle/service/audio/audio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/service/audio/audio.cpp b/src/core/hle/service/audio/audio.cpp index 6caf794caa..fde766a275 100644 --- a/src/core/hle/service/audio/audio.cpp +++ b/src/core/hle/service/audio/audio.cpp @@ -191,7 +191,7 @@ void LoopProcess(Core::System& system) { server_manager->RegisterNamedService("audout:d", std::make_shared(system), 30); server_manager->RegisterNamedService("audin:d", std::make_shared(system), 30); server_manager->RegisterNamedService("audrec:d", std::make_shared(system), 30); - server_manager->RegisterNamedService("audren:d", std::make_shared(system), 30); + server_manager->RegisterNamedService("audren:d", std::make_shared(system), 30); server_manager->RegisterNamedService("audin:u", std::make_shared(system), 30); server_manager->RegisterNamedService("audin:a", std::make_shared(system), 30); From 3d37a816c6adc2708a7be70f5a7fbe0af36b8227 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 23 Sep 2026 14:51:18 +0200 Subject: [PATCH 030/198] [glsl] fix clang 23 build error for unused function `SetDefinition` (#4389) Reported by @gixel > unused function template SetDefinition in: src/shader_recompiler/backend/glsl/emit_glsl.cpp:32:6: error: unused function template 'SetDefinition' [-Werror,-Wunused-template] - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4389 Reviewed-by: MaranBr Reviewed-by: Maufeat --- .../backend/glsl/emit_glsl.cpp | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cpp index 66ecfc9f74..8ec180bc42 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -28,11 +31,6 @@ struct FuncTraits { using ArgType = std::tuple_element_t>; }; -template -void SetDefinition(EmitContext& ctx, IR::Inst* inst, Args... args) { - inst->SetDefinition(func(ctx, std::forward(args)...)); -} - template auto Arg(EmitContext& ctx, const IR::Value& arg) { if constexpr (std::is_same_v) { @@ -53,21 +51,10 @@ auto Arg(EmitContext& ctx, const IR::Value& arg) { template void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence) { using Traits = FuncTraits; - if constexpr (std::is_same_v) { - if constexpr (is_first_arg_inst) { - SetDefinition( - ctx, inst, *inst, - Arg>(ctx, inst->Arg(I))...); - } else { - SetDefinition( - ctx, inst, Arg>(ctx, inst->Arg(I))...); - } + if constexpr (is_first_arg_inst) { + func(ctx, *inst, Arg>(ctx, inst->Arg(I))...); } else { - if constexpr (is_first_arg_inst) { - func(ctx, *inst, Arg>(ctx, inst->Arg(I))...); - } else { - func(ctx, Arg>(ctx, inst->Arg(I))...); - } + func(ctx, Arg>(ctx, inst->Arg(I))...); } } From 278f411dad6e8a52747994888f8778b277f6d953 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 23 Sep 2026 14:51:51 +0200 Subject: [PATCH 031/198] [frontend] Unify cmdline parsing (#4424) Addresses #4383. Makes it so both the Qt and SDL frontends now share the same options (bar `-hlaunch` and `-qlaunch`). Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4424 Reviewed-by: MaranBr Reviewed-by: Maufeat --- docs/user/CommandLine.md | 54 ++++++---- src/core/CMakeLists.txt | 5 + src/core/launch_params.cpp | 205 ++++++++++++++++++++++++++++++++++++ src/core/launch_params.h | 43 ++++++++ src/yuzu/main_window.cpp | 86 ++++----------- src/yuzu_cmd/CMakeLists.txt | 3 - src/yuzu_cmd/yuzu.cpp | 204 +++-------------------------------- 7 files changed, 319 insertions(+), 281 deletions(-) create mode 100644 src/core/launch_params.cpp create mode 100644 src/core/launch_params.h diff --git a/docs/user/CommandLine.md b/docs/user/CommandLine.md index b8d71ac61f..a63a41a27c 100644 --- a/docs/user/CommandLine.md +++ b/docs/user/CommandLine.md @@ -1,32 +1,44 @@ # User Handbook - Command Line -There are two main applications, an SDL-based app (`eden-cli`) and a Qt based app (`eden`); both accept command line arguments. - -## eden +There are two main applications, an SDL-based app (`eden-cli`) and a Qt based app (`eden`); both accept the same command line arguments. - `./eden `: Running with a single argument and nothing else, will make the emulator look for the given file and load it, this behavior is similar to `eden-cli`; allows dragging and dropping games into the application. -- `-g `: Alternate way to specify what to load, overrides. However let it be noted that arguments that use `-` will be treated as options/ignored, if your game, for some reason, starts with `-`, in order to safely handle it you may need to specify it as an argument. -- `-f`: Use fullscreen. -- `-u `: Select the index of the user to load as. -- `-input-profile `: Specifies input profile name to use (for player #0 only). +- `--debug/-d`: Enter debug mode, allow gdb stub at port `1234` +- `--config/-c`: Specify alternate configuration file. +- `--fullscreen/-f`: Use fullscreen. +- `--help/-h`: Display help. +- `--game/-g `: Alternate way to specify what to load, overrides. However let it be noted that arguments that use `-` will be treated as options/ignored, if your game, for some reason, starts with `-`, in order to safely handle it you may need to specify it as an argument. +- `--multiplayer/-m`: Specify multiplayer options. +- `--program/-p`: Specify the program arguments to pass (optional). +- `--user/-u `: Specify the user index. +- `--version/-v`: Display version and quit. +- `--input-profile/-i `: Specifies input profile name to use (for player #0 only). +- `--null-render/-n`: Forces the usage of the "Null" render backend irrespective of settings. +- `--filter/-x`: Sets the debug log filter irrespective of settings. +- `--singlecore/-s`: Forces single-core regardless of settings. + +Only the Qt frontend supports the following arguments: + - `-qlaunch`: Launch QLaunch. - `-hlaunch`: Launch homebrew launcher `nx-hbloader`. - Requires a copy of Atmosphere to be extracted onto `sdmc`. - This is a shorthand for `/sdmc/atmosphere/hbl.nsp`. - `-setup`: Launch setup applet. -## eden-cli +`eden` (provided with `--room`), and `eden-room` supports the following options as well: -- `--debug/-d`: Enter debug mode, allow gdb stub at port `1234` -- `--config/-c`: Specify alternate configuration file. -- `--fullscreen/-f`: Set fullscreen. -- `--help/-h`: Display help. -- `--game/-g`: Specify the game to run. -- `--multiplayer/-m`: Specify multiplayer options. -- `--program/-p`: Specify the program arguments to pass (optional). -- `--user/-u`: Specify the user index. -- `--version/-v`: Display version and quit. -- `--input-profile/-i`: Specifies input profile name to use (for player #0 only). -- `--null-render/-n`: Forces the usage of the "Null" render backend irrespective of settings. -- `--filter/-x`: Sets the debug log filter irrespective of settings. -- `--singlecore/-s`: Forces single-core regardless of settings. +- `-n/--room-name`: The name of the room. +- `-d/--room-description`: The room description. +- `-s/--bind-address`: The bind address for the room. +- `-p/--port`: The port used for the room. +- `-m/--max-members`: The maximum number of players for this room. +- `-w/--password`: The password for the room. +- `-g/--preferred-game`: The preferred game for this room. +- `-i/--preferred-game-id`: The preferred game-id for this room. +- `-u/--username`: The username used for announce. +- `-t/--token`: The token used for announce. +- `-a/--web-api-url`: yuzu Web API url. +- `-b/--ban-list-file`: The file for storing the room ban list. +- `-l/--log-file`: The file for storing the room log. +- `-h/--help`: Display this help and exit. +- `-v/--version`: Output version information and exit. diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 5f9e9bd654..31f9931d3a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -23,6 +23,8 @@ add_library(core STATIC core_timing.h cpu_manager.cpp cpu_manager.h + launch_params.cpp + launch_params.h crypto/aes_util.cpp crypto/aes_util.h crypto/ctr_encryption_layer.cpp @@ -1203,6 +1205,9 @@ endif() target_include_directories(core PRIVATE ${OPUS_INCLUDE_DIRS}) target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb tz) +if (MSVC) + target_link_libraries(core PRIVATE getopt) +endif() if (BOOST_NO_HEADERS) target_link_libraries(core PUBLIC Boost::container Boost::heap Boost::asio Boost::process Boost::crc) diff --git a/src/core/launch_params.cpp b/src/core/launch_params.cpp new file mode 100644 index 0000000000..a0483226ec --- /dev/null +++ b/src/core/launch_params.cpp @@ -0,0 +1,205 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include +#include + +#include "common/assert.h" +#include "common/logging.h" +#include "common/settings.h" +#include "common/string_util.h" +#include "common/scm_rev.h" +#include "core/core.h" +#include "core/hle/service/acc/profile_manager.h" +#include "core/launch_params.h" + +#undef _UNICODE +#include +#ifndef _MSC_VER +#include +#endif + +namespace Core { +LaunchParams ParseLaunchParams(Core::System& system, int argc, char *argv[], wchar_t *argv_w[]) noexcept { + LaunchParams p{}; + + int option_index = 0; + static struct option long_options[] = { + // clang-format off + {"debug", no_argument, 0, 'd'}, + {"config", required_argument, 0, 'c'}, + {"fullscreen", no_argument, 0, 'f'}, + {"help", no_argument, 0, 'h'}, + {"game", required_argument, 0, 'g'}, + {"multiplayer", required_argument, 0, 'm'}, + {"program", optional_argument, 0, 'p'}, + {"user", required_argument, 0, 'u'}, + {"version", no_argument, 0, 'v'}, + {"input-profile", no_argument, 0, 'i'}, + {"null-render", no_argument, 0, 'n'}, + {"singlecore", no_argument, 0, 's'}, + {"filter", no_argument, 0, 'x'}, + {0, 0, 0, 0}, + // clang-format on + }; + + while (optind < argc) { + if (int arg = getopt_long(argc, argv, "dc:fhg:m:p:u:vinsx", long_options, &option_index); arg != -1) { + switch (char(arg)) { + case 'd': + p.override_gdb_port = uint16_t(atoi(optarg)); + break; + case 'c': + p.config_path = optarg; + break; + case 'f': + p.fullscreen = true; + LOG_INFO(Frontend, "Starting in fullscreen mode..."); + break; + case 'h': + p.print_help = true; + break; + case 'g': + p.filepath = std::string(optarg); + break; + case 'i': { + p.input_profile = std::string(optarg); + break; + } + case 'm': { + p.use_multiplayer = true; + const std::string str_arg(optarg); + // regex to check if the format is nickname:password@ip:port + // with optional :password + const std::regex re("^([^:]+)(?::(.+))?@([^:]+)(?::([0-9]+))?$"); + if (std::regex_match(str_arg, re)) { + std::smatch match; + std::regex_search(str_arg, match, re); + ASSERT(match.size() == 5); + p.nickname = match[1]; + p.password = match[2]; + p.address = match[3]; + if (!match[4].str().empty()) { + p.port = u16(std::strtoul(match[4].str().c_str(), nullptr, 0)); + } + std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$"); + ASSERT(std::regex_match(p.nickname, nickname_re) && "Nickname is not valid. Must be 4 to 20 alphanumeric characters"); + ASSERT(!p.address.empty() && "Address is empty"); + } + break; + } + case 'p': + p.program_args = argv[optind]; + ++optind; + break; + case 'u': { + // Launch game with a specific user + bool argument_ok = isdigit(optarg[0]); + p.selected_user = atoi(optarg); + if (!argument_ok) { + // try to look it up by username, only finds the first username that matches. + auto const user_idx = system.GetProfileManager().GetUserIndex(optarg); + if (user_idx != std::nullopt) { + p.selected_user = user_idx.value(); + } else { + LOG_ERROR(Frontend, "Invalid user argument '{}'", optarg); + break; + } + } + if (system.GetProfileManager().UserExistsIndex(*p.selected_user)) { + Settings::values.current_user = s32(*p.selected_user); + } else { + LOG_ERROR(Frontend, "Selected user {} doesn't exist", *p.selected_user); + } + break; + } + case 'v': + p.print_version = true; + break; + case 'n': + p.force_null_render = true; + break; + case 's': + p.force_single_core = true; + break; + case 'x': + p.log_filter = argv[optind]; + ++optind; + break; + } + } else { + // only kept due to shortcuts made by Qt frontend which use "-qlaunch" + if (strcmp(argv[optind], "-hlaunch") == 0) { + p.launch_hlaunch = true; + } else if (strcmp(argv[optind], "-qlaunch") == 0) { + p.launch_qlaunch = true; + } else if (strcmp(argv[optind], "-setup") == 0) { + p.launch_setup = true; + } else { + // qt feeds utf8 data, sdl frontend feeds raw utf16 data +#ifdef _WIN32 + p.filepath = argv_w != nullptr + ? Common::UTF16ToUTF8(argv_w[optind]) + : argv[optind]; +#else + p.filepath = argv[optind]; +#endif + } + optind++; + } + } + p.argv0 = argv[0]; + return p; +} + +void ApplyLaunchParams(LaunchParams const& lp) noexcept { + // apply the log_filter setting + // the logger was initialized before and doesn't pick up the filter on its own + Common::Log::Filter filter{}; + filter.ParseFilterString(lp.log_filter.value_or(Settings::values.log_filter.GetValue())); + Common::Log::SetGlobalFilter(filter); + + if (!lp.program_args.empty()) { + Settings::values.program_args = lp.program_args; + } + if (!lp.input_profile.empty()) { + auto& players = Settings::values.players.GetValue(); + players[0].profile_name = lp.input_profile; + } + if (lp.selected_user.has_value()) { + Settings::values.current_user = std::clamp(*lp.selected_user, 0, 7); + } + if (lp.override_gdb_port.has_value()) { + Settings::values.use_gdbstub = true; + Settings::values.gdbstub_port = *lp.override_gdb_port; + } + if (lp.force_single_core) { + Settings::values.use_multi_core = false; + } + if (lp.force_null_render) { + Settings::values.renderer_backend = Settings::RendererBackend::Null; + } + + if (lp.print_version) { + LOG_INFO(Frontend, "Eden {} {}", Common::g_scm_branch, Common::g_scm_desc); + } + if (lp.print_help) { + LOG_INFO(Frontend, + "Usage: {}" + " [options] \n" + "-c, --config Load the specified configuration file\n" + "-f, --fullscreen Start in fullscreen mode\n" + "-g, --game File path of the game to load\n" + "-h, --help Display this help and exit\n" + "-m, --multiplayer=nick:password@address:port" + " Nickname, password, address and port for multiplayer\n" + "-p, --program Pass following string as arguments to executable\n" + "-u, --user Select a specific user profile from 0 to 7\n" + "-d, --debug Run the GDB stub on a port from 1 to 65535\n" + "-v, --version Output version information and exit\n", + lp.argv0 + ); + } +} + +} diff --git a/src/core/launch_params.h b/src/core/launch_params.h new file mode 100644 index 0000000000..4da30fc1c2 --- /dev/null +++ b/src/core/launch_params.h @@ -0,0 +1,43 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include +#include +#include "common/common_types.h" +#include "network/room.h" + +namespace Core { + +class System; +struct LaunchParams { + std::string argv0{}; + std::string filepath{}; + std::string nickname{}; + std::string password{}; + std::string address{}; + std::string input_profile{}; + std::string program_args{}; + std::optional config_path{}; + std::optional selected_user{}; + std::optional override_gdb_port{}; + std::optional log_filter{}; + u16 port = Network::DefaultRoomPort; + bool use_multiplayer = false; + bool fullscreen = false; + bool force_null_render = false; + bool force_single_core = false; + // print + bool print_version = false; + bool print_help = false; + // qt + bool launch_hlaunch = false; + bool launch_qlaunch = false; + bool launch_setup = false; +}; + +LaunchParams ParseLaunchParams(Core::System& system, int argc, char *argv[], wchar_t *argv_w[]) noexcept; +void ApplyLaunchParams(LaunchParams const& lp) noexcept; + +} diff --git a/src/yuzu/main_window.cpp b/src/yuzu/main_window.cpp index 1d579239a1..e2807e80ff 100644 --- a/src/yuzu/main_window.cpp +++ b/src/yuzu/main_window.cpp @@ -3,6 +3,7 @@ // Static Qt on macOS doesn't use Vulkan // Other platforms do, and thus have conflicting VulkanMemoryAllocator symbols +#include "core/launch_params.h" #if defined(QT_STATICPLUGIN) && !defined(__APPLE__) #undef VMA_IMPLEMENTATION #endif @@ -515,79 +516,28 @@ MainWindow::MainWindow(bool has_broken_vulkan) // to prevent the UI from blowing up. UpdateUITheme(); - QStringList args = QApplication::arguments(); + if (QStringList args = QApplication::arguments(); args.size() >= 2) { + QList qba{}; + for (auto const& e : args) + qba.push_back(e.toUtf8()); + std::vector args_cstr{}; + for (auto& e : qba) + args_cstr.push_back(e.data()); - if (args.size() < 2) { - return; - } + auto const lp = Core::ParseLaunchParams(*QtCommon::system, args_cstr.size(), args_cstr.data(), nullptr); - QString game_path; - bool should_launch_qlaunch = false; - bool should_launch_hlaunch = false; - bool should_launch_setup = false; - bool has_gamepath = false; - bool is_fullscreen = false; - - // Preserves drag/drop functionality - for (int i = 1; i < args.size(); ++i) { - if (args[i] == QStringLiteral("-f")) { - // Launch game in fullscreen mode - is_fullscreen = true; - } else if (args[i] == QStringLiteral("-u") && i < args.size() - 1) { - // Launch game with a specific user - int user_arg_idx = ++i; - bool argument_ok; - std::size_t selected_user = args[user_arg_idx].toUInt(&argument_ok); - if (!argument_ok) { - // try to look it up by username, only finds the first username that matches. - std::string const user_arg_str = args[user_arg_idx].toStdString(); - auto const user_idx = - QtCommon::system->GetProfileManager().GetUserIndex(user_arg_str); - if (user_idx != std::nullopt) { - selected_user = user_idx.value(); - } else { - LOG_ERROR(Frontend, "Invalid user argument '{}'", user_arg_str); - continue; - } - } - if (QtCommon::system->GetProfileManager().UserExistsIndex(selected_user)) { - Settings::values.current_user = s32(selected_user); - user_flag_cmd_line = true; - } else { - LOG_ERROR(Frontend, "Selected user {} doesn't exist", selected_user); - } - } else if (args[i] == QStringLiteral("-g") && i < args.size() - 1) { - // Launch game at path - game_path = args[++i]; - has_gamepath = true; - } else if (args[i] == QStringLiteral("-input-profile") && i < args.size() - 1) { - auto& players = Settings::values.players.GetValue(); - players[0].profile_name = args[++i].toStdString(); - } else if (args[i] == QStringLiteral("-qlaunch")) { - should_launch_qlaunch = true; - } else if (args[i] == QStringLiteral("-hlaunch")) { - should_launch_hlaunch = true; - } else if (args[i] == QStringLiteral("-setup")) { - should_launch_setup = true; - } else { - game_path = args[i]; - has_gamepath = true; + // Override fullscreen setting if gamepath or argument is provided + if (!lp.filepath.empty() || lp.fullscreen) { + ui->action_Fullscreen->setChecked(lp.fullscreen); } - } - // Override fullscreen setting if gamepath or argument is provided - if (has_gamepath || is_fullscreen) { - ui->action_Fullscreen->setChecked(is_fullscreen); - } - - if (should_launch_setup) { - LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Starter), std::nullopt); - } else { - if (!game_path.isEmpty()) { - BootGame(game_path, ApplicationAppletParameters()); - } else if (should_launch_qlaunch) { + if (!lp.filepath.empty()) { + BootGame(QString::fromStdString(lp.filepath), ApplicationAppletParameters()); + } else if (lp.launch_setup) { + LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Starter), std::nullopt); + } else if (lp.launch_qlaunch) { LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::QLaunch), std::nullopt); - } else if (should_launch_hlaunch) { + } else if (lp.launch_hlaunch) { std::filesystem::path const sd_dir = Common::FS::GetEdenPathString(Common::FS::EdenPath::SDMCDir); auto const hbl_path = (sd_dir / "atmosphere" / "hbl.nsp").string(); diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index 09a9bd6da1..17a1545167 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt @@ -42,9 +42,6 @@ target_link_libraries(yuzu-cmd PRIVATE common core input_common frontend_common if (ENABLE_OPENGL) target_link_libraries(yuzu-cmd PRIVATE glad) endif() -if (MSVC) - target_link_libraries(yuzu-cmd PRIVATE getopt) -endif() target_link_libraries(yuzu-cmd PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) create_resource("../../dist/eden.bmp" "yuzu_cmd/yuzu_icon.h" "yuzu_icon") diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index a161418289..473a5b1014 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -10,6 +10,7 @@ #include #include #include "common/settings_enums.h" +#include "core/launch_params.h" #ifdef __EMSCRIPTEN__ #include #endif @@ -52,12 +53,6 @@ #include "common/windows/timer_resolution.h" #endif -#undef _UNICODE -#include -#ifndef _MSC_VER -#include -#endif - #ifdef _WIN32 extern "C" { // tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable @@ -67,25 +62,6 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } #endif -static void PrintHelp(const char* argv0) { - std::cout << "Usage: " << argv0 - << " [options] \n" - "-c, --config Load the specified configuration file\n" - "-f, --fullscreen Start in fullscreen mode\n" - "-g, --game File path of the game to load\n" - "-h, --help Display this help and exit\n" - "-m, --multiplayer=nick:password@address:port" - " Nickname, password, address and port for multiplayer\n" - "-p, --program Pass following string as arguments to executable\n" - "-u, --user Select a specific user profile from 0 to 7\n" - "-d, --debug Run the GDB stub on a port from 1 to 65535\n" - "-v, --version Output version information and exit\n"; -} - -static void PrintVersion() { - std::cout << "Eden " << Common::g_scm_branch << " " << Common::g_scm_desc << std::endl; -} - static void OnStateChanged(const Network::RoomMember::State& state) { switch (state) { case Network::RoomMember::State::Idle: @@ -208,168 +184,18 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { LOG_CRITICAL(Frontend, "Failed to get command line arguments"); return SDL_APP_FAILURE; } -#endif - std::string filepath; - std::optional config_path{}; - std::string program_args; - std::optional selected_user{}; - std::optional override_gdb_port{}; - bool use_multiplayer = false; - bool fullscreen = false; - bool force_null_render = false; - bool force_single_core = false; - std::string nickname{}; - std::string password{}; - std::string address{}; - std::string input_profile{}; - std::optional log_filter{}; - u16 port = Network::DefaultRoomPort; - - static struct option long_options[] = { - // clang-format off - {"debug", no_argument, 0, 'd'}, - {"config", required_argument, 0, 'c'}, - {"fullscreen", no_argument, 0, 'f'}, - {"help", no_argument, 0, 'h'}, - {"game", required_argument, 0, 'g'}, - {"multiplayer", required_argument, 0, 'm'}, - {"program", optional_argument, 0, 'p'}, - {"user", required_argument, 0, 'u'}, - {"version", no_argument, 0, 'v'}, - {"input-profile", no_argument, 0, 'i'}, - {"null-render", no_argument, 0, 'n'}, - {"singlecore", no_argument, 0, 's'}, - {"filter", no_argument, 0, 'x'}, - {0, 0, 0, 0}, - // clang-format on - }; - - while (optind < argc) { - int arg = getopt_long(argc, argv, "g:fhvcip::c:u:d:", long_options, &option_index); - if (arg != -1) { - switch (char(arg)) { - case 'd': - override_gdb_port = uint16_t(atoi(optarg)); - break; - case 'c': - config_path = optarg; - break; - case 'f': - fullscreen = true; - LOG_INFO(Frontend, "Starting in fullscreen mode..."); - break; - case 'h': - PrintHelp(argv[0]); - return SDL_APP_FAILURE; - case 'g': - filepath = std::string(optarg); - break; - case 'i': { - input_profile = std::string(optarg); - break; - } - case 'm': { - use_multiplayer = true; - const std::string str_arg(optarg); - // regex to check if the format is nickname:password@ip:port - // with optional :password - const std::regex re("^([^:]+)(?::(.+))?@([^:]+)(?::([0-9]+))?$"); - if (!std::regex_match(str_arg, re)) { - std::cout << "Wrong format for option --multiplayer\n"; - PrintHelp(argv[0]); - return SDL_APP_FAILURE; - } - - std::smatch match; - std::regex_search(str_arg, match, re); - ASSERT(match.size() == 5); - nickname = match[1]; - password = match[2]; - address = match[3]; - if (!match[4].str().empty()) { - port = u16(std::strtoul(match[4].str().c_str(), nullptr, 0)); - } - std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$"); - if (!std::regex_match(nickname, nickname_re)) { - LOG_ERROR(Frontend, "Nickname is not valid. Must be 4 to 20 alphanumeric characters"); - return SDL_APP_FAILURE; - } - if (address.empty()) { - LOG_ERROR(Frontend, "Address to room must not be empty"); - return SDL_APP_FAILURE; - } - break; - } - case 'p': - program_args = argv[optind]; - ++optind; - break; - case 'u': - selected_user = atoi(optarg); - break; - case 'v': - PrintVersion(); - return SDL_APP_FAILURE; - case 'n': - force_null_render = true; - break; - case 's': - force_single_core = true; - break; - case 'x': - log_filter = argv[optind]; - ++optind; - break; - } - } else { -#ifdef _WIN32 - filepath = Common::UTF16ToUTF8(argv_w[optind]); #else - filepath = argv[optind]; + wchar_t **argv_w = nullptr; #endif - optind++; - } - } - - SdlConfig config{config_path}; - - // apply the log_filter setting - // the logger was initialized before and doesn't pick up the filter on its own - Common::Log::Filter filter; - filter.ParseFilterString(log_filter.value_or(Settings::values.log_filter.GetValue())); - Common::Log::SetGlobalFilter(filter); - - if (!program_args.empty()) { - Settings::values.program_args = program_args; - } - - if (!input_profile.empty()) { - auto& players = Settings::values.players.GetValue(); - players[0].profile_name = input_profile; - } - - if (selected_user.has_value()) { - Settings::values.current_user = std::clamp(*selected_user, 0, 7); - } - - if (override_gdb_port.has_value()) { - Settings::values.use_gdbstub = true; - Settings::values.gdbstub_port = *override_gdb_port; - } - - if (force_single_core) { - Settings::values.use_multi_core = false; - } - - if (force_null_render) { - Settings::values.renderer_backend = Settings::RendererBackend::Null; - } - + Core::LaunchParams lp = Core::ParseLaunchParams(state->system, argc, argv, argv_w); #ifdef _WIN32 LocalFree(argv_w); #endif + SdlConfig config{lp.config_path}; - if (filepath.empty()) { + Core::ApplyLaunchParams(lp); + + if (lp.filepath.empty()) { LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); return SDL_APP_FAILURE; } @@ -386,14 +212,14 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { case Settings::RendererBackend::OpenGL_GLSL: case Settings::RendererBackend::OpenGL_GLASM: case Settings::RendererBackend::OpenGL_SPIRV: - state->emu_window = std::make_unique(&input_subsystem, state->system, fullscreen); + state->emu_window = std::make_unique(&input_subsystem, state->system, lp.fullscreen); break; #endif case Settings::RendererBackend::Vulkan: - state->emu_window = std::make_unique(&input_subsystem, state->system, fullscreen); + state->emu_window = std::make_unique(&input_subsystem, state->system, lp.fullscreen); break; case Settings::RendererBackend::Null: - state->emu_window = std::make_unique(&input_subsystem, state->system, fullscreen); + state->emu_window = std::make_unique(&input_subsystem, state->system, lp.fullscreen); break; default: LOG_CRITICAL(Frontend, "Invalid renderer backend"); @@ -413,12 +239,12 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { Service::AM::FrontendAppletParameters load_parameters{ .applet_id = Service::AM::AppletId::Application, }; - const Core::SystemResultStatus load_result = state->system.Load(*state->emu_window, filepath, load_parameters); + const Core::SystemResultStatus load_result = state->system.Load(*state->emu_window, lp.filepath, load_parameters); switch (load_result) { case Core::SystemResultStatus::Success: break; // Expected case case Core::SystemResultStatus::ErrorGetLoader: - LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filepath); + LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", lp.filepath); return SDL_APP_FAILURE; case Core::SystemResultStatus::ErrorLoader: LOG_CRITICAL(Frontend, "Failed to load ROM!"); @@ -440,14 +266,14 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { return SDL_APP_FAILURE; } - if (use_multiplayer) { + if (lp.use_multiplayer) { if (auto member = Network::GetRoomMember().lock()) { member->BindOnChatMessageReceived(OnMessageReceived); member->BindOnStatusMessageReceived(OnStatusMessageReceived); member->BindOnStateChanged(OnStateChanged); member->BindOnError(OnNetworkError); - LOG_DEBUG(Network, "Start connection to {}:{} with nickname {}", address, port, nickname); - member->Join(nickname, address.c_str(), port, 0, Network::NoPreferredIP, password); + LOG_DEBUG(Network, "Start connection to {}:{} with nickname {}", lp.address, lp.port, lp.nickname); + member->Join(lp.nickname, lp.address.c_str(), lp.port, 0, Network::NoPreferredIP, lp.password); } else { LOG_ERROR(Network, "Could not access RoomMember"); return SDL_APP_FAILURE; From cb73a4dcc7710a7fea1643797b17e39858f4ae6a Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Thu, 24 Sep 2026 02:48:46 +0200 Subject: [PATCH 032/198] [renderer_vulkan] Skip post-processing on applet layers (#4474) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Detect applet layers via the absence of the Recording bit in layer_stack_mask (only AppletId::Application sets it) and skip PostProcessChain creation and application for them. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4474 Reviewed-by: CamilleLaVey Reviewed-by: lizzie --- src/video_core/renderer_vulkan/present/layer.cpp | 11 +++++++++-- src/video_core/renderer_vulkan/present/layer.h | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/video_core/renderer_vulkan/present/layer.cpp b/src/video_core/renderer_vulkan/present/layer.cpp index 1868142f51..6d3e7721f6 100644 --- a/src/video_core/renderer_vulkan/present/layer.cpp +++ b/src/video_core/renderer_vulkan/present/layer.cpp @@ -98,7 +98,10 @@ void Layer::ConfigureDraw(const Device& device, PresentPushConstants* out_push_c RefreshResources(device, framebuffer); SetAntiAliasPass(device); #ifdef HAS_RESHADE - SetPostProcessPass(device); + const bool is_applet = + (framebuffer.layer_stack_mask & Service::Nvnflinger::LayerStackBit( + Service::Nvnflinger::LayerStackId::Recording)) == 0; + SetPostProcessPass(device, is_applet); #endif // Finish any pending renderpass @@ -228,7 +231,11 @@ void Layer::SetAntiAliasPass(const Device& device) { } #ifdef HAS_RESHADE -void Layer::SetPostProcessPass(const Device& device) { +void Layer::SetPostProcessPass(const Device& device, bool is_applet) { + if (is_applet) { + post_process.reset(); + return; + } const VkExtent2D render_area{ .width = Settings::values.resolution_info.ScaleUp(raw_width), .height = Settings::values.resolution_info.ScaleUp(raw_height), diff --git a/src/video_core/renderer_vulkan/present/layer.h b/src/video_core/renderer_vulkan/present/layer.h index f290ba5bb4..b965ef7c49 100644 --- a/src/video_core/renderer_vulkan/present/layer.h +++ b/src/video_core/renderer_vulkan/present/layer.h @@ -70,7 +70,7 @@ private: void RefreshResources(const Device& device, const Tegra::FramebufferConfig& framebuffer); void SetAntiAliasPass(const Device& device); #ifdef HAS_RESHADE - void SetPostProcessPass(const Device& device); + void SetPostProcessPass(const Device& device, bool is_applet); #endif void ReleaseRawImages(); From dbeb73ee011416cffc6c203945f5ccc6b90621f6 Mon Sep 17 00:00:00 2001 From: xbzk Date: Thu, 24 Sep 2026 18:44:14 +0200 Subject: [PATCH 033/198] [video_core] cpu buffer fix + kepler uploads / maxwell macro dirty tracking fixes (#4473) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Aimed to fix two known UE5 crashes: Kepler uploads and Maxwell macros, both caused by CPU/GPU races due dirty tracking issues. Kepler ComputeInline: preserved dirty tracking across dma continuations and async readback. Maxwell macros: preserved gpu owned subranges during page granular cpu uploads. DiscardWrite: stopped clearing neighboring macro arguments by rounding up ranges. DMA Step: improved continuation aware dirty sampling. To the Ender Magnolia crew (maybe 1 or 2 persons): This will fix the dash crash, and the random / shackled beast vaper crashes. There are some more UE5 issues to go next. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4473 Reviewed-by: lizzie Reviewed-by: MaranBr --- src/video_core/buffer_cache/buffer_cache.h | 23 ++++++++++++++-------- src/video_core/dma_pusher.cpp | 15 +++++++++----- src/video_core/engines/kepler_compute.cpp | 15 ++++++++++---- src/video_core/engines/kepler_compute.h | 2 ++ 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 4c345dd213..576f20c4e7 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -121,7 +121,7 @@ void BufferCache

::UnmapGPUMemory(size_t as_id, GPUVAddr gpu_addr, size_t size template void BufferCache

::WriteMemory(DAddr device_addr, u64 size) { - if (memory_tracker.IsRegionGpuModified(device_addr, size)) { + if (IsRegionGpuModified(device_addr, size)) { ClearDownload(device_addr, size); gpu_modified_ranges.Subtract(device_addr, size); } @@ -311,11 +311,8 @@ std::pair BufferCache

::ObtainCPUBuffer( MarkWrittenBuffer(buffer_id, device_addr, size); break; case ObtainBufferOperation::DiscardWrite: { - const DAddr device_addr_start = Common::AlignDown(device_addr, 64); - const DAddr device_addr_end = Common::AlignUp(device_addr + size, 64); - const size_t new_size = device_addr_end - device_addr_start; - ClearDownload(device_addr_start, new_size); - gpu_modified_ranges.Subtract(device_addr_start, new_size); + ClearDownload(device_addr, size); + gpu_modified_ranges.Subtract(device_addr, size); break; } default: @@ -1742,14 +1739,24 @@ bool BufferCache

::SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 si u64 total_size_bytes = 0; u64 largest_copy = 0; const DAddr buffer_start = buffer.cpu_addr_cached; - memory_tracker.ForEachUploadRange(device_addr, size, [&](u64 device_addr_out, u64 range_size) { + const auto add_upload = [&](DAddr start, DAddr end) { + if (start == end) return; + const u64 range_size = end - start; upload_copies.push_back(BufferCopy{ .src_offset = total_size_bytes, - .dst_offset = device_addr_out - buffer_start, + .dst_offset = start - buffer_start, .size = range_size, }); total_size_bytes += range_size; largest_copy = (std::max)(largest_copy, range_size); + }; + memory_tracker.ForEachUploadRange(device_addr, size, [&](u64 device_addr_out, u64 range_size) { + DAddr upload_start = device_addr_out; + gpu_modified_ranges.ForEachInRange(device_addr_out, range_size, [&](DAddr gpu_start, DAddr gpu_end) { + add_upload(upload_start, gpu_start); + upload_start = gpu_end; + }); + add_upload(upload_start, device_addr_out + range_size); }); if (total_size_bytes == 0) { return true; diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp index 2417659f09..2c0ba007ef 100644 --- a/src/video_core/dma_pusher.cpp +++ b/src/video_core/dma_pusher.cpp @@ -16,7 +16,7 @@ namespace Tegra { constexpr u32 MacroRegistersStart = 0xE00; -[[maybe_unused]] constexpr u32 ComputeInline = 0x6D; +constexpr u32 ComputeInline = 0x6D; DmaPusher::DmaPusher(Core::System& system_, MemoryManager& memory_manager_, Control::ChannelState& channel_state_) : system{system_} @@ -73,11 +73,16 @@ bool DmaPusher::Step() { synced = false; } - if (header.size > 0 && dma_state.method >= MacroRegistersStart && subchannels[dma_state.subchannel]) { - subchannels[dma_state.subchannel]->current_dirty = memory_manager.IsMemoryDirty(dma_state.dma_get, header.size * sizeof(u32)); - } - if (header.size > 0) { + if (subchannels[dma_state.subchannel] && dma_state.method_count) { + const auto engine = subchannel_type[dma_state.subchannel]; + const bool kepler_payload = engine == Engines::EngineTypes::KeplerCompute && dma_state.method == ComputeInline && dma_state.non_incrementing; + const bool macro_payload = engine == Engines::EngineTypes::Maxwell3D && dma_state.method >= MacroRegistersStart; + if (kepler_payload || macro_payload) { + const size_t words = std::min(dma_state.method_count, header.size); + subchannels[dma_state.subchannel]->current_dirty = memory_manager.IsMemoryDirty(dma_state.dma_get, words * sizeof(u32)); + } + } const bool use_safe = Settings::IsDMALevelDefault() ? Settings::IsGPULevelHigh() : Settings::IsDMALevelSafe(); if (use_safe) { Tegra::Memory::GpuGuestMemoryheaders(memory_manager, dma_state.dma_get, header.size, &command_headers); diff --git a/src/video_core/engines/kepler_compute.cpp b/src/video_core/engines/kepler_compute.cpp index 1ef6e0fc0d..96a12539a2 100644 --- a/src/video_core/engines/kepler_compute.cpp +++ b/src/video_core/engines/kepler_compute.cpp @@ -49,13 +49,16 @@ void KeplerCompute::CallMethod(Core::System& system, u32 method, u32 method_argu case KEPLER_COMPUTE_REG_INDEX(exec_upload): { UploadInfo info{.upload_address = upload_address, .exec_address = upload_state.ExecTargetAddress(), - .copy_size = upload_state.GetUploadSize()}; + .copy_size = upload_state.GetUploadSize(), + .was_dirty = upload_dirty}; uploads.push_back(info); upload_state.ProcessExec(regs.exec_upload.linear != 0); break; } case KEPLER_COMPUTE_REG_INDEX(data_upload): { upload_address = current_dma_segment; + upload_dirty = current_dirty; + current_dirty = false; upload_state.ProcessData(method_argument, is_last_call); break; } @@ -64,9 +67,11 @@ void KeplerCompute::CallMethod(Core::System& system, u32 method, u32 method_argu for (auto& data : uploads) { const GPUVAddr offset = data.exec_address - launch_desc_loc; - if (offset / sizeof(u32) == LAUNCH_REG_INDEX(grid_dim_x) && - memory_manager.IsMemoryDirty(data.upload_address, data.copy_size)) { - indirect_compute = {data.upload_address}; + if (offset / sizeof(u32) == LAUNCH_REG_INDEX(grid_dim_x)) { + const bool source_dirty = memory_manager.IsMemoryDirty(data.upload_address, data.copy_size); + if (data.was_dirty || source_dirty) { + indirect_compute = {data.upload_address}; + } } } uploads.clear(); @@ -83,6 +88,8 @@ void KeplerCompute::CallMultiMethod(Core::System& system, u32 method, const u32* switch (method) { case KEPLER_COMPUTE_REG_INDEX(data_upload): upload_address = current_dma_segment; + upload_dirty = current_dirty; + current_dirty = false; upload_state.ProcessData(base_start, amount); return; default: diff --git a/src/video_core/engines/kepler_compute.h b/src/video_core/engines/kepler_compute.h index 4f7242f804..078d3d45be 100644 --- a/src/video_core/engines/kepler_compute.h +++ b/src/video_core/engines/kepler_compute.h @@ -226,11 +226,13 @@ private: VideoCore::RasterizerInterface* rasterizer = nullptr; Upload::State upload_state; GPUVAddr upload_address; + bool upload_dirty{}; struct UploadInfo { GPUVAddr upload_address; GPUVAddr exec_address; u32 copy_size; + bool was_dirty; }; std::vector uploads; std::optional indirect_compute{}; From 99bf8cf51afb7b367cb5003f11a797499c71d13c Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Fri, 25 Sep 2026 05:29:08 +0200 Subject: [PATCH 034/198] [am, renderer_vulkan] Fix overlay darkening and SGSR black screen on applets (#4475) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- - Overlay applet: use IsOverlayOpenLocked to pick the Z-index, so the darkening background is only layered above the game while the overlay is open. - Vulkan: skip the SGSR pass for applet layers to avoid presenting a black frame. - Partial revert fix crashes in games on UE with the overlay applet enabled. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4475 Reviewed-by: CamilleLaVey Reviewed-by: lizzie --- src/core/hle/service/am/window_system.cpp | 2 +- src/hid_core/resources/npad/npad.cpp | 23 +++++++++++-------- .../renderer_vulkan/present/layer.cpp | 13 +++++++---- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/core/hle/service/am/window_system.cpp b/src/core/hle/service/am/window_system.cpp index 3858791430..fbb1a57efd 100644 --- a/src/core/hle/service/am/window_system.cpp +++ b/src/core/hle/service/am/window_system.cpp @@ -517,7 +517,7 @@ void WindowSystem::UpdateAppletStateLocked(Applet* applet, bool is_foreground, b // Layer ordering. Composition sorts back-to-front. Now with enums for calrity. s32 z_index = Background; if (is_overlay) { - z_index = Overlay; + z_index = this->IsOverlayOpenLocked(*applet) ? Overlay : Background; } else if (inherited_foreground) { z_index = is_obscured ? Foreground : ForegroundVisible; } diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp index c67f839df1..2b04e2c670 100644 --- a/src/hid_core/resources/npad/npad.cpp +++ b/src/hid_core/resources/npad/npad.cpp @@ -45,6 +45,19 @@ NPad::NPad(Core::HID::HIDCore& hid_core_, KernelHelpers::ServiceContext& service AbstractPad{hid_core_.kernel}, }} { + for (std::size_t aruid_index = 0; aruid_index < AruidIndexMax; ++aruid_index) { + for (std::size_t i = 0; i < controller_data[aruid_index].size(); ++i) { + auto& controller = controller_data[aruid_index][i]; + controller.device = hid_core.GetEmulatedControllerByIndex(i); + Core::HID::ControllerUpdateCallback engine_callback{ + .on_change = [this, i, kernel = &hid_core.kernel](Core::HID::ControllerTriggerType type) { + ControllerUpdate(*kernel, type, i); + }, + .is_npad_service = true, + }; + controller.callback_key = controller.device->SetCallback(engine_callback); + } + } for (std::size_t i = 0; i < abstracted_pads.size(); ++i) { abstracted_pads[i].SetNpadId(IndexToNpadIdType(i)); } @@ -93,16 +106,6 @@ Result NPad::Activate(u64 aruid) { for (std::size_t i = 0; i < controller_data[aruid_index].size(); ++i) { auto& controller = controller_data[aruid_index][i]; controller.shared_memory = &data->shared_memory_format->npad.npad_entry[i].internal_state; - controller.device = hid_core.GetEmulatedControllerByIndex(i); - if (!controller.callback_key) { - Core::HID::ControllerUpdateCallback engine_callback{ - .on_change = [this, i](Core::HID::ControllerTriggerType type) { - ControllerUpdate(hid_core.kernel, type, i); - }, - .is_npad_service = true, - }; - controller.callback_key = controller.device->SetCallback(engine_callback); - } } // Prefill controller buffers diff --git a/src/video_core/renderer_vulkan/present/layer.cpp b/src/video_core/renderer_vulkan/present/layer.cpp index 6d3e7721f6..9f4aaf390f 100644 --- a/src/video_core/renderer_vulkan/present/layer.cpp +++ b/src/video_core/renderer_vulkan/present/layer.cpp @@ -94,13 +94,13 @@ void Layer::ConfigureDraw(const Device& device, PresentPushConstants* out_push_c const u32 scaled_width = texture_info ? texture_info->scaled_width : texture_width; const u32 scaled_height = texture_info ? texture_info->scaled_height : texture_height; const bool use_accelerated = texture_info.has_value(); + const bool is_applet = + (framebuffer.layer_stack_mask & Service::Nvnflinger::LayerStackBit( + Service::Nvnflinger::LayerStackId::Recording)) == 0; RefreshResources(device, framebuffer); SetAntiAliasPass(device); #ifdef HAS_RESHADE - const bool is_applet = - (framebuffer.layer_stack_mask & Service::Nvnflinger::LayerStackBit( - Service::Nvnflinger::LayerStackId::Recording)) == 0; SetPostProcessPass(device, is_applet); #endif @@ -141,8 +141,11 @@ void Layer::ConfigureDraw(const Device& device, PresentPushConstants* out_push_c source_image_view = fsr->Draw(device, scheduler, image_index, source_image, source_image_view, render_extent, crop_rect); crop_rect = {0, 0, 1, 1}; } else if (auto* sgsr = std::get_if(&sr_filter)) { - source_image_view = sgsr->Draw(device, scheduler, image_index, source_image, source_image_view, render_extent, crop_rect); - crop_rect = {0, 0, 1, 1}; + if (!is_applet) { + source_image_view = sgsr->Draw(device, scheduler, image_index, source_image, + source_image_view, render_extent, crop_rect); + crop_rect = {0, 0, 1, 1}; + } } SetMatrixData(device, *out_push_constants, layout); From bebc19da3253f13ceb5abfe8560cdbdc32ea7d8a Mon Sep 17 00:00:00 2001 From: lizzie Date: Fri, 25 Sep 2026 07:54:49 +0200 Subject: [PATCH 035/198] [common] Use `std::make_unique_for_overwrite` in ScratchBuffer, remove polyfill (#4432) Original `make_unique_for_overwrite.h` is well defined acc. to standard https://en.cppreference.com/cpp/memory/unique_ptr/make_unique, but by now most libc++ supports the function, so no need for polyfill. Test that this didn't break anything (for example, Megaman game that has video at the start), or anything using VIC/IPC. Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4432 Reviewed-by: MaranBr Reviewed-by: CamilleLaVey --- src/common/CMakeLists.txt | 1 - src/common/make_unique_for_overwrite.h | 27 ------------------- src/common/scratch_buffer.h | 12 ++++----- src/core/file_sys/vfs/vfs_real.cpp | 7 +++-- src/core/file_sys/vfs/vfs_real.h | 11 ++++---- .../hle/service/psc/ovln/receiver_service.cpp | 4 +-- 6 files changed, 16 insertions(+), 46 deletions(-) delete mode 100644 src/common/make_unique_for_overwrite.h diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 94da1724df..0517f0b9e1 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -76,7 +76,6 @@ add_library( logging.h lz4_compression.cpp lz4_compression.h - make_unique_for_overwrite.h math_util.h memory_detect.cpp memory_detect.h diff --git a/src/common/make_unique_for_overwrite.h b/src/common/make_unique_for_overwrite.h deleted file mode 100644 index 17f81bba4a..0000000000 --- a/src/common/make_unique_for_overwrite.h +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include - -namespace Common { - -template - requires(!std::is_array_v) -std::unique_ptr make_unique_for_overwrite() { - return std::unique_ptr(new T); -} - -template - requires std::is_unbounded_array_v -std::unique_ptr make_unique_for_overwrite(std::size_t n) { - return std::unique_ptr(new std::remove_extent_t[n]); -} - -template - requires std::is_bounded_array_v -void make_unique_for_overwrite(Args&&...) = delete; - -} // namespace Common diff --git a/src/common/scratch_buffer.h b/src/common/scratch_buffer.h index 8c1f566301..929a65609a 100644 --- a/src/common/scratch_buffer.h +++ b/src/common/scratch_buffer.h @@ -8,8 +8,7 @@ #include #include - -#include "common/make_unique_for_overwrite.h" +#include namespace Common { @@ -38,8 +37,9 @@ public: ScratchBuffer() = default; explicit ScratchBuffer(size_type initial_capacity) - : last_requested_size{initial_capacity}, buffer_capacity{initial_capacity}, - buffer{Common::make_unique_for_overwrite(initial_capacity)} {} + : last_requested_size{initial_capacity} + , buffer_capacity{initial_capacity} + , buffer{std::make_unique_for_overwrite(initial_capacity)} {} ~ScratchBuffer() = default; ScratchBuffer(const ScratchBuffer&) = delete; @@ -64,7 +64,7 @@ public: /// The previously held data will remain intact. void resize(size_type size) { if (size > buffer_capacity) { - auto new_buffer = Common::make_unique_for_overwrite(size); + auto new_buffer = std::make_unique_for_overwrite(size); std::memcpy(new_buffer.get(), buffer.get(), buffer_capacity * sizeof(T)); buffer = std::move(new_buffer); buffer_capacity = size; @@ -77,7 +77,7 @@ public: void resize_destructive(size_type size) { if (size > buffer_capacity) { buffer_capacity = size; - buffer = Common::make_unique_for_overwrite(buffer_capacity); + buffer = std::make_unique_for_overwrite(buffer_capacity); } last_requested_size = size; } diff --git a/src/core/file_sys/vfs/vfs_real.cpp b/src/core/file_sys/vfs/vfs_real.cpp index b04f832cd3..14e0caad3c 100644 --- a/src/core/file_sys/vfs/vfs_real.cpp +++ b/src/core/file_sys/vfs/vfs_real.cpp @@ -109,8 +109,7 @@ VirtualFile RealVfsFilesystem::OpenFileFromEntry(std::string_view path_, std::op auto reference = std::make_unique(); this->InsertReferenceIntoListLocked(*reference); - auto file = std::shared_ptr( - new RealVfsFile(*this, std::move(reference), path, perms, size, std::move(parent_path))); + auto file = std::make_shared(*this, std::move(reference), path, perms, size, std::move(parent_path)); cache[path] = file; return file; @@ -177,7 +176,7 @@ bool RealVfsFilesystem::DeleteFile(std::string_view path_) { VirtualDir RealVfsFilesystem::OpenDirectory(std::string_view path_, OpenMode perms) { const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault); - return std::shared_ptr(new RealVfsDirectory(*this, path, perms)); + return std::make_shared(*this, path, perms); } VirtualDir RealVfsFilesystem::CreateDirectory(std::string_view path_, OpenMode perms) { @@ -185,7 +184,7 @@ VirtualDir RealVfsFilesystem::CreateDirectory(std::string_view path_, OpenMode p if (!FS::CreateDirs(path)) { return nullptr; } - return std::shared_ptr(new RealVfsDirectory(*this, path, perms)); + return std::make_shared(*this, path, perms); } VirtualDir RealVfsFilesystem::CopyDirectory(std::string_view old_path_, diff --git a/src/core/file_sys/vfs/vfs_real.h b/src/core/file_sys/vfs/vfs_real.h index 672126d7ba..a97f7d32ea 100644 --- a/src/core/file_sys/vfs/vfs_real.h +++ b/src/core/file_sys/vfs/vfs_real.h @@ -82,6 +82,9 @@ class RealVfsFile : public VfsFile { friend class RealVfsFilesystem; public: + RealVfsFile(RealVfsFilesystem& base, std::unique_ptr reference, + const std::string& path, OpenMode perms = OpenMode::Read, + std::optional size = {}, std::optional parent_path = {}); ~RealVfsFile() override; std::string GetName() const override; @@ -95,9 +98,6 @@ public: bool Rename(std::string_view name) override; private: - RealVfsFile(RealVfsFilesystem& base, std::unique_ptr reference, - const std::string& path, OpenMode perms = OpenMode::Read, - std::optional size = {}, std::optional parent_path = {}); RealVfsFilesystem& base; std::unique_ptr reference; @@ -113,6 +113,8 @@ class RealVfsDirectory : public VfsDirectory { friend class RealVfsFilesystem; public: + RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, + OpenMode perms = OpenMode::Read); ~RealVfsDirectory() override; VirtualFile GetFileRelative(std::string_view relative_path) const override; @@ -138,9 +140,6 @@ public: std::map> GetEntries() const override; private: - RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, - OpenMode perms = OpenMode::Read); - template std::vector> IterateEntries() const; diff --git a/src/core/hle/service/psc/ovln/receiver_service.cpp b/src/core/hle/service/psc/ovln/receiver_service.cpp index d869325181..3b0b180725 100644 --- a/src/core/hle/service/psc/ovln/receiver_service.cpp +++ b/src/core/hle/service/psc/ovln/receiver_service.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -24,7 +24,7 @@ IReceiverService::~IReceiverService() = default; Result IReceiverService::OpenReceiver(Out> out_receiver) { LOG_DEBUG(Service_PSC, "called"); - *out_receiver = std::shared_ptr(new IReceiver(system)); + *out_receiver = std::make_shared(system); R_SUCCEED(); } From 87d2f03c39bc441055d593a7913f63a017795359 Mon Sep 17 00:00:00 2001 From: MaranBr Date: Sat, 26 Sep 2026 02:21:45 +0200 Subject: [PATCH 036/198] [hid_core] Code cleanup (#4461) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This is just a code cleanup. This is no longer necessary due to commit #4457. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4461 Reviewed-by: lizzie --- src/hid_core/frontend/emulated_controller.cpp | 22 ++++--------------- src/hid_core/frontend/emulated_controller.h | 2 -- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp index 1092970ee8..7b4af13232 100644 --- a/src/hid_core/frontend/emulated_controller.cpp +++ b/src/hid_core/frontend/emulated_controller.cpp @@ -761,9 +761,6 @@ void EmulatedController::StartMotionCalibration() { } void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback, std::size_t index, Common::UUID uuid) { - const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); - const auto& player = Settings::values.players.GetValue()[player_index]; - if (index >= controller.button_values.size()) { return; } @@ -916,21 +913,10 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback break; } - if (!is_connected) { - if (npad_type == NpadStyleIndex::Handheld) { - if (npad_id_type == NpadIdType::Handheld) { - Connect(); - controller_connected[player_index] = true; - } - } else if (npad_type != NpadStyleIndex::Handheld) { - if (npad_id_type == NpadIdType::Player1) { - Connect(); - controller_connected[player_index] = true; - } else if (player.connected && !controller_connected[player_index]) { - Connect(); - controller_connected[player_index] = true; - } - } + const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); + const auto& player = Settings::values.players.GetValue()[player_index]; + if (player.connected) { + Connect(); } TriggerOnChange(ControllerTriggerType::Button, true); diff --git a/src/hid_core/frontend/emulated_controller.h b/src/hid_core/frontend/emulated_controller.h index 7a2291b8a4..80ea633c63 100644 --- a/src/hid_core/frontend/emulated_controller.h +++ b/src/hid_core/frontend/emulated_controller.h @@ -22,7 +22,6 @@ #include "common/settings.h" #include "common/vector_math.h" #include "hid_core/frontend/motion_input.h" -#include "hid_core/hid_core.h" #include "hid_core/hid_types.h" #include "hid_core/irsensor/irs_types.h" @@ -585,7 +584,6 @@ private: std::array last_vibration_value{DEFAULT_VIBRATION_VALUE, DEFAULT_VIBRATION_VALUE}; std::array last_vibration_timepoint{}; - std::array controller_connected{}; // Atomically synched values std::atomic npad_type{HID::NpadStyleIndex::None}; From f273423b2b83f1a37cc7c1a7a92601f26e0c12ae Mon Sep 17 00:00:00 2001 From: MaranBr Date: Sat, 26 Sep 2026 05:01:27 +0200 Subject: [PATCH 037/198] [buffer_cache] Simplify GPU fence synchronization and remove GPU buffer readback (#4477) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This is understood to improve GPU synchronization within the buffer cache in certain edge cases. GPU Fence Strict is no longer necessary. We now apply the stronger synchronization only in the specific case that actually requires it. The GPU Buffer Readback has been removed, as it is no longer needed following PR #4473. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4477 Reviewed-by: CamilleLaVey --- .../features/settings/model/BooleanSetting.kt | 1 - .../settings/model/view/SettingsItem.kt | 7 ---- .../settings/ui/SettingsFragmentPresenter.kt | 1 - .../app/src/main/res/values-ar/strings.xml | 3 -- .../app/src/main/res/values-de/strings.xml | 1 - .../app/src/main/res/values-es/strings.xml | 3 -- .../app/src/main/res/values-ru/strings.xml | 3 -- .../src/main/res/values-zh-rCN/strings.xml | 3 -- .../src/main/res/values-zh-rTW/strings.xml | 2 - .../app/src/main/res/values/arrays.xml | 1 - .../app/src/main/res/values/strings.xml | 3 -- src/common/settings.cpp | 4 -- src/common/settings.h | 10 +---- src/common/settings_enums.h | 2 +- src/qt_common/config/shared_translation.cpp | 5 +-- src/video_core/buffer_cache/buffer_cache.h | 39 +++++++++---------- .../buffer_cache/buffer_cache_base.h | 4 +- src/video_core/fence_manager.h | 2 +- src/video_core/query_cache/query_cache.h | 2 +- .../renderer_vulkan/vk_buffer_cache.cpp | 10 ++--- .../renderer_vulkan/vk_buffer_cache.h | 4 +- 21 files changed, 32 insertions(+), 78 deletions(-) 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 ca3309245e..97be7f1bd9 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 @@ -30,7 +30,6 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_REACTIVE_FLUSHING("use_reactive_flushing"), ENABLE_BUFFER_HISTORY("enable_buffer_history"), USE_OPTIMIZED_VERTEX_BUFFERS("use_optimized_vertex_buffers"), - ENABLE_GPU_BUFFER_READBACK("enable_gpu_buffer_readback"), SYNC_MEMORY_OPERATIONS("sync_memory_operations"), BUFFER_REORDER_DISABLE("disable_buffer_reorder"), RENDERER_DEBUG("debug"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 3f38831a17..366d3a8b3b 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -908,13 +908,6 @@ abstract class SettingsItem( descriptionId = R.string.enable_buffer_history_description ) ) - put( - SwitchSetting( - BooleanSetting.ENABLE_GPU_BUFFER_READBACK, - titleId = R.string.enable_gpu_buffer_readback, - descriptionId = R.string.enable_gpu_buffer_readback_description - ) - ) put( SwitchSetting( BooleanSetting.USE_OPTIMIZED_VERTEX_BUFFERS, 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 ca282ba159..e9f818d9bc 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 @@ -549,7 +549,6 @@ class SettingsFragmentPresenter( add(BooleanSetting.RENDERER_FORCE_MAX_CLOCK.key) add(BooleanSetting.RENDERER_REACTIVE_FLUSHING.key) add(BooleanSetting.ENABLE_BUFFER_HISTORY.key) - add(BooleanSetting.ENABLE_GPU_BUFFER_READBACK.key) add(BooleanSetting.USE_OPTIMIZED_VERTEX_BUFFERS.key) add(HeaderSetting(R.string.hacks)) diff --git a/src/android/app/src/main/res/values-ar/strings.xml b/src/android/app/src/main/res/values-ar/strings.xml index 44f86d380f..fe8e1e0555 100644 --- a/src/android/app/src/main/res/values-ar/strings.xml +++ b/src/android/app/src/main/res/values-ar/strings.xml @@ -580,8 +580,6 @@ يحسن دقة العرض في بعض الألعاب على حساب الأداء. تمكين سجل التخزين المؤقت يُتيح هذا الخيار الوصول إلى حالات التخزين المؤقت السابقة. وقد يُحسّن جودة العرض وثبات الأداء في بعض الألعاب. - تفعيل قراءة مخزن وحدة معالجة الرسومات - يحافظ هذا النظام على بيانات المخزن المؤقت المُعدّلة بواسطة وحدة معالجة الرسومات عن طريق قراءتها مرة أخرى قبل التحميل. تتطلب بعض الألعاب ذلك لعرض بعض التأثيرات بشكل صحيح. قد يُسبب ذلك مشاكل إذا لم يتمكن الجهاز من التعامل مع عبء العمل الإضافي. مخازن الرؤوس المُحسّنة يُتيح ربطًا مُحسَّنًا لمخازن الرؤوس لتحسين الأداء. يتطلب برامج تشغيل Mesa 26.0+ Turnip/ برامج تشغيل QCOM. قد يتعطل على برامج تشغيل Turnip القديمة (25.3 وما دون). @@ -1099,7 +1097,6 @@ فوري متوازن دقيق - صارم محافظ عدواني diff --git a/src/android/app/src/main/res/values-de/strings.xml b/src/android/app/src/main/res/values-de/strings.xml index 6ed158fc72..8f6b691176 100644 --- a/src/android/app/src/main/res/values-de/strings.xml +++ b/src/android/app/src/main/res/values-de/strings.xml @@ -967,7 +967,6 @@ Wirklich fortfahren? Direkt Ausgewogen Genau - Strikt Konservativ Aggressiv diff --git a/src/android/app/src/main/res/values-es/strings.xml b/src/android/app/src/main/res/values-es/strings.xml index 3444ccaa71..72f8d74203 100644 --- a/src/android/app/src/main/res/values-es/strings.xml +++ b/src/android/app/src/main/res/values-es/strings.xml @@ -524,8 +524,6 @@ Mejora la precisión de renderizado en algunos juegos, pero reduce el rendimiento. Activar el historial del búfer Permite el acceso al estado del búfer anterior. Esta opción puede mejorar la calidad de renderizado y la consistencia en el rendimiento de algunos juegos. - Activar la lectura del buffer de la GPU - Conserva los datos del búfer modificados por la GPU leyéndolos antes de subirlos.\nAlgunos juegos requieren esto para renderizar correctamente ciertos efectos.\nPuede causar problemas si el hardware no puede soportar la carga de trabajo adicional. Búferes de vértices optimizados Permite la optimización del enlace del búfer de vértices para un mejor rendimiento. Requiere controladores Mesa 26.0+ Turnip/ controladores QCOM. Fallará con controladores Turnip más antiguos (versión 25.3 o inferior). @@ -1038,7 +1036,6 @@ Inmediato Equilibrado Preciso - Estricto Conservador Agresivo diff --git a/src/android/app/src/main/res/values-ru/strings.xml b/src/android/app/src/main/res/values-ru/strings.xml index 7bfe003317..912ce84caf 100644 --- a/src/android/app/src/main/res/values-ru/strings.xml +++ b/src/android/app/src/main/res/values-ru/strings.xml @@ -569,8 +569,6 @@ Повышение точности рендеринга в некоторых играх за счет снижения производительности. Включить историю буфера Позволяет обращаться к предыдущим состояниям буфера. Эта опция может повысить качество рендеринга и стабильность производительности в некоторых играх. - Включить обратное чтение буфера ГПУ - Сохраняет измененные ГПУ данные буфера путем чтения их обратно перед выгрузками. Некоторые игры требуют этого, чтобы рендерить определенные эффекты правильно. Может вызывать проблемы если оборудование не может обработать дополнительную рабочую нагрузку. Оптимизированные вершинные буферы Включает оптимизированную привязку вершинного буфера для повышения производительности. Требует Mesa Turnip 26.0+ / QCOM. Приводит к вылету на старых версиях драйверов Turnip (25.3 и ниже). @@ -1088,7 +1086,6 @@ Мгновенный Сбалансированный Точный - Строгий Консервативный Агрессивный 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 index 2f41b5d65a..19f5f0aae7 100644 --- a/src/android/app/src/main/res/values-zh-rCN/strings.xml +++ b/src/android/app/src/main/res/values-zh-rCN/strings.xml @@ -570,8 +570,6 @@ 通过牺牲性能来提升某些游戏的渲染精度。 启用缓冲区历史 启用对先前缓冲区状态的访问。此选项可在某些游戏中提升渲染质量并保持性能的一致性。 - 启用 GPU 缓冲区回读 - 在上传前回读经由 GPU 修改过的缓冲区数据,以将其保留。一些游戏会用到这项设定以正确渲染某些效果。如果硬件无法处理额外的工作负载,则可能会导致问题。 优化顶点缓冲区 启用经过优化的顶点缓冲区绑定以提升性能。需要 Mesa 26.0 及以上版本的 Turnip 或 QCOM 驱动程序。若使用较旧版本的 Turnip 驱动 (25.3 及以下版本) 则会导致崩溃。 @@ -1089,7 +1087,6 @@ 即时 均衡 精确 - 严格 保守式 主动式 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 index 5db1e31a2b..044b7675de 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -561,8 +561,6 @@ 犧牲效能,以改善部分遊戲的轉譯準確度 啟用緩衝區歷史 允許存取先前的緩衝區狀態。此選項可能會改善部分遊戲的渲染品質與效能穩定性 - 啟用 GPU 緩衝區讀回 - 透過在上傳之前先將 GPU 修改過的緩衝區資料讀回來保存資料,部分遊戲需要啟用此功能才能正常渲染遊戲特效。如果硬體無法負荷可能會導致錯誤 最佳化頂點緩衝區 啟用最佳化的頂點緩衝區綁定。需要安裝 Mesa 26.0+ Turnip drivers/Qualcomm drivers。使用舊版 Turnip drivers 會導致當機 (25.3版和更低的版本) diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index b3aed5758c..be367a2fcf 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -558,7 +558,6 @@ @string/gpu_fence_behavior_immediate @string/gpu_fence_behavior_balanced @string/gpu_fence_behavior_accurate - @string/gpu_fence_behavior_strict 0 diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 730f6bbade..5a587be351 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -586,8 +586,6 @@ Improves rendering accuracy in some games at the cost of performance. Enable buffer history Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - Enable GPU Buffer Readback - Preserves GPU-modified buffer data by reading it back before uploads. Some games require this to render certain effects properly. May cause issues if the hardware cannot handle the additional workload. Optimized Vertex Buffers Enables optimized vertex buffer binding for improved performance. Requires Mesa 26.0+ Turnip drivers/ QCOM drivers. Will crash on older Turnip drivers (25.3 and below). @@ -1138,7 +1136,6 @@ Immediate Balanced Accurate - Strict CPU diff --git a/src/common/settings.cpp b/src/common/settings.cpp index bc46b61bb4..3f5154026e 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -178,10 +178,6 @@ bool IsGPUFenceBehaviorAccurate() { return values.gpu_fence_behavior.GetValue() == GpuFenceBehavior::Accurate; } -bool IsGPUFenceBehaviorStrict() { - return values.gpu_fence_behavior.GetValue() == GpuFenceBehavior::Strict; -} - bool IsFastmemEnabled() { if (values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Debugging) return bool(values.cpuopt_fastmem); diff --git a/src/common/settings.h b/src/common/settings.h index c1c2d4f0df..5d66f49ebd 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -525,7 +525,7 @@ struct Values { SwitchableSetting gpu_fence_behavior{linkage, GpuFenceBehavior::Default, GpuFenceBehavior::Default, - GpuFenceBehavior::Strict, + GpuFenceBehavior::Accurate, "gpu_fence_behavior", Category::RendererAdvanced, Specialization::Default, @@ -655,13 +655,6 @@ struct Values { SwitchableSetting rescale_hack{linkage, false, "rescale_hack", Category::RendererHacks}; - SwitchableSetting enable_gpu_buffer_readback{linkage, - false, - "enable_gpu_buffer_readback", - Category::RendererAdvanced, - Specialization::Default, - true, - true}; SwitchableSetting use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders", Category::RendererHacks}; @@ -979,7 +972,6 @@ bool IsDMALevelSafe(); bool IsGPUFenceBehaviorDefault(); bool IsGPUFenceBehaviorBalanced(); bool IsGPUFenceBehaviorAccurate(); -bool IsGPUFenceBehaviorStrict(); bool IsFastmemEnabled(); void SetNceEnabled(bool is_64bit); diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index 4b406f4c35..55acb0ae8c 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h @@ -137,7 +137,7 @@ ENUM(VramUsageMode, Conservative, Aggressive); ENUM(RendererBackend, OpenGL_GLSL, Vulkan, Null, OpenGL_GLASM, OpenGL_SPIRV); ENUM(GpuAccuracy, Low, High); ENUM(DmaAccuracy, Default, Unsafe, Safe); -ENUM(GpuFenceBehavior, Default, Immediate, Balanced, Accurate, Strict); +ENUM(GpuFenceBehavior, Default, Immediate, Balanced, Accurate); ENUM(CpuBackend, Dynarmic, Nce); ENUM(CpuAccuracy, Auto, Accurate, Unsafe, Paranoid, Debugging); ENUM(CpuClock, Normal, Boost, Overclock) diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 4ef97c602a..d61c84e278 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -226,9 +226,7 @@ std::unique_ptr InitializeTranslations(QObject* parent) { INSERT(Settings, dma_accuracy, tr("DMA Accuracy:"), tr("Controls the DMA read mode.\nUnsafe is faster, while Safe is more stable and can fix issues in some games.\nDefault follows the GPU Accuracy setting.")); INSERT(Settings, gpu_fence_behavior, tr("GPU Fence Behavior:"), - tr("Controls the GPU fence synchronization behavior.\nImmediate is the fastest option, but can introduce some issues.\nBalanced offers better compatibility and may fix issues in some games.\nAccurate further improves compatibility at the cost of some performance.\nStrict is the slowest option, but can fix issues that require stricter synchronization.\nDefault follows the GPU Accuracy setting.")); - INSERT(Settings, enable_gpu_buffer_readback, tr("Enable GPU buffer readback"), - tr("Preserves GPU-modified data by reading it back before uploading.\nSome games require this to render certain effects properly.")); + tr("Controls the GPU fence synchronization behavior.\nImmediate is the fastest option, but can introduce some issues.\nBalanced offers better compatibility and may fix issues in some games.\nAccurate further improves compatibility at the cost of some performance.\nDefault follows the GPU Mode setting.")); INSERT(Settings, use_asynchronous_shaders, tr("Enable asynchronous shader compilation"), tr("May reduce shader stutter.")); INSERT(Settings, gpu_clock, tr("GPU Clocks"), @@ -442,7 +440,6 @@ std::unique_ptr ComboboxEnumeration(QObject* parent) { PAIR(GpuFenceBehavior, Immediate, tr("Immediate")), PAIR(GpuFenceBehavior, Balanced, tr("Balanced")), PAIR(GpuFenceBehavior, Accurate, tr("Accurate")), - PAIR(GpuFenceBehavior, Strict, tr("Strict")), }}); translations->insert( {Settings::EnumMetadata::Index(), diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 576f20c4e7..9a5d6f322a 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -249,6 +249,10 @@ bool BufferCache

::DMACopy(GPUVAddr src_address, GPUVAddr dest_address, u64 am runtime.CopyBuffer(dest_buffer, src_buffer, copies, true); if (has_new_downloads) { memory_tracker.MarkRegionAsGpuModified(*cpu_dest_address, amount); + const bool should_sync = Settings::IsGPUFenceBehaviorBalanced() || Settings::IsGPUFenceBehaviorAccurate(); + if (should_sync) { + runtime.Finish(); + } } Tegra::Memory::DeviceGuestMemoryScoped @@ -1230,7 +1234,7 @@ void BufferCache

::BindHostComputeStorageBuffers() { buffer.MarkUsage(offset, size); if (is_written) { - MarkWrittenBuffer(binding.buffer_id, binding.device_addr, size); + MarkWrittenBuffer(binding.buffer_id, binding.device_addr, size, true); } if constexpr (NEEDS_BIND_STORAGE_INDEX) { @@ -1516,10 +1520,12 @@ void BufferCache

::UpdateComputeTextureBuffers() { } template -void BufferCache

::MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u32 size) { +void BufferCache

::MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u32 size, bool needs_sync) { if constexpr (!IS_OPENGL) { - Buffer& buffer = slot_buffers[buffer_id]; - buffer.setWriteTick(runtime.CurrentTick()); + if (needs_sync) { + Buffer& buffer = slot_buffers[buffer_id]; + buffer.setWriteTick(runtime.CurrentTick()); + } } memory_tracker.MarkRegionAsGpuModified(device_addr, size); gpu_modified_ranges.Add(device_addr, size); @@ -1535,8 +1541,11 @@ BufferId BufferCache

::FindBuffer(DAddr device_addr, u32 size, bool sparse_com const BufferId buffer_id = page_table[page]; if (buffer_id) { Buffer& buffer = slot_buffers[buffer_id]; - WaitForGpuFenceIfNeeded(buffer); if (buffer.IsInBounds(device_addr, size)) { + const bool should_sync = Settings::IsGPUFenceBehaviorAccurate(); + if (should_sync) { + SynchronizeBufferWrites(buffer); + } bool usable = true; if constexpr (requires { buffer.IsSparseCompatible(); }) { if (sparse_compatible && !buffer.IsSparseCompatible()) { @@ -1552,17 +1561,11 @@ BufferId BufferCache

::FindBuffer(DAddr device_addr, u32 size, bool sparse_com } template -void BufferCache

::WaitForGpuFenceIfNeeded(Buffer& buffer) { +void BufferCache

::SynchronizeBufferWrites(Buffer& buffer) { if constexpr (!IS_OPENGL) { - const bool gpu_fence_accurate = Settings::IsGPUFenceBehaviorAccurate(); - const bool gpu_fence_strict = Settings::IsGPUFenceBehaviorStrict(); - if (gpu_fence_accurate || gpu_fence_strict) { - const u64 gpu_tick_delay = gpu_fence_strict ? 0 : 3; - const u64 buffer_tick = buffer.getWriteTick(); - const u64 gpu_tick = runtime.KnownGpuTick(); - if (buffer_tick > gpu_tick + gpu_tick_delay) { - runtime.Wait(buffer_tick); - } + const u64 buffer_tick = buffer.getWriteTick(); + if (!runtime.IsFree(buffer_tick)) { + runtime.Wait(buffer_tick); } } } @@ -1795,9 +1798,6 @@ void BufferCache

::ImmediateUploadMemory([[maybe_unused]] Buffer& buffer, if (immediate_buffer.empty()) { immediate_buffer = ImmediateBuffer(largest_copy); } - if (Settings::values.enable_gpu_buffer_readback.GetValue()) { - DownloadBufferMemory(buffer, device_addr, copy.size); - } device_memory.ReadBlockUnsafe(device_addr, immediate_buffer.data(), copy.size); upload_span = immediate_buffer.subspan(0, copy.size); } @@ -1816,9 +1816,6 @@ void BufferCache

::MappedUploadMemory([[maybe_unused]] Buffer& buffer, for (BufferCopy& copy : copies) { u8* const src_pointer = staging_pointer.data() + copy.src_offset; const DAddr device_addr = buffer.CpuAddr() + copy.dst_offset; - if (Settings::values.enable_gpu_buffer_readback.GetValue()) { - DownloadBufferMemory(buffer, device_addr, copy.size); - } device_memory.ReadBlockUnsafe(device_addr, src_pointer, copy.size); // Apply the staging offset copy.src_offset += upload_staging.offset; diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 0dbb368c47..26bf3dd9ed 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -430,11 +430,11 @@ private: void UpdateComputeTextureBuffers(); - void MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u32 size); + void MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u32 size, bool needs_sync = false); [[nodiscard]] BufferId FindBuffer(DAddr device_addr, u32 size, bool sparse_compatible); - void WaitForGpuFenceIfNeeded(Buffer& buffer); + void SynchronizeBufferWrites(Buffer& buffer); [[nodiscard]] OverlapResult ResolveOverlaps(DAddr device_addr, u32 wanted_size); diff --git a/src/video_core/fence_manager.h b/src/video_core/fence_manager.h index 885c714025..776c01e3fa 100644 --- a/src/video_core/fence_manager.h +++ b/src/video_core/fence_manager.h @@ -72,7 +72,7 @@ public: } void SignalFence(std::function&& func) { - const bool delay_fence = Settings::IsGPUFenceBehaviorDefault() ? Settings::IsGPULevelHigh() : Settings::IsGPUFenceBehaviorBalanced() || Settings::IsGPUFenceBehaviorAccurate() || Settings::IsGPUFenceBehaviorStrict(); + const bool delay_fence = Settings::IsGPUFenceBehaviorDefault() ? Settings::IsGPULevelHigh() : Settings::IsGPUFenceBehaviorBalanced() || Settings::IsGPUFenceBehaviorAccurate(); const bool should_flush = ShouldFlush(); if constexpr (!can_async_check) { TryReleasePendingFences(); diff --git a/src/video_core/query_cache/query_cache.h b/src/video_core/query_cache/query_cache.h index 5404dec943..b8c1bc4f45 100644 --- a/src/video_core/query_cache/query_cache.h +++ b/src/video_core/query_cache/query_cache.h @@ -260,7 +260,7 @@ void QueryCacheBase::CounterReport(GPUVAddr addr, QueryType counter_type }; u8* pointer = impl->device_memory.template GetPointer(cpu_addr); u8* pointer_timestamp = impl->device_memory.template GetPointer(cpu_addr + 8); - bool is_synced = (Settings::IsGPUFenceBehaviorDefault() ? !Settings::IsGPULevelHigh() : !Settings::IsGPUFenceBehaviorBalanced() && !Settings::IsGPUFenceBehaviorAccurate() && !Settings::IsGPUFenceBehaviorStrict()) && is_fence; + bool is_synced = (Settings::IsGPUFenceBehaviorDefault() ? !Settings::IsGPULevelHigh() : !Settings::IsGPUFenceBehaviorBalanced() && !Settings::IsGPUFenceBehaviorAccurate()) && is_fence; std::function operation([this, is_synced, streamer, query_base = query, query_location, pointer, pointer_timestamp] { if (True(query_base->flags & QueryFlagBits::IsInvalidated)) { diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 958f3b2a2e..1a33189bf8 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -419,15 +419,15 @@ void BufferCacheRuntime::TickFrame(Common::SlotVector& slot_buffers) noe } u64 BufferCacheRuntime::CurrentTick() { - return scheduler.GetMasterSemaphore().CurrentTick(); + return scheduler.CurrentTick(); } -u64 BufferCacheRuntime::KnownGpuTick() { - return scheduler.GetMasterSemaphore().KnownGpuTick(); +bool BufferCacheRuntime::IsFree(u64 tick) { + return scheduler.IsFree(tick); } -void BufferCacheRuntime::Wait(u64 buffer_tick) { - scheduler.Wait(buffer_tick); +void BufferCacheRuntime::Wait(u64 tick) { + scheduler.Wait(tick); } void BufferCacheRuntime::Finish() { diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index fbd8c2e753..fff1f8164d 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -112,9 +112,9 @@ public: u64 CurrentTick(); - u64 KnownGpuTick(); + bool IsFree(u64 tick); - void Wait(u64 buffer_tick); + void Wait(u64 tick); void Finish(); From 37fe9119526c03ca064166130cc983c55b9a9e86 Mon Sep 17 00:00:00 2001 From: Exverge Date: Sat, 26 Sep 2026 16:02:35 +0200 Subject: [PATCH 038/198] [common/sparse_large_vector] correct Win32 exception handler (#4481) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Adds mutex to prevent multiple threads from accessing the vector at the same time and corrects the Windows exception handler to use the correct faulting address used by the exception handler (previously used the instruction address instead of the fault address) and properly shifts the stored values for the handler. Fixes weird compiler-specific bugs on Windows Co-authored-by: bruno Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4481 Reviewed-by: lizzie Reviewed-by: MaranBr --- src/common/sparse_large_vector.cpp | 46 ++++++++++++++++++++---------- src/common/sparse_large_vector.h | 27 +++++++++++------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/src/common/sparse_large_vector.cpp b/src/common/sparse_large_vector.cpp index 745575a880..eee8ff6d18 100644 --- a/src/common/sparse_large_vector.cpp +++ b/src/common/sparse_large_vector.cpp @@ -6,6 +6,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #ifdef _WIN32 +#include #include #include #else @@ -20,32 +21,36 @@ namespace Common { #ifdef _WIN32 static std::vector> vector_regions {}; +static std::mutex vector_regions_mutex {}; // Workaround for handling non-commited memory accessed by Dynarmic; usually result of an error static LONG WINAPI FakePageFaultHandler(PEXCEPTION_POINTERS info) { DWORD code = info->ExceptionRecord->ExceptionCode; - u64 exception_addr = reinterpret_cast(info->ExceptionRecord->ExceptionAddress); + u64 exception_addr = reinterpret_cast(info->ExceptionRecord->ExceptionInformation[1]); - if (code != EXCEPTION_ACCESS_VIOLATION) { + if (code != EXCEPTION_ACCESS_VIOLATION || info->ExceptionRecord->ExceptionInformation[0] == 1) { // Not our problem return EXCEPTION_CONTINUE_SEARCH; } u64 addr = 0, addr2 = 0; - for (auto region: vector_regions) { - auto addr_shifted = exception_addr >> HostPageBits; - if (region.first <= addr_shifted && addr_shifted <= region.second) { - addr = addr_shifted; - } + { + std::lock_guard lock(vector_regions_mutex); + for (auto region: vector_regions) { + auto addr_shifted = exception_addr >> HostPageBits; + if (region.first <= addr_shifted && addr_shifted <= region.second) { + addr = addr_shifted; + } - // Page-boundary accesses - if (auto addr_ = (exception_addr + 0x40) >> HostPageBits; addr_ != addr_shifted && region.first <= addr_ && addr_ <= region.second) { - addr2 = addr_; - } + // Page-boundary accesses + if (auto addr_ = (exception_addr + 0x40) >> HostPageBits; addr_ != addr_shifted && region.first <= addr_ && addr_ <= region.second) { + addr2 = addr_; + } - if (addr != 0 || addr2 != 0) { - break; + if (addr != 0 || addr2 != 0) { + break; + } } } @@ -77,8 +82,16 @@ bool CommitVectorPage(uintptr_t addr, bool write) noexcept { auto res = VirtualQuery(reinterpret_cast(addr), &info, sizeof(info)); if (res == 0) { LOG_CRITICAL(HW_Memory, "Failed to query large buffer region at {:#x} with error {}, will try committing anyway", addr, GetLastError()); + } else if (info.State == MEM_COMMIT) { + DWORD old_protect {}; + auto perm = write ? PAGE_READWRITE : PAGE_READONLY; + if (!VirtualProtect(reinterpret_cast(addr), HostPageSize, perm, &old_protect)) { + LOG_ERROR(HW_Memory, "Failed to change permissions of large buffer region at {:#x}, error {}", addr, GetLastError()); + return false; + } + return true; } else if (info.State != MEM_RESERVE) { - LOG_ERROR(HW_Memory, "Tried to commit an unreserved large buffer region at {:#x} that is not mapped or is already committed (state {:#x})", addr, info.State); + LOG_ERROR(HW_Memory, "Tried to commit an unreserved large buffer region at {:#x} that is not mapped (state {:#x})", addr, info.State); return false; } @@ -123,7 +136,8 @@ void* AllocateMemoryPages(std::size_t size) noexcept { void* base = VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE); if (base != nullptr) { - vector_regions.emplace_back(reinterpret_cast(base), reinterpret_cast(base) + size); + std::lock_guard lock(vector_regions_mutex); + vector_regions.emplace_back(reinterpret_cast(base) >> HostPageBits, (reinterpret_cast(base) + size) >> HostPageBits); static std::once_flag flag; std::call_once(flag, []() { AddVectoredExceptionHandler(1, FakePageFaultHandler); }); @@ -149,6 +163,8 @@ void FreeMemoryPages(void* base, [[maybe_unused]] std::size_t size) noexcept { if (!base) return; #ifdef _WIN32 + std::lock_guard lock(vector_regions_mutex); + std::erase_if(vector_regions, [base](const auto& r) {return r.first == reinterpret_cast(base); }); ASSERT(VirtualFree(base, 0, MEM_RELEASE)); #else ASSERT(munmap(base, size) == 0); diff --git a/src/common/sparse_large_vector.h b/src/common/sparse_large_vector.h index 86f0be7866..8496c28cef 100644 --- a/src/common/sparse_large_vector.h +++ b/src/common/sparse_large_vector.h @@ -28,9 +28,9 @@ constexpr u64 HostPageBits = 12; constexpr u64 HostPageMask = ~(HostPageSize - 1); bool CommitVectorPage(uintptr_t addr, bool write) noexcept; #else -const u64 HostPageSize = sysconf(_SC_PAGESIZE); -const u64 HostPageBits = std::countr_zero(HostPageSize); -const u64 HostPageMask = ~(HostPageSize - 1); +inline const u64 HostPageSize = sysconf(_SC_PAGESIZE); +inline const u64 HostPageBits = std::countr_zero(HostPageSize); +inline const u64 HostPageMask = ~(HostPageSize - 1); #endif void* AllocateMemoryPages(std::size_t size) noexcept; @@ -81,8 +81,8 @@ public: UNREACHABLE_MSG("Out of bounds RW access on SparseLargeVector @ {}", index); } - if (!IsCommittedPage(index)) { - CommitPage(index); + if (!IsCommittedPage(index) && !CommitPage(index)) { + UNREACHABLE_MSG("Cannot access SparseLargeVector index {} with RW permission", index); } return base_ptr[index]; } @@ -103,9 +103,8 @@ public: LOG_CRITICAL(Common_Memory, "Out of bounds write on SparseLargeVector @ {}", index); return; } - if (!IsCommittedPage(index)) - CommitPage(index); - base_ptr[index] = value; + if (IsCommittedPage(index) || CommitPage(index)) + base_ptr[index] = value; } void ZeroRegion(std::size_t start, std::size_t end_) noexcept { @@ -177,16 +176,22 @@ private: return (val >> (page & 63)) & 1; } - constexpr void CommitPage(std::size_t index) noexcept { + constexpr bool CommitPage(std::size_t index) noexcept { auto page_index = (index * sizeof(T)) >> HostPageBits; auto page = reinterpret_cast(base_ptr + index) & HostPageMask; #if defined(_WIN32) - CommitVectorPage(page, true); + if (!CommitVectorPage(page, true)) { + return false; + } #else - mprotect(reinterpret_cast(page), HostPageSize, PROT_READ | PROT_WRITE); + if (mprotect(reinterpret_cast(page), HostPageSize, PROT_READ | PROT_WRITE) != 0) { + LOG_ERROR(Common_Memory, "Failed to commit large buffer region at index {}, error {}", index, strerror(errno)); + return false; + } #endif committed_pages[page_index >> 6].fetch_or(1ULL << (page_index & 63), std::memory_order_release); + return true; } constexpr void DecommitPage(std::size_t index) noexcept { From 930b64858ed3107f6585ce212dea06d7a13a83c9 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 15 Sep 2026 23:38:47 -0400 Subject: [PATCH 039/198] Fix build --- src/video_core/renderer_vulkan/vk_compute_pass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 4685c6ae30..b7bb4b00b4 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -711,7 +711,8 @@ BlockLinearUnswizzleImage2DPass::BlockLinearUnswizzleImage2DPass( ComputePassDescriptorQueue& compute_pass_descriptor_queue_) : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, - COMPUTE_PUSH_CONSTANT_RANGE, + COMPUTE_PUSH_CONSTANT_RANGE< + sizeof(VideoCommon::Accelerated::BlockLinearSwizzle2DParams)>, BLOCK_LINEAR_UNSWIZZLE_2D_COMP_SPV), scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} From 26031c0940795e45a66b4e5b43446c8a60bbb723 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 00:54:01 -0400 Subject: [PATCH 040/198] Fixes on the astc decoder --- src/video_core/host_shaders/astc_decoder.comp | 96 +++++++------------ 1 file changed, 36 insertions(+), 60 deletions(-) diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp index b7797e3165..20f4af896e 100644 --- a/src/video_core/host_shaders/astc_decoder.comp +++ b/src/video_core/host_shaders/astc_decoder.comp @@ -980,67 +980,42 @@ uint UnquantizeTexelWeight(EncodingData val) { const uint encoding = Encoding(val); const uint bitlen = NumBits(val); const uint bitval = BitValue(val); - const uint A = ReplicateBitTo7((bitval & 1)); - uint B = 0, C = 0, D = 0; + const uint A = ReplicateBitTo7(bitval & 1u); uint result = 0; - const uint bitlen_0_results[5] = {0, 16, 32, 48, 64}; - switch (encoding) { - case JUST_BITS: + if (encoding == JUST_BITS) { result = FastReplicateTo6(bitval, bitlen); - break; - case TRIT: { - D = QuintTritValue(val); - switch (bitlen) { - case 0: - return bitlen_0_results[D * 2]; - case 1: { - C = 50; - break; + } else { + const uint D = QuintTritValue(val); + if (bitlen == 0u) { + if (encoding == TRIT) { + return D * 32u; + } + return D * 16u; } - case 2: { - C = 23; - const uint b = (bitval >> 1) & 1; - B = (b << 6) | (b << 2) | b; - break; + const uint b = (bitval >> 1u) & ((0x3100u >> (bitlen * 4u)) & 0xfu); + uint B = 0; + uint C = 0; + if (encoding == TRIT) { + if (bitlen == 1u) { + C = 50u; + } else if (bitlen == 2u) { + C = 23u; + B = (b << 6u) | (b << 2u) | b; + } else { + C = 11u; + B = (b << 5u) | b; + } + } else { + if (bitlen == 1u) { + C = 28u; + } else { + C = 13u; + B = (b << 6u) | (b << 1u); + } } - case 3: { - C = 11; - const uint cb = (bitval >> 1) & 3; - B = (cb << 5) | cb; - break; - } - default: - break; - } - break; - } - case QUINT: { - D = QuintTritValue(val); - switch (bitlen) { - case 0: - return bitlen_0_results[D]; - case 1: { - C = 28; - break; - } - case 2: { - C = 13; - const uint b = (bitval >> 1) & 1; - B = (b << 6) | (b << 1); - break; - } - } - break; - } - } - if (encoding != JUST_BITS && bitlen > 0) { - result = D * C + B; - result ^= A; - result = (A & 0x20) | (result >> 2); - } - if (result > 32) { - result += 1; + result = (A & 0x20u) | (((D * C + B) ^ A) >> 2u); } + result += 1u - uint(result <= 32u); return result; } @@ -1449,10 +1424,11 @@ void DecompressBlock(ivec3 coord) { } uint SwizzleOffset(uvec2 pos) { - const uint x = pos.x; - const uint y = pos.y; - return ((x % 64) / 32) * 256 + ((y % 8) / 2) * 64 + - ((x % 32) / 16) * 32 + (y % 2) * 16 + (x % 16); + return ((pos.x & 32u) << 3u) | + ((pos.y & 6u) << 5u) | + ((pos.x & 16u) << 1u) | + ((pos.y & 1u) << 4u) | + (pos.x & 15u); } void main() { From b24c3d7226784f302e1740512af420d5977dadfa Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 01:55:44 -0400 Subject: [PATCH 041/198] Keep refining astc decoding math --- src/video_core/host_shaders/astc_decoder.comp | 8 +--- .../renderer_vulkan/vk_texture_cache.cpp | 47 +++++++++++-------- src/video_core/texture_cache/texture_cache.h | 2 +- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp index 20f4af896e..2248a92a46 100644 --- a/src/video_core/host_shaders/astc_decoder.comp +++ b/src/video_core/host_shaders/astc_decoder.comp @@ -987,10 +987,7 @@ uint UnquantizeTexelWeight(EncodingData val) { } else { const uint D = QuintTritValue(val); if (bitlen == 0u) { - if (encoding == TRIT) { - return D * 32u; - } - return D * 16u; + return D << (4u | uint(encoding == TRIT)); } const uint b = (bitval >> 1u) & ((0x3100u >> (bitlen * 4u)) & 0xfu); uint B = 0; @@ -1015,8 +1012,7 @@ uint UnquantizeTexelWeight(EncodingData val) { } result = (A & 0x20u) | (((D * C + B) ^ A) >> 2u); } - result += 1u - uint(result <= 32u); - return result; + return result + (1u - uint(result <= 32u)); } void UnquantizeTexelWeights(uvec2 size, bool is_dual_plane) { diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 4b37fee265..bf8efaaf09 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -323,6 +323,10 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { .pNext = nullptr, .usage = VK_IMAGE_USAGE_STORAGE_BIT, }; + u32 layer_count = VK_REMAINING_ARRAY_LAYERS; + if (view_type == VK_IMAGE_VIEW_TYPE_2D || view_type == VK_IMAGE_VIEW_TYPE_3D) { + layer_count = 1; + } return device.CreateImageView(VkImageViewCreateInfo{ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, .pNext = &storage_image_view_usage_create_info, @@ -341,7 +345,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { .baseMipLevel = level, .levelCount = 1, .baseArrayLayer = 0, - .layerCount = VK_REMAINING_ARRAY_LAYERS, + .layerCount = layer_count, }, }); } @@ -1989,14 +1993,6 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu storage_image_views[level] = MakeStorageView(device, level, *original_image, storage_format); } - } else if (True(flags & VideoCommon::ImageFlagBits::AcceleratedUpload)) { - const auto& device = runtime->device.GetLogical(); - const VkFormat storage_format = UnswizzleStorageFormat(BytesPerBlock(info.format)); - const VkImageViewType view_type = UnswizzleStorageViewType(info.type); - for (s32 level = 0; level < info.resources.levels; ++level) { - storage_image_views[level] = - MakeStorageView(device, level, *original_image, storage_format, view_type); - } } } @@ -3178,20 +3174,31 @@ VkRenderPass Framebuffer::RenderPassVariant(u32 color_clear_mask, bool depth_ste void TextureCacheRuntime::AccelerateImageUpload( Image& image, const StagingBufferRef& map, std::span swizzles) { + const bool is_rescaled = True(image.flags & ImageFlagBits::Rescaled); + if (is_rescaled) { + image.ScaleDown(true); + } if (IsPixelFormatASTC(image.info.format)) { - return astc_decoder_pass->Assemble(image, map, swizzles); + astc_decoder_pass->Assemble(image, map, swizzles); + } else { + switch (image.info.type) { + case ImageType::e2D: + bl_unswizzle_2d_pass->Unswizzle(image, map, swizzles); + break; + case ImageType::e3D: + bl_unswizzle_3d_pass->Unswizzle(image, map, swizzles); + break; + case ImageType::Linear: + pitch_unswizzle_pass->Unswizzle(image, map, swizzles); + break; + default: + ASSERT(false); + break; + } } - switch (image.info.type) { - case ImageType::e2D: - return bl_unswizzle_2d_pass->Unswizzle(image, map, swizzles); - case ImageType::e3D: - return bl_unswizzle_3d_pass->Unswizzle(image, map, swizzles); - case ImageType::Linear: - return pitch_unswizzle_pass->Unswizzle(image, map, swizzles); - default: - break; + if (is_rescaled) { + image.ScaleUp(); } - ASSERT(false); } void TextureCacheRuntime::TransitionImageLayout(Image& image) { diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index a248fe9c93..5b2cafc89d 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1107,7 +1107,7 @@ void TextureCache

::UploadImageContents(Image& image, StagingBuffer& staging) const GPUVAddr gpu_addr = image.gpu_addr; if (True(image.flags & ImageFlagBits::AcceleratedUpload)) { - gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), mapped_span.size_bytes(), + gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), image.guest_size_bytes, VideoCommon::CacheType::NoTextureCache); const auto uploads = FullUploadSwizzles(image.info); runtime.AccelerateImageUpload(image, staging, FixSmallVectorADL(uploads)); From 66a25a3d79e6cf0dc095d07353b9767ee5c42575 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 02:33:06 -0400 Subject: [PATCH 042/198] Some unvalid checks on astc decoder --- src/video_core/host_shaders/astc_decoder.comp | 11 ++++++++--- src/video_core/texture_cache/util.cpp | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp index 2248a92a46..58dccb545f 100644 --- a/src/video_core/host_shaders/astc_decoder.comp +++ b/src/video_core/host_shaders/astc_decoder.comp @@ -296,14 +296,19 @@ uint ExtractBits(uvec4 payload, int offset, int bits) { if (bits > 32) { return 0; } - const int last_offset = offset + bits - 1; + if (offset >= 128) { + return 0; + } + const int avail_bits = min(bits, 128 - offset); + const int last_offset = offset + avail_bits - 1; const int shifted_offset = offset >> 5; if ((last_offset >> 5) == shifted_offset) { - return bitfieldExtract(payload[shifted_offset], offset & 31, bits); + return bitfieldExtract(payload[shifted_offset], offset & 31, avail_bits); } const int first_bits = 32 - (offset & 31); const int result_first = int(bitfieldExtract(payload[shifted_offset], offset & 31, first_bits)); - const int result_second = int(bitfieldExtract(payload[shifted_offset + 1], 0, bits - first_bits)); + const int result_second = + int(bitfieldExtract(payload[shifted_offset + 1], 0, avail_bits - first_bits)); return result_first | (result_second << first_bits); } diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index e55d0752ec..25cf6e33b1 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -950,7 +950,7 @@ void ConvertImage(std::span input, const ImageInfo& info, std::span input, const ImageInfo& info, std::span Date: Wed, 16 Sep 2026 16:19:52 -0400 Subject: [PATCH 043/198] Keep working on ASTC --- .../renderer_vulkan/vk_texture_cache.cpp | 6 +- src/video_core/texture_cache/texture_cache.h | 25 +++- .../texture_cache/texture_cache_base.h | 1 + src/video_core/texture_cache/util.cpp | 74 +++++++++- src/video_core/texture_cache/util.h | 7 +- src/video_core/textures/astc.cpp | 126 +++++++++++++----- src/video_core/textures/astc.h | 19 +++ .../vulkan_common/vulkan_memory_allocator.cpp | 20 --- 8 files changed, 221 insertions(+), 57 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index bf8efaaf09..caff739187 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -57,6 +57,7 @@ using VideoCore::Surface::SurfaceType; namespace { constexpr bool ENABLE_MSAA_TILER_RESOLVE = true; constexpr bool ENABLE_MSAA_RESOLVE_CONSUME = true; +constexpr bool ENABLE_ACCELERATED_UNSWIZZLE = false; constexpr bool ENABLE_MSAA_COLOR_DISCARD = true; constexpr bool ENABLE_MSAA_DEPTH_STENCIL_DISCARD = true; @@ -193,6 +194,9 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { } [[nodiscard]] bool IsUnswizzleAcceleratedFormat(const Device& device, PixelFormat format) { + if (!ENABLE_ACCELERATED_UNSWIZZLE) { + return false; + } if (IsPixelFormatASTC(format) || VideoCore::Surface::IsPixelFormatBCn(format)) { return false; } @@ -1018,7 +1022,7 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue, memory_allocator); } - if (device.IsKhrImageFormatListSupported()) { + if (ENABLE_ACCELERATED_UNSWIZZLE && device.IsKhrImageFormatListSupported()) { bl_unswizzle_2d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue); bl_unswizzle_3d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 5b2cafc89d..861d9f63d0 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1117,6 +1117,12 @@ void TextureCache

::UploadImageContents(Image& image, StagingBuffer& staging) Tegra::Memory::GpuGuestMemory swizzle_data( *gpu_memory, gpu_addr, image.guest_size_bytes, &swizzle_data_buffer); if (True(image.flags & ImageFlagBits::Converted)) { + if (CanConvertFromGuest(image.info)) { + const auto copies = + FixSmallVectorADL(ConvertImageFromGuest(swizzle_data, image.info, mapped_span)); + image.UploadMemory(staging, copies); + return; + } unswizzle_data_buffer.resize_destructive(image.unswizzled_size_bytes); auto copies = FixSmallVectorADL(UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, unswizzle_data_buffer)); ConvertImage(unswizzle_data_buffer, image.info, mapped_span, copies); @@ -1302,10 +1308,27 @@ void TextureCache

::QueueAsyncDecode(Image& image, ImageId image_id) { decode->image_id = image_id; async_decodes.push_back(std::move(decode)); + const size_t out_size = MapSizeBytes(image); + if (CanConvertFromGuest(image.info)) { + decode_ptr->input_data.resize_destructive(image.guest_size_bytes); + gpu_memory->ReadBlockUnsafe(image.gpu_addr, decode_ptr->input_data.data(), + image.guest_size_bytes); + + texture_decode_worker.QueueWork([out_size, info = image.info, async_decode = decode_ptr] { + async_decode->decoded_data.resize_destructive(out_size); + auto copies = + ConvertImageFromGuest(async_decode->input_data, info, async_decode->decoded_data); + + std::unique_lock lock{async_decode->mutex}; + async_decode->copies = std::move(copies); + async_decode->complete = true; + }); + return; + } + std::vector local_unswizzle_data_buffer(image.unswizzled_size_bytes, 0); Tegra::Memory::GpuGuestMemory swizzle_data(*gpu_memory, image.gpu_addr, image.guest_size_bytes, &swizzle_data_buffer); auto copies = UnswizzleImage(*gpu_memory, image.gpu_addr, image.info, swizzle_data, local_unswizzle_data_buffer); - const size_t out_size = MapSizeBytes(image); auto func = [out_size, copies, info = image.info, input = std::move(local_unswizzle_data_buffer), diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 517afa4aa8..8fbd7f61bc 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -63,6 +63,7 @@ struct ImageViewInOut { struct AsyncDecodeContext { ImageId image_id; + Common::ScratchBuffer input_data; Common::ScratchBuffer decoded_data; boost::container::small_vector copies; std::mutex mutex; diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 25cf6e33b1..8d275ff8eb 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project @@ -994,6 +994,78 @@ void ConvertImage(std::span input, const ImageInfo& info, std::span ConvertImageFromGuest( + std::span input, const ImageInfo& info, std::span output) { + const u32 bpp_log2 = BytesPerBlockLog2(info.format); + const Extent2D tile_size = DefaultBlockSize(info.format); + const Extent3D size = info.size; + const LevelInfo level_info = MakeLevelInfo(info); + const s32 num_layers = info.resources.layers; + const s32 num_levels = info.resources.levels; + const std::array level_sizes = CalculateLevelSizes(level_info, num_levels); + const Extent2D gob = GobSize(bpp_log2, info.block.height, info.tile_width_spacing); + const u32 layer_size = CalculateLevelBytes(level_sizes, num_levels); + const u32 layer_stride = AlignLayerSize(layer_size, size, level_info.block, tile_size.height, + info.tile_width_spacing); + const u32 out_bytes_per_texel = BytesPerBlock(PixelFormat::A8B8G8R8_UNORM); + size_t guest_offset = 0; + u32 output_offset = 0; + boost::container::small_vector copies(num_levels); + + for (s32 level = 0; level < num_levels; ++level) { + const Extent3D level_size = AdjustMipSize(size, level); + const Extent3D num_tiles = AdjustTileSize(level_size, tile_size); + const Extent3D block = + AdjustMipBlockSize(num_tiles, level_info.block, level, level_info.num_levels); + const u32 stride_alignment = StrideAlignment(num_tiles, info.block, gob, bpp_log2); + const u32 stride = Common::AlignUpLog2(num_tiles.width, stride_alignment) << bpp_log2; + const u32 gobs_in_x = Common::DivCeilLog2(stride, GOB_SIZE_X_SHIFT); + const u32 gob_block_size = gobs_in_x << (GOB_SIZE_SHIFT + block.height + block.depth); + const u32 level_bytes = level_size.width * level_size.height * level_size.depth * + num_layers * out_bytes_per_texel; + copies[level] = BufferImageCopy{ + .buffer_offset = output_offset, + .buffer_size = level_bytes, + .buffer_row_length = level_size.width, + .buffer_image_height = level_size.height, + .image_subresource = + { + .base_level = level, + .base_layer = 0, + .num_layers = num_layers, + }, + .image_offset = {0, 0, 0}, + .image_extent = level_size, + }; + const Tegra::Texture::ASTC::BlockLinearLayout layout{ + .layer_stride = layer_stride, + .slice_size = + Common::DivCeilLog2(num_tiles.height, block.height + GOB_SIZE_Y_SHIFT) * + gob_block_size, + .block_size = gob_block_size, + .x_shift = GOB_SIZE_SHIFT + block.height + block.depth, + .gob_height = block.height, + .gob_height_mask = (1U << block.height) - 1, + .gob_depth = block.depth, + .gob_depth_mask = (1U << block.depth) - 1, + }; + Tegra::Texture::ASTC::DecompressBlockLinear( + input.subspan(guest_offset), level_size.width, level_size.height, level_size.depth, + num_layers, tile_size.width, tile_size.height, layout, output.subspan(output_offset)); + output_offset += level_bytes; + guest_offset += level_sizes[level]; + } + return copies; +} + boost::container::small_vector FullDownloadCopies(const ImageInfo& info) { const Extent3D size = info.size; const u32 bytes_per_block = BytesPerBlock(info.format); diff --git a/src/video_core/texture_cache/util.h b/src/video_core/texture_cache/util.h index 3e8bb00032..1bc4b53582 100644 --- a/src/video_core/texture_cache/util.h +++ b/src/video_core/texture_cache/util.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project @@ -72,6 +72,11 @@ struct OverlapResult { void ConvertImage(std::span input, const ImageInfo& info, std::span output, std::span copies); +[[nodiscard]] bool CanConvertFromGuest(const ImageInfo& info); + +[[nodiscard]] boost::container::small_vector ConvertImageFromGuest( + std::span input, const ImageInfo& info, std::span output); + [[nodiscard]] boost::container::small_vector FullDownloadCopies( const ImageInfo& info); diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp index 0b6d06c49a..678e52a242 100644 --- a/src/video_core/textures/astc.cpp +++ b/src/video_core/textures/astc.cpp @@ -20,6 +20,7 @@ #include "common/common_types.h" #include #include "video_core/textures/astc.h" +#include "video_core/textures/decoders.h" #include "video_core/textures/workers.h" class InputBitStream { @@ -1671,7 +1672,7 @@ static void ComputeEndpoints(Pixel& ep1, Pixel& ep2, const u32*& colorValues, } static void FillVoidExtentLDR(InputBitStream& strm, std::span outBuf, u32 blockWidth, - u32 blockHeight) { + u32 blockHeight, u32 stride) { // Don't actually care about the void extent, just read the bits... for (s32 i = 0; i < 4; ++i) { strm.ReadBits<13>(); @@ -1688,7 +1689,7 @@ static void FillVoidExtentLDR(InputBitStream& strm, std::span outBuf, u32 b for (u32 j = 0; j < blockHeight; j++) { for (u32 i = 0; i < blockWidth; i++) { - outBuf[j * blockWidth + i] = rgba; + outBuf[j * stride + i] = rgba; } } } @@ -1726,52 +1727,52 @@ static u16 HalfToClampedByte(u16 half_bits) { return static_cast(clamped * 255.0f + 0.5f); } -static void FillError(std::span outBuf, u32 blockWidth, u32 blockHeight) { +static void FillError(std::span outBuf, u32 blockWidth, u32 blockHeight, u32 stride) { for (u32 j = 0; j < blockHeight; j++) { for (u32 i = 0; i < blockWidth; i++) { - outBuf[j * blockWidth + i] = 0x00000000; + outBuf[j * stride + i] = 0x00000000; } } } static void DecompressBlock(std::span inBuf, const u32 blockWidth, - const u32 blockHeight, std::span outBuf) { + const u32 blockHeight, std::span outBuf, u32 stride) { InputBitStream strm(inBuf); TexelWeightParams weightParams = DecodeBlockInfo(strm); // Was there an error? if (weightParams.m_bError) { assert(false && "Invalid block mode"); - FillError(outBuf, blockWidth, blockHeight); + FillError(outBuf, blockWidth, blockHeight, stride); return; } if (weightParams.m_bVoidExtentLDR) { - FillVoidExtentLDR(strm, outBuf, blockWidth, blockHeight); + FillVoidExtentLDR(strm, outBuf, blockWidth, blockHeight, stride); return; } if (weightParams.m_bVoidExtentHDR) { assert(false && "HDR void extent blocks are unsupported!"); - FillError(outBuf, blockWidth, blockHeight); + FillError(outBuf, blockWidth, blockHeight, stride); return; } if (weightParams.m_Width > blockWidth) { assert(false && "Texel weight grid width should be smaller than block width"); - FillError(outBuf, blockWidth, blockHeight); + FillError(outBuf, blockWidth, blockHeight, stride); return; } if (weightParams.m_Height > blockHeight) { assert(false && "Texel weight grid height should be smaller than block height"); - FillError(outBuf, blockWidth, blockHeight); + FillError(outBuf, blockWidth, blockHeight, stride); return; } if (weightParams.GetNumWeightValues() > 64) { assert(false && "Too many weights in the weight grid"); - FillError(outBuf, blockWidth, blockHeight); + FillError(outBuf, blockWidth, blockHeight, stride); return; } @@ -1781,7 +1782,7 @@ static void DecompressBlock(std::span inBuf, const u32 blockWidth, if (nPartitions == 4 && weightParams.m_bDualPlane) { assert(false && "Dual plane mode is incompatible with four partition blocks"); - FillError(outBuf, blockWidth, blockHeight); + FillError(outBuf, blockWidth, blockHeight, stride); return; } @@ -1813,7 +1814,7 @@ static void DecompressBlock(std::span inBuf, const u32 blockWidth, u32 nWeightBits = weightParams.GetPackedBitSize(); if (nWeightBits < 24 || nWeightBits > 96) { assert(false && "Invalid weight bit count"); - FillError(outBuf, blockWidth, blockHeight); + FillError(outBuf, blockWidth, blockHeight, stride); return; } s32 remainingBits = 128 - nWeightBits - static_cast(strm.GetBitsRead()); @@ -1995,41 +1996,54 @@ static void DecompressBlock(std::span inBuf, const u32 blockWidth, } } - outBuf[j * blockWidth + i] = p.Pack(); + outBuf[j * stride + i] = p.Pack(); } } +static void DecodeAndStoreBlock(std::span data, size_t src_offset, u32 x, u32 y, + u32 width, u32 height, u32 block_width, u32 block_height, + std::span out_slice) { + const u32 decomp_width = (std::min)(block_width, width - x); + const u32 decomp_height = (std::min)(block_height, height - y); + u32* const dst = out_slice.data() + size_t{y} * width + x; + if (src_offset + 16 > data.size()) { + for (u32 h = 0; h < decomp_height; ++h) { + std::memset(dst + size_t{h} * width, 0, decomp_width * 4); + } + return; + } + const std::span block_ptr{data.subspan(src_offset, 16)}; + if (decomp_width == block_width && decomp_height == block_height) { + const size_t touched = size_t{block_height - 1} * width + block_width; + DecompressBlock(block_ptr, block_width, block_height, std::span{dst, touched}, width); + return; + } + std::array staging; + DecompressBlock(block_ptr, block_width, block_height, staging, block_width); + for (u32 h = 0; h < decomp_height; ++h) { + std::memcpy(dst + size_t{h} * width, staging.data() + h * block_width, decomp_width * 4); + } +} + void Decompress(std::span data, uint32_t width, uint32_t height, uint32_t depth, uint32_t block_width, uint32_t block_height, std::span output) { const u32 rows = Common::DivideUp(height, block_height); const u32 cols = Common::DivideUp(width, block_width); Common::ThreadWorker& workers{GetThreadWorkers()}; + const std::span out{reinterpret_cast(output.data()), output.size() / 4}; + const size_t slice_texels = size_t{height} * width; for (u32 z = 0; z < depth; ++z) { - const u32 depth_offset = z * height * width * 4; + const std::span out_slice = out.subspan(z * slice_texels); for (u32 y_index = 0; y_index < rows; ++y_index) { - auto decompress_stride = [data, width, height, block_width, block_height, output, rows, - cols, z, depth_offset, y_index] { + auto decompress_stride = [data, width, height, block_width, block_height, out_slice, + rows, cols, z, y_index] { const u32 y = y_index * block_height; for (u32 x_index = 0; x_index < cols; ++x_index) { const u32 block_index = (z * rows * cols) + (y_index * cols) + x_index; - const u32 x = x_index * block_width; - - const std::span blockPtr{data.subspan(block_index * 16, 16)}; - - // Blocks can be at most 12x12 - std::array uncompData; - DecompressBlock(blockPtr, block_width, block_height, uncompData); - - u32 decompWidth = (std::min)(block_width, width - x); - u32 decompHeight = (std::min)(block_height, height - y); - - const std::span outRow = output.subspan(depth_offset + (y * width + x) * 4); - for (u32 h = 0; h < decompHeight; ++h) { - std::memcpy(outRow.data() + h * width * 4, - uncompData.data() + h * block_width, decompWidth * 4); - } + DecodeAndStoreBlock(data, size_t{block_index} * 16, x_index * block_width, y, + width, height, block_width, block_height, out_slice); } }; workers.QueueWork(std::move(decompress_stride)); @@ -2038,4 +2052,50 @@ void Decompress(std::span data, uint32_t width, uint32_t height, } } +void DecompressBlockLinear(std::span data, uint32_t width, uint32_t height, + uint32_t depth, uint32_t layers, uint32_t block_width, + uint32_t block_height, const BlockLinearLayout& layout, + std::span output) { + const u32 rows = Common::DivideUp(height, block_height); + const u32 cols = Common::DivideUp(width, block_width); + const size_t slice_texels = size_t{height} * width; + + Common::ThreadWorker& workers{GetThreadWorkers()}; + const std::span out{reinterpret_cast(output.data()), output.size() / 4}; + + for (u32 layer = 0; layer < layers; ++layer) { + const size_t layer_offset = size_t{layer} * layout.layer_stride; + for (u32 z = 0; z < depth; ++z) { + const size_t slice_offset = + layer_offset + (z >> layout.gob_depth) * size_t{layout.slice_size} + + ((z & layout.gob_depth_mask) << (GOB_SIZE_SHIFT + layout.gob_height)); + const std::span out_slice = + out.subspan((size_t{layer} * depth + z) * slice_texels); + for (u32 y_index = 0; y_index < rows; ++y_index) { + auto decompress_stride = [data, width, height, block_width, block_height, out_slice, + cols, layout, slice_offset, y_index] { + const u32 y = y_index * block_height; + const u32 gob_y = y_index >> GOB_SIZE_Y_SHIFT; + const size_t offset_y = + (gob_y >> layout.gob_height) * size_t{layout.block_size} + + ((gob_y & layout.gob_height_mask) << GOB_SIZE_SHIFT); + const u32 swizzled_y = ((y_index & 1) << 4) | ((y_index & 6) << 5); + for (u32 x_index = 0; x_index < cols; ++x_index) { + const u32 byte_x = x_index * 16; + const size_t offset_x = size_t{byte_x >> GOB_SIZE_X_SHIFT} + << layout.x_shift; + const u32 swizzled_x = ((x_index & 1) << 5) | ((x_index & 2) << 7); + const size_t src_offset = slice_offset + offset_y + offset_x + + (swizzled_x | swizzled_y); + DecodeAndStoreBlock(data, src_offset, x_index * block_width, y, width, + height, block_width, block_height, out_slice); + } + }; + workers.QueueWork(std::move(decompress_stride)); + } + } + } + workers.WaitForRequests(); +} + } // namespace Tegra::Texture::ASTC diff --git a/src/video_core/textures/astc.h b/src/video_core/textures/astc.h index afd3933c3e..5d59da7496 100644 --- a/src/video_core/textures/astc.h +++ b/src/video_core/textures/astc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -5,7 +8,23 @@ namespace Tegra::Texture::ASTC { +struct BlockLinearLayout { + uint32_t layer_stride; + uint32_t slice_size; + uint32_t block_size; + uint32_t x_shift; + uint32_t gob_height; + uint32_t gob_height_mask; + uint32_t gob_depth; + uint32_t gob_depth_mask; +}; + void Decompress(std::span data, uint32_t width, uint32_t height, uint32_t depth, uint32_t block_width, uint32_t block_height, std::span output); +void DecompressBlockLinear(std::span data, uint32_t width, uint32_t height, + uint32_t depth, uint32_t layers, uint32_t block_width, + uint32_t block_height, const BlockLinearLayout& layout, + std::span output); + } // namespace Tegra::Texture::ASTC diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp index f4721543ae..4d2d5b1317 100644 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp @@ -30,26 +30,6 @@ namespace { // Helpers translating MemoryUsage to flags/usage - [[maybe_unused]] VkMemoryPropertyFlags MemoryUsagePropertyFlags(MemoryUsage usage) { - switch (usage) { - case MemoryUsage::DeviceLocal: - return VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; - case MemoryUsage::Upload: - return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; - case MemoryUsage::Download: - return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | - VK_MEMORY_PROPERTY_HOST_CACHED_BIT; - case MemoryUsage::Stream: - return VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; - } - ASSERT_MSG(false, "Invalid memory usage={}", usage); - return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; - } - [[nodiscard]] VkMemoryPropertyFlags MemoryUsagePreferredVmaFlags(MemoryUsage usage) { if (usage == MemoryUsage::Download) { return VK_MEMORY_PROPERTY_HOST_CACHED_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; From 43622f463db2a750b3148884e35dcaa5635e691d Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 16:59:20 -0400 Subject: [PATCH 044/198] A test for a corrupted unswizzled textures --- src/video_core/host_shaders/astc_decoder.comp | 26 +++++++------------ .../renderer_vulkan/vk_texture_cache.cpp | 6 ++++- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp index 58dccb545f..9a3954ca21 100644 --- a/src/video_core/host_shaders/astc_decoder.comp +++ b/src/video_core/host_shaders/astc_decoder.comp @@ -164,27 +164,19 @@ uint FastReplicateTo8(uint value, uint num_bits) { return ReplicateBits(value, num_bits, 8); } +const uint REPLICATE_TO_6_ODD_HALVES = ((63u >> 1u) << 5u) | ((21u >> 1u) << 10u) | + ((9u >> 1u) << 15u) | ((17u >> 1u) << 20u) | + ((33u >> 1u) << 25u); +const uint REPLICATE_TO_6_SHIFTS = (2u << 16u) | (4u << 20u); + uint FastReplicateTo6(uint value, uint num_bits) { - if (num_bits == 0) { - return 0; - } - if (num_bits >= 6) { + if (num_bits >= 6u) { return value; } const uint v = value & ((1u << num_bits) - 1u); - if (num_bits == 1) { - return v * 63u; - } - if (num_bits == 2) { - return v * 21u; - } - if (num_bits == 3) { - return v * 9u; - } - if (num_bits == 4) { - return (v << 2u) | (v >> 2u); - } - return (v << 1u) | (v >> 4u); + const uint c = ((REPLICATE_TO_6_ODD_HALVES >> (num_bits * 5u)) & 0x1fu) * 2u + 1u; + const uint s = (REPLICATE_TO_6_SHIFTS >> (num_bits * 4u)) & 0xfu; + return (v * c) >> s; } uint Div3Floor(uint v) { diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index caff739187..ff1ab0bf2c 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -57,7 +57,8 @@ using VideoCore::Surface::SurfaceType; namespace { constexpr bool ENABLE_MSAA_TILER_RESOLVE = true; constexpr bool ENABLE_MSAA_RESOLVE_CONSUME = true; -constexpr bool ENABLE_ACCELERATED_UNSWIZZLE = false; +constexpr bool ENABLE_ACCELERATED_UNSWIZZLE = true; +constexpr bool ENABLE_ACCELERATED_UNSWIZZLE_DISPATCH = false; constexpr bool ENABLE_MSAA_COLOR_DISCARD = true; constexpr bool ENABLE_MSAA_DEPTH_STENCIL_DISCARD = true; @@ -207,6 +208,9 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { } [[nodiscard]] bool WillUseAcceleratedUnswizzle(const Device& device, const ImageInfo& info) { + if (!ENABLE_ACCELERATED_UNSWIZZLE_DISPATCH) { + return false; + } switch (info.type) { case ImageType::e2D: case ImageType::e3D: From facee08b5ee9452a10ee0af0daf26544a7bcfdc9 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 17:59:19 -0400 Subject: [PATCH 045/198] More tests to find out the texture corruption on previous unswizzle changes --- src/video_core/renderer_vulkan/vk_compute_pass.cpp | 5 ++--- src/video_core/renderer_vulkan/vk_texture_cache.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index b7bb4b00b4..76061d8cc9 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -647,7 +647,7 @@ void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, V VkImageLayout old_layout = VK_IMAGE_LAYOUT_UNDEFINED; VkPipelineStageFlags src_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; if (is_initialized) { - src_access = VK_ACCESS_SHADER_WRITE_BIT; + src_access = VK_ACCESS_MEMORY_WRITE_BIT; old_layout = VK_IMAGE_LAYOUT_GENERAL; src_stage = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER; } @@ -683,8 +683,7 @@ void RecordUnswizzleEndBarrier(Scheduler& scheduler, VkImage vk_image, .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .pNext = nullptr, .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index ff1ab0bf2c..2b285ad3ea 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -58,7 +58,7 @@ namespace { constexpr bool ENABLE_MSAA_TILER_RESOLVE = true; constexpr bool ENABLE_MSAA_RESOLVE_CONSUME = true; constexpr bool ENABLE_ACCELERATED_UNSWIZZLE = true; -constexpr bool ENABLE_ACCELERATED_UNSWIZZLE_DISPATCH = false; +constexpr bool ENABLE_ACCELERATED_UNSWIZZLE_DISPATCH = true; constexpr bool ENABLE_MSAA_COLOR_DISCARD = true; constexpr bool ENABLE_MSAA_DEPTH_STENCIL_DISCARD = true; From 6221bd2c43e80bc0d9b1c303fd94481e23e8c3cb Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 18:23:20 -0400 Subject: [PATCH 046/198] Reduce accelerated unswizzle path --- src/video_core/renderer_vulkan/vk_texture_cache.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 2b285ad3ea..ed4105efa6 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -204,6 +204,9 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { if (VideoCore::Surface::GetFormatType(format) != SurfaceType::ColorTexture) { return false; } + if (!MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format).storage) { + return false; + } return IsUnswizzleStorageFormatSupported(device, BytesPerBlock(format)); } From b016c8876878ecc737862fc607bf0ad1e9f88409 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 21:12:40 -0400 Subject: [PATCH 047/198] Remove the unswizzle path on the extra shaders --- .../renderer_vulkan/vk_compute_pass.cpp | 250 ------------------ .../renderer_vulkan/vk_compute_pass.h | 51 ---- .../renderer_vulkan/vk_texture_cache.cpp | 130 +-------- .../renderer_vulkan/vk_texture_cache.h | 3 - 4 files changed, 6 insertions(+), 428 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 76061d8cc9..604a0d7cac 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -16,16 +16,12 @@ #include "common/common_types.h" #include "common/div_ceil.h" #include "common/vector_math.h" -#include #include "video_core/host_shaders/astc_decoder_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_nosubgroups_comp_spv.h" #include "video_core/host_shaders/resolve_conditional_render_comp_spv.h" #include "video_core/host_shaders/vulkan_quad_indexed_comp_spv.h" #include "video_core/host_shaders/vulkan_uint8_comp_spv.h" -#include "video_core/host_shaders/block_linear_unswizzle_2d_comp_spv.h" -#include "video_core/host_shaders/block_linear_unswizzle_3d_comp_spv.h" -#include "video_core/host_shaders/pitch_unswizzle_comp_spv.h" #include "video_core/renderer_vulkan/vk_compute_pass.h" #include "video_core/surface.h" #include "video_core/renderer_vulkan/vk_descriptor_pool.h" @@ -188,26 +184,6 @@ struct AstcPushConstants { u32 block_height_mask; }; -struct BlockLinear3DImagePushConstants { - alignas(16) std::array origin; - alignas(16) std::array destination; - u32 bytes_per_block_log2; - u32 slice_size; - u32 block_size; - u32 x_shift; - u32 block_height; - u32 block_height_mask; - u32 block_depth; - u32 block_depth_mask; -}; - -struct PitchUnswizzlePushConstants { - std::array origin; - std::array destination; - u32 bytes_per_block_log2; - u32 pitch; -}; - struct QueriesPrefixScanPushConstants { u32 min_accumulation_base; u32 max_accumulation_base; @@ -639,230 +615,4 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, scheduler.Finish(); } -namespace { - -void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, VkImage vk_image, - VkImageAspectFlags aspect_mask, bool is_initialized) { - VkAccessFlags src_access = VK_ACCESS_NONE; - VkImageLayout old_layout = VK_IMAGE_LAYOUT_UNDEFINED; - VkPipelineStageFlags src_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - if (is_initialized) { - src_access = VK_ACCESS_MEMORY_WRITE_BIT; - old_layout = VK_IMAGE_LAYOUT_GENERAL; - src_stage = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER; - } - scheduler.Record([vk_pipeline, vk_image, aspect_mask, src_access, old_layout, - src_stage](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier image_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = nullptr, - .srcAccessMask = src_access, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, - .oldLayout = old_layout, - .newLayout = VK_IMAGE_LAYOUT_GENERAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = vk_image, - .subresourceRange{ - .aspectMask = aspect_mask, - .baseMipLevel = 0, - .levelCount = VK_REMAINING_MIP_LEVELS, - .baseArrayLayer = 0, - .layerCount = VK_REMAINING_ARRAY_LAYERS, - }, - }; - cmdbuf.PipelineBarrier(src_stage, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, image_barrier); - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, vk_pipeline); - }); -} - -void RecordUnswizzleEndBarrier(Scheduler& scheduler, VkImage vk_image, - VkImageAspectFlags aspect_mask) { - scheduler.Record([vk_image, aspect_mask](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier image_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, - .oldLayout = VK_IMAGE_LAYOUT_GENERAL, - .newLayout = VK_IMAGE_LAYOUT_GENERAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = vk_image, - .subresourceRange{ - .aspectMask = aspect_mask, - .baseMipLevel = 0, - .levelCount = VK_REMAINING_MIP_LEVELS, - .baseArrayLayer = 0, - .layerCount = VK_REMAINING_ARRAY_LAYERS, - }, - }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, 0, image_barrier); - }); -} - -} // Anonymous namespace - -BlockLinearUnswizzleImage2DPass::BlockLinearUnswizzleImage2DPass( - const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, - StagingBufferPool& staging_buffer_pool_, - ComputePassDescriptorQueue& compute_pass_descriptor_queue_) - : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, - ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, - COMPUTE_PUSH_CONSTANT_RANGE< - sizeof(VideoCommon::Accelerated::BlockLinearSwizzle2DParams)>, - BLOCK_LINEAR_UNSWIZZLE_2D_COMP_SPV), - scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, - compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} - -BlockLinearUnswizzleImage2DPass::~BlockLinearUnswizzleImage2DPass() = default; - -void BlockLinearUnswizzleImage2DPass::Unswizzle( - Image& image, const StagingBufferRef& map, - std::span swizzles) { - using namespace VideoCommon::Accelerated; - scheduler.RequestOutsideRenderPassOperationContext(); - const VkImageAspectFlags aspect_mask = image.AspectMask(); - const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, - image.ExchangeInitialization()); - for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { - const size_t input_offset = swizzle.buffer_offset + map.offset; - const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 32U); - const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); - const u32 num_dispatches_z = image.info.resources.layers; - - compute_pass_descriptor_queue.Acquire(scheduler, 2); - compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, - image.guest_size_bytes - swizzle.buffer_offset); - compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); - const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; - - const auto params = MakeBlockLinearSwizzle2DParams(swizzle, image.info); - scheduler.Record([this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, - descriptor_data](vk::CommandBuffer cmdbuf) { - const VkDescriptorSet set = descriptor_allocator.Commit(); - device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); - cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); - cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, params); - cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); - }); - } - RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); - scheduler.Finish(); -} - -BlockLinearUnswizzleImage3DPass::BlockLinearUnswizzleImage3DPass( - const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, - StagingBufferPool& staging_buffer_pool_, - ComputePassDescriptorQueue& compute_pass_descriptor_queue_) - : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, - ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, - COMPUTE_PUSH_CONSTANT_RANGE, - BLOCK_LINEAR_UNSWIZZLE_3D_COMP_SPV), - scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, - compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} - -BlockLinearUnswizzleImage3DPass::~BlockLinearUnswizzleImage3DPass() = default; - -void BlockLinearUnswizzleImage3DPass::Unswizzle( - Image& image, const StagingBufferRef& map, - std::span swizzles) { - using namespace VideoCommon::Accelerated; - scheduler.RequestOutsideRenderPassOperationContext(); - const VkImageAspectFlags aspect_mask = image.AspectMask(); - const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, - image.ExchangeInitialization()); - for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { - const size_t input_offset = swizzle.buffer_offset + map.offset; - const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 16U); - const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); - const u32 num_dispatches_z = Common::DivCeil(swizzle.num_tiles.depth, 2U); - - compute_pass_descriptor_queue.Acquire(scheduler, 2); - compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, - image.guest_size_bytes - swizzle.buffer_offset); - compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); - const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; - - const auto p = MakeBlockLinearSwizzle3DParams(swizzle, image.info); - const BlockLinear3DImagePushConstants params{ - .origin = p.origin, - .destination = p.destination, - .bytes_per_block_log2 = p.bytes_per_block_log2, - .slice_size = p.slice_size, - .block_size = p.block_size, - .x_shift = p.x_shift, - .block_height = p.block_height, - .block_height_mask = p.block_height_mask, - .block_depth = p.block_depth, - .block_depth_mask = p.block_depth_mask, - }; - scheduler.Record([this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, - descriptor_data](vk::CommandBuffer cmdbuf) { - const VkDescriptorSet set = descriptor_allocator.Commit(); - device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); - cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); - cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, params); - cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); - }); - } - RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); - scheduler.Finish(); -} - -PitchUnswizzlePass::PitchUnswizzlePass(const Device& device_, Scheduler& scheduler_, - DescriptorPool& descriptor_pool_, - StagingBufferPool& staging_buffer_pool_, - ComputePassDescriptorQueue& compute_pass_descriptor_queue_) - : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, - ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, - COMPUTE_PUSH_CONSTANT_RANGE, - PITCH_UNSWIZZLE_COMP_SPV), - scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, - compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} - -PitchUnswizzlePass::~PitchUnswizzlePass() = default; - -void PitchUnswizzlePass::Unswizzle(Image& image, const StagingBufferRef& map, - std::span swizzles) { - const u32 bytes_per_block = VideoCore::Surface::BytesPerBlock(image.info.format); - ASSERT(std::has_single_bit(bytes_per_block)); - scheduler.RequestOutsideRenderPassOperationContext(); - const VkImageAspectFlags aspect_mask = image.AspectMask(); - const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, - image.ExchangeInitialization()); - for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { - const size_t input_offset = swizzle.buffer_offset + map.offset; - const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 32U); - const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); - - compute_pass_descriptor_queue.Acquire(scheduler, 2); - compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, - image.guest_size_bytes - swizzle.buffer_offset); - compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); - const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; - - const PitchUnswizzlePushConstants params{ - .origin = {0, 0}, - .destination = {0, 0}, - .bytes_per_block_log2 = static_cast(std::countr_zero(bytes_per_block)), - .pitch = image.info.pitch, - }; - scheduler.Record([this, num_dispatches_x, num_dispatches_y, params, - descriptor_data](vk::CommandBuffer cmdbuf) { - const VkDescriptorSet set = descriptor_allocator.Commit(); - device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); - cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); - cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, params); - cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, 1); - }); - } - RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); - scheduler.Finish(); -} - } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index 811deee8a2..12723099ca 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h @@ -134,55 +134,4 @@ private: MemoryAllocator& memory_allocator; }; -class BlockLinearUnswizzleImage2DPass final : public ComputePass { -public: - explicit BlockLinearUnswizzleImage2DPass( - const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, - StagingBufferPool& staging_buffer_pool_, - ComputePassDescriptorQueue& compute_pass_descriptor_queue_); - ~BlockLinearUnswizzleImage2DPass(); - - void Unswizzle(Image& image, const StagingBufferRef& map, - std::span swizzles); - -private: - Scheduler& scheduler; - StagingBufferPool& staging_buffer_pool; - ComputePassDescriptorQueue& compute_pass_descriptor_queue; -}; - -class BlockLinearUnswizzleImage3DPass final : public ComputePass { -public: - explicit BlockLinearUnswizzleImage3DPass( - const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, - StagingBufferPool& staging_buffer_pool_, - ComputePassDescriptorQueue& compute_pass_descriptor_queue_); - ~BlockLinearUnswizzleImage3DPass(); - - void Unswizzle(Image& image, const StagingBufferRef& map, - std::span swizzles); - -private: - Scheduler& scheduler; - StagingBufferPool& staging_buffer_pool; - ComputePassDescriptorQueue& compute_pass_descriptor_queue; -}; - -class PitchUnswizzlePass final : public ComputePass { -public: - explicit PitchUnswizzlePass(const Device& device_, Scheduler& scheduler_, - DescriptorPool& descriptor_pool_, - StagingBufferPool& staging_buffer_pool_, - ComputePassDescriptorQueue& compute_pass_descriptor_queue_); - ~PitchUnswizzlePass(); - - void Unswizzle(Image& image, const StagingBufferRef& map, - std::span swizzles); - -private: - Scheduler& scheduler; - StagingBufferPool& staging_buffer_pool; - ComputePassDescriptorQueue& compute_pass_descriptor_queue; -}; - } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index ed4105efa6..5663220045 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -57,8 +57,6 @@ using VideoCore::Surface::SurfaceType; namespace { constexpr bool ENABLE_MSAA_TILER_RESOLVE = true; constexpr bool ENABLE_MSAA_RESOLVE_CONSUME = true; -constexpr bool ENABLE_ACCELERATED_UNSWIZZLE = true; -constexpr bool ENABLE_ACCELERATED_UNSWIZZLE_DISPATCH = true; constexpr bool ENABLE_MSAA_COLOR_DISCARD = true; constexpr bool ENABLE_MSAA_DEPTH_STENCIL_DISCARD = true; @@ -162,82 +160,6 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { info.size.depth == 1; } -[[nodiscard]] VkFormat UnswizzleStorageFormat(u32 bytes_per_block) { - switch (bytes_per_block) { - case 1: - return VK_FORMAT_R8_UINT; - case 2: - return VK_FORMAT_R16_UINT; - case 4: - return VK_FORMAT_R32_UINT; - case 8: - return VK_FORMAT_R32G32_UINT; - case 16: - return VK_FORMAT_R32G32B32A32_UINT; - default: - return VK_FORMAT_UNDEFINED; - } -} - -[[nodiscard]] bool IsUnswizzleStorageFormatSupported(const Device& device, u32 bytes_per_block) { - switch (bytes_per_block) { - case 1: - return device.IsStorageBuffer8BitAccessSupported(); - case 2: - return device.IsStorageBuffer16BitAccessSupported(); - case 4: - case 8: - case 16: - return true; - default: - return false; - } -} - -[[nodiscard]] bool IsUnswizzleAcceleratedFormat(const Device& device, PixelFormat format) { - if (!ENABLE_ACCELERATED_UNSWIZZLE) { - return false; - } - if (IsPixelFormatASTC(format) || VideoCore::Surface::IsPixelFormatBCn(format)) { - return false; - } - if (VideoCore::Surface::GetFormatType(format) != SurfaceType::ColorTexture) { - return false; - } - if (!MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format).storage) { - return false; - } - return IsUnswizzleStorageFormatSupported(device, BytesPerBlock(format)); -} - -[[nodiscard]] bool WillUseAcceleratedUnswizzle(const Device& device, const ImageInfo& info) { - if (!ENABLE_ACCELERATED_UNSWIZZLE_DISPATCH) { - return false; - } - switch (info.type) { - case ImageType::e2D: - case ImageType::e3D: - case ImageType::Linear: - break; - default: - return false; - } - if (info.num_samples > 1 || !device.IsKhrImageFormatListSupported()) { - return false; - } - return IsUnswizzleAcceleratedFormat(device, info.format); -} - -[[nodiscard]] VkImageViewType UnswizzleStorageViewType(ImageType type) { - if (type == ImageType::e3D) { - return VK_IMAGE_VIEW_TYPE_3D; - } - if (type == ImageType::Linear) { - return VK_IMAGE_VIEW_TYPE_2D; - } - return VK_IMAGE_VIEW_TYPE_2D_ARRAY; -} - [[nodiscard]] VkImageCreateInfo MakeImageCreateInfo(const Device& device, const ImageInfo& info, std::optional format_override = {}) { auto format_info = @@ -327,23 +249,18 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { } [[nodiscard]] vk::ImageView MakeStorageView(const vk::Device& device, u32 level, VkImage image, - VkFormat format, - VkImageViewType view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY) { + VkFormat format) { static constexpr VkImageViewUsageCreateInfo storage_image_view_usage_create_info{ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, .pNext = nullptr, .usage = VK_IMAGE_USAGE_STORAGE_BIT, }; - u32 layer_count = VK_REMAINING_ARRAY_LAYERS; - if (view_type == VK_IMAGE_VIEW_TYPE_2D || view_type == VK_IMAGE_VIEW_TYPE_3D) { - layer_count = 1; - } return device.CreateImageView(VkImageViewCreateInfo{ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, .pNext = &storage_image_view_usage_create_info, .flags = 0, .image = image, - .viewType = view_type, + .viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY, .format = format, .components{ .r = VK_COMPONENT_SWIZZLE_IDENTITY, @@ -356,7 +273,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { .baseMipLevel = level, .levelCount = 1, .baseArrayLayer = 0, - .layerCount = layer_count, + .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }); } @@ -1029,14 +946,6 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue, memory_allocator); } - if (ENABLE_ACCELERATED_UNSWIZZLE && device.IsKhrImageFormatListSupported()) { - bl_unswizzle_2d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, - compute_pass_descriptor_queue); - bl_unswizzle_3d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, - compute_pass_descriptor_queue); - pitch_unswizzle_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, - compute_pass_descriptor_queue); - } if (!device.IsKhrImageFormatListSupported()) { return; } @@ -1044,8 +953,6 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched const auto image_format = static_cast(index_a); if (IsPixelFormatASTC(image_format) && !device.IsOptimalAstcSupported()) { view_formats[index_a].push_back(VK_FORMAT_A8B8G8R8_UNORM_PACK32); - } else if (IsUnswizzleAcceleratedFormat(device, image_format)) { - view_formats[index_a].push_back(UnswizzleStorageFormat(BytesPerBlock(image_format))); } for (size_t index_b = 0; index_b < VideoCore::Surface::MaxPixelFormat; index_b++) { const auto view_format = static_cast(index_b); @@ -1988,10 +1895,6 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu flags |= VideoCommon::ImageFlagBits::Converted; flags |= VideoCommon::ImageFlagBits::CostlyLoad; } - if (False(flags & VideoCommon::ImageFlagBits::Converted) && - WillUseAcceleratedUnswizzle(runtime->device, info)) { - flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; - } if (runtime->device.HasDebuggingToolAttached()) { original_image.SetObjectNameEXT(VideoCommon::Name(*this).c_str()); } @@ -2377,15 +2280,11 @@ VkImageView Image::StorageImageView(s32 level) noexcept { if (!view) { auto format_info = MaxwellToVK::SurfaceFormat(runtime->device, FormatType::Optimal, true, info.format); - VkImageViewType view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY; if (WillUseAcceleratedAstcDecode(runtime->device, info)) { format_info.format = VK_FORMAT_A8B8G8R8_UNORM_PACK32; - } else if (True(flags & VideoCommon::ImageFlagBits::AcceleratedUpload)) { - format_info.format = UnswizzleStorageFormat(BytesPerBlock(info.format)); - view_type = UnswizzleStorageViewType(info.type); } view = MakeStorageView(runtime->device.GetLogical(), level, *(this->*current_image), - format_info.format, view_type); + format_info.format); } return *view; } @@ -2778,7 +2677,7 @@ vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags aspect_ .pNext = nullptr, .flags = 0, .image = image_handle, - .viewType = view_type, + .viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY, .format = vk_format, .components{ .r = VK_COMPONENT_SWIZZLE_IDENTITY, @@ -3189,24 +3088,7 @@ void TextureCacheRuntime::AccelerateImageUpload( if (is_rescaled) { image.ScaleDown(true); } - if (IsPixelFormatASTC(image.info.format)) { - astc_decoder_pass->Assemble(image, map, swizzles); - } else { - switch (image.info.type) { - case ImageType::e2D: - bl_unswizzle_2d_pass->Unswizzle(image, map, swizzles); - break; - case ImageType::e3D: - bl_unswizzle_3d_pass->Unswizzle(image, map, swizzles); - break; - case ImageType::Linear: - pitch_unswizzle_pass->Unswizzle(image, map, swizzles); - break; - default: - ASSERT(false); - break; - } - } + astc_decoder_pass->Assemble(image, map, swizzles); if (is_rescaled) { image.ScaleUp(); } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 2e6b547e72..6510e10e50 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -156,9 +156,6 @@ public: BlitImageHelper& blit_image_helper; RenderPassCache& render_pass_cache; std::optional astc_decoder_pass; - std::optional bl_unswizzle_2d_pass; - std::optional bl_unswizzle_3d_pass; - std::optional pitch_unswizzle_pass; const Settings::ResolutionScalingInfo& resolution; std::array, VideoCore::Surface::MaxPixelFormat> view_formats; From 0cc76f1f22cc7ef376e45e26f3344b6a1b15fa5a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 21:26:19 -0400 Subject: [PATCH 048/198] First intent to relax the pressure on the gpu thread for unswizzling images --- src/video_core/textures/decoders.cpp | 63 ++++++++++++++++++---------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 25b0860b0f..d7eef06a4c 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp @@ -1,9 +1,10 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include #include #include @@ -15,6 +16,7 @@ #include "common/div_ceil.h" #include "video_core/gpu.h" #include "video_core/textures/decoders.h" +#include "video_core/textures/workers.h" namespace Tegra::Texture { namespace { @@ -36,6 +38,8 @@ void incrpdep(u32& value) { value = ((value | ~mask) + swizzled_incr) & mask; } +constexpr u32 PARALLEL_SWIZZLE_BYTES = 256 * 1024; + template void SwizzleImpl(std::span output, std::span input, u32 width, u32 height, u32 depth, u32 block_height, u32 block_depth, u32 stride) { @@ -58,37 +62,55 @@ void SwizzleImpl(std::span output, std::span input, u32 width, u32 const u32 block_depth_mask = (1U << block_depth) - 1; const u32 x_shift = GOB_SIZE_SHIFT + block_height + block_depth; - for (u32 slice = 0; slice < depth; ++slice) { + const auto process = [&](u32 slice, u32 line_begin, u32 line_end) { const u32 z = slice + origin_z; const u32 offset_z = (z >> block_depth) * slice_size + ((z & block_depth_mask) << (GOB_SIZE_SHIFT + block_height)); - for (u32 line = 0; line < height; ++line) { + const u32 slice_base = slice * pitch * height; + for (u32 line = line_begin; line < line_end; ++line) { const u32 y = line + origin_y; - const u32 swizzled_y = pdep(y); + const u32 swizzled_y = ((y & 1) << 4) | ((y & 6) << 5); const u32 block_y = y >> GOB_SIZE_Y_SHIFT; const u32 offset_y = (block_y >> block_height) * block_size + ((block_y & block_height_mask) << GOB_SIZE_SHIFT); + const u32 row_base = offset_z + offset_y + swizzled_y; + u32 linear_offset = slice_base + line * pitch; u32 swizzled_x = pdep(origin_x * BYTES_PER_PIXEL); for (u32 column = 0; column < width; - ++column, incrpdep(swizzled_x)) { + ++column, incrpdep(swizzled_x), + linear_offset += BYTES_PER_PIXEL) { const u32 x = (column + origin_x) * BYTES_PER_PIXEL; const u32 offset_x = (x >> GOB_SIZE_X_SHIFT) << x_shift; - const u32 base_swizzled_offset = offset_z + offset_y + offset_x; - const u32 swizzled_offset = base_swizzled_offset + (swizzled_x | swizzled_y); + const u32 swizzled_offset = row_base + offset_x + swizzled_x; - const u32 unswizzled_offset = - slice * pitch * height + line * pitch + column * BYTES_PER_PIXEL; - - u8* const dst = &output[TO_LINEAR ? swizzled_offset : unswizzled_offset]; - const u8* const src = &input[TO_LINEAR ? unswizzled_offset : swizzled_offset]; + u8* const dst = &output[TO_LINEAR ? swizzled_offset : linear_offset]; + const u8* const src = &input[TO_LINEAR ? linear_offset : swizzled_offset]; std::memcpy(dst, src, BYTES_PER_PIXEL); } } + }; + + const u32 rows_per_task = (std::max)(1U, PARALLEL_SWIZZLE_BYTES / (std::max)(1U, pitch)); + if (u64{depth} * height * pitch < PARALLEL_SWIZZLE_BYTES * 2) { + for (u32 slice = 0; slice < depth; ++slice) { + process(slice, 0, height); + } + return; } + Common::ThreadWorker& workers{GetThreadWorkers()}; + for (u32 slice = 0; slice < depth; ++slice) { + for (u32 line = 0; line < height; line += rows_per_task) { + const u32 line_end = (std::min)(line + rows_per_task, height); + workers.QueueWork([&process, slice, line, line_end] { + process(slice, line, line_end); + }); + } + } + workers.WaitForRequests(); } template @@ -123,26 +145,25 @@ void SwizzleSubrectImpl(std::span output, std::span input, u32 wid const u32 lines_in_y = (std::min)(unprocessed_lines, extent_y); for (u32 line = 0; line < lines_in_y; ++line) { const u32 y = line + origin_y; - const u32 swizzled_y = pdep(y); + const u32 swizzled_y = ((y & 1) << 4) | ((y & 6) << 5); const u32 block_y = y >> GOB_SIZE_Y_SHIFT; const u32 offset_y = (block_y >> block_height) * block_size + ((block_y & block_height_mask) << GOB_SIZE_SHIFT); + const u32 row_base = offset_z + offset_y + swizzled_y; + u32 linear_offset = slice * pitch * height + line * pitch; u32 swizzled_x = pdep(origin_x * BYTES_PER_PIXEL); for (u32 column = 0; column < extent_x; - ++column, incrpdep(swizzled_x)) { + ++column, incrpdep(swizzled_x), + linear_offset += BYTES_PER_PIXEL) { const u32 x = (column + origin_x) * BYTES_PER_PIXEL; const u32 offset_x = (x >> GOB_SIZE_X_SHIFT) << x_shift; - const u32 base_swizzled_offset = offset_z + offset_y + offset_x; - const u32 swizzled_offset = base_swizzled_offset + (swizzled_x | swizzled_y); + const u32 swizzled_offset = row_base + offset_x + swizzled_x; - const u32 unswizzled_offset = - slice * pitch * height + line * pitch + column * BYTES_PER_PIXEL; - - u8* const dst = &output[TO_LINEAR ? swizzled_offset : unswizzled_offset]; - const u8* const src = &input[TO_LINEAR ? unswizzled_offset : swizzled_offset]; + u8* const dst = &output[TO_LINEAR ? swizzled_offset : linear_offset]; + const u8* const src = &input[TO_LINEAR ? linear_offset : swizzled_offset]; std::memcpy(dst, src, BYTES_PER_PIXEL); } From 40036eb0f82358d9ba134c49d219d0ead8a6dc02 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 22:40:54 -0400 Subject: [PATCH 049/198] Remove the thread opt for unswizzle images --- src/video_core/textures/decoders.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index d7eef06a4c..a914acace0 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp @@ -4,7 +4,6 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include #include #include #include @@ -16,7 +15,6 @@ #include "common/div_ceil.h" #include "video_core/gpu.h" #include "video_core/textures/decoders.h" -#include "video_core/textures/workers.h" namespace Tegra::Texture { namespace { @@ -38,8 +36,6 @@ void incrpdep(u32& value) { value = ((value | ~mask) + swizzled_incr) & mask; } -constexpr u32 PARALLEL_SWIZZLE_BYTES = 256 * 1024; - template void SwizzleImpl(std::span output, std::span input, u32 width, u32 height, u32 depth, u32 block_height, u32 block_depth, u32 stride) { @@ -62,12 +58,12 @@ void SwizzleImpl(std::span output, std::span input, u32 width, u32 const u32 block_depth_mask = (1U << block_depth) - 1; const u32 x_shift = GOB_SIZE_SHIFT + block_height + block_depth; - const auto process = [&](u32 slice, u32 line_begin, u32 line_end) { + for (u32 slice = 0; slice < depth; ++slice) { const u32 z = slice + origin_z; const u32 offset_z = (z >> block_depth) * slice_size + ((z & block_depth_mask) << (GOB_SIZE_SHIFT + block_height)); const u32 slice_base = slice * pitch * height; - for (u32 line = line_begin; line < line_end; ++line) { + for (u32 line = 0; line < height; ++line) { const u32 y = line + origin_y; const u32 swizzled_y = ((y & 1) << 4) | ((y & 6) << 5); @@ -92,25 +88,7 @@ void SwizzleImpl(std::span output, std::span input, u32 width, u32 std::memcpy(dst, src, BYTES_PER_PIXEL); } } - }; - - const u32 rows_per_task = (std::max)(1U, PARALLEL_SWIZZLE_BYTES / (std::max)(1U, pitch)); - if (u64{depth} * height * pitch < PARALLEL_SWIZZLE_BYTES * 2) { - for (u32 slice = 0; slice < depth; ++slice) { - process(slice, 0, height); - } - return; } - Common::ThreadWorker& workers{GetThreadWorkers()}; - for (u32 slice = 0; slice < depth; ++slice) { - for (u32 line = 0; line < height; line += rows_per_task) { - const u32 line_end = (std::min)(line + rows_per_task, height); - workers.QueueWork([&process, slice, line, line_end] { - process(slice, line, line_end); - }); - } - } - workers.WaitForRequests(); } template From a152596f29435f7cebcc0b3ce526282cbff3fde9 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 16 Sep 2026 23:57:44 -0400 Subject: [PATCH 050/198] Chinga su madre que perramente molesto es este puto juego --- src/video_core/renderer_vulkan/vk_texture_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 5663220045..1e3520e21a 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -2677,7 +2677,7 @@ vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags aspect_ .pNext = nullptr, .flags = 0, .image = image_handle, - .viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY, + .viewType = view_type, .format = vk_format, .components{ .r = VK_COMPONENT_SWIZZLE_IDENTITY, From bd82351d73b8c89c07868252bf09facba4d34473 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 00:56:50 -0400 Subject: [PATCH 051/198] First try to align GOB's --- src/video_core/textures/decoders.cpp | 47 +++++++++++++++------------- src/video_core/textures/decoders.h | 1 - 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index a914acace0..29d44b77db 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp @@ -41,9 +41,9 @@ void SwizzleImpl(std::span output, std::span input, u32 width, u32 u32 block_height, u32 block_depth, u32 stride) { // The origin of the transformation can be configured here, leave it as zero as the current API // doesn't expose it. - static constexpr u32 origin_x = 0; static constexpr u32 origin_y = 0; static constexpr u32 origin_z = 0; + static constexpr u32 columns_per_gob = GOB_SIZE_X / BYTES_PER_PIXEL; // We can configure here a custom pitch // As it's not exposed 'width * BYTES_PER_PIXEL' will be the expected pitch. @@ -63,29 +63,37 @@ void SwizzleImpl(std::span output, std::span input, u32 width, u32 const u32 offset_z = (z >> block_depth) * slice_size + ((z & block_depth_mask) << (GOB_SIZE_SHIFT + block_height)); const u32 slice_base = slice * pitch * height; - for (u32 line = 0; line < height; ++line) { - const u32 y = line + origin_y; - const u32 swizzled_y = ((y & 1) << 4) | ((y & 6) << 5); - - const u32 block_y = y >> GOB_SIZE_Y_SHIFT; + for (u32 band = 0; band < height; band += GOB_SIZE_Y) { + const u32 band_end = (std::min)(band + GOB_SIZE_Y, height); + const u32 block_y = (band + origin_y) >> GOB_SIZE_Y_SHIFT; const u32 offset_y = (block_y >> block_height) * block_size + ((block_y & block_height_mask) << GOB_SIZE_SHIFT); - const u32 row_base = offset_z + offset_y + swizzled_y; - u32 linear_offset = slice_base + line * pitch; - u32 swizzled_x = pdep(origin_x * BYTES_PER_PIXEL); - for (u32 column = 0; column < width; - ++column, incrpdep(swizzled_x), - linear_offset += BYTES_PER_PIXEL) { - const u32 x = (column + origin_x) * BYTES_PER_PIXEL; - const u32 offset_x = (x >> GOB_SIZE_X_SHIFT) << x_shift; + const u32 band_base = offset_z + offset_y; + u32 band_linear = slice_base + band * pitch; + u32 offset_x = 0; + for (u32 gob = 0; gob < width; gob += columns_per_gob, + offset_x += 1U << x_shift, band_linear += GOB_SIZE_X) { + const u32 columns = (std::min)(columns_per_gob, width - gob); + const u32 gob_base = band_base + offset_x; + u32 linear_row = band_linear; + for (u32 line = band; line < band_end; ++line, linear_row += pitch) { + const u32 y = line + origin_y; + const u32 row_base = gob_base + ((y & 1) << 4) + ((y & 6) << 5); - const u32 swizzled_offset = row_base + offset_x + swizzled_x; + u32 linear_offset = linear_row; + u32 swizzled_x = 0; + for (u32 column = 0; column < columns; + ++column, incrpdep(swizzled_x), + linear_offset += BYTES_PER_PIXEL) { + const u32 swizzled_offset = row_base + swizzled_x; - u8* const dst = &output[TO_LINEAR ? swizzled_offset : linear_offset]; - const u8* const src = &input[TO_LINEAR ? linear_offset : swizzled_offset]; + u8* const dst = &output[TO_LINEAR ? swizzled_offset : linear_offset]; + const u8* const src = &input[TO_LINEAR ? linear_offset : swizzled_offset]; - std::memcpy(dst, src, BYTES_PER_PIXEL); + std::memcpy(dst, src, BYTES_PER_PIXEL); + } + } } } } @@ -163,11 +171,8 @@ void Swizzle(std::span output, std::span input, u32 bytes_per_pixe block_depth, stride_alignment); BPP_CASE(1) BPP_CASE(2) - BPP_CASE(3) BPP_CASE(4) - BPP_CASE(6) BPP_CASE(8) - BPP_CASE(12) BPP_CASE(16) #undef BPP_CASE default: diff --git a/src/video_core/textures/decoders.h b/src/video_core/textures/decoders.h index 1e14a38753..8018f444be 100644 --- a/src/video_core/textures/decoders.h +++ b/src/video_core/textures/decoders.h @@ -24,7 +24,6 @@ constexpr u32 GOB_SIZE_Z_SHIFT = 0; constexpr u32 GOB_SIZE_SHIFT = GOB_SIZE_X_SHIFT + GOB_SIZE_Y_SHIFT + GOB_SIZE_Z_SHIFT; constexpr u32 SWIZZLE_X_BITS = 0b100101111; -constexpr u32 SWIZZLE_Y_BITS = 0b011010000; /// Unswizzles a block linear texture into linear memory. void UnswizzleTexture(std::span output, std::span input, u32 bytes_per_pixel, From 052a04e610a38936b0e7d6100a8af8c8b90f7a4d Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 02:20:40 -0400 Subject: [PATCH 052/198] Correcting some bugs on the vulkan async presentation thread --- .../renderer_vulkan/renderer_vulkan.cpp | 6 +++-- .../renderer_vulkan/vk_present_manager.cpp | 26 ++++++++++++++++++- .../renderer_vulkan/vk_present_manager.h | 10 ++++++- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 4fd4c0233b..27ca531186 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -217,13 +217,15 @@ void RendererVulkan::Composite(std::span framebu scheduler.RequestOutsideRenderPassOperationContext(); blit_swapchain.DrawToFrame(device, rasterizer, frame, framebuffers, - render_window.GetFramebufferLayout(), swapchain.GetImageCount(), + render_window.GetFramebufferLayout(), + present_manager.SwapchainImageCount(), swapchain.GetImageViewFormat()); #ifdef HAS_LSFG void(frame_gen.WantedGenerations(present_manager.MaxExtraFrames())); - frame_gen.Process(device, frame, swapchain.GetImageFormat(), GuestExtent(framebuffers)); + frame_gen.Process(device, frame, present_manager.SwapchainImageFormat(), + GuestExtent(framebuffers)); const size_t generated_frames = frame_gen.GeneratedFrameCount(); for (size_t generation = 0; generation < generated_frames; ++generation) { diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index d173a3ba5f..9298764546 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -23,6 +23,7 @@ namespace Vulkan { namespace { constexpr size_t MAX_FRAMES_IN_FLIGHT = 7; +constexpr u32 MAX_PRESENT_ATTEMPTS = 3; #ifdef HAS_LSFG static_assert(MAX_FRAMES_IN_FLIGHT <= LSFG_MAX_TARGETS); #endif @@ -372,12 +373,33 @@ void PresentManager::SetImageCount() { #else image_count = std::min(swapchain.GetImageCount(), MAX_FRAMES_IN_FLIGHT); #endif + swapchain_image_count = swapchain.GetImageCount(); + swapchain_image_format = swapchain.GetImageFormat(); +} + +void PresentManager::DiscardFrame(Frame* frame) { + static constexpr VkPipelineStageFlags wait_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + const VkSemaphore render_ready = *frame->render_ready; + const VkSubmitInfo submit_info{ + .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, + .pNext = nullptr, + .waitSemaphoreCount = 1U, + .pWaitSemaphores = &render_ready, + .pWaitDstStageMask = &wait_stage, + .commandBufferCount = 0U, + .pCommandBuffers = nullptr, + .signalSemaphoreCount = 0U, + .pSignalSemaphores = nullptr, + }; + + std::scoped_lock submit_lock{scheduler.submit_mutex}; + void(device.GetGraphicsQueue().Submit(submit_info, *frame->present_done)); } void PresentManager::CopyToSwapchain(Frame* frame) { bool requires_recreation = false; - while (true) { + for (u32 attempt = 0; attempt < MAX_PRESENT_ATTEMPTS; ++attempt) { try { // Recreate surface and swapchain if needed. if (requires_recreation) { @@ -397,6 +419,8 @@ void PresentManager::CopyToSwapchain(Frame* frame) { requires_recreation = true; } } + + DiscardFrame(frame); } void PresentManager::CopyToSwapchainImpl(Frame* frame) { diff --git a/src/video_core/renderer_vulkan/vk_present_manager.h b/src/video_core/renderer_vulkan/vk_present_manager.h index 4741c55e61..ab2b76f10f 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.h +++ b/src/video_core/renderer_vulkan/vk_present_manager.h @@ -6,6 +6,7 @@ #pragma once +#include #include #include #include @@ -68,6 +69,9 @@ public: /// How many additional frames can be queued without stalling the render thread [[nodiscard]] size_t MaxExtraFrames() const; + [[nodiscard]] std::size_t SwapchainImageCount() const { return swapchain_image_count; } + [[nodiscard]] VkFormat SwapchainImageFormat() const { return swapchain_image_format; } + private: void PresentThread(std::stop_token token); @@ -77,6 +81,8 @@ private: void RecreateSwapchain(Frame* frame); + void DiscardFrame(Frame* frame); + void SetImageCount(); private: @@ -100,7 +106,9 @@ private: bool blit_supported; bool storage_supported; bool use_present_thread; - std::size_t image_count{}; + std::atomic image_count{}; + std::atomic swapchain_image_count{}; + std::atomic swapchain_image_format{}; }; } // namespace Vulkan From 86f826c313a097b89e2b846c725e834377661073 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 03:31:53 -0400 Subject: [PATCH 053/198] Remove astc recompression method --- src/common/settings.cpp | 1 - src/common/settings.h | 7 -- src/common/settings_enums.h | 1 - src/qt_common/config/shared_translation.cpp | 12 --- src/qt_common/config/uisettings.h | 1 - src/video_core/CMakeLists.txt | 4 +- .../renderer_opengl/gl_texture_cache.cpp | 30 +------ .../renderer_vulkan/maxwell_to_vk.cpp | 21 ++--- .../renderer_vulkan/vk_texture_cache.cpp | 7 +- src/video_core/surface.cpp | 10 +-- src/video_core/texture_cache/image_base.h | 2 + src/video_core/texture_cache/texture_cache.h | 28 ++++++ .../texture_cache/texture_cache_base.h | 2 + src/video_core/texture_cache/util.cpp | 59 +------------ src/video_core/textures/bcn.cpp | 86 ------------------- src/video_core/textures/bcn.h | 16 ---- 16 files changed, 45 insertions(+), 242 deletions(-) delete mode 100644 src/video_core/textures/bcn.cpp delete mode 100644 src/video_core/textures/bcn.h diff --git a/src/common/settings.cpp b/src/common/settings.cpp index bc46b61bb4..7605305a04 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -48,7 +48,6 @@ SWITCHABLE(AnisotropyMode, true); SWITCHABLE(AntiAliasing, false); SWITCHABLE(AspectRatio, true); SWITCHABLE(AstcDecodeMode, true); -SWITCHABLE(AstcRecompression, true); SWITCHABLE(AudioMode, true); SWITCHABLE(CpuBackend, true); SWITCHABLE(CpuAccuracy, true); diff --git a/src/common/settings.h b/src/common/settings.h index 48d4ca427d..d15427187c 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -65,7 +65,6 @@ SWITCHABLE(AnisotropyMode, true); SWITCHABLE(AntiAliasing, false); SWITCHABLE(AspectRatio, true); SWITCHABLE(AstcDecodeMode, true); -SWITCHABLE(AstcRecompression, true); SWITCHABLE(AudioMode, true); SWITCHABLE(CpuBackend, true); SWITCHABLE(CpuAccuracy, true); @@ -563,12 +562,6 @@ struct Values { true, true}; - SwitchableSetting astc_recompression{linkage, - AstcRecompression::Uncompressed, - "astc_recompression", - Category::RendererAdvanced}; - - SwitchableSetting sync_memory_operations{linkage, false, "sync_memory_operations", diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index 1d7c25cf09..73568e257c 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h @@ -130,7 +130,6 @@ ENUM(TimeZone, Auto, Default, Cet, Cst6Cdt, Cuba, Eet, Egypt, Eire, Est, Est5Edt Roc, Rok, Singapore, Turkey, Uct, Universal, Utc, WSu, Wet, Zulu); ENUM(AnisotropyMode, Automatic, Default, X2, X4, X8, X16); ENUM(AstcDecodeMode, Cpu, Gpu, CpuAsynchronous); -ENUM(AstcRecompression, Uncompressed, Bc1, Bc3); ENUM(FramePacingMode, Target_Auto, Target_30, Target_60, Target_90, Target_120); ENUM(VSyncMode, Immediate, Mailbox, Fifo, FifoRelaxed); ENUM(VramUsageMode, Conservative, Aggressive); diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 96e569aa21..1f6792f86c 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -179,11 +179,6 @@ std::unique_ptr InitializeTranslations(QObject* parent) { "GPU: Use the GPU's compute shaders to decode ASTC textures (recommended).\n" "CPU Asynchronously: Use the CPU to decode ASTC textures on demand. Eliminates" "ASTC decoding\nstuttering but may present artifacts.")); - INSERT(Settings, astc_recompression, tr("ASTC Recompression Method:"), - tr("Most GPUs lack support for ASTC textures and must decompress to an" - "intermediate format: RGBA8.\n" - "BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format,\n" - " saving VRAM but degrading image quality.")); INSERT(Settings, frame_pacing_mode, tr("Frame Pacing Mode (Vulkan only)"), tr("Controls how the emulator manages frame pacing to reduce stuttering and make the " "frame rate smoother and more consistent.")); @@ -379,13 +374,6 @@ std::unique_ptr ComboboxEnumeration(QObject* parent) { PAIR(AstcDecodeMode, Gpu, tr("GPU")), PAIR(AstcDecodeMode, CpuAsynchronous, tr("CPU Asynchronous")), }}); - translations->insert( - {Settings::EnumMetadata::Index(), - { - PAIR(AstcRecompression, Uncompressed, tr("Uncompressed (Best quality)")), - PAIR(AstcRecompression, Bc1, tr("BC1 (Low quality)")), - PAIR(AstcRecompression, Bc3, tr("BC3 (Medium quality)")), - }}); translations->insert({Settings::EnumMetadata::Index(), { PAIR(FramePacingMode, Target_Auto, tr("Auto")), diff --git a/src/qt_common/config/uisettings.h b/src/qt_common/config/uisettings.h index 794d1a029b..58a538367a 100644 --- a/src/qt_common/config/uisettings.h +++ b/src/qt_common/config/uisettings.h @@ -262,6 +262,5 @@ Q_DECLARE_METATYPE(Settings::ResolutionSetup); Q_DECLARE_METATYPE(Settings::ScalingFilter); Q_DECLARE_METATYPE(Settings::AntiAliasing); Q_DECLARE_METATYPE(Settings::RendererBackend); -Q_DECLARE_METATYPE(Settings::AstcRecompression); Q_DECLARE_METATYPE(Settings::AstcDecodeMode); Q_DECLARE_METATYPE(Settings::SpirvOptimizeMode); diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 64d14ab2a6..77883b6484 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -256,8 +256,6 @@ add_library(video_core STATIC texture_cache/util.h textures/astc.h textures/astc.cpp - textures/bcn.cpp - textures/bcn.h textures/decoders.cpp textures/decoders.h textures/texture.cpp @@ -406,7 +404,7 @@ if (ENABLE_OPENGL) endif() target_link_libraries(video_core PUBLIC common core) -target_link_libraries(video_core PUBLIC shader_recompiler stb bc_decoder gpu_logging) +target_link_libraries(video_core PUBLIC shader_recompiler bc_decoder gpu_logging) if (ENABLE_OPENGL) target_link_libraries(video_core PUBLIC glad) endif() diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 48aa32bc90..2589e42109 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -235,9 +235,7 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array& color) { if (Settings::values.accelerate_astc.GetValue() != Settings::AstcDecodeMode::Gpu) { return false; } - return Settings::values.astc_recompression.GetValue() == - Settings::AstcRecompression::Uncompressed && - info.size.depth == 1; + return info.size.depth == 1; } [[nodiscard]] VkImageCreateInfo MakeImageCreateInfo(const Device& device, const ImageInfo& info, @@ -1880,8 +1878,9 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu case Settings::AstcDecodeMode::Gpu: if (WillUseAcceleratedAstcDecode(runtime->device, info)) { flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; + break; } - break; + [[fallthrough]]; case Settings::AstcDecodeMode::CpuAsynchronous: flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; break; diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 4603870bfa..fa9554db59 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -6,7 +6,6 @@ #include "common/common_types.h" #include "common/math_util.h" -#include "common/settings.h" #include "video_core/surface.h" namespace VideoCore::Surface { @@ -469,14 +468,7 @@ u64 TranscodedAstcSize(u64 base_size, PixelFormat format) { static_cast(DefaultBlockHeight(format)) * RGBA8_PIXEL_SIZE; const u64 uncompressed_size = (base_size * base_block_size) / BytesPerBlock(format); - switch (Settings::values.astc_recompression.GetValue()) { - case Settings::AstcRecompression::Bc1: - return uncompressed_size / 8; - case Settings::AstcRecompression::Bc3: - return uncompressed_size / 4; - default: - return uncompressed_size; - } + return uncompressed_size; } } // namespace VideoCore::Surface diff --git a/src/video_core/texture_cache/image_base.h b/src/video_core/texture_cache/image_base.h index 79fc8505d6..9e0a293962 100644 --- a/src/video_core/texture_cache/image_base.h +++ b/src/video_core/texture_cache/image_base.h @@ -95,6 +95,7 @@ struct ImageBase { u32 scale_rating = 0; u64 scale_tick = 0; bool has_scaled = false; + u32 guest_data_checks = 0; size_t channel = 0; @@ -105,6 +106,7 @@ struct ImageBase { VAddr cpu_addr_end = 0; u64 modification_tick = 0; + u64 guest_data_hash = 0; size_t lru_index = SIZE_MAX; std::array mip_level_offsets{}; diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 861d9f63d0..489ceda94e 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -12,6 +12,7 @@ #include #include "common/alignment.h" +#include "common/cityhash.h" #include "common/settings.h" #include "common/slot_vector.h" #include "video_core/control/channel_state.h" @@ -1074,6 +1075,29 @@ void TextureCache

::DownloadImageIntoBuffer(typename TextureCache

::Image* i } } +template +bool TextureCache

::IsAstcDataUnchanged(Image& image) { + static constexpr u32 CHECK_THRESHOLD = 4; + if (False(image.flags & ImageFlagBits::Converted) || + True(image.flags & ImageFlagBits::GpuModified) || + !IsPixelFormatASTC(image.info.format)) { + return false; + } + if (image.guest_data_checks < CHECK_THRESHOLD) { + ++image.guest_data_checks; + return false; + } + Tegra::Memory::GpuGuestMemory guest_data( + *gpu_memory, image.gpu_addr, image.guest_size_bytes, &swizzle_data_buffer); + const u64 hash = Common::CityHash64(reinterpret_cast(guest_data.data()), + image.guest_size_bytes); + if (image.guest_data_hash == hash) { + return true; + } + image.guest_data_hash = hash; + return false; +} + template void TextureCache

::RefreshContents(Image& image, ImageId image_id) { if (False(image.flags & ImageFlagBits::CpuModified)) { @@ -1085,6 +1109,10 @@ void TextureCache

::RefreshContents(Image& image, ImageId image_id) { TrackImage(image, image_id); + if (IsAstcDataUnchanged(image)) { + return; + } + if (image.info.num_samples > 1 && !runtime.CanUploadMSAA()) { LOG_WARNING(HW_GPU, "MSAA image uploads are not implemented"); runtime.TransitionImageLayout(image); diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 8fbd7f61bc..29f5bdde83 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -298,6 +298,8 @@ private: void RefreshContents(Image& image, ImageId image_id); + [[nodiscard]] bool IsAstcDataUnchanged(Image& image); + /// Upload data from guest to an image template void UploadImageContents(Image& image, StagingBuffer& staging_buffer); diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 8d275ff8eb..d8cae4f3ee 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -22,7 +22,6 @@ #include "common/common_types.h" #include "common/div_ceil.h" #include "common/scratch_buffer.h" -#include "common/settings.h" #include "video_core/compatible_formats.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/guest_memory.h" @@ -34,7 +33,6 @@ #include "video_core/texture_cache/samples_helper.h" #include "video_core/texture_cache/util.h" #include "video_core/textures/astc.h" -#include "video_core/textures/bcn.h" #include "video_core/textures/decoders.h" namespace VideoCommon { @@ -608,21 +606,6 @@ u32 CalculateConvertedSizeBytes(const ImageInfo& info) noexcept { return info.size.width * BytesPerBlock(info.format); } static constexpr Extent2D TILE_SIZE{1, 1}; - if (IsPixelFormatASTC(info.format) && Settings::values.astc_recompression.GetValue() != - Settings::AstcRecompression::Uncompressed) { - const u32 bpp_div = - Settings::values.astc_recompression.GetValue() == Settings::AstcRecompression::Bc1 ? 2 - : 1; - // NumBlocksPerLayer doesn't account for this correctly, so we have to do it manually. - u32 output_size = 0; - for (s32 i = 0; i < info.resources.levels; i++) { - const auto mip_size = AdjustMipSize(info.size, i); - const u32 plane_dim = - Common::AlignUp(mip_size.width, 4U) * Common::AlignUp(mip_size.height, 4U); - output_size += (plane_dim * info.size.depth * info.resources.layers) / bpp_div; - } - return output_size; - } return NumBlocksPerLayer(info, TILE_SIZE) * info.resources.layers * ConvertedBytesPerBlock(info.format); } @@ -925,7 +908,6 @@ boost::container::small_vector UnswizzleImage(Tegra::Memory void ConvertImage(std::span input, const ImageInfo& info, std::span output, std::span copies) { u32 output_offset = 0; - Common::ScratchBuffer decode_scratch; const Extent2D tile_size = DefaultBlockSize(info.format); for (BufferImageCopy& copy : copies) { @@ -940,10 +922,7 @@ void ConvertImage(std::span input, const ImageInfo& info, std::span input, const ImageInfo& info, std::span(copy.buffer_size); } else { DecompressBCn(input_offset, output.subspan(output_offset), copy, info.format); output_offset += copy.image_extent.width * copy.image_extent.height * @@ -995,11 +944,7 @@ void ConvertImage(std::span input, const ImageInfo& info, std::span ConvertImageFromGuest( diff --git a/src/video_core/textures/bcn.cpp b/src/video_core/textures/bcn.cpp deleted file mode 100644 index 16ddbe3202..0000000000 --- a/src/video_core/textures/bcn.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include -#include -#include "common/alignment.h" -#include "video_core/textures/bcn.h" -#include "video_core/textures/workers.h" - -namespace Tegra::Texture::BCN { - -using BCNCompressor = void(u8* block_output, const u8* block_input, bool any_alpha); - -template -void CompressBCN(std::span data, uint32_t width, uint32_t height, uint32_t depth, - std::span output, BCNCompressor f) { - constexpr u8 alpha_threshold = 128; - constexpr u32 bytes_per_px = 4; - const u32 plane_dim = width * height; - - Common::ThreadWorker& workers{GetThreadWorkers()}; - - for (u32 z = 0; z < depth; z++) { - for (u32 y = 0; y < height; y += 4) { - auto compress_row = [z, y, width, height, plane_dim, f, data, output]() { - for (u32 x = 0; x < width; x += 4) { - // Gather 4x4 block of RGBA texels - u8 input_colors[4][4][4]; - bool any_alpha = false; - - for (u32 j = 0; j < 4; j++) { - for (u32 i = 0; i < 4; i++) { - const size_t coord = - (z * plane_dim + (y + j) * width + (x + i)) * bytes_per_px; - - if ((x + i < width) && (y + j < height)) { - if constexpr (ThresholdAlpha) { - if (data[coord + 3] >= alpha_threshold) { - input_colors[j][i][0] = data[coord + 0]; - input_colors[j][i][1] = data[coord + 1]; - input_colors[j][i][2] = data[coord + 2]; - input_colors[j][i][3] = 255; - } else { - any_alpha = true; - memset(input_colors[j][i], 0, bytes_per_px); - } - } else { - memcpy(input_colors[j][i], &data[coord], bytes_per_px); - } - } else { - memset(input_colors[j][i], 0, bytes_per_px); - } - } - } - - const u32 bytes_per_row = BytesPerBlock * Common::DivideUp(width, 4U); - const u32 bytes_per_plane = bytes_per_row * Common::DivideUp(height, 4U); - f(output.data() + z * bytes_per_plane + (y / 4) * bytes_per_row + - (x / 4) * BytesPerBlock, - reinterpret_cast(input_colors), any_alpha); - } - }; - workers.QueueWork(std::move(compress_row)); - } - workers.WaitForRequests(); - } -} - -void CompressBC1(std::span data, uint32_t width, uint32_t height, uint32_t depth, - std::span output) { - CompressBCN<8, true>(data, width, height, depth, output, - [](u8* block_output, const u8* block_input, bool any_alpha) { - stb_compress_bc1_block(block_output, block_input, any_alpha, - STB_DXT_NORMAL); - }); -} - -void CompressBC3(std::span data, uint32_t width, uint32_t height, uint32_t depth, - std::span output) { - CompressBCN<16, false>(data, width, height, depth, output, - [](u8* block_output, const u8* block_input, bool any_alpha) { - stb_compress_bc3_block(block_output, block_input, STB_DXT_NORMAL); - }); -} - -} // namespace Tegra::Texture::BCN diff --git a/src/video_core/textures/bcn.h b/src/video_core/textures/bcn.h deleted file mode 100644 index d5d2a16c91..0000000000 --- a/src/video_core/textures/bcn.h +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include "common/common_types.h" - -namespace Tegra::Texture::BCN { - -void CompressBC1(std::span data, u32 width, u32 height, u32 depth, std::span output); - -void CompressBC3(std::span data, u32 width, u32 height, u32 depth, std::span output); - -} // namespace Tegra::Texture::BCN From f955dfedcbbcef9ce98801f0aec1df600a3b7a10 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 04:59:25 -0400 Subject: [PATCH 054/198] remove async vulkan presentation toggle android --- .../yuzu_emu/features/settings/model/BooleanSetting.kt | 1 - .../yuzu_emu/features/settings/model/view/SettingsItem.kt | 7 ------- .../features/settings/ui/SettingsFragmentPresenter.kt | 1 - src/android/app/src/main/res/values-ar/strings.xml | 2 -- src/android/app/src/main/res/values-es/strings.xml | 2 -- src/android/app/src/main/res/values-ru/strings.xml | 2 -- src/android/app/src/main/res/values-uk/strings.xml | 2 -- src/android/app/src/main/res/values-zh-rCN/strings.xml | 2 -- src/android/app/src/main/res/values-zh-rTW/strings.xml | 2 -- src/android/app/src/main/res/values/strings.xml | 2 -- src/common/settings.h | 2 +- 11 files changed, 1 insertion(+), 24 deletions(-) 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 c0f85d0f60..63747cd241 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 @@ -25,7 +25,6 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache"), RENDERER_FORCE_MAX_CLOCK("force_max_clock"), RENDERER_ASYNCHRONOUS_GPU_EMULATION("use_asynchronous_gpu_emulation"), - RENDERER_ASYNC_PRESENTATION("async_presentation"), RENDERER_ASYNCHRONOUS_SHADERS("use_asynchronous_shaders"), RENDERER_REACTIVE_FLUSHING("use_reactive_flushing"), ENABLE_BUFFER_HISTORY("enable_buffer_history"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 8c07d394b0..b6b42c366c 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -751,13 +751,6 @@ abstract class SettingsItem( descriptionId = R.string.renderer_asynchronous_gpu_emulation_description ) ) - put( - SwitchSetting( - BooleanSetting.RENDERER_ASYNC_PRESENTATION, - titleId = R.string.renderer_async_presentation, - descriptionId = R.string.renderer_async_presentation_description - ) - ) put( SingleChoiceSetting( IntSetting.DMA_ACCURACY, 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 53e0e3a3d7..4cfa885fb4 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 @@ -560,7 +560,6 @@ class SettingsFragmentPresenter( add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key) add(IntSetting.ANDROID_PIPELINE_WORKERS.key) add(BooleanSetting.RENDERER_ASYNCHRONOUS_GPU_EMULATION.key) - add(BooleanSetting.RENDERER_ASYNC_PRESENTATION.key) add(HeaderSetting(R.string.extensions)) diff --git a/src/android/app/src/main/res/values-ar/strings.xml b/src/android/app/src/main/res/values-ar/strings.xml index f199e42efa..cf2c968f99 100644 --- a/src/android/app/src/main/res/values-ar/strings.xml +++ b/src/android/app/src/main/res/values-ar/strings.xml @@ -574,8 +574,6 @@ يجبر وحدة معالجة الرسومات على العمل بأقصى سرعة ممكنة (سيظل يتم تطبيق القيود الحرارية). محاكاة غير متزامنة لوحدة معالجة الرسومات يمكن لهذه الحيلة أن تزيد الأداء عن طريق تشغيل محاكاة وحدة معالجة الرسومات بشكل غير متزامن على حساب مشاكل الرسومات وزيادة معدلات الأعطال بسبب العمليات المتعلقة بالتوقيت. - عرض غير متزامن - يمكن لهذه الحيلة أن تزيد من الأداء عن طريق نقل عملية العرض إلى خيط معالجة منفصل على حساب مشاكل الرسوميات. استخدم التنظيف التفاعلي يحسن دقة العرض في بعض الألعاب على حساب الأداء. تمكين سجل التخزين المؤقت diff --git a/src/android/app/src/main/res/values-es/strings.xml b/src/android/app/src/main/res/values-es/strings.xml index 1f7faad22c..11c7fe296f 100644 --- a/src/android/app/src/main/res/values-es/strings.xml +++ b/src/android/app/src/main/res/values-es/strings.xml @@ -517,8 +517,6 @@ Fuerza a la GPU a ejecutarse a la velocidad máxima de reloj posible (se seguirán aplicando restricciones térmicas). Emulación de GPU asíncrona Este hack puede aumentar el rendimiento ejecutando la emulación de la GPU de forma asíncrona, a costa de problemas gráficos y un aumento en la tasa de fallos debido a operaciones relacionadas con la sincronización. - Presentación asíncrona - Este hack puede aumentar el rendimiento al mover la presentación a un hilo independiente de la CPU a costa de problemas gráficos. Usar limpieza reactiva Mejora la precisión de renderizado en algunos juegos, pero reduce el rendimiento. Activar el historial del búfer diff --git a/src/android/app/src/main/res/values-ru/strings.xml b/src/android/app/src/main/res/values-ru/strings.xml index a839b3bfbc..6dd50bbf29 100644 --- a/src/android/app/src/main/res/values-ru/strings.xml +++ b/src/android/app/src/main/res/values-ru/strings.xml @@ -554,8 +554,6 @@ Заставляет ГПУ работать на максимально возможных тактовых частотах (тепловые ограничения все равно будут применяться). Асинхронная эмуляция ГПУ Может повысить производительность за счёт асинхронного запуска эмуляции ГПУ, но ценой появления графических ошибок и увеличения частоты вылетов из-за операций, зависящих от синхронизации. - Асинхронная презентация - Может повысить производительность за счёт перемещения вывода кадров в отдельный поток ЦП, но ценой возникновения графических проблем. Реактивная очистка Повышение точности рендеринга в некоторых играх за счет снижения производительности. Включить историю буфера diff --git a/src/android/app/src/main/res/values-uk/strings.xml b/src/android/app/src/main/res/values-uk/strings.xml index 3f2cb94fb2..62c9c090e1 100644 --- a/src/android/app/src/main/res/values-uk/strings.xml +++ b/src/android/app/src/main/res/values-uk/strings.xml @@ -481,8 +481,6 @@ Змушує GPU працювати на максимальній тактовій частоті. Асинхронна емуляція ГП Це обхідне рішення може покращити продуктивність завдяки асинхронному виконанню емуляції ГП, але спричинить проблеми з графікою та збільшить частоту збоїв чутливих до таймінгів операцій. - Асинхронне подання - Це обхідне рішення може покращити продуктивність завдяки переміщенню подання на окремий потік ЦП, але спричинить проблеми з графікою. Реактивне очищення Покращує точність рендерингу в деяких іграх. Увімкнути історію буфера 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 index 3cdb7278b3..568d1d384e 100644 --- a/src/android/app/src/main/res/values-zh-rCN/strings.xml +++ b/src/android/app/src/main/res/values-zh-rCN/strings.xml @@ -535,8 +535,6 @@ 强制 GPU 以最大时钟运行 (温控依然生效)。 GPU 异步模拟 此技巧可通过异步运行 GPU 模拟来提升性能,但在执行与时序相关的操作时,可能带来图形显示问题以及增加崩溃概率。 - 异步呈现 - 此技巧通过将图形呈现移至独立的 CPU 线程来提升性能,但可能会带来图形显示问题。 启用反应性刷新 通过牺牲性能来提升某些游戏的渲染精度。 启用缓冲区历史 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 index fa59e2a9b7..15a3b9645d 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -555,8 +555,6 @@ 強制 GPU 以可能的最大時脈執行 (熱溫限制仍會被套用) GPU 非同步模擬 此修改可透過使用 GPU 非同步模擬來提升性能,不過可能會導致圖形問題且會提高在進行時序相關操作時當機的機率 - 非同步呈現 - 此修改可以透過將渲染移至單獨的 CPU 執行緒來提升性能,但可能會導致圖形問題 使用重新啟用排清 犧牲效能,以改善部分遊戲的轉譯準確度 啟用緩衝區歷史 diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 9b941608a1..025922df8d 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -580,8 +580,6 @@ Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied). GPU async emulation This hack can increase performance by running GPU emulation asynchronously at the cost of graphical issues and increased crash rates by timing-related operations. - Asynchronous presentation - This hack can increase performance by moving presentation to a separate CPU thread at the cost of graphical issues. Use reactive flushing Improves rendering accuracy in some games at the cost of performance. Enable buffer history diff --git a/src/common/settings.h b/src/common/settings.h index d15427187c..10c5042539 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -634,7 +634,7 @@ struct Values { true}; SwitchableSetting async_presentation{linkage, #ifdef __ANDROID__ - false, + true, #else false, #endif From 691b63e79b24e9b44d8d98ef0af6649d4059eda3 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 05:12:09 -0400 Subject: [PATCH 055/198] Quick adjustments on overlapped buffers --- src/video_core/buffer_cache/buffer_cache.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 4c345dd213..3165483388 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1680,6 +1680,11 @@ BufferId BufferCache

::CreateBuffer(DAddr device_addr, u32 wanted_size, wanted_size = static_cast(device_addr_end - device_addr); const OverlapResult overlap = ResolveOverlaps(device_addr, wanted_size); const u32 size = static_cast(overlap.end - overlap.begin); + if constexpr (requires(Buffer& buffer) { buffer.IsSparseCompatible(); }) { + for (const BufferId overlap_id : overlap.ids) { + sparse_compatible |= slot_buffers[overlap_id].IsSparseCompatible(); + } + } const BufferId new_buffer_id = slot_buffers.insert(runtime, overlap.begin, size, sparse_compatible); auto& new_buffer = slot_buffers[new_buffer_id]; From 64a307c6dc6fd25978c7821c4ace708dca601d2a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 05:42:58 -0400 Subject: [PATCH 056/198] Port some changes from Lizzie's optimization with some exceptions --- src/video_core/host_shaders/astc_decoder.comp | 1257 ++++++----------- 1 file changed, 398 insertions(+), 859 deletions(-) diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp index 9a3954ca21..af6fac0e84 100644 --- a/src/video_core/host_shaders/astc_decoder.comp +++ b/src/video_core/host_shaders/astc_decoder.comp @@ -55,6 +55,7 @@ const uint GOB_SIZE_SHIFT = GOB_SIZE_X_SHIFT + GOB_SIZE_Y_SHIFT; const uint BYTES_PER_BLOCK_LOG2 = 4; +// DO NOT CHANGE - code depends on the value of these! const uint JUST_BITS = 0u; const uint QUINT = 1u; const uint TRIT = 2u; @@ -62,27 +63,45 @@ const uint TRIT = 2u; // ASTC Encodings data, sorted in ascending order based on their BitLength value // (see GetBitLength() function) const uint encoding_values[22] = uint[]( - (JUST_BITS), (JUST_BITS | (1u << 8u)), (TRIT), (JUST_BITS | (2u << 8u)), - (QUINT), (TRIT | (1u << 8u)), (JUST_BITS | (3u << 8u)), (QUINT | (1u << 8u)), - (TRIT | (2u << 8u)), (JUST_BITS | (4u << 8u)), (QUINT | (2u << 8u)), (TRIT | (3u << 8u)), - (JUST_BITS | (5u << 8u)), (QUINT | (3u << 8u)), (TRIT | (4u << 8u)), (JUST_BITS | (6u << 8u)), - (QUINT | (4u << 8u)), (TRIT | (5u << 8u)), (JUST_BITS | (7u << 8u)), (QUINT | (5u << 8u)), - (TRIT | (6u << 8u)), (JUST_BITS | (8u << 8u))); + (JUST_BITS), + (JUST_BITS | (1u << 8u)), + (TRIT), + (JUST_BITS | (2u << 8u)), + (QUINT), + (TRIT | (1u << 8u)), + (JUST_BITS | (3u << 8u)), + (QUINT | (1u << 8u)), + (TRIT | (2u << 8u)), + (JUST_BITS | (4u << 8u)), + (QUINT | (2u << 8u)), + (TRIT | (3u << 8u)), + (JUST_BITS | (5u << 8u)), + (QUINT | (3u << 8u)), + (TRIT | (4u << 8u)), + (JUST_BITS | (6u << 8u)), + (QUINT | (4u << 8u)), + (TRIT | (5u << 8u)), + (JUST_BITS | (7u << 8u)), + (QUINT | (5u << 8u)), + (TRIT | (6u << 8u)), + (JUST_BITS | (8u << 8u)) +); // Input ASTC texture globals -int total_bitsread = 0; -uvec4 local_buff; - +uint total_bitsread = 0; // Color data globals uvec4 color_endpoint_data; -int color_bitsread = 0; +uint color_bitsread = 0; +// Global "vector" to be pushed into when decoding +// At most will require BLOCK_WIDTH x BLOCK_HEIGHT in single plane mode +// At most will require BLOCK_WIDTH x BLOCK_HEIGHT x 2 in dual plane mode +// So the maximum would be 144 (12 x 12) elements, x 2 for two planes #define MAX_WEIGHT_VALUES 64 -uint result_vector[MAX_WEIGHT_VALUES]; +uint result_vector[MAX_WEIGHT_VALUES + 1]; int result_index = 0; uint result_vector_max_index; -bool result_limit_reached = false; // EncodingData helpers uint Encoding(EncodingData val) { @@ -118,12 +137,10 @@ EncodingData CreateEncodingData(uint encoding, uint num_bits, uint bit_val, uint void ResultEmplaceBack(EncodingData val) { - if (result_index >= result_vector_max_index) { - // Alert callers to avoid decoding more than needed by this phase - result_limit_reached = true; - return; - } - result_vector[result_index] = val.data; + // A = result_index, B = result_vector_max_index + // A >= B -> A - B >= 0 + // A < B -> A - B < 0 + result_vector[min(uint(MAX_WEIGHT_VALUES), result_index)] = val.data; ++result_index; } @@ -139,60 +156,31 @@ uint ReplicateBitTo9(uint value) { return value * 511; } -uint ReplicateBits(uint value, uint num_bits, uint to_bit) { - if (value == 0 || num_bits == 0) { - return 0; - } - if (num_bits >= to_bit) { - return value; - } - const uint v = value & uint((1 << num_bits) - 1); - uint res = v; - uint reslen = num_bits; - while (reslen < to_bit) { - const uint num_dst_bits_to_shift_up = min(num_bits, to_bit - reslen); - const uint num_src_bits_to_shift_down = num_bits - num_dst_bits_to_shift_up; - - res <<= num_dst_bits_to_shift_up; - res |= (v >> num_src_bits_to_shift_down); - reslen += num_bits; - } - return res; +const uint mod6_table = 0 + | ((6 % 1) << (2 * 1)) | ((6 % 2) << (2 * 2)) + | ((6 % 3) << (2 * 3)) | ((6 % 4) << (2 * 4)) + | ((6 % 5) << (2 * 5)) | ((6 % 6) << (2 * 6)); +const uint mod8_table = 0 + | ((8 % 1) << (2 * 1)) | ((8 % 2) << (2 * 2)) + | ((8 % 3) << (2 * 3)) | ((8 % 4) << (2 * 4)) + | ((8 % 5) << (2 * 5)) | ((8 % 6) << (2 * 6)) + | ((8 % 7) << (2 * 7)) | ((8 % 8) << (2 * 8)); +// Assumes num_bits < to_bit, num_bits and to_bit != 0 +uint ReplicateBits(uint value, uint num_bits, uint to_bit, uint table) { + const uint repl = value & ((1 << num_bits) - 1); + const uint shift = (table >> (num_bits << 1)) & 3; + uint v = repl; + v |= v << (num_bits << 0); // [ xxxx xxrr ] + v |= v << (num_bits << 1); // [ xxxx rrrr ] + v |= v << (num_bits << 2); // [ rrrr rrrr ] + v = (v << shift) | repl >> (num_bits - shift); + return v & ((1 << to_bit) - 1); } - uint FastReplicateTo8(uint value, uint num_bits) { - return ReplicateBits(value, num_bits, 8); + return ReplicateBits(value, num_bits, 8, mod8_table); } - -const uint REPLICATE_TO_6_ODD_HALVES = ((63u >> 1u) << 5u) | ((21u >> 1u) << 10u) | - ((9u >> 1u) << 15u) | ((17u >> 1u) << 20u) | - ((33u >> 1u) << 25u); -const uint REPLICATE_TO_6_SHIFTS = (2u << 16u) | (4u << 20u); - uint FastReplicateTo6(uint value, uint num_bits) { - if (num_bits >= 6u) { - return value; - } - const uint v = value & ((1u << num_bits) - 1u); - const uint c = ((REPLICATE_TO_6_ODD_HALVES >> (num_bits * 5u)) & 0x1fu) * 2u + 1u; - const uint s = (REPLICATE_TO_6_SHIFTS >> (num_bits * 4u)) & 0xfu; - return (v * c) >> s; -} - -uint Div3Floor(uint v) { - return (v * 0x5556) >> 16; -} - -uint Div3Ceil(uint v) { - return Div3Floor(v + 2); -} - -uint Div5Floor(uint v) { - return (v * 0x3334) >> 16; -} - -uint Div5Ceil(uint v) { - return Div5Floor(v + 4); + return ReplicateBits(value, num_bits, 6, mod6_table); } uint Hash52(uint p) { @@ -209,144 +197,85 @@ uint Hash52(uint p) { return p; } -uint Select2DPartition(uint seed, uint x, uint y, uint partition_count) { - if ((block_dims.y * block_dims.x) < 32) { - x <<= 1; - y <<= 1; - } - +uint Select2DPartition(uint seed, uvec2 pos, uint partition_count) { + pos <<= uint(block_dims.y * block_dims.x < 32); seed += (partition_count - 1) * 1024; - const uint rnum = Hash52(uint(seed)); - uint seed1 = uint(rnum & 0xF); - uint seed2 = uint((rnum >> 4) & 0xF); - uint seed3 = uint((rnum >> 8) & 0xF); - uint seed4 = uint((rnum >> 12) & 0xF); - uint seed5 = uint((rnum >> 16) & 0xF); - uint seed6 = uint((rnum >> 20) & 0xF); - uint seed7 = uint((rnum >> 24) & 0xF); - uint seed8 = uint((rnum >> 28) & 0xF); - - seed1 = (seed1 * seed1); - seed2 = (seed2 * seed2); - seed3 = (seed3 * seed3); - seed4 = (seed4 * seed4); - seed5 = (seed5 * seed5); - seed6 = (seed6 * seed6); - seed7 = (seed7 * seed7); - seed8 = (seed8 * seed8); - - uint sh1, sh2; - if ((seed & 1) > 0) { - sh1 = (seed & 2) > 0 ? 4 : 5; - sh2 = (partition_count == 3) ? 6 : 5; - } else { - sh1 = (partition_count == 3) ? 6 : 5; - sh2 = (seed & 2) > 0 ? 4 : 5; - } - seed1 >>= sh1; - seed2 >>= sh2; - seed3 >>= sh1; - seed4 >>= sh2; - seed5 >>= sh1; - seed6 >>= sh2; - seed7 >>= sh1; - seed8 >>= sh2; - - uint a = seed1 * x + seed2 * y + (rnum >> 14); - uint b = seed3 * x + seed4 * y + (rnum >> 10); - uint c = seed5 * x + seed6 * y + (rnum >> 6); - uint d = seed7 * x + seed8 * y + (rnum >> 2); - - a &= 0x3F; - b &= 0x3F; - c &= 0x3F; - d &= 0x3F; - - if (partition_count < 4) { - d = 0; - } - if (partition_count < 3) { - c = 0; - } - - if (a >= b && a >= c && a >= d) { + uvec2 shift = uvec2( + (seed & 2) > 0 ? 4 : 5, + (partition_count == 3) ? 6 : 5 + ); + shift.xy = (seed & 1) > 0 ? shift.xy : shift.yx; + uvec4 rseed[2] = uvec4[]( + (uvec4(rnum) >> uvec4(0, 4, 8, 12)) & 0xf, + (uvec4(rnum) >> uvec4(16, 20, 24, 28)) & 0xf + ); + rseed[0] = (rseed[0] * rseed[0]) >> shift.xyxy; + rseed[1] = (rseed[1] * rseed[1]) >> shift.xyxy; + const uvec4 rnum_vec = uvec4(rnum) >> uvec4(14, 10, 6, 2); + const uvec4 result_mask = ((uvec4(0, 1, 2, 3) - partition_count) >> 8) & 0x3f; + uvec4 result = uvec4( + rseed[0].xz * pos.xx + rseed[0].yw * pos.yy + rnum_vec.xy, + rseed[1].xz * pos.xx + rseed[1].yw * pos.yy + rnum_vec.zw + ) & result_mask; + if (result.x >= result.y && result.x >= result.z && result.x >= result.w) { return 0; - } else if (b >= c && b >= d) { + } else if (result.y >= result.z && result.y >= result.w) { return 1; - } else if (c >= d) { + } else if (result.z >= result.w) { return 2; } else { return 3; } } -uint ExtractBits(uvec4 payload, int offset, int bits) { - if (bits <= 0) { +uint ExtractBits(uvec4 payload, uint offset, uint bits) { + if (bits == 0 || bits > 32 || offset >= 128) return 0; - } - if (bits > 32) { - return 0; - } - if (offset >= 128) { - return 0; - } - const int avail_bits = min(bits, 128 - offset); - const int last_offset = offset + avail_bits - 1; - const int shifted_offset = offset >> 5; - if ((last_offset >> 5) == shifted_offset) { - return bitfieldExtract(payload[shifted_offset], offset & 31, avail_bits); - } - const int first_bits = 32 - (offset & 31); - const int result_first = int(bitfieldExtract(payload[shifted_offset], offset & 31, first_bits)); - const int result_second = - int(bitfieldExtract(payload[shifted_offset + 1], 0, avail_bits - first_bits)); - return result_first | (result_second << first_bits); + const uint avail_bits = min(bits, 128 - offset); + const uint last_offset = offset + avail_bits - 1; + const uint shifted_offset = offset >> 5; + if ((last_offset >> 5) == shifted_offset) + return bitfieldExtract(payload[shifted_offset], int(offset & 31), int(avail_bits)); + const uint first_bits = 32 - (offset & 31); + const uvec4 next = uvec4(payload.yzw, 0); + return bitfieldExtract(payload[shifted_offset], int(offset & 31), int(first_bits)) + | (bitfieldExtract(next[shifted_offset], 0, int(avail_bits - first_bits)) << first_bits); } -uint StreamBits(uint num_bits) { - const int int_bits = int(num_bits); - const uint ret = ExtractBits(local_buff, total_bitsread, int_bits); - total_bitsread += int_bits; +uint StreamBits(uvec4 local_buff, uint num_bits) { + const uint ret = ExtractBits(local_buff, total_bitsread, num_bits); + total_bitsread += num_bits; return ret; } void SkipBits(uint num_bits) { - const int int_bits = int(num_bits); - total_bitsread += int_bits; + total_bitsread += num_bits; } uint StreamColorBits(uint num_bits) { - const int int_bits = int(num_bits); - const uint ret = ExtractBits(color_endpoint_data, color_bitsread, int_bits); - color_bitsread += int_bits; + const uint ret = ExtractBits(color_endpoint_data, color_bitsread, num_bits); + color_bitsread += num_bits; return ret; } -EncodingData GetEncodingFromVector(uint index) { - const uint data = result_vector[index]; - return EncodingData(data); -} - // Returns the number of bits required to encode n_vals values. uint GetBitLength(uint n_vals, uint encoding_index) { + // uint Div3Floor(uint v) { return (v * 0x5556) >> 16; } + // uint Div3Ceil(uint v) { return Div3Floor(v + 2); } + // uint Div5Floor(uint v) { return (v * 0x3334) >> 16; } + // uint Div5Ceil(uint v) { return Div5Floor(v + 4); } const EncodingData encoding_value = EncodingData(encoding_values[encoding_index]); const uint encoding = Encoding(encoding_value); - uint total_bits = NumBits(encoding_value) * n_vals; - if (encoding == TRIT) { - total_bits += Div5Ceil(n_vals * 8); - } else if (encoding == QUINT) { - total_bits += Div3Ceil(n_vals * 7); - } - return total_bits; + const uint num_bits = NumBits(encoding_value); + const uvec3 div_constant = uvec3(0, 0x5556, 0x3334); + return num_bits * n_vals + + ((((n_vals * ((0x870 >> (encoding << 2)) & 0xf)) + ((0x420 >> (encoding << 2)) & 0xf)) + * div_constant[encoding]) >> 16); } uint GetNumWeightValues(uvec2 size, bool dual_plane) { - uint n_vals = size.x * size.y; - if (dual_plane) { - n_vals *= 2; - } - return n_vals; + return (size.x * size.y) << uint(dual_plane); } uint GetPackedBitSize(uvec2 size, bool dual_plane, uint max_weight) { @@ -375,13 +304,16 @@ void DecodeQuintBlock(uint num_bits) { if (BitsOp(qQ.w, 1, 2) == 3 && BitsOp(qQ.w, 5, 6) == 0) { qQ.x = 4; qQ.y = 4; - qQ.z = (BitsBracket(qQ.w, 0) << 2) | ((BitsBracket(qQ.w, 4) & ~BitsBracket(qQ.w, 0)) << 1) | - (BitsBracket(qQ.w, 3) & ~BitsBracket(qQ.w, 0)); + qQ.z = (BitsBracket(qQ.w, 0) << 2) + | ((BitsBracket(qQ.w, 4) & ~BitsBracket(qQ.w, 0)) << 1) + | (BitsBracket(qQ.w, 3) & ~BitsBracket(qQ.w, 0)); } else { uint C = 0; if (BitsOp(qQ.w, 1, 2) == 3) { qQ.z = 4; - C = (BitsOp(qQ.w, 3, 4) << 3) | ((~BitsOp(qQ.w, 5, 6) & 3) << 1) | BitsBracket(qQ.w, 0); + C = (BitsOp(qQ.w, 3, 4) << 3) + | ((~BitsOp(qQ.w, 5, 6) & 3) << 1) + | BitsBracket(qQ.w, 0); } else { qQ.z = BitsOp(qQ.w, 5, 6); C = BitsOp(qQ.w, 0, 4); @@ -394,39 +326,37 @@ void DecodeQuintBlock(uint num_bits) { qQ.x = BitsOp(C, 0, 2); } } - for (uint i = 0; i < 3; i++) { - const EncodingData val = CreateEncodingData(QUINT, num_bits, m[i], qQ[i]); - ResultEmplaceBack(val); - } + for (uint i = 0; i < 3; i++) + ResultEmplaceBack(CreateEncodingData(QUINT, num_bits, m[i], qQ[i])); } void DecodeTritBlock(uint num_bits) { uvec4 m; uvec4 t; - uvec3 Tm5t5; + uvec3 tm5t5; m[0] = StreamColorBits(num_bits); - Tm5t5.x = StreamColorBits(2); + tm5t5.x = StreamColorBits(2); m[1] = StreamColorBits(num_bits); - Tm5t5.x |= StreamColorBits(2) << 2; + tm5t5.x |= StreamColorBits(2) << 2; m[2] = StreamColorBits(num_bits); - Tm5t5.x |= StreamColorBits(1) << 4; + tm5t5.x |= StreamColorBits(1) << 4; m[3] = StreamColorBits(num_bits); - Tm5t5.x |= StreamColorBits(2) << 5; - Tm5t5.y = StreamColorBits(num_bits); - Tm5t5.x |= StreamColorBits(1) << 7; + tm5t5.x |= StreamColorBits(2) << 5; + tm5t5.y = StreamColorBits(num_bits); + tm5t5.x |= StreamColorBits(1) << 7; uint C = 0; - if (BitsOp(Tm5t5.x, 2, 4) == 7) { - C = (BitsOp(Tm5t5.x, 5, 7) << 2) | BitsOp(Tm5t5.x, 0, 1); - Tm5t5.z = 2; + if (BitsOp(tm5t5.x, 2, 4) == 7) { + C = (BitsOp(tm5t5.x, 5, 7) << 2) | BitsOp(tm5t5.x, 0, 1); + tm5t5.z = 2; t[3] = 2; } else { - C = BitsOp(Tm5t5.x, 0, 4); - if (BitsOp(Tm5t5.x, 5, 6) == 3) { - Tm5t5.z = 2; - t[3] = BitsBracket(Tm5t5.x, 7); + C = BitsOp(tm5t5.x, 0, 4); + if (BitsOp(tm5t5.x, 5, 6) == 3) { + tm5t5.z = 2; + t[3] = BitsBracket(tm5t5.x, 7); } else { - Tm5t5.z = BitsBracket(Tm5t5.x, 7); - t[3] = BitsOp(Tm5t5.x, 5, 6); + tm5t5.z = BitsBracket(tm5t5.x, 7); + t[3] = BitsOp(tm5t5.x, 5, 6); } } if (BitsOp(C, 0, 1) == 3) { @@ -442,156 +372,147 @@ void DecodeTritBlock(uint num_bits) { t[1] = BitsOp(C, 2, 3); t[0] = (BitsBracket(C, 1) << 1) | (BitsBracket(C, 0) & ~BitsBracket(C, 1)); } - for (uint i = 0; i < 4; i++) { - const EncodingData val = CreateEncodingData(TRIT, num_bits, m[i], t[i]); - ResultEmplaceBack(val); - } - const EncodingData val = CreateEncodingData(TRIT, num_bits, Tm5t5.y, Tm5t5.z); - ResultEmplaceBack(val); + for (uint i = 0; i < 4; i++) + ResultEmplaceBack(CreateEncodingData(TRIT, num_bits, m[i], t[i])); + ResultEmplaceBack(CreateEncodingData(TRIT, num_bits, tm5t5.y, tm5t5.z)); } void DecodeIntegerSequence(uint max_range, uint num_values) { EncodingData val = EncodingData(encoding_values[max_range]); const uint encoding = Encoding(val); const uint num_bits = NumBits(val); - uint vals_decoded = 0; - while (vals_decoded < num_values && !result_limit_reached) { + for (uint i = 0; i < num_values && result_index < result_vector_max_index; ) { switch (encoding) { case QUINT: DecodeQuintBlock(num_bits); - vals_decoded += 3; + i += 3; break; case TRIT: DecodeTritBlock(num_bits); - vals_decoded += 5; + i += 5; break; case JUST_BITS: BitValue(val, StreamColorBits(num_bits)); ResultEmplaceBack(val); - vals_decoded++; + i++; break; } } } -void DecodeColorValues(uvec4 modes, uint num_partitions, uint color_data_bits, out uint color_values[32]) { - uint num_values = 0; - for (uint i = 0; i < num_partitions; i++) { - num_values += ((modes[i] >> 2) + 1) << 1; +uint DecodeSingleColorValue(EncodingData val) { + const uint encoding = Encoding(val); + const uint bitlen = NumBits(val); + const uint bitval = BitValue(val); + uint B = 0, C = 0, D = 0; + uint A = ReplicateBitTo9((bitval & 1)); + switch (encoding) { + case JUST_BITS: + break; + case TRIT: { + D = QuintTritValue(val); + switch (bitlen) { + case 1: + C = 204; + break; + case 2: { + C = 93; + const uint b = (bitval >> 1) & 1; + B = (b << 8) | (b << 4) | (b << 2) | (b << 1); + break; + } + case 3: { + C = 44; + const uint cb = (bitval >> 1) & 3; + B = (cb << 7) | (cb << 2) | cb; + break; + } + case 4: { + C = 22; + const uint dcb = (bitval >> 1) & 7; + B = (dcb << 6) | dcb; + break; + } + case 5: { + C = 11; + const uint edcb = (bitval >> 1) & 0xF; + B = (edcb << 5) | (edcb >> 2); + break; + } + case 6: { + C = 5; + const uint fedcb = (bitval >> 1) & 0x1F; + B = (fedcb << 4) | (fedcb >> 4); + break; + } + } + break; } + case QUINT: { + D = QuintTritValue(val); + switch (bitlen) { + case 1: + C = 113; + break; + case 2: { + C = 54; + const uint b = (bitval >> 1) & 1; + B = (b << 8) | (b << 3) | (b << 2); + break; + } + case 3: { + C = 26; + const uint cb = (bitval >> 1) & 3; + B = (cb << 7) | (cb << 1) | (cb >> 1); + break; + } + case 4: { + C = 13; + const uint dcb = (bitval >> 1) & 7; + B = (dcb << 6) | (dcb >> 1); + break; + } + case 5: { + C = 6; + const uint edcb = (bitval >> 1) & 0xF; + B = (edcb << 5) | (edcb >> 3); + break; + } + } + break; + } + } + uint unq = D * C + B; + unq = unq ^ A; + unq = (A & 0x80) | (unq >> 2); + return encoding == JUST_BITS ? FastReplicateTo8(bitval, bitlen) : unq; +} + +void DecodeColorValues(uvec4 modes, uint num_partitions, uint color_data_bits, out uint color_values[32]) { + // TODO: modes[] zero on invalid, so less ops + const uvec4 num_values_tmp = (((modes >> 2) + 1) << 1) & ((uvec4(0, 1, 2, 3) - num_partitions) >> 8); + uint num_values = num_values_tmp.x + num_values_tmp.y + num_values_tmp.z + num_values_tmp.w; // Find the largest encoding that's within color_data_bits // TODO(ameerj): profile with binary search - int range = 0; + uint range = 0; while (++range < encoding_values.length()) { - const uint bit_length = GetBitLength(num_values, range); + const uint bit_length = GetBitLength(num_values, int(range)); if (bit_length > color_data_bits) { break; } } + const uint upper_bound = num_values; DecodeIntegerSequence(range - 1, num_values); - uint out_index = 0; - for (int itr = 0; itr < result_index; ++itr) { - if (out_index >= num_values) { - break; - } - const EncodingData val = GetEncodingFromVector(itr); - const uint encoding = Encoding(val); - const uint bitlen = NumBits(val); - const uint bitval = BitValue(val); - uint A = 0, B = 0, C = 0, D = 0; - A = ReplicateBitTo9((bitval & 1)); - switch (encoding) { - case JUST_BITS: - color_values[out_index++] = FastReplicateTo8(bitval, bitlen); - break; - case TRIT: { - D = QuintTritValue(val); - switch (bitlen) { - case 1: - C = 204; - break; - case 2: { - C = 93; - const uint b = (bitval >> 1) & 1; - B = (b << 8) | (b << 4) | (b << 2) | (b << 1); - break; - } - case 3: { - C = 44; - const uint cb = (bitval >> 1) & 3; - B = (cb << 7) | (cb << 2) | cb; - break; - } - case 4: { - C = 22; - const uint dcb = (bitval >> 1) & 7; - B = (dcb << 6) | dcb; - break; - } - case 5: { - C = 11; - const uint edcb = (bitval >> 1) & 0xF; - B = (edcb << 5) | (edcb >> 2); - break; - } - case 6: { - C = 5; - const uint fedcb = (bitval >> 1) & 0x1F; - B = (fedcb << 4) | (fedcb >> 4); - break; - } - } - break; - } - case QUINT: { - D = QuintTritValue(val); - switch (bitlen) { - case 1: - C = 113; - break; - case 2: { - C = 54; - const uint b = (bitval >> 1) & 1; - B = (b << 8) | (b << 3) | (b << 2); - break; - } - case 3: { - C = 26; - const uint cb = (bitval >> 1) & 3; - B = (cb << 7) | (cb << 1) | (cb >> 1); - break; - } - case 4: { - C = 13; - const uint dcb = (bitval >> 1) & 7; - B = (dcb << 6) | (dcb >> 1); - break; - } - case 5: { - C = 6; - const uint edcb = (bitval >> 1) & 0xF; - B = (edcb << 5) | (edcb >> 3); - break; - } - } - break; - } - } - if (encoding != JUST_BITS) { - uint T = (D * C) + B; - T ^= A; - T = (A & 0x80) | (T >> 2); - color_values[out_index++] = T; - } + for (int i = 0; i < upper_bound; ++i) { + color_values[i + 1] = DecodeSingleColorValue(EncodingData(result_vector[i])); } } ivec2 BitTransferSigned(int a, int b) { - ivec2 transferred; - transferred.y = b >> 1; - transferred.y |= a & 0x80; - transferred.x = a >> 1; - transferred.x &= 0x3F; + ivec2 transferred = ivec2( + (a >> 1) & 0x3F, + (b >> 1) | (a & 0x80) + ); if ((transferred.x & 0x20) > 0) { transferred.x -= 0x40; } @@ -606,169 +527,17 @@ ivec4 BlueContract(int a, int r, int g, int b) { return ivec4(a, (r + b) >> 1, (g + b) >> 1, b); } -bool IsHDRColorEndpointMode(uint cem) { - return cem == 2u || cem == 3u || cem == 7u || cem == 11u || cem == 14u || cem == 15u; -} - -int SignExtend(int value, uint nbits) { - int sign_bit = 1 << (nbits - 1u); - return (value ^ sign_bit) - sign_bit; -} - -void DecodeHDREndpointMode7(uint v0, uint v1, uint v2, uint v3, out ivec3 e0, out ivec3 e1) { - uint modeval = ((v0 & 0xC0u) >> 6u) | ((v1 & 0x80u) >> 5u) | ((v2 & 0x80u) >> 4u); - - uint majcomp; - uint mode; - if ((modeval & 0xCu) != 0xCu) { - majcomp = modeval >> 2u; - mode = modeval & 3u; - } else if (modeval != 0xFu) { - majcomp = modeval & 3u; - mode = 4u; - } else { - majcomp = 0u; - mode = 5u; - } - - int red = int(v0 & 0x3Fu); - int green = int(v1 & 0x1Fu); - int blue = int(v2 & 0x1Fu); - int scale = int(v3 & 0x1Fu); - - uint x0 = (v1 >> 6u) & 1u; - uint x1 = (v1 >> 5u) & 1u; - uint x2 = (v2 >> 6u) & 1u; - uint x3 = (v2 >> 5u) & 1u; - uint x4 = (v3 >> 7u) & 1u; - uint x5 = (v3 >> 6u) & 1u; - uint x6 = (v3 >> 5u) & 1u; - - uint ohm = 1u << mode; - if ((ohm & 0x30u) != 0u) green |= int(x0 << 6u); - if ((ohm & 0x3Au) != 0u) green |= int(x1 << 5u); - if ((ohm & 0x30u) != 0u) blue |= int(x2 << 6u); - if ((ohm & 0x3Au) != 0u) blue |= int(x3 << 5u); - if ((ohm & 0x3Du) != 0u) scale |= int(x6 << 5u); - if ((ohm & 0x2Du) != 0u) scale |= int(x5 << 6u); - if ((ohm & 0x04u) != 0u) scale |= int(x4 << 7u); - if ((ohm & 0x3Bu) != 0u) red |= int(x4 << 6u); - if ((ohm & 0x04u) != 0u) red |= int(x3 << 6u); - if ((ohm & 0x10u) != 0u) red |= int(x5 << 7u); - if ((ohm & 0x0Fu) != 0u) red |= int(x2 << 7u); - if ((ohm & 0x05u) != 0u) red |= int(x1 << 8u); - if ((ohm & 0x0Au) != 0u) red |= int(x0 << 8u); - if ((ohm & 0x05u) != 0u) red |= int(x0 << 9u); - if ((ohm & 0x02u) != 0u) red |= int(x6 << 9u); - if ((ohm & 0x01u) != 0u) red |= int(x3 << 10u); - if ((ohm & 0x02u) != 0u) red |= int(x5 << 10u); - - int shamts[6] = int[](1, 1, 2, 3, 4, 5); - int shamt = shamts[mode]; - red <<= shamt; - green <<= shamt; - blue <<= shamt; - scale <<= shamt; - - if (mode != 5u) { - green = red - green; - blue = red - blue; - } - - if (majcomp == 1u) { - int t = red; red = green; green = t; - } - if (majcomp == 2u) { - int t = red; red = blue; blue = t; - } - - e1 = ivec3(clamp(red, 0, 0xFFF), clamp(green, 0, 0xFFF), clamp(blue, 0, 0xFFF)); - e0 = ivec3(clamp(red - scale, 0, 0xFFF), clamp(green - scale, 0, 0xFFF), - clamp(blue - scale, 0, 0xFFF)); -} - -void DecodeHDREndpointMode11(uint v0, uint v1, uint v2, uint v3, uint v4, uint v5, out ivec3 e0, - out ivec3 e1) { - uint majcomp = ((v4 & 0x80u) >> 7u) | ((v5 & 0x80u) >> 6u); - if (majcomp == 3u) { - e0 = ivec3(int(v0 << 4u), int(v2 << 4u), int((v4 & 0x7Fu) << 5u)); - e1 = ivec3(int(v1 << 4u), int(v3 << 4u), int((v5 & 0x7Fu) << 5u)); - return; - } - - uint mode = ((v1 & 0x80u) >> 7u) | ((v2 & 0x80u) >> 6u) | ((v3 & 0x80u) >> 5u); - int va = int(v0 | ((v1 & 0x40u) << 2u)); - int vb0 = int(v2 & 0x3Fu); - int vb1 = int(v3 & 0x3Fu); - int vc = int(v1 & 0x3Fu); - int vd0 = int(v4 & 0x7Fu); - int vd1 = int(v5 & 0x7Fu); - - int dbitstab[8] = int[](7, 6, 7, 6, 5, 6, 5, 6); - vd0 = SignExtend(vd0, uint(dbitstab[mode])); - vd1 = SignExtend(vd1, uint(dbitstab[mode])); - - uint x0 = (v2 >> 6u) & 1u; - uint x1 = (v3 >> 6u) & 1u; - uint x2 = (v4 >> 6u) & 1u; - uint x3 = (v5 >> 6u) & 1u; - uint x4 = (v4 >> 5u) & 1u; - uint x5 = (v5 >> 5u) & 1u; - - uint ohm = 1u << mode; - if ((ohm & 0xA4u) != 0u) va |= int(x0 << 9u); - if ((ohm & 0x08u) != 0u) va |= int(x2 << 9u); - if ((ohm & 0x50u) != 0u) va |= int(x4 << 9u); - if ((ohm & 0x50u) != 0u) va |= int(x5 << 10u); - if ((ohm & 0xA0u) != 0u) va |= int(x1 << 10u); - if ((ohm & 0xC0u) != 0u) va |= int(x2 << 11u); - if ((ohm & 0x04u) != 0u) vc |= int(x1 << 6u); - if ((ohm & 0xE8u) != 0u) vc |= int(x3 << 6u); - if ((ohm & 0x20u) != 0u) vc |= int(x2 << 7u); - if ((ohm & 0x5Bu) != 0u) vb0 |= int(x0 << 6u); - if ((ohm & 0x5Bu) != 0u) vb1 |= int(x1 << 6u); - if ((ohm & 0x12u) != 0u) vb0 |= int(x2 << 7u); - if ((ohm & 0x12u) != 0u) vb1 |= int(x3 << 7u); - - int shamt = (int(mode) >> 1) ^ 3; - va <<= shamt; - vb0 <<= shamt; - vb1 <<= shamt; - vc <<= shamt; - vd0 <<= shamt; - vd1 <<= shamt; - - int r1 = clamp(va, 0, 0xFFF); - int g1 = clamp(va - vb0, 0, 0xFFF); - int b1 = clamp(va - vb1, 0, 0xFFF); - int r0 = clamp(va - vc, 0, 0xFFF); - int g0 = clamp(va - vb0 - vc - vd0, 0, 0xFFF); - int b0 = clamp(va - vb1 - vc - vd1, 0, 0xFFF); - - if (majcomp == 1u) { - int t; - t = r0; r0 = g0; g0 = t; - t = r1; r1 = g1; g1 = t; - } else if (majcomp == 2u) { - int t; - t = r0; r0 = b0; b0 = t; - t = r1; r1 = b1; b1 = t; - } - e0 = ivec3(r0, g0, b0); - e1 = ivec3(r1, g1, b1); -} - void ComputeEndpoints(out uvec4 ep1, out uvec4 ep2, uint color_endpoint_mode, uint color_values[32], inout uint colvals_index) { #define READ_UINT_VALUES(N) \ uvec4 V[2]; \ for (uint i = 0; i < N; i++) { \ - V[i / 4][i % 4] = color_values[colvals_index++]; \ + V[i >> 2][i & 3] = color_values[++colvals_index]; \ } #define READ_INT_VALUES(N) \ ivec4 V[2]; \ for (uint i = 0; i < N; i++) { \ - V[i / 4][i % 4] = int(color_values[colvals_index++]); \ + V[i >> 2][i & 3] = int(color_values[++colvals_index]); \ } switch (color_endpoint_mode) { @@ -794,12 +563,8 @@ void ComputeEndpoints(out uvec4 ep1, out uvec4 ep2, uint color_endpoint_mode, ui } case 5: { READ_INT_VALUES(4) - ivec2 transferred = BitTransferSigned(V[0].y, V[0].x); - V[0].y = transferred.x; - V[0].x = transferred.y; - transferred = BitTransferSigned(V[0].w, V[0].z); - V[0].w = transferred.x; - V[0].z = transferred.y; + V[0].yx = BitTransferSigned(V[0].y, V[0].x); + V[0].wz = BitTransferSigned(V[0].w, V[0].z); ep1 = ClampByte(ivec4(V[0].z, V[0].x, V[0].x, V[0].x)); ep2 = ClampByte(ivec4(V[0].z + V[0].w, V[0].x + V[0].y, V[0].x + V[0].y, V[0].x + V[0].y)); break; @@ -823,15 +588,9 @@ void ComputeEndpoints(out uvec4 ep1, out uvec4 ep2, uint color_endpoint_mode, ui } case 9: { READ_INT_VALUES(6) - ivec2 transferred = BitTransferSigned(V[0].y, V[0].x); - V[0].y = transferred.x; - V[0].x = transferred.y; - transferred = BitTransferSigned(V[0].w, V[0].z); - V[0].w = transferred.x; - V[0].z = transferred.y; - transferred = BitTransferSigned(V[1].y, V[1].x); - V[1].y = transferred.x; - V[1].x = transferred.y; + V[0].yx = BitTransferSigned(V[0].y, V[0].x); + V[0].wz = BitTransferSigned(V[0].w, V[0].z); + V[1].yx = BitTransferSigned(V[1].y, V[1].x); if ((V[0].y + V[0].w + V[1].y) >= 0) { ep1 = ClampByte(ivec4(0xFF, V[0].x, V[0].z, V[1].x)); ep2 = ClampByte(ivec4(0xFF, V[0].x + V[0].y, V[0].z + V[0].w, V[1].x + V[1].y)); @@ -860,21 +619,10 @@ void ComputeEndpoints(out uvec4 ep1, out uvec4 ep2, uint color_endpoint_mode, ui } case 13: { READ_INT_VALUES(8) - ivec2 transferred = BitTransferSigned(V[0].y, V[0].x); - V[0].y = transferred.x; - V[0].x = transferred.y; - transferred = BitTransferSigned(V[0].w, V[0].z); - V[0].w = transferred.x; - V[0].z = transferred.y; - - transferred = BitTransferSigned(V[1].y, V[1].x); - V[1].y = transferred.x; - V[1].x = transferred.y; - - transferred = BitTransferSigned(V[1].w, V[1].z); - V[1].w = transferred.x; - V[1].z = transferred.y; - + V[0].yx = BitTransferSigned(V[0].y, V[0].x); + V[0].wz = BitTransferSigned(V[0].w, V[0].z); + V[1].yx = BitTransferSigned(V[1].y, V[1].x); + V[1].wz = BitTransferSigned(V[1].w, V[1].z); if ((V[0].y + V[0].w + V[1].y) >= 0) { ep1 = ClampByte(ivec4(V[1].z, V[0].x, V[0].z, V[1].x)); ep2 = ClampByte(ivec4(V[1].w + V[1].z, V[0].x + V[0].y, V[0].z + V[0].w, V[1].x + V[1].y)); @@ -884,86 +632,8 @@ void ComputeEndpoints(out uvec4 ep1, out uvec4 ep2, uint color_endpoint_mode, ui } break; } - case 2: { - READ_UINT_VALUES(2) - uint y0, y1; - if (V[0].y >= V[0].x) { - y0 = V[0].x << 4u; - y1 = V[0].y << 4u; - } else { - y0 = (V[0].y << 4u) + 8u; - y1 = (V[0].x << 4u) - 8u; - } - ep1 = uvec4(0x780u, y0, y0, y0); - ep2 = uvec4(0x780u, y1, y1, y1); - break; - } - case 3: { - READ_UINT_VALUES(2) - uint y0, d; - if ((V[0].x & 0x80u) != 0u) { - y0 = ((V[0].y & 0xE0u) << 4u) | ((V[0].x & 0x7Fu) << 2u); - d = (V[0].y & 0x1Fu) << 2u; - } else { - y0 = ((V[0].y & 0xF0u) << 4u) | ((V[0].x & 0x7Fu) << 1u); - d = (V[0].y & 0x0Fu) << 1u; - } - const uint y1 = min(y0 + d, 0xFFFu); - ep1 = uvec4(0x780u, y0, y0, y0); - ep2 = uvec4(0x780u, y1, y1, y1); - break; - } - case 7: { - READ_UINT_VALUES(4) - ivec3 e0, e1; - DecodeHDREndpointMode7(V[0].x, V[0].y, V[0].z, V[0].w, e0, e1); - ep1 = uvec4(0x780u, uint(e0.x), uint(e0.y), uint(e0.z)); - ep2 = uvec4(0x780u, uint(e1.x), uint(e1.y), uint(e1.z)); - break; - } - case 11: { - READ_UINT_VALUES(6) - ivec3 e0, e1; - DecodeHDREndpointMode11(V[0].x, V[0].y, V[0].z, V[0].w, V[1].x, V[1].y, e0, e1); - ep1 = uvec4(0x780u, uint(e0.x), uint(e0.y), uint(e0.z)); - ep2 = uvec4(0x780u, uint(e1.x), uint(e1.y), uint(e1.z)); - break; - } - case 14: { - READ_UINT_VALUES(8) - ivec3 e0, e1; - DecodeHDREndpointMode11(V[0].x, V[0].y, V[0].z, V[0].w, V[1].x, V[1].y, e0, e1); - ep1 = uvec4(V[1].z, uint(e0.x), uint(e0.y), uint(e0.z)); - ep2 = uvec4(V[1].w, uint(e1.x), uint(e1.y), uint(e1.z)); - break; - } - case 15: { - READ_UINT_VALUES(8) - ivec3 e0, e1; - DecodeHDREndpointMode11(V[0].x, V[0].y, V[0].z, V[0].w, V[1].x, V[1].y, e0, e1); - const uint mode = ((V[1].z >> 7u) & 1u) | ((V[1].w >> 6u) & 2u); - int a6 = int(V[1].z & 0x7Fu); - int a7 = int(V[1].w & 0x7Fu); - int alpha0, alpha1; - if (mode == 3u) { - alpha0 = a6 << 5; - alpha1 = a7 << 5; - } else { - a6 |= (a7 << int(mode + 1u)) & 0x780; - a7 &= int(0x3Fu >> mode); - a7 ^= int(0x20u >> mode); - a7 -= int(0x20u >> mode); - a6 <<= int(4u - mode); - a7 <<= int(4u - mode); - a7 += a6; - alpha0 = a6; - alpha1 = clamp(a7, 0, 0xFFF); - } - ep1 = uvec4(uint(alpha0), uint(e0.x), uint(e0.y), uint(e0.z)); - ep2 = uvec4(uint(alpha1), uint(e1.x), uint(e1.y), uint(e1.z)); - break; - } default: { + // HDR mode, or more likely a bug computing the color_endpoint_mode ep1 = uvec4(0xFF, 0xFF, 0, 0); ep2 = uvec4(0xFF, 0xFF, 0, 0); break; @@ -974,149 +644,84 @@ void ComputeEndpoints(out uvec4 ep1, out uvec4 ep2, uint color_endpoint_mode, ui } uint UnquantizeTexelWeight(EncodingData val) { - const uint encoding = Encoding(val); - const uint bitlen = NumBits(val); - const uint bitval = BitValue(val); - const uint A = ReplicateBitTo7(bitval & 1u); - uint result = 0; + uint encoding = Encoding(val), bitlen = NumBits(val), bitval = BitValue(val); if (encoding == JUST_BITS) { - result = FastReplicateTo6(bitval, bitlen); - } else { - const uint D = QuintTritValue(val); - if (bitlen == 0u) { - return D << (4u | uint(encoding == TRIT)); - } - const uint b = (bitval >> 1u) & ((0x3100u >> (bitlen * 4u)) & 0xfu); - uint B = 0; - uint C = 0; + return (bitlen >= 1 && bitlen <= 5) + ? uint(floor(0.5f + float(bitval) * 64.0f / float((1 << bitlen) - 1))) + : FastReplicateTo6(bitval, bitlen); + } else if (encoding == TRIT || encoding == QUINT) { + uint B = 0, C = 0, D = 0; + uint b_mask = (0x3100 >> (bitlen << 2)) & 0xf; + uint b = (bitval >> 1) & b_mask; + D = QuintTritValue(val); if (encoding == TRIT) { - if (bitlen == 1u) { - C = 50u; - } else if (bitlen == 2u) { - C = 23u; - B = (b << 6u) | (b << 2u) | b; - } else { - C = 11u; - B = (b << 5u) | b; + switch (bitlen) { + case 0: return D << 5; //0,32,64 + case 1: C = 50; break; + case 2: C = 23; B = (b << 6) | (b << 2) | b; break; + case 3: C = 11; B = (b << 5) | b; break; } - } else { - if (bitlen == 1u) { - C = 28u; - } else { - C = 13u; - B = (b << 6u) | (b << 1u); + } else if (encoding == QUINT) { + switch (bitlen) { + case 0: return D << 4; //0, 16, 32, 48, 64 + case 1: C = 28; break; + case 2: C = 13; B = (b << 6) | (b << 1); break; } } - result = (A & 0x20u) | (((D * C + B) ^ A) >> 2u); + uint A = ReplicateBitTo7(bitval & 1); + uint res = (A & 0x20) | (((D * C + B) ^ A) >> 2); + return res + (res > 32 ? 1 : 0); } - return result + (1u - uint(result <= 32u)); + return 0; } void UnquantizeTexelWeights(uvec2 size, bool is_dual_plane) { const uint num_planes = is_dual_plane ? 2 : 1; const uint area = size.x * size.y; const uint loop_count = min(result_index, area * num_planes); - for (uint itr = 0; itr < loop_count; ++itr) { - result_vector[itr] = - UnquantizeTexelWeight(GetEncodingFromVector(itr)); + for (uint i = 0; i < loop_count; ++i) { + result_vector[i] = UnquantizeTexelWeight(EncodingData(result_vector[i])); } } uint GetUnquantizedTexelWeight(uint offset_base, uint plane, bool is_dual_plane) { - const uint offset = is_dual_plane ? 2 * offset_base + plane : offset_base; + const uint offset = is_dual_plane ? (offset_base << 1) + plane : offset_base; return result_vector[offset]; } -uvec4 GetUnquantizedWeightVector(uint t, uint s, uvec2 size, uint plane_index, bool is_dual_plane) { - const uint Ds = uint((block_dims.x * 0.5f + 1024) / (block_dims.x - 1)); - const uint Dt = uint((block_dims.y * 0.5f + 1024) / (block_dims.y - 1)); +uvec4 GetUnquantizedWeightVector(uvec2 pos, uvec2 size, uint plane_index, bool is_dual_plane) { const uint area = size.x * size.y; - - const uint cs = Ds * s; - const uint ct = Dt * t; - const uint gs = (cs * (size.x - 1) + 32) >> 6; - const uint gt = (ct * (size.y - 1) + 32) >> 6; - const uint js = gs >> 4; - const uint fs = gs & 0xF; - const uint jt = gt >> 4; - const uint ft = gt & 0x0F; - const uint w11 = (fs * ft + 8) >> 4; - const uint w10 = ft - w11; - const uint w01 = fs - w11; - const uint w00 = 16 - fs - ft + w11; + const uvec2 D = uvec2((block_dims * 0.5f + 1024.0f) / (block_dims - 1.0f)); + const uvec2 c = D * pos; + const uvec2 g = (c * (size - 1) + 32) >> 6; + const uvec2 j = g >> 4; + const uvec2 f = g & 0xF; + const uint w11 = (f.x * f.y + 8) >> 4; + const uint w10 = f.y - w11; + const uint w01 = f.x - w11; + const uint w00 = 16 - f.x - f.y + w11; const uvec4 w = uvec4(w00, w01, w10, w11); - const uint v0 = jt * size.x + js; - - uvec4 p0 = uvec4(0); - uvec4 p1 = uvec4(0); - - if (v0 < area) { - const uint offset_base = v0; - p0.x = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane); - p1.x = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane); - } - if ((v0 + 1) < (area)) { - const uint offset_base = v0 + 1; - p0.y = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane); - p1.y = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane); - } - if ((v0 + size.x) < (area)) { - const uint offset_base = v0 + size.x; - p0.z = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane); - p1.z = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane); - } - if ((v0 + size.x + 1) < (area)) { - const uint offset_base = v0 + size.x + 1; - p0.w = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane); - p1.w = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane); - } - - const uint primary_weight = (uint(dot(p0, w)) + 8) >> 4; - - uvec4 weight_vec = uvec4(primary_weight); - - if (is_dual_plane) { - const uint secondary_weight = (uint(dot(p1, w)) + 8) >> 4; - for (uint c = 0; c < 4; c++) { - const bool is_secondary = ((plane_index + 1u) & 3u) == c; - weight_vec[c] = is_secondary ? secondary_weight : primary_weight; - } - } - return weight_vec; + const uint v0 = j.y * size.x + j.x; + // + const uvec4 offset_base = uvec4(v0, v0 + 1, v0 + size.x, v0 + size.x + 1); + const uvec4 cmp_mask = uvec4(0) - uvec4(lessThan(offset_base, uvec4(area))); + uvec4 p0 = uvec4( + GetUnquantizedTexelWeight(offset_base.x, 0, is_dual_plane) & cmp_mask.x, + GetUnquantizedTexelWeight(offset_base.y, 0, is_dual_plane) & cmp_mask.y, + GetUnquantizedTexelWeight(offset_base.z, 0, is_dual_plane) & cmp_mask.z, + GetUnquantizedTexelWeight(offset_base.w, 0, is_dual_plane) & cmp_mask.w + ); + uvec4 p1 = uvec4( + GetUnquantizedTexelWeight(offset_base.x, 1, is_dual_plane) & cmp_mask.x, + GetUnquantizedTexelWeight(offset_base.y, 1, is_dual_plane) & cmp_mask.y, + GetUnquantizedTexelWeight(offset_base.z, 1, is_dual_plane) & cmp_mask.z, + GetUnquantizedTexelWeight(offset_base.w, 1, is_dual_plane) & cmp_mask.w + ); + const uvec2 final_weight = (uvec2(uint(dot(p0, w)), uint(dot(p1, w))) + 8) >> 4; + const uvec4 plane_mask = uvec4(0) - (uvec4(equal(uvec4(((plane_index + 1u) & 3u)), uvec4(0, 1, 2, 3))) & uvec4(0 - uint(is_dual_plane))); + return (final_weight.yyyy & plane_mask) | (final_weight.xxxx & ~plane_mask); } -int FindLayout(uint mode) { - if ((mode & 3) != 0) { - if ((mode & 8) != 0) { - if ((mode & 4) != 0) { - if ((mode & 0x100) != 0) { - return 4; - } - return 3; - } - return 2; - } - if ((mode & 4) != 0) { - return 1; - } - return 0; - } - if ((mode & 0x100) != 0) { - if ((mode & 0x80) != 0) { - if ((mode & 0x20) != 0) { - return 8; - } - return 7; - } - return 9; - } - if ((mode & 0x80) != 0) { - return 6; - } - return 5; -} - - void FillError(ivec3 coord) { for (uint j = 0; j < block_dims.y; j++) { for (uint i = 0; i < block_dims.x; i++) { @@ -1125,12 +730,13 @@ void FillError(ivec3 coord) { } } -void FillVoidExtentLDR(ivec3 coord) { +void FillVoidExtentLDR(uvec4 local_buff, ivec3 coord) { + // TODO: If you do extract bits, remember that it may be 11, or OTHER SkipBits(52); - const uint r_u = StreamBits(16); - const uint g_u = StreamBits(16); - const uint b_u = StreamBits(16); - const uint a_u = StreamBits(16); + const uint r_u = StreamBits(local_buff, 16); + const uint g_u = StreamBits(local_buff, 16); + const uint b_u = StreamBits(local_buff, 16); + const uint a_u = StreamBits(local_buff, 16); const float a = float(a_u) / 65535.0f; const float r = float(r_u) / 65535.0f; const float g = float(g_u) / 65535.0f; @@ -1142,13 +748,13 @@ void FillVoidExtentLDR(ivec3 coord) { } } -bool IsError(uint mode) { +bool IsError(uvec4 local_buff, uint mode) { if ((mode & 0x1ff) == 0x1fc) { if ((mode & 0x200) != 0) { // params.void_extent_hdr = true; return true; } - if ((mode & 0x400) == 0 || StreamBits(1) == 0) { + if ((mode & 0x400) == 0 || StreamBits(local_buff, 1) == 0) { return true; } return false; @@ -1162,9 +768,36 @@ bool IsError(uint mode) { return false; } -uvec2 DecodeBlockSize(uint mode) { +int FindLayout(uint mode) { + // Possible (Relevant), x = dont care, (in hex) + // Before shift: 02x, 08x, 10x, 00x, 0Ax, 12x, 18x, 1Ax + // After shift: 01, 04, 08, 00, 05, 09, 0c, 0d + // Reassemble and remove middle 0x040 (moronic fuzzy table) + // 0000 -> 0 0020 -> 1 0040 -> 0 0060 -> 1 + // 0080 -> 2 00a0 -> 3 00c0 -> 2 00e0 -> 3 + // 0100 -> 4 0120 -> 5 0140 -> 4 0160 -> 5 + // 0180 -> 6 01a0 -> 7 01c0 -> 6 01e0 -> 7 + // Key ranges: 01a0 -> 7, 0180 -> 6, 0100 -> 4, 0080 -> 2 + // 8>>2 = 2, 4>>2 = 1 :: () = 0, (4) = 1, (8) = 2, (8,4) = 3 + const uint mask = 0 - uint((mode & 3) != 0); + const uint sh3_mode = (mode >> 2) & 3; + const uint sh0_mode = ((mode >> 6) & 6) | ((mode >> 5) & 1); + const uint fl_const_table = 0 + | ((1) << (2 * 4)) //0080 -> 2, 1 + 5 = 6 + | ((1) << (3 * 4)) + | ((4) << (4 * 4)) //0100 -> 4, 4 + 5 = 9 + | ((4) << (5 * 4)) + | ((2) << (6 * 4)) //0180 -> 6, 2 + 5 = 7 + | ((3) << (7 * 4)) //01a0 -> 7, 3 + 5 = 8 + ; + const uint if_mode3_t = sh3_mode + uint((mode & 0x10c) == 0x10c); + const uint if_mode3_f = 5 + ((fl_const_table >> (sh0_mode << 2)) & 7); + return int((if_mode3_t & mask) | (if_mode3_f & ~mask)); +} + +uvec2 DecodeBlockSize(uint mode_layout, uint mode) { uint A, B; - switch (FindLayout(mode)) { + switch (mode_layout) { case 0: A = (mode >> 5) & 0x3; B = (mode >> 7) & 0x3; @@ -1204,130 +837,81 @@ uvec2 DecodeBlockSize(uint mode) { } } -uint DecodeMaxWeight(uint mode) { - const uint mode_layout = FindLayout(mode); - uint weight_index = (mode & 0x10) != 0 ? 1 : 0; - if (mode_layout < 5) { - weight_index |= (mode & 0x3) << 1; - } else { - weight_index |= (mode & 0xc) >> 1; - } - weight_index -= 2; - if ((mode_layout != 9) && ((mode & 0x200) != 0)) { - weight_index += 6; - } - return weight_index + 1; +uint DecodeMaxWeight(uint mode_layout, uint mode) { + const uint mode0_or = (mode & 0x3) << 1; + const uint mode5_or = (mode & 0xc) >> 1; + const uint cmp_moden = 0 - uint(mode_layout < 5); + const uint cmp_add6 = 0 - (uint(mode_layout != 9) & (mode >> 9) & 1); + return (((mode >> 4) & 1) + | (mode0_or & cmp_moden) | (mode5_or & ~cmp_moden)) + + (6 & cmp_add6) - 1; } -void DecompressBlock(ivec3 coord) { - uint mode = StreamBits(11); - if (IsError(mode)) { +void DecompressBlock(uvec4 local_buff, ivec3 coord) { + uint mode = StreamBits(local_buff, 11); + if (IsError(local_buff, mode)) { FillError(coord); return; } if ((mode & 0x1ff) == 0x1fc) { // params.void_extent_ldr = true; - FillVoidExtentLDR(coord); + FillVoidExtentLDR(local_buff, coord); return; } - const uvec2 size_params = DecodeBlockSize(mode); - if ((size_params.x > block_dims.x) || (size_params.y > block_dims.y)) { - FillError(coord); - return; - } - const uint num_partitions = StreamBits(2) + 1; + const uint num_partitions = StreamBits(local_buff, 2) + 1; const uint mode_layout = FindLayout(mode); const bool dual_plane = (mode_layout != 9) && ((mode & 0x400) != 0); - if (num_partitions > 4 || (num_partitions == 4 && dual_plane)) { - FillError(coord); - return; - } - if (GetNumWeightValues(size_params, dual_plane) > MAX_WEIGHT_VALUES) { + const uvec2 size_params = DecodeBlockSize(mode_layout, mode); + if (size_params.x > block_dims.x || size_params.y > block_dims.y + || num_partitions > 4 || (num_partitions == 4 && dual_plane) + || GetNumWeightValues(size_params, dual_plane) > MAX_WEIGHT_VALUES) { FillError(coord); return; } uint partition_index = 1; uvec4 color_endpoint_mode = uvec4(0); - uint ced_pointer = 0; uint base_cem = 0; if (num_partitions == 1) { - color_endpoint_mode.x = StreamBits(4); + color_endpoint_mode.x = StreamBits(local_buff, 4); partition_index = 0; } else { - partition_index = StreamBits(10); - base_cem = StreamBits(6); + partition_index = StreamBits(local_buff, 10); + base_cem = StreamBits(local_buff, 6); } const uint base_mode = base_cem & 3; - const uint max_weight = DecodeMaxWeight(mode); + const uint max_weight = DecodeMaxWeight(mode_layout, mode); const uint weight_bits = GetPackedBitSize(size_params, dual_plane, max_weight); - if (weight_bits < 24 || weight_bits > 96) { - FillError(coord); - return; - } - uint remaining_bits = 128 - weight_bits - total_bitsread; - uint extra_cem_bits = 0; - if (base_mode > 0) { - switch (num_partitions) { - case 2: - extra_cem_bits += 2; - break; - case 3: - extra_cem_bits += 5; - break; - case 4: - extra_cem_bits += 8; - break; - default: - FillError(coord); - return; - } - } - remaining_bits -= extra_cem_bits; + const uint extra_cem_bits = base_mode > 0 ? ((0x85200 >> (num_partitions << 2)) & 0x0f) : 0; const uint plane_selector_bits = dual_plane ? 2 : 0; + uint remaining_bits = 128 - weight_bits - total_bitsread; + remaining_bits -= extra_cem_bits; remaining_bits -= plane_selector_bits; if (remaining_bits > 128) { // Bad data, more remaining bits than 4 bytes // return early - FillError(coord); return; } // Read color data... const uint color_data_bits = remaining_bits; - while (remaining_bits > 0) { + for (uint i = 0; remaining_bits > 0 && i < 4; ++i) { const int nb = int(min(remaining_bits, 32U)); - const uint b = StreamBits(nb); - color_endpoint_data[ced_pointer] = uint(bitfieldExtract(b, 0, nb)); - ++ced_pointer; + color_endpoint_data[i] = StreamBits(local_buff, nb); remaining_bits -= nb; } - const uint plane_index = uint(StreamBits(plane_selector_bits)); + + // color_endpoint_mode assumed to be 0 on invalids/out of "range" + const uint plane_index = uint(StreamBits(local_buff, plane_selector_bits)); + const uvec4 cem_mask = (uvec4(0, 1, 2, 3) - num_partitions) >> 8; if (base_mode > 0) { - const uint extra_cem = StreamBits(extra_cem_bits); - uint cem = (extra_cem << 6) | base_cem; - cem >>= 2; - uvec4 C = uvec4(0); - for (uint i = 0; i < num_partitions; i++) { - C[i] = (cem & 1); - cem >>= 1; - } - uvec4 M = uvec4(0); - for (uint i = 0; i < num_partitions; i++) { - M[i] = cem & 3; - cem >>= 2; - } - for (uint i = 0; i < num_partitions; i++) { - color_endpoint_mode[i] = base_mode; - if (C[i] == 0) { - --color_endpoint_mode[i]; - } - color_endpoint_mode[i] <<= 2; - color_endpoint_mode[i] |= M[i]; - } + const uint extra_cem = StreamBits(local_buff, extra_cem_bits); + const uint cem = ((extra_cem << 6) | base_cem) >> 2; + const uint c0 = cem & ((1 << num_partitions) - 1); + const uint c1 = (cem >> num_partitions) & ((1 << (num_partitions << 1)) - 1); + const uvec4 c = (uvec4(c0) >> uvec4(0, 1, 2, 3)) & 1; + const uvec4 m = (uvec4(c1) >> uvec4(0, 2, 4, 6)) & 3; + color_endpoint_mode = (((uvec4(base_mode) - (1 - c)) << 2) | m) & cem_mask; } else if (num_partitions > 1) { - const uint cem = base_cem >> 2; - for (uint i = 0; i < num_partitions; i++) { - color_endpoint_mode[i] = cem; - } + color_endpoint_mode = uvec4(base_cem >> 2) & cem_mask; } uvec4 endpoints0[4]; @@ -1338,90 +922,46 @@ void DecompressBlock(ivec3 coord) { uint color_values[32]; uint colvals_index = 0; DecodeColorValues(color_endpoint_mode, num_partitions, color_data_bits, color_values); - for (uint i = 0; i < num_partitions; i++) { - ComputeEndpoints(endpoints0[i], endpoints1[i], color_endpoint_mode[i], color_values, - colvals_index); - } + for (uint i = 0; i < num_partitions; i++) + ComputeEndpoints(endpoints0[i], endpoints1[i], color_endpoint_mode[i], color_values, colvals_index); } color_endpoint_data = local_buff; color_endpoint_data = bitfieldReverse(color_endpoint_data).wzyx; const uint clear_byte_start = (weight_bits >> 3) + 1; - const uint byte_insert = ExtractBits(color_endpoint_data, int(clear_byte_start - 1) * 8, 8) & - uint(((1 << (weight_bits % 8)) - 1)); + const uint byte_insert = ExtractBits(color_endpoint_data, (clear_byte_start - 1) << 3, 8) & uint(((1 << (weight_bits & 7)) - 1)); const uint vec_index = (clear_byte_start - 1) >> 2; - color_endpoint_data[vec_index] = bitfieldInsert(color_endpoint_data[vec_index], byte_insert, - int((clear_byte_start - 1) % 4) * 8, 8); - for (uint i = clear_byte_start; i < 16; ++i) { - const uint idx = i >> 2; - color_endpoint_data[idx] = bitfieldInsert(color_endpoint_data[idx], 0, int(i % 4) * 8, 8); - } + color_endpoint_data[vec_index] = bitfieldInsert(color_endpoint_data[vec_index], byte_insert, int((clear_byte_start - 1) & 3) << 3, 8); + for (uint i = clear_byte_start; i < 16; ++i) + color_endpoint_data[i >> 2] = bitfieldInsert(color_endpoint_data[i >> 2], 0, int(i & 3) << 3, 8); // Re-init vector variables for next decode phase result_index = 0; color_bitsread = 0; - result_limit_reached = false; // The limit for the Unquantize phase, avoids decoding more data than needed. - result_vector_max_index = size_params.x * size_params.y; - if (dual_plane) { - result_vector_max_index *= 2; - } + result_vector_max_index = (size_params.x * size_params.y) << uint(dual_plane); DecodeIntegerSequence(max_weight, GetNumWeightValues(size_params, dual_plane)); - UnquantizeTexelWeights(size_params, dual_plane); for (uint j = 0; j < block_dims.y; j++) { for (uint i = 0; i < block_dims.x; i++) { - uint local_partition = 0; - if (num_partitions > 1) { - local_partition = Select2DPartition(partition_index, i, j, num_partitions); - } - const uint local_cem = color_endpoint_mode[local_partition]; - const uvec4 weight_vec = GetUnquantizedWeightVector(j, i, size_params, plane_index, dual_plane); - - vec4 p; - if (IsHDRColorEndpointMode(local_cem)) { - const uvec4 C0 = endpoints0[local_partition] << 4u; - const uvec4 C1 = endpoints1[local_partition] << 4u; - const uvec4 C = (C0 * (uvec4(64) - weight_vec) + C1 * weight_vec + uvec4(32)) / 64u; - const uvec4 E = (C & uvec4(0xF800u)) >> 11u; - const uvec4 M = C & uvec4(0x7FFu); - const uvec4 Mt_lo = 3u * M; - const uvec4 Mt_mid = 4u * M - 512u; - const uvec4 Mt_hi = 5u * M - 2048u; - const uvec4 Mt = - mix(Mt_lo, mix(Mt_mid, Mt_hi, greaterThanEqual(M, uvec4(1536u))), - greaterThanEqual(M, uvec4(512u))); - const uvec4 Cf = (E << 10u) + (Mt >> 3u); - const uvec4 half_bits = mix(Cf, uvec4(0x7BFFu), greaterThanEqual(Cf, uvec4(0x7C00u))); - p = vec4(unpackHalf2x16(half_bits.x).x, unpackHalf2x16(half_bits.y).x, - unpackHalf2x16(half_bits.z).x, unpackHalf2x16(half_bits.w).x); - - if (local_cem == 14u) { - const uint a0 = ReplicateByteTo16(uvec4(endpoints0[local_partition].x)).x; - const uint a1 = ReplicateByteTo16(uvec4(endpoints1[local_partition].x)).x; - const uint Ca = (a0 * (64u - weight_vec.x) + a1 * weight_vec.x + 32u) / 64u; - p.x = float(Ca) / 65535.0f; - } - } else { - const uvec4 C0 = ReplicateByteTo16(endpoints0[local_partition]); - const uvec4 C1 = ReplicateByteTo16(endpoints1[local_partition]); - const vec4 Cf = - vec4((C0 * (uvec4(64) - weight_vec) + C1 * weight_vec + uvec4(32)) / 64); - p = Cf / 65535.0f; - } - - imageStore(dest_image, coord + ivec3(i, j, 0), clamp(p, 0.0f, 1.0f).gbar); + const uint local_partition = Select2DPartition(partition_index, uvec2(i, j), num_partitions) & (0 - uint(num_partitions > 1)); + const uvec4 C0 = ReplicateByteTo16(endpoints0[local_partition]); + const uvec4 C1 = ReplicateByteTo16(endpoints1[local_partition]); + const uvec4 weight_vec = GetUnquantizedWeightVector(uvec2(i, j), size_params, plane_index, dual_plane); + const vec4 Cf = vec4((C0 * (uvec4(64) - weight_vec) + C1 * weight_vec + 32) >> 6); + const vec4 p = (Cf / 65535.0f); + imageStore(dest_image, coord + ivec3(i, j, 0), p.gbar); } } } uint SwizzleOffset(uvec2 pos) { - return ((pos.x & 32u) << 3u) | - ((pos.y & 6u) << 5u) | - ((pos.x & 16u) << 1u) | - ((pos.y & 1u) << 4u) | - (pos.x & 15u); + return ((pos.x & 32u) << 3u) + | ((pos.y & 6u) << 5u) + | ((pos.x & 16u) << 1u) + | ((pos.y & 1u) << 4u) + | (pos.x & 15u); } void main() { @@ -1441,6 +981,5 @@ void main() { if (any(greaterThanEqual(coord, imageSize(dest_image)))) { return; } - local_buff = astc_data[offset / 16]; - DecompressBlock(coord); + DecompressBlock(astc_data[offset >> 4], coord); } From 27bcaba75cd9e98f63bb470f97915776a64d00e8 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 06:12:25 -0400 Subject: [PATCH 057/198] first intent to pinpoint performance decrease on virtual buffer table + multi-range --- .../buffer_cache/virtual_range_cache.h | 91 ++----------------- 1 file changed, 10 insertions(+), 81 deletions(-) diff --git a/src/video_core/buffer_cache/virtual_range_cache.h b/src/video_core/buffer_cache/virtual_range_cache.h index f4284d6abb..378df18656 100644 --- a/src/video_core/buffer_cache/virtual_range_cache.h +++ b/src/video_core/buffer_cache/virtual_range_cache.h @@ -5,9 +5,7 @@ #include #include -#include #include -#include #include @@ -28,23 +26,22 @@ using VirtualSegments = boost::container::small_vector; class VirtualRangeCache { public: static constexpr size_t MAX_ENTRIES = 8192; - static constexpr size_t MAX_DEFERRED = 4096; const VirtualSegments* Query(Tegra::MemoryManager& memory, GPUVAddr gpu_addr, u32 size) { - if (has_deferred.load(std::memory_order_acquire)) { - ApplyDeferred(); - } + const u64 current = generation.load(std::memory_order_acquire); if (entries.size() > MAX_ENTRIES) { entries.clear(); } const size_t as_id = memory.GetID(); const u64 key = MakeKey(as_id, gpu_addr); const auto it = entries.find(key); - if (it != entries.end() && it->second.as_id == as_id && - it->second.gpu_addr == gpu_addr && it->second.size == size) { + if (it != entries.end() && it->second.generation == current && + it->second.as_id == as_id && it->second.gpu_addr == gpu_addr && + it->second.size == size) { return &it->second.segments; } Entry entry{}; + entry.generation = current; entry.as_id = as_id; entry.gpu_addr = gpu_addr; entry.size = size; @@ -79,95 +76,27 @@ public: return &result.first->second.segments; } - void Unmap(size_t as_id, GPUVAddr gpu_addr, u64 size) { - if (size == 0) { - return; + void Unmap(size_t, GPUVAddr, u64 size) { + if (size != 0) { + generation.fetch_add(1, std::memory_order_release); } - { - std::scoped_lock lock{deferred_mutex}; - if (!deferred.empty()) { - DeferredUnmap& last = deferred.back(); - if (last.as_id == as_id && last.gpu_addr + last.size == gpu_addr) { - last.size += size; - has_deferred.store(true, std::memory_order_release); - return; - } - } - if (deferred.size() >= MAX_DEFERRED) { - deferred.clear(); - deferred_overflow = true; - } else { - deferred.push_back(DeferredUnmap{ - .as_id = as_id, - .gpu_addr = gpu_addr, - .size = size, - }); - } - } - has_deferred.store(true, std::memory_order_release); } private: struct Entry { VirtualSegments segments; + u64 generation{}; size_t as_id{}; GPUVAddr gpu_addr{}; u32 size{}; }; - struct DeferredUnmap { - size_t as_id; - GPUVAddr gpu_addr; - u64 size; - }; - static u64 MakeKey(size_t as_id, GPUVAddr gpu_addr) { return (static_cast(as_id) << 48) ^ gpu_addr; } - void ApplyDeferred() { - std::vector pending; - bool overflow = false; - { - std::scoped_lock lock{deferred_mutex}; - has_deferred.store(false, std::memory_order_release); - pending.swap(deferred); - overflow = deferred_overflow; - deferred_overflow = false; - } - if (overflow) { - entries.clear(); - return; - } - if (pending.empty() || entries.empty()) { - return; - } - for (auto it = entries.begin(); it != entries.end();) { - const Entry& entry = it->second; - const GPUVAddr entry_end = entry.gpu_addr + entry.size; - bool overlaps = false; - for (const DeferredUnmap& unmap : pending) { - if (unmap.as_id != entry.as_id) { - continue; - } - if (entry.gpu_addr < unmap.gpu_addr + unmap.size && unmap.gpu_addr < entry_end) { - overlaps = true; - break; - } - } - if (overlaps) { - it = entries.erase(it); - } else { - ++it; - } - } - } - ::Common::unordered_map entries; - std::vector deferred; - std::mutex deferred_mutex; - std::atomic has_deferred{false}; - bool deferred_overflow{}; + std::atomic generation{}; }; } // namespace VideoCommon From d633c43aae5f1e74ac3ee3d54b5349e469a89ca6 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 06:35:08 -0400 Subject: [PATCH 058/198] Remove static pipelines --- src/video_core/renderer_vulkan/blit_image.cpp | 18 ++-- .../renderer_vulkan/present/util.cpp | 2 +- .../renderer_vulkan/vk_compute_pass.cpp | 2 +- .../vulkan_common/vulkan_device.cpp | 100 ------------------ src/video_core/vulkan_common/vulkan_device.h | 9 -- 5 files changed, 11 insertions(+), 120 deletions(-) diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index ddd52e9426..f9d9460c37 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -1281,7 +1281,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceColorPipeline(const BlitImagePipelineKe .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }, device.StaticPipelineCache())); + })); return *blit_color_pipelines.back(); } @@ -1313,7 +1313,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceDepthStencilPipeline(const BlitImagePip .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }, device.StaticPipelineCache())); + })); return *blit_depth_stencil_pipelines.back(); } @@ -1366,7 +1366,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearColorPipeline(const BlitImagePipel .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }, device.StaticPipelineCache())); + })); return *clear_color_pipelines.back(); } @@ -1422,7 +1422,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearStencilPipeline( .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }, device.StaticPipelineCache())); + })); return *clear_stencil_pipelines.back(); } @@ -1465,7 +1465,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceBlitColorMSAAPipeline(const BlitMSAAPip .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }, device.StaticPipelineCache())); + })); return *blit_msaa_color_pipelines.back(); } @@ -1584,7 +1584,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceResolveDepthStencilPipeline(VkRenderPas .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }, device.StaticPipelineCache())); + })); return *pipelines.back(); } @@ -1697,7 +1697,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceMSAACopyPipeline(const MSAACopyPipeline .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }, device.StaticPipelineCache())); + })); return *msaa_copy_pipelines.back(); } @@ -1817,7 +1817,7 @@ void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass ren .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }, device.StaticPipelineCache()); + }); } void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, @@ -1860,7 +1860,7 @@ void BlitImageHelper::ConvertPipeline(vk::Pipeline& pipeline, VkRenderPass rende .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }, device.StaticPipelineCache()); + }); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/util.cpp b/src/video_core/renderer_vulkan/present/util.cpp index 2ea7870f01..11250687d6 100644 --- a/src/video_core/renderer_vulkan/present/util.cpp +++ b/src/video_core/renderer_vulkan/present/util.cpp @@ -521,7 +521,7 @@ static vk::Pipeline CreateWrappedPipelineImpl( .subpass = 0, .basePipelineHandle = 0, .basePipelineIndex = 0, - }, device.StaticPipelineCache()); + }); } vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderpass, diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 604a0d7cac..5aeef5ad3c 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -267,7 +267,7 @@ ComputePass::ComputePass(const Device& device_, Scheduler& scheduler, Descriptor .layout = *layout, .basePipelineHandle = {}, .basePipelineIndex = 0, - }, device.StaticPipelineCache()); + }); } ComputePass::~ComputePass() = default; diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index be09bca8d3..d79e8d37fe 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -7,8 +7,6 @@ #include #include #include -#include -#include #include #include #include "common/container/unordered_map.h" @@ -19,8 +17,6 @@ #include #include "common/assert.h" -#include "common/fs/fs.h" -#include "common/fs/path_util.h" #include "common/literals.h" #include #include "common/settings.h" @@ -398,17 +394,6 @@ std::vector ExtensionListForVulkan( return output; } -constexpr std::array STATIC_CACHE_MAGIC_NUMBER{'e', 'd', 'e', 'n', 's', 't', 'p', 'c'}; -constexpr u32 STATIC_CACHE_VERSION = 1; - -std::filesystem::path StaticPipelineCacheFilename() { - const auto shader_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::ShaderDir); - if (!Common::FS::CreateDir(shader_dir)) { - return {}; - } - return shader_dir / "vulkan_static_pipelines.bin"; -} - } // Anonymous namespace void Device::RemoveExtension(bool& extension, const std::string& extension_name) { @@ -766,100 +751,15 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR vk::Check(vmaCreateAllocator(&allocator_info, &allocator)); - owns_static_pipeline_cache = surface != VkSurfaceKHR{}; - LoadStaticPipelineCache(); - // Initialize GPU logging if enabled InitializeGPULogging(); } Device::~Device() { - SaveStaticPipelineCache(); ShutdownGPULogging(); vmaDestroyAllocator(allocator); } -void Device::LoadStaticPipelineCache() { - const auto create = [this](size_t size, const void* data) { - static_pipeline_cache = logical.CreatePipelineCache({ - .sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .initialDataSize = size, - .pInitialData = data, - }); - }; - if (!owns_static_pipeline_cache) { - create(0, nullptr); - return; - } - const auto filename = StaticPipelineCacheFilename(); - if (filename.empty()) { - create(0, nullptr); - return; - } - std::vector data; - try { - std::ifstream file(filename, std::ios::binary | std::ios::ate); - if (!file.is_open()) { - create(0, nullptr); - return; - } - file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - const size_t total = static_cast(file.tellg()); - file.seekg(0, std::ios::beg); - std::array magic{}; - u32 version{}; - if (total < magic.size() + sizeof(version)) { - create(0, nullptr); - return; - } - file.read(magic.data(), magic.size()) - .read(reinterpret_cast(&version), sizeof(version)); - if (magic != STATIC_CACHE_MAGIC_NUMBER || version != STATIC_CACHE_VERSION) { - create(0, nullptr); - return; - } - data.resize(total - magic.size() - sizeof(version)); - file.read(data.data(), static_cast(data.size())); - } catch (const std::ios_base::failure& e) { - create(0, nullptr); - return; - } - create(data.size(), data.empty() ? nullptr : data.data()); -} - -void Device::SaveStaticPipelineCache() const { - if (!owns_static_pipeline_cache || !static_pipeline_cache) { - return; - } - const auto filename = StaticPipelineCacheFilename(); - if (filename.empty()) { - return; - } - size_t size = 0; - std::vector data; - static_pipeline_cache.Read(&size, nullptr); - if (size == 0) { - return; - } - data.resize(size); - static_pipeline_cache.Read(&size, data.data()); - try { - std::ofstream file(filename, std::ios::binary | std::ios::trunc); - file.exceptions(std::ofstream::failbit); - if (!file.is_open()) { - return; - } - file.write(STATIC_CACHE_MAGIC_NUMBER.data(), STATIC_CACHE_MAGIC_NUMBER.size()) - .write(reinterpret_cast(&STATIC_CACHE_VERSION), - sizeof(STATIC_CACHE_VERSION)) - .write(data.data(), static_cast(size)); - } catch (const std::ios_base::failure& e) { - Common::FS::RemoveFile(filename); - } -} - VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, FormatType format_type) const { if (IsFormatSupported(wanted_format, wanted_usage, format_type)) { diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 077b1c3e23..45b0ad7b17 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -273,10 +273,6 @@ public: return physical; } - VkPipelineCache StaticPipelineCache() const noexcept { - return *static_pipeline_cache; - } - /// Returns the main graphics queue. vk::Queue GetGraphicsQueue() const { return graphics_queue; @@ -1135,9 +1131,6 @@ private: /// Returns true if the device natively supports blitting depth stencil images. bool TestDepthStencilBlits(VkFormat format) const; - void LoadStaticPipelineCache(); - void SaveStaticPipelineCache() const; - private: VkInstance instance; ///< Vulkan instance. VmaAllocator allocator; ///< VMA allocator. @@ -1146,8 +1139,6 @@ private: vk::Device logical; ///< Logical device. vk::Queue graphics_queue; ///< Main graphics queue. vk::Queue present_queue; ///< Main present queue. - vk::PipelineCache static_pipeline_cache; - bool owns_static_pipeline_cache{}; u32 instance_version{}; ///< Vulkan instance version. u32 graphics_family{}; ///< Main graphics queue family index. u32 present_family{}; ///< Main present queue family index. From 8cdf552c28056ca204f449655f675041817a003a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 06:55:48 -0400 Subject: [PATCH 059/198] Some adjustments to vertex attributes --- src/video_core/engines/draw_manager.cpp | 36 +++++++++++++++---- src/video_core/engines/maxwell_3d.h | 3 +- .../renderer_vulkan/vk_graphics_pipeline.cpp | 3 +- .../renderer_vulkan/vk_rasterizer.cpp | 6 +++- .../vulkan_common/vulkan_device.cpp | 8 +++++ src/video_core/vulkan_common/vulkan_device.h | 6 ++++ 6 files changed, 52 insertions(+), 10 deletions(-) diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index 5891c25622..cbac98c8c6 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp @@ -14,6 +14,10 @@ namespace Tegra::Engines { void Maxwell3D::DrawManager::ProcessMethodCall(Maxwell3D& maxwell3d, u32 method, u32 argument) { + if (draw_state.draw_mode == DrawMode::InstanceArray && + method != MAXWELL3D_REG_INDEX(vertex_array_instance_subsequent)) { + DrawDeferred(maxwell3d); + } switch (method) { case MAXWELL3D_REG_INDEX(clear_surface): return Clear(maxwell3d, 1); @@ -73,6 +77,15 @@ void Maxwell3D::DrawManager::Clear(Maxwell3D& maxwell3d, u32 layer_count) { } void Maxwell3D::DrawManager::DrawDeferred(Maxwell3D& maxwell3d) { + if (draw_state.draw_mode == DrawMode::InstanceArray) { + const u32 instance_count = draw_state.instance_count + 1; + draw_state.draw_mode = DrawMode::General; + draw_state.instance_count = 0; + if (maxwell3d.ShouldExecute()) { + maxwell3d.rasterizer->Draw(false, instance_count); + } + return; + } if (draw_state.draw_mode != DrawMode::Instance || draw_state.instance_count == 0) { return; } @@ -89,16 +102,25 @@ void Maxwell3D::DrawManager::DrawArray(Maxwell3D& maxwell3d, Maxwell3D::Regs::Pr } void Maxwell3D::DrawManager::DrawArrayInstanced(Maxwell3D& maxwell3d, Maxwell3D::Regs::PrimitiveTopology topology, u32 vertex_first, u32 vertex_count, bool subsequent) { + if (subsequent && draw_state.draw_mode == DrawMode::InstanceArray && + instance_topology == topology && draw_state.vertex_buffer.first == vertex_first && + draw_state.vertex_buffer.count == vertex_count) { + ++draw_state.instance_count; + return; + } + u32 base_instance = 0; + if (subsequent) { + base_instance = draw_state.base_instance + draw_state.instance_count + 1; + } + DrawDeferred(maxwell3d); + instance_topology = topology; draw_state.topology = topology; draw_state.vertex_buffer.first = vertex_first; draw_state.vertex_buffer.count = vertex_count; - if (!subsequent) { - draw_state.instance_count = 1; - } - draw_state.base_instance = draw_state.instance_count - 1; - draw_state.draw_mode = DrawMode::Instance; - draw_state.instance_count++; - ProcessDraw(maxwell3d, false, 1); + draw_state.base_instance = base_instance; + draw_state.instance_count = 0; + draw_state.draw_mode = DrawMode::InstanceArray; + UpdateTopology(maxwell3d); } void Maxwell3D::DrawManager::DrawIndex(Maxwell3D& maxwell3d, Maxwell3D::Regs::PrimitiveTopology topology, u32 index_first, u32 index_count, u32 base_index, u32 base_instance, u32 num_instances) { diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 0cab2ae986..277304ed76 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -3034,7 +3034,7 @@ public: // clang-format on struct DrawManager { - enum class DrawMode : u32 { General = 0, Instance, InlineIndex }; + enum class DrawMode : u32 { General = 0, Instance, InlineIndex, InstanceArray }; struct State { Maxwell3D::Regs::PrimitiveTopology topology{}; DrawMode draw_mode{}; @@ -3086,6 +3086,7 @@ public: void ProcessDraw(Maxwell3D& maxwell3d, bool draw_indexed, u32 instance_count); void ProcessDrawIndirect(Maxwell3D& maxwell3d); State draw_state{}; + Maxwell3D::Regs::PrimitiveTopology instance_topology{}; DrawTextureState draw_texture_state{}; IndirectParams indirect_state{}; }; diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 8b5b0bc9c5..7ee1c608c0 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -705,7 +705,8 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { if (instanced) { vertex_binding_divisors.push_back({ .binding = static_cast(index), - .divisor = key.state.binding_divisors[index], + .divisor = (std::min)(key.state.binding_divisors[index], + device.GetMaxVertexAttribDivisor()), }); } } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index f43bea1220..92c5574691 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -1918,13 +1918,17 @@ void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs) for (u32 binding = 0; binding < max_bindings; ++binding) { const auto& input_binding{regs.vertex_streams[binding]}; const bool is_instanced{regs.vertex_stream_instances.IsInstancingEnabled(binding)}; + u32 divisor = 1; + if (is_instanced) { + divisor = (std::min)(input_binding.frequency, device.GetMaxVertexAttribDivisor()); + } bindings.push_back({ .sType = VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT, .pNext = nullptr, .binding = binding, .stride = input_binding.stride, .inputRate = is_instanced ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX, - .divisor = is_instanced ? input_binding.frequency : 1, + .divisor = divisor, }); } diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index d79e8d37fe..9a9bfdd43b 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1130,11 +1130,19 @@ bool Device::GetSuitability(bool requires_swapchain) { SetNext(next, properties.custom_border_color); } + if (extensions.vertex_attribute_divisor) { + properties.vertex_attribute_divisor.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT; + SetNext(next, properties.vertex_attribute_divisor); + } + // Perform the property fetch. physical.GetProperties2(properties2); // Store base properties properties.properties = properties2.properties; + max_vertex_attrib_divisor = + (std::max)(1U, properties.vertex_attribute_divisor.maxVertexAttribDivisor); // Unload extensions if feature support is insufficient. RemoveUnsuitableExtensions(); diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 45b0ad7b17..c6d6df16b1 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -984,6 +984,10 @@ FN_MAX_LIMIT_LIST return properties.properties.limits.maxVertexInputBindings; } + u32 GetMaxVertexAttribDivisor() const { + return max_vertex_attrib_divisor; + } + u32 GetMaxViewports() const { return properties.properties.limits.maxViewports; } @@ -1188,6 +1192,7 @@ private: VkPhysicalDeviceMaintenance5PropertiesKHR maintenance5{}; VkPhysicalDeviceDepthStencilResolveProperties depth_stencil_resolve{}; VkPhysicalDeviceCustomBorderColorPropertiesEXT custom_border_color{}; + VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_attribute_divisor{}; VkPhysicalDeviceProperties properties{}; }; @@ -1195,6 +1200,7 @@ private: Extensions extensions{}; Features features{}; Properties properties{}; + u32 max_vertex_attrib_divisor{1}; VkPhysicalDeviceFeatures2 features2{}; VkPhysicalDeviceProperties2 properties2{}; From 521d3922f5ccaf96250a70a9676aa2cb57eb38ae Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 10:44:42 -0400 Subject: [PATCH 060/198] Fix build --- src/video_core/engines/draw_manager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index cbac98c8c6..682b5ae048 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp @@ -208,6 +208,9 @@ void Maxwell3D::DrawManager::DrawBegin(Maxwell3D& maxwell3d) { void Maxwell3D::DrawManager::DrawEnd(Maxwell3D& maxwell3d, u32 instance_count, bool force_draw) { switch (draw_state.draw_mode) { + case DrawMode::InstanceArray: + DrawDeferred(maxwell3d); + break; case DrawMode::Instance: if (!force_draw) { break; From b10212fe9473aeb745b73b61bf4848438a5b58f3 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 12:58:32 -0400 Subject: [PATCH 061/198] Let's try to change a bit the redundancy --- src/video_core/buffer_cache/buffer_cache.h | 17 +++++----- .../buffer_cache/buffer_cache_base.h | 3 +- src/video_core/engines/draw_manager.cpp | 33 ++++++++++++++----- src/video_core/engines/maxwell_3d.h | 1 + .../renderer_vulkan/vk_rasterizer.cpp | 23 ++++++++----- .../renderer_vulkan/vk_rasterizer.h | 2 +- 6 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 3165483388..5705954ae6 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1006,7 +1006,7 @@ void BufferCache

::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 } template -void BufferCache

::ResolveMultiRangeStorage(Binding& binding, bool is_written, +void BufferCache

::ResolveMultiRangeStorage(Binding& binding, std::vector& pool) { binding.segment_first = 0; binding.segment_count = 0; @@ -1014,15 +1014,17 @@ void BufferCache

::ResolveMultiRangeStorage(Binding& binding, bool is_written, if (binding.gpu_addr == 0 || binding.size == 0) { return; } - if (is_written && !runtime.PrefersSparseSources()) { - return; - } const VirtualSegments* found = virtual_ranges.Query(*gpu_memory, binding.gpu_addr, binding.size); if (!found || found->size() < 2) { return; } const VirtualSegments segments = *found; + for (const VirtualSegment& segment : segments) { + if (memory_tracker.IsRegionGpuModified(segment.device_addr, segment.size)) { + return; + } + } const u32 first = static_cast(pool.size()); const bool prefer_sparse = runtime.PrefersSparseSources(); for (const VirtualSegment& segment : segments) { @@ -1439,8 +1441,7 @@ void BufferCache

::UpdateStorageBuffers(size_t stage) { Binding& binding = channel_state->storage_buffers[stage][index]; const BufferId buffer_id = FindBuffer(binding.device_addr, binding.size, false); binding.buffer_id = buffer_id; - const bool is_written = ((channel_state->written_storage_buffers[stage] >> index) & 1) != 0; - ResolveMultiRangeStorage(binding, is_written, graphics_segments); + ResolveMultiRangeStorage(binding, graphics_segments); }); } @@ -1504,9 +1505,7 @@ void BufferCache

::UpdateComputeStorageBuffers() { // Resolve buffer Binding& binding = channel_state->compute_storage_buffers[index]; binding.buffer_id = FindBuffer(binding.device_addr, binding.size, false); - const bool is_written = - ((channel_state->written_compute_storage_buffers >> index) & 1) != 0; - ResolveMultiRangeStorage(binding, is_written, compute_segments); + ResolveMultiRangeStorage(binding, compute_segments); }); } diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 0dbb368c47..61b3e9bbab 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -228,8 +228,7 @@ public: bool BindMultiRangeStorage(const Binding& binding, bool is_written, std::span pool); - void ResolveMultiRangeStorage(Binding& binding, bool is_written, - std::vector& pool); + void ResolveMultiRangeStorage(Binding& binding, std::vector& pool); void UnmapGPUMemory(size_t as_id, GPUVAddr gpu_addr, size_t size); diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index 682b5ae048..b38847db6b 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp @@ -76,16 +76,20 @@ void Maxwell3D::DrawManager::Clear(Maxwell3D& maxwell3d, u32 layer_count) { } } -void Maxwell3D::DrawManager::DrawDeferred(Maxwell3D& maxwell3d) { - if (draw_state.draw_mode == DrawMode::InstanceArray) { - const u32 instance_count = draw_state.instance_count + 1; - draw_state.draw_mode = DrawMode::General; - draw_state.instance_count = 0; - if (maxwell3d.ShouldExecute()) { - maxwell3d.rasterizer->Draw(false, instance_count); - } +void Maxwell3D::DrawManager::FlushInstanceArray(Maxwell3D& maxwell3d) { + if (draw_state.draw_mode != DrawMode::InstanceArray) { return; } + const u32 instance_count = draw_state.instance_count + 1; + draw_state.draw_mode = DrawMode::General; + draw_state.instance_count = 0; + if (draw_state.vertex_buffer.count != 0 && maxwell3d.ShouldExecute()) { + maxwell3d.rasterizer->Draw(false, instance_count); + } +} + +void Maxwell3D::DrawManager::DrawDeferred(Maxwell3D& maxwell3d) { + FlushInstanceArray(maxwell3d); if (draw_state.draw_mode != DrawMode::Instance || draw_state.instance_count == 0) { return; } @@ -94,6 +98,7 @@ void Maxwell3D::DrawManager::DrawDeferred(Maxwell3D& maxwell3d) { } void Maxwell3D::DrawManager::DrawArray(Maxwell3D& maxwell3d, Maxwell3D::Regs::PrimitiveTopology topology, u32 vertex_first, u32 vertex_count, u32 base_instance, u32 num_instances) { + FlushInstanceArray(maxwell3d); draw_state.topology = topology; draw_state.vertex_buffer.first = vertex_first; draw_state.vertex_buffer.count = vertex_count; @@ -124,6 +129,7 @@ void Maxwell3D::DrawManager::DrawArrayInstanced(Maxwell3D& maxwell3d, Maxwell3D: } void Maxwell3D::DrawManager::DrawIndex(Maxwell3D& maxwell3d, Maxwell3D::Regs::PrimitiveTopology topology, u32 index_first, u32 index_count, u32 base_index, u32 base_instance, u32 num_instances) { + FlushInstanceArray(maxwell3d); draw_state.topology = topology; draw_state.index_buffer = maxwell3d.regs.index_buffer; draw_state.index_buffer.first = index_first; @@ -134,11 +140,13 @@ void Maxwell3D::DrawManager::DrawIndex(Maxwell3D& maxwell3d, Maxwell3D::Regs::Pr } void Maxwell3D::DrawManager::DrawArrayIndirect(Maxwell3D& maxwell3d, Maxwell3D::Regs::PrimitiveTopology topology) { + FlushInstanceArray(maxwell3d); draw_state.topology = topology; ProcessDrawIndirect(maxwell3d); } void Maxwell3D::DrawManager::DrawIndexedIndirect(Maxwell3D& maxwell3d, Maxwell3D::Regs::PrimitiveTopology topology, u32 index_first, u32 index_count) { + FlushInstanceArray(maxwell3d); draw_state.topology = topology; draw_state.index_buffer = maxwell3d.regs.index_buffer; draw_state.index_buffer.first = index_first; @@ -209,7 +217,7 @@ void Maxwell3D::DrawManager::DrawBegin(Maxwell3D& maxwell3d) { void Maxwell3D::DrawManager::DrawEnd(Maxwell3D& maxwell3d, u32 instance_count, bool force_draw) { switch (draw_state.draw_mode) { case DrawMode::InstanceArray: - DrawDeferred(maxwell3d); + FlushInstanceArray(maxwell3d); break; case DrawMode::Instance: if (!force_draw) { @@ -301,6 +309,13 @@ void Maxwell3D::DrawManager::UpdateTopology(Maxwell3D& maxwell3d) { void Maxwell3D::DrawManager::ProcessDraw(Maxwell3D& maxwell3d, bool draw_indexed, u32 instance_count) { LOG_TRACE(HW_GPU, "called, topology={}, count={}", draw_state.topology, draw_indexed ? draw_state.index_buffer.count : draw_state.vertex_buffer.count); UpdateTopology(maxwell3d); + u32 count = draw_state.vertex_buffer.count; + if (draw_indexed) { + count = draw_state.index_buffer.count; + } + if (count == 0) { + return; + } if (maxwell3d.ShouldExecute()) { maxwell3d.rasterizer->Draw(draw_indexed, instance_count); } diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 277304ed76..ae4b761ced 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -3071,6 +3071,7 @@ public: void ProcessMethodCall(Maxwell3D& maxwell3d, u32 method, u32 argument); void Clear(Maxwell3D& maxwell3d, u32 layer_count); void DrawDeferred(Maxwell3D& maxwell3d); + void FlushInstanceArray(Maxwell3D& maxwell3d); void DrawArray(Maxwell3D& maxwell3d, Maxwell3D::Regs::PrimitiveTopology topology, u32 vertex_first, u32 vertex_count, u32 base_instance, u32 num_instances); void DrawArrayInstanced(Maxwell3D& maxwell3d, Maxwell3D::Regs::PrimitiveTopology topology, u32 vertex_first, u32 vertex_count, bool subsequent); void DrawIndex(Maxwell3D& maxwell3d, Maxwell3D::Regs::PrimitiveTopology topology, u32 index_first, u32 index_count, u32 base_index, u32 base_instance, u32 num_instances); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 92c5574691..b5eb0c5763 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -166,7 +166,11 @@ DrawParams MakeDrawParams(const Tegra::Engines::Maxwell3D::DrawManager::State& d params.base_vertex = 0; params.is_indexed = true; } else if (draw_state.topology == Maxwell::PrimitiveTopology::QuadStrip) { - params.num_vertices = (params.num_vertices - 2) / 2 * 6; + u32 strips = 0; + if (params.num_vertices >= 2) { + strips = (params.num_vertices - 2) / 2; + } + params.num_vertices = strips * 6; params.base_vertex = 0; params.is_indexed = true; } @@ -251,7 +255,7 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) { if (!pipeline->Configure(is_indexed)) return; - UpdateDynamicStates(); + UpdateDynamicStates(pipeline->HasDynamicVertexInput()); query_cache.NotifySegment(true); HandleTransformFeedback(); @@ -361,7 +365,12 @@ void RasterizerVulkan::DrawTexture() { texture_cache.SynchronizeDescriptors(false); texture_cache.UpdateRenderTargets(false); - UpdateDynamicStates(); + bool dynamic_vertex_input = false; + if (device.IsExtVertexInputDynamicStateSupported()) { + GraphicsPipeline* const gp = pipeline_cache.CurrentGraphicsPipeline(); + dynamic_vertex_input = gp && gp->HasDynamicVertexInput(); + } + UpdateDynamicStates(dynamic_vertex_input); query_cache.NotifySegment(true); query_cache.CounterEnable(VideoCommon::QueryType::ZPassPixelCount64, maxwell3d->regs.zpass_pixel_count_enable); @@ -1060,7 +1069,7 @@ bool AccelerateDMA::BufferToImage(const Tegra::DMA::ImageCopy& copy_info, return DmaBufferImageCopy(copy_info, buffer_operand, image_operand); } -void RasterizerVulkan::UpdateDynamicStates() { +void RasterizerVulkan::UpdateDynamicStates(bool dynamic_vertex_input) { auto& regs = maxwell3d->regs; auto& flags = maxwell3d->dirty.flags; const auto topology = maxwell3d->draw_manager.draw_state.topology; @@ -1137,10 +1146,8 @@ void RasterizerVulkan::UpdateDynamicStates() { UpdateColorWriteEnable(regs); } - if (device.IsExtVertexInputDynamicStateSupported()) { - if (auto* gp = pipeline_cache.CurrentGraphicsPipeline(); gp && gp->HasDynamicVertexInput()) { - UpdateVertexInput(regs); - } + if (dynamic_vertex_input) { + UpdateVertexInput(regs); } } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 7470aa4f14..59bcf65ec4 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -159,7 +159,7 @@ private: void FlushWork(); - void UpdateDynamicStates(); + void UpdateDynamicStates(bool dynamic_vertex_input); void HandleTransformFeedback(); From f92e326e174666aeb30b8441a3dcc32415330022 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 15:51:32 -0400 Subject: [PATCH 062/198] Adjustments from the previous change for pipelines --- src/video_core/buffer_cache/buffer_cache_base.h | 6 +++++- src/video_core/engines/draw_manager.cpp | 9 +-------- .../renderer_vulkan/vk_rasterizer.cpp | 17 ++++++++++++++--- src/video_core/renderer_vulkan/vk_rasterizer.h | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 61b3e9bbab..18997088d3 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -228,7 +228,11 @@ public: bool BindMultiRangeStorage(const Binding& binding, bool is_written, std::span pool); - void ResolveMultiRangeStorage(Binding& binding, std::vector& pool); + + + + + void ResolveMultiRangeStorage(Binding& binding, std::vector& pool); void UnmapGPUMemory(size_t as_id, GPUVAddr gpu_addr, size_t size); diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index b38847db6b..177d83700b 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp @@ -83,7 +83,7 @@ void Maxwell3D::DrawManager::FlushInstanceArray(Maxwell3D& maxwell3d) { const u32 instance_count = draw_state.instance_count + 1; draw_state.draw_mode = DrawMode::General; draw_state.instance_count = 0; - if (draw_state.vertex_buffer.count != 0 && maxwell3d.ShouldExecute()) { + if (maxwell3d.ShouldExecute()) { maxwell3d.rasterizer->Draw(false, instance_count); } } @@ -309,13 +309,6 @@ void Maxwell3D::DrawManager::UpdateTopology(Maxwell3D& maxwell3d) { void Maxwell3D::DrawManager::ProcessDraw(Maxwell3D& maxwell3d, bool draw_indexed, u32 instance_count) { LOG_TRACE(HW_GPU, "called, topology={}, count={}", draw_state.topology, draw_indexed ? draw_state.index_buffer.count : draw_state.vertex_buffer.count); UpdateTopology(maxwell3d); - u32 count = draw_state.vertex_buffer.count; - if (draw_indexed) { - count = draw_state.index_buffer.count; - } - if (count == 0) { - return; - } if (maxwell3d.ShouldExecute()) { maxwell3d.rasterizer->Draw(draw_indexed, instance_count); } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index b5eb0c5763..7346c5c269 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -237,7 +237,7 @@ RasterizerVulkan::~RasterizerVulkan() { } template -void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) { +void RasterizerVulkan::PrepareDraw(bool is_indexed, bool skip_empty, Func&& draw_func) { SCOPE_EXIT { gpu.TickWork(); @@ -245,6 +245,17 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) { FlushWork(); gpu_memory->FlushCaching(); + if (skip_empty) { + const auto& draw_state = maxwell3d->draw_manager.draw_state; + u32 count = draw_state.vertex_buffer.count; + if (is_indexed) { + count = draw_state.index_buffer.count; + } + if (count == 0) { + return; + } + } + GraphicsPipeline* const pipeline{pipeline_cache.CurrentGraphicsPipeline()}; if (!pipeline) { return; @@ -264,7 +275,7 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) { } void RasterizerVulkan::Draw(bool is_indexed, u32 instance_count) { - PrepareDraw(is_indexed, [this, is_indexed, instance_count] { + PrepareDraw(is_indexed, true, [this, is_indexed, instance_count] { const auto& draw_state = maxwell3d->draw_manager.draw_state; const u32 num_instances{instance_count}; const DrawParams draw_params{MakeDrawParams(draw_state, num_instances, is_indexed)}; @@ -299,7 +310,7 @@ void RasterizerVulkan::Draw(bool is_indexed, u32 instance_count) { void RasterizerVulkan::DrawIndirect() { const auto& params = maxwell3d->draw_manager.indirect_state; buffer_cache.SetDrawIndirect(¶ms); - PrepareDraw(params.is_indexed, [this, ¶ms] { + PrepareDraw(params.is_indexed, false, [this, ¶ms] { const auto indirect_buffer = buffer_cache.GetDrawIndirectBuffer(); const auto& buffer = indirect_buffer.first; const auto& offset = indirect_buffer.second; diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 59bcf65ec4..bb7c5ff09e 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -155,7 +155,7 @@ private: static constexpr VkDeviceSize DEFAULT_BUFFER_SIZE = 4 * sizeof(float); template - void PrepareDraw(bool is_indexed, Func&&); + void PrepareDraw(bool is_indexed, bool skip_empty, Func&&); void FlushWork(); From 377478cd46db5091356e025369d5b230697859c8 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 16:25:34 -0400 Subject: [PATCH 063/198] A quick topology test --- src/video_core/engines/draw_manager.cpp | 58 ++++++++++++++++--- src/video_core/host_shaders/CMakeLists.txt | 1 + .../host_shaders/vulkan_indirect_quads.comp | 33 +++++++++++ src/video_core/macro.cpp | 8 ++- .../renderer_vulkan/vk_compute_pass.cpp | 51 ++++++++++++++++ .../renderer_vulkan/vk_compute_pass.h | 19 ++++++ .../renderer_vulkan/vk_rasterizer.cpp | 41 +++++++++---- .../renderer_vulkan/vk_rasterizer.h | 2 + .../vk_staging_buffer_pool.cpp | 3 +- 9 files changed, 192 insertions(+), 24 deletions(-) create mode 100644 src/video_core/host_shaders/vulkan_indirect_quads.comp diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index 177d83700b..0d3558a8f3 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp @@ -282,28 +282,68 @@ void Maxwell3D::DrawManager::DrawTexture(Maxwell3D& maxwell3d) { } void Maxwell3D::DrawManager::UpdateTopology(Maxwell3D& maxwell3d) { + using Topology = Maxwell3D::Regs::PrimitiveTopology; + using Override = Maxwell3D::Regs::PrimitiveTopologyOverride; switch (maxwell3d.regs.primitive_topology_control) { case Maxwell3D::Regs::PrimitiveTopologyControl::UseInBeginMethods: break; case Maxwell3D::Regs::PrimitiveTopologyControl::UseSeparateState: switch (maxwell3d.regs.topology_override) { - case Maxwell3D::Regs::PrimitiveTopologyOverride::None: + case Override::None: break; - case Maxwell3D::Regs::PrimitiveTopologyOverride::Points: - draw_state.topology = Maxwell3D::Regs::PrimitiveTopology::Points; + case Override::Points: + case Override::LegacyPoints: + draw_state.topology = Topology::Points; break; - case Maxwell3D::Regs::PrimitiveTopologyOverride::Lines: - draw_state.topology = Maxwell3D::Regs::PrimitiveTopology::Lines; + case Override::Lines: + case Override::LegacyLines: + case Override::LegacyLinesImm: + case Override::LegacyIndexedLines: + case Override::LegacyIndexedLines2: + draw_state.topology = Topology::Lines; break; - case Maxwell3D::Regs::PrimitiveTopologyOverride::LineStrip: - draw_state.topology = Maxwell3D::Regs::PrimitiveTopology::LineStrip; + case Override::LineStrip: + case Override::LegacyLineStrip: + case Override::LegacyIndexedLineStrip: + draw_state.topology = Topology::LineStrip; break; - default: - draw_state.topology = Maxwell3D::Regs::PrimitiveTopology(maxwell3d.regs.topology_override); + case Override::Triangles: + case Override::LegacyTriangles: + case Override::LegacyIndexedTriangles: + case Override::LegacyIndexedTriangles2: + draw_state.topology = Topology::Triangles; + break; + case Override::TriangleStrip: + case Override::LegacyTriangleStrip: + case Override::LegacyIndexedTriangleStrip: + draw_state.topology = Topology::TriangleStrip; + break; + case Override::LegacyTriangleFan: + case Override::LegacyTriangleFanImm: + case Override::LegacyIndexedTriangleFan: + draw_state.topology = Topology::TriangleFan; + break; + case Override::LinesAdjacency: + draw_state.topology = Topology::LinesAdjacency; + break; + case Override::LineStripAdjacency: + draw_state.topology = Topology::LineStripAdjacency; + break; + case Override::TrianglesAdjacency: + draw_state.topology = Topology::TrianglesAdjacency; + break; + case Override::TriangleStripAdjacency: + draw_state.topology = Topology::TriangleStripAdjacency; + break; + case Override::Patches: + draw_state.topology = Topology::Patches; break; } break; } + if (u32(draw_state.topology) > u32(Topology::Patches)) { + draw_state.topology = Topology::Triangles; + } } void Maxwell3D::DrawManager::ProcessDraw(Maxwell3D& maxwell3d, bool draw_indexed, u32 instance_count) { diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt index a115bc7b64..468bdc19ec 100644 --- a/src/video_core/host_shaders/CMakeLists.txt +++ b/src/video_core/host_shaders/CMakeLists.txt @@ -78,6 +78,7 @@ set(SHADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_fidelityfx_fsr_easu_fp32.frag ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_fidelityfx_fsr_rcas_fp16.frag ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_fidelityfx_fsr_rcas_fp32.frag + ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_indirect_quads.comp ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_present.frag ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_present.vert ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_present_scaleforce_fp16.frag diff --git a/src/video_core/host_shaders/vulkan_indirect_quads.comp b/src/video_core/host_shaders/vulkan_indirect_quads.comp new file mode 100644 index 0000000000..01bc2f961f --- /dev/null +++ b/src/video_core/host_shaders/vulkan_indirect_quads.comp @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#version 460 core + +layout (local_size_x = 32) in; + +layout (std430, set = 0, binding = 0) readonly buffer InputBuffer { + uint input_commands[]; +}; + +layout (std430, set = 0, binding = 1) writeonly buffer OutputBuffer { + uint output_commands[]; +}; + +layout (push_constant) uniform PushConstants { + uint num_draws; + uint src_stride; +}; + +void main() { + uint draw = gl_GlobalInvocationID.x; + if (draw >= num_draws) { + return; + } + uint src = draw * src_stride; + uint dst = draw * 5; + output_commands[dst + 0] = input_commands[src + 0] / 4 * 6; + output_commands[dst + 1] = input_commands[src + 1]; + output_commands[dst + 2] = input_commands[src + 2] / 4 * 6; + output_commands[dst + 3] = input_commands[src + 3]; + output_commands[dst + 4] = input_commands[src + 4]; +} diff --git a/src/video_core/macro.cpp b/src/video_core/macro.cpp index 86f528af15..ac658f7534 100644 --- a/src/video_core/macro.cpp +++ b/src/video_core/macro.cpp @@ -62,6 +62,10 @@ bool IsTopologySafe(Maxwell3D::Regs::PrimitiveTopology topology) { } } +bool IsTopologySafeIndexedIndirect(Maxwell3D::Regs::PrimitiveTopology topology) { + return IsTopologySafe(topology) || topology == Maxwell3D::Regs::PrimitiveTopology::Quads; +} + } // Anonymous namespace void HLE_DrawArraysIndirect::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { @@ -125,7 +129,7 @@ void HLE_DrawArraysIndirect::Fallback(Core::System& system, Engines::Maxwell3D& void HLE_DrawIndexedIndirect::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { auto topology = static_cast(parameters[0]); - if (!maxwell3d.AnyParametersDirty() || !IsTopologySafe(topology)) { + if (!maxwell3d.AnyParametersDirty() || !IsTopologySafeIndexedIndirect(topology)) { Fallback(system, maxwell3d, parameters); return; } @@ -198,7 +202,7 @@ void HLE_MultiLayerClear::Execute(Core::System& system, Engines::Maxwell3D& maxw } void HLE_MultiDrawIndexedIndirectCount::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { const auto topology = Maxwell3D::Regs::PrimitiveTopology(parameters[2]); - if (IsTopologySafe(topology)) { + if (IsTopologySafeIndexedIndirect(topology)) { const u32 start_indirect = parameters[0]; const u32 end_indirect = parameters[1]; if (start_indirect >= end_indirect) { diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 5aeef5ad3c..a92155881d 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -20,6 +20,7 @@ #include "video_core/host_shaders/queries_prefix_scan_sum_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_nosubgroups_comp_spv.h" #include "video_core/host_shaders/resolve_conditional_render_comp_spv.h" +#include "video_core/host_shaders/vulkan_indirect_quads_comp_spv.h" #include "video_core/host_shaders/vulkan_quad_indexed_comp_spv.h" #include "video_core/host_shaders/vulkan_uint8_comp_spv.h" #include "video_core/renderer_vulkan/vk_compute_pass.h" @@ -375,6 +376,56 @@ std::pair QuadIndexedPass::Assemble( return {staging.buffer, staging.offset}; } +IndirectQuadsPass::IndirectQuadsPass(const Device& device_, Scheduler& scheduler_, + DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_) + : ComputePass(device_, scheduler_, descriptor_pool_, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS, + INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, + COMPUTE_PUSH_CONSTANT_RANGE, VULKAN_INDIRECT_QUADS_COMP_SPV), + scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, + compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} + +IndirectQuadsPass::~IndirectQuadsPass() = default; + +std::pair IndirectQuadsPass::Assemble(u32 num_draws, u32 stride, + VkBuffer src_buffer, u32 src_offset) { + u32 src_stride = stride / static_cast(sizeof(u32)); + if (src_stride < COMMAND_WORDS) { + src_stride = COMMAND_WORDS; + } + const u32 input_size = num_draws * src_stride * static_cast(sizeof(u32)); + const std::size_t staging_size = std::size_t(num_draws) * COMMAND_WORDS * sizeof(u32); + const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal); + + compute_pass_descriptor_queue.Acquire(scheduler, 2); + compute_pass_descriptor_queue.AddBuffer(src_buffer, src_offset, input_size); + compute_pass_descriptor_queue.AddBuffer(staging.buffer, staging.offset, staging_size); + const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; + + scheduler.RequestOutsideRenderPassOperationContext(); + scheduler.Record([this, descriptor_data, num_draws, src_stride](vk::CommandBuffer cmdbuf) { + static constexpr u32 DISPATCH_SIZE = 32; + static constexpr VkMemoryBarrier WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + .pNext = nullptr, + .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, + .dstAccessMask = VK_ACCESS_INDIRECT_COMMAND_READ_BIT, + }; + const std::array push_constants{num_draws, src_stride}; + const VkDescriptorSet set = descriptor_allocator.Commit(); + device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); + cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline); + cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); + cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(push_constants), + &push_constants); + cmdbuf.Dispatch(Common::DivCeil(num_draws, DISPATCH_SIZE), 1, 1); + cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, + VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, 0, WRITE_BARRIER); + }); + return {staging.buffer, staging.offset}; +} + ConditionalRenderingResolvePass::ConditionalRenderingResolvePass( const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, ComputePassDescriptorQueue& compute_pass_descriptor_queue_) diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index 12723099ca..3fdd2c6f01 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h @@ -88,6 +88,25 @@ private: ComputePassDescriptorQueue& compute_pass_descriptor_queue; }; +class IndirectQuadsPass final : public ComputePass { +public: + explicit IndirectQuadsPass(const Device& device_, Scheduler& scheduler_, + DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_); + ~IndirectQuadsPass(); + + static constexpr u32 COMMAND_WORDS = 5; + + std::pair Assemble(u32 num_draws, u32 stride, VkBuffer src_buffer, + u32 src_offset); + +private: + Scheduler& scheduler; + StagingBufferPool& staging_buffer_pool; + ComputePassDescriptorQueue& compute_pass_descriptor_queue; +}; + class ConditionalRenderingResolvePass final : public ComputePass { public: explicit ConditionalRenderingResolvePass( diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 7346c5c269..7fa889e22f 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -212,6 +212,8 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra compute_pass_descriptor_queue(device, UpdateDescriptorQueue::COMPUTE_FRAME_PAYLOAD_SIZE), descriptor_buffer_ring(device, memory_allocator), blit_image(device, scheduler, state_tracker, descriptor_pool), render_pass_cache(device), + indirect_quads_pass(device, scheduler, descriptor_pool, staging_pool, + compute_pass_descriptor_queue), texture_cache_runtime{ device, scheduler, memory_allocator, staging_pool, blit_image, render_pass_cache, descriptor_pool, compute_pass_descriptor_queue}, @@ -314,6 +316,18 @@ void RasterizerVulkan::DrawIndirect() { const auto indirect_buffer = buffer_cache.GetDrawIndirectBuffer(); const auto& buffer = indirect_buffer.first; const auto& offset = indirect_buffer.second; + VkBuffer command_buffer = buffer->Handle(); + VkDeviceSize command_offset = offset; + u32 command_stride = static_cast(params.stride); + if (params.is_indexed && + maxwell3d->draw_manager.draw_state.topology == Maxwell::PrimitiveTopology::Quads) { + const auto patched = indirect_quads_pass.Assemble( + static_cast(params.max_draw_counts), command_stride, command_buffer, + static_cast(offset)); + command_buffer = patched.first; + command_offset = patched.second; + command_stride = IndirectQuadsPass::COMMAND_WORDS * static_cast(sizeof(u32)); + } if (params.is_byte_count) { scheduler.Record([buffer_obj = buffer->Handle(), offset, stride = params.stride](vk::CommandBuffer cmdbuf) { @@ -326,29 +340,32 @@ void RasterizerVulkan::DrawIndirect() { const auto count = buffer_cache.GetDrawIndirectCount(); const auto& draw_buffer = count.first; const auto& offset_base = count.second; - scheduler.Record([draw_buffer_obj = draw_buffer->Handle(), - buffer_obj = buffer->Handle(), offset_base, offset, + scheduler.Record([draw_buffer_obj = draw_buffer->Handle(), command_buffer, + offset_base, command_offset, command_stride, params](vk::CommandBuffer cmdbuf) { if (params.is_indexed) { - cmdbuf.DrawIndexedIndirectCount( - buffer_obj, offset, draw_buffer_obj, offset_base, - static_cast(params.max_draw_counts), static_cast(params.stride)); + cmdbuf.DrawIndexedIndirectCount(command_buffer, command_offset, draw_buffer_obj, + offset_base, + static_cast(params.max_draw_counts), + command_stride); } else { - cmdbuf.DrawIndirectCount(buffer_obj, offset, draw_buffer_obj, offset_base, + cmdbuf.DrawIndirectCount(command_buffer, command_offset, draw_buffer_obj, + offset_base, static_cast(params.max_draw_counts), - static_cast(params.stride)); + command_stride); } }); return; } - scheduler.Record([buffer_obj = buffer->Handle(), offset, params](vk::CommandBuffer cmdbuf) { + scheduler.Record([command_buffer, command_offset, command_stride, + params](vk::CommandBuffer cmdbuf) { if (params.is_indexed) { - cmdbuf.DrawIndexedIndirect(buffer_obj, offset, + cmdbuf.DrawIndexedIndirect(command_buffer, command_offset, static_cast(params.max_draw_counts), - static_cast(params.stride)); + command_stride); } else { - cmdbuf.DrawIndirect(buffer_obj, offset, static_cast(params.max_draw_counts), - static_cast(params.stride)); + cmdbuf.DrawIndirect(command_buffer, command_offset, + static_cast(params.max_draw_counts), command_stride); } }); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index bb7c5ff09e..52ab0742a7 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -17,6 +17,7 @@ #include "video_core/rasterizer_interface.h" #include "video_core/renderer_vulkan/blit_image.h" #include "video_core/renderer_vulkan/vk_buffer_cache.h" +#include "video_core/renderer_vulkan/vk_compute_pass.h" #include "video_core/renderer_vulkan/vk_descriptor_buffer.h" #include "video_core/renderer_vulkan/vk_descriptor_pool.h" #include "video_core/renderer_vulkan/vk_fence_manager.h" @@ -211,6 +212,7 @@ private: DescriptorBufferRing descriptor_buffer_ring; BlitImageHelper blit_image; RenderPassCache render_pass_cache; + IndirectQuadsPass indirect_quads_pass; TextureCacheRuntime texture_cache_runtime; TextureCache texture_cache; diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index 7b6571d33d..b847b66e7c 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -211,7 +211,8 @@ StagingBufferRef StagingBufferPool::CreateStagingBuffer(size_t size, MemoryUsage .size = 1ULL << log2_size, .usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, + VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, .sharingMode = VK_SHARING_MODE_EXCLUSIVE, .queueFamilyIndexCount = 0, .pQueueFamilyIndices = nullptr, From 10528f1ceb6d98ebef77ed985b41bbbec4107132 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 17 Sep 2026 17:19:27 -0400 Subject: [PATCH 064/198] Revert some previous changes partially + maintenance5 changes --- .../buffer_cache/virtual_range_cache.h | 92 +++++++++++++++++-- src/video_core/macro.cpp | 8 +- .../renderer_vulkan/vk_buffer_cache.cpp | 13 ++- .../renderer_vulkan/vk_compute_pass.cpp | 12 ++- .../renderer_vulkan/vk_rasterizer.cpp | 11 --- .../renderer_vulkan/vk_rasterizer.h | 2 - .../vulkan_common/vulkan_wrapper.cpp | 1 + src/video_core/vulkan_common/vulkan_wrapper.h | 6 ++ 8 files changed, 114 insertions(+), 31 deletions(-) diff --git a/src/video_core/buffer_cache/virtual_range_cache.h b/src/video_core/buffer_cache/virtual_range_cache.h index 378df18656..542fb52b23 100644 --- a/src/video_core/buffer_cache/virtual_range_cache.h +++ b/src/video_core/buffer_cache/virtual_range_cache.h @@ -5,7 +5,9 @@ #include #include +#include #include +#include #include @@ -26,22 +28,23 @@ using VirtualSegments = boost::container::small_vector; class VirtualRangeCache { public: static constexpr size_t MAX_ENTRIES = 8192; + static constexpr size_t MAX_DEFERRED = 4096; const VirtualSegments* Query(Tegra::MemoryManager& memory, GPUVAddr gpu_addr, u32 size) { - const u64 current = generation.load(std::memory_order_acquire); + if (has_deferred.load(std::memory_order_acquire)) { + ApplyDeferred(); + } if (entries.size() > MAX_ENTRIES) { entries.clear(); } const size_t as_id = memory.GetID(); const u64 key = MakeKey(as_id, gpu_addr); const auto it = entries.find(key); - if (it != entries.end() && it->second.generation == current && - it->second.as_id == as_id && it->second.gpu_addr == gpu_addr && - it->second.size == size) { + if (it != entries.end() && it->second.as_id == as_id && + it->second.gpu_addr == gpu_addr && it->second.size == size) { return &it->second.segments; } Entry entry{}; - entry.generation = current; entry.as_id = as_id; entry.gpu_addr = gpu_addr; entry.size = size; @@ -76,27 +79,96 @@ public: return &result.first->second.segments; } - void Unmap(size_t, GPUVAddr, u64 size) { - if (size != 0) { - generation.fetch_add(1, std::memory_order_release); + void Unmap(size_t as_id, GPUVAddr gpu_addr, u64 size) { + if (size == 0) { + return; } + { + std::scoped_lock lock{deferred_mutex}; + if (!deferred.empty()) { + DeferredUnmap& last = deferred.back(); + if (last.as_id == as_id && last.gpu_addr + last.size == gpu_addr) { + last.size += size; + has_deferred.store(true, std::memory_order_release); + return; + } + } + if (deferred.size() >= MAX_DEFERRED) { + deferred.clear(); + deferred_overflow = true; + } else { + deferred.push_back(DeferredUnmap{ + .as_id = as_id, + .gpu_addr = gpu_addr, + .size = size, + }); + } + } + has_deferred.store(true, std::memory_order_release); } private: struct Entry { VirtualSegments segments; - u64 generation{}; size_t as_id{}; GPUVAddr gpu_addr{}; u32 size{}; }; + struct DeferredUnmap { + size_t as_id; + GPUVAddr gpu_addr; + u64 size; + }; + static u64 MakeKey(size_t as_id, GPUVAddr gpu_addr) { return (static_cast(as_id) << 48) ^ gpu_addr; } + void ApplyDeferred() { + bool overflow = false; + { + std::scoped_lock lock{deferred_mutex}; + has_deferred.store(false, std::memory_order_release); + pending.clear(); + pending.swap(deferred); + overflow = deferred_overflow; + deferred_overflow = false; + } + if (overflow) { + entries.clear(); + return; + } + if (pending.empty() || entries.empty()) { + return; + } + for (auto it = entries.begin(); it != entries.end();) { + const Entry& entry = it->second; + const GPUVAddr entry_end = entry.gpu_addr + entry.size; + bool overlaps = false; + for (const DeferredUnmap& unmap : pending) { + if (unmap.as_id != entry.as_id) { + continue; + } + if (entry.gpu_addr < unmap.gpu_addr + unmap.size && unmap.gpu_addr < entry_end) { + overlaps = true; + break; + } + } + if (overlaps) { + it = entries.erase(it); + } else { + ++it; + } + } + } + ::Common::unordered_map entries; - std::atomic generation{}; + std::vector deferred; + std::vector pending; + std::mutex deferred_mutex; + std::atomic has_deferred{false}; + bool deferred_overflow{}; }; } // namespace VideoCommon diff --git a/src/video_core/macro.cpp b/src/video_core/macro.cpp index ac658f7534..86f528af15 100644 --- a/src/video_core/macro.cpp +++ b/src/video_core/macro.cpp @@ -62,10 +62,6 @@ bool IsTopologySafe(Maxwell3D::Regs::PrimitiveTopology topology) { } } -bool IsTopologySafeIndexedIndirect(Maxwell3D::Regs::PrimitiveTopology topology) { - return IsTopologySafe(topology) || topology == Maxwell3D::Regs::PrimitiveTopology::Quads; -} - } // Anonymous namespace void HLE_DrawArraysIndirect::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { @@ -129,7 +125,7 @@ void HLE_DrawArraysIndirect::Fallback(Core::System& system, Engines::Maxwell3D& void HLE_DrawIndexedIndirect::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { auto topology = static_cast(parameters[0]); - if (!maxwell3d.AnyParametersDirty() || !IsTopologySafeIndexedIndirect(topology)) { + if (!maxwell3d.AnyParametersDirty() || !IsTopologySafe(topology)) { Fallback(system, maxwell3d, parameters); return; } @@ -202,7 +198,7 @@ void HLE_MultiLayerClear::Execute(Core::System& system, Engines::Maxwell3D& maxw } void HLE_MultiDrawIndexedIndirectCount::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { const auto topology = Maxwell3D::Regs::PrimitiveTopology(parameters[2]); - if (IsTopologySafeIndexedIndirect(topology)) { + if (IsTopologySafe(topology)) { const u32 start_indirect = parameters[0]; const u32 end_indirect = parameters[1]; if (start_indirect >= end_indirect) { diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 958f3b2a2e..f397f9faf4 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -578,29 +578,40 @@ bool BufferCacheRuntime::BindMultiRangeStorageBuffer(u64 key, bool is_written) { void BufferCacheRuntime::BindIndexBuffer(PrimitiveTopology topology, IndexFormat index_format, u32 base_vertex, u32 num_indices, VkBuffer buffer, - u32 offset, [[maybe_unused]] u32 size) { + u32 offset, u32 size) { VkIndexType vk_index_type = MaxwellToVK::IndexFormat(index_format); VkDeviceSize vk_offset = offset; + VkDeviceSize vk_size = size; VkBuffer vk_buffer = buffer; if (topology == PrimitiveTopology::Quads || topology == PrimitiveTopology::QuadStrip) { vk_index_type = VK_INDEX_TYPE_UINT32; + vk_size = VK_WHOLE_SIZE; std::tie(vk_buffer, vk_offset) = quad_index_pass.Assemble(index_format, num_indices, base_vertex, buffer, offset, topology == PrimitiveTopology::QuadStrip); } else if (vk_index_type == VK_INDEX_TYPE_UINT8_EXT && !device.IsExtIndexTypeUint8Supported()) { vk_index_type = VK_INDEX_TYPE_UINT16; if (uint8_pass) { + vk_size = VK_WHOLE_SIZE; std::tie(vk_buffer, vk_offset) = uint8_pass->Assemble(num_indices, buffer, offset); } else if (device.GetDriverID() == VK_DRIVER_ID_QUALCOMM_PROPRIETARY) { ReserveNullBuffer(); vk_buffer = *null_buffer; vk_offset = 0; + vk_size = VK_WHOLE_SIZE; } } if (vk_buffer == VK_NULL_HANDLE) { // Vulkan doesn't support null index buffers. Replace it with our own null buffer. ReserveNullBuffer(); vk_buffer = *null_buffer; + vk_size = VK_WHOLE_SIZE; + } + if (device.IsKhrMaintenance5Supported()) { + scheduler.Record([vk_buffer, vk_offset, vk_size, vk_index_type](vk::CommandBuffer cmdbuf) { + cmdbuf.BindIndexBuffer2KHR(vk_buffer, vk_offset, vk_size, vk_index_type); + }); + return; } scheduler.Record([vk_buffer, vk_offset, vk_index_type](vk::CommandBuffer cmdbuf) { cmdbuf.BindIndexBuffer(vk_buffer, vk_offset, vk_index_type); diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index a92155881d..2fe69a8dc4 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -342,7 +342,17 @@ std::pair QuadIndexedPass::Assemble( return 2; }(); const u32 input_size = num_vertices << index_shift; - const u32 num_tri_vertices = (is_strip ? (num_vertices - 2) / 2 : num_vertices / 4) * 6; + u32 quads = num_vertices / 4; + if (is_strip) { + quads = 0; + if (num_vertices >= 2) { + quads = (num_vertices - 2) / 2; + } + } + if (quads == 0) { + quads = 1; + } + const u32 num_tri_vertices = quads * 6; const std::size_t staging_size = num_tri_vertices * sizeof(u32); const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 7fa889e22f..c7978ea9fc 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -212,8 +212,6 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra compute_pass_descriptor_queue(device, UpdateDescriptorQueue::COMPUTE_FRAME_PAYLOAD_SIZE), descriptor_buffer_ring(device, memory_allocator), blit_image(device, scheduler, state_tracker, descriptor_pool), render_pass_cache(device), - indirect_quads_pass(device, scheduler, descriptor_pool, staging_pool, - compute_pass_descriptor_queue), texture_cache_runtime{ device, scheduler, memory_allocator, staging_pool, blit_image, render_pass_cache, descriptor_pool, compute_pass_descriptor_queue}, @@ -319,15 +317,6 @@ void RasterizerVulkan::DrawIndirect() { VkBuffer command_buffer = buffer->Handle(); VkDeviceSize command_offset = offset; u32 command_stride = static_cast(params.stride); - if (params.is_indexed && - maxwell3d->draw_manager.draw_state.topology == Maxwell::PrimitiveTopology::Quads) { - const auto patched = indirect_quads_pass.Assemble( - static_cast(params.max_draw_counts), command_stride, command_buffer, - static_cast(offset)); - command_buffer = patched.first; - command_offset = patched.second; - command_stride = IndirectQuadsPass::COMMAND_WORDS * static_cast(sizeof(u32)); - } if (params.is_byte_count) { scheduler.Record([buffer_obj = buffer->Handle(), offset, stride = params.stride](vk::CommandBuffer cmdbuf) { diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 52ab0742a7..bb7c5ff09e 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -17,7 +17,6 @@ #include "video_core/rasterizer_interface.h" #include "video_core/renderer_vulkan/blit_image.h" #include "video_core/renderer_vulkan/vk_buffer_cache.h" -#include "video_core/renderer_vulkan/vk_compute_pass.h" #include "video_core/renderer_vulkan/vk_descriptor_buffer.h" #include "video_core/renderer_vulkan/vk_descriptor_pool.h" #include "video_core/renderer_vulkan/vk_fence_manager.h" @@ -212,7 +211,6 @@ private: DescriptorBufferRing descriptor_buffer_ring; BlitImageHelper blit_image; RenderPassCache render_pass_cache; - IndirectQuadsPass indirect_quads_pass; TextureCacheRuntime texture_cache_runtime; TextureCache texture_cache; diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 5044881598..652f864890 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -96,6 +96,7 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdBeginDebugUtilsLabelEXT); X(vkCmdBindDescriptorSets); X(vkCmdBindIndexBuffer); + X(vkCmdBindIndexBuffer2KHR); X(vkCmdBindPipeline); X(vkCmdBindTransformFeedbackBuffersEXT); X(vkCmdBindVertexBuffers); diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 97d2ba3700..2a2c5fedc7 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -211,6 +211,7 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT{}; PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets{}; PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer{}; + PFN_vkCmdBindIndexBuffer2KHR vkCmdBindIndexBuffer2KHR{}; PFN_vkCmdBindPipeline vkCmdBindPipeline{}; PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT{}; PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers{}; @@ -1280,6 +1281,11 @@ public: dld->vkCmdBindIndexBuffer(handle, buffer, offset, index_type); } + void BindIndexBuffer2KHR(VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, + VkIndexType index_type) const noexcept { + dld->vkCmdBindIndexBuffer2KHR(handle, buffer, offset, size, index_type); + } + void BindVertexBuffers(u32 first, u32 count, const VkBuffer* buffers, const VkDeviceSize* offsets) const noexcept { dld->vkCmdBindVertexBuffers(handle, first, count, buffers, offsets); From 17adc28b2c8a5f0dfe2abcbf306570c5b84d3e9f Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 18 Sep 2026 01:18:03 -0400 Subject: [PATCH 065/198] Remove some dead accesors --- .../renderer_vulkan/maxwell_to_vk.cpp | 8 ++- .../renderer_vulkan/vk_graphics_pipeline.cpp | 2 +- .../renderer_vulkan/vk_multi_range_buffer.cpp | 10 +++- .../renderer_vulkan/vk_rasterizer.cpp | 3 + .../vulkan_common/vulkan_device.cpp | 26 +------- src/video_core/vulkan_common/vulkan_device.h | 59 +++++-------------- .../vulkan_common/vulkan_wrapper.cpp | 23 ++++++++ src/video_core/vulkan_common/vulkan_wrapper.h | 3 + 8 files changed, 61 insertions(+), 73 deletions(-) diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index b730ae4d58..dae9fe0269 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp @@ -70,12 +70,14 @@ VkSamplerAddressMode WrapMode(const Device& device, } ASSERT(false); return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; - case Tegra::Texture::WrapMode::MirrorOnceClampToEdge: - return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; case Tegra::Texture::WrapMode::MirrorOnceBorder: UNIMPLEMENTED(); - return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; + [[fallthrough]]; + case Tegra::Texture::WrapMode::MirrorOnceClampToEdge: case Tegra::Texture::WrapMode::MirrorOnceClampOGL: + if (!device.IsKhrSamplerMirrorClampToEdgeSupported()) { + return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + } return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; default: UNIMPLEMENTED_MSG("Unimplemented wrap mode={}", wrap_mode); diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 7ee1c608c0..101fab301e 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -740,7 +740,7 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { .vertexBindingDivisorCount = static_cast(vertex_binding_divisors.size()), .pVertexBindingDivisors = vertex_binding_divisors.data(), }; - if (!vertex_binding_divisors.empty()) { + if (!vertex_binding_divisors.empty() && device.IsExtVertexAttributeDivisorSupported()) { vertex_input_ci.pNext = &input_divisor_ci; } const bool has_tess_stages = spv_modules[1] || spv_modules[2]; diff --git a/src/video_core/renderer_vulkan/vk_multi_range_buffer.cpp b/src/video_core/renderer_vulkan/vk_multi_range_buffer.cpp index 4d84390002..6d1ae5fc53 100644 --- a/src/video_core/renderer_vulkan/vk_multi_range_buffer.cpp +++ b/src/video_core/renderer_vulkan/vk_multi_range_buffer.cpp @@ -32,8 +32,6 @@ MultiRangeBufferCache::MultiRangeBufferCache(const Device& device) { VkDeviceSize MultiRangeBufferCache::QueryBlockSize(const Device& device, u32& memory_type_bits) const { - const VkDevice logical = *device.GetLogical(); - const auto& dld = device.GetDispatchLoader(); const VkBufferCreateInfo probe_ci{ .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, .pNext = nullptr, @@ -44,6 +42,14 @@ VkDeviceSize MultiRangeBufferCache::QueryBlockSize(const Device& device, .queueFamilyIndexCount = 0, .pQueueFamilyIndices = nullptr, }; + if (device.IsKhrMaintenance4Supported()) { + const VkMemoryRequirements reqs = + device.GetLogical().GetDeviceBufferMemoryRequirements(probe_ci); + memory_type_bits = reqs.memoryTypeBits; + return reqs.alignment; + } + const VkDevice logical = *device.GetLogical(); + const auto& dld = device.GetDispatchLoader(); VkBuffer probe{}; if (dld.vkCreateBuffer(logical, &probe_ci, nullptr, &probe) != VK_SUCCESS) { return 0; diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index c7978ea9fc..fd95ea288b 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -326,6 +326,9 @@ void RasterizerVulkan::DrawIndirect() { return; } if (params.include_count) { + if (!device.IsDrawIndirectCountSupported()) { + return; + } const auto count = buffer_cache.GetDrawIndirectCount(); const auto& draw_buffer = count.first; const auto& offset_base = count.second; diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 9a9bfdd43b..27379be506 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -949,6 +949,8 @@ bool Device::GetSuitability(bool requires_swapchain) { extensions.depth_stencil_resolve = extensions.depth_stencil_resolve && (instance_version >= VK_API_VERSION_1_2 || extensions.create_renderpass2); + extensions.draw_indirect_count = + extensions.draw_indirect_count || instance_version >= VK_API_VERSION_1_2; RemoveExtensionIfUnsuitable(extensions.depth_stencil_resolve, VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME); @@ -1408,18 +1410,6 @@ void Device::RemoveUnsuitableExtensions() { features.workgroup_memory_explicit_layout, VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME); - // VK_KHR_maintenance1 - extensions.maintenance1 = loaded_extensions.contains(VK_KHR_MAINTENANCE_1_EXTENSION_NAME); - RemoveExtensionIfUnsuitable(extensions.maintenance1, VK_KHR_MAINTENANCE_1_EXTENSION_NAME); - - // VK_KHR_maintenance2 - extensions.maintenance2 = loaded_extensions.contains(VK_KHR_MAINTENANCE_2_EXTENSION_NAME); - RemoveExtensionIfUnsuitable(extensions.maintenance2, VK_KHR_MAINTENANCE_2_EXTENSION_NAME); - - // VK_KHR_maintenance3 - extensions.maintenance3 = loaded_extensions.contains(VK_KHR_MAINTENANCE_3_EXTENSION_NAME); - RemoveExtensionIfUnsuitable(extensions.maintenance3, VK_KHR_MAINTENANCE_3_EXTENSION_NAME); - // VK_KHR_maintenance4 extensions.maintenance4 = features.maintenance4.maintenance4; RemoveExtensionFeatureIfUnsuitable(extensions.maintenance4, features.maintenance4, @@ -1430,18 +1420,6 @@ void Device::RemoveUnsuitableExtensions() { RemoveExtensionFeatureIfUnsuitable(extensions.maintenance5, features.maintenance5, VK_KHR_MAINTENANCE_5_EXTENSION_NAME); - // VK_KHR_maintenance6 - extensions.maintenance6 = features.maintenance6.maintenance6; - RemoveExtensionFeatureIfUnsuitable(extensions.maintenance6, features.maintenance6, - VK_KHR_MAINTENANCE_6_EXTENSION_NAME); - - // VK_KHR_maintenance7 - extensions.maintenance7 = loaded_extensions.contains(VK_KHR_MAINTENANCE_7_EXTENSION_NAME); - RemoveExtensionIfUnsuitable(extensions.maintenance7, VK_KHR_MAINTENANCE_7_EXTENSION_NAME); - - // VK_KHR_maintenance8 - extensions.maintenance8 = loaded_extensions.contains(VK_KHR_MAINTENANCE_8_EXTENSION_NAME); - RemoveExtensionIfUnsuitable(extensions.maintenance8, VK_KHR_MAINTENANCE_8_EXTENSION_NAME); // VK_KHR_synchronization2 extensions.synchronization2 = features.synchronization2.synchronization2; diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index c6d6df16b1..8b93aad373 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -72,7 +72,6 @@ VK_DEFINE_HANDLE(VmaAllocator) FEATURE(EXT, TransformFeedback, TRANSFORM_FEEDBACK, transform_feedback) \ FEATURE(EXT, VertexInputDynamicState, VERTEX_INPUT_DYNAMIC_STATE, vertex_input_dynamic_state) \ FEATURE(KHR, Maintenance5, MAINTENANCE_5, maintenance5) \ - FEATURE(KHR, Maintenance6, MAINTENANCE_6, maintenance6) \ FEATURE(KHR, PipelineExecutableProperties, PIPELINE_EXECUTABLE_PROPERTIES, \ pipeline_executable_properties) \ FEATURE(KHR, ShaderQuadControl, SHADER_QUAD_CONTROL, shader_quad_control) \ @@ -104,17 +103,11 @@ VK_DEFINE_HANDLE(VmaAllocator) EXTENSION(KHR, SWAPCHAIN, swapchain) \ EXTENSION(KHR, SWAPCHAIN_MUTABLE_FORMAT, swapchain_mutable_format) \ EXTENSION(KHR, IMAGE_FORMAT_LIST, image_format_list) \ - EXTENSION(KHR, MAINTENANCE_1, maintenance1) \ - EXTENSION(KHR, MAINTENANCE_2, maintenance2) \ - EXTENSION(KHR, MAINTENANCE_3, maintenance3) \ - EXTENSION(KHR, MAINTENANCE_7, maintenance7) \ - EXTENSION(KHR, MAINTENANCE_8, maintenance8) \ EXTENSION(NV, DEVICE_DIAGNOSTICS_CONFIG, device_diagnostics_config) \ EXTENSION(NV, GEOMETRY_SHADER_PASSTHROUGH, geometry_shader_passthrough) \ EXTENSION(NV, VIEWPORT_ARRAY2, viewport_array2) \ EXTENSION(NV, VIEWPORT_SWIZZLE, viewport_swizzle) \ EXTENSION(EXT, FILTER_CUBIC, filter_cubic) \ - EXTENSION(IMG, FILTER_CUBIC, filter_cubic_img) \ EXTENSION(QCOM, FILTER_CUBIC_WEIGHTS, filter_cubic_weights) // Define extensions which must be supported. @@ -549,11 +542,6 @@ FN_MAX_LIMIT_LIST return extensions.geometry_shader_passthrough; } - /// Returns true if the device supports VK_KHR_uniform_buffer_standard_layout. - bool IsKhrUniformBufferStandardLayoutSupported() const { - return extensions.uniform_buffer_standard_layout; - } - /// Returns true if the device supports VK_KHR_push_descriptor. bool IsKhrPushDescriptorSupported() const { return extensions.push_descriptor; @@ -1004,27 +992,27 @@ FN_MAX_LIMIT_LIST return features2.features.multiViewport; } - /// Returns true if the device supports VK_KHR_maintenance1. - bool IsKhrMaintenance1Supported() const { - return extensions.maintenance1; - } - - /// Returns true if the device supports VK_KHR_maintenance2. - bool IsKhrMaintenance2Supported() const { - return extensions.maintenance2; - } - - /// Returns true if the device supports VK_KHR_maintenance3. - bool IsKhrMaintenance3Supported() const { - return extensions.maintenance3; - } - + /// Returns true if the device supports VK_KHR_maintenance5. /// Returns true if the device supports VK_KHR_maintenance4. bool IsKhrMaintenance4Supported() const { return extensions.maintenance4; } - /// Returns true if the device supports VK_KHR_maintenance5. + /// Returns true if the device can read the draw count from a buffer. + bool IsDrawIndirectCountSupported() const { + return extensions.draw_indirect_count; + } + + /// Returns true if the device supports VK_EXT_vertex_attribute_divisor. + bool IsExtVertexAttributeDivisorSupported() const { + return extensions.vertex_attribute_divisor; + } + + /// Returns true if the device supports VK_KHR_sampler_mirror_clamp_to_edge. + bool IsKhrSamplerMirrorClampToEdgeSupported() const { + return extensions.sampler_mirror_clamp_to_edge; + } + bool IsKhrMaintenance5Supported() const { return extensions.maintenance5; } @@ -1046,21 +1034,6 @@ FN_MAX_LIMIT_LIST properties.maintenance5.earlyFragmentSampleMaskTestBeforeSampleCounting; } - /// Returns true if the device supports VK_KHR_maintenance6. - bool IsKhrMaintenance6Supported() const { - return extensions.maintenance6; - } - - /// Returns true if the device supports VK_KHR_maintenance7. - bool IsKhrMaintenance7Supported() const { - return extensions.maintenance7; - } - - /// Returns true if the device supports VK_KHR_maintenance8. - bool IsKhrMaintenance8Supported() const { - return extensions.maintenance8; - } - /// Returns true if the device supports UINT8 index buffer conversion via compute shader. bool SupportsUint8Indices() const { return features.bit8_storage.storageBuffer8BitAccess && diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 652f864890..d5012ddd83 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -216,6 +216,7 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkFreeDescriptorSets); X(vkFreeMemory); X(vkGetBufferMemoryRequirements2); + X(vkGetDeviceBufferMemoryRequirements); X(vkGetDeviceQueue); X(vkGetEventStatus); X(vkGetFenceStatus); @@ -266,6 +267,12 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { Proc(dld.vkCmdDrawIndexedIndirectCount, dld, "vkCmdDrawIndexedIndirectCountKHR", device); } + // Maintenance4 queries are core in Vulkan 1.3, otherwise require VK_KHR_maintenance4 + if (!dld.vkGetDeviceBufferMemoryRequirements) { + Proc(dld.vkGetDeviceBufferMemoryRequirements, dld, + "vkGetDeviceBufferMemoryRequirementsKHR", device); + } + // Synchronization2 is core in Vulkan 1.3, otherwise requires VK_KHR_synchronization2 if (!dld.vkCmdPipelineBarrier2) { Proc(dld.vkCmdPipelineBarrier2, dld, "vkCmdPipelineBarrier2KHR", device); @@ -874,6 +881,22 @@ VkMemoryRequirements Device::GetBufferMemoryRequirements(VkBuffer buffer, return requirements.memoryRequirements; } +VkMemoryRequirements Device::GetDeviceBufferMemoryRequirements( + const VkBufferCreateInfo& ci) const noexcept { + const VkDeviceBufferMemoryRequirements info{ + .sType = VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS, + .pNext = nullptr, + .pCreateInfo = &ci, + }; + VkMemoryRequirements2 requirements{ + .sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, + .pNext = nullptr, + .memoryRequirements{}, + }; + dld->vkGetDeviceBufferMemoryRequirements(handle, &info, &requirements); + return requirements.memoryRequirements; +} + VkMemoryRequirements Device::GetImageMemoryRequirements(VkImage image) const noexcept { VkMemoryRequirements requirements; dld->vkGetImageMemoryRequirements(handle, image, &requirements); diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 2a2c5fedc7..5c2d78bc2c 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -332,6 +332,7 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkFreeDescriptorSets vkFreeDescriptorSets{}; PFN_vkFreeMemory vkFreeMemory{}; PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2{}; + PFN_vkGetDeviceBufferMemoryRequirements vkGetDeviceBufferMemoryRequirements{}; PFN_vkGetDeviceQueue vkGetDeviceQueue{}; PFN_vkGetEventStatus vkGetEventStatus{}; PFN_vkGetFenceStatus vkGetFenceStatus{}; @@ -1105,6 +1106,8 @@ public: VkMemoryRequirements GetBufferMemoryRequirements(VkBuffer buffer, void* pnext = nullptr) const noexcept; + VkMemoryRequirements GetDeviceBufferMemoryRequirements(const VkBufferCreateInfo& ci) const noexcept; + VkMemoryRequirements GetImageMemoryRequirements(VkImage image) const noexcept; std::vector GetPipelineExecutablePropertiesKHR( From 08741c919a9b4affa44b178b2f6d367bedb6347b Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 18 Sep 2026 01:56:42 -0400 Subject: [PATCH 066/198] Some changes to GC --- src/video_core/CMakeLists.txt | 1 + src/video_core/buffer_cache/buffer_cache.h | 70 ++++++++++++------- .../buffer_cache/buffer_cache_base.h | 8 +++ src/video_core/cache_reclaim.h | 35 ++++++++++ src/video_core/texture_cache/texture_cache.h | 42 +++++------ .../texture_cache/texture_cache_base.h | 10 ++- 6 files changed, 113 insertions(+), 53 deletions(-) create mode 100644 src/video_core/cache_reclaim.h diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 77883b6484..82f0b68863 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -22,6 +22,7 @@ add_library(video_core STATIC buffer_cache/usage_tracker.h buffer_cache/virtual_range_cache.h buffer_cache/word_manager.h + cache_reclaim.h cache_types.h capture.h cdma_pusher.cpp diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 5705954ae6..061611bdb7 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -30,34 +30,52 @@ BufferCache

::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, R #ifdef YUZU_LEGACY immediately_free = (Settings::values.vram_usage_mode.GetValue() == Settings::VramUsageMode::Aggressive); #endif - if (!runtime.CanReportMemoryUsage()) { - minimum_memory = DEFAULT_EXPECTED_MEMORY; - critical_memory = DEFAULT_CRITICAL_MEMORY; - return; - } - - const s64 device_local_memory = static_cast(runtime.GetDeviceLocalMemory()); - const s64 min_spacing_expected = device_local_memory - 1_GiB; - const s64 min_spacing_critical = device_local_memory - 512_MiB; - const s64 mem_threshold = (std::min)(device_local_memory, TARGET_THRESHOLD); - const s64 min_vacancy_expected = (6 * mem_threshold) / 10; - const s64 min_vacancy_critical = (2 * mem_threshold) / 10; - minimum_memory = static_cast( - (std::max)((std::min)(device_local_memory - min_vacancy_expected, min_spacing_expected), - DEFAULT_EXPECTED_MEMORY)); - critical_memory = static_cast( - (std::max)((std::min)(device_local_memory - min_vacancy_critical, min_spacing_critical), - DEFAULT_CRITICAL_MEMORY)); + device_local_memory = runtime.GetDeviceLocalMemory(); + const auto thresholds = VideoCommon::MakeReclaimThresholds( + device_local_memory, static_cast(TARGET_THRESHOLD), + static_cast(DEFAULT_EXPECTED_MEMORY), static_cast(DEFAULT_CRITICAL_MEMORY)); + minimum_memory = thresholds.minimum; + expected_memory = thresholds.expected; + critical_memory = thresholds.critical; } template BufferCache

::~BufferCache() = default; +template +void BufferCache

::ReclaimInline() { + if (total_used_memory < minimum_memory) { + return; + } + int num_iterations = 8; + const auto clean_up = [this, &num_iterations](BufferId buffer_id) { + if (num_iterations == 0) { + return true; + } + Buffer& buffer = slot_buffers[buffer_id]; + if (memory_tracker.IsRegionGpuModified(buffer.CpuAddr(), buffer.SizeBytes())) { + return false; + } + --num_iterations; + DeleteBuffer(buffer_id); + return false; + }; + lru_cache.ForEachItemBelow(frame_tick - INLINE_TICKS_TO_DESTROY, clean_up); +} + template void BufferCache

::RunGarbageCollector() { - const bool aggressive_gc = total_used_memory >= critical_memory; - const u64 ticks_to_destroy = aggressive_gc ? 60 : 120; - int num_iterations = aggressive_gc ? 64 : 32; + const bool aggressive_gc = heap_pressure || total_used_memory >= critical_memory; + const bool priority_gc = aggressive_gc || total_used_memory >= expected_memory; + u64 ticks_to_destroy = 120; + int num_iterations = 32; + if (aggressive_gc) { + ticks_to_destroy = 30; + num_iterations = 64; + } else if (priority_gc) { + ticks_to_destroy = 60; + num_iterations = 48; + } const auto clean_up = [this, &num_iterations](BufferId buffer_id) { if (num_iterations == 0) { return true; @@ -96,11 +114,12 @@ void BufferCache

::TickFrame() { const bool skip_preferred = hits * 256 < shots * 251; channel_state->uniform_buffer_skip_cache_size = skip_preferred ? DEFAULT_SKIP_CACHE_SIZE : 0; - // If we can obtain the memory info, use it instead of the estimate. - if (runtime.CanReportMemoryUsage()) { - total_used_memory = runtime.GetDeviceMemoryUsage(); + heap_pressure = false; + if (device_local_memory != 0 && runtime.CanReportMemoryUsage()) { + heap_pressure = runtime.GetDeviceMemoryUsage() + HEAP_PRESSURE_HEADROOM >= + device_local_memory; } - if (total_used_memory >= minimum_memory) { + if (total_used_memory >= minimum_memory || heap_pressure) { RunGarbageCollector(); } ++frame_tick; @@ -1674,6 +1693,7 @@ void BufferCache

::JoinOverlap(BufferId new_buffer_id, BufferId overlap_id, template BufferId BufferCache

::CreateBuffer(DAddr device_addr, u32 wanted_size, bool sparse_compatible) { + ReclaimInline(); DAddr device_addr_end = Common::AlignUp(device_addr + wanted_size, CACHING_PAGESIZE); device_addr = Common::AlignDown(device_addr, CACHING_PAGESIZE); wanted_size = static_cast(device_addr_end - device_addr); diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 18997088d3..8afa93b433 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -31,6 +31,7 @@ #include "video_core/buffer_cache/buffer_base.h" #include "video_core/buffer_cache/virtual_range_cache.h" #include "video_core/control/channel_state_cache.h" +#include "video_core/cache_reclaim.h" #include "video_core/delayed_destruction_ring.h" #include "video_core/dirty_flags.h" #include "video_core/engines/maxwell_3d.h" @@ -199,6 +200,8 @@ class BufferCache : public VideoCommon::ChannelSetupCaches compute_segments; u64 frame_tick = 0; u64 total_used_memory = 0; + u64 device_local_memory = 0; u64 minimum_memory = 0; + u64 expected_memory = 0; u64 critical_memory = 0; + bool heap_pressure = false; BufferId inline_buffer_id; #ifdef YUZU_LEGACY bool immediately_free = false; diff --git a/src/video_core/cache_reclaim.h b/src/video_core/cache_reclaim.h new file mode 100644 index 0000000000..aa5c43552f --- /dev/null +++ b/src/video_core/cache_reclaim.h @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include + +#include "common/common_types.h" + +namespace VideoCommon { + +struct ReclaimThresholds { + u64 minimum{}; + u64 expected{}; + u64 critical{}; +}; + +[[nodiscard]] constexpr ReclaimThresholds MakeReclaimThresholds(u64 device_local_memory, + u64 target_threshold, + u64 default_expected, + u64 default_critical) { + u64 critical = default_critical; + if (device_local_memory != 0) { + const u64 budget = (std::min)(device_local_memory, target_threshold); + critical = (std::min)(critical, budget / 2); + } + const u64 expected = (std::min)(default_expected, (critical * 3) / 4); + return ReclaimThresholds{ + .minimum = (expected * 3) / 4, + .expected = expected, + .critical = critical, + }; +} + +} // namespace VideoCommon diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 489ceda94e..2c3a19eb20 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -58,24 +58,14 @@ TextureCache

::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag void(slot_samplers.insert(runtime, sampler_descriptor)); if constexpr (HAS_DEVICE_MEMORY_INFO) { - const s64 device_local_memory = static_cast(runtime.GetDeviceLocalMemory()); - const s64 min_spacing_expected = device_local_memory - 1_GiB; - const s64 min_spacing_critical = device_local_memory - 512_MiB; - const s64 mem_threshold = (std::min)(device_local_memory, TARGET_THRESHOLD); - const s64 min_vacancy_expected = (6 * mem_threshold) / 10; - const s64 min_vacancy_critical = (2 * mem_threshold) / 10; - expected_memory = static_cast( - (std::max)((std::min)(device_local_memory - min_vacancy_expected, min_spacing_expected), - DEFAULT_EXPECTED_MEMORY)); - critical_memory = static_cast( - (std::max)((std::min)(device_local_memory - min_vacancy_critical, min_spacing_critical), - DEFAULT_CRITICAL_MEMORY)); - minimum_memory = static_cast((device_local_memory - mem_threshold) / 2); - } else { - expected_memory = DEFAULT_EXPECTED_MEMORY + 512_MiB; - critical_memory = DEFAULT_CRITICAL_MEMORY + 1_GiB; - minimum_memory = 0; + device_local_memory = runtime.GetDeviceLocalMemory(); } + const auto thresholds = VideoCommon::MakeReclaimThresholds( + device_local_memory, static_cast(TARGET_THRESHOLD), + static_cast(DEFAULT_EXPECTED_MEMORY), static_cast(DEFAULT_CRITICAL_MEMORY)); + minimum_memory = thresholds.minimum; + expected_memory = thresholds.expected; + critical_memory = thresholds.critical; } template @@ -85,8 +75,9 @@ void TextureCache

::RunGarbageCollector() { u64 ticks_to_destroy = 0; size_t num_iterations = 0; const auto Configure = [&](bool allow_aggressive) { - high_priority_mode = total_used_memory >= expected_memory; - aggressive_mode = allow_aggressive && total_used_memory >= critical_memory; + high_priority_mode = heap_pressure || total_used_memory >= expected_memory; + aggressive_mode = + allow_aggressive && (heap_pressure || total_used_memory >= critical_memory); ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL; num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10); }; @@ -100,7 +91,7 @@ void TextureCache

::RunGarbageCollector() { return false; } const bool must_download = IsDownloadable(image) && False(image.flags & ImageFlagBits::BadOverlap); - if ((!aggressive_mode && True(image.flags & ImageFlagBits::CostlyLoad)) || (!high_priority_mode && must_download)) { + if (!aggressive_mode && (must_download || True(image.flags & ImageFlagBits::CostlyLoad))) { return false; } if (must_download) { @@ -126,7 +117,7 @@ void TextureCache

::RunGarbageCollector() { }; Configure(false); lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup); - if (total_used_memory >= critical_memory) { + if (heap_pressure || total_used_memory >= critical_memory) { Configure(true); lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup); } @@ -134,11 +125,12 @@ void TextureCache

::RunGarbageCollector() { template void TextureCache

::TickFrame() { - // If we can obtain the memory info, use it instead of the estimate. - if (runtime.CanReportMemoryUsage()) { - total_used_memory = runtime.GetDeviceMemoryUsage(); + heap_pressure = false; + if (device_local_memory != 0 && runtime.CanReportMemoryUsage()) { + heap_pressure = runtime.GetDeviceMemoryUsage() + HEAP_PRESSURE_HEADROOM >= + device_local_memory; } - if (total_used_memory > minimum_memory) { + if (total_used_memory > minimum_memory || heap_pressure) { RunGarbageCollector(); } sentenced_images.Tick(); diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 29f5bdde83..63b83050e6 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -31,6 +31,7 @@ #include "common/thread_worker.h" #include "video_core/compatible_formats.h" #include "video_core/control/channel_state_cache.h" +#include "video_core/cache_reclaim.h" #include "video_core/delayed_destruction_ring.h" #include "video_core/engines/fermi_2d.h" #include "video_core/surface.h" @@ -121,6 +122,7 @@ class TextureCache : public VideoCommon::ChannelSetupCaches Date: Fri, 18 Sep 2026 03:30:06 -0400 Subject: [PATCH 067/198] Quick change to previous GC adjustment --- src/video_core/buffer_cache/buffer_cache.h | 18 ++++++++++++------ .../buffer_cache/buffer_cache_base.h | 1 + src/video_core/cache_reclaim.h | 5 ++++- src/video_core/texture_cache/texture_cache.h | 9 ++++----- .../texture_cache/texture_cache_base.h | 4 ++-- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 061611bdb7..6066609e45 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -33,10 +33,12 @@ BufferCache

::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, R device_local_memory = runtime.GetDeviceLocalMemory(); const auto thresholds = VideoCommon::MakeReclaimThresholds( device_local_memory, static_cast(TARGET_THRESHOLD), - static_cast(DEFAULT_EXPECTED_MEMORY), static_cast(DEFAULT_CRITICAL_MEMORY)); + static_cast(DEFAULT_EXPECTED_MEMORY), static_cast(DEFAULT_CRITICAL_MEMORY), + HEAP_PRESSURE_HEADROOM); minimum_memory = thresholds.minimum; expected_memory = thresholds.expected; critical_memory = thresholds.critical; + heap_headroom = thresholds.headroom; } template @@ -52,11 +54,11 @@ void BufferCache

::ReclaimInline() { if (num_iterations == 0) { return true; } + --num_iterations; Buffer& buffer = slot_buffers[buffer_id]; if (memory_tracker.IsRegionGpuModified(buffer.CpuAddr(), buffer.SizeBytes())) { return false; } - --num_iterations; DeleteBuffer(buffer_id); return false; }; @@ -116,8 +118,7 @@ void BufferCache

::TickFrame() { heap_pressure = false; if (device_local_memory != 0 && runtime.CanReportMemoryUsage()) { - heap_pressure = runtime.GetDeviceMemoryUsage() + HEAP_PRESSURE_HEADROOM >= - device_local_memory; + heap_pressure = runtime.GetDeviceMemoryUsage() + heap_headroom >= device_local_memory; } if (total_used_memory >= minimum_memory || heap_pressure) { RunGarbageCollector(); @@ -363,6 +364,7 @@ void BufferCache

::DisableGraphicsUniformBuffer(size_t stage, u32 index) { template void BufferCache

::UpdateGraphicsBuffers(bool is_indexed) { + ReclaimInline(); do { channel_state->has_deleted_buffers = false; DoUpdateGraphicsBuffers(is_indexed); @@ -371,6 +373,7 @@ void BufferCache

::UpdateGraphicsBuffers(bool is_indexed) { template void BufferCache

::UpdateComputeBuffers() { + ReclaimInline(); do { channel_state->has_deleted_buffers = false; DoUpdateComputeBuffers(); @@ -1343,7 +1346,7 @@ void BufferCache

::UpdateIndexBuffer() { inline_buffer_id = CreateBuffer(0, buffer_size, false); } if (slot_buffers[inline_buffer_id].SizeBytes() < buffer_size) [[unlikely]] { - slot_buffers.erase(inline_buffer_id); + DeleteBuffer(inline_buffer_id, true); inline_buffer_id = CreateBuffer(0, buffer_size, false); } channel_state->index_buffer = Binding{ @@ -1693,7 +1696,6 @@ void BufferCache

::JoinOverlap(BufferId new_buffer_id, BufferId overlap_id, template BufferId BufferCache

::CreateBuffer(DAddr device_addr, u32 wanted_size, bool sparse_compatible) { - ReclaimInline(); DAddr device_addr_end = Common::AlignUp(device_addr + wanted_size, CACHING_PAGESIZE); device_addr = Common::AlignDown(device_addr, CACHING_PAGESIZE); wanted_size = static_cast(device_addr_end - device_addr); @@ -1994,6 +1996,10 @@ void BufferCache

::DeleteBuffer(BufferId buffer_id, bool do_not_mark) { memory_tracker.MarkRegionAsCpuModified(buffer.CpuAddr(), buffer.SizeBytes()); } + if (inline_buffer_id == buffer_id) { + inline_buffer_id = NULL_BUFFER_ID; + } + Unregister(buffer_id); #ifdef YUZU_LEGACY diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 8afa93b433..b4af2820d5 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -549,6 +549,7 @@ private: u64 minimum_memory = 0; u64 expected_memory = 0; u64 critical_memory = 0; + u64 heap_headroom = 0; bool heap_pressure = false; BufferId inline_buffer_id; #ifdef YUZU_LEGACY diff --git a/src/video_core/cache_reclaim.h b/src/video_core/cache_reclaim.h index aa5c43552f..a8870ea96b 100644 --- a/src/video_core/cache_reclaim.h +++ b/src/video_core/cache_reclaim.h @@ -13,12 +13,14 @@ struct ReclaimThresholds { u64 minimum{}; u64 expected{}; u64 critical{}; + u64 headroom{}; }; [[nodiscard]] constexpr ReclaimThresholds MakeReclaimThresholds(u64 device_local_memory, u64 target_threshold, u64 default_expected, - u64 default_critical) { + u64 default_critical, + u64 default_headroom) { u64 critical = default_critical; if (device_local_memory != 0) { const u64 budget = (std::min)(device_local_memory, target_threshold); @@ -29,6 +31,7 @@ struct ReclaimThresholds { .minimum = (expected * 3) / 4, .expected = expected, .critical = critical, + .headroom = (std::clamp)(device_local_memory / 4, default_headroom, default_headroom * 2), }; } diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 2c3a19eb20..4092036b9e 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -62,10 +62,12 @@ TextureCache

::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag } const auto thresholds = VideoCommon::MakeReclaimThresholds( device_local_memory, static_cast(TARGET_THRESHOLD), - static_cast(DEFAULT_EXPECTED_MEMORY), static_cast(DEFAULT_CRITICAL_MEMORY)); + static_cast(DEFAULT_EXPECTED_MEMORY), static_cast(DEFAULT_CRITICAL_MEMORY), + HEAP_PRESSURE_HEADROOM); minimum_memory = thresholds.minimum; expected_memory = thresholds.expected; critical_memory = thresholds.critical; + heap_headroom = thresholds.headroom; } template @@ -127,8 +129,7 @@ template void TextureCache

::TickFrame() { heap_pressure = false; if (device_local_memory != 0 && runtime.CanReportMemoryUsage()) { - heap_pressure = runtime.GetDeviceMemoryUsage() + HEAP_PRESSURE_HEADROOM >= - device_local_memory; + heap_pressure = runtime.GetDeviceMemoryUsage() + heap_headroom >= device_local_memory; } if (total_used_memory > minimum_memory || heap_pressure) { RunGarbageCollector(); @@ -1320,8 +1321,6 @@ u64 TextureCache

::GetScaledImageSizeBytes(const ImageBase& image) { template void TextureCache

::QueueAsyncDecode(Image& image, ImageId image_id) { UNIMPLEMENTED_IF(False(image.flags & ImageFlagBits::Converted)); - LOG_INFO(HW_GPU, "Queuing async texture decode"); - image.flags |= ImageFlagBits::IsDecoding; auto decode = std::make_unique(); auto* decode_ptr = decode.get(); diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 63b83050e6..7a46134490 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -446,6 +446,7 @@ private: u64 minimum_memory = 0; u64 expected_memory = 0; u64 critical_memory = 0; + u64 heap_headroom = 0; bool heap_pressure = false; struct BufferDownload { @@ -498,8 +499,7 @@ private: u64 modification_tick = 0; u64 frame_tick = 0; - Common::ThreadWorker texture_decode_worker{1, "TextureDecoder", {}, - Common::ThreadPlacement::Efficiency}; + Common::ThreadWorker texture_decode_worker{1, "TextureDecoder"}; std::vector> async_decodes; // Join caching From e9436f8094e3a2ab05b2abc15a75706832e6a18a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 18 Sep 2026 04:28:12 -0400 Subject: [PATCH 068/198] A test to remove uneeded Finish() --- src/video_core/renderer_vulkan/vk_compute_pass.cpp | 11 ++++++----- src/video_core/renderer_vulkan/vk_texture_cache.cpp | 10 +--------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 2fe69a8dc4..914174b92c 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -596,8 +596,9 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, const VkImageMemoryBarrier image_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .pNext = nullptr, - .srcAccessMask = static_cast(is_initialized ? VK_ACCESS_SHADER_WRITE_BIT - : VK_ACCESS_NONE), + .srcAccessMask = static_cast( + is_initialized ? VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT + : VK_ACCESS_NONE), .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, .oldLayout = is_initialized ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_UNDEFINED, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -656,7 +657,8 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .pNext = nullptr, .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, + .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | + VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -671,9 +673,8 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, }, }; cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, 0, image_barrier); + vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, 0, image_barrier); }); - scheduler.Finish(); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index b5ce435d83..1eaaf1eba4 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1899,14 +1899,6 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu } current_image = &Image::original_image; storage_image_views.resize(info.resources.levels); - if (WillUseAcceleratedAstcDecode(runtime->device, info)) { - const auto& device = runtime->device.GetLogical(); - const VkFormat storage_format = VK_FORMAT_A8B8G8R8_UNORM_PACK32; - for (s32 level = 0; level < info.resources.levels; ++level) { - storage_image_views[level] = - MakeStorageView(device, level, *original_image, storage_format); - } - } } Image::Image(const VideoCommon::NullImageParams& params) : VideoCommon::ImageBase{params} {} @@ -2282,7 +2274,7 @@ VkImageView Image::StorageImageView(s32 level) noexcept { if (WillUseAcceleratedAstcDecode(runtime->device, info)) { format_info.format = VK_FORMAT_A8B8G8R8_UNORM_PACK32; } - view = MakeStorageView(runtime->device.GetLogical(), level, *(this->*current_image), + view = MakeStorageView(runtime->device.GetLogical(), level, *original_image, format_info.format); } return *view; From 3cabafc06a8ac255e4a466fbb4711e41b386c644 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 03:30:18 -0400 Subject: [PATCH 069/198] Re-add unswizzle linear 2D to the pass --- .../renderer_vulkan/vk_compute_pass.cpp | 170 ++++++++++++------ .../renderer_vulkan/vk_compute_pass.h | 17 ++ .../renderer_vulkan/vk_texture_cache.cpp | 65 ++++++- .../renderer_vulkan/vk_texture_cache.h | 1 + 4 files changed, 200 insertions(+), 53 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 914174b92c..b542ccceb5 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -17,6 +17,7 @@ #include "common/div_ceil.h" #include "common/vector_math.h" #include "video_core/host_shaders/astc_decoder_comp_spv.h" +#include "video_core/host_shaders/block_linear_unswizzle_2d_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_nosubgroups_comp_spv.h" #include "video_core/host_shaders/resolve_conditional_render_comp_spv.h" @@ -565,6 +566,72 @@ void QueriesPrefixScanPass::Run(VkBuffer accumulation_buffer, VkBuffer dst_buffe } } +namespace { + +void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, VkImage vk_image, + VkImageAspectFlags aspect_mask, bool is_initialized) { + VkAccessFlags src_access = VK_ACCESS_NONE; + VkImageLayout old_layout = VK_IMAGE_LAYOUT_UNDEFINED; + VkPipelineStageFlags src_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + if (is_initialized) { + src_access = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT; + old_layout = VK_IMAGE_LAYOUT_GENERAL; + src_stage = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER; + } + scheduler.Record([vk_pipeline, vk_image, aspect_mask, src_access, old_layout, + src_stage](vk::CommandBuffer cmdbuf) { + const VkImageMemoryBarrier image_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + .pNext = nullptr, + .srcAccessMask = src_access, + .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, + .oldLayout = old_layout, + .newLayout = VK_IMAGE_LAYOUT_GENERAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = vk_image, + .subresourceRange{ + .aspectMask = aspect_mask, + .baseMipLevel = 0, + .levelCount = VK_REMAINING_MIP_LEVELS, + .baseArrayLayer = 0, + .layerCount = VK_REMAINING_ARRAY_LAYERS, + }, + }; + cmdbuf.PipelineBarrier(src_stage, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, image_barrier); + cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, vk_pipeline); + }); +} + +void RecordUnswizzleEndBarrier(Scheduler& scheduler, VkImage vk_image, + VkImageAspectFlags aspect_mask) { + scheduler.Record([vk_image, aspect_mask](vk::CommandBuffer cmdbuf) { + const VkImageMemoryBarrier image_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + .pNext = nullptr, + .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, + .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | + VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .oldLayout = VK_IMAGE_LAYOUT_GENERAL, + .newLayout = VK_IMAGE_LAYOUT_GENERAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = vk_image, + .subresourceRange{ + .aspectMask = aspect_mask, + .baseMipLevel = 0, + .levelCount = VK_REMAINING_MIP_LEVELS, + .baseArrayLayer = 0, + .layerCount = VK_REMAINING_ARRAY_LAYERS, + }, + }; + cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, + vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, 0, image_barrier); + }); +} + +} // Anonymous namespace + ASTCDecoderPass::ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, StagingBufferPool& staging_buffer_pool_, @@ -587,37 +654,10 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, VideoCore::Surface::DefaultBlockHeight(image.info.format), }; scheduler.RequestOutsideRenderPassOperationContext(); - const VkPipeline vk_pipeline = *pipeline; const VkImageAspectFlags aspect_mask = image.AspectMask(); const VkImage vk_image = image.Handle(); - const bool is_initialized = image.ExchangeInitialization(); - scheduler.Record([vk_pipeline, vk_image, aspect_mask, - is_initialized](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier image_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = nullptr, - .srcAccessMask = static_cast( - is_initialized ? VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT - : VK_ACCESS_NONE), - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, - .oldLayout = is_initialized ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_UNDEFINED, - .newLayout = VK_IMAGE_LAYOUT_GENERAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = vk_image, - .subresourceRange{ - .aspectMask = aspect_mask, - .baseMipLevel = 0, - .levelCount = VK_REMAINING_MIP_LEVELS, - .baseArrayLayer = 0, - .layerCount = VK_REMAINING_ARRAY_LAYERS, - }, - }; - cmdbuf.PipelineBarrier(is_initialized ? vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER - : VkPipelineStageFlags(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT), - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, image_barrier); - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, vk_pipeline); - }); + RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + image.ExchangeInitialization()); for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { const size_t input_offset = swizzle.buffer_offset + map.offset; const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 8U); @@ -652,29 +692,55 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); }); } - scheduler.Record([vk_image, aspect_mask](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier image_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, - .oldLayout = VK_IMAGE_LAYOUT_GENERAL, - .newLayout = VK_IMAGE_LAYOUT_GENERAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = vk_image, - .subresourceRange{ - .aspectMask = aspect_mask, - .baseMipLevel = 0, - .levelCount = VK_REMAINING_MIP_LEVELS, - .baseArrayLayer = 0, - .layerCount = VK_REMAINING_ARRAY_LAYERS, - }, - }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, 0, image_barrier); - }); + RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); +} + +BlockLinearUnswizzleImage2DPass::BlockLinearUnswizzleImage2DPass( + const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_) + : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, + ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, + COMPUTE_PUSH_CONSTANT_RANGE< + sizeof(VideoCommon::Accelerated::BlockLinearSwizzle2DParams)>, + BLOCK_LINEAR_UNSWIZZLE_2D_COMP_SPV), + scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, + compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} + +BlockLinearUnswizzleImage2DPass::~BlockLinearUnswizzleImage2DPass() = default; + +void BlockLinearUnswizzleImage2DPass::Unswizzle( + Image& image, const StagingBufferRef& map, + std::span swizzles) { + using namespace VideoCommon::Accelerated; + scheduler.RequestOutsideRenderPassOperationContext(); + const VkImageAspectFlags aspect_mask = image.AspectMask(); + const VkImage vk_image = image.Handle(); + RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + image.ExchangeInitialization()); + for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { + const size_t input_offset = swizzle.buffer_offset + map.offset; + const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 32U); + const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); + const u32 num_dispatches_z = image.info.resources.layers; + + compute_pass_descriptor_queue.Acquire(scheduler, 2); + compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, + image.guest_size_bytes - swizzle.buffer_offset); + compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); + const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; + + const auto params = MakeBlockLinearSwizzle2DParams(swizzle, image.info); + scheduler.Record([this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, + descriptor_data](vk::CommandBuffer cmdbuf) { + const VkDescriptorSet set = descriptor_allocator.Commit(); + device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); + cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); + cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, params); + cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); + }); + } + RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index 3fdd2c6f01..c0bc1e6e88 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h @@ -153,4 +153,21 @@ private: MemoryAllocator& memory_allocator; }; +class BlockLinearUnswizzleImage2DPass final : public ComputePass { +public: + explicit BlockLinearUnswizzleImage2DPass( + const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_); + ~BlockLinearUnswizzleImage2DPass(); + + void Unswizzle(Image& image, const StagingBufferRef& map, + std::span swizzles); + +private: + Scheduler& scheduler; + StagingBufferPool& staging_buffer_pool; + ComputePassDescriptorQueue& compute_pass_descriptor_queue; +}; + } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 1eaaf1eba4..c44546c254 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -158,6 +158,52 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { return info.size.depth == 1; } +[[nodiscard]] VkFormat UnswizzleStorageFormat(u32 bytes_per_block) { + switch (bytes_per_block) { + case 1: + return VK_FORMAT_R8_UINT; + case 2: + return VK_FORMAT_R16_UINT; + case 4: + return VK_FORMAT_R32_UINT; + case 8: + return VK_FORMAT_R32G32_UINT; + case 16: + return VK_FORMAT_R32G32B32A32_UINT; + default: + return VK_FORMAT_UNDEFINED; + } +} + +[[nodiscard]] bool IsUnswizzleAcceleratedFormat(const Device& device, PixelFormat format) { + if (!device.IsStorageBuffer8BitAccessSupported() || + !device.IsStorageBuffer16BitAccessSupported()) { + return false; + } + if (IsPixelFormatASTC(format) || VideoCore::Surface::IsPixelFormatBCn(format)) { + return false; + } + if (VideoCore::Surface::GetFormatType(format) != SurfaceType::ColorTexture) { + return false; + } + const VkFormat storage_format = UnswizzleStorageFormat(BytesPerBlock(format)); + if (storage_format == VK_FORMAT_UNDEFINED) { + return false; + } + return device.IsFormatSupported(storage_format, VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, + FormatType::Optimal); +} + +[[nodiscard]] bool WillUseAcceleratedUnswizzle(const Device& device, const ImageInfo& info) { + if (info.type != ImageType::e2D || info.num_samples > 1) { + return false; + } + if (!device.IsKhrImageFormatListSupported()) { + return false; + } + return IsUnswizzleAcceleratedFormat(device, info.format); +} + [[nodiscard]] VkImageCreateInfo MakeImageCreateInfo(const Device& device, const ImageInfo& info, std::optional format_override = {}) { auto format_info = @@ -944,6 +990,11 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue, memory_allocator); } + if (device.IsKhrImageFormatListSupported() && device.IsStorageBuffer8BitAccessSupported() && + device.IsStorageBuffer16BitAccessSupported()) { + bl_unswizzle_2d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, + compute_pass_descriptor_queue); + } if (!device.IsKhrImageFormatListSupported()) { return; } @@ -951,6 +1002,8 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched const auto image_format = static_cast(index_a); if (IsPixelFormatASTC(image_format) && !device.IsOptimalAstcSupported()) { view_formats[index_a].push_back(VK_FORMAT_A8B8G8R8_UNORM_PACK32); + } else if (IsUnswizzleAcceleratedFormat(device, image_format)) { + view_formats[index_a].push_back(UnswizzleStorageFormat(BytesPerBlock(image_format))); } for (size_t index_b = 0; index_b < VideoCore::Surface::MaxPixelFormat; index_b++) { const auto view_format = static_cast(index_b); @@ -1894,6 +1947,10 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu flags |= VideoCommon::ImageFlagBits::Converted; flags |= VideoCommon::ImageFlagBits::CostlyLoad; } + if (False(flags & VideoCommon::ImageFlagBits::Converted) && + WillUseAcceleratedUnswizzle(runtime->device, info)) { + flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; + } if (runtime->device.HasDebuggingToolAttached()) { original_image.SetObjectNameEXT(VideoCommon::Name(*this).c_str()); } @@ -2273,6 +2330,8 @@ VkImageView Image::StorageImageView(s32 level) noexcept { MaxwellToVK::SurfaceFormat(runtime->device, FormatType::Optimal, true, info.format); if (WillUseAcceleratedAstcDecode(runtime->device, info)) { format_info.format = VK_FORMAT_A8B8G8R8_UNORM_PACK32; + } else if (True(flags & VideoCommon::ImageFlagBits::AcceleratedUpload)) { + format_info.format = UnswizzleStorageFormat(BytesPerBlock(info.format)); } view = MakeStorageView(runtime->device.GetLogical(), level, *original_image, format_info.format); @@ -3079,7 +3138,11 @@ void TextureCacheRuntime::AccelerateImageUpload( if (is_rescaled) { image.ScaleDown(true); } - astc_decoder_pass->Assemble(image, map, swizzles); + if (IsPixelFormatASTC(image.info.format)) { + astc_decoder_pass->Assemble(image, map, swizzles); + } else { + bl_unswizzle_2d_pass->Unswizzle(image, map, swizzles); + } if (is_rescaled) { image.ScaleUp(); } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 6510e10e50..8c86bdd5d2 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -156,6 +156,7 @@ public: BlitImageHelper& blit_image_helper; RenderPassCache& render_pass_cache; std::optional astc_decoder_pass; + std::optional bl_unswizzle_2d_pass; const Settings::ResolutionScalingInfo& resolution; std::array, VideoCore::Surface::MaxPixelFormat> view_formats; From 51d64c298d7127dd7a7e616887196ef6b8f184f3 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 04:40:22 -0400 Subject: [PATCH 070/198] Some reviews on storage views --- .../renderer_vulkan/vk_texture_cache.cpp | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index c44546c254..f3142215ff 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -180,7 +180,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { !device.IsStorageBuffer16BitAccessSupported()) { return false; } - if (IsPixelFormatASTC(format) || VideoCore::Surface::IsPixelFormatBCn(format)) { + if (DefaultBlockWidth(format) != 1 || DefaultBlockHeight(format) != 1) { return false; } if (VideoCore::Surface::GetFormatType(format) != SurfaceType::ColorTexture) { @@ -204,6 +204,29 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { return IsUnswizzleAcceleratedFormat(device, info.format); } +[[nodiscard]] std::array ShaderStorageViewFormats(PixelFormat format) { + if (VideoCore::Surface::GetFormatType(format) != SurfaceType::ColorTexture) { + return {}; + } + if (DefaultBlockWidth(format) != 1 || DefaultBlockHeight(format) != 1) { + return {}; + } + switch (BytesPerBlock(format)) { + case 1: + return {VK_FORMAT_R8_UINT, VK_FORMAT_R8_SINT}; + case 2: + return {VK_FORMAT_R16_UINT, VK_FORMAT_R16_SINT}; + case 4: + return {VK_FORMAT_R32_UINT, VK_FORMAT_UNDEFINED}; + case 8: + return {VK_FORMAT_R32G32_UINT, VK_FORMAT_UNDEFINED}; + case 16: + return {VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_UNDEFINED}; + default: + return {}; + } +} + [[nodiscard]] VkImageCreateInfo MakeImageCreateInfo(const Device& device, const ImageInfo& info, std::optional format_override = {}) { auto format_info = @@ -1002,8 +1025,6 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched const auto image_format = static_cast(index_a); if (IsPixelFormatASTC(image_format) && !device.IsOptimalAstcSupported()) { view_formats[index_a].push_back(VK_FORMAT_A8B8G8R8_UNORM_PACK32); - } else if (IsUnswizzleAcceleratedFormat(device, image_format)) { - view_formats[index_a].push_back(UnswizzleStorageFormat(BytesPerBlock(image_format))); } for (size_t index_b = 0; index_b < VideoCore::Surface::MaxPixelFormat; index_b++) { const auto view_format = static_cast(index_b); @@ -1013,6 +1034,14 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched view_formats[index_a].push_back(view_info.format); } } + auto& formats = view_formats[index_a]; + for (const VkFormat storage_format : ShaderStorageViewFormats(image_format)) { + if (storage_format == VK_FORMAT_UNDEFINED || + std::ranges::find(formats, storage_format) != formats.end()) { + continue; + } + formats.push_back(storage_format); + } } } From 1529e30435165f6df8f10222da55cbff8294a2e9 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 05:18:56 -0400 Subject: [PATCH 071/198] quick tests with dependency flags per attachment stage --- .../renderer_vulkan/vk_render_pass_cache.cpp | 86 +++++++++++++------ 1 file changed, 61 insertions(+), 25 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp index 4d8fa15d16..fc65596eb8 100644 --- a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp @@ -4,6 +4,8 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include + #include "common/container/unordered_map.h" #include @@ -229,17 +231,48 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .preserveAttachmentCount = 0, .pPreserveAttachments = nullptr, }; - const VkSubpassDependency dependency{ - .srcSubpass = 0, // Current subpass - .dstSubpass = 0, // Same subpass (self-dependency) - .srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, + static constexpr VkPipelineStageFlags ATTACHMENT_STAGES = + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT; + static constexpr VkAccessFlags ATTACHMENT_WRITE_ACCESS = + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + static constexpr VkAccessFlags ATTACHMENT_ACCESS = + ATTACHMENT_WRITE_ACCESS | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT; + static constexpr VkPipelineStageFlags OUTSIDE_STAGES = + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | + VK_PIPELINE_STAGE_TRANSFER_BIT; + + const std::array dependencies{ + VkSubpassDependency{ + .srcSubpass = VK_SUBPASS_EXTERNAL, + .dstSubpass = 0, + .srcStageMask = OUTSIDE_STAGES, + .dstStageMask = ATTACHMENT_STAGES, + .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .dstAccessMask = ATTACHMENT_ACCESS, + .dependencyFlags = 0, + }, + VkSubpassDependency{ + .srcSubpass = 0, + .dstSubpass = 0, + .srcStageMask = ATTACHMENT_STAGES, .dstStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, - .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + .srcAccessMask = ATTACHMENT_WRITE_ACCESS, .dstAccessMask = VK_ACCESS_SHADER_READ_BIT, - .dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT + .dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT, + }, + VkSubpassDependency{ + .srcSubpass = 0, + .dstSubpass = VK_SUBPASS_EXTERNAL, + .srcStageMask = ATTACHMENT_STAGES, + .dstStageMask = OUTSIDE_STAGES, + .srcAccessMask = ATTACHMENT_WRITE_ACCESS, + .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_TRANSFER_READ_BIT | + VK_ACCESS_TRANSFER_WRITE_BIT, + .dependencyFlags = 0, + }, }; if (device->IsKhrCreateRenderPass2Supported()) { @@ -299,18 +332,21 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .preserveAttachmentCount = 0, .pPreserveAttachments = nullptr, }; - const VkSubpassDependency2 dependency2{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, - .pNext = nullptr, - .srcSubpass = dependency.srcSubpass, - .dstSubpass = dependency.dstSubpass, - .srcStageMask = dependency.srcStageMask, - .dstStageMask = dependency.dstStageMask, - .srcAccessMask = dependency.srcAccessMask, - .dstAccessMask = dependency.dstAccessMask, - .dependencyFlags = dependency.dependencyFlags, - .viewOffset = 0, - }; + boost::container::static_vector dependencies2; + for (const VkSubpassDependency& dependency : dependencies) { + dependencies2.push_back(VkSubpassDependency2{ + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, + .pNext = nullptr, + .srcSubpass = dependency.srcSubpass, + .dstSubpass = dependency.dstSubpass, + .srcStageMask = dependency.srcStageMask, + .dstStageMask = dependency.dstStageMask, + .srcAccessMask = dependency.srcAccessMask, + .dstAccessMask = dependency.dstAccessMask, + .dependencyFlags = dependency.dependencyFlags, + .viewOffset = 0, + }); + } pair->second = device->GetLogical().CreateRenderPass2({ .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .pNext = nullptr, @@ -319,8 +355,8 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .pAttachments = descriptions2.empty() ? nullptr : descriptions2.data(), .subpassCount = 1, .pSubpasses = &subpass2, - .dependencyCount = 1, - .pDependencies = &dependency2, + .dependencyCount = static_cast(dependencies2.size()), + .pDependencies = dependencies2.data(), .correlatedViewMaskCount = 0, .pCorrelatedViewMasks = nullptr, }); @@ -335,8 +371,8 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .pAttachments = descriptions.empty() ? nullptr : descriptions.data(), .subpassCount = 1, .pSubpasses = &subpass, - .dependencyCount = 1, - .pDependencies = &dependency, + .dependencyCount = static_cast(dependencies.size()), + .pDependencies = dependencies.data(), }); return *pair->second; } From 20d3a4370ab5ada66df337de57930024b7174792 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 05:42:55 -0400 Subject: [PATCH 072/198] Remove the dependency test + remove color texture filter per shasder storage view --- .../renderer_vulkan/vk_render_pass_cache.cpp | 86 ++++++------------- .../renderer_vulkan/vk_texture_cache.cpp | 3 - 2 files changed, 25 insertions(+), 64 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp index fc65596eb8..4d8fa15d16 100644 --- a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp @@ -4,8 +4,6 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include - #include "common/container/unordered_map.h" #include @@ -231,48 +229,17 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .preserveAttachmentCount = 0, .pPreserveAttachments = nullptr, }; - static constexpr VkPipelineStageFlags ATTACHMENT_STAGES = - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT; - static constexpr VkAccessFlags ATTACHMENT_WRITE_ACCESS = - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - static constexpr VkAccessFlags ATTACHMENT_ACCESS = - ATTACHMENT_WRITE_ACCESS | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT; - static constexpr VkPipelineStageFlags OUTSIDE_STAGES = - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_TRANSFER_BIT; - - const std::array dependencies{ - VkSubpassDependency{ - .srcSubpass = VK_SUBPASS_EXTERNAL, - .dstSubpass = 0, - .srcStageMask = OUTSIDE_STAGES, - .dstStageMask = ATTACHMENT_STAGES, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = ATTACHMENT_ACCESS, - .dependencyFlags = 0, - }, - VkSubpassDependency{ - .srcSubpass = 0, - .dstSubpass = 0, - .srcStageMask = ATTACHMENT_STAGES, + const VkSubpassDependency dependency{ + .srcSubpass = 0, // Current subpass + .dstSubpass = 0, // Same subpass (self-dependency) + .srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, .dstStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, - .srcAccessMask = ATTACHMENT_WRITE_ACCESS, + .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, .dstAccessMask = VK_ACCESS_SHADER_READ_BIT, - .dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT, - }, - VkSubpassDependency{ - .srcSubpass = 0, - .dstSubpass = VK_SUBPASS_EXTERNAL, - .srcStageMask = ATTACHMENT_STAGES, - .dstStageMask = OUTSIDE_STAGES, - .srcAccessMask = ATTACHMENT_WRITE_ACCESS, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dependencyFlags = 0, - }, + .dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT }; if (device->IsKhrCreateRenderPass2Supported()) { @@ -332,21 +299,18 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .preserveAttachmentCount = 0, .pPreserveAttachments = nullptr, }; - boost::container::static_vector dependencies2; - for (const VkSubpassDependency& dependency : dependencies) { - dependencies2.push_back(VkSubpassDependency2{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, - .pNext = nullptr, - .srcSubpass = dependency.srcSubpass, - .dstSubpass = dependency.dstSubpass, - .srcStageMask = dependency.srcStageMask, - .dstStageMask = dependency.dstStageMask, - .srcAccessMask = dependency.srcAccessMask, - .dstAccessMask = dependency.dstAccessMask, - .dependencyFlags = dependency.dependencyFlags, - .viewOffset = 0, - }); - } + const VkSubpassDependency2 dependency2{ + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, + .pNext = nullptr, + .srcSubpass = dependency.srcSubpass, + .dstSubpass = dependency.dstSubpass, + .srcStageMask = dependency.srcStageMask, + .dstStageMask = dependency.dstStageMask, + .srcAccessMask = dependency.srcAccessMask, + .dstAccessMask = dependency.dstAccessMask, + .dependencyFlags = dependency.dependencyFlags, + .viewOffset = 0, + }; pair->second = device->GetLogical().CreateRenderPass2({ .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .pNext = nullptr, @@ -355,8 +319,8 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .pAttachments = descriptions2.empty() ? nullptr : descriptions2.data(), .subpassCount = 1, .pSubpasses = &subpass2, - .dependencyCount = static_cast(dependencies2.size()), - .pDependencies = dependencies2.data(), + .dependencyCount = 1, + .pDependencies = &dependency2, .correlatedViewMaskCount = 0, .pCorrelatedViewMasks = nullptr, }); @@ -371,8 +335,8 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .pAttachments = descriptions.empty() ? nullptr : descriptions.data(), .subpassCount = 1, .pSubpasses = &subpass, - .dependencyCount = static_cast(dependencies.size()), - .pDependencies = dependencies.data(), + .dependencyCount = 1, + .pDependencies = &dependency, }); return *pair->second; } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index f3142215ff..4c2617144e 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -205,9 +205,6 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { } [[nodiscard]] std::array ShaderStorageViewFormats(PixelFormat format) { - if (VideoCore::Surface::GetFormatType(format) != SurfaceType::ColorTexture) { - return {}; - } if (DefaultBlockWidth(format) != 1 || DefaultBlockHeight(format) != 1) { return {}; } From 0dd78bbd07828f2d1c67b58eca3f3204352a0e9d Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 06:12:59 -0400 Subject: [PATCH 073/198] Re-add unswizzle 3D pass --- .../renderer_vulkan/maxwell_to_vk.cpp | 16 +--- .../renderer_vulkan/vk_compute_pass.cpp | 73 +++++++++++++++++++ .../renderer_vulkan/vk_compute_pass.h | 17 +++++ .../renderer_vulkan/vk_texture_cache.cpp | 24 ++++-- .../renderer_vulkan/vk_texture_cache.h | 1 + src/video_core/surface.cpp | 4 - src/video_core/surface.h | 4 - .../texture_cache/format_lookup_table.cpp | 9 --- .../vulkan_common/vulkan_device.cpp | 4 - 9 files changed, 111 insertions(+), 41 deletions(-) diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index dae9fe0269..12c311ad35 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp @@ -224,10 +224,6 @@ FormatInfo SurfaceFormat(const Device& device, FormatType format_type, bool with SURFACE_FORMAT_ELEM(VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, 0, ETC2_RGB_SRGB) \ SURFACE_FORMAT_ELEM(VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, 0, ETC2_RGBA_SRGB) \ SURFACE_FORMAT_ELEM(VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, 0, ETC2_RGB_PTA_SRGB) \ - SURFACE_FORMAT_ELEM(VK_FORMAT_EAC_R11_UNORM_BLOCK, 0, EAC_R11_UNORM) \ - SURFACE_FORMAT_ELEM(VK_FORMAT_EAC_R11_SNORM_BLOCK, 0, EAC_R11_SNORM) \ - SURFACE_FORMAT_ELEM(VK_FORMAT_EAC_R11G11_UNORM_BLOCK, 0, EAC_R11G11_UNORM) \ - SURFACE_FORMAT_ELEM(VK_FORMAT_EAC_R11G11_SNORM_BLOCK, 0, EAC_R11G11_SNORM) \ /* Depth formats */ \ SURFACE_FORMAT_ELEM(VK_FORMAT_D32_SFLOAT, usage_attachable, D32_FLOAT) \ SURFACE_FORMAT_ELEM(VK_FORMAT_D16_UNORM, usage_attachable, D16_UNORM) \ @@ -273,17 +269,7 @@ FormatInfo SurfaceFormat(const Device& device, FormatType format_type, bool with } } else if (!device.IsOptimalEtc2Supported() && VideoCore::Surface::IsPixelFormatETC2(pixel_format)) { // Transcode on hardware that doesn't support ETC2 natively - if (pixel_format == PixelFormat::EAC_R11_SNORM) { - tuple.format = VK_FORMAT_R8_SNORM; - } else if (pixel_format == PixelFormat::EAC_R11_UNORM) { - tuple.format = VK_FORMAT_R8_UNORM; - } else if (pixel_format == PixelFormat::EAC_R11G11_SNORM) { - tuple.format = VK_FORMAT_R8G8_SNORM; - } else if (pixel_format == PixelFormat::EAC_R11G11_UNORM) { - tuple.format = VK_FORMAT_R8G8_UNORM; - } else { - tuple.format = is_srgb ? VK_FORMAT_A8B8G8R8_SRGB_PACK32 : VK_FORMAT_A8B8G8R8_UNORM_PACK32; - } + tuple.format = is_srgb ? VK_FORMAT_A8B8G8R8_SRGB_PACK32 : VK_FORMAT_A8B8G8R8_UNORM_PACK32; } bool const attachable = (tuple.usage & usage_attachable) != 0; bool const storage = (tuple.usage & usage_storage) != 0; diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index b542ccceb5..d8137d6fab 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -18,6 +18,7 @@ #include "common/vector_math.h" #include "video_core/host_shaders/astc_decoder_comp_spv.h" #include "video_core/host_shaders/block_linear_unswizzle_2d_comp_spv.h" +#include "video_core/host_shaders/block_linear_unswizzle_3d_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_nosubgroups_comp_spv.h" #include "video_core/host_shaders/resolve_conditional_render_comp_spv.h" @@ -186,6 +187,19 @@ struct AstcPushConstants { u32 block_height_mask; }; +struct BlockLinear3DImagePushConstants { + alignas(16) std::array origin; + alignas(16) std::array destination; + u32 bytes_per_block_log2; + u32 slice_size; + u32 block_size; + u32 x_shift; + u32 block_height; + u32 block_height_mask; + u32 block_depth; + u32 block_depth_mask; +}; + struct QueriesPrefixScanPushConstants { u32 min_accumulation_base; u32 max_accumulation_base; @@ -743,4 +757,63 @@ void BlockLinearUnswizzleImage2DPass::Unswizzle( RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); } +BlockLinearUnswizzleImage3DPass::BlockLinearUnswizzleImage3DPass( + const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_) + : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, + ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, + COMPUTE_PUSH_CONSTANT_RANGE, + BLOCK_LINEAR_UNSWIZZLE_3D_COMP_SPV), + scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, + compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} + +BlockLinearUnswizzleImage3DPass::~BlockLinearUnswizzleImage3DPass() = default; + +void BlockLinearUnswizzleImage3DPass::Unswizzle( + Image& image, const StagingBufferRef& map, + std::span swizzles) { + using namespace VideoCommon::Accelerated; + scheduler.RequestOutsideRenderPassOperationContext(); + const VkImageAspectFlags aspect_mask = image.AspectMask(); + const VkImage vk_image = image.Handle(); + RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + image.ExchangeInitialization()); + for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { + const size_t input_offset = swizzle.buffer_offset + map.offset; + const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 16U); + const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); + const u32 num_dispatches_z = Common::DivCeil(swizzle.num_tiles.depth, 2U); + + compute_pass_descriptor_queue.Acquire(scheduler, 2); + compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, + image.guest_size_bytes - swizzle.buffer_offset); + compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); + const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; + + const auto p = MakeBlockLinearSwizzle3DParams(swizzle, image.info); + const BlockLinear3DImagePushConstants params{ + .origin = p.origin, + .destination = p.destination, + .bytes_per_block_log2 = p.bytes_per_block_log2, + .slice_size = p.slice_size, + .block_size = p.block_size, + .x_shift = p.x_shift, + .block_height = p.block_height, + .block_height_mask = p.block_height_mask, + .block_depth = p.block_depth, + .block_depth_mask = p.block_depth_mask, + }; + scheduler.Record([this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, + descriptor_data](vk::CommandBuffer cmdbuf) { + const VkDescriptorSet set = descriptor_allocator.Commit(); + device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); + cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); + cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, params); + cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); + }); + } + RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); +} + } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index c0bc1e6e88..d791554d32 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h @@ -153,6 +153,23 @@ private: MemoryAllocator& memory_allocator; }; +class BlockLinearUnswizzleImage3DPass final : public ComputePass { +public: + explicit BlockLinearUnswizzleImage3DPass( + const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_); + ~BlockLinearUnswizzleImage3DPass(); + + void Unswizzle(Image& image, const StagingBufferRef& map, + std::span swizzles); + +private: + Scheduler& scheduler; + StagingBufferPool& staging_buffer_pool; + ComputePassDescriptorQueue& compute_pass_descriptor_queue; +}; + class BlockLinearUnswizzleImage2DPass final : public ComputePass { public: explicit BlockLinearUnswizzleImage2DPass( diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 4c2617144e..fb64e89574 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -195,7 +195,8 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { } [[nodiscard]] bool WillUseAcceleratedUnswizzle(const Device& device, const ImageInfo& info) { - if (info.type != ImageType::e2D || info.num_samples > 1) { + const bool supported_type = info.type == ImageType::e2D || info.type == ImageType::e3D; + if (!supported_type || info.num_samples > 1) { return false; } if (!device.IsKhrImageFormatListSupported()) { @@ -313,7 +314,12 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { } [[nodiscard]] vk::ImageView MakeStorageView(const vk::Device& device, u32 level, VkImage image, - VkFormat format) { + VkFormat format, + VkImageViewType view_type) { + u32 layer_count = VK_REMAINING_ARRAY_LAYERS; + if (view_type == VK_IMAGE_VIEW_TYPE_3D) { + layer_count = 1; + } static constexpr VkImageViewUsageCreateInfo storage_image_view_usage_create_info{ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, .pNext = nullptr, @@ -324,7 +330,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { .pNext = &storage_image_view_usage_create_info, .flags = 0, .image = image, - .viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY, + .viewType = view_type, .format = format, .components{ .r = VK_COMPONENT_SWIZZLE_IDENTITY, @@ -337,7 +343,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { .baseMipLevel = level, .levelCount = 1, .baseArrayLayer = 0, - .layerCount = VK_REMAINING_ARRAY_LAYERS, + .layerCount = layer_count, }, }); } @@ -1014,6 +1020,8 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched device.IsStorageBuffer16BitAccessSupported()) { bl_unswizzle_2d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue); + bl_unswizzle_3d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, + compute_pass_descriptor_queue); } if (!device.IsKhrImageFormatListSupported()) { return; @@ -2354,13 +2362,17 @@ VkImageView Image::StorageImageView(s32 level) noexcept { if (!view) { auto format_info = MaxwellToVK::SurfaceFormat(runtime->device, FormatType::Optimal, true, info.format); + VkImageViewType view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY; if (WillUseAcceleratedAstcDecode(runtime->device, info)) { format_info.format = VK_FORMAT_A8B8G8R8_UNORM_PACK32; } else if (True(flags & VideoCommon::ImageFlagBits::AcceleratedUpload)) { format_info.format = UnswizzleStorageFormat(BytesPerBlock(info.format)); + if (info.type == ImageType::e3D) { + view_type = VK_IMAGE_VIEW_TYPE_3D; + } } view = MakeStorageView(runtime->device.GetLogical(), level, *original_image, - format_info.format); + format_info.format, view_type); } return *view; } @@ -3166,6 +3178,8 @@ void TextureCacheRuntime::AccelerateImageUpload( } if (IsPixelFormatASTC(image.info.format)) { astc_decoder_pass->Assemble(image, map, swizzles); + } else if (image.info.type == ImageType::e3D) { + bl_unswizzle_3d_pass->Unswizzle(image, map, swizzles); } else { bl_unswizzle_2d_pass->Unswizzle(image, map, swizzles); } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 8c86bdd5d2..5023a94b8b 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -157,6 +157,7 @@ public: RenderPassCache& render_pass_cache; std::optional astc_decoder_pass; std::optional bl_unswizzle_2d_pass; + std::optional bl_unswizzle_3d_pass; const Settings::ResolutionScalingInfo& resolution; std::array, VideoCore::Surface::MaxPixelFormat> view_formats; diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index fa9554db59..d1b9bf4151 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -343,10 +343,6 @@ bool IsPixelFormatETC2(PixelFormat format) { case PixelFormat::ETC2_RGB_SRGB: case PixelFormat::ETC2_RGBA_SRGB: case PixelFormat::ETC2_RGB_PTA_SRGB: - case PixelFormat::EAC_R11_UNORM: - case PixelFormat::EAC_R11_SNORM: - case PixelFormat::EAC_R11G11_UNORM: - case PixelFormat::EAC_R11G11_SNORM: return true; default: return false; diff --git a/src/video_core/surface.h b/src/video_core/surface.h index 8e1973d3b9..5611dbdffa 100644 --- a/src/video_core/surface.h +++ b/src/video_core/surface.h @@ -119,10 +119,6 @@ namespace VideoCore::Surface { PIXEL_FORMAT_ELEM(ETC2_RGB_SRGB, 4, 4, 64) \ PIXEL_FORMAT_ELEM(ETC2_RGBA_SRGB, 4, 4, 128) \ PIXEL_FORMAT_ELEM(ETC2_RGB_PTA_SRGB, 4, 4, 64) \ - PIXEL_FORMAT_ELEM(EAC_R11_UNORM, 4, 4, 64) \ - PIXEL_FORMAT_ELEM(EAC_R11_SNORM, 4, 4, 64) \ - PIXEL_FORMAT_ELEM(EAC_R11G11_UNORM, 4, 4, 128) \ - PIXEL_FORMAT_ELEM(EAC_R11G11_SNORM, 4, 4, 128) \ /* Depth formats */ \ PIXEL_FORMAT_ELEM(D32_FLOAT, 1, 1, 32) \ PIXEL_FORMAT_ELEM(D16_UNORM, 1, 1, 16) \ diff --git a/src/video_core/texture_cache/format_lookup_table.cpp b/src/video_core/texture_cache/format_lookup_table.cpp index d6e019cddf..ea68a1c063 100644 --- a/src/video_core/texture_cache/format_lookup_table.cpp +++ b/src/video_core/texture_cache/format_lookup_table.cpp @@ -204,15 +204,6 @@ PixelFormat PixelFormatFromTextureInfo(TextureFormat format, ComponentType red, return PixelFormat::ETC2_RGB_PTA_SRGB; case Hash(TextureFormat::ETC2_RGBA, UNORM, SRGB): return PixelFormat::ETC2_RGBA_SRGB; - /* EAC */ - case Hash(TextureFormat::EAC, UNORM): - return PixelFormat::EAC_R11_UNORM; - case Hash(TextureFormat::EAC, SNORM): - return PixelFormat::EAC_R11_SNORM; - case Hash(TextureFormat::EACX2, UNORM): - return PixelFormat::EAC_R11G11_UNORM; - case Hash(TextureFormat::EACX2, SNORM): - return PixelFormat::EAC_R11G11_SNORM; /* ASTC */ case Hash(TextureFormat::ASTC_2D_4X4, UNORM, LINEAR): return PixelFormat::ASTC_2D_4X4_UNORM; diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 27379be506..1e15f05156 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -301,10 +301,6 @@ VkFormatFeatureFlags GetFormatFeatures(VkFormatProperties properties, FormatType VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, - VK_FORMAT_EAC_R11_UNORM_BLOCK, - VK_FORMAT_EAC_R11_SNORM_BLOCK, - VK_FORMAT_EAC_R11G11_UNORM_BLOCK, - VK_FORMAT_EAC_R11G11_SNORM_BLOCK, }; ::Common::unordered_map format_properties; for (const auto format : formats) { From 3a22f908a3275039113bfb3ffe78f0d40688c142 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 06:44:30 -0400 Subject: [PATCH 074/198] Re-add pitch 2D pass --- .../renderer_vulkan/vk_compute_pass.cpp | 61 +++++++++++++++++++ .../renderer_vulkan/vk_compute_pass.h | 17 ++++++ .../renderer_vulkan/vk_texture_cache.cpp | 11 +++- .../renderer_vulkan/vk_texture_cache.h | 1 + 4 files changed, 88 insertions(+), 2 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index d8137d6fab..4dd65f0269 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -12,6 +12,8 @@ #include "video_core/renderer_vulkan/vk_texture_cache.h" +#include + #include "common/assert.h" #include "common/common_types.h" #include "common/div_ceil.h" @@ -19,6 +21,7 @@ #include "video_core/host_shaders/astc_decoder_comp_spv.h" #include "video_core/host_shaders/block_linear_unswizzle_2d_comp_spv.h" #include "video_core/host_shaders/block_linear_unswizzle_3d_comp_spv.h" +#include "video_core/host_shaders/pitch_unswizzle_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_comp_spv.h" #include "video_core/host_shaders/queries_prefix_scan_sum_nosubgroups_comp_spv.h" #include "video_core/host_shaders/resolve_conditional_render_comp_spv.h" @@ -200,6 +203,13 @@ struct BlockLinear3DImagePushConstants { u32 block_depth_mask; }; +struct PitchUnswizzlePushConstants { + std::array origin; + std::array destination; + u32 bytes_per_block_log2; + u32 pitch; +}; + struct QueriesPrefixScanPushConstants { u32 min_accumulation_base; u32 max_accumulation_base; @@ -816,4 +826,55 @@ void BlockLinearUnswizzleImage3DPass::Unswizzle( RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); } +PitchUnswizzlePass::PitchUnswizzlePass(const Device& device_, Scheduler& scheduler_, + DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_) + : ComputePass(device_, scheduler_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, + ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, + COMPUTE_PUSH_CONSTANT_RANGE, + PITCH_UNSWIZZLE_COMP_SPV), + scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, + compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} + +PitchUnswizzlePass::~PitchUnswizzlePass() = default; + +void PitchUnswizzlePass::Unswizzle(Image& image, const StagingBufferRef& map, + std::span swizzles) { + const u32 bytes_per_block = VideoCore::Surface::BytesPerBlock(image.info.format); + ASSERT(std::has_single_bit(bytes_per_block)); + scheduler.RequestOutsideRenderPassOperationContext(); + const VkImageAspectFlags aspect_mask = image.AspectMask(); + const VkImage vk_image = image.Handle(); + RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + image.ExchangeInitialization()); + for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { + const size_t input_offset = swizzle.buffer_offset + map.offset; + const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 32U); + const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); + + compute_pass_descriptor_queue.Acquire(scheduler, 2); + compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, + image.guest_size_bytes - swizzle.buffer_offset); + compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); + const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; + + const PitchUnswizzlePushConstants params{ + .origin = {0, 0}, + .destination = {0, 0}, + .bytes_per_block_log2 = static_cast(std::countr_zero(bytes_per_block)), + .pitch = image.info.pitch, + }; + scheduler.Record([this, num_dispatches_x, num_dispatches_y, params, + descriptor_data](vk::CommandBuffer cmdbuf) { + const VkDescriptorSet set = descriptor_allocator.Commit(); + device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); + cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); + cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, params); + cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, 1); + }); + } + RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); +} + } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index d791554d32..f871648647 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h @@ -153,6 +153,23 @@ private: MemoryAllocator& memory_allocator; }; +class PitchUnswizzlePass final : public ComputePass { +public: + explicit PitchUnswizzlePass(const Device& device_, Scheduler& scheduler_, + DescriptorPool& descriptor_pool_, + StagingBufferPool& staging_buffer_pool_, + ComputePassDescriptorQueue& compute_pass_descriptor_queue_); + ~PitchUnswizzlePass(); + + void Unswizzle(Image& image, const StagingBufferRef& map, + std::span swizzles); + +private: + Scheduler& scheduler; + StagingBufferPool& staging_buffer_pool; + ComputePassDescriptorQueue& compute_pass_descriptor_queue; +}; + class BlockLinearUnswizzleImage3DPass final : public ComputePass { public: explicit BlockLinearUnswizzleImage3DPass( diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index fb64e89574..749a49c898 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -195,7 +195,8 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { } [[nodiscard]] bool WillUseAcceleratedUnswizzle(const Device& device, const ImageInfo& info) { - const bool supported_type = info.type == ImageType::e2D || info.type == ImageType::e3D; + const bool supported_type = info.type == ImageType::e2D || info.type == ImageType::e3D || + info.type == ImageType::Linear; if (!supported_type || info.num_samples > 1) { return false; } @@ -317,7 +318,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { VkFormat format, VkImageViewType view_type) { u32 layer_count = VK_REMAINING_ARRAY_LAYERS; - if (view_type == VK_IMAGE_VIEW_TYPE_3D) { + if (view_type != VK_IMAGE_VIEW_TYPE_2D_ARRAY) { layer_count = 1; } static constexpr VkImageViewUsageCreateInfo storage_image_view_usage_create_info{ @@ -1022,6 +1023,8 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched compute_pass_descriptor_queue); bl_unswizzle_3d_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue); + pitch_unswizzle_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, + compute_pass_descriptor_queue); } if (!device.IsKhrImageFormatListSupported()) { return; @@ -2369,6 +2372,8 @@ VkImageView Image::StorageImageView(s32 level) noexcept { format_info.format = UnswizzleStorageFormat(BytesPerBlock(info.format)); if (info.type == ImageType::e3D) { view_type = VK_IMAGE_VIEW_TYPE_3D; + } else if (info.type == ImageType::Linear) { + view_type = VK_IMAGE_VIEW_TYPE_2D; } } view = MakeStorageView(runtime->device.GetLogical(), level, *original_image, @@ -3180,6 +3185,8 @@ void TextureCacheRuntime::AccelerateImageUpload( astc_decoder_pass->Assemble(image, map, swizzles); } else if (image.info.type == ImageType::e3D) { bl_unswizzle_3d_pass->Unswizzle(image, map, swizzles); + } else if (image.info.type == ImageType::Linear) { + pitch_unswizzle_pass->Unswizzle(image, map, swizzles); } else { bl_unswizzle_2d_pass->Unswizzle(image, map, swizzles); } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 5023a94b8b..2e6b547e72 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -158,6 +158,7 @@ public: std::optional astc_decoder_pass; std::optional bl_unswizzle_2d_pass; std::optional bl_unswizzle_3d_pass; + std::optional pitch_unswizzle_pass; const Settings::ResolutionScalingInfo& resolution; std::array, VideoCore::Surface::MaxPixelFormat> view_formats; From 8a8c7f4c06ee78f579312d529cbfec8e50543dab Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 13:46:49 -0400 Subject: [PATCH 075/198] addresing MHR regression --- src/video_core/buffer_cache/buffer_cache.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 6066609e45..eb214af50e 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1042,11 +1042,6 @@ void BufferCache

::ResolveMultiRangeStorage(Binding& binding, return; } const VirtualSegments segments = *found; - for (const VirtualSegment& segment : segments) { - if (memory_tracker.IsRegionGpuModified(segment.device_addr, segment.size)) { - return; - } - } const u32 first = static_cast(pool.size()); const bool prefer_sparse = runtime.PrefersSparseSources(); for (const VirtualSegment& segment : segments) { From 09371eab6052b916676a5a2a9cc3d7320acca7bd Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 15:33:10 -0400 Subject: [PATCH 076/198] Remove dead code om VMA --- .../renderer_vulkan/vk_buffer_cache.cpp | 1 - .../vulkan_common/vulkan_memory_allocator.cpp | 222 +++--------------- .../vulkan_common/vulkan_memory_allocator.h | 70 ------ 3 files changed, 34 insertions(+), 259 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index f397f9faf4..da2d36e41e 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -263,7 +263,6 @@ protected: StagingBufferPool& staging_pool; vk::Buffer buffer{}; - MemoryCommit memory_commit{}; VkIndexType index_type{}; u32 num_indices = 0; }; diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp index 4d2d5b1317..31a909ef2f 100644 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp @@ -4,20 +4,8 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include -#include -#include -#include -#include -#include -#include - -#include "common/alignment.h" -#include "common/assert.h" #include "common/common_types.h" #include "common/literals.h" -#include "common/logging.h" -#include #include "video_core/vulkan_common/vma.h" #include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_memory_allocator.h" @@ -53,6 +41,26 @@ namespace { return {}; } + template + [[nodiscard]] VkResult AllocateRelaxing(VmaAllocationCreateInfo& ci, F&& allocate) { + VkResult result = allocate(ci); + if (result == VK_SUCCESS) { + return result; + } + if ((ci.flags & VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT) != 0) { + ci.flags &= ~VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT; + result = allocate(ci); + if (result == VK_SUCCESS) { + return result; + } + } + if ((ci.preferredFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) { + ci.preferredFlags &= ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + result = allocate(ci); + } + return result; + } + [[nodiscard]] VmaMemoryUsage MemoryUsageVma(MemoryUsage usage) { switch (usage) { case MemoryUsage::DeviceLocal: @@ -66,106 +74,9 @@ namespace { } } // namespace -//MemoryCommit is now VMA-backed -MemoryCommit::MemoryCommit(VmaAllocator alloc, VmaAllocation a, - const VmaAllocationInfo &info) noexcept - : allocator{alloc}, allocation{a}, memory{info.deviceMemory}, - offset{info.offset}, size{info.size}, mapped_ptr{info.pMappedData} { - // Log GPU memory allocation - if (GPU::Logging::IsActive() && - Settings::values.gpu_log_memory_tracking.GetValue()) { - GPU::Logging::GPULogger::GetInstance().LogMemoryAllocation( - reinterpret_cast(memory), - static_cast(size), - 0 // Memory property flags (not easily available from VMA) - ); - } -} - -MemoryCommit::~MemoryCommit() { Release(); } - -MemoryCommit::MemoryCommit(MemoryCommit &&rhs) noexcept - : allocator{std::exchange(rhs.allocator, nullptr)}, - allocation{std::exchange(rhs.allocation, nullptr)}, - memory{std::exchange(rhs.memory, VK_NULL_HANDLE)}, - offset{std::exchange(rhs.offset, 0)}, - size{std::exchange(rhs.size, 0)}, - mapped_ptr{std::exchange(rhs.mapped_ptr, nullptr)} {} - -MemoryCommit &MemoryCommit::operator=(MemoryCommit &&rhs) noexcept { - if (this != &rhs) { - Release(); - allocator = std::exchange(rhs.allocator, nullptr); - allocation = std::exchange(rhs.allocation, nullptr); - memory = std::exchange(rhs.memory, VK_NULL_HANDLE); - offset = std::exchange(rhs.offset, 0); - size = std::exchange(rhs.size, 0); - mapped_ptr = std::exchange(rhs.mapped_ptr, nullptr); - } - return *this; -} - -std::span MemoryCommit::Map() -{ - if (!allocation) return {}; - if (!mapped_ptr) { - if (vmaMapMemory(allocator, allocation, &mapped_ptr) != VK_SUCCESS) return {}; - } - const size_t n = static_cast(std::min(size, - (std::numeric_limits::max)())); - return std::span{static_cast(mapped_ptr), n}; -} - -std::span MemoryCommit::Map() const -{ - if (!allocation) return {}; - if (!mapped_ptr) { - void *p = nullptr; - if (vmaMapMemory(allocator, allocation, &p) != VK_SUCCESS) return {}; - const_cast(this)->mapped_ptr = p; - } - const size_t n = static_cast(std::min(size, - (std::numeric_limits::max)())); - return std::span{static_cast(mapped_ptr), n}; -} - -void MemoryCommit::Unmap() -{ - if (allocation && mapped_ptr) { - vmaUnmapMemory(allocator, allocation); - mapped_ptr = nullptr; - } -} - -void MemoryCommit::Release() { - if (allocation && allocator) { - // Log GPU memory deallocation - if (GPU::Logging::IsActive() && - Settings::values.gpu_log_memory_tracking.GetValue() && - memory != VK_NULL_HANDLE) { - GPU::Logging::GPULogger::GetInstance().LogMemoryDeallocation( - reinterpret_cast(memory) - ); - } - - if (mapped_ptr) { - vmaUnmapMemory(allocator, allocation); - mapped_ptr = nullptr; - } - vmaFreeMemory(allocator, allocation); - } - allocation = nullptr; - allocator = nullptr; - memory = VK_NULL_HANDLE; - offset = 0; - size = 0; -} - MemoryAllocator::MemoryAllocator(const Device &device_) : device{device_}, allocator{device.GetAllocator()}, - properties{device_.GetPhysical().GetMemoryProperties().memoryProperties}, - buffer_image_granularity{ - device_.GetPhysical().GetProperties().limits.bufferImageGranularity} { + properties{device_.GetPhysical().GetMemoryProperties().memoryProperties} { // Preserve the previous "RenderDoc small heap" trimming behavior that we had in original vma minus the heap bug if (device.HasDebuggingToolAttached()) @@ -187,7 +98,7 @@ MemoryAllocator::~MemoryAllocator() = default; vk::Image MemoryAllocator::CreateImage(const VkImageCreateInfo &ci) const { - const VmaAllocationCreateInfo alloc_ci = { + VmaAllocationCreateInfo alloc_ci = { .flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT, .usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE, .requiredFlags = 0, @@ -201,7 +112,9 @@ vk::Image MemoryAllocator::CreateImage(const VkImageCreateInfo &ci) const VkImage handle{}; VmaAllocation allocation{}; VmaAllocationInfo alloc_info{}; - vk::Check(vmaCreateImage(allocator, &ci, &alloc_ci, &handle, &allocation, &alloc_info)); + vk::Check(AllocateRelaxing(alloc_ci, [&](const VmaAllocationCreateInfo& retry) { + return vmaCreateImage(allocator, &ci, &retry, &handle, &allocation, &alloc_info); + })); // Log GPU memory allocation for images if (GPU::Logging::IsActive() && @@ -222,7 +135,7 @@ vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo &ci, MemoryUsa auto const anv_flags = (usage == MemoryUsage::Stream && device.GetDriverID() == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA) ? VK_MEMORY_PROPERTY_HOST_CACHED_BIT : 0; - const VmaAllocationCreateInfo alloc_ci = { + VmaAllocationCreateInfo alloc_ci = { .flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage), .usage = MemoryUsageVma(usage), .requiredFlags = 0, @@ -238,7 +151,9 @@ vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo &ci, MemoryUsa VmaAllocation allocation{}; VkMemoryPropertyFlags property_flags{}; - vk::Check(vmaCreateBuffer(allocator, &ci, &alloc_ci, &handle, &allocation, &alloc_info)); + vk::Check(AllocateRelaxing(alloc_ci, [&](const VmaAllocationCreateInfo& retry) { + return vmaCreateBuffer(allocator, &ci, &retry, &handle, &allocation, &alloc_info); + })); vmaGetAllocationMemoryProperties(allocator, allocation, &property_flags); // Log GPU memory allocation for buffers @@ -278,7 +193,7 @@ vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo &ci, MemoryUsa if (usage == MemoryUsage::Stream) { memory_type_bits = 0u; } - const VmaAllocationCreateInfo alloc_ci = { + VmaAllocationCreateInfo alloc_ci = { .flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage), .usage = MemoryUsageVma(usage), .requiredFlags = 0, @@ -294,8 +209,10 @@ vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo &ci, MemoryUsa VmaAllocation allocation{}; VkMemoryPropertyFlags property_flags{}; - vk::Check(vmaCreateBufferWithAlignment(allocator, &ci, &alloc_ci, min_alignment, &handle, - &allocation, &alloc_info)); + vk::Check(AllocateRelaxing(alloc_ci, [&](const VmaAllocationCreateInfo& retry) { + return vmaCreateBufferWithAlignment(allocator, &ci, &retry, min_alignment, &handle, + &allocation, &alloc_info); + })); vmaGetAllocationMemoryProperties(allocator, allocation, &property_flags); u8 *data = reinterpret_cast(alloc_info.pMappedData); @@ -314,75 +231,4 @@ vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo &ci, MemoryUsa location, device.GetDispatchLoader()); } -MemoryCommit MemoryAllocator::Commit(const VkMemoryRequirements &reqs, MemoryUsage usage) -{ - const auto vma_usage = MemoryUsageVma(usage); - VmaAllocationCreateInfo ci{}; - ci.flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage); - ci.usage = vma_usage; - ci.memoryTypeBits = reqs.memoryTypeBits & valid_memory_types; - ci.requiredFlags = 0; - ci.preferredFlags = MemoryUsagePreferredVmaFlags(usage); - - VmaAllocation a{}; - VmaAllocationInfo info{}; - - VkResult res = vmaAllocateMemory(allocator, &reqs, &ci, &a, &info); - - if (res != VK_SUCCESS) { - // Relax 1: drop budget constraint - auto ci2 = ci; - ci2.flags &= ~VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT; - res = vmaAllocateMemory(allocator, &reqs, &ci2, &a, &info); - - // Relax 2: if we preferred DEVICE_LOCAL, drop that preference - if (res != VK_SUCCESS && (ci.preferredFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) { - auto ci3 = ci2; - ci3.preferredFlags &= ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; - res = vmaAllocateMemory(allocator, &reqs, &ci3, &a, &info); - } - } - - vk::Check(res); - return MemoryCommit(allocator, a, info); -} - -MemoryCommit MemoryAllocator::Commit(const vk::Buffer &buffer, MemoryUsage usage) { - // Allocate memory appropriate for this buffer automatically - const auto vma_usage = MemoryUsageVma(usage); - - VmaAllocationCreateInfo ci{}; - ci.flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage); - ci.usage = vma_usage; - ci.requiredFlags = 0; - ci.preferredFlags = MemoryUsagePreferredVmaFlags(usage); - ci.pool = VK_NULL_HANDLE; - ci.pUserData = nullptr; - ci.priority = 0.0f; - - const VkBuffer raw = *buffer; - - VmaAllocation a{}; - VmaAllocationInfo info{}; - - // Let VMA infer memory requirements from the buffer - VkResult res = vmaAllocateMemoryForBuffer(allocator, raw, &ci, &a, &info); - - if (res != VK_SUCCESS) { - auto ci2 = ci; - ci2.flags &= ~VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT; - res = vmaAllocateMemoryForBuffer(allocator, raw, &ci2, &a, &info); - - if (res != VK_SUCCESS && (ci.preferredFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) { - auto ci3 = ci2; - ci3.preferredFlags &= ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; - res = vmaAllocateMemoryForBuffer(allocator, raw, &ci3, &a, &info); - } - } - - vk::Check(res); - vk::Check(vmaBindBufferMemory2(allocator, a, 0, raw, nullptr)); - return MemoryCommit(allocator, a, info); -} - } // namespace Vulkan diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.h b/src/video_core/vulkan_common/vulkan_memory_allocator.h index a0f9081fc0..79a33f0b7b 100644 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.h +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.h @@ -39,51 +39,6 @@ namespace Vulkan { } } -/// Ownership handle of a memory commitment (real VMA allocation). - class MemoryCommit { - public: - MemoryCommit() noexcept = default; - - MemoryCommit(VmaAllocator allocator, VmaAllocation allocation, - const VmaAllocationInfo &info) noexcept; - - ~MemoryCommit(); - - MemoryCommit(const MemoryCommit &) = delete; - - MemoryCommit &operator=(const MemoryCommit &) = delete; - - MemoryCommit(MemoryCommit &&) noexcept; - - MemoryCommit &operator=(MemoryCommit &&) noexcept; - - [[nodiscard]] std::span Map(); - - [[nodiscard]] std::span Map() const; - - void Unmap(); - - explicit operator bool() const noexcept { return allocation != nullptr; } - - VkDeviceMemory Memory() const noexcept { return memory; } - - VkDeviceSize Offset() const noexcept { return offset; } - - VkDeviceSize Size() const noexcept { return size; } - - VmaAllocation Allocation() const noexcept { return allocation; } - - private: - void Release(); - - VmaAllocator allocator{}; ///< VMA allocator - VmaAllocation allocation{}; ///< VMA allocation handle - VkDeviceMemory memory{}; ///< Underlying VkDeviceMemory chosen by VMA - VkDeviceSize offset{}; ///< Offset of this allocation inside VkDeviceMemory - VkDeviceSize size{}; ///< Size of the allocation - void *mapped_ptr{}; ///< Optional persistent mapped pointer - }; - /// Memory allocator container. /// Allocates and releases memory allocations on demand. class MemoryAllocator { @@ -110,35 +65,10 @@ namespace Vulkan { vk::Buffer CreateBuffer(const VkBufferCreateInfo &ci, MemoryUsage usage, VkDeviceSize min_alignment) const; - /** - * Commits a memory with the specified requirements. - * - * @param requirements Requirements returned from a Vulkan call. - * @param usage Indicates how the memory will be used. - * - * @returns A memory commit. - */ - MemoryCommit Commit(const VkMemoryRequirements &requirements, MemoryUsage usage); - - /// Commits memory required by the buffer and binds it (for buffers created outside VMA). - MemoryCommit Commit(const vk::Buffer &buffer, MemoryUsage usage); - private: - static bool IsAutoUsage(VmaMemoryUsage u) noexcept { - switch (u) { - case VMA_MEMORY_USAGE_AUTO: - case VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE: - case VMA_MEMORY_USAGE_AUTO_PREFER_HOST: - return true; - default: - return false; - } - } - const Device &device; ///< Device handle. VmaAllocator allocator; ///< VMA allocator. const VkPhysicalDeviceMemoryProperties properties; ///< Physical device memory properties. - VkDeviceSize buffer_image_granularity; ///< Adjacent buffer/image granularity u32 valid_memory_types{~0u}; }; From 1fbb1a0499eb0e6547404eb2c9197e59113b8792 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 15:47:59 -0400 Subject: [PATCH 077/198] Revert QCOM spoof --- src/video_core/vulkan_common/vulkan_wrapper.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index d5012ddd83..e4c8f518b9 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -468,20 +468,8 @@ Instance Instance::Create(u32 version, Span layers, Span gloom + yellow line glitch appears -#ifdef __ANDROID__ - const VkApplicationInfo application_info{ - .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, - .pNext = nullptr, - .pApplicationName = "PUBGMobile", - .applicationVersion = VK_MAKE_VERSION(1, 7, 0), - .pEngineName = "UnrealEngine", - .engineVersion = VK_MAKE_VERSION(4, 23, 0), - .apiVersion = VK_API_VERSION_1_3, - }; -#else + // DO NOT TOUCH, breaks RNDA3!! + // Don't know why, but gloom + yellow line glitch appears const VkApplicationInfo application_info{ .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = nullptr, @@ -491,7 +479,6 @@ Instance Instance::Create(u32 version, Span layers, Span Date: Sat, 19 Sep 2026 16:57:03 -0400 Subject: [PATCH 078/198] Add checks on texel buffer alignments --- .../renderer_vulkan/vk_buffer_cache.cpp | 5 +++++ .../vulkan_common/vulkan_device.cpp | 10 ++++++++++ src/video_core/vulkan_common/vulkan_device.h | 20 +++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index da2d36e41e..8c93a92046 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -133,6 +133,11 @@ VkBufferView Buffer::View(u32 offset, u32 size, VideoCore::Surface::PixelFormat offset = 0; size = 0; } + const u32 required = + static_cast(device->TexelBufferAlignment(VideoCore::Surface::BytesPerBlock(format))); + const u32 misalign = offset % required; + offset -= misalign; + size += misalign; const auto it{std::ranges::find_if(views, [offset, size, format](const BufferView& view) { return offset == view.offset && size == view.size && format == view.format; })}; diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 1e15f05156..65194f647a 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1112,6 +1112,16 @@ bool Device::GetSuitability(bool requires_swapchain) { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES; SetNext(next, properties.subgroup_size_control); } + properties.texel_buffer_alignment.storageTexelBufferOffsetAlignmentBytes = + properties.properties.limits.minTexelBufferOffsetAlignment; + properties.texel_buffer_alignment.uniformTexelBufferOffsetAlignmentBytes = + properties.properties.limits.minTexelBufferOffsetAlignment; + if (features.texel_buffer_alignment.texelBufferAlignment == VK_TRUE || + instance_version >= VK_API_VERSION_1_3) { + properties.texel_buffer_alignment.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT; + SetNext(next, properties.texel_buffer_alignment); + } if (extensions.transform_feedback) { properties.transform_feedback.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 8b93aad373..916a78fd56 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -6,6 +6,7 @@ #pragma once +#include #include #include #include @@ -69,6 +70,7 @@ VK_DEFINE_HANDLE(VmaAllocator) primitive_topology_list_restart) \ FEATURE(EXT, ProvokingVertex, PROVOKING_VERTEX, provoking_vertex) \ FEATURE(EXT, Robustness2, ROBUSTNESS_2, robustness2) \ + FEATURE(EXT, TexelBufferAlignment, TEXEL_BUFFER_ALIGNMENT, texel_buffer_alignment) \ FEATURE(EXT, TransformFeedback, TRANSFORM_FEEDBACK, transform_feedback) \ FEATURE(EXT, VertexInputDynamicState, VERTEX_INPUT_DYNAMIC_STATE, vertex_input_dynamic_state) \ FEATURE(KHR, Maintenance5, MAINTENANCE_5, maintenance5) \ @@ -291,6 +293,23 @@ public: return properties.properties.apiVersion; } + VkDeviceSize TexelBufferAlignment(u32 texel_size) const { + VkDeviceSize texel = texel_size; + if (texel % 3 == 0) { + texel /= 3; + } + const auto& limits = properties.texel_buffer_alignment; + VkDeviceSize storage = limits.storageTexelBufferOffsetAlignmentBytes; + if (limits.storageTexelBufferOffsetSingleTexelAlignment != VK_FALSE) { + storage = (std::min)(storage, texel); + } + VkDeviceSize uniform = limits.uniformTexelBufferOffsetAlignmentBytes; + if (limits.uniformTexelBufferOffsetSingleTexelAlignment != VK_FALSE) { + uniform = (std::min)(uniform, texel); + } + return (std::max)((std::max)(storage, uniform), VkDeviceSize{1}); + } + /// Returns the current driver version provided in Vulkan-formatted version numbers. u32 GetDriverVersion() const { return properties.properties.driverVersion; @@ -1161,6 +1180,7 @@ private: VkPhysicalDevicePushDescriptorPropertiesKHR push_descriptor{}; VkPhysicalDeviceDescriptorBufferPropertiesEXT descriptor_buffer{}; VkPhysicalDeviceSubgroupSizeControlProperties subgroup_size_control{}; + VkPhysicalDeviceTexelBufferAlignmentProperties texel_buffer_alignment{}; VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback{}; VkPhysicalDeviceMaintenance5PropertiesKHR maintenance5{}; VkPhysicalDeviceDepthStencilResolveProperties depth_stencil_resolve{}; From d82a9c3ba5e89d3a619c437217495ed26c411b2e Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 19 Sep 2026 18:08:38 -0400 Subject: [PATCH 079/198] Adjust stagging buffer ring --- .../vk_staging_buffer_pool.cpp | 53 +++++++++++++++---- .../renderer_vulkan/vk_staging_buffer_pool.h | 10 +++- .../renderer_vulkan/vk_texture_cache.cpp | 5 +- .../vulkan_common/vulkan_device.cpp | 2 +- .../vulkan_common/vulkan_memory_allocator.cpp | 13 +++-- 5 files changed, 66 insertions(+), 17 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index b847b66e7c..5f04df2c9e 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -120,7 +120,14 @@ void StagingBufferPool::FreeDeferred(StagingBufferRef& ref) { } void StagingBufferPool::TickFrame() { - current_delete_level = (current_delete_level + 1) % NUM_LEVELS; + for (size_t step = 0; step < NUM_LEVELS; ++step) { + current_delete_level = (current_delete_level + 1) % NUM_LEVELS; + if (!device_local_cache[current_delete_level].entries.empty() || + !upload_cache[current_delete_level].entries.empty() || + !download_cache[current_delete_level].entries.empty()) { + break; + } + } ReleaseCache(MemoryUsage::DeviceLocal); ReleaseCache(MemoryUsage::Upload); @@ -128,10 +135,12 @@ void StagingBufferPool::TickFrame() { } StagingBufferRef StagingBufferPool::GetStreamBuffer(size_t size) { - if (AreRegionsActive(Region(free_iterator) + 1, - (std::min)(Region(iterator + size) + 1, NUM_SYNCS))) { - // Avoid waiting for the previous usages to be free - return GetStagingBuffer(size, MemoryUsage::Upload); + const size_t wanted_begin = Region(free_iterator) + 1; + const size_t wanted_end = (std::min)(Region(iterator + size) + 1, NUM_SYNCS); + if (AreRegionsActive(wanted_begin, wanted_end)) { + if (auto ref = OverflowStreamBuffer(size, wanted_begin, wanted_end)) { + return *ref; + } } const u64 current_tick = scheduler.CurrentTick(); std::fill(sync_ticks.begin() + Region(used_iterator), sync_ticks.begin() + Region(iterator), @@ -147,8 +156,9 @@ StagingBufferRef StagingBufferPool::GetStreamBuffer(size_t size) { free_iterator = size; if (AreRegionsActive(0, Region(size) + 1)) { - // Avoid waiting for the previous usages to be free - return GetStagingBuffer(size, MemoryUsage::Upload); + if (auto ref = OverflowStreamBuffer(size, 0, Region(size) + 1)) { + return *ref; + } } } const size_t offset = iterator; @@ -164,6 +174,27 @@ StagingBufferRef StagingBufferPool::GetStreamBuffer(size_t size) { }; } +u64 StagingBufferPool::MaxRegionTick(size_t region_begin, size_t region_end) const { + u64 tick = 0; + for (size_t region = region_begin; region < region_end; ++region) { + tick = (std::max)(tick, sync_ticks[region]); + } + return tick; +} + +std::optional StagingBufferPool::OverflowStreamBuffer(size_t size, + size_t region_begin, + size_t region_end) { + if (cache_bytes[static_cast(MemoryUsage::Upload)] < stream_buffer_size) { + return GetStagingBuffer(size, MemoryUsage::Upload); + } + if (auto ref = TryGetReservedBuffer(size, MemoryUsage::Upload, false)) { + return ref; + } + scheduler.Wait(MaxRegionTick(region_begin, region_end)); + return std::nullopt; +} + bool StagingBufferPool::AreRegionsActive(size_t region_begin, size_t region_end) const { const u64 gpu_tick = scheduler.GetMasterSemaphore().KnownGpuTick(); return std::any_of(sync_ticks.begin() + region_begin, sync_ticks.begin() + region_end, @@ -233,6 +264,7 @@ StagingBufferRef StagingBufferPool::CreateStagingBuffer(size_t size, MemoryUsage device.IsBufferDeviceAddressSupported() ? device.GetLogical().GetBufferDeviceAddress(*buffer) : VkDeviceAddress{}; + cache_bytes[static_cast(usage)] += size_t{1} << log2_size; StagingBuffer& entry = GetCache(usage)[log2_size].entries.emplace_back(StagingBuffer{ .buffer = std::move(buffer), .device_address = buffer_address, @@ -261,12 +293,12 @@ StagingBufferPool::StagingBuffersCache& StagingBufferPool::GetCache(MemoryUsage } void StagingBufferPool::ReleaseCache(MemoryUsage usage) { - ReleaseLevel(GetCache(usage), current_delete_level); + ReleaseLevel(usage, current_delete_level); } -void StagingBufferPool::ReleaseLevel(StagingBuffersCache& cache, size_t log2) { +void StagingBufferPool::ReleaseLevel(MemoryUsage usage, size_t log2) { constexpr size_t deletions_per_tick = 16; - auto& staging = cache[log2]; + auto& staging = GetCache(usage)[log2]; auto& entries = staging.entries; const size_t old_size = entries.size(); @@ -280,6 +312,7 @@ void StagingBufferPool::ReleaseLevel(StagingBuffersCache& cache, size_t log2) { entries.erase(std::remove_if(begin, end, is_deletable), end); const size_t new_size = entries.size(); + cache_bytes[static_cast(usage)] -= (old_size - new_size) << log2; staging.delete_index += deletions_per_tick; if (staging.delete_index >= new_size) { staging.delete_index = 0; diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h index 6d967abb41..d684a1289b 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include "common/common_types.h" @@ -88,6 +89,11 @@ private: bool AreRegionsActive(size_t region_begin, size_t region_end) const; + u64 MaxRegionTick(size_t region_begin, size_t region_end) const; + + std::optional OverflowStreamBuffer(size_t size, size_t region_begin, + size_t region_end); + StagingBufferRef GetStagingBuffer(size_t size, MemoryUsage usage, bool deferred = false); std::optional TryGetReservedBuffer(size_t size, MemoryUsage usage, @@ -99,7 +105,7 @@ private: void ReleaseCache(MemoryUsage usage); - void ReleaseLevel(StagingBuffersCache& cache, size_t log2); + void ReleaseLevel(MemoryUsage usage, size_t log2); size_t Region(size_t iter) const noexcept { return iter / region_size; } @@ -119,6 +125,8 @@ private: size_t free_iterator = 0; std::array sync_ticks{}; + std::array cache_bytes{}; + StagingBuffersCache device_local_cache; StagingBuffersCache upload_cache; StagingBuffersCache download_cache; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 749a49c898..33ab5dd57f 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1091,11 +1091,12 @@ bool TextureCacheRuntime::ShouldReinterpret(Image& dst, Image& src) { } VkBuffer TextureCacheRuntime::GetTemporaryBuffer(size_t needed_size) { - const auto level = (8 * sizeof(size_t)) - std::countl_zero(needed_size - 1ULL); + const size_t wanted_size = (std::max)(needed_size, size_t{1}); + const auto level = (8 * sizeof(size_t)) - std::countl_zero(wanted_size - 1ULL); if (buffers[level]) { return *buffers[level]; } - const auto new_size = Common::NextPow2(needed_size); + const auto new_size = Common::NextPow2(wanted_size); static constexpr VkBufferUsageFlags flags = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 65194f647a..8fd72cb71f 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -741,7 +741,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR .pHeapSizeLimit = nullptr, .pVulkanFunctions = &functions, .instance = instance, - .vulkanApiVersion = ApiVersion(), + .vulkanApiVersion = VK_API_VERSION_1_1, .pTypeExternalMemoryHandleTypes = nullptr, }; diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp index 31a909ef2f..ef1143aeb6 100644 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp @@ -26,6 +26,13 @@ namespace { : VkMemoryPropertyFlagBits{}; } + [[nodiscard]] VkMemoryPropertyFlags MemoryUsageRequiredVmaFlags(MemoryUsage usage) { + if (usage == MemoryUsage::Upload || usage == MemoryUsage::Download) { + return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + } + return VkMemoryPropertyFlagBits{}; + } + [[nodiscard]] VmaAllocationCreateFlags MemoryUsageVmaFlags(MemoryUsage usage) { switch (usage) { case MemoryUsage::Upload: @@ -103,7 +110,7 @@ vk::Image MemoryAllocator::CreateImage(const VkImageCreateInfo &ci) const .usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE, .requiredFlags = 0, .preferredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, - .memoryTypeBits = 0, + .memoryTypeBits = valid_memory_types, .pool = VK_NULL_HANDLE, .pUserData = nullptr, .priority = 0.f, @@ -138,7 +145,7 @@ vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo &ci, MemoryUsa VmaAllocationCreateInfo alloc_ci = { .flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage), .usage = MemoryUsageVma(usage), - .requiredFlags = 0, + .requiredFlags = MemoryUsageRequiredVmaFlags(usage), .preferredFlags = MemoryUsagePreferredVmaFlags(usage) | anv_flags, .memoryTypeBits = usage == MemoryUsage::Stream ? 0u : valid_memory_types, .pool = VK_NULL_HANDLE, @@ -196,7 +203,7 @@ vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo &ci, MemoryUsa VmaAllocationCreateInfo alloc_ci = { .flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage), .usage = MemoryUsageVma(usage), - .requiredFlags = 0, + .requiredFlags = MemoryUsageRequiredVmaFlags(usage), .preferredFlags = MemoryUsagePreferredVmaFlags(usage) | anv_flags, .memoryTypeBits = memory_type_bits, .pool = VK_NULL_HANDLE, From ffb75c2b68e0d432b40b3ab64adfb13454dd5d6a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sun, 20 Sep 2026 14:18:28 -0400 Subject: [PATCH 080/198] Revert "[common/core/dynarmic] Optimize page table allocations (#4219)" --- src/common/CMakeLists.txt | 4 +- src/common/fiber.cpp | 1 + src/common/host_memory.cpp | 54 ++--- src/common/host_memory.h | 3 +- src/common/page_table.cpp | 38 +++- src/common/page_table.h | 120 +++++------ src/common/sparse_large_vector.cpp | 143 ------------- src/common/sparse_large_vector.h | 194 ------------------ src/common/virtual_buffer.cpp | 44 ++++ src/common/virtual_buffer.h | 84 ++++++++ src/core/arm/dynarmic/arm_dynarmic_32.cpp | 18 +- src/core/arm/dynarmic/arm_dynarmic_64.cpp | 19 +- src/core/device_memory.h | 10 +- src/core/device_memory_manager.h | 10 +- src/core/device_memory_manager.inc | 49 +++-- src/core/hle/kernel/k_page_table_base.cpp | 110 ++++------ src/core/hle/kernel/k_page_table_base.h | 13 +- src/core/memory.cpp | 81 ++++---- .../backend/arm64/a32_address_space.cpp | 4 +- .../backend/arm64/a64_address_space.cpp | 4 +- .../src/dynarmic/backend/arm64/emit_arm64.h | 4 +- .../backend/arm64/emit_arm64_memory.cpp | 15 +- .../dynarmic/backend/x64/emit_x64_memory.h | 63 ++---- .../src/dynarmic/interface/A32/config.h | 19 +- .../src/dynarmic/interface/A64/config.h | 19 +- src/video_core/memory_manager.cpp | 4 +- src/video_core/memory_manager.h | 4 +- 27 files changed, 394 insertions(+), 737 deletions(-) delete mode 100644 src/common/sparse_large_vector.cpp delete mode 100644 src/common/sparse_large_vector.h create mode 100644 src/common/virtual_buffer.cpp create mode 100644 src/common/virtual_buffer.h diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 61e0e64aa8..3a6d2acf8a 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -108,8 +108,6 @@ add_library( settings_setting.h slot_vector.h socket_types.h - sparse_large_vector.cpp - sparse_large_vector.h spin_lock.h stb.cpp stb.h @@ -139,6 +137,8 @@ add_library( uuid.cpp uuid.h vector_math.h + virtual_buffer.cpp + virtual_buffer.h zstd_compression.cpp zstd_compression.h fs/ryujinx_compat.h fs/ryujinx_compat.cpp diff --git a/src/common/fiber.cpp b/src/common/fiber.cpp index 0e7f28c5b9..69eca732eb 100644 --- a/src/common/fiber.cpp +++ b/src/common/fiber.cpp @@ -9,6 +9,7 @@ #include "common/assert.h" #include "common/fiber.h" +#include "common/virtual_buffer.h" #include diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 75a9da80e9..dd0780a283 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -178,14 +178,6 @@ public: Release(); } - void* Allocate(size_t size) { - auto* ptr = VirtualAlloc(nullptr, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - if (ptr == nullptr) { - LOG_CRITICAL(HW_Memory, "Failed to allocate fallback buffer with size {:#x}, error {}", size, GetLastError()); - } - return ptr; - } - void Map(size_t virtual_offset, size_t host_offset, size_t length, MemoryPermission perms) { std::unique_lock lock{placeholder_mutex}; if (!IsNiechePlaceholder(virtual_offset, length)) { @@ -406,10 +398,6 @@ private: // For managarm: see https://github.com/managarm/managarm/issues/1370 #else // ^^^ Windows ^^^ vvv POSIX vvv -#ifndef MAP_NOCORE -#define MAP_NOCORE 0 -#endif - #ifdef ARCHITECTURE_arm64 static void* ChooseVirtualBase(size_t virtual_size) { @@ -434,7 +422,7 @@ static void* ChooseVirtualBase(size_t virtual_size) { // Note: we may be able to take advantage of MAP_FIXED_NOREPLACE here. void* map_pointer = mmap(reinterpret_cast(hint_address), virtual_size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_NOCORE, -1, 0); + MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); // If we successfully mapped, we're done. if (reinterpret_cast(map_pointer) == hint_address) { @@ -454,11 +442,11 @@ static void* ChooseVirtualBase(size_t virtual_size) { static void* ChooseVirtualBase(size_t virtual_size) { #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__sun__) || defined(__HAIKU__) || defined(__managarm__) || defined(__AIX__) - void* virtual_base = mmap(nullptr, virtual_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_ALIGNED_SUPER | MAP_NOCORE, -1, 0); + void* virtual_base = mmap(nullptr, virtual_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_ALIGNED_SUPER, -1, 0); if (virtual_base != MAP_FAILED) return virtual_base; #endif - return mmap(nullptr, virtual_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_NOCORE, -1, 0); + return mmap(nullptr, virtual_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); } #endif @@ -552,13 +540,13 @@ public: } if (use_anon) { LOG_WARNING(Common_Memory, "Using private mappings instead of shared ones"); - backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_NOCORE, -1, 0)); + backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)); if (fd > 0) { fd = -1; close(fd); } } else { - backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_NOCORE, fd, 0)); + backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); } if (backing_base == MAP_FAILED) { LOG_CRITICAL(HW_Memory, "mmap failed: {}", strerror(errno)); @@ -582,14 +570,6 @@ public: Release(); } - void* Allocate(size_t size) { - auto* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); - if (ptr == MAP_FAILED) { - LOG_CRITICAL(HW_Memory, "Failed to allocate fallback buffer with size {:#x}, {}", size, strerror(errno)); - } - return ptr; - } - void Map(size_t virtual_offset, size_t host_offset, size_t length, MemoryPermission perms) { // Intersect the range with our address space. AdjustMap(&virtual_offset, &length); @@ -710,10 +690,12 @@ HostMemory::HostMemory(size_t backing_size_, size_t virtual_size_) { #if defined(__OPENORBIS__) || defined(__managarm__) LOG_WARNING(HW_Memory, "Platform doesn't support fastmem"); - backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)); + fallback_buffer.emplace(backing_size); + backing_base = fallback_buffer->data(); virtual_base = nullptr; #else // Try to allocate a fastmem arena. + // The implementation will fail with std::bad_alloc on errors. impl = std::make_unique(AlignUp(backing_size, PageAlignment), AlignUp(virtual_size, PageAlignment) + HugePageSize); if (impl->Init()) { backing_base = impl->backing_base; @@ -724,26 +706,16 @@ HostMemory::HostMemory(size_t backing_size_, size_t virtual_size_) virtual_base_offset = virtual_base - impl->virtual_base; } } else { - LOG_WARNING(HW_Memory, "Platform can support fastmem, but can't create it"); - fallback_buffer = true; - backing_base = static_cast(impl->Allocate(backing_size)); - virtual_base = nullptr; impl.reset(); + LOG_WARNING(HW_Memory, "Platform can support fastmem, but can't create it"); + fallback_buffer.emplace(backing_size); + backing_base = fallback_buffer->data(); + virtual_base = nullptr; } #endif } -HostMemory::~HostMemory() { -#ifdef _WIN32 - if (fallback_buffer) { - VirtualFree(backing_base, backing_size, MEM_RELEASE); - } -#else - if (fallback_buffer) { - munmap(backing_base, backing_size); - } -#endif -} +HostMemory::~HostMemory() = default; HostMemory::HostMemory(HostMemory&&) noexcept = default; diff --git a/src/common/host_memory.h b/src/common/host_memory.h index a7fd0532b7..24f4670732 100644 --- a/src/common/host_memory.h +++ b/src/common/host_memory.h @@ -10,6 +10,7 @@ #include #include "common/common_funcs.h" #include "common/common_types.h" +#include "common/virtual_buffer.h" namespace Common { @@ -85,7 +86,7 @@ private: u8* virtual_base{}; size_t virtual_base_offset{}; // Windows requires it for kernels whom lack proper support for some functions! - bool fallback_buffer{false}; + std::optional> fallback_buffer; }; } // namespace Common diff --git a/src/common/page_table.cpp b/src/common/page_table.cpp index 73278cfc59..d34ba89993 100644 --- a/src/common/page_table.cpp +++ b/src/common/page_table.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project @@ -13,11 +13,39 @@ PageTable::PageTable() = default; PageTable::~PageTable() noexcept = default; -void PageTable::Resize(std::size_t address_space_width_in_bits, std::size_t page_bits) { - auto const num_page_table_entries = 1ULL << (address_space_width_in_bits - page_bits); - entries.ResizeAndClear(num_page_table_entries); +bool PageTable::BeginTraversal(TraversalEntry* out_entry, TraversalContext* out_context, + Common::ProcessAddress address) const { + out_context->next_offset = GetInteger(address); + out_context->next_page = address / page_size; + + return this->ContinueTraversal(out_entry, out_context); +} + +bool PageTable::ContinueTraversal(TraversalEntry* out_entry, TraversalContext* context) const { + // Setup invalid defaults. + out_entry->phys_addr = 0; + out_entry->block_size = page_size; + // Validate that we can read the actual entry. + if (auto const page = context->next_page; page < entries.size()) { + // Validate that the entry is mapped. + if (auto const paddr = entries[page].addr; paddr != 0) { + // Populate the results. + out_entry->phys_addr = paddr + context->next_offset; + context->next_page += 1; + context->next_offset += page_size; + return true; + } + } + context->next_page += 1; + context->next_offset += page_size; + return false; +} + +void PageTable::Resize(std::size_t address_space_width_in_bits, std::size_t page_size_in_bits) { + auto const num_page_table_entries = 1ULL << (address_space_width_in_bits - page_size_in_bits); + entries.resize(num_page_table_entries); current_address_space_width_in_bits = address_space_width_in_bits; - current_page_bits = page_bits; + page_size = 1ULL << page_size_in_bits; } } // namespace Common diff --git a/src/common/page_table.h b/src/common/page_table.h index 1588eca616..0dfd152331 100644 --- a/src/common/page_table.h +++ b/src/common/page_table.h @@ -9,22 +9,22 @@ #include #include "common/common_types.h" -#include "common/sparse_large_vector.h" #include "common/typed_address.h" +#include "common/virtual_buffer.h" namespace Common { enum class PageType : u8 { /// Page is unmapped and should cause an access error. - Unmapped = 0b00, + Unmapped, /// Page is mapped to regular memory. This is the only type you can get pointers to. - Memory = 0b01, + Memory, /// Page is mapped to regular memory, but inaccessible from CPU fastmem and must use /// the callbacks. - DebugMemory = 0b10, + DebugMemory, /// Page is mapped to regular memory, but also needs to check for rasterizer cache flushing and /// invalidation - RasterizerCachedMemory = 0b11, + RasterizerCachedMemory, }; /** @@ -42,86 +42,57 @@ struct PageTable { u64 next_offset{}; }; - /// Masks out bits reserved for attribute tagging. - static constexpr u64 ATTRIBUTE_MASK = ((1ULL << 44) - 1) << 12; - - /// Specifies sign bit for page table entries. - static constexpr u64 SIGN_BIT = 45 + 12; // 44 bits of data + page offset + /// Number of bits reserved for attribute tagging. + /// This can be at most the guaranteed alignment of the pointers in the page table. + static constexpr int ATTRIBUTE_BITS = 2; /** - * Atomic tuple of host pointer, page type, and block id. - * This uses the lower bits of a given pointer to store the attributes. + * Pair of host pointer and page type attribute. + * This uses the lower bits of a given pointer to store the attribute tag. * Writing and reading the pointer attribute pair is guaranteed to be atomic for the same method * call. In other words, they are guaranteed to be synchronized at all times. */ - class PageEntryData { + class PageInfo { public: - struct Data { - Data(bool marked_, PageType type_, u16 block_, u64 page_) - : marked(static_cast(marked_) & 0b1) - , type(static_cast(type_) & ((1ULL << 2) - 1)) - , block(static_cast(block_) & ((1ULL << 9) - 1)) - , page((page_ >> 12) & ((1ULL << 45) - 1)) - , block2((static_cast(block_) >> 9) & ((1ULL << 7) - 1)) {} - u64 marked : 1; - u64 type : 2; - u64 block : 9; - u64 page : 45; // 44 bits of actual data (64 - page offset (12) - reserved (8)) + a sign bit - u64 block2 : 7; - }; - - [[nodiscard]] Data Raw() const noexcept { - return std::bit_cast(data_raw.load(std::memory_order_relaxed)); - } - /// Returns the page pointer - [[nodiscard]] uintptr_t Pointer(bool ignored_marked = false) const noexcept { - return ExtractPointer(std::bit_cast(data_raw.load(std::memory_order_relaxed)), ignored_marked); + [[nodiscard]] uintptr_t Pointer() const noexcept { + return ExtractPointer(raw.load(std::memory_order_relaxed)); } /// Returns the page type attribute [[nodiscard]] PageType Type() const noexcept { - return static_cast(std::bit_cast(data_raw.load(std::memory_order_relaxed)).type); - } - - /// Returns the block identifier. - [[nodiscard]] u16 Block() const noexcept { - return ExtractBlock(std::bit_cast(data_raw.load(std::memory_order_relaxed))); + return ExtractType(raw.load(std::memory_order_relaxed)); } /// Returns the page pointer and attribute pair, extracted from the same atomic read - [[nodiscard]] std::tuple PointerTypeBlock(bool ignore_marked = false) const noexcept { - const auto non_atomic_raw = std::bit_cast(data_raw.load(std::memory_order_relaxed)); - return {ExtractPointer(non_atomic_raw, ignore_marked), static_cast(non_atomic_raw.type), ExtractBlock(non_atomic_raw)}; + [[nodiscard]] std::pair PointerType() const noexcept { + const uintptr_t non_atomic_raw = raw.load(std::memory_order_relaxed); + return {ExtractPointer(non_atomic_raw), ExtractType(non_atomic_raw)}; } - /// Write page info atomically - constexpr void Store(bool marked, PageType type, u16 block, uintptr_t pointer) noexcept { - data_raw.store(std::bit_cast(Data{marked, type, block, pointer})); + /// Returns the raw representation of the page information. + /// Use ExtractPointer and ExtractType to unpack the value. + [[nodiscard]] uintptr_t Raw() const noexcept { + return raw.load(std::memory_order_relaxed); } - constexpr void MarkRasterizerCached() noexcept { - data_raw.fetch_or(0b111); - } - - constexpr void MarkDebug(u64 ptr, u16 block) noexcept { - Store(true, PageType::DebugMemory, block, ptr); + /// Write a page pointer and type pair atomically + void Store(uintptr_t pointer, PageType type) noexcept { + raw.store(pointer | uintptr_t(type)); } /// Unpack a pointer from a page info raw representation - [[nodiscard]] static uintptr_t ExtractPointer(Data raw, bool ignore_marked = false) noexcept { - return raw.marked && !ignore_marked ? 0 - // shift raw.page's fake sign bit to the actual sign bit, then sign extend - : ((s64)(raw.page << (64 - 44))) >> (64 - 44 - 12); + [[nodiscard]] static uintptr_t ExtractPointer(uintptr_t raw) noexcept { + return raw & (~uintptr_t{0} << ATTRIBUTE_BITS); } - [[nodiscard]] static u16 ExtractBlock(Data raw) noexcept { - return static_cast(raw.block | (raw.block2 << 9)); + /// Unpack a page type from a page info raw representation + [[nodiscard]] static PageType ExtractType(uintptr_t raw) noexcept { + return static_cast(raw & ((uintptr_t{1} << ATTRIBUTE_BITS) - 1)); } private: - std::atomic data_raw; - static_assert(sizeof(Data) == sizeof(std::atomic)); + std::atomic raw; }; PageTable(); @@ -129,8 +100,13 @@ struct PageTable { PageTable(const PageTable&) = delete; PageTable& operator=(const PageTable&) = delete; - PageTable(PageTable&&) noexcept = delete; - PageTable& operator=(PageTable&&) noexcept = delete; + + PageTable(PageTable&&) noexcept = default; + PageTable& operator=(PageTable&&) noexcept = default; + + bool BeginTraversal(TraversalEntry* out_entry, TraversalContext* out_context, + Common::ProcessAddress address) const; + bool ContinueTraversal(TraversalEntry* out_entry, TraversalContext* context) const; /** * Resizes the page table to be able to accommodate enough pages within @@ -145,14 +121,30 @@ struct PageTable { return current_address_space_width_in_bits; } + bool GetPhysicalAddress(Common::PhysicalAddress* out_phys_addr, + Common::ProcessAddress virt_addr) const { + if (virt_addr > (1ULL << this->GetAddressSpaceBits())) { + return false; + } + + *out_phys_addr = entries[virt_addr / page_size].addr + GetInteger(virt_addr); + return true; + } + /// Vector of memory pointers backing each page. An entry can only be non-null if the /// corresponding attribute element is of type `Memory`. - SparseLargeVector entries; - static_assert(sizeof(PageEntryData) == 8); + struct PageEntryData { + PageInfo ptr; + u64 block; + u64 addr; + u64 padding; + }; + VirtualBuffer entries; + static_assert(sizeof(PageEntryData) == 32); u8* fastmem_arena{}; std::size_t current_address_space_width_in_bits{}; - std::size_t current_page_bits{}; + std::size_t page_size{}; }; } // namespace Common diff --git a/src/common/sparse_large_vector.cpp b/src/common/sparse_large_vector.cpp deleted file mode 100644 index ce6455a235..0000000000 --- a/src/common/sparse_large_vector.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -/* virtual_buffer.cpp */ -// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#ifdef _WIN32 -#include -#include -#else -#include -#endif - -#include "common/alignment.h" -#include "common/assert.h" -#include "common/sparse_large_vector.h" - -namespace Common { - -#ifdef _WIN32 -static std::vector> vector_regions {}; - -// Workaround for handling non-commited memory accessed by Dynarmic; usually result of an error -static LONG WINAPI FakePageFaultHandler(PEXCEPTION_POINTERS info) { - DWORD code = info->ExceptionRecord->ExceptionCode; - u64 exception_addr = reinterpret_cast(info->ExceptionRecord->ExceptionAddress); - - if (code != EXCEPTION_ACCESS_VIOLATION) { - // Not our problem - return EXCEPTION_CONTINUE_SEARCH; - } - - u64 addr = 0, addr2 = 0; - - for (auto region: vector_regions) { - auto addr_shifted = exception_addr >> HostPageBits; - if (region.first <= addr_shifted && addr_shifted <= region.second) { - addr = addr_shifted; - } - - // Page-boundary accesses - if (auto addr_ = (exception_addr + 0x40) >> HostPageBits; addr_ != addr_shifted && region.first <= addr_ && addr_ <= region.second) { - addr2 = addr_; - } - - if (addr != 0 || addr2 != 0) { - break; - } - } - - if (addr == 0 && addr2 == 0) { - // Not our problem - return EXCEPTION_CONTINUE_SEARCH; - } - - LOG_ERROR(HW_Memory, "Accessing an unallocated region of a SparseLargeVector at {:#x}; this shouldn't happen and is likely a Dynarmic error!", exception_addr); - - // Commit this region - if (addr != 0) { - if (!CommitVectorPage(addr << HostPageBits, false)) { - return EXCEPTION_CONTINUE_SEARCH; - } - } - // Commit next region if needed - if (addr2 != 0) { - if (!CommitVectorPage(addr2 << HostPageBits, false)) { - return EXCEPTION_CONTINUE_SEARCH; - } - } - - return EXCEPTION_CONTINUE_EXECUTION; -} - -bool CommitVectorPage(uintptr_t addr, bool write) noexcept { - MEMORY_BASIC_INFORMATION info {}; - auto res = VirtualQuery(reinterpret_cast(addr), &info, sizeof(info)); - if (res == 0) { - LOG_CRITICAL(HW_Memory, "Failed to query large buffer region at {:#x} with error {}, will try committing anyway", addr, GetLastError()); - } else if (info.State != MEM_RESERVE) { - LOG_ERROR(HW_Memory, "Tried to commit an unreserved large buffer region at {:#x} that is not mapped or is already committed (state {:#x})", addr, info.State); - return false; - } - - auto perm = write ? PAGE_READWRITE : PAGE_READONLY; - void* res2 = VirtualAlloc(reinterpret_cast(addr), HostPageSize, MEM_COMMIT, perm); - if (res2 == nullptr) { - LOG_ERROR(HW_Memory, "Failed to commit large buffer region at {:#x}, error {}", addr, GetLastError()); - return false; - } - - return true; -} -#endif - -#ifndef MAP_NOCORE -#define MAP_NOCORE 0 -#endif - -void* AllocateMemoryPages(std::size_t size) noexcept { - if (auto page = HostPageSize; size % page != 0) { - LOG_WARNING(HW_Memory, "Allocating unaligned large vector with size {:#x}; aligning to {} page size", size, page); - size = AlignUp(size, page); - } - -#ifdef _WIN32 - // We will never use this memory entirely so instead of committing it up front let's just reserve it and commit each page individually - void* base = VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE); - - if (base != nullptr) { - vector_regions.emplace_back(reinterpret_cast(base), reinterpret_cast(base) + size); - - static std::once_flag flag; - std::call_once(flag, []() { AddVectoredExceptionHandler(1, FakePageFaultHandler); }); - } else { - // Try committing everything instead?? - LOG_WARNING(HW_Memory, "Failed to reserve large vector region with error {}, trying to commit instead..", GetLastError()); - base = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE); - } - ASSERT_MSG(base, "Failed to reserve {:#x} sized region with error {}", size, GetLastError()); -#else - void* base = mmap(nullptr, size, PROT_READ, MAP_ANON | MAP_PRIVATE | MAP_NOCORE, -1, 0); - if (base == MAP_FAILED) - base = nullptr; - ASSERT_MSG(base, "Failed to allocate {:#x} sized region with error {}", size, strerror(errno)); -#endif - return base; -} - -void FreeMemoryPages(void* base, [[maybe_unused]] std::size_t size) noexcept { - if (auto page = HostPageSize; size % page != 0) { - size = AlignUp(size, page); - } - if (!base) - return; -#ifdef _WIN32 - ASSERT(VirtualFree(base, 0, MEM_RELEASE)); -#else - ASSERT(munmap(base, size) == 0); -#endif -} - -} // namespace Common diff --git a/src/common/sparse_large_vector.h b/src/common/sparse_large_vector.h deleted file mode 100644 index 827944fb08..0000000000 --- a/src/common/sparse_large_vector.h +++ /dev/null @@ -1,194 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -/* virtual_buffer.h */ -// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include -#include -#include - -#ifndef _WIN32 -#include -#include -#endif - -#include "common/alignment.h" -#include "common/assert.h" - -namespace Common { - -#ifdef _WIN32 -constexpr u64 HostPageSize = 0x1000; -constexpr u64 HostPageBits = 12; -constexpr u64 HostPageMask = ~(HostPageSize - 1); -bool CommitVectorPage(uintptr_t addr, bool write) noexcept; -#else -const u64 HostPageSize = sysconf(_SC_PAGESIZE); -const u64 HostPageBits = std::countr_zero(HostPageSize); -const u64 HostPageMask = ~(HostPageSize - 1); -#endif - -void* AllocateMemoryPages(std::size_t size) noexcept; -void FreeMemoryPages(void* base, std::size_t size) noexcept; - -/// A large page-aligned buffer that has optimized memory usage for zero-writes. -template -requires std::is_trivially_copyable_v -class SparseLargeVector final { -public: - constexpr SparseLargeVector() = default; - - explicit SparseLargeVector(std::size_t count) noexcept - : alloc_size{count * sizeof(T)} - { - base_ptr = static_cast(AllocateMemoryPages(alloc_size)); - - // each item in vector holds information for 64 pages - auto denom = HostPageSize * 64; - committed_pages = std::vector>((alloc_size + denom - 1) / denom); - } - - ~SparseLargeVector() noexcept { - FreeMemoryPages(base_ptr, alloc_size); - } - - SparseLargeVector(const SparseLargeVector&) = delete; - SparseLargeVector& operator=(const SparseLargeVector&) = delete; - SparseLargeVector(SparseLargeVector&& other) = delete; - SparseLargeVector& operator=(SparseLargeVector&& other) = delete; - - void ResizeAndClear(std::size_t count) noexcept { - if (auto const new_size = count * sizeof(T); new_size != alloc_size) { - FreeMemoryPages(base_ptr, alloc_size); - alloc_size = new_size; - base_ptr = static_cast(AllocateMemoryPages(alloc_size)); - - auto denom = HostPageSize * 64; - committed_pages = std::vector>((alloc_size + denom - 1) / denom); - } - } - - /// Returns a reference to the value of the requested index and allocates memory if needed. - T& GetAndFault(std::size_t index) noexcept { - if (index > alloc_size / sizeof(T)) { - UNREACHABLE_MSG("Out of bounds RW access on SparseLargeVector @ {}", index); - } - - if (!IsCommittedPage(index)) { - CommitPage(index); - } - return base_ptr[index]; - } - - /// Returns a reference to the value of the requested index if initialized, or will otherwise return a zero-initialized object. - const T& GetOrDefault(std::size_t index) const { -#ifdef _WIN32 - if (!IsCommittedPage(index)) { - return *reinterpret_cast(&default_val); - } -#endif - // On non-Windows, OS page table should optimize this by pointing to a zero page if unallocated. - return base_ptr[index]; - } - - void Set(std::size_t index, const T& value) noexcept { - if (index > alloc_size / sizeof(T)) { - LOG_CRITICAL(Common_Memory, "Out of bounds write on SparseLargeVector @ {}", index); - return; - } - if (!IsCommittedPage(index)) - CommitPage(index); - base_ptr[index] = value; - } - - void ZeroRegion(std::size_t start, std::size_t end_) noexcept { - u64 base = reinterpret_cast(&base_ptr[start]); - const u64 end = reinterpret_cast(&base_ptr[end_]); - - const u64 end_page = AlignUp(base, HostPageSize); - const u64 first_size = (std::min)(end_page, end) - base; - - if (IsCommittedPage(start / sizeof(T))) { - std::memset(reinterpret_cast(base), 0, first_size); - } - - if (end <= end_page) - return; - - base = end_page; - - for (u64 page = base; page < end; page += HostPageSize) { - if (!IsCommittedPage((page - reinterpret_cast(base_ptr)) / sizeof(T))) { - continue; - } - - std::memset(reinterpret_cast(page), 0, (std::min)( HostPageSize, end - page)); - } - } - - constexpr void CommitRegion(size_t index, size_t end_) { - const u64 base = static_cast(index) * sizeof(T); - const u64 end = static_cast(end_) * sizeof(T); - - for (u64 page = AlignDown(base, HostPageSize); page < end; page += HostPageSize) { - if (!IsCommittedPage(page / sizeof(T))) { - CommitPage(page / sizeof(T)); - } - } - } - - constexpr T& GetUnchecked(size_t index) { - return base_ptr[index]; - } - - [[nodiscard]] constexpr const T& operator[](std::size_t index) const noexcept { - return GetOrDefault(index); - } - - [[nodiscard]] constexpr const T* data() const noexcept { - return base_ptr; - } - - [[nodiscard]] constexpr std::size_t size() const noexcept { - return alloc_size / sizeof(T); - } - -private: - [[nodiscard]] constexpr bool IsCommittedPage(std::size_t index) const noexcept { - if (index > alloc_size / sizeof(T)) { - LOG_CRITICAL(Common_Memory, "Out of bounds access on large vector @ {}", index); - return false; - } - - auto page = (index * sizeof(T)) >> HostPageBits; - auto val = committed_pages[page >> 6].load(std::memory_order_acquire); - return (val >> (page & 63)) & 1; - } - - constexpr void CommitPage(std::size_t index) noexcept { - auto page_index = (index * sizeof(T)) >> HostPageBits; - auto page = reinterpret_cast(base_ptr + index) & HostPageMask; -#if defined(_WIN32) - CommitVectorPage(page, true); -#else - mprotect(reinterpret_cast(page), HostPageSize, PROT_READ | PROT_WRITE); -#endif - - committed_pages[page_index >> 6].fetch_or(1ULL << (page_index & 63), std::memory_order_release); - } - - std::size_t alloc_size{}; - T* base_ptr{}; - - std::vector> committed_pages{}; -#ifdef _WIN32 - const std::array default_val{}; -#endif -}; - -} // namespace Common diff --git a/src/common/virtual_buffer.cpp b/src/common/virtual_buffer.cpp new file mode 100644 index 0000000000..8a4265e3e6 --- /dev/null +++ b/src/common/virtual_buffer.cpp @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifdef _WIN32 +#include +#else +#include +#endif + +#include "common/assert.h" +#include "common/virtual_buffer.h" + +namespace Common { + +void* AllocateMemoryPages(std::size_t size) noexcept { +#ifdef _WIN32 + void* base = VirtualAlloc(nullptr, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); + if (base == nullptr) { + // Probably failing to reserve is less likely than failing to commit + base = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE); + } +#else + void* base = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); + if (base == MAP_FAILED) + base = nullptr; +#endif + ASSERT(base); + return base; +} + +void FreeMemoryPages(void* base, [[maybe_unused]] std::size_t size) noexcept { + if (!base) + return; +#ifdef _WIN32 + ASSERT(VirtualFree(base, 0, MEM_RELEASE)); +#else + ASSERT(munmap(base, size) == 0); +#endif +} + +} // namespace Common diff --git a/src/common/virtual_buffer.h b/src/common/virtual_buffer.h new file mode 100644 index 0000000000..d6386e2a4d --- /dev/null +++ b/src/common/virtual_buffer.h @@ -0,0 +1,84 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +namespace Common { + +void* AllocateMemoryPages(std::size_t size) noexcept; +void FreeMemoryPages(void* base, std::size_t size) noexcept; + +template +class VirtualBuffer final { +public: + // TODO: Uncomment this and change Common::PageTable::PageInfo to be trivially constructible + // using std::atomic_ref once libc++ has support for it + // static_assert( + // std::is_trivially_constructible_v, + // "T must be trivially constructible, as non-trivial constructors will not be executed " + // "with the current allocator"); + + constexpr VirtualBuffer() = default; + explicit VirtualBuffer(std::size_t count) noexcept + : alloc_size{count * sizeof(T)} + { + base_ptr = reinterpret_cast(AllocateMemoryPages(alloc_size)); + } + + ~VirtualBuffer() noexcept { + FreeMemoryPages(base_ptr, alloc_size); + } + + VirtualBuffer(const VirtualBuffer&) = delete; + VirtualBuffer& operator=(const VirtualBuffer&) = delete; + + VirtualBuffer(VirtualBuffer&& other) noexcept + : alloc_size{std::exchange(other.alloc_size, 0)} + , base_ptr{std::exchange(other.base_ptr, nullptr)} + {} + + VirtualBuffer& operator=(VirtualBuffer&& other) noexcept { + alloc_size = std::exchange(other.alloc_size, 0); + base_ptr = std::exchange(other.base_ptr, nullptr); + return *this; + } + + void resize(std::size_t count) noexcept { + if (auto const new_size = count * sizeof(T); new_size != alloc_size) { + FreeMemoryPages(base_ptr, alloc_size); + alloc_size = new_size; + base_ptr = reinterpret_cast(AllocateMemoryPages(alloc_size)); + } + } + + [[nodiscard]] constexpr const T& operator[](std::size_t index) const noexcept { + return base_ptr[index]; + } + + [[nodiscard]] constexpr T& operator[](std::size_t index) noexcept { + return base_ptr[index]; + } + + [[nodiscard]] constexpr T* data() noexcept { + return base_ptr; + } + + [[nodiscard]] constexpr const T* data() const noexcept { + return base_ptr; + } + + [[nodiscard]] constexpr std::size_t size() const noexcept { + return alloc_size / sizeof(T); + } + +private: + std::size_t alloc_size{}; + T* base_ptr{}; +}; + +} // namespace Common diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 80e2b2dca9..97284efa4c 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp @@ -172,12 +172,12 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) { if (page_table) { constexpr size_t PageBits = 12; constexpr size_t NumPageTableEntries = 1 << (32 - PageBits); + constexpr size_t PageLog2Stride = 5; + static_assert(1 << PageLog2Stride == sizeof(Common::PageTable::PageEntryData)); - // Dynarmic will not write to the page table, const_cast is safe here - config.page_table = reinterpret_cast*>( - const_cast(page_table->entries.data())); - config.page_table_pointer_mask = Common::PageTable::ATTRIBUTE_MASK; - config.page_table_marked_bit = 0; + config.page_table = reinterpret_cast*>(page_table->entries.data()); + config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; + config.page_table_log2_stride = PageLog2Stride; config.absolute_offset_page_table = true; config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; config.only_detect_misalignment_via_page_table_on_page_boundary = true; @@ -188,13 +188,6 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) { config.fastmem_exclusive_access = config.fastmem_pointer != std::nullopt; config.recompile_on_exclusive_fastmem_failure = true; - - if (reinterpret_cast(m_system.DeviceMemory().buffer.BackingBasePointer() + - Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize()) < (1ULL << 39)) { - // Systems like FreeBSD allocate memory really low by default, and since we pack our page table entries, - // we have to manually sign extend when our actual pointer is negative. - config.page_table_sign_extension = Common::PageTable::SIGN_BIT; - } } // Multi-process state @@ -427,7 +420,6 @@ void ArmDynarmic32::SignalInterrupt(Kernel::KThread* thread) { } void ArmDynarmic32::ClearInstructionCache() { - m_cb->last_code_addr = u64(-1); m_jit->ClearCache(); } diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 9662bf1712..0b7f6874a7 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp @@ -211,12 +211,13 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s // Memory if (page_table) { - // Dynarmic will not write to the page table, const_cast is safe here - config.page_table = reinterpret_cast( - const_cast(page_table->entries.data())); + constexpr size_t PageLog2Stride = 5; + static_assert(1 << PageLog2Stride == sizeof(Common::PageTable::PageEntryData)); + + config.page_table = reinterpret_cast(page_table->entries.data()); config.page_table_address_space_bits = std::uint32_t(address_space_bits); - config.page_table_pointer_mask = Common::PageTable::ATTRIBUTE_MASK; - config.page_table_marked_bit = 0; + config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; + config.page_table_log2_stride = PageLog2Stride; config.silently_mirror_page_table = false; config.absolute_offset_page_table = true; config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; @@ -230,13 +231,6 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s config.fastmem_exclusive_access = config.fastmem_pointer != std::nullopt; config.recompile_on_exclusive_fastmem_failure = true; - - if (reinterpret_cast(m_system.DeviceMemory().buffer.BackingBasePointer() + - Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize()) < (1ULL << 39)) { - // Systems like FreeBSD allocate memory really low by default, and since we pack our page table entries, - // we have to manually sign extend when our actual pointer is negative. - config.page_table_sign_extension = Common::PageTable::SIGN_BIT; - } } // Multi-process state @@ -453,7 +447,6 @@ void ArmDynarmic64::SignalInterrupt(Kernel::KThread* thread) { } void ArmDynarmic64::ClearInstructionCache() { - m_cb->last_code_addr = u64(-1); m_jit->ClearCache(); } diff --git a/src/core/device_memory.h b/src/core/device_memory.h index b5103e23bc..11bf0e3268 100644 --- a/src/core/device_memory.h +++ b/src/core/device_memory.h @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -29,11 +26,8 @@ public: template Common::PhysicalAddress GetPhysicalAddr(const T* ptr) const { - return GetPhysicalAddr(reinterpret_cast(ptr)); - } - - Common::PhysicalAddress GetPhysicalAddr(uintptr_t ptr) const { - return (ptr - reinterpret_cast(buffer.BackingBasePointer())) + + return (reinterpret_cast(ptr) - + reinterpret_cast(buffer.BackingBasePointer())) + DramMemoryMap::Base; } diff --git a/src/core/device_memory_manager.h b/src/core/device_memory_manager.h index b4b3b46088..3d97fdcc5c 100644 --- a/src/core/device_memory_manager.h +++ b/src/core/device_memory_manager.h @@ -18,7 +18,7 @@ #include "common/common_types.h" #include "common/range_mutex.h" #include "common/scratch_buffer.h" -#include "common/sparse_large_vector.h" +#include "common/virtual_buffer.h" namespace Core { @@ -178,8 +178,8 @@ private: u32 continuity_tracker; u32 compressed_physical_ptr; }; - Common::SparseLargeVector compressed_device_addr; - Common::SparseLargeVector tracked_entries; + Common::VirtualBuffer compressed_device_addr; + Common::VirtualBuffer tracked_entries; // Process memory interfaces @@ -200,8 +200,8 @@ private: return std::make_pair(asid, address); } - constexpr void InsertCPUBacking(size_t page_index, VAddr address, Asid asid) { - tracked_entries.GetUnchecked(page_index).cpu_backing_address = address | (asid.id << asid_start_bit); + void InsertCPUBacking(size_t page_index, VAddr address, Asid asid) { + tracked_entries[page_index].cpu_backing_address = address | (asid.id << asid_start_bit); } std::array t_slot{}; diff --git a/src/core/device_memory_manager.inc b/src/core/device_memory_manager.inc index 97c2706abb..9866f3a4f7 100644 --- a/src/core/device_memory_manager.inc +++ b/src/core/device_memory_manager.inc @@ -177,6 +177,17 @@ DeviceMemoryManager::DeviceMemoryManager(const DeviceMemory& device_memo { impl = std::make_unique>(); cached_pages = std::make_unique(); + + const size_t total_virtual = device_as_size >> Memory::YUZU_PAGEBITS; + for (size_t i = 0; i < total_virtual; i++) { + tracked_entries[i].compressed_physical_ptr = 0; + tracked_entries[i].continuity_tracker = 1; + tracked_entries[i].cpu_backing_address = 0; + } + const size_t total_phys = 1ULL << ((Settings::values.memory_layout_mode.GetValue() == Settings::MemoryLayout::Memory_4Gb ? physical_min_bits : physical_max_bits) - Memory::YUZU_PAGEBITS); + for (size_t i = 0; i < total_phys; i++) { + compressed_device_addr[i] = 0; + } } template @@ -209,28 +220,26 @@ void DeviceMemoryManager::Map(DAddr address, VAddr virtual_address, size size_t start_page_d = address >> Memory::YUZU_PAGEBITS; size_t num_pages = Common::AlignUp(size, Memory::YUZU_PAGESIZE) >> Memory::YUZU_PAGEBITS; std::scoped_lock lk(mapping_guard); - - tracked_entries.CommitRegion(start_page_d, start_page_d + num_pages); for (size_t i = 0; i < num_pages; i++) { const VAddr new_vaddress = virtual_address + i * Memory::YUZU_PAGESIZE; auto* ptr = process_memory->GetPointerSilent(Common::ProcessAddress(new_vaddress)); if (ptr == nullptr) [[unlikely]] { - tracked_entries.GetUnchecked(start_page_d + i).compressed_physical_ptr = 0; + tracked_entries[start_page_d + i].compressed_physical_ptr = 0; continue; } auto phys_addr = static_cast(GetRawPhysicalAddr(ptr) >> Memory::YUZU_PAGEBITS) + 1U; - tracked_entries.GetUnchecked(start_page_d + i).compressed_physical_ptr = phys_addr; + tracked_entries[start_page_d + i].compressed_physical_ptr = phys_addr; InsertCPUBacking(start_page_d + i, new_vaddress, asid); const u32 base_dev = compressed_device_addr[phys_addr - 1U]; const u32 new_dev = static_cast(start_page_d + i); if (base_dev == 0) [[likely]] { - compressed_device_addr.GetAndFault(phys_addr - 1U) = new_dev; + compressed_device_addr[phys_addr - 1U] = new_dev; continue; } u32 start_id = base_dev & MULTI_MASK; if ((base_dev >> MULTI_FLAG_BITS) == 0) { start_id = impl->multi_dev_address.Register(base_dev); - compressed_device_addr.GetAndFault(phys_addr - 1U) = MULTI_FLAG | start_id; + compressed_device_addr[phys_addr - 1U] = MULTI_FLAG | start_id; } impl->multi_dev_address.Register(new_dev, start_id); } @@ -246,26 +255,24 @@ void DeviceMemoryManager::Unmap(DAddr address, size_t size) { size_t num_pages = Common::AlignUp(size, Memory::YUZU_PAGESIZE) >> Memory::YUZU_PAGEBITS; device_inter->InvalidateRegion(address, size); std::scoped_lock lk(mapping_guard); - - tracked_entries.CommitRegion(start_page_d, start_page_d + num_pages); // should already be committed, but just in case for (size_t i = 0; i < num_pages; i++) { - auto& entry = tracked_entries.GetUnchecked(start_page_d + i); - auto phys_addr = entry.compressed_physical_ptr; - entry.compressed_physical_ptr = 0; - entry.cpu_backing_address = 0; + auto phys_addr = tracked_entries[start_page_d + i].compressed_physical_ptr; + tracked_entries[start_page_d + i].compressed_physical_ptr = 0; + tracked_entries[start_page_d + i].cpu_backing_address = 0; if (phys_addr != 0) [[likely]] { - u32& base_dev = compressed_device_addr.GetAndFault(phys_addr - 1U); + const u32 base_dev = compressed_device_addr[phys_addr - 1U]; if ((base_dev >> MULTI_FLAG_BITS) == 0) [[likely]] { - base_dev = 0; + compressed_device_addr[phys_addr - 1] = 0; continue; } const auto [more_entries, new_start] = impl->multi_dev_address.Unregister( static_cast(start_page_d + i), base_dev & MULTI_MASK); if (!more_entries) { - base_dev = impl->multi_dev_address.ReleaseEntry(new_start); + compressed_device_addr[phys_addr - 1] = + impl->multi_dev_address.ReleaseEntry(new_start); continue; } - base_dev = new_start | MULTI_FLAG; + compressed_device_addr[phys_addr - 1] = new_start | MULTI_FLAG; } } t_slot = {}; @@ -278,8 +285,6 @@ void DeviceMemoryManager::TrackContinuityImpl(DAddr address, VAddr virtu size_t num_pages = Common::AlignUp(size, Memory::YUZU_PAGESIZE) >> Memory::YUZU_PAGEBITS; uintptr_t last_ptr = 0; size_t page_count = 1; - - tracked_entries.CommitRegion(start_page_d, start_page_d + num_pages); for (size_t i = num_pages; i > 0; i--) { size_t index = i - 1; const VAddr new_vaddress = virtual_address + index * Memory::YUZU_PAGESIZE; @@ -291,14 +296,14 @@ void DeviceMemoryManager::TrackContinuityImpl(DAddr address, VAddr virtu page_count = 1; } last_ptr = new_ptr; - tracked_entries.GetUnchecked(start_page_d + index).continuity_tracker = static_cast(page_count) - 1; + tracked_entries[start_page_d + index].continuity_tracker = static_cast(page_count); } } template u8* DeviceMemoryManager::GetSpan(const DAddr src_addr, const std::size_t size) { size_t page_index = src_addr >> page_bits; size_t subbits = src_addr & page_mask; - if ((static_cast(tracked_entries[page_index].continuity_tracker+1) << page_bits) >= size + subbits) { + if ((static_cast(tracked_entries[page_index].continuity_tracker) << page_bits) >= size + subbits) { return GetPointer(src_addr); } return nullptr; @@ -308,7 +313,7 @@ template const u8* DeviceMemoryManager::GetSpan(const DAddr src_addr, const std::size_t size) const { size_t page_index = src_addr >> page_bits; size_t subbits = src_addr & page_mask; - if ((static_cast(tracked_entries[page_index].continuity_tracker+1) << page_bits) >= size + subbits) { + if ((static_cast(tracked_entries[page_index].continuity_tracker) << page_bits) >= size + subbits) { return GetPointer(src_addr); } return nullptr; @@ -378,7 +383,7 @@ void DeviceMemoryManager::WalkBlock(DAddr addr, std::size_t size, auto o std::size_t page_index = addr >> Memory::YUZU_PAGEBITS; std::size_t page_offset = addr & Memory::YUZU_PAGEMASK; while (remaining_size) { - const size_t next_pages = std::size_t(tracked_entries[page_index].continuity_tracker+1); + const size_t next_pages = std::size_t(tracked_entries[page_index].continuity_tracker); const std::size_t copy_amount = (std::min)((next_pages << Memory::YUZU_PAGEBITS) - page_offset, remaining_size); const auto current_vaddr = u64((page_index << Memory::YUZU_PAGEBITS) + page_offset); SCOPE_EXIT{ diff --git a/src/core/hle/kernel/k_page_table_base.cpp b/src/core/hle/kernel/k_page_table_base.cpp index 2a0a7d49d5..a727355a9f 100644 --- a/src/core/hle/kernel/k_page_table_base.cpp +++ b/src/core/hle/kernel/k_page_table_base.cpp @@ -635,36 +635,6 @@ Result KPageTableBase::CheckMemoryState(const KMemoryInfo& info, KMemoryState st R_SUCCEED(); } -bool KPageTableBase::BeginTraversal(const Common::PageTable &impl, TraversalEntry *out_entry, TraversalContext *out_context, - Common::ProcessAddress address) const { - out_context->next_offset = GetInteger(address); - out_context->next_page = GetInteger(address) >> PageBits; - - return ContinueTraversal(impl, out_entry, out_context); -} - -bool KPageTableBase::ContinueTraversal(const Common::PageTable &impl, TraversalEntry *out_entry, - TraversalContext *context) const { - // Setup invalid defaults. - out_entry->phys_addr = 0; - out_entry->block_size = PageSize; - // Validate that we can read the actual entry. - if (auto const page = context->next_page; page < impl.entries.size()) { - // Validate that the entry is mapped. - if (auto const paddr = impl.entries[page].Pointer(true); paddr != 0) { - // Populate the results and return true - out_entry->phys_addr = GetInteger(m_system.DeviceMemory().GetPhysicalAddr(paddr + context->next_offset)); - context->next_page += 1; - context->next_offset += PageSize; - return true; - } - } - context->next_page += 1; - context->next_offset += PageSize; - // Otherwise return false - return false; -} - Result KPageTableBase::CheckMemoryStateContiguous(size_t* out_blocks_needed, KProcessAddress addr, size_t size, KMemoryState state_mask, KMemoryState state, KMemoryPermission perm_mask, @@ -970,7 +940,7 @@ Result KPageTableBase::QueryMappingImpl(KProcessAddress* out, KPhysicalAddress a size_t tot_size = 0; next_valid = - BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), region_start); + impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), region_start); next_entry.block_size = (next_entry.block_size - (GetInteger(region_start) & (next_entry.block_size - 1))); @@ -1006,7 +976,7 @@ Result KPageTableBase::QueryMappingImpl(KProcessAddress* out, KPhysicalAddress a break; } - next_valid = ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context)); + next_valid = impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); } // Check the last entry. @@ -1784,7 +1754,7 @@ Result KPageTableBase::MakePageGroup(KPageGroup& pg, KProcessAddress addr, size_ // Begin traversal. TraversalContext context; TraversalEntry next_entry; - R_UNLESS(BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), addr), + R_UNLESS(impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), addr), ResultInvalidCurrentMemory); // Prepare tracking variables. @@ -1794,7 +1764,7 @@ Result KPageTableBase::MakePageGroup(KPageGroup& pg, KProcessAddress addr, size_ // Iterate, adding to group as we go. while (tot_size < size) { - R_UNLESS(ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context)), + R_UNLESS(impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)), ResultInvalidCurrentMemory); if (next_entry.phys_addr != (cur_addr + cur_size)) { @@ -1858,7 +1828,7 @@ bool KPageTableBase::IsValidPageGroup(const KPageGroup& pg, KProcessAddress addr // Begin traversal. TraversalContext context; TraversalEntry next_entry; - if (!BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), addr)) { + if (!impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), addr)) { return false; } @@ -1869,7 +1839,7 @@ bool KPageTableBase::IsValidPageGroup(const KPageGroup& pg, KProcessAddress addr // Iterate, comparing expected to actual. while (tot_size < size) { - if (!ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context))) { + if (!impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context))) { return false; } @@ -1926,7 +1896,7 @@ Result KPageTableBase::GetContiguousMemoryRangeWithState( // Begin a traversal. TraversalContext context; TraversalEntry cur_entry = {.phys_addr = 0, .block_size = 0}; - R_UNLESS(BeginTraversal(impl, std::addressof(cur_entry), std::addressof(context), address), + R_UNLESS(impl.BeginTraversal(std::addressof(cur_entry), std::addressof(context), address), ResultInvalidCurrentMemory); // Traverse until we have enough size or we aren't contiguous any more. @@ -1935,7 +1905,7 @@ Result KPageTableBase::GetContiguousMemoryRangeWithState( for (contig_size = cur_entry.block_size - (GetInteger(phys_address) & (cur_entry.block_size - 1)); contig_size < size; contig_size += cur_entry.block_size) { - if (!ContinueTraversal(impl, std::addressof(cur_entry), std::addressof(context))) { + if (!impl.ContinueTraversal(std::addressof(cur_entry), std::addressof(context))) { break; } if (cur_entry.phys_addr != phys_address + contig_size) { @@ -2364,7 +2334,7 @@ Result KPageTableBase::QueryPhysicalAddress(Svc::lp64::PhysicalMemoryInfo* out, TraversalContext context; TraversalEntry next_entry; bool traverse_valid = - BeginTraversal(m_impl, std::addressof(next_entry), std::addressof(context), virt_addr); + m_impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), virt_addr); R_UNLESS(traverse_valid, ResultInvalidCurrentMemory); // Set tracking variables. @@ -2375,7 +2345,7 @@ Result KPageTableBase::QueryPhysicalAddress(Svc::lp64::PhysicalMemoryInfo* out, while (true) { // Continue the traversal. traverse_valid = - ContinueTraversal(m_impl, std::addressof(next_entry), std::addressof(context)); + m_impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); if (!traverse_valid) { break; } @@ -2597,7 +2567,7 @@ Result KPageTableBase::UnmapIoRegion(KProcessAddress dst_address, KPhysicalAddre TraversalContext context; TraversalEntry next_entry; ASSERT( - BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), dst_address)); + impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), dst_address)); // Check that the physical region matches. R_UNLESS(next_entry.phys_addr == phys_addr, ResultInvalidMemoryRegion); @@ -2607,7 +2577,7 @@ Result KPageTableBase::UnmapIoRegion(KProcessAddress dst_address, KPhysicalAddre next_entry.block_size - (GetInteger(phys_addr) & (next_entry.block_size - 1)); checked_size < size; checked_size += next_entry.block_size) { // Continue the traversal. - ASSERT(ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context))); + ASSERT(impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context))); // Check that the physical region matches. R_UNLESS(next_entry.phys_addr == phys_addr + checked_size, ResultInvalidMemoryRegion); @@ -3059,7 +3029,7 @@ Result KPageTableBase::InvalidateProcessDataCache(KProcessAddress address, size_ TraversalContext context; TraversalEntry next_entry; bool traverse_valid = - BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), address); + impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), address); R_UNLESS(traverse_valid, ResultInvalidCurrentMemory); // Prepare tracking variables. @@ -3071,7 +3041,7 @@ Result KPageTableBase::InvalidateProcessDataCache(KProcessAddress address, size_ while (tot_size < size) { // Continue the traversal. traverse_valid = - ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context)); + impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); R_UNLESS(traverse_valid, ResultInvalidCurrentMemory); if (next_entry.phys_addr != (cur_addr + cur_size)) { @@ -3159,7 +3129,7 @@ Result KPageTableBase::ReadDebugMemory(KProcessAddress dst_address, KProcessAddr TraversalContext context; TraversalEntry next_entry; bool traverse_valid = - BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), src_address); + impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), src_address); R_UNLESS(traverse_valid, ResultInvalidCurrentMemory); // Prepare tracking variables. @@ -3197,7 +3167,7 @@ Result KPageTableBase::ReadDebugMemory(KProcessAddress dst_address, KProcessAddr while (tot_size < size) { // Continue the traversal. traverse_valid = - ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context)); + impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); ASSERT(traverse_valid); if (next_entry.phys_addr != (cur_addr + cur_size)) { @@ -3255,7 +3225,7 @@ Result KPageTableBase::WriteDebugMemory(KProcessAddress dst_address, KProcessAdd TraversalContext context; TraversalEntry next_entry; bool traverse_valid = - BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), dst_address); + impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), dst_address); R_UNLESS(traverse_valid, ResultInvalidCurrentMemory); // Prepare tracking variables. @@ -3297,7 +3267,7 @@ Result KPageTableBase::WriteDebugMemory(KProcessAddress dst_address, KProcessAdd while (tot_size < size) { // Continue the traversal. traverse_valid = - ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context)); + impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); ASSERT(traverse_valid); if (next_entry.phys_addr != (cur_addr + cur_size)) { @@ -3758,7 +3728,7 @@ Result KPageTableBase::CopyMemoryFromLinearToUser( TraversalContext context; TraversalEntry next_entry; bool traverse_valid = - BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), src_addr); + impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), src_addr); ASSERT(traverse_valid); // Prepare tracking variables. @@ -3798,7 +3768,7 @@ Result KPageTableBase::CopyMemoryFromLinearToUser( while (tot_size < size) { // Continue the traversal. traverse_valid = - ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context)); + impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); ASSERT(traverse_valid); if (next_entry.phys_addr != (cur_addr + cur_size)) { @@ -3852,7 +3822,7 @@ Result KPageTableBase::CopyMemoryFromLinearToKernel( TraversalContext context; TraversalEntry next_entry; bool traverse_valid = - BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), src_addr); + impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), src_addr); ASSERT(traverse_valid); // Prepare tracking variables. @@ -3875,7 +3845,7 @@ Result KPageTableBase::CopyMemoryFromLinearToKernel( while (tot_size < size) { // Continue the traversal. traverse_valid = - ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context)); + impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); ASSERT(traverse_valid); if (next_entry.phys_addr != (cur_addr + cur_size)) { @@ -3932,7 +3902,7 @@ Result KPageTableBase::CopyMemoryFromUserToLinear( TraversalContext context; TraversalEntry next_entry; bool traverse_valid = - BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), dst_addr); + impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), dst_addr); ASSERT(traverse_valid); // Prepare tracking variables. @@ -3971,7 +3941,7 @@ Result KPageTableBase::CopyMemoryFromUserToLinear( while (tot_size < size) { // Continue the traversal. traverse_valid = - ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context)); + impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); ASSERT(traverse_valid); if (next_entry.phys_addr != (cur_addr + cur_size)) { @@ -4027,7 +3997,7 @@ Result KPageTableBase::CopyMemoryFromKernelToLinear(KProcessAddress dst_addr, si TraversalContext context; TraversalEntry next_entry; bool traverse_valid = - BeginTraversal(impl, std::addressof(next_entry), std::addressof(context), dst_addr); + impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), dst_addr); ASSERT(traverse_valid); // Prepare tracking variables. @@ -4050,7 +4020,7 @@ Result KPageTableBase::CopyMemoryFromKernelToLinear(KProcessAddress dst_addr, si while (tot_size < size) { // Continue the traversal. traverse_valid = - ContinueTraversal(impl, std::addressof(next_entry), std::addressof(context)); + impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); ASSERT(traverse_valid); if (next_entry.phys_addr != (cur_addr + cur_size)) { @@ -4119,10 +4089,10 @@ Result KPageTableBase::CopyMemoryFromHeapToHeap( bool traverse_valid; // Begin traversal. - traverse_valid = BeginTraversal(src_impl, std::addressof(src_next_entry), + traverse_valid = src_impl.BeginTraversal(std::addressof(src_next_entry), std::addressof(src_context), src_addr); ASSERT(traverse_valid); - traverse_valid = BeginTraversal(dst_impl, std::addressof(dst_next_entry), + traverse_valid = dst_impl.BeginTraversal(std::addressof(dst_next_entry), std::addressof(dst_context), dst_addr); ASSERT(traverse_valid); @@ -4157,7 +4127,7 @@ Result KPageTableBase::CopyMemoryFromHeapToHeap( if (ofs + cur_copy_size != size) { if (cur_src_addr + cur_min_size == cur_src_block_addr + cur_src_size) { // Continue the src traversal. - traverse_valid = ContinueTraversal(src_impl, std::addressof(src_next_entry), + traverse_valid = src_impl.ContinueTraversal(std::addressof(src_next_entry), std::addressof(src_context)); ASSERT(traverse_valid); @@ -4168,7 +4138,7 @@ Result KPageTableBase::CopyMemoryFromHeapToHeap( if (cur_dst_addr + cur_min_size == dst_next_entry.phys_addr + dst_next_entry.block_size) { // Continue the dst traversal. - traverse_valid = ContinueTraversal(dst_impl, std::addressof(dst_next_entry), + traverse_valid = dst_impl.ContinueTraversal(std::addressof(dst_next_entry), std::addressof(dst_context)); ASSERT(traverse_valid); @@ -4253,10 +4223,10 @@ Result KPageTableBase::CopyMemoryFromHeapToHeapWithoutCheckDestination( bool traverse_valid; // Begin traversal. - traverse_valid = BeginTraversal(src_impl, std::addressof(src_next_entry), + traverse_valid = src_impl.BeginTraversal(std::addressof(src_next_entry), std::addressof(src_context), src_addr); ASSERT(traverse_valid); - traverse_valid = BeginTraversal(dst_impl, std::addressof(dst_next_entry), + traverse_valid = dst_impl.BeginTraversal(std::addressof(dst_next_entry), std::addressof(dst_context), dst_addr); ASSERT(traverse_valid); @@ -4291,7 +4261,7 @@ Result KPageTableBase::CopyMemoryFromHeapToHeapWithoutCheckDestination( if (ofs + cur_copy_size != size) { if (cur_src_addr + cur_min_size == cur_src_block_addr + cur_src_size) { // Continue the src traversal. - traverse_valid = ContinueTraversal(src_impl, std::addressof(src_next_entry), + traverse_valid = src_impl.ContinueTraversal(std::addressof(src_next_entry), std::addressof(src_context)); ASSERT(traverse_valid); @@ -4302,7 +4272,7 @@ Result KPageTableBase::CopyMemoryFromHeapToHeapWithoutCheckDestination( if (cur_dst_addr + cur_min_size == dst_next_entry.phys_addr + dst_next_entry.block_size) { // Continue the dst traversal. - traverse_valid = ContinueTraversal(dst_impl, std::addressof(dst_next_entry), + traverse_valid = dst_impl.ContinueTraversal(std::addressof(dst_next_entry), std::addressof(dst_context)); ASSERT(traverse_valid); @@ -4577,7 +4547,7 @@ Result KPageTableBase::SetupForIpcServer(KProcessAddress* out_addr, size_t size, // Begin traversal. TraversalContext context; TraversalEntry next_entry; - bool traverse_valid = BeginTraversal(src_impl, std::addressof(next_entry), + bool traverse_valid = src_impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), aligned_src_start); ASSERT(traverse_valid); @@ -4627,7 +4597,7 @@ Result KPageTableBase::SetupForIpcServer(KProcessAddress* out_addr, size_t size, // If the block's size was one page, we may need to continue traversal. if (cur_block_size == 0 && aligned_src_size > PageSize) { traverse_valid = - ContinueTraversal(src_impl, std::addressof(next_entry), std::addressof(context)); + src_impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); ASSERT(traverse_valid); cur_block_addr = next_entry.phys_addr; @@ -4640,7 +4610,7 @@ Result KPageTableBase::SetupForIpcServer(KProcessAddress* out_addr, size_t size, while (aligned_src_start + tot_block_size < mapping_src_end) { // Continue the traversal. traverse_valid = - ContinueTraversal(src_impl, std::addressof(next_entry), std::addressof(context)); + src_impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); ASSERT(traverse_valid); // Process the block. @@ -4683,7 +4653,7 @@ Result KPageTableBase::SetupForIpcServer(KProcessAddress* out_addr, size_t size, if (mapped_block_end + cur_block_size < aligned_src_end && cur_block_size == last_block_size) { traverse_valid = - ContinueTraversal(src_impl, std::addressof(next_entry), std::addressof(context)); + src_impl.ContinueTraversal(std::addressof(next_entry), std::addressof(context)); ASSERT(traverse_valid); cur_block_addr = next_entry.phys_addr; @@ -5631,7 +5601,7 @@ Result KPageTableBase::UnmapProcessMemory(KProcessAddress dst_address, size_t si ContiguousRangeInfo(KPageTableBase& pt, KProcessAddress address, size_t size) : m_pt(pt), m_remaining_size(size) { // Begin a traversal. - ASSERT(m_pt.BeginTraversal(m_pt.GetImpl(), std::addressof(m_entry), + ASSERT(m_pt.GetImpl().BeginTraversal(std::addressof(m_entry), std::addressof(m_context), address)); // Setup tracking fields. @@ -5662,7 +5632,7 @@ Result KPageTableBase::UnmapProcessMemory(KProcessAddress dst_address, size_t si void DetermineContiguousBlockExtents() { // Continue traversing until we're not contiguous, or we have enough. while (m_cur_size < m_remaining_size) { - ASSERT(m_pt.ContinueTraversal(m_pt.GetImpl(), std::addressof(m_entry), + ASSERT(m_pt.GetImpl().ContinueTraversal(std::addressof(m_entry), std::addressof(m_context))); // If we're not contiguous, we're done. diff --git a/src/core/hle/kernel/k_page_table_base.h b/src/core/hle/kernel/k_page_table_base.h index 0c222910fc..1d4fa85f04 100644 --- a/src/core/hle/kernel/k_page_table_base.h +++ b/src/core/hle/kernel/k_page_table_base.h @@ -370,10 +370,6 @@ private: size_t num_pages, size_t alignment, size_t offset, size_t guard_pages) const; - bool BeginTraversal(const Common::PageTable& impl, TraversalEntry* out_entry, TraversalContext* out_context, - Common::ProcessAddress address) const; - bool ContinueTraversal(const Common::PageTable& impl, TraversalEntry* out_entry, TraversalContext* context) const; - Result CheckMemoryStateContiguous(size_t* out_blocks_needed, KProcessAddress addr, size_t size, KMemoryState state_mask, KMemoryState state, KMemoryPermission perm_mask, KMemoryPermission perm, @@ -478,14 +474,7 @@ private: // Validate pre-conditions. ASSERT(this->IsLockedByCurrentThread()); - if (virt_addr > (1ULL << m_address_space_width)) { - return false; - } - - *out = m_system.DeviceMemory().GetPhysicalAddr( - this->GetImpl().entries[GetInteger(virt_addr) >> PageBits].Pointer(true) + GetInteger(virt_addr)); - - return true; + return this->GetImpl().GetPhysicalAddress(out, virt_addr); } public: diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 837016de1d..a5e6b8592c 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -101,10 +101,8 @@ struct Memory::Impl { } u64 protect_bytes = 0, protect_begin = 0; - - current_page_table->entries.CommitRegion(vaddr >> YUZU_PAGEBITS, (vaddr + size) >> YUZU_PAGEBITS); for (u64 addr = vaddr; addr < vaddr + size; addr += YUZU_PAGESIZE) { - const Common::PageType page_type = current_page_table->entries.GetUnchecked(addr >> YUZU_PAGEBITS).Type(); + const Common::PageType page_type = current_page_table->entries[addr >> YUZU_PAGEBITS].ptr.Type(); switch (page_type) { case Common::PageType::RasterizerCachedMemory: if (protect_bytes > 0) { @@ -125,14 +123,16 @@ struct Memory::Impl { } [[nodiscard]] u8* GetPointerFromRasterizerCachedMemory(u64 vaddr) const { - if (u64 paddr = current_page_table->entries[vaddr >> YUZU_PAGEBITS].Pointer(true); paddr) - return reinterpret_cast(paddr) + vaddr; + Common::PhysicalAddress const paddr = current_page_table->entries[vaddr >> YUZU_PAGEBITS].addr; + if (paddr) + return system.DeviceMemory().GetPointer(paddr + vaddr); return {}; } [[nodiscard]] u8* GetPointerFromDebugMemory(u64 vaddr) const { - if (u64 paddr = current_page_table->entries[vaddr >> YUZU_PAGEBITS].Pointer(true); paddr) - return reinterpret_cast(paddr) + vaddr; + const Common::PhysicalAddress paddr = current_page_table->entries[vaddr >> YUZU_PAGEBITS].addr; + if (paddr != 0) + return system.DeviceMemory().GetPointer(paddr + vaddr); return {}; } @@ -243,12 +243,10 @@ struct Memory::Impl { std::size_t page_index = addr >> YUZU_PAGEBITS; std::size_t page_offset = addr & YUZU_PAGEMASK; bool user_accessible = true; - - current_page_table->entries.CommitRegion(page_index, page_index + (size >> YUZU_PAGEBITS) + 1); while (remaining_size != 0) { const std::size_t copy_amount = (std::min)(std::size_t(YUZU_PAGESIZE) - page_offset, remaining_size); const auto current_vaddr = u64((page_index << YUZU_PAGEBITS) + page_offset); - const auto [pointer, type, _] = current_page_table->entries.GetUnchecked(page_index).PointerTypeBlock(); + const auto [pointer, type] = current_page_table->entries[page_index].ptr.PointerType(); switch (type) { case Common::PageType::Unmapped: { user_accessible = false; @@ -299,10 +297,10 @@ struct Memory::Impl { } [[nodiscard]] inline const u8* GetSpan(const VAddr addr, const std::size_t size) const noexcept { - return (current_page_table->entries[addr >> YUZU_PAGEBITS].Block() == current_page_table->entries[(addr + size) >> YUZU_PAGEBITS].Block()) ? GetPointerSilent(addr) : nullptr; + return (current_page_table->entries[addr >> YUZU_PAGEBITS].block == current_page_table->entries[(addr + size) >> YUZU_PAGEBITS].block) ? GetPointerSilent(addr) : nullptr; } [[nodiscard]] inline u8* GetSpan(const VAddr addr, const std::size_t size) noexcept { - return (current_page_table->entries[addr >> YUZU_PAGEBITS].Block() == current_page_table->entries[(addr + size) >> YUZU_PAGEBITS].Block()) ? GetPointerSilent(addr) : nullptr; + return (current_page_table->entries[addr >> YUZU_PAGEBITS].block == current_page_table->entries[(addr + size) >> YUZU_PAGEBITS].block) ? GetPointerSilent(addr) : nullptr; } bool WriteBlockImpl(const Common::ProcessAddress addr, const void* buffer, const std::size_t size, bool unsafe) { @@ -406,14 +404,11 @@ struct Memory::Impl { // The region is at a granularity of CPU pages. const u64 num_pages = ((vaddr + size - 1) >> YUZU_PAGEBITS) - (vaddr >> YUZU_PAGEBITS) + 1; - - current_page_table->entries.CommitRegion(vaddr >> YUZU_PAGEBITS, (vaddr >> YUZU_PAGEBITS) + num_pages); for (u64 i = 0; i < num_pages; ++i, vaddr += YUZU_PAGESIZE) { - auto& entry = current_page_table->entries.GetUnchecked(vaddr >> YUZU_PAGEBITS); - const auto [pointer, type, block] = entry.PointerTypeBlock(true); + const Common::PageType page_type = current_page_table->entries[vaddr >> YUZU_PAGEBITS].ptr.Type(); if (debug) { // Switch page type to debug if now debug - switch (type) { + switch (page_type) { case Common::PageType::Unmapped: ASSERT(false && "Attempted to mark unmapped pages as debug"); break; @@ -422,14 +417,14 @@ struct Memory::Impl { // Page is already marked. break; case Common::PageType::Memory: - entry.MarkDebug(pointer, block); + current_page_table->entries[vaddr >> YUZU_PAGEBITS].ptr.Store(0, Common::PageType::DebugMemory); break; default: UNREACHABLE(); } } else { // Switch page type to non-debug if now non-debug - switch (type) { + switch (page_type) { case Common::PageType::Unmapped: ASSERT(false && "Attempted to mark unmapped pages as non-debug"); break; @@ -438,7 +433,8 @@ struct Memory::Impl { // Don't mess with already non-debug or rasterizer memory. break; case Common::PageType::DebugMemory: { - entry.Store(false, Common::PageType::Memory, block, pointer); + u8* const pointer = GetPointerFromDebugMemory(vaddr & ~YUZU_PAGEMASK); + current_page_table->entries[vaddr >> YUZU_PAGEBITS].ptr.Store(uintptr_t(pointer) - (vaddr & ~YUZU_PAGEMASK), Common::PageType::Memory); break; } default: @@ -470,10 +466,8 @@ struct Memory::Impl { // is different). This assumes the specified GPU address region is contiguous as well. const u64 num_pages = ((vaddr + size - 1) >> YUZU_PAGEBITS) - (vaddr >> YUZU_PAGEBITS) + 1; - current_page_table->entries.CommitRegion(vaddr >> YUZU_PAGEBITS, (vaddr >> YUZU_PAGEBITS) + num_pages); for (u64 i = 0; i < num_pages; ++i, vaddr += YUZU_PAGESIZE) { - auto& entry = current_page_table->entries.GetUnchecked(vaddr >> YUZU_PAGEBITS); - const Common::PageType page_type = entry.Type(); + const Common::PageType page_type= current_page_table->entries[vaddr >> YUZU_PAGEBITS].ptr.Type(); if (cached) { // Switch page type to cached if now cached switch (page_type) { @@ -483,7 +477,7 @@ struct Memory::Impl { break; case Common::PageType::DebugMemory: case Common::PageType::Memory: - entry.MarkRasterizerCached(); + current_page_table->entries[vaddr >> YUZU_PAGEBITS].ptr.Store(0, Common::PageType::RasterizerCachedMemory); break; case Common::PageType::RasterizerCachedMemory: // There can be more than one GPU region mapped per CPU region, so it's common @@ -505,13 +499,13 @@ struct Memory::Impl { // that this area is already unmarked as cached. break; case Common::PageType::RasterizerCachedMemory: { - if (auto [ptr, _, block] = entry.PointerTypeBlock(true); ptr == 0) { + if (u8* const pointer = GetPointerFromRasterizerCachedMemory(vaddr & ~YUZU_PAGEMASK); pointer == nullptr) { // It's possible that this function has been called while updating the // pagetable after unmapping a VMA. In that case the underlying VMA will no // longer exist, and we should just leave the pagetable entry blank. - entry.Store(false, Common::PageType::Unmapped, block, 0); + current_page_table->entries[vaddr >> YUZU_PAGEBITS].ptr.Store(0, Common::PageType::Unmapped); } else { - entry.Store(false, Common::PageType::Memory, block, ptr); + current_page_table->entries[vaddr >> YUZU_PAGEBITS].ptr.Store(uintptr_t(pointer) - (vaddr & ~YUZU_PAGEMASK), Common::PageType::Memory); } break; } @@ -545,18 +539,22 @@ struct Memory::Impl { ASSERT_MSG(type != Common::PageType::Memory, "Mapping memory page without a pointer @ {:016x}", base * YUZU_PAGESIZE); - page_table.entries.ZeroRegion(base, end); - } else { - auto current_block = block_count.fetch_add(1, std::memory_order_relaxed); - ASSERT(current_block != 65535); - - page_table.entries.CommitRegion(base, end); while (base != end) { - auto host_ptr = reinterpret_cast(system.DeviceMemory().GetPointer(target)) - (base << YUZU_PAGEBITS);; - auto& entry = page_table.entries.GetUnchecked(base); + page_table.entries[base].ptr.Store(0, type); + page_table.entries[base].addr = 0; + page_table.entries[base].block = 0; + base += 1; + } + } else { + auto orig_base = base; + while (base != end) { + auto host_ptr = uintptr_t(system.DeviceMemory().GetPointer(target)) - (base << YUZU_PAGEBITS); + auto backing = GetInteger(target) - (base << YUZU_PAGEBITS); + page_table.entries[base].ptr.Store(host_ptr, type); + page_table.entries[base].addr = backing; + page_table.entries[base].block = orig_base << YUZU_PAGEBITS; - entry.Store(false, type, current_block, host_ptr); - ASSERT_MSG(page_table.entries[base].Pointer(), + ASSERT_MSG(page_table.entries[base].ptr.Pointer(), "memory mapping base yield a nullptr within the table"); base += 1; @@ -571,11 +569,11 @@ struct Memory::Impl { vaddr &= 0xffffffffffffULL; if (AddressSpaceContains(*current_page_table, vaddr, 1)) [[likely]] { // Avoid adding any extra logic to this fast-path block - const auto raw = current_page_table->entries[vaddr >> YUZU_PAGEBITS].Raw(); - if (auto pointer = Common::PageTable::PageEntryData::ExtractPointer(raw); pointer) [[likely]] { + const uintptr_t raw_pointer = current_page_table->entries[vaddr >> YUZU_PAGEBITS].ptr.Raw(); + if (const uintptr_t pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) [[likely]] { return reinterpret_cast(pointer + vaddr); } else { - switch (static_cast(raw.type)) { + switch (Common::PageTable::PageInfo::ExtractType(raw_pointer)) { case Common::PageType::Memory: ASSERT_MSG(false, "Mapped memory page without a pointer @ {:#016x}", vaddr); return nullptr; @@ -775,7 +773,6 @@ struct Memory::Impl { #else Common::HostMemory* host_buffer{}; #endif - std::atomic block_count = 0; }; Memory::Memory(Core::System& system_) : system{system_} { @@ -814,7 +811,7 @@ bool Memory::IsValidVirtualAddress(const Common::ProcessAddress vaddr) const { if (page >= page_table.entries.size()) { return false; } - const auto [pointer, type, _] = page_table.entries[page].PointerTypeBlock(); + const auto [pointer, type] = page_table.entries[page].ptr.PointerType(); return pointer != 0 || type == Common::PageType::RasterizerCachedMemory || type == Common::PageType::DebugMemory; } diff --git a/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp index 8b6ec2506e..da51220e9c 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/a32_address_space.cpp @@ -371,10 +371,8 @@ EmitConfig A32AddressSpace::GetEmitConfig() { .page_table_pointer = std::bit_cast(conf.page_table), .page_table_address_space_bits = 32, - .page_table_pointer_mask = conf.page_table_pointer_mask, + .page_table_pointer_mask_bits = conf.page_table_pointer_mask_bits, .page_table_log2_stride = conf.page_table_log2_stride, - .page_table_marked_bit = conf.page_table_marked_bit, - .page_table_sign_extension = conf.page_table_sign_extension, .silently_mirror_page_table = true, .absolute_offset_page_table = conf.absolute_offset_page_table, .detect_misaligned_access_via_page_table = conf.detect_misaligned_access_via_page_table, diff --git a/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp index 2dbb7d2e1d..2c71ffe282 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/a64_address_space.cpp @@ -545,10 +545,8 @@ EmitConfig A64AddressSpace::GetEmitConfig() { .page_table_pointer = std::bit_cast(conf.page_table), .page_table_address_space_bits = conf.page_table_address_space_bits, - .page_table_pointer_mask = conf.page_table_pointer_mask, + .page_table_pointer_mask_bits = conf.page_table_pointer_mask_bits, .page_table_log2_stride = conf.page_table_log2_stride, - .page_table_marked_bit = conf.page_table_marked_bit, - .page_table_sign_extension = conf.page_table_sign_extension, .silently_mirror_page_table = conf.silently_mirror_page_table, .absolute_offset_page_table = conf.absolute_offset_page_table, .detect_misaligned_access_via_page_table = conf.detect_misaligned_access_via_page_table, diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.h b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.h index 693f71ea39..f2c89bbfc0 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.h +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.h @@ -128,10 +128,8 @@ struct EmitConfig { // Page table u64 page_table_pointer; std::size_t page_table_address_space_bits; - u64 page_table_pointer_mask; + int page_table_pointer_mask_bits; std::size_t page_table_log2_stride; - std::optional page_table_marked_bit; - std::optional page_table_sign_extension; bool silently_mirror_page_table; bool absolute_offset_page_table; u8 detect_misaligned_access_via_page_table; diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_memory.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_memory.cpp index 170fcf9613..143244d60b 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_memory.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_memory.cpp @@ -273,18 +273,9 @@ std::pair InlinePageTableEmitVAddrLookup(oaknut::Cod // load x0 = *<(u8*)pagetable + index> code.LDR(Xscratch0, Xpagetable, Xscratch0); - if (ctx.conf.page_table_marked_bit) { - code.TST(Xscratch0, 1ULL << *ctx.conf.page_table_marked_bit); - code.B(NE, *fallback); - } - - if (ctx.conf.page_table_pointer_mask != 0) { - code.AND(Xscratch0, Xscratch0, ctx.conf.page_table_pointer_mask); - } - - // TODO: combine this with page_table_pointer_mask - if (ctx.conf.page_table_sign_extension) { - code.SBFM(Xscratch0, Xscratch0, 0, *ctx.conf.page_table_sign_extension); + if (ctx.conf.page_table_pointer_mask_bits != 0) { + const u64 mask = u64(~u64(0)) << ctx.conf.page_table_pointer_mask_bits; + code.AND(Xscratch0, Xscratch0, mask); } code.CBZ(Xscratch0, *fallback); diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h index 54ad638ada..3ac078f1d7 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h @@ -9,7 +9,6 @@ #pragma once #include -#include #include "dynarmic/backend/x64/xbyak.h" #include "dynarmic/backend/x64/a32_emit_x64.h" @@ -79,46 +78,27 @@ Xbyak::RegExp EmitVAddrLookup(BlockOfCode& code, EmitContext& ctx, size_t bitsiz template<> [[maybe_unused]] Xbyak::RegExp EmitVAddrLookup(BlockOfCode& code, A32EmitContext& ctx, size_t bitsize, Xbyak::Label& abort, Xbyak::Reg64 vaddr) { const Xbyak::Reg64 page = ctx.reg_alloc.ScratchGpr(code); - const Xbyak::Reg64 tmp = ctx.conf.absolute_offset_page_table && ctx.conf.page_table_pointer_mask == 0 ? page : ctx.reg_alloc.ScratchGpr(code); + const Xbyak::Reg32 tmp = ctx.conf.absolute_offset_page_table ? page.cvt32() : ctx.reg_alloc.ScratchGpr(code).cvt32(); - EmitDetectMisalignedVAddr(code, ctx, bitsize, abort, vaddr, tmp); + EmitDetectMisalignedVAddr(code, ctx, bitsize, abort, vaddr, tmp.cvt64()); - code.mov(tmp, vaddr); + // TODO: This code assumes vaddr has been zext from 32-bits to 64-bits. + + code.mov(tmp, vaddr.cvt32()); code.shr(tmp, int(page_table_const_bits)); - - if (ctx.conf.page_table_log2_stride > 3) { - code.shl(tmp, int(ctx.conf.page_table_log2_stride)); - code.mov(page, qword[r14 + tmp.cvt64()]); - } else { - code.mov(page, qword[r14 + tmp.cvt64() * int(ctx.conf.page_table_log2_stride)]); - } - - // check for marked bit, use as unmapped if marked - if (ctx.conf.page_table_marked_bit) { - code.bt(page, *ctx.conf.page_table_marked_bit); - code.jc(abort, code.T_NEAR); - } - // mask away attributes - if (ctx.conf.page_table_pointer_mask == 0) { + code.shl(tmp, int(ctx.conf.page_table_log2_stride)); + code.mov(page, qword[r14 + tmp.cvt64()]); + if (ctx.conf.page_table_pointer_mask_bits == 0) { code.test(page, page); - } else if (std::in_range(ctx.conf.page_table_pointer_mask)) { - code.and_(page, ctx.conf.page_table_pointer_mask); } else { - code.mov(tmp, ctx.conf.page_table_pointer_mask); - code.and_(page, tmp); + code.and_(page, ~u32(0) << ctx.conf.page_table_pointer_mask_bits); } - // check for sign bit, apply sign extension as needed - if (ctx.conf.page_table_sign_extension) { - code.shl(page, 63 - int(*ctx.conf.page_table_sign_extension)); - code.sar(page, 63 - int(*ctx.conf.page_table_sign_extension)); - } - code.jz(abort, code.T_NEAR); if (ctx.conf.absolute_offset_page_table) { return page + vaddr; } - code.mov(tmp, vaddr); - code.and_(tmp, u32(page_table_const_mask)); + code.mov(tmp, vaddr.cvt32()); + code.and_(tmp, static_cast(page_table_const_mask)); return page + tmp.cvt64(); } @@ -128,7 +108,7 @@ template<> const size_t unused_top_bits = 64 - ctx.conf.page_table_address_space_bits; const Xbyak::Reg64 page = ctx.reg_alloc.ScratchGpr(code); - const Xbyak::Reg64 tmp = ctx.conf.absolute_offset_page_table && ctx.conf.page_table_pointer_mask == 0 ? page : ctx.reg_alloc.ScratchGpr(code); + const Xbyak::Reg64 tmp = ctx.conf.absolute_offset_page_table ? page : ctx.reg_alloc.ScratchGpr(code); EmitDetectMisalignedVAddr(code, ctx, bitsize, abort, vaddr, tmp); @@ -163,26 +143,11 @@ template<> code.shl(tmp, int(ctx.conf.page_table_log2_stride)); code.mov(page, qword[r14 + tmp]); - - // check for marked bit, use as unmapped if marked - if (ctx.conf.page_table_marked_bit) { - code.bt(page, *ctx.conf.page_table_marked_bit); - code.jc(abort, code.T_NEAR); - } - // mask away attributes - if (ctx.conf.page_table_pointer_mask == 0) { + if (ctx.conf.page_table_pointer_mask_bits == 0) { code.test(page, page); - } else if (std::in_range(ctx.conf.page_table_pointer_mask)) { - code.and_(page, ctx.conf.page_table_pointer_mask); } else { - code.mov(tmp, ctx.conf.page_table_pointer_mask); - code.and_(page, tmp); + code.and_(page, ~u32(0) << ctx.conf.page_table_pointer_mask_bits); } - if (ctx.conf.page_table_sign_extension) { - code.shl(page, *ctx.conf.page_table_sign_extension); - code.sar(page, *ctx.conf.page_table_sign_extension); - } - code.jz(abort, code.T_NEAR); if (ctx.conf.absolute_offset_page_table) { return page + vaddr; diff --git a/src/dynarmic/src/dynarmic/interface/A32/config.h b/src/dynarmic/src/dynarmic/interface/A32/config.h index b93b116164..5a97fb69f3 100644 --- a/src/dynarmic/src/dynarmic/interface/A32/config.h +++ b/src/dynarmic/src/dynarmic/interface/A32/config.h @@ -159,23 +159,14 @@ struct UserConfig { /// Maximum size is limited by the maximum length of a x86_64 / arm64 jump. std::uint32_t code_cache_size = 128 * 1024 * 1024; // bytes - /// Applies a bit mask to the bits in host pointers from the page table. + /// Masks out the first N bits in host pointers from the page table. /// The intention behind this is to allow users of Dynarmic to pack attributes in the /// same integer and update the pointer attribute pair atomically. - /// If the configured value is ~(0b111ULL), all pointers will be forcefully aligned to 8 bytes. - std::uint64_t page_table_pointer_mask = 0; + /// If the configured value is 3, all pointers will be forcefully aligned to 8 bytes. + std::int32_t page_table_pointer_mask_bits = 0; - /// Log2 of the size per page entry, value should be either 3 or 4 - std::uint32_t page_table_log2_stride = 3; - - /// Setting this value has Dynarmic check the specified bit of the page pointer provided by page table. - /// If the bit is set to 1, Dynarmic will treat it as unmapped. - /// This bit should be included as part of `page_table_pointer_mask_bits`. - std::optional page_table_marked_bit = std::nullopt; - - /// If this value is set, Dynarmic will sign extend the page table pointer by this bit. - /// Useful for compacting bits into the page table and should be used as part of `page_table_pointer_mask`. - std::optional page_table_sign_extension = std::nullopt; + // Log2 of the size per page entry, value should be either 3 or 4 + std::size_t page_table_log2_stride = 3; /// Select the architecture version to use. /// There are minor behavioural differences between versions. diff --git a/src/dynarmic/src/dynarmic/interface/A64/config.h b/src/dynarmic/src/dynarmic/interface/A64/config.h index 818aed73e7..83c1593fd8 100644 --- a/src/dynarmic/src/dynarmic/interface/A64/config.h +++ b/src/dynarmic/src/dynarmic/interface/A64/config.h @@ -173,23 +173,14 @@ struct UserConfig { /// This is only used if page_table is not nullptr. std::uint32_t page_table_address_space_bits = 36; - /// Applies a bit mask to the bits in host pointers from the page table. + /// Masks out the first N bits in host pointers from the page table. /// The intention behind this is to allow users of Dynarmic to pack attributes in the /// same integer and update the pointer attribute pair atomically. - /// If the configured value is ~(0b111ULL), all pointers will be forcefully aligned to 8 bytes. - std::uint64_t page_table_pointer_mask = 0; + /// If the configured value is 3, all pointers will be forcefully aligned to 8 bytes. + std::int32_t page_table_pointer_mask_bits = 0; - /// Log2 of the size per page entry, value should be either 3 or 4 - std::uint32_t page_table_log2_stride = 3; - - /// Setting this value has Dynarmic check the specified bit of the page pointer provided by page table. - /// If the bit is set to 1, Dynarmic will treat it as unmapped. - /// This bit should be included as part of `page_table_pointer_mask`. - std::optional page_table_marked_bit = std::nullopt; - - /// If this value is set, Dynarmic will sign extend the page table pointer by this bit. - /// Useful for compacting bits into the page table and should be used as part of `page_table_pointer_mask`. - std::optional page_table_sign_extension = std::nullopt; + // Log2 of the size per page entry, value should be either 3 or 4 + std::size_t page_table_log2_stride = 3; /// Counter-timer frequency register. The value of the register is not interpreted by /// dynarmic. diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index d5838a387d..b9b136f6b8 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -46,8 +46,8 @@ MemoryManager::MemoryManager(Core::System& system_, MaxwellDeviceMemoryManager& page_table_mask = page_table_size - 1; big_page_table_mask = big_page_table_size - 1; - big_page_table_dev.ResizeAndClear(big_page_table_size); big_entries.resize(big_page_table_size / 32, 0); + big_page_table_dev.resize(big_page_table_size); big_page_continuous.resize(big_page_table_size / continuous_bits, 0); entries.resize(page_table_size / 32, 0); } @@ -143,7 +143,7 @@ GPUVAddr MemoryManager::BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] DAddr const DAddr current_dev_addr = dev_addr + offset; const auto index = PageEntryIndex(current_gpu_addr, true); const u32 sub_value = static_cast(current_dev_addr >> cpu_page_bits); - big_page_table_dev.Set(index, sub_value); + big_page_table_dev[index] = sub_value; const bool is_continuous = ([&] { uintptr_t base_ptr{ reinterpret_cast(memory.GetPointer(current_dev_addr))}; diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index 08978567d2..f9fddd177a 100644 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h @@ -17,7 +17,7 @@ #include "common/multi_level_page_table.h" #include "common/range_map.h" #include "common/scratch_buffer.h" -#include "common/sparse_large_vector.h" +#include "common/virtual_buffer.h" #include "video_core/invalidation_accumulator.h" #include "video_core/cache_types.h" #include "video_core/host1x/gpu_device_memory_manager.h" @@ -214,7 +214,7 @@ private: Common::MultiLevelPageTable page_table; Common::RangeMap kind_map; - Common::SparseLargeVector big_page_table_dev; + Common::VirtualBuffer big_page_table_dev; std::vector big_page_continuous; boost::container::small_vector, 32> page_stash{}; From 36b06254b48511e99a907aede600cb069f69bb30 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sun, 20 Sep 2026 15:50:04 -0400 Subject: [PATCH 081/198] Fix licenses --- src/common/page_table.cpp | 2 +- src/core/device_memory.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/page_table.cpp b/src/common/page_table.cpp index d34ba89993..33fff39002 100644 --- a/src/common/page_table.cpp +++ b/src/common/page_table.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project diff --git a/src/core/device_memory.h b/src/core/device_memory.h index 11bf0e3268..7603e94698 100644 --- a/src/core/device_memory.h +++ b/src/core/device_memory.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later From 8d8e67cd7fd657bc461fe00fc4fce25782178f00 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sun, 20 Sep 2026 18:08:27 -0400 Subject: [PATCH 082/198] Just an small experiment to simply interpreter --- src/core/CMakeLists.txt | 3 +- src/core/arm/nce/interpreter_visitor.cpp | 920 ++----- src/core/arm/nce/interpreter_visitor.h | 136 +- src/core/arm/nce/visitor_base.h | 2783 ---------------------- 4 files changed, 323 insertions(+), 3519 deletions(-) delete mode 100644 src/core/arm/nce/visitor_base.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 74391b5e65..9cc2792a8c 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1238,8 +1238,7 @@ if (HAS_NCE) arm/nce/interpreter_visitor.cpp arm/nce/interpreter_visitor.h arm/nce/patcher.cpp - arm/nce/patcher.h - arm/nce/visitor_base.h) + arm/nce/patcher.h) target_link_libraries(core PRIVATE merry::oaknut) endif() diff --git a/src/core/arm/nce/interpreter_visitor.cpp b/src/core/arm/nce/interpreter_visitor.cpp index 2ccc176323..11b759edaf 100644 --- a/src/core/arm/nce/interpreter_visitor.cpp +++ b/src/core/arm/nce/interpreter_visitor.cpp @@ -5,779 +5,387 @@ // SPDX-FileCopyrightText: Copyright 2023 merryhime // SPDX-License-Identifier: GPL-2.0-or-later -#include +#include + #include "core/arm/nce/interpreter_visitor.h" namespace Core { namespace { -// Prefetch tuning parameters -[[maybe_unused]] constexpr size_t CACHE_LINE_SIZE = 64; -[[maybe_unused]] constexpr size_t PREFETCH_STRIDE = 128; // 2 cache lines ahead -[[maybe_unused]] constexpr size_t SIMD_PREFETCH_THRESHOLD = 32; // Bytes + +u64 SignExtend(u64 value, size_t bitsize, size_t regsize) { + const u64 mask = u64{1} << (bitsize - 1); + const u64 extended = ((value & ((u64{1} << bitsize) - 1)) ^ mask) - mask; + if (regsize == 64) { + return extended; + } + return static_cast(extended); +} + +u128 VectorGetElement(u128 value, size_t bitsize) { + if (bitsize >= 128) { + return value; + } + if (bitsize >= 64) { + return {value[0], 0}; + } + return {value[0] & ((u64{1} << bitsize) - 1), 0}; +} + } // namespace -template -u64 SignExtendToLong(u64 value) { - u64 mask = 1ULL << (BitSize - 1); - value &= (1ULL << BitSize) - 1; - return (value ^ mask) - mask; -} - -static u64 SignExtendToLong(u64 value, u64 bitsize) { - switch (bitsize) { - case 8: - return SignExtendToLong<8>(value); - case 16: - return SignExtendToLong<16>(value); - case 32: - return SignExtendToLong<32>(value); - default: - return value; - } -} - -template -u32 SignExtendToWord(u32 value) { - u32 mask = 1ULL << (BitSize - 1); - value &= (1ULL << BitSize) - 1; - return (value ^ mask) - mask; -} - -static u32 SignExtendToWord(u32 value, u64 bitsize) { - switch (bitsize) { - case 8: - return SignExtendToWord<8>(value); - case 16: - return SignExtendToWord<16>(value); - default: - return value; - } -} - -static u64 SignExtend(u64 value, u64 bitsize, u64 regsize) { - if (regsize == 64) { - return SignExtendToLong(value, bitsize); - } else { - return SignExtendToWord(static_cast(value), bitsize); - } -} - -static u128 VectorGetElement(u128 value, u64 bitsize) { - switch (bitsize) { - case 8: - return {value[0] & ((1ULL << 8) - 1), 0}; - case 16: - return {value[0] & ((1ULL << 16) - 1), 0}; - case 32: - return {value[0] & ((1ULL << 32) - 1), 0}; - case 64: - return {value[0], 0}; - default: - return value; - } -} - -u64 InterpreterVisitor::ExtendReg(size_t bitsize, Reg reg, Imm<3> option, u8 shift) { - ASSERT(shift <= 4); - ASSERT(bitsize == 32 || bitsize == 64); +u64 InterpreterVisitor::ExtendReg(Reg reg, Imm<3> option, u8 shift) { + const size_t len = size_t{8} << option.Bits<0, 1, size_t>(); u64 val = this->GetReg(reg); - size_t len; - u64 extended; - bool signed_extend; - - switch (option.ZeroExtend()) { - case 0b000: { // UXTB - val &= ((1ULL << 8) - 1); - len = 8; - signed_extend = false; - break; + if (len < 64) { + val &= (u64{1} << len) - 1; + if (option.Bit<2>()) { + val = SignExtend(val, len, 64); + } } - case 0b001: { // UXTH - val &= ((1ULL << 16) - 1); - len = 16; - signed_extend = false; - break; - } - case 0b010: { // UXTW - val &= ((1ULL << 32) - 1); - len = 32; - signed_extend = false; - break; - } - case 0b011: { // UXTX - len = 64; - signed_extend = false; - break; - } - case 0b100: { // SXTB - val &= ((1ULL << 8) - 1); - len = 8; - signed_extend = true; - break; - } - case 0b101: { // SXTH - val &= ((1ULL << 16) - 1); - len = 16; - signed_extend = true; - break; - } - case 0b110: { // SXTW - val &= ((1ULL << 32) - 1); - len = 32; - signed_extend = true; - break; - } - case 0b111: { // SXTX - len = 64; - signed_extend = true; - break; - } - default: - UNREACHABLE(); - } - - if (len < bitsize && signed_extend) { - extended = SignExtend(val, len, bitsize); - } else { - extended = val; - } - - return extended << shift; + return val << shift; } -u128 InterpreterVisitor::GetVec(Vec v) { - return m_fpsimd_regs[static_cast(v)]; -} - -u64 InterpreterVisitor::GetReg(Reg r) { - return m_regs[static_cast(r)]; -} - -u64 InterpreterVisitor::GetSp() { - return m_sp; -} - -u64 InterpreterVisitor::GetPc() { - return m_pc; -} - -void InterpreterVisitor::SetVec(Vec v, u128 value) { - m_fpsimd_regs[static_cast(v)] = value; -} - -void InterpreterVisitor::SetReg(Reg r, u64 value) { - m_regs[static_cast(r)] = value; -} - -void InterpreterVisitor::SetSp(u64 value) { - m_sp = value; -} - -bool InterpreterVisitor::Ordered(size_t size, bool L, bool o0, Reg Rn, Reg Rt) { - const auto memop = L ? MemOp::Load : MemOp::Store; - const size_t elsize = 8 << size; - const size_t datasize = elsize; - const size_t dbytes = datasize / 8; - - u64 address = (Rn == Reg::SP) ? this->GetSp() : this->GetReg(Rn); - switch (memop) { - case MemOp::Store: { - std::atomic_thread_fence(std::memory_order_seq_cst); - u64 value = this->GetReg(Rt); - m_memory.WriteBlock(address, &value, dbytes); - std::atomic_thread_fence(std::memory_order_seq_cst); - break; - } - case MemOp::Load: { +bool InterpreterVisitor::Ordered(size_t size, bool load, Reg Rn, Reg Rt) { + const size_t dbytes = size_t{1} << size; + const u64 address = this->GetRegSp(Rn); + if (load) { u64 value = 0; m_memory.ReadBlock(address, &value, dbytes); this->SetReg(Rt, value); std::atomic_thread_fence(std::memory_order_seq_cst); - break; - } - default: - UNREACHABLE(); + return true; } + std::atomic_thread_fence(std::memory_order_seq_cst); + u64 value = this->GetReg(Rt); + m_memory.WriteBlock(address, &value, dbytes); + std::atomic_thread_fence(std::memory_order_seq_cst); return true; } -bool InterpreterVisitor::STLLR(Imm<2> sz, Reg Rn, Reg Rt) { - const size_t size = sz.ZeroExtend(); - const bool L = 0; - const bool o0 = 0; - return this->Ordered(size, L, o0, Rn, Rt); -} - -bool InterpreterVisitor::STLR(Imm<2> sz, Reg Rn, Reg Rt) { - const size_t size = sz.ZeroExtend(); - const bool L = 0; - const bool o0 = 1; - return this->Ordered(size, L, o0, Rn, Rt); -} - -bool InterpreterVisitor::LDLAR(Imm<2> sz, Reg Rn, Reg Rt) { - const size_t size = sz.ZeroExtend(); - const bool L = 1; - const bool o0 = 0; - return this->Ordered(size, L, o0, Rn, Rt); -} - -bool InterpreterVisitor::LDAR(Imm<2> sz, Reg Rn, Reg Rt) { - const size_t size = sz.ZeroExtend(); - const bool L = 1; - const bool o0 = 1; - return this->Ordered(size, L, o0, Rn, Rt); -} - -bool InterpreterVisitor::LDR_lit_gen(bool opc_0, Imm<19> imm19, Reg Rt) { - const size_t size = opc_0 == 0 ? 4 : 8; - const s64 offset = Dynarmic::concatenate(imm19, Imm<2>{0}).SignExtend(); - const u64 address = this->GetPc() + offset; - +bool InterpreterVisitor::LoadLiteral(bool wide, Imm<19> imm19, Reg Rt) { + size_t size = 4; + if (wide) { + size = 8; + } u64 data = 0; - m_memory.ReadBlock(address, &data, size); - + m_memory.ReadBlock(m_pc + (imm19.SignExtend() << 2), &data, size); this->SetReg(Rt, data); return true; } -bool InterpreterVisitor::LDR_lit_fpsimd(Imm<2> opc, Imm<19> imm19, Vec Vt) { +bool InterpreterVisitor::LoadLiteralSimd(Imm<2> opc, Imm<19> imm19, Vec Vt) { if (opc == 0b11) { - // Unallocated encoding return false; } - - // Size in bytes - const u64 size = 4 << opc.ZeroExtend(); - const u64 offset = imm19.SignExtend() << 2; - const u64 address = this->GetPc() + offset; - u128 data{}; - m_memory.ReadBlock(address, &data, size); + m_memory.ReadBlock(m_pc + (imm19.SignExtend() << 2), &data, + size_t{4} << opc.ZeroExtend()); this->SetVec(Vt, data); return true; } -bool InterpreterVisitor::STP_LDP_gen(Imm<2> opc, bool not_postindex, bool wback, Imm<1> L, - Imm<7> imm7, Reg Rt2, Reg Rn, Reg Rt) { - if ((L == 0 && opc.Bit<0>() == 1) || opc == 0b11) { - // Unallocated encoding +bool InterpreterVisitor::Pair(Imm<2> opc, bool not_postindex, bool wback, bool load, Imm<7> imm7, + Reg Rt2, Reg Rn, Reg Rt) { + if (!not_postindex && !wback) { + return false; + } + const bool signed_ = opc.Bit<0>(); + if (opc == 0b11 || (!load && signed_)) { + return false; + } + if (load && (Rt == Rt2 || (wback && (Rt == Rn || Rt2 == Rn) && Rn != Reg::R31))) { + return false; + } + if (!load && wback && (Rt == Rn || Rt2 == Rn) && Rn != Reg::R31) { return false; } - const auto memop = L == 1 ? MemOp::Load : MemOp::Store; - if (memop == MemOp::Load && wback && (Rt == Rn || Rt2 == Rn) && Rn != Reg::R31) { - // Unpredictable instruction - return false; - } - if (memop == MemOp::Store && wback && (Rt == Rn || Rt2 == Rn) && Rn != Reg::R31) { - // Unpredictable instruction - return false; - } - if (memop == MemOp::Load && Rt == Rt2) { - // Unpredictable instruction - return false; - } - - u64 address; - if (Rn == Reg::SP) { - address = this->GetSp(); - } else { - address = this->GetReg(Rn); - } - - const bool postindex = !not_postindex; - const bool signed_ = opc.Bit<0>() != 0; const size_t scale = 2 + opc.Bit<1>(); - const size_t datasize = 8 << scale; + const size_t dbytes = size_t{1} << scale; const u64 offset = imm7.SignExtend() << scale; - - if (!postindex) { + u64 address = this->GetRegSp(Rn); + if (not_postindex) { address += offset; } - - const size_t dbytes = datasize / 8; - switch (memop) { - case MemOp::Store: { - u64 data1 = this->GetReg(Rt); - u64 data2 = this->GetReg(Rt2); - m_memory.WriteBlock(address, &data1, dbytes); - m_memory.WriteBlock(address + dbytes, &data2, dbytes); - break; - } - case MemOp::Load: { + if (load) { u64 data1 = 0, data2 = 0; m_memory.ReadBlock(address, &data1, dbytes); m_memory.ReadBlock(address + dbytes, &data2, dbytes); if (signed_) { - this->SetReg(Rt, SignExtend(data1, datasize, 64)); - this->SetReg(Rt2, SignExtend(data2, datasize, 64)); - } else { - this->SetReg(Rt, data1); - this->SetReg(Rt2, data2); + data1 = SignExtend(data1, dbytes * 8, 64); + data2 = SignExtend(data2, dbytes * 8, 64); } - break; + this->SetReg(Rt, data1); + this->SetReg(Rt2, data2); + } else { + u64 data1 = this->GetReg(Rt); + u64 data2 = this->GetReg(Rt2); + m_memory.WriteBlock(address, &data1, dbytes); + m_memory.WriteBlock(address + dbytes, &data2, dbytes); } - default: - UNREACHABLE(); - } - if (wback) { - if (postindex) { + if (!not_postindex) { address += offset; } - - if (Rn == Reg::SP) { - this->SetSp(address); - } else { - this->SetReg(Rn, address); - } + this->SetRegSp(Rn, address); } - return true; } -bool InterpreterVisitor::STP_LDP_fpsimd(Imm<2> opc, bool not_postindex, bool wback, Imm<1> L, - Imm<7> imm7, Vec Vt2, Reg Rn, Vec Vt) { - if (opc == 0b11) { - // Unallocated encoding +bool InterpreterVisitor::PairSimd(Imm<2> opc, bool not_postindex, bool wback, bool load, + Imm<7> imm7, Vec Vt2, Reg Rn, Vec Vt) { + if (!not_postindex && !wback) { + return false; + } + if (opc == 0b11 || (load && Vt == Vt2)) { return false; } - const auto memop = L == 1 ? MemOp::Load : MemOp::Store; - if (memop == MemOp::Load && Vt == Vt2) { - // Unpredictable instruction - return false; - } - - u64 address; - if (Rn == Reg::SP) { - address = this->GetSp(); - } else { - address = this->GetReg(Rn); - } - - const bool postindex = !not_postindex; const size_t scale = 2 + opc.ZeroExtend(); - const size_t datasize = 8 << scale; + const size_t dbytes = size_t{1} << scale; const u64 offset = imm7.SignExtend() << scale; - const size_t dbytes = datasize / 8; - - if (!postindex) { + u64 address = this->GetRegSp(Rn); + if (not_postindex) { address += offset; } - - switch (memop) { - case MemOp::Store: { - u128 data1 = VectorGetElement(this->GetVec(Vt), datasize); - u128 data2 = VectorGetElement(this->GetVec(Vt2), datasize); - m_memory.WriteBlock(address, &data1, dbytes); - m_memory.WriteBlock(address + dbytes, &data2, dbytes); - break; - } - case MemOp::Load: { + if (load) { u128 data1{}, data2{}; m_memory.ReadBlock(address, &data1, dbytes); m_memory.ReadBlock(address + dbytes, &data2, dbytes); this->SetVec(Vt, data1); this->SetVec(Vt2, data2); - break; + } else { + u128 data1 = VectorGetElement(this->GetVec(Vt), dbytes * 8); + u128 data2 = VectorGetElement(this->GetVec(Vt2), dbytes * 8); + m_memory.WriteBlock(address, &data1, dbytes); + m_memory.WriteBlock(address + dbytes, &data2, dbytes); } - default: - UNREACHABLE(); + if (wback) { + if (!not_postindex) { + address += offset; + } + this->SetRegSp(Rn, address); + } + return true; +} + +bool InterpreterVisitor::RegisterImmediate(bool wback, bool postindex, u64 offset, Imm<2> size, + Imm<2> opc, Reg Rn, Reg Rt) { + const bool signed_ = opc.Bit<1>(); + if (signed_ && (size == 0b11 || (size == 0b10 && opc.Bit<0>()))) { + return false; } + const size_t datasize = size_t{8} << size.ZeroExtend(); + size_t regsize = 32; + if (size == 0b11 || (signed_ && !opc.Bit<0>())) { + regsize = 64; + } + u64 address = this->GetRegSp(Rn); + if (!postindex) { + address += offset; + } + if (signed_ || opc.Bit<0>()) { + u64 data = 0; + m_memory.ReadBlock(address, &data, datasize / 8); + if (signed_) { + data = SignExtend(data, datasize, regsize); + } + this->SetReg(Rt, data); + } else { + u64 data = this->GetReg(Rt); + m_memory.WriteBlock(address, &data, datasize / 8); + } if (wback) { if (postindex) { address += offset; } - - if (Rn == Reg::SP) { - this->SetSp(address); - } else { - this->SetReg(Rn, address); - } + this->SetRegSp(Rn, address); } - return true; } -bool InterpreterVisitor::RegisterImmediate(bool wback, bool postindex, size_t scale, u64 offset, - Imm<2> size, Imm<2> opc, Reg Rn, Reg Rt) { - MemOp memop; - bool signed_ = false; - size_t regsize = 0; - const size_t datasize = 8 << scale; - - if (opc.Bit<1>() == 0) { - memop = opc.Bit<0>() ? MemOp::Load : MemOp::Store; - regsize = size == 0b11 ? 64 : 32; - } else if (size == 0b11) { - memop = MemOp::Prefetch; - ASSERT(!opc.Bit<0>()); - } else { - memop = MemOp::Load; - ASSERT(!(size == 0b10 && opc.Bit<0>() == 1)); - regsize = opc.Bit<0>() ? 32 : 64; - signed_ = true; +bool InterpreterVisitor::RegisterOffset(bool S, Imm<2> size, Imm<1> opc_1, Imm<1> opc_0, Reg Rm, + Imm<3> option, Reg Rn, Reg Rt) { + if (!option.Bit<1>()) { + return false; + } + const bool high = opc_1 == 1; + const bool wide = size == 0b11; + if (high && opc_0 == 1 && (wide || size == 0b10)) { + return false; + } + if (high && wide) { + return true; } - u64 address = (Rn == Reg::SP) ? this->GetSp() : this->GetReg(Rn); - if (!postindex) - address += offset; - - switch (memop) { - case MemOp::Store: { - u64 data = this->GetReg(Rt); - m_memory.WriteBlock(address, &data, datasize / 8); - break; + const size_t scale = size.ZeroExtend(); + const size_t datasize = size_t{8} << scale; + size_t regsize = 32; + if (wide || (high && opc_0 == 0)) { + regsize = 64; } - case MemOp::Load: { + u8 shift = 0; + if (S) { + shift = static_cast(scale); + } + const u64 address = this->GetRegSp(Rn) + this->ExtendReg(Rm, option, shift); + if (high || opc_0 == 1) { u64 data = 0; m_memory.ReadBlock(address, &data, datasize / 8); - if (signed_) { - this->SetReg(Rt, SignExtend(data, datasize, regsize)); - } else { - this->SetReg(Rt, data); + if (high) { + data = SignExtend(data, datasize, regsize); } - break; - } - case MemOp::Prefetch: - break; - } - - if (wback) { - if (postindex) - address += offset; - if (Rn == Reg::SP) - this->SetSp(address); - else - this->SetReg(Rn, address); + this->SetReg(Rt, data); + return true; } + u64 data = this->GetReg(Rt); + m_memory.WriteBlock(address, &data, datasize / 8); return true; } -bool InterpreterVisitor::STRx_LDRx_imm_1(Imm<2> size, Imm<2> opc, Imm<9> imm9, bool not_postindex, - Reg Rn, Reg Rt) { - const bool wback = true; - const bool postindex = !not_postindex; - const size_t scale = size.ZeroExtend(); - const u64 offset = imm9.SignExtend(); +bool InterpreterVisitor::SimdImmediate(bool wback, bool postindex, size_t scale, u64 offset, + bool load, Reg Rn, Vec Vt) { + if (scale > 4) { + return false; + } - return this->RegisterImmediate(wback, postindex, scale, offset, size, opc, Rn, Rt); -} - -bool InterpreterVisitor::STRx_LDRx_imm_2(Imm<2> size, Imm<2> opc, Imm<12> imm12, Reg Rn, Reg Rt) { - const bool wback = false; - const bool postindex = false; - const size_t scale = size.ZeroExtend(); - const u64 offset = imm12.ZeroExtend() << scale; - - return this->RegisterImmediate(wback, postindex, scale, offset, size, opc, Rn, Rt); -} - -bool InterpreterVisitor::STURx_LDURx(Imm<2> size, Imm<2> opc, Imm<9> imm9, Reg Rn, Reg Rt) { - const bool wback = false; - const bool postindex = false; - const size_t scale = size.ZeroExtend(); - const u64 offset = imm9.SignExtend(); - - return this->RegisterImmediate(wback, postindex, scale, offset, size, opc, Rn, Rt); -} - -bool InterpreterVisitor::SIMDImmediate(bool wback, bool postindex, size_t scale, u64 offset, - MemOp memop, Reg Rn, Vec Vt) { - const size_t datasize = 8 << scale; - u64 address = (Rn == Reg::SP) ? this->GetSp() : this->GetReg(Rn); - if (!postindex) + const size_t dbytes = size_t{1} << scale; + u64 address = this->GetRegSp(Rn); + if (!postindex) { address += offset; - - switch (memop) { - case MemOp::Store: { - u128 data = VectorGetElement(this->GetVec(Vt), datasize); - m_memory.WriteBlock(address, &data, datasize / 8); - break; } - case MemOp::Load: { + if (load) { u128 data{}; - m_memory.ReadBlock(address, &data, datasize / 8); + m_memory.ReadBlock(address, &data, dbytes); this->SetVec(Vt, data); - break; + } else { + u128 data = VectorGetElement(this->GetVec(Vt), dbytes * 8); + m_memory.WriteBlock(address, &data, dbytes); } - default: - UNREACHABLE(); - } - if (wback) { - if (postindex) + if (postindex) { address += offset; - if (Rn == Reg::SP) - this->SetSp(address); - else - this->SetReg(Rn, address); + } + this->SetRegSp(Rn, address); } return true; } -bool InterpreterVisitor::STR_imm_fpsimd_1(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, - bool not_postindex, Reg Rn, Vec Vt) { - const size_t scale = Dynarmic::concatenate(opc_1, size).ZeroExtend(); - if (scale > 4) { - // Unallocated encoding +bool InterpreterVisitor::SimdOffset(size_t scale, bool S, bool load, Reg Rm, Imm<3> option, Reg Rn, + Vec Vt) { + if (scale > 4 || !option.Bit<1>()) { return false; } - const bool wback = true; - const bool postindex = !not_postindex; - const u64 offset = imm9.SignExtend(); - - return this->SIMDImmediate(wback, postindex, scale, offset, MemOp::Store, Rn, Vt); -} - -bool InterpreterVisitor::STR_imm_fpsimd_2(Imm<2> size, Imm<1> opc_1, Imm<12> imm12, Reg Rn, - Vec Vt) { - const size_t scale = Dynarmic::concatenate(opc_1, size).ZeroExtend(); - if (scale > 4) { - // Unallocated encoding - return false; + const size_t dbytes = size_t{1} << scale; + u8 shift = 0; + if (S) { + shift = static_cast(scale); } - - const bool wback = false; - const bool postindex = false; - const u64 offset = imm12.ZeroExtend() << scale; - - return this->SIMDImmediate(wback, postindex, scale, offset, MemOp::Store, Rn, Vt); -} - -bool InterpreterVisitor::LDR_imm_fpsimd_1(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, - bool not_postindex, Reg Rn, Vec Vt) { - const size_t scale = Dynarmic::concatenate(opc_1, size).ZeroExtend(); - if (scale > 4) { - // Unallocated encoding - return false; - } - - const bool wback = true; - const bool postindex = !not_postindex; - const u64 offset = imm9.SignExtend(); - - return this->SIMDImmediate(wback, postindex, scale, offset, MemOp::Load, Rn, Vt); -} - -bool InterpreterVisitor::LDR_imm_fpsimd_2(Imm<2> size, Imm<1> opc_1, Imm<12> imm12, Reg Rn, - Vec Vt) { - const size_t scale = Dynarmic::concatenate(opc_1, size).ZeroExtend(); - if (scale > 4) { - // Unallocated encoding - return false; - } - - const bool wback = false; - const bool postindex = false; - const u64 offset = imm12.ZeroExtend() << scale; - - return this->SIMDImmediate(wback, postindex, scale, offset, MemOp::Load, Rn, Vt); -} - -bool InterpreterVisitor::STUR_fpsimd(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, Reg Rn, Vec Vt) { - const size_t scale = Dynarmic::concatenate(opc_1, size).ZeroExtend(); - if (scale > 4) { - // Unallocated encoding - return false; - } - - const bool wback = false; - const bool postindex = false; - const u64 offset = imm9.SignExtend(); - - return this->SIMDImmediate(wback, postindex, scale, offset, MemOp::Store, Rn, Vt); -} - -bool InterpreterVisitor::LDUR_fpsimd(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, Reg Rn, Vec Vt) { - const size_t scale = Dynarmic::concatenate(opc_1, size).ZeroExtend(); - if (scale > 4) { - // Unallocated encoding - return false; - } - - const bool wback = false; - const bool postindex = false; - const u64 offset = imm9.SignExtend(); - - return this->SIMDImmediate(wback, postindex, scale, offset, MemOp::Load, Rn, Vt); -} - -bool InterpreterVisitor::RegisterOffset(size_t scale, u8 shift, Imm<2> size, Imm<1> opc_1, - Imm<1> opc_0, Reg Rm, Imm<3> option, Reg Rn, Reg Rt) { - MemOp memop; - size_t regsize = 64; - bool signed_ = false; - - if (opc_1 == 0) { - memop = opc_0 == 1 ? MemOp::Load : MemOp::Store; - regsize = size == 0b11 ? 64 : 32; - signed_ = false; - } else if (size == 0b11) { - memop = MemOp::Prefetch; - if (opc_0 == 1) { - // Unallocated encoding - return false; - } - } else { - memop = MemOp::Load; - if (size == 0b10 && opc_0 == 1) { - // Unallocated encoding - return false; - } - regsize = opc_0 == 1 ? 32 : 64; - signed_ = true; - } - - const size_t datasize = 8 << scale; - - // Operation - const u64 offset = this->ExtendReg(64, Rm, option, shift); - - u64 address; - if (Rn == Reg::SP) { - address = this->GetSp(); - } else { - address = this->GetReg(Rn); - } - address += offset; - - switch (memop) { - case MemOp::Store: { - u64 data = this->GetReg(Rt); - m_memory.WriteBlock(address, &data, datasize / 8); - break; - } - case MemOp::Load: { - u64 data = 0; - m_memory.ReadBlock(address, &data, datasize / 8); - if (signed_) { - this->SetReg(Rt, SignExtend(data, datasize, regsize)); - } else { - this->SetReg(Rt, data); - } - break; - } - case MemOp::Prefetch: - break; - } - - return true; -} - -bool InterpreterVisitor::STRx_reg(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Reg Rt) { - const Imm<1> opc_0{0}; - const size_t scale = size.ZeroExtend(); - const u8 shift = S ? static_cast(scale) : 0; - if (!option.Bit<1>()) { - // Unallocated encoding - return false; - } - return this->RegisterOffset(scale, shift, size, opc_1, opc_0, Rm, option, Rn, Rt); -} - -bool InterpreterVisitor::LDRx_reg(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Reg Rt) { - const Imm<1> opc_0{1}; - const size_t scale = size.ZeroExtend(); - const u8 shift = S ? static_cast(scale) : 0; - if (!option.Bit<1>()) { - // Unallocated encoding - return false; - } - return this->RegisterOffset(scale, shift, size, opc_1, opc_0, Rm, option, Rn, Rt); -} - -bool InterpreterVisitor::SIMDOffset(size_t scale, u8 shift, Imm<1> opc_0, Reg Rm, Imm<3> option, - Reg Rn, Vec Vt) { - const auto memop = opc_0 == 1 ? MemOp::Load : MemOp::Store; - const size_t datasize = 8 << scale; - - // Operation - const u64 offset = this->ExtendReg(64, Rm, option, shift); - - u64 address; - if (Rn == Reg::SP) { - address = this->GetSp(); - } else { - address = this->GetReg(Rn); - } - address += offset; - - switch (memop) { - case MemOp::Store: { - u128 data = VectorGetElement(this->GetVec(Vt), datasize); - m_memory.WriteBlock(address, &data, datasize / 8); - break; - } - case MemOp::Load: { + const u64 address = this->GetRegSp(Rn) + this->ExtendReg(Rm, option, shift); + if (load) { u128 data{}; - m_memory.ReadBlock(address, &data, datasize / 8); + m_memory.ReadBlock(address, &data, dbytes); this->SetVec(Vt, data); - break; + return true; } - default: - UNREACHABLE(); - } - + u128 data = VectorGetElement(this->GetVec(Vt), dbytes * 8); + m_memory.WriteBlock(address, &data, dbytes); return true; } -bool InterpreterVisitor::STR_reg_fpsimd(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, - Reg Rn, Vec Vt) { - const Imm<1> opc_0{0}; - const size_t scale = Dynarmic::concatenate(opc_1, size).ZeroExtend(); - if (scale > 4) { - // Unallocated encoding - return false; +bool InterpreterVisitor::Execute(u32 inst) { + const Imm<2> size{inst >> 30}; + const Imm<2> opc{(inst >> 22) & 3}; + const Imm<3> option{(inst >> 13) & 7}; + const Imm<19> imm19{(inst >> 5) & 0x7FFFF}; + const Reg Rn = static_cast((inst >> 5) & 31); + const Reg Rt = static_cast(inst & 31); + const Vec Vt = static_cast(inst & 31); + const bool load = (inst & (1U << 22)) != 0; + const bool not_postindex = (inst & (1U << 11)) != 0; + const bool scaled = (inst & (1U << 12)) != 0; + const size_t vscale = ((inst >> 21) & 4) | (inst >> 30); + const u64 imm9 = Imm<9>{(inst >> 12) & 0x1FF}.SignExtend(); + + switch ((inst >> 24) & 0x3F) { + case 0b001000: + if ((inst & 0x00BF7C00) != 0x009F7C00) { + return false; + } + return this->Ordered(size.ZeroExtend(), load, Rn, Rt); + case 0b011000: + if ((inst & 0x80000000) != 0) { + return false; + } + return this->LoadLiteral((inst & 0x40000000) != 0, imm19, Rt); + case 0b011100: + return this->LoadLiteralSimd(size, imm19, Vt); + case 0b101000: + case 0b101001: + return this->Pair(size, (inst & (1U << 24)) != 0, (inst & (1U << 23)) != 0, load, + Imm<7>{(inst >> 15) & 0x7F}, static_cast((inst >> 10) & 31), Rn, Rt); + case 0b101100: + case 0b101101: + return this->PairSimd(size, (inst & (1U << 24)) != 0, (inst & (1U << 23)) != 0, load, + Imm<7>{(inst >> 15) & 0x7F}, static_cast((inst >> 10) & 31), Rn, + Vt); + case 0b111000: + if ((inst & (1U << 21)) != 0) { + if ((inst & 0x00000C00) != 0x00000800) { + return false; + } + return this->RegisterOffset(scaled, size, Imm<1>{(inst >> 23) & 1}, + Imm<1>{(inst >> 22) & 1}, + static_cast((inst >> 16) & 31), option, Rn, Rt); + } + if ((inst & (1U << 10)) != 0) { + return this->RegisterImmediate(true, !not_postindex, imm9, size, opc, Rn, Rt); + } + if (not_postindex) { + return false; + } + return this->RegisterImmediate(false, false, imm9, size, opc, Rn, Rt); + case 0b111001: + return this->RegisterImmediate(false, false, + u64{(inst >> 10) & 0xFFF} << size.ZeroExtend(), size, + opc, Rn, Rt); + case 0b111100: + if ((inst & (1U << 21)) != 0) { + if ((inst & 0x00000C00) != 0x00000800) { + return false; + } + return this->SimdOffset(vscale, scaled, load, static_cast((inst >> 16) & 31), + option, Rn, Vt); + } + if ((inst & (1U << 10)) != 0) { + return this->SimdImmediate(true, !not_postindex, vscale, imm9, load, Rn, Vt); + } + if (not_postindex) { + return false; + } + return this->SimdImmediate(false, false, vscale, imm9, load, Rn, Vt); + case 0b111101: + return this->SimdImmediate(false, false, vscale, u64{(inst >> 10) & 0xFFF} << vscale, load, + Rn, Vt); } - const u8 shift = S ? static_cast(scale) : 0; - if (!option.Bit<1>()) { - // Unallocated encoding - return false; - } - return this->SIMDOffset(scale, shift, opc_0, Rm, option, Rn, Vt); + return false; } -bool InterpreterVisitor::LDR_reg_fpsimd(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, - Reg Rn, Vec Vt) { - const Imm<1> opc_0{1}; - const size_t scale = Dynarmic::concatenate(opc_1, size).ZeroExtend(); - if (scale > 4) { - // Unallocated encoding - return false; - } - const u8 shift = S ? static_cast(scale) : 0; - if (!option.Bit<1>()) { - // Unallocated encoding - return false; - } - return this->SIMDOffset(scale, shift, opc_0, Rm, option, Rn, Vt); -} - -std::optional MatchAndExecuteOneInstruction(Core::Memory::Memory& memory, mcontext_t* context, fpsimd_context* fpsimd_context) { +std::optional MatchAndExecuteOneInstruction(Core::Memory::Memory& memory, mcontext_t* context, + fpsimd_context* fpsimd_context) { std::span regs(reinterpret_cast(context->regs), 31); std::span vregs(reinterpret_cast(fpsimd_context->vregs), 32); u64& sp = *reinterpret_cast(&context->sp); const u64& pc = *reinterpret_cast(&context->pc); InterpreterVisitor visitor(memory, regs, vregs, sp, pc); - u32 instruction = memory.Read32(pc); - bool was_executed = false; - - auto decoder = Dynarmic::A64::Decode(visitor, instruction); - if (decoder) { - was_executed = *decoder; - } else { - was_executed = false; + if (!visitor.Execute(memory.Read32(pc))) { + return std::nullopt; } - return was_executed ? std::optional(pc + 4) : std::nullopt; + return pc + 4; } } // namespace Core diff --git a/src/core/arm/nce/interpreter_visitor.h b/src/core/arm/nce/interpreter_visitor.h index 131b69cd7d..667ea24ac8 100644 --- a/src/core/arm/nce/interpreter_visitor.h +++ b/src/core/arm/nce/interpreter_visitor.h @@ -7,97 +7,77 @@ #pragma once -#include -#include -#include +#include #include +#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#include +#include +#pragma GCC diagnostic pop -#include "core/hle/kernel/k_thread.h" #include "core/memory.h" -#include "common/logging.h" -#include "core/arm/nce/visitor_base.h" namespace Core { -namespace Memory { -class Memory; -} - -class InterpreterVisitor final : public VisitorBase { +class InterpreterVisitor { public: explicit InterpreterVisitor(Core::Memory::Memory& memory, std::span regs, std::span fpsimd_regs, u64& sp, const u64& pc) : m_memory(memory), m_regs(regs), m_fpsimd_regs(fpsimd_regs), m_sp(sp), m_pc(pc) {} - ~InterpreterVisitor() override = default; - enum class MemOp { - Load, - Store, - Prefetch, - }; - - u128 GetVec(Vec v); - u64 GetReg(Reg r); - u64 GetSp(); - u64 GetPc(); - - void SetVec(Vec v, u128 value); - void SetReg(Reg r, u64 value); - void SetSp(u64 value); - - u64 ExtendReg(size_t bitsize, Reg reg, Imm<3> option, u8 shift); - - // Loads and stores - Load/Store Exclusive - bool Ordered(size_t size, bool L, bool o0, Reg Rn, Reg Rt); - bool STLLR(Imm<2> size, Reg Rn, Reg Rt) override; - bool STLR(Imm<2> size, Reg Rn, Reg Rt) override; - bool LDLAR(Imm<2> size, Reg Rn, Reg Rt) override; - bool LDAR(Imm<2> size, Reg Rn, Reg Rt) override; - - // Loads and stores - Load register (literal) - bool LDR_lit_gen(bool opc_0, Imm<19> imm19, Reg Rt) override; - bool LDR_lit_fpsimd(Imm<2> opc, Imm<19> imm19, Vec Vt) override; - - // Loads and stores - Load/Store register pair - bool STP_LDP_gen(Imm<2> opc, bool not_postindex, bool wback, Imm<1> L, Imm<7> imm7, Reg Rt2, - Reg Rn, Reg Rt) override; - bool STP_LDP_fpsimd(Imm<2> opc, bool not_postindex, bool wback, Imm<1> L, Imm<7> imm7, Vec Vt2, - Reg Rn, Vec Vt) override; - - // Loads and stores - Load/Store register (immediate) - bool RegisterImmediate(bool wback, bool postindex, size_t scale, u64 offset, Imm<2> size, - Imm<2> opc, Reg Rn, Reg Rt); - bool STRx_LDRx_imm_1(Imm<2> size, Imm<2> opc, Imm<9> imm9, bool not_postindex, Reg Rn, - Reg Rt) override; - bool STRx_LDRx_imm_2(Imm<2> size, Imm<2> opc, Imm<12> imm12, Reg Rn, Reg Rt) override; - bool STURx_LDURx(Imm<2> size, Imm<2> opc, Imm<9> imm9, Reg Rn, Reg Rt) override; - - bool SIMDImmediate(bool wback, bool postindex, size_t scale, u64 offset, MemOp memop, Reg Rn, - Vec Vt); - bool STR_imm_fpsimd_1(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, bool not_postindex, Reg Rn, - Vec Vt) override; - bool STR_imm_fpsimd_2(Imm<2> size, Imm<1> opc_1, Imm<12> imm12, Reg Rn, Vec Vt) override; - bool LDR_imm_fpsimd_1(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, bool not_postindex, Reg Rn, - Vec Vt) override; - bool LDR_imm_fpsimd_2(Imm<2> size, Imm<1> opc_1, Imm<12> imm12, Reg Rn, Vec Vt) override; - bool STUR_fpsimd(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, Reg Rn, Vec Vt) override; - bool LDUR_fpsimd(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, Reg Rn, Vec Vt) override; - - // Loads and stores - Load/Store register (register offset) - bool RegisterOffset(size_t scale, u8 shift, Imm<2> size, Imm<1> opc_1, Imm<1> opc_0, Reg Rm, - Imm<3> option, Reg Rn, Reg Rt); - bool STRx_reg(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Reg Rt) override; - bool LDRx_reg(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Reg Rt) override; - - bool SIMDOffset(size_t scale, u8 shift, Imm<1> opc_0, Reg Rm, Imm<3> option, Reg Rn, Vec Vt); - bool STR_reg_fpsimd(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Vec Vt) override; - bool LDR_reg_fpsimd(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Vec Vt) override; + bool Execute(u32 inst); private: + template + using Imm = Dynarmic::Imm; + using Reg = Dynarmic::A64::Reg; + using Vec = Dynarmic::A64::Vec; + + u128 GetVec(Vec v) const { + return m_fpsimd_regs[static_cast(v)]; + } + void SetVec(Vec v, u128 value) { + m_fpsimd_regs[static_cast(v)] = value; + } + u64 GetReg(Reg r) const { + return m_regs[static_cast(r)]; + } + void SetReg(Reg r, u64 value) { + m_regs[static_cast(r)] = value; + } + u64 GetRegSp(Reg r) const { + if (r == Reg::SP) { + return m_sp; + } + return m_regs[static_cast(r)]; + } + void SetRegSp(Reg r, u64 value) { + if (r == Reg::SP) { + m_sp = value; + return; + } + m_regs[static_cast(r)] = value; + } + + u64 ExtendReg(Reg reg, Imm<3> option, u8 shift); + + bool Ordered(size_t size, bool load, Reg Rn, Reg Rt); + bool LoadLiteral(bool wide, Imm<19> imm19, Reg Rt); + bool LoadLiteralSimd(Imm<2> opc, Imm<19> imm19, Vec Vt); + bool Pair(Imm<2> opc, bool not_postindex, bool wback, bool load, Imm<7> imm7, Reg Rt2, Reg Rn, + Reg Rt); + bool PairSimd(Imm<2> opc, bool not_postindex, bool wback, bool load, Imm<7> imm7, Vec Vt2, + Reg Rn, Vec Vt); + bool RegisterImmediate(bool wback, bool postindex, u64 offset, Imm<2> size, Imm<2> opc, Reg Rn, + Reg Rt); + bool RegisterOffset(bool S, Imm<2> size, Imm<1> opc_1, Imm<1> opc_0, Reg Rm, Imm<3> option, + Reg Rn, Reg Rt); + bool SimdImmediate(bool wback, bool postindex, size_t scale, u64 offset, bool load, Reg Rn, + Vec Vt); + bool SimdOffset(size_t scale, bool S, bool load, Reg Rm, Imm<3> option, Reg Rn, Vec Vt); + Core::Memory::Memory& m_memory; std::span m_regs; std::span m_fpsimd_regs; diff --git a/src/core/arm/nce/visitor_base.h b/src/core/arm/nce/visitor_base.h deleted file mode 100644 index 6a2be3d9bc..0000000000 --- a/src/core/arm/nce/visitor_base.h +++ /dev/null @@ -1,2783 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project -// SPDX-FileCopyrightText: Copyright 2023 merryhime -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wshadow" - -#include -#include -#include - -#pragma GCC diagnostic pop - -namespace Core { - -class VisitorBase { -public: - using instruction_return_type = bool; - - template - using Imm = Dynarmic::Imm; - using Reg = Dynarmic::A64::Reg; - using Vec = Dynarmic::A64::Vec; - using Cond = Dynarmic::A64::Cond; - - virtual ~VisitorBase() {} - - virtual bool UnallocatedEncoding() { - return false; - } - - // Data processing - Immediate - PC relative addressing - virtual bool ADR(Imm<2> immlo, Imm<19> immhi, Reg Rd) { - return false; - } - virtual bool ADRP(Imm<2> immlo, Imm<19> immhi, Reg Rd) { - return false; - } - - // Data processing - Immediate - Add/Sub (with tag) - virtual bool ADDG(Imm<6> offset_imm, Imm<4> tag_offset, Reg Rn, Reg Rd) { - return false; - } - virtual bool SUBG(Imm<6> offset_imm, Imm<4> tag_offset, Reg Rn, Reg Rd) { - return false; - } - - // Data processing - Immediate - Add/Sub - virtual bool ADD_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd) { - return false; - } - virtual bool ADDS_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd) { - return false; - } - virtual bool SUB_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd) { - return false; - } - virtual bool SUBS_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd) { - return false; - } - - // Data processing - Immediate - Logical - virtual bool AND_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd) { - return false; - } - virtual bool ORR_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd) { - return false; - } - virtual bool EOR_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd) { - return false; - } - virtual bool ANDS_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd) { - return false; - } - - // Data processing - Immediate - Move Wide - virtual bool MOVN(bool sf, Imm<2> hw, Imm<16> imm16, Reg Rd) { - return false; - } - virtual bool MOVZ(bool sf, Imm<2> hw, Imm<16> imm16, Reg Rd) { - return false; - } - virtual bool MOVK(bool sf, Imm<2> hw, Imm<16> imm16, Reg Rd) { - return false; - } - - // Data processing - Immediate - Bitfield - virtual bool SBFM(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd) { - return false; - } - virtual bool BFM(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd) { - return false; - } - virtual bool UBFM(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd) { - return false; - } - virtual bool ASR_1(Imm<5> immr, Reg Rn, Reg Rd) { - return false; - } - virtual bool ASR_2(Imm<6> immr, Reg Rn, Reg Rd) { - return false; - } - virtual bool SXTB_1(Reg Rn, Reg Rd) { - return false; - } - virtual bool SXTB_2(Reg Rn, Reg Rd) { - return false; - } - virtual bool SXTH_1(Reg Rn, Reg Rd) { - return false; - } - virtual bool SXTH_2(Reg Rn, Reg Rd) { - return false; - } - virtual bool SXTW(Reg Rn, Reg Rd) { - return false; - } - - // Data processing - Immediate - Extract - virtual bool EXTR(bool sf, bool N, Reg Rm, Imm<6> imms, Reg Rn, Reg Rd) { - return false; - } - - // Conditional branch - virtual bool B_cond(Imm<19> imm19, Cond cond) { - return false; - } - - // Exception generation - virtual bool SVC(Imm<16> imm16) { - return false; - } - virtual bool HVC(Imm<16> imm16) { - return false; - } - virtual bool SMC(Imm<16> imm16) { - return false; - } - virtual bool BRK(Imm<16> imm16) { - return false; - } - virtual bool HLT(Imm<16> imm16) { - return false; - } - virtual bool DCPS1(Imm<16> imm16) { - return false; - } - virtual bool DCPS2(Imm<16> imm16) { - return false; - } - virtual bool DCPS3(Imm<16> imm16) { - return false; - } - - // System - virtual bool MSR_imm(Imm<3> op1, Imm<4> CRm, Imm<3> op2) { - return false; - } - virtual bool HINT(Imm<4> CRm, Imm<3> op2) { - return false; - } - virtual bool NOP() { - return false; - } - virtual bool YIELD() { - return false; - } - virtual bool WFE() { - return false; - } - virtual bool WFI() { - return false; - } - virtual bool SEV() { - return false; - } - virtual bool SEVL() { - return false; - } - virtual bool XPAC_1(bool D, Reg Rd) { - return false; - } - virtual bool XPAC_2() { - return false; - } - virtual bool PACIA_1(bool Z, Reg Rn, Reg Rd) { - return false; - } - virtual bool PACIA_2() { - return false; - } - virtual bool PACIB_1(bool Z, Reg Rn, Reg Rd) { - return false; - } - virtual bool PACIB_2() { - return false; - } - virtual bool AUTIA_1(bool Z, Reg Rn, Reg Rd) { - return false; - } - virtual bool AUTIA_2() { - return false; - } - virtual bool AUTIB_1(bool Z, Reg Rn, Reg Rd) { - return false; - } - virtual bool AUTIB_2() { - return false; - } - virtual bool BTI(Imm<2> upper_op2) { - return false; - } - virtual bool ESB() { - return false; - } - virtual bool PSB() { - return false; - } - virtual bool TSB() { - return false; - } - virtual bool CSDB() { - return false; - } - virtual bool CLREX(Imm<4> CRm) { - return false; - } - virtual bool DSB(Imm<4> CRm) { - return false; - } - virtual bool SSBB() { - return false; - } - virtual bool PSSBB() { - return false; - } - virtual bool DMB(Imm<4> CRm) { - return false; - } - virtual bool ISB(Imm<4> CRm) { - return false; - } - virtual bool SYS(Imm<3> op1, Imm<4> CRn, Imm<4> CRm, Imm<3> op2, Reg Rt) { - return false; - } - virtual bool SB() { - return false; - } - virtual bool MSR_reg(Imm<1> o0, Imm<3> op1, Imm<4> CRn, Imm<4> CRm, Imm<3> op2, Reg Rt) { - return false; - } - virtual bool SYSL(Imm<3> op1, Imm<4> CRn, Imm<4> CRm, Imm<3> op2, Reg Rt) { - return false; - } - virtual bool MRS(Imm<1> o0, Imm<3> op1, Imm<4> CRn, Imm<4> CRm, Imm<3> op2, Reg Rt) { - return false; - } - - // System - Flag manipulation instructions - virtual bool CFINV() { - return false; - } - virtual bool RMIF(Imm<6> lsb, Reg Rn, Imm<4> mask) { - return false; - } - virtual bool SETF8(Reg Rn) { - return false; - } - virtual bool SETF16(Reg Rn) { - return false; - } - - // System - Flag format instructions - virtual bool XAFlag() { - return false; - } - virtual bool AXFlag() { - return false; - } - - // SYS: Data Cache - virtual bool DC_IVAC(Reg Rt) { - return false; - } - virtual bool DC_ISW(Reg Rt) { - return false; - } - virtual bool DC_CSW(Reg Rt) { - return false; - } - virtual bool DC_CISW(Reg Rt) { - return false; - } - virtual bool DC_ZVA(Reg Rt) { - return false; - } - virtual bool DC_CVAC(Reg Rt) { - return false; - } - virtual bool DC_CVAU(Reg Rt) { - return false; - } - virtual bool DC_CVAP(Reg Rt) { - return false; - } - virtual bool DC_CIVAC(Reg Rt) { - return false; - } - - // SYS: Instruction Cache - virtual bool IC_IALLU() { - return false; - } - virtual bool IC_IALLUIS() { - return false; - } - virtual bool IC_IVAU(Reg Rt) { - return false; - } - - // Unconditional branch (Register) - virtual bool BR(Reg Rn) { - return false; - } - virtual bool BRA(bool Z, bool M, Reg Rn, Reg Rm) { - return false; - } - virtual bool BLR(Reg Rn) { - return false; - } - virtual bool BLRA(bool Z, bool M, Reg Rn, Reg Rm) { - return false; - } - virtual bool RET(Reg Rn) { - return false; - } - virtual bool RETA(bool M) { - return false; - } - virtual bool ERET() { - return false; - } - virtual bool ERETA(bool M) { - return false; - } - virtual bool DRPS() { - return false; - } - - // Unconditional branch (immediate) - virtual bool B_uncond(Imm<26> imm26) { - return false; - } - virtual bool BL(Imm<26> imm26) { - return false; - } - - // Compare and branch (immediate) - virtual bool CBZ(bool sf, Imm<19> imm19, Reg Rt) { - return false; - } - virtual bool CBNZ(bool sf, Imm<19> imm19, Reg Rt) { - return false; - } - virtual bool TBZ(Imm<1> b5, Imm<5> b40, Imm<14> imm14, Reg Rt) { - return false; - } - virtual bool TBNZ(Imm<1> b5, Imm<5> b40, Imm<14> imm14, Reg Rt) { - return false; - } - - // Loads and stores - Advanced SIMD Load/Store multiple structures - virtual bool STx_mult_1(bool Q, Imm<4> opcode, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool STx_mult_2(bool Q, Reg Rm, Imm<4> opcode, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LDx_mult_1(bool Q, Imm<4> opcode, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LDx_mult_2(bool Q, Reg Rm, Imm<4> opcode, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - - // Loads and stores - Advanced SIMD Load/Store single structures - virtual bool ST1_sngl_1(bool Q, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool ST1_sngl_2(bool Q, Reg Rm, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, - Vec Vt) { - return false; - } - virtual bool ST3_sngl_1(bool Q, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool ST3_sngl_2(bool Q, Reg Rm, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, - Vec Vt) { - return false; - } - virtual bool ST2_sngl_1(bool Q, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool ST2_sngl_2(bool Q, Reg Rm, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, - Vec Vt) { - return false; - } - virtual bool ST4_sngl_1(bool Q, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool ST4_sngl_2(bool Q, Reg Rm, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, - Vec Vt) { - return false; - } - virtual bool LD1_sngl_1(bool Q, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD1_sngl_2(bool Q, Reg Rm, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, - Vec Vt) { - return false; - } - virtual bool LD3_sngl_1(bool Q, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD3_sngl_2(bool Q, Reg Rm, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, - Vec Vt) { - return false; - } - virtual bool LD1R_1(bool Q, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD1R_2(bool Q, Reg Rm, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD3R_1(bool Q, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD3R_2(bool Q, Reg Rm, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD2_sngl_1(bool Q, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD2_sngl_2(bool Q, Reg Rm, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, - Vec Vt) { - return false; - } - virtual bool LD4_sngl_1(bool Q, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD4_sngl_2(bool Q, Reg Rm, Imm<2> upper_opcode, bool S, Imm<2> size, Reg Rn, - Vec Vt) { - return false; - } - virtual bool LD2R_1(bool Q, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD2R_2(bool Q, Reg Rm, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD4R_1(bool Q, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - virtual bool LD4R_2(bool Q, Reg Rm, Imm<2> size, Reg Rn, Vec Vt) { - return false; - } - - // Loads and stores - Load/Store Exclusive - virtual bool STXR(Imm<2> size, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool STLXR(Imm<2> size, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool STXP(Imm<1> size, Reg Rs, Reg Rt2, Reg Rn, Reg Rt) { - return false; - } - virtual bool STLXP(Imm<1> size, Reg Rs, Reg Rt2, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDXR(Imm<2> size, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDAXR(Imm<2> size, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDXP(Imm<1> size, Reg Rt2, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDAXP(Imm<1> size, Reg Rt2, Reg Rn, Reg Rt) { - return false; - } - virtual bool STLLR(Imm<2> size, Reg Rn, Reg Rt) { - return false; - } - virtual bool STLR(Imm<2> size, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDLAR(Imm<2> size, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDAR(Imm<2> size, Reg Rn, Reg Rt) { - return false; - } - virtual bool CASP(bool sz, bool L, Reg Rs, bool o0, Reg Rn, Reg Rt) { - return false; - } - virtual bool CASB(bool L, Reg Rs, bool o0, Reg Rn, Reg Rt) { - return false; - } - virtual bool CASH(bool L, Reg Rs, bool o0, Reg Rn, Reg Rt) { - return false; - } - virtual bool CAS(bool sz, bool L, Reg Rs, bool o0, Reg Rn, Reg Rt) { - return false; - } - - // Loads and stores - Load register (literal) - virtual bool LDR_lit_gen(bool opc_0, Imm<19> imm19, Reg Rt) { - return false; - } - virtual bool LDR_lit_fpsimd(Imm<2> opc, Imm<19> imm19, Vec Vt) { - return false; - } - virtual bool LDRSW_lit(Imm<19> imm19, Reg Rt) { - return false; - } - virtual bool PRFM_lit(Imm<19> imm19, Imm<5> prfop) { - return false; - } - - // Loads and stores - Load/Store no-allocate pair - virtual bool STNP_LDNP_gen(Imm<1> upper_opc, Imm<1> L, Imm<7> imm7, Reg Rt2, Reg Rn, Reg Rt) { - return false; - } - virtual bool STNP_LDNP_fpsimd(Imm<2> opc, Imm<1> L, Imm<7> imm7, Vec Vt2, Reg Rn, Vec Vt) { - return false; - } - - // Loads and stores - Load/Store register pair - virtual bool STP_LDP_gen(Imm<2> opc, bool not_postindex, bool wback, Imm<1> L, Imm<7> imm7, - Reg Rt2, Reg Rn, Reg Rt) { - return false; - } - virtual bool STP_LDP_fpsimd(Imm<2> opc, bool not_postindex, bool wback, Imm<1> L, Imm<7> imm7, - Vec Vt2, Reg Rn, Vec Vt) { - return false; - } - virtual bool STGP_1(Imm<7> offset_imm, Reg Rt2, Reg Rn, Reg Rt) { - return false; - } - virtual bool STGP_2(Imm<7> offset_imm, Reg Rt2, Reg Rn, Reg Rt) { - return false; - } - virtual bool STGP_3(Imm<7> offset_imm, Reg Rt2, Reg Rn, Reg Rt) { - return false; - } - - // Loads and stores - Load/Store register (immediate) - virtual bool STRx_LDRx_imm_1(Imm<2> size, Imm<2> opc, Imm<9> imm9, bool not_postindex, Reg Rn, - Reg Rt) { - return false; - } - virtual bool STRx_LDRx_imm_2(Imm<2> size, Imm<2> opc, Imm<12> imm12, Reg Rn, Reg Rt) { - return false; - } - virtual bool STURx_LDURx(Imm<2> size, Imm<2> opc, Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool PRFM_imm(Imm<12> imm12, Reg Rn, Reg Rt) { - return false; - } - virtual bool PRFM_unscaled_imm(Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool STR_imm_fpsimd_1(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, bool not_postindex, - Reg Rn, Vec Vt) { - return false; - } - virtual bool STR_imm_fpsimd_2(Imm<2> size, Imm<1> opc_1, Imm<12> imm12, Reg Rn, Vec Vt) { - return false; - } - virtual bool LDR_imm_fpsimd_1(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, bool not_postindex, - Reg Rn, Vec Vt) { - return false; - } - virtual bool LDR_imm_fpsimd_2(Imm<2> size, Imm<1> opc_1, Imm<12> imm12, Reg Rn, Vec Vt) { - return false; - } - virtual bool STUR_fpsimd(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, Reg Rn, Vec Vt) { - return false; - } - virtual bool LDUR_fpsimd(Imm<2> size, Imm<1> opc_1, Imm<9> imm9, Reg Rn, Vec Vt) { - return false; - } - - // Loads and stores - Load/Store register (unprivileged) - virtual bool STTRB(Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDTRB(Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDTRSB(Imm<2> opc, Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool STTRH(Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDTRH(Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDTRSH(Imm<2> opc, Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool STTR(Imm<2> size, Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDTR(Imm<2> size, Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDTRSW(Imm<9> imm9, Reg Rn, Reg Rt) { - return false; - } - - // Loads and stores - Atomic memory options - virtual bool LDADDB(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDCLRB(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDEORB(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDSETB(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDSMAXB(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDSMINB(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDUMAXB(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDUMINB(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool SWPB(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDAPRB(Reg Rn, Reg Rt) { - return false; - } - virtual bool LDADDH(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDCLRH(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDEORH(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDSETH(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDSMAXH(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDSMINH(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDUMAXH(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDUMINH(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool SWPH(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDAPRH(Reg Rn, Reg Rt) { - return false; - } - virtual bool LDADD(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDCLR(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDEOR(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDSET(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDSMAX(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDSMIN(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDUMAX(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDUMIN(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool SWP(bool A, bool R, Reg Rs, Reg Rn, Reg Rt) { - return false; - } - virtual bool LDAPR(Reg Rn, Reg Rt) { - return false; - } - - // Loads and stores - Load/Store register (register offset) - virtual bool STRx_reg(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Reg Rt) { - return false; - } - virtual bool LDRx_reg(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Reg Rt) { - return false; - } - virtual bool STR_reg_fpsimd(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Vec Vt) { - return false; - } - virtual bool LDR_reg_fpsimd(Imm<2> size, Imm<1> opc_1, Reg Rm, Imm<3> option, bool S, Reg Rn, - Vec Vt) { - return false; - } - - // Loads and stores - Load/Store memory tags - virtual bool STG_1(Imm<9> imm9, Reg Rn) { - return false; - } - virtual bool STG_2(Imm<9> imm9, Reg Rn) { - return false; - } - virtual bool STG_3(Imm<9> imm9, Reg Rn) { - return false; - } - virtual bool LDG(Imm<9> offset_imm, Reg Rn, Reg Rt) { - return false; - } - virtual bool STZG_1(Imm<9> offset_imm, Reg Rn) { - return false; - } - virtual bool STZG_2(Imm<9> offset_imm, Reg Rn) { - return false; - } - virtual bool STZG_3(Imm<9> offset_imm, Reg Rn) { - return false; - } - virtual bool ST2G_1(Imm<9> offset_imm, Reg Rn) { - return false; - } - virtual bool ST2G_2(Imm<9> offset_imm, Reg Rn) { - return false; - } - virtual bool ST2G_3(Imm<9> offset_imm, Reg Rn) { - return false; - } - virtual bool STGV(Reg Rn, Reg Rt) { - return false; - } - virtual bool STZ2G_1(Imm<9> offset_imm, Reg Rn) { - return false; - } - virtual bool STZ2G_2(Imm<9> offset_imm, Reg Rn) { - return false; - } - virtual bool STZ2G_3(Imm<9> offset_imm, Reg Rn) { - return false; - } - virtual bool LDGV(Reg Rn, Reg Rt) { - return false; - } - - // Loads and stores - Load/Store register (pointer authentication) - virtual bool LDRA(bool M, bool S, Imm<9> imm9, bool W, Reg Rn, Reg Rt) { - return false; - } - - // Data Processing - Register - 2 source - virtual bool UDIV(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool SDIV(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool LSLV(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool LSRV(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool ASRV(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool RORV(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool CRC32(bool sf, Reg Rm, Imm<2> sz, Reg Rn, Reg Rd) { - return false; - } - virtual bool CRC32C(bool sf, Reg Rm, Imm<2> sz, Reg Rn, Reg Rd) { - return false; - } - virtual bool PACGA(Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool SUBP(Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool IRG(Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool GMI(Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool SUBPS(Reg Rm, Reg Rn, Reg Rd) { - return false; - } - - // Data Processing - Register - 1 source - virtual bool RBIT_int(bool sf, Reg Rn, Reg Rd) { - return false; - } - virtual bool REV16_int(bool sf, Reg Rn, Reg Rd) { - return false; - } - virtual bool REV(bool sf, bool opc_0, Reg Rn, Reg Rd) { - return false; - } - virtual bool CLZ_int(bool sf, Reg Rn, Reg Rd) { - return false; - } - virtual bool CLS_int(bool sf, Reg Rn, Reg Rd) { - return false; - } - virtual bool REV32_int(Reg Rn, Reg Rd) { - return false; - } - virtual bool PACDA(bool Z, Reg Rn, Reg Rd) { - return false; - } - virtual bool PACDB(bool Z, Reg Rn, Reg Rd) { - return false; - } - virtual bool AUTDA(bool Z, Reg Rn, Reg Rd) { - return false; - } - virtual bool AUTDB(bool Z, Reg Rn, Reg Rd) { - return false; - } - - // Data Processing - Register - Logical (shifted register) - virtual bool AND_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool BIC_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool ORR_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool ORN_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool EOR_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool EON(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool ANDS_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool BICS(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - - // Data Processing - Register - Add/Sub (shifted register) - virtual bool ADD_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool ADDS_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool SUB_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - virtual bool SUBS_shift(bool sf, Imm<2> shift, Reg Rm, Imm<6> imm6, Reg Rn, Reg Rd) { - return false; - } - - // Data Processing - Register - Add/Sub (shifted register) - virtual bool ADD_ext(bool sf, Reg Rm, Imm<3> option, Imm<3> imm3, Reg Rn, Reg Rd) { - return false; - } - virtual bool ADDS_ext(bool sf, Reg Rm, Imm<3> option, Imm<3> imm3, Reg Rn, Reg Rd) { - return false; - } - virtual bool SUB_ext(bool sf, Reg Rm, Imm<3> option, Imm<3> imm3, Reg Rn, Reg Rd) { - return false; - } - virtual bool SUBS_ext(bool sf, Reg Rm, Imm<3> option, Imm<3> imm3, Reg Rn, Reg Rd) { - return false; - } - - // Data Processing - Register - Add/Sub (with carry) - virtual bool ADC(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool ADCS(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool SBC(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool SBCS(bool sf, Reg Rm, Reg Rn, Reg Rd) { - return false; - } - - // Data Processing - Register - Conditional compare - virtual bool CCMN_reg(bool sf, Reg Rm, Cond cond, Reg Rn, Imm<4> nzcv) { - return false; - } - virtual bool CCMP_reg(bool sf, Reg Rm, Cond cond, Reg Rn, Imm<4> nzcv) { - return false; - } - virtual bool CCMN_imm(bool sf, Imm<5> imm5, Cond cond, Reg Rn, Imm<4> nzcv) { - return false; - } - virtual bool CCMP_imm(bool sf, Imm<5> imm5, Cond cond, Reg Rn, Imm<4> nzcv) { - return false; - } - - // Data Processing - Register - Conditional select - virtual bool CSEL(bool sf, Reg Rm, Cond cond, Reg Rn, Reg Rd) { - return false; - } - virtual bool CSINC(bool sf, Reg Rm, Cond cond, Reg Rn, Reg Rd) { - return false; - } - virtual bool CSINV(bool sf, Reg Rm, Cond cond, Reg Rn, Reg Rd) { - return false; - } - virtual bool CSNEG(bool sf, Reg Rm, Cond cond, Reg Rn, Reg Rd) { - return false; - } - - // Data Processing - Register - 3 source - virtual bool MADD(bool sf, Reg Rm, Reg Ra, Reg Rn, Reg Rd) { - return false; - } - virtual bool MSUB(bool sf, Reg Rm, Reg Ra, Reg Rn, Reg Rd) { - return false; - } - virtual bool SMADDL(Reg Rm, Reg Ra, Reg Rn, Reg Rd) { - return false; - } - virtual bool SMSUBL(Reg Rm, Reg Ra, Reg Rn, Reg Rd) { - return false; - } - virtual bool SMULH(Reg Rm, Reg Rn, Reg Rd) { - return false; - } - virtual bool UMADDL(Reg Rm, Reg Ra, Reg Rn, Reg Rd) { - return false; - } - virtual bool UMSUBL(Reg Rm, Reg Ra, Reg Rn, Reg Rd) { - return false; - } - virtual bool UMULH(Reg Rm, Reg Rn, Reg Rd) { - return false; - } - - // Data Processing - FP and SIMD - AES - virtual bool AESE(Vec Vn, Vec Vd) { - return false; - } - virtual bool AESD(Vec Vn, Vec Vd) { - return false; - } - virtual bool AESMC(Vec Vn, Vec Vd) { - return false; - } - virtual bool AESIMC(Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SHA - virtual bool SHA1C(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA1P(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA1M(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA1SU0(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA256H(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA256H2(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA256SU1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA1H(Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA1SU1(Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA256SU0(Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Scalar copy - virtual bool DUP_elt_1(Imm<5> imm5, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Scalar three - virtual bool FMULX_vec_1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMULX_vec_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMEQ_reg_1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMEQ_reg_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPS_1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPS_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRSQRTS_1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRSQRTS_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGE_reg_1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGE_reg_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FACGE_1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FACGE_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FABD_1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FABD_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGT_reg_1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGT_reg_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FACGT_1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FACGT_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Two register misc FP16 - virtual bool FCVTNS_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTMS_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTAS_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool SCVTF_int_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGT_zero_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMEQ_zero_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMLT_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTPS_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZS_int_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPE_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPX_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTNU_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTMU_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTAU_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool UCVTF_int_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGE_zero_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMLE_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTPU_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZU_int_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FRSQRTE_1(Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Two register misc - virtual bool FCVTNS_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTMS_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTAS_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool SCVTF_int_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGT_zero_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMEQ_zero_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMLT_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTPS_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZS_int_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPE_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPX_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTNU_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTMU_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTAU_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool UCVTF_int_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGE_zero_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMLE_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTPU_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZU_int_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRSQRTE_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Scalar two register misc FP16 - virtual bool FCVTNS_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTMS_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTAS_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool SCVTF_int_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGT_zero_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMEQ_zero_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMLT_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTPS_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZS_int_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPE_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTNU_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTMU_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTAU_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool UCVTF_int_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGE_zero_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMLE_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTPU_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZU_int_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRSQRTE_3(bool Q, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Scalar two register misc - virtual bool FCVTNS_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTMS_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTAS_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool SCVTF_int_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGT_zero_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMEQ_zero_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMLT_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTPS_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZS_int_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPE_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTNU_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTMU_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTAU_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool UCVTF_int_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGE_zero_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMLE_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTPU_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZU_int_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRSQRTE_4(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Scalar three same extra - virtual bool SQRDMLAH_vec_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRDMLAH_vec_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRDMLSH_vec_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRDMLSH_vec_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Scalar two-register misc - virtual bool SUQADD_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQABS_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMGT_zero_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMEQ_zero_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMLT_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool ABS_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQXTN_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool USQADD_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQNEG_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMGE_zero_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMLE_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool NEG_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQXTUN_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQXTN_1(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTXN_1(bool sz, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Scalar pairwise - virtual bool ADDP_pair(Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXNMP_pair_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXNMP_pair_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FADDP_pair_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FADDP_pair_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXP_pair_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXP_pair_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINNMP_pair_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINNMP_pair_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINP_pair_1(Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINP_pair_2(bool sz, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Scalar three different - virtual bool SQDMLAL_vec_1(Imm<2> size, Reg Rm, Reg Rn, Vec Vd) { - return false; - } - virtual bool SQDMLSL_vec_1(Imm<2> size, Reg Rm, Reg Rn, Vec Vd) { - return false; - } - virtual bool SQDMULL_vec_1(Imm<2> size, Reg Rm, Reg Rn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Scalar three same - virtual bool SQADD_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSUB_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMGT_reg_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMGE_reg_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SSHL_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHL_reg_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SRSHL_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRSHL_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool ADD_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMTST_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQDMULH_vec_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQADD_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQSUB_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMHI_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMHS_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool USHL_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQSHL_reg_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool URSHL_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQRSHL_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SUB_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMEQ_reg_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRDMULH_vec_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Scalar shift by immediate - virtual bool SSHR_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SSRA_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SRSHR_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SRSRA_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHL_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHL_imm_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHRN_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRSHRN_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SCVTF_fix_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZS_fix_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool USHR_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool USRA_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool URSHR_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool URSRA_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SRI_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SLI_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHLU_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQSHL_imm_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHRUN_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRSHRUN_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQSHRN_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQRSHRN_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool UCVTF_fix_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZU_fix_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Scalar x indexed element - virtual bool SQDMLAL_elt_1(Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQDMLSL_elt_1(Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQDMULL_elt_1(Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQDMULH_elt_1(Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQRDMULH_elt_1(Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FMLA_elt_1(Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLA_elt_2(bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLS_elt_1(Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLS_elt_2(bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMUL_elt_1(Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMUL_elt_2(bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRDMLAH_elt_1(Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQRDMLSH_elt_1(Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FMULX_elt_1(Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMULX_elt_2(bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Table Lookup - virtual bool TBL(bool Q, Vec Vm, Imm<2> len, size_t Vn, Vec Vd) { - return false; - } - virtual bool TBX(bool Q, Vec Vm, Imm<2> len, size_t Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Permute - virtual bool UZP1(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool TRN1(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool ZIP1(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UZP2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool TRN2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool ZIP2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Extract - virtual bool EXT(bool Q, Vec Vm, Imm<4> imm4, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Copy - virtual bool DUP_elt_2(bool Q, Imm<5> imm5, Vec Vn, Vec Vd) { - return false; - } - virtual bool DUP_gen(bool Q, Imm<5> imm5, Reg Rn, Vec Vd) { - return false; - } - virtual bool SMOV(bool Q, Imm<5> imm5, Vec Vn, Reg Rd) { - return false; - } - virtual bool UMOV(bool Q, Imm<5> imm5, Vec Vn, Reg Rd) { - return false; - } - virtual bool INS_gen(Imm<5> imm5, Reg Rn, Vec Vd) { - return false; - } - virtual bool INS_elt(Imm<5> imm5, Imm<4> imm4, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Three same - virtual bool FMULX_vec_3(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMEQ_reg_3(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPS_3(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRSQRTS_3(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGE_reg_3(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FACGE_3(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FABD_3(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGT_reg_3(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FACGT_3(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXNM_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLA_vec_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FADD_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAX_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINNM_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLS_vec_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FSUB_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMIN_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXNMP_vec_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FADDP_vec_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMUL_vec_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXP_vec_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FDIV_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINNMP_vec_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINP_vec_1(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Three same extra - virtual bool SDOT_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UDOT_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMLA_vec(bool Q, Imm<2> size, Vec Vm, Imm<2> rot, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCADD_vec(bool Q, Imm<2> size, Vec Vm, Imm<1> rot, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Two register misc - virtual bool REV64_asimd(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool REV16_asimd(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SADDLP(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CLS_asimd(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CNT(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SADALP(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool XTN(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTN(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTL(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool URECPE(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool REV32_asimd(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool UADDLP(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CLZ_asimd(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool UADALP(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHLL(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool NOT(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool RBIT_asimd(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool URSQRTE(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool SUQADD_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQABS_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMGT_zero_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMEQ_zero_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMLT_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool ABS_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQXTN_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool USQADD_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQNEG_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMGE_zero_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMLE_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool NEG_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQXTUN_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQXTN_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTXN_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTN_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTN_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTM_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTM_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FABS_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FABS_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTP_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTP_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTZ_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTZ_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTA_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTA_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTX_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTX_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FNEG_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FNEG_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTI_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTI_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FSQRT_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FSQRT_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINT32X_1(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINT64X_1(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINT32Z_1(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINT64Z_1(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD across lanes - virtual bool SADDLV(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SMAXV(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool SMINV(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool ADDV(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXNMV_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXNMV_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXV_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXV_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINNMV_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINNMV_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINV_1(bool Q, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINV_2(bool Q, bool sz, Vec Vn, Vec Vd) { - return false; - } - virtual bool UADDLV(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool UMAXV(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - virtual bool UMINV(bool Q, Imm<2> size, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD three different - virtual bool SADDL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SADDW(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SSUBL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SSUBW(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool ADDHN(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SABAL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SUBHN(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SABDL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SMLAL_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SMLSL_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SMULL_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool PMULL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UADDL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UADDW(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool USUBL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool USUBW(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool RADDHN(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UABAL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool RSUBHN(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UABDL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UMLAL_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UMLSL_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UMULL_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQDMLAL_vec_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQDMLSL_vec_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQDMULL_vec_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD three same - virtual bool SHADD(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SRHADD(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHSUB(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SMAX(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SMIN(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SABD(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SABA(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool MLA_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool MUL_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SMAXP(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SMINP(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool ADDP_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLAL_vec_1(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLAL_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool AND_asimd(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool BIC_asimd_reg(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLSL_vec_1(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLSL_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool ORR_asimd_reg(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool ORN_asimd(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UHADD(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool URHADD(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UHSUB(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UMAX(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UMIN(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UABD(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UABA(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool MLS_vec(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool PMUL(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UMAXP(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UMINP(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool EOR_asimd(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool BSL(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool BIT(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool BIF(bool Q, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXNM_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLA_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FADD_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAX_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINNM_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLS_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FSUB_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMIN_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXNMP_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FADDP_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMUL_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXP_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FDIV_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINNMP_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINP_vec_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMULX_vec_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMEQ_reg_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRECPS_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRSQRTS_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGE_reg_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FACGE_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FABD_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCMGT_reg_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FACGT_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQADD_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSUB_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMGT_reg_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMGE_reg_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SSHL_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHL_reg_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SRSHL_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRSHL_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool ADD_vector(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMTST_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQDMULH_vec_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQADD_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQSUB_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMHI_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMHS_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool USHL_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQSHL_reg_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool URSHL_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQRSHL_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SUB_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool CMEQ_reg_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRDMULH_vec_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD modified immediate - virtual bool MOVI(bool Q, bool op, Imm<1> a, Imm<1> b, Imm<1> c, Imm<4> cmode, Imm<1> d, - Imm<1> e, Imm<1> f, Imm<1> g, Imm<1> h, Vec Vd) { - return false; - } - virtual bool FMOV_2(bool Q, bool op, Imm<1> a, Imm<1> b, Imm<1> c, Imm<1> d, Imm<1> e, Imm<1> f, - Imm<1> g, Imm<1> h, Vec Vd) { - return false; - } - virtual bool FMOV_3(bool Q, Imm<1> a, Imm<1> b, Imm<1> c, Imm<1> d, Imm<1> e, Imm<1> f, - Imm<1> g, Imm<1> h, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD Shift by immediate - virtual bool SSHR_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SSRA_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SRSHR_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SRSRA_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHL_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHL_imm_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHRN(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool RSHRN(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHRN_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRSHRN_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SSHLL(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SCVTF_fix_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZS_fix_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool USHR_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool USRA_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool URSHR_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool URSRA_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SRI_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SLI_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHLU_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQSHL_imm_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQSHRUN_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRSHRUN_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQSHRN_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool UQRSHRN_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool USHLL(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool UCVTF_fix_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVTZU_fix_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SIMD vector x indexed element - virtual bool SMLAL_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQDMLAL_elt_2(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, - Vec Vn, Vec Vd) { - return false; - } - virtual bool SMLSL_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQDMLSL_elt_2(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, - Vec Vn, Vec Vd) { - return false; - } - virtual bool MUL_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SMULL_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vm, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQDMULL_elt_2(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, - Vec Vn, Vec Vd) { - return false; - } - virtual bool SQDMULH_elt_2(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, - Vec Vn, Vec Vd) { - return false; - } - virtual bool SQRDMULH_elt_2(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, - Vec Vn, Vec Vd) { - return false; - } - virtual bool SDOT_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FMLA_elt_3(bool Q, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLA_elt_4(bool Q, bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FMLS_elt_3(bool Q, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMLS_elt_4(bool Q, bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FMUL_elt_3(bool Q, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMUL_elt_4(bool Q, bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FMLAL_elt_1(bool Q, bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FMLAL_elt_2(bool Q, bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FMLSL_elt_1(bool Q, bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FMLSL_elt_2(bool Q, bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool MLA_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool UMLAL_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool MLS_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool UMLSL_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool UMULL_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQRDMLAH_elt_2(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, - Vec Vn, Vec Vd) { - return false; - } - virtual bool UDOT_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool SQRDMLSH_elt_2(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, - Vec Vn, Vec Vd) { - return false; - } - virtual bool FMULX_elt_3(bool Q, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMULX_elt_4(bool Q, bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, - Vec Vd) { - return false; - } - virtual bool FCMLA_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<2> rot, - Imm<1> H, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Cryptographic three register - virtual bool SM3TT1A(Vec Vm, Imm<2> imm2, Vec Vn, Vec Vd) { - return false; - } - virtual bool SM3TT1B(Vec Vm, Imm<2> imm2, Vec Vn, Vec Vd) { - return false; - } - virtual bool SM3TT2A(Vec Vm, Imm<2> imm2, Vec Vn, Vec Vd) { - return false; - } - virtual bool SM3TT2B(Vec Vm, Imm<2> imm2, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SHA512 three register - virtual bool SHA512H(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA512H2(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SHA512SU1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool RAX1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool XAR(Vec Vm, Imm<6> imm6, Vec Vn, Vec Vd) { - return false; - } - virtual bool SM3PARTW1(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SM3PARTW2(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool SM4EKEY(Vec Vm, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Cryptographic four register - virtual bool EOR3(Vec Vm, Vec Va, Vec Vn, Vec Vd) { - return false; - } - virtual bool BCAX(Vec Vm, Vec Va, Vec Vn, Vec Vd) { - return false; - } - virtual bool SM3SS1(Vec Vm, Vec Va, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - SHA512 two register - virtual bool SHA512SU0(Vec Vn, Vec Vd) { - return false; - } - virtual bool SM4E(Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Conversion between floating point and fixed point - virtual bool SCVTF_float_fix(bool sf, Imm<2> type, Imm<6> scale, Reg Rn, Vec Vd) { - return false; - } - virtual bool UCVTF_float_fix(bool sf, Imm<2> type, Imm<6> scale, Reg Rn, Vec Vd) { - return false; - } - virtual bool FCVTZS_float_fix(bool sf, Imm<2> type, Imm<6> scale, Vec Vn, Reg Rd) { - return false; - } - virtual bool FCVTZU_float_fix(bool sf, Imm<2> type, Imm<6> scale, Vec Vn, Reg Rd) { - return false; - } - - // Data Processing - FP and SIMD - Conversion between floating point and integer - virtual bool FCVTNS_float(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool FCVTNU_float(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool SCVTF_float_int(bool sf, Imm<2> type, Reg Rn, Vec Vd) { - return false; - } - virtual bool UCVTF_float_int(bool sf, Imm<2> type, Reg Rn, Vec Vd) { - return false; - } - virtual bool FCVTAS_float(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool FCVTAU_float(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool FMOV_float_gen(bool sf, Imm<2> type, Imm<1> rmode_0, Imm<1> opc_0, size_t n, - size_t d) { - return false; - } - virtual bool FCVTPS_float(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool FCVTPU_float(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool FCVTMS_float(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool FCVTMU_float(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool FCVTZS_float_int(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool FCVTZU_float_int(bool sf, Imm<2> type, Vec Vn, Reg Rd) { - return false; - } - virtual bool FJCVTZS(Vec Vn, Reg Rd) { - return false; - } - - // Data Processing - FP and SIMD - Floating point data processing - virtual bool FMOV_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FABS_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FNEG_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FSQRT_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FCVT_float(Imm<2> type, Imm<2> opc, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTN_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTP_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTM_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTZ_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTA_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTX_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINTI_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINT32X_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINT64X_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINT32Z_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - virtual bool FRINT64Z_float(Imm<2> type, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Floating point compare - virtual bool FCMP_float(Imm<2> type, Vec Vm, Vec Vn, bool cmp_with_zero) { - return false; - } - virtual bool FCMPE_float(Imm<2> type, Vec Vm, Vec Vn, bool cmp_with_zero) { - return false; - } - - // Data Processing - FP and SIMD - Floating point immediate - virtual bool FMOV_float_imm(Imm<2> type, Imm<8> imm8, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Floating point conditional compare - virtual bool FCCMP_float(Imm<2> type, Vec Vm, Cond cond, Vec Vn, Imm<4> nzcv) { - return false; - } - virtual bool FCCMPE_float(Imm<2> type, Vec Vm, Cond cond, Vec Vn, Imm<4> nzcv) { - return false; - } - - // Data Processing - FP and SIMD - Floating point data processing two register - virtual bool FMUL_float(Imm<2> type, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FDIV_float(Imm<2> type, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FADD_float(Imm<2> type, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FSUB_float(Imm<2> type, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAX_float(Imm<2> type, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMIN_float(Imm<2> type, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMAXNM_float(Imm<2> type, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMINNM_float(Imm<2> type, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - virtual bool FNMUL_float(Imm<2> type, Vec Vm, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Floating point conditional select - virtual bool FCSEL_float(Imm<2> type, Vec Vm, Cond cond, Vec Vn, Vec Vd) { - return false; - } - - // Data Processing - FP and SIMD - Floating point data processing three register - virtual bool FMADD_float(Imm<2> type, Vec Vm, Vec Va, Vec Vn, Vec Vd) { - return false; - } - virtual bool FMSUB_float(Imm<2> type, Vec Vm, Vec Va, Vec Vn, Vec Vd) { - return false; - } - virtual bool FNMADD_float(Imm<2> type, Vec Vm, Vec Va, Vec Vn, Vec Vd) { - return false; - } - virtual bool FNMSUB_float(Imm<2> type, Vec Vm, Vec Va, Vec Vn, Vec Vd) { - return false; - } -}; - -} // namespace Core From 3ab215fd30dd3cb4481d8d58c748a1b9520f8c1a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sun, 20 Sep 2026 19:16:06 -0400 Subject: [PATCH 083/198] experiment to address some TPIDR_EL0 stalls --- src/core/arm/nce/patcher.cpp | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/core/arm/nce/patcher.cpp b/src/core/arm/nce/patcher.cpp index 7d2041d4d2..b1569ceee6 100644 --- a/src/core/arm/nce/patcher.cpp +++ b/src/core/arm/nce/patcher.cpp @@ -371,14 +371,9 @@ size_t Patcher::GetPreSectionSize() const noexcept { } void Patcher::WriteLoadContext(oaknut::VectorCodeGenerator& cg) { - // This function was called, which modifies X30, so use that as a scratch register. - // SP contains the guest X30, so save our return X30 to SP + 8, since we have allocated 16 bytes - // of stack. cg.STR(X30, SP, 8); - cg.MRS(X30, oaknut::SystemReg::TPIDR_EL0); - cg.LDR(X30, X30, offsetof(NativeExecutionParameters, native_context)); + cg.LDR(X30, SP, 0); - // Load system registers. cg.LDR(W0, X30, offsetof(GuestContext, fpsr)); cg.MSR(oaknut::SystemReg::FPSR, X0); cg.LDR(W0, X30, offsetof(GuestContext, fpcr)); @@ -386,7 +381,9 @@ void Patcher::WriteLoadContext(oaknut::VectorCodeGenerator& cg) { cg.LDR(W0, X30, offsetof(GuestContext, nzcv)); cg.MSR(oaknut::SystemReg::NZCV, X0); - // Load all vector registers. + cg.LDR(X0, X30, 8 * 30); + cg.STR(X0, SP, 0); + static constexpr size_t VEC_OFF = offsetof(GuestContext, vector_registers); for (int i = 0; i <= 30; i += 2) { cg.LDP(oaknut::QReg{i}, oaknut::QReg{i + 1}, X30, VEC_OFF + 16 * i); @@ -436,7 +433,7 @@ void Patcher::WriteSaveContext(oaknut::VectorCodeGenerator& cg) { cg.STR(W0, X30, offsetof(GuestContext, nzcv)); cg.LDR(X0, SP, POST_INDEXED, 16); - // Reload our return X30 from the stack, and return. + cg.MOV(X1, X30); cg.LDR(X30, SP, 8); cg.RET(); } @@ -457,8 +454,6 @@ void Patcher::WriteSvcTrampoline(ModuleDestLabel module_dest, u32 svc_id, oaknut // Now that we've saved all registers, we can use any registers as scratch. // Store PC + 4 to arm interface, since we know the instruction offset from the entry point. oaknut::Label pc_after_svc; - cg.MRS(X1, oaknut::SystemReg::TPIDR_EL0); - cg.LDR(X1, X1, offsetof(NativeExecutionParameters, native_context)); cg.LDR(X2, pc_after_svc); cg.STR(X2, X1, offsetof(GuestContext, pc)); @@ -514,24 +509,13 @@ void Patcher::WriteSvcTrampoline(ModuleDestLabel module_dest, u32 svc_id, oaknut // Host called this location. Save the return address so we can // unwind the stack properly when jumping back. - cg.MRS(X2, oaknut::SystemReg::TPIDR_EL0); - cg.LDR(X2, X2, offsetof(NativeExecutionParameters, native_context)); - cg.ADD(X0, X2, offsetof(GuestContext, host_ctx)); + cg.ADD(X0, X1, offsetof(GuestContext, host_ctx)); cg.STR(X30, X0, offsetof(HostContext, host_saved_regs) + 11 * sizeof(u64)); - // Reload all guest registers except X30 and PC. - // The function also expects 16 bytes of stack already allocated. - cg.STR(X30, SP, PRE_INDEXED, -16); + cg.STR(X1, SP, PRE_INDEXED, -16); cg.BL(load_ctx); cg.LDR(X30, SP, POST_INDEXED, 16); - // Use X1 as a scratch register to restore X30. - cg.STR(X1, SP, PRE_INDEXED, -16); - cg.MRS(X1, oaknut::SystemReg::TPIDR_EL0); - cg.LDR(X1, X1, offsetof(NativeExecutionParameters, native_context)); - cg.LDR(X30, X1, offsetof(GuestContext, cpu_registers) + sizeof(u64) * 30); - cg.LDR(X1, SP, POST_INDEXED, 16); - // Unlock the context. this->UnlockContext(cg); From fa9e069907d78ffaeef7dacc02f3697743d444fb Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 22 Sep 2026 16:27:47 -0400 Subject: [PATCH 084/198] Adjust buffer stream size + reduce descriptor loads --- src/video_core/renderer_vulkan/vk_blit_screen.cpp | 2 +- src/video_core/renderer_vulkan/vk_descriptor_pool.cpp | 1 - src/video_core/renderer_vulkan/vk_descriptor_pool.h | 2 +- src/video_core/renderer_vulkan/vk_master_semaphore.cpp | 2 +- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 2 +- src/video_core/renderer_vulkan/vk_scheduler.cpp | 9 +-------- src/video_core/renderer_vulkan/vk_scheduler.h | 2 -- .../renderer_vulkan/vk_staging_buffer_pool.cpp | 9 --------- src/video_core/renderer_vulkan/vk_update_descriptor.h | 4 ++-- src/video_core/vulkan_common/vulkan_device.h | 1 - 10 files changed, 7 insertions(+), 27 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp index 205382f81a..242d60c5e1 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp +++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp @@ -33,8 +33,8 @@ BlitScreen::BlitScreen(Tegra::MaxwellDeviceMemoryManager& device_memory_, const BlitScreen::~BlitScreen() = default; void BlitScreen::WaitIdle(const Device& device) { - present_manager.WaitPresent(); scheduler.Finish(); + present_manager.WaitPresent(); device.GetLogical().WaitIdle(); } diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp index b020d99b93..b41e755871 100644 --- a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp @@ -125,7 +125,6 @@ vk::DescriptorSets DescriptorAllocator::AllocateDescriptors(size_t count) { throw vk::Exception(VK_ERROR_OUT_OF_POOL_MEMORY); } -DescriptorPool::DescriptorPool(const Device& device_, Scheduler& scheduler) {} DescriptorPool::~DescriptorPool() = default; DescriptorAllocator DescriptorPool::Allocator(const Device& device, Scheduler& scheduler, VkDescriptorSetLayout layout, std::span infos) { diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.h b/src/video_core/renderer_vulkan/vk_descriptor_pool.h index 4efeb60373..45d3acdb55 100644 --- a/src/video_core/renderer_vulkan/vk_descriptor_pool.h +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.h @@ -65,7 +65,7 @@ private: class DescriptorPool { public: - explicit DescriptorPool(const Device& device, Scheduler& scheduler); + DescriptorPool() = default; ~DescriptorPool(); DescriptorPool& operator=(const DescriptorPool&) = delete; diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp index be5a1144ce..9ca215b425 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp @@ -353,7 +353,7 @@ void MasterSemaphore::WaitThread(std::stop_token token) { free_queue.push_front(std::move(fence)); gpu_tick.store(host_tick, std::memory_order_release); } - gpu_tick.notify_one(); + gpu_tick.notify_all(); } } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index fd95ea288b..aa36aa9093 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -206,7 +206,7 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra StateTracker& state_tracker_, Scheduler& scheduler_) : gpu{gpu_}, device_memory{device_memory_}, device{device_}, memory_allocator{memory_allocator_}, state_tracker{state_tracker_}, scheduler{scheduler_}, - staging_pool(device, memory_allocator, scheduler), descriptor_pool(device, scheduler), + staging_pool(device, memory_allocator, scheduler), guest_descriptor_queue(device, UpdateDescriptorQueue::GUEST_FRAME_PAYLOAD_SIZE, device.IsExtDescriptorBufferSupported()), compute_pass_descriptor_queue(device, UpdateDescriptorQueue::COMPUTE_FRAME_PAYLOAD_SIZE), diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 4a7a7d5e78..74379e8063 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -56,9 +56,7 @@ Scheduler::~Scheduler() = default; u64 Scheduler::Flush(VkSemaphore signal_semaphore, VkSemaphore wait_semaphore) { // When flushing, we only send data to the worker thread; no waiting is necessary. - const u64 signal_value = SubmitExecution(signal_semaphore, wait_semaphore); - AllocateNewContext(); - return signal_value; + return SubmitExecution(signal_semaphore, wait_semaphore); } void Scheduler::Finish(VkSemaphore signal_semaphore, VkSemaphore wait_semaphore) { @@ -66,7 +64,6 @@ void Scheduler::Finish(VkSemaphore signal_semaphore, VkSemaphore wait_semaphore) const u64 presubmit_tick = CurrentTick(); SubmitExecution(signal_semaphore, wait_semaphore); Wait(presubmit_tick); - AllocateNewContext(); } void Scheduler::WaitWorker() { @@ -384,10 +381,6 @@ u64 Scheduler::SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_se return signal_value; } -void Scheduler::AllocateNewContext() { - // Enable counters once again. These are disabled when a command buffer is finished. -} - void Scheduler::InvalidateState() { state.graphics_pipeline = nullptr; state.rescaling_defined = false; diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index d4bc8d0ec5..08ae0bfca1 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -287,8 +287,6 @@ private: u64 SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_semaphore); - void AllocateNewContext(); - void EndPendingOperations(); void EndRenderPass(); diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index 5f04df2c9e..e2bc1ad3a4 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -28,16 +28,7 @@ using namespace Common::Literals; // Maximum potential alignment of a Vulkan buffer constexpr VkDeviceSize MAX_ALIGNMENT = 256; -// Stream buffer size in bytes -// *NIX drivers are more sensitive to increased buffers for streaming. -// Windows ones however, can intake bigger buffers and generally do not OOM. -// - GTX 960 on Windows will not OOM with 256mib -// - GT 1030 on ^NIX will OOM with 256mib -#if defined(__FreeBSD__) constexpr VkDeviceSize MAX_STREAM_BUFFER_SIZE = 128_MiB; -#else -constexpr VkDeviceSize MAX_STREAM_BUFFER_SIZE = 256_MiB; -#endif size_t GetStreamBufferSize(const Device& device) { if (!device.HasDebuggingToolAttached()) { diff --git a/src/video_core/renderer_vulkan/vk_update_descriptor.h b/src/video_core/renderer_vulkan/vk_update_descriptor.h index 9f30e65dbd..04d76a8386 100644 --- a/src/video_core/renderer_vulkan/vk_update_descriptor.h +++ b/src/video_core/renderer_vulkan/vk_update_descriptor.h @@ -40,8 +40,8 @@ class UpdateDescriptorQueue final { static constexpr size_t FRAMES_IN_FLIGHT = 8; public: - static constexpr size_t GUEST_FRAME_PAYLOAD_SIZE = 0x80000; - static constexpr size_t COMPUTE_FRAME_PAYLOAD_SIZE = 0x20000; + static constexpr size_t GUEST_FRAME_PAYLOAD_SIZE = 0x20000; + static constexpr size_t COMPUTE_FRAME_PAYLOAD_SIZE = 0x8000; explicit UpdateDescriptorQueue(const Device& device_, size_t frame_payload_size_, bool supports_descriptor_buffer_ = false); diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 916a78fd56..0927ca8a05 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -1011,7 +1011,6 @@ FN_MAX_LIMIT_LIST return features2.features.multiViewport; } - /// Returns true if the device supports VK_KHR_maintenance5. /// Returns true if the device supports VK_KHR_maintenance4. bool IsKhrMaintenance4Supported() const { return extensions.maintenance4; From e6fe763afa00b30be9e8f468048e6ec0578c5850 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 22 Sep 2026 16:40:50 -0400 Subject: [PATCH 085/198] Correction on the descriptor pool --- src/video_core/renderer_vulkan/vk_descriptor_pool.cpp | 1 + src/video_core/renderer_vulkan/vk_descriptor_pool.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp index b41e755871..2f4af7c330 100644 --- a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp @@ -125,6 +125,7 @@ vk::DescriptorSets DescriptorAllocator::AllocateDescriptors(size_t count) { throw vk::Exception(VK_ERROR_OUT_OF_POOL_MEMORY); } +DescriptorPool::DescriptorPool() = default; DescriptorPool::~DescriptorPool() = default; DescriptorAllocator DescriptorPool::Allocator(const Device& device, Scheduler& scheduler, VkDescriptorSetLayout layout, std::span infos) { diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.h b/src/video_core/renderer_vulkan/vk_descriptor_pool.h index 45d3acdb55..6a80f8e107 100644 --- a/src/video_core/renderer_vulkan/vk_descriptor_pool.h +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.h @@ -65,7 +65,7 @@ private: class DescriptorPool { public: - DescriptorPool() = default; + DescriptorPool(); ~DescriptorPool(); DescriptorPool& operator=(const DescriptorPool&) = delete; From 6ffd65adaf83292f370e150bf98eb378de4e0108 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 22 Sep 2026 18:35:26 -0400 Subject: [PATCH 086/198] another intent to remove sync1 and replace it with sync2 completely --- src/video_core/renderer_vulkan/blit_image.cpp | 122 ++--- src/video_core/renderer_vulkan/blit_image.h | 18 +- .../renderer_vulkan/present/frame_gen.cpp | 38 +- .../renderer_vulkan/present/layer.cpp | 33 +- .../renderer_vulkan/present/lsfg_common.cpp | 31 +- .../renderer_vulkan/present/lsfg_common.h | 4 +- .../renderer_vulkan/present/lsfg_generate.cpp | 21 +- .../renderer_vulkan/present/util.cpp | 50 +- .../renderer_vulkan/vk_buffer_cache.cpp | 91 ++-- .../renderer_vulkan/vk_compute_pass.cpp | 137 ++--- .../renderer_vulkan/vk_descriptor_pool.h | 3 +- .../renderer_vulkan/vk_master_semaphore.cpp | 276 ++++------ .../renderer_vulkan/vk_present_manager.cpp | 128 +++-- .../renderer_vulkan/vk_query_cache.cpp | 92 ++-- .../renderer_vulkan/vk_rasterizer.cpp | 51 +- .../renderer_vulkan/vk_render_pass_cache.cpp | 187 +++---- .../renderer_vulkan/vk_scheduler.cpp | 64 +-- .../renderer_vulkan/vk_texture_cache.cpp | 478 ++++++++++-------- .../renderer_vulkan/vk_turbo_mode.cpp | 24 +- .../vulkan_common/vulkan_device.cpp | 6 +- src/video_core/vulkan_common/vulkan_device.h | 8 +- .../vulkan_common/vulkan_wrapper.cpp | 12 +- src/video_core/vulkan_common/vulkan_wrapper.h | 164 ++---- 23 files changed, 1005 insertions(+), 1033 deletions(-) diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index f9d9460c37..928e7bfb9c 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -454,12 +454,15 @@ VkExtent2D GetConversionExtent(const ImageView& src_image_view) { void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayout target_layout, VkImageLayout source_layout = VK_IMAGE_LAYOUT_GENERAL) { - constexpr VkFlags flags{VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT}; - const VkImageMemoryBarrier barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + constexpr VkAccessFlags2 flags{VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_SHADER_READ_BIT}; + const VkImageMemoryBarrier2 barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, .srcAccessMask = flags, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, .dstAccessMask = flags, .oldLayout = source_layout, .newLayout = target_layout, @@ -474,8 +477,7 @@ void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayo .layerCount = 1, }, }; - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, barrier); + cmdbuf.PipelineBarrier(barrier); } void RecordShaderReadBarrier(Scheduler& scheduler, const ImageView& image_view) { @@ -483,14 +485,22 @@ void RecordShaderReadBarrier(Scheduler& scheduler, const ImageView& image_view) const VkImageSubresourceRange subresource_range = SubresourceRangeFromView(image_view); scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([image, subresource_range](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | + VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | + VK_PIPELINE_STAGE_2_TRANSFER_BIT | + VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT, + .srcAccessMask = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_SHADER_WRITE_BIT | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -498,17 +508,7 @@ void RecordShaderReadBarrier(Scheduler& scheduler, const ImageView& image_view) .image = image, .subresourceRange = subresource_range, }; - cmdbuf.PipelineBarrier( - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | - VK_PIPELINE_STAGE_TRANSFER_BIT | - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - 0, - barrier); + cmdbuf.PipelineBarrier(barrier); }); } @@ -991,10 +991,12 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, .layerCount = VK_REMAINING_ARRAY_LAYERS, }; const std::array pre_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = aspect_info.pre_src_stages, .srcAccessMask = aspect_info.pre_src_access, + .dstStageMask = aspect_info.pre_dst_stages, .dstAccessMask = aspect_info.pre_src_dst_access, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1003,10 +1005,12 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, .image = src, .subresourceRange = barrier_range, }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = aspect_info.pre_src_stages, .srcAccessMask = aspect_info.pre_src_access, + .dstStageMask = aspect_info.pre_dst_stages, .dstAccessMask = aspect_info.pre_dst_dst_access, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1016,8 +1020,7 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, .subresourceRange = barrier_range, }, }; - cmdbuf.PipelineBarrier(aspect_info.pre_src_stages, aspect_info.pre_dst_stages, 0, - nullptr, nullptr, pre_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, pre_barriers); const VkRenderPassBeginInfo renderpass_bi{ .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, .pNext = nullptr, @@ -1053,10 +1056,12 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, cmdbuf.PushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, push_constants); cmdbuf.Draw(3, 1, 0, 0); cmdbuf.EndRenderPass(); - const VkImageMemoryBarrier post_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 post_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = aspect_info.post_src_stages, .srcAccessMask = aspect_info.post_src_access, + .dstStageMask = aspect_info.post_dst_stages, .dstAccessMask = aspect_info.post_dst_access, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1065,8 +1070,7 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, .image = dst, .subresourceRange = barrier_range, }; - cmdbuf.PipelineBarrier(aspect_info.post_src_stages, aspect_info.post_dst_stages, 0, - post_barrier); + cmdbuf.PipelineBarrier(post_barrier); }); msaa_copy_resources.push_back(MSAACopyResources{ .tick = scheduler.CurrentTick(), @@ -1115,21 +1119,21 @@ void BlitImageHelper::CopyMSAA(RenderPassCache& render_pass_cache, VkImage dst_i .src_view_aspect = VK_IMAGE_ASPECT_COLOR_BIT, .attachment_aspect = VK_IMAGE_ASPECT_COLOR_BIT, .barrier_aspect = VK_IMAGE_ASPECT_COLOR_BIT, - .pre_src_access = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .pre_src_dst_access = VK_ACCESS_SHADER_READ_BIT, + .pre_src_access = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .pre_src_dst_access = VK_ACCESS_2_SHADER_READ_BIT, .pre_dst_dst_access = - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - .pre_src_stages = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT, + VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, + .pre_src_stages = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | + VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT, .pre_dst_stages = - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - .post_src_access = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - .post_dst_access = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_TRANSFER_READ_BIT, - .post_src_stages = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - .post_dst_stages = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT, + VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, + .post_src_access = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, + .post_dst_access = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_TRANSFER_READ_BIT, + .post_src_stages = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, + .post_dst_stages = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT, }; const VkFormat src_vk_format = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, true, src_format).format; @@ -1625,19 +1629,19 @@ void BlitImageHelper::CopyMSAADepth(RenderPassCache& render_pass_cache, VkImage .attachment_aspect = attachment_aspect, .barrier_aspect = attachment_aspect, .pre_src_access = - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, - .pre_src_dst_access = VK_ACCESS_SHADER_READ_BIT, - .pre_dst_dst_access = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - .pre_src_stages = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_TRANSFER_BIT, + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, + .pre_src_dst_access = VK_ACCESS_2_SHADER_READ_BIT, + .pre_dst_dst_access = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + .pre_src_stages = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_TRANSFER_BIT, .pre_dst_stages = - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT, - .post_src_access = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - .post_dst_access = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT, - .post_src_stages = VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, + VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT, + .post_src_access = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + .post_dst_access = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_TRANSFER_READ_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT, + .post_src_stages = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT, .post_dst_stages = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, }; const VkFormat src_vk_format = diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index 62e6743a23..895d0f8de4 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h @@ -140,15 +140,15 @@ private: VkImageAspectFlags src_view_aspect; VkImageAspectFlags attachment_aspect; VkImageAspectFlags barrier_aspect; - VkAccessFlags pre_src_access; - VkAccessFlags pre_src_dst_access; - VkAccessFlags pre_dst_dst_access; - VkPipelineStageFlags pre_src_stages; - VkPipelineStageFlags pre_dst_stages; - VkAccessFlags post_src_access; - VkAccessFlags post_dst_access; - VkPipelineStageFlags post_src_stages; - VkPipelineStageFlags post_dst_stages; + VkAccessFlags2 pre_src_access; + VkAccessFlags2 pre_src_dst_access; + VkAccessFlags2 pre_dst_dst_access; + VkPipelineStageFlags2 pre_src_stages; + VkPipelineStageFlags2 pre_dst_stages; + VkAccessFlags2 post_src_access; + VkAccessFlags2 post_dst_access; + VkPipelineStageFlags2 post_src_stages; + VkPipelineStageFlags2 post_dst_stages; }; void BlitImpl(const Framebuffer* dst_framebuffer, const ImageView& src_image_view, diff --git a/src/video_core/renderer_vulkan/present/frame_gen.cpp b/src/video_core/renderer_vulkan/present/frame_gen.cpp index e6d857323b..d5916d6170 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen.cpp @@ -113,13 +113,17 @@ void WriteColorPpm(const std::filesystem::path& path, VkExtent2D extent, WritePortablePixmap(path, "P6", extent, rgb); } -VkImageMemoryBarrier MakeTransitionBarrier(VkImage image, VkAccessFlags src_access, - VkAccessFlags dst_access, VkImageLayout old_layout, - VkImageLayout new_layout) { - return VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, +VkImageMemoryBarrier2 MakeTransitionBarrier(VkImage image, VkPipelineStageFlags2 src_stage, + VkAccessFlags2 src_access, + VkPipelineStageFlags2 dst_stage, + VkAccessFlags2 dst_access, VkImageLayout old_layout, + VkImageLayout new_layout) { + return VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = src_stage, .srcAccessMask = src_access, + .dstStageMask = dst_stage, .dstAccessMask = dst_access, .oldLayout = old_layout, .newLayout = new_layout, @@ -160,29 +164,31 @@ void CopyPresentedFrame(vk::CommandBuffer cmdbuf, VkImage source, LsfgImage& des VkExtent2D extent) { const auto make_barrier = MakeTransitionBarrier; + static constexpr VkPipelineStageFlags2 present_stage = + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT; + const std::array before{ - make_barrier(source, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, + make_barrier(source, present_stage, VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, + VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL), - make_barrier(destination.Handle(), VK_ACCESS_SHADER_READ_BIT, VK_ACCESS_TRANSFER_WRITE_BIT, + make_barrier(destination.Handle(), present_stage, VK_ACCESS_2_SHADER_READ_BIT, + VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_WRITE_BIT, destination.Layout(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL), }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, 0, {}, {}, before); + cmdbuf.PipelineBarrier(0, {}, {}, before); cmdbuf.CopyImage(source, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, destination.Handle(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, MakeCopyRegion(extent)); const std::array after{ - make_barrier(source, VK_ACCESS_TRANSFER_READ_BIT, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, + make_barrier(source, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, + present_stage, VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL), - make_barrier(destination.Handle(), VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, + make_barrier(destination.Handle(), VK_PIPELINE_STAGE_2_TRANSFER_BIT, + VK_ACCESS_2_TRANSFER_WRITE_BIT, present_stage, VK_ACCESS_2_SHADER_READ_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL), }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - 0, {}, {}, after); + cmdbuf.PipelineBarrier(0, {}, {}, after); destination.SetLayout(VK_IMAGE_LAYOUT_GENERAL); } diff --git a/src/video_core/renderer_vulkan/present/layer.cpp b/src/video_core/renderer_vulkan/present/layer.cpp index 1868142f51..562928b953 100644 --- a/src/video_core/renderer_vulkan/present/layer.cpp +++ b/src/video_core/renderer_vulkan/present/layer.cpp @@ -364,11 +364,13 @@ void Layer::UpdateRawImage(const Tegra::FramebufferConfig& framebuffer, size_t i }; scheduler.Record([this, copy, index = image_index](vk::CommandBuffer cmdbuf) { const VkImage image = *raw_images[index]; - const VkImageMemoryBarrier base_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 base_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = 0, - .dstAccessMask = 0, + .srcStageMask = VK_PIPELINE_STAGE_2_NONE, + .srcAccessMask = VK_ACCESS_2_NONE, + .dstStageMask = VK_PIPELINE_STAGE_2_NONE, + .dstAccessMask = VK_ACCESS_2_NONE, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -382,23 +384,24 @@ void Layer::UpdateRawImage(const Tegra::FramebufferConfig& framebuffer, size_t i .layerCount = 1, }, }; - VkImageMemoryBarrier read_barrier = base_barrier; - read_barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; + VkImageMemoryBarrier2 read_barrier = base_barrier; + read_barrier.srcStageMask = VK_PIPELINE_STAGE_2_HOST_BIT; + read_barrier.dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT; + read_barrier.dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT; read_barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; read_barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; - VkImageMemoryBarrier write_barrier = base_barrier; - write_barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; - write_barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; + VkImageMemoryBarrier2 write_barrier = base_barrier; + write_barrier.srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT; + write_barrier.srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT; + write_barrier.dstStageMask = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT; + write_barrier.dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT; write_barrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, - read_barrier); + cmdbuf.PipelineBarrier(read_barrier); cmdbuf.CopyBufferToImage(*buffer, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, copy); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - 0, write_barrier); + cmdbuf.PipelineBarrier(write_barrier); }); } diff --git a/src/video_core/renderer_vulkan/present/lsfg_common.cpp b/src/video_core/renderer_vulkan/present/lsfg_common.cpp index d2df2755e5..74e5d446d8 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_common.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_common.cpp @@ -67,12 +67,14 @@ vk::Buffer CreateUniformBuffer(MemoryAllocator& memory_allocator, VkDeviceSize s return memory_allocator.CreateBuffer(buffer_ci, MemoryUsage::Upload); } -VkImageMemoryBarrier MakeBarrier(const LsfgImage& image, VkAccessFlags src_access, - VkAccessFlags dst_access) { - return VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, +VkImageMemoryBarrier2 MakeBarrier(const LsfgImage& image, VkAccessFlags2 src_access, + VkAccessFlags2 dst_access) { + return VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, .srcAccessMask = src_access, + .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, .dstAccessMask = dst_access, .oldLayout = image.Layout(), .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -98,19 +100,19 @@ LsfgImage::LsfgImage(const Device& device, MemoryAllocator& memory_allocator, Vk view = CreateWrappedImageView(device, image, format); } -LsfgBarriers& LsfgBarriers::Push(LsfgImage& image, VkAccessFlags src_access, - VkAccessFlags dst_access) { +LsfgBarriers& LsfgBarriers::Push(LsfgImage& image, VkAccessFlags2 src_access, + VkAccessFlags2 dst_access) { barriers.push_back(MakeBarrier(image, src_access, dst_access)); image.SetLayout(VK_IMAGE_LAYOUT_GENERAL); return *this; } LsfgBarriers& LsfgBarriers::WriteToRead(LsfgImage& image) { - return Push(image, VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT); + return Push(image, VK_ACCESS_2_SHADER_WRITE_BIT, VK_ACCESS_2_SHADER_READ_BIT); } LsfgBarriers& LsfgBarriers::ReadToWrite(LsfgImage& image) { - return Push(image, VK_ACCESS_SHADER_READ_BIT, VK_ACCESS_SHADER_WRITE_BIT); + return Push(image, VK_ACCESS_2_SHADER_READ_BIT, VK_ACCESS_2_SHADER_WRITE_BIT); } LsfgBarriers& LsfgBarriers::WriteToRead(LsfgImage* image) { @@ -122,11 +124,13 @@ LsfgBarriers& LsfgBarriers::ReadToWrite(LsfgImage* image) { } LsfgBarriers& LsfgBarriers::DiscardToWrite(VkImage image) { - barriers.push_back(VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + barriers.push_back(VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_NONE, + .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -199,8 +203,7 @@ void LsfgBarriers::Build() { if (barriers.empty()) { return; } - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {}, {}, barriers); + cmdbuf.PipelineBarrier(0, {}, {}, barriers); barriers.clear(); } diff --git a/src/video_core/renderer_vulkan/present/lsfg_common.h b/src/video_core/renderer_vulkan/present/lsfg_common.h index d1e3271a6d..bc538f4d1b 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_common.h +++ b/src/video_core/renderer_vulkan/present/lsfg_common.h @@ -147,10 +147,10 @@ public: void Build(); private: - LsfgBarriers& Push(LsfgImage& image, VkAccessFlags src_access, VkAccessFlags dst_access); + LsfgBarriers& Push(LsfgImage& image, VkAccessFlags2 src_access, VkAccessFlags2 dst_access); vk::CommandBuffer cmdbuf; - std::vector barriers; + std::vector barriers; }; class LsfgDescriptorWriter { diff --git a/src/video_core/renderer_vulkan/present/lsfg_generate.cpp b/src/video_core/renderer_vulkan/present/lsfg_generate.cpp index 4473b59a2f..2aa470bdb0 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_generate.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_generate.cpp @@ -22,12 +22,15 @@ constexpr u32 DISPATCH_TILE_SHIFT = 4; return (size + (1u << DISPATCH_TILE_SHIFT) - 1) >> DISPATCH_TILE_SHIFT; } -VkImageMemoryBarrier MakeTargetBarrier(VkImage image, VkAccessFlags src_access, - VkAccessFlags dst_access, VkImageLayout old_layout) { - return VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, +VkImageMemoryBarrier2 MakeTargetBarrier(VkImage image, VkPipelineStageFlags2 src_stage, + VkAccessFlags2 src_access, VkPipelineStageFlags2 dst_stage, + VkAccessFlags2 dst_access, VkImageLayout old_layout) { + return VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = src_stage, .srcAccessMask = src_access, + .dstStageMask = dst_stage, .dstAccessMask = dst_access, .oldLayout = old_layout, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -118,13 +121,11 @@ void LsfgGenerate::Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t sl cmdbuf.Dispatch(GroupCount(extent.width), GroupCount(extent.height), 1); const std::array after{MakeTargetBarrier( - image, VK_ACCESS_SHADER_WRITE_BIT, - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_READ_BIT, + image, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_WRITE_BIT, + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT, + VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_TRANSFER_READ_BIT, VK_IMAGE_LAYOUT_GENERAL)}; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, {}, {}, after); + cmdbuf.PipelineBarrier(0, {}, {}, after); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/util.cpp b/src/video_core/renderer_vulkan/present/util.cpp index 11250687d6..131973bdd6 100644 --- a/src/video_core/renderer_vulkan/present/util.cpp +++ b/src/video_core/renderer_vulkan/present/util.cpp @@ -49,12 +49,15 @@ vk::Image CreateWrappedImage(MemoryAllocator& allocator, VkExtent2D dimensions, void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayout target_layout, VkImageLayout source_layout) { - constexpr VkFlags flags{VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT}; - const VkImageMemoryBarrier barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + constexpr VkAccessFlags2 flags{VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_SHADER_READ_BIT}; + const VkImageMemoryBarrier2 barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, .srcAccessMask = flags, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, .dstAccessMask = flags, .oldLayout = source_layout, .newLayout = target_layout, @@ -69,8 +72,7 @@ void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayo .layerCount = 1, }, }; - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, barrier); + cmdbuf.PipelineBarrier(barrier); } void UploadImage(const Device& device, MemoryAllocator& allocator, Scheduler& scheduler, @@ -116,11 +118,13 @@ void UploadImage(const Device& device, MemoryAllocator& allocator, Scheduler& sc void DownloadColorImage(vk::CommandBuffer& cmdbuf, VkImage image, VkBuffer buffer, VkExtent3D extent) { - const VkImageMemoryBarrier read_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 read_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -134,11 +138,13 @@ void DownloadColorImage(vk::CommandBuffer& cmdbuf, VkImage image, VkBuffer buffe .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - const VkImageMemoryBarrier image_write_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 image_write_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_NONE, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -152,11 +158,13 @@ void DownloadColorImage(vk::CommandBuffer& cmdbuf, VkImage image, VkBuffer buffe .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - static constexpr VkMemoryBarrier memory_write_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 memory_write_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; const VkBufferImageCopy copy{ .bufferOffset = 0, @@ -171,11 +179,9 @@ void DownloadColorImage(vk::CommandBuffer& cmdbuf, VkImage image, VkBuffer buffe .imageOffset{.x = 0, .y = 0, .z = 0}, .imageExtent{extent}, }; - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, - read_barrier); + cmdbuf.PipelineBarrier(read_barrier); cmdbuf.CopyImageToBuffer(image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, buffer, copy); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, 0, - memory_write_barrier, nullptr, image_write_barrier); + cmdbuf.PipelineBarrier(0, memory_write_barrier, {}, image_write_barrier); } vk::ImageView CreateWrappedImageView(const Device& device, vk::Image& image, VkFormat format) { diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 8c93a92046..56f0e7b870 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -227,11 +227,13 @@ public: .dstOffset = 0, .size = size_bytes, }; - const VkBufferMemoryBarrier write_barrier{ - .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, + const VkBufferMemoryBarrier2 write_barrier{ + .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_INDEX_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT, + .dstAccessMask = VK_ACCESS_2_INDEX_READ_BIT, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .buffer = dst_buffer, @@ -239,8 +241,7 @@ public: .size = size_bytes, }; cmdbuf.CopyBuffer(src_buffer, dst_buffer, copy); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, 0, write_barrier); + cmdbuf.PipelineBarrier(write_barrier); }); } else { buffer.Flush(); @@ -456,17 +457,21 @@ void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, if (dst_buffer == VK_NULL_HANDLE || src_buffer == VK_NULL_HANDLE) { return; } - static constexpr VkMemoryBarrier READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, }; - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; // Measuring a popular game, this number never exceeds the specified size once data is warmed up @@ -483,42 +488,42 @@ void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([src_buffer, dst_buffer, vk_copies, barrier](vk::CommandBuffer cmdbuf) { if (barrier) { - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - VK_PIPELINE_STAGE_TRANSFER_BIT, 0, READ_BARRIER); + cmdbuf.PipelineBarrier(READ_BARRIER); } cmdbuf.CopyBuffer(src_buffer, dst_buffer, VideoCommon::FixSmallVectorADL(vk_copies)); if (barrier) { - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, 0, WRITE_BARRIER); + cmdbuf.PipelineBarrier(WRITE_BARRIER); } }); } void BufferCacheRuntime::PreCopyBarrier() { - static constexpr VkMemoryBarrier READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, READ_BARRIER); + cmdbuf.PipelineBarrier(READ_BARRIER); }); } void BufferCacheRuntime::PostCopyBarrier() { - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, WRITE_BARRIER); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); } @@ -526,26 +531,28 @@ void BufferCacheRuntime::ClearBuffer(VkBuffer dest_buffer, u32 offset, size_t si if (dest_buffer == VK_NULL_HANDLE) { return; } - static constexpr VkMemoryBarrier READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, }; - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([dest_buffer, offset, size, value](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, READ_BARRIER); + cmdbuf.PipelineBarrier(READ_BARRIER); cmdbuf.FillBuffer(dest_buffer, offset, size, value); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, WRITE_BARRIER); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); } diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 4dd65f0269..ca5a267c6a 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -322,19 +322,20 @@ std::pair Uint8Pass::Assemble(u32 num_vertices, VkBuffer scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([this, descriptor_data, num_vertices](vk::CommandBuffer cmdbuf) { static constexpr u32 DISPATCH_SIZE = 1024; - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT, + .dstAccessMask = VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT, }; const VkDescriptorSet set = descriptor_allocator.Commit(); device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); cmdbuf.Dispatch(Common::DivCeil(num_vertices, DISPATCH_SIZE), 1, 1); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, 0, WRITE_BARRIER); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); return {staging.buffer, staging.offset}; } @@ -391,11 +392,13 @@ std::pair QuadIndexedPass::Assemble( scheduler.Record([this, descriptor_data, num_tri_vertices, base_vertex, index_shift, is_strip](vk::CommandBuffer cmdbuf) { static constexpr u32 DISPATCH_SIZE = 1024; - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_INDEX_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT, + .dstAccessMask = VK_ACCESS_2_INDEX_READ_BIT, }; const std::array push_constants{base_vertex, index_shift, is_strip ? 1u : 0u}; const VkDescriptorSet set = descriptor_allocator.Commit(); @@ -405,8 +408,7 @@ std::pair QuadIndexedPass::Assemble( cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(push_constants), &push_constants); cmdbuf.Dispatch(Common::DivCeil(num_tri_vertices, DISPATCH_SIZE), 1, 1); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, 0, WRITE_BARRIER); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); return {staging.buffer, staging.offset}; } @@ -441,11 +443,13 @@ std::pair IndirectQuadsPass::Assemble(u32 num_draws, u32 scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([this, descriptor_data, num_draws, src_stride](vk::CommandBuffer cmdbuf) { static constexpr u32 DISPATCH_SIZE = 32; - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_INDIRECT_COMMAND_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT, + .dstAccessMask = VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT, }; const std::array push_constants{num_draws, src_stride}; const VkDescriptorSet set = descriptor_allocator.Commit(); @@ -455,8 +459,7 @@ std::pair IndirectQuadsPass::Assemble(u32 num_draws, u32 cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(push_constants), &push_constants); cmdbuf.Dispatch(Common::DivCeil(num_draws, DISPATCH_SIZE), 1, 1); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, 0, WRITE_BARRIER); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); return {staging.buffer, staging.offset}; } @@ -484,17 +487,21 @@ void ConditionalRenderingResolvePass::Resolve(VkBuffer dst_buffer, VkBuffer src_ scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([this, descriptor_data, compare_to_zero](vk::CommandBuffer cmdbuf) { - static constexpr VkMemoryBarrier read_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 read_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT | VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT, }; - static constexpr VkMemoryBarrier write_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 write_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT, + .dstAccessMask = VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT, }; const ConditionalRenderingResolvePushConstants uniforms{ .compare_to_zero = compare_to_zero ? 1U : 0U, @@ -502,15 +509,12 @@ void ConditionalRenderingResolvePass::Resolve(VkBuffer dst_buffer, VkBuffer src_ const VkDescriptorSet set = descriptor_allocator.Commit(); device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, read_barrier); + cmdbuf.PipelineBarrier(read_barrier); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, uniforms); cmdbuf.Dispatch(1, 1, 1); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT, 0, - write_barrier); + cmdbuf.PipelineBarrier(write_barrier); }); } @@ -532,14 +536,14 @@ QueriesPrefixScanPass::QueriesPrefixScanPass( void QueriesPrefixScanPass::Run(VkBuffer accumulation_buffer, VkBuffer dst_buffer, VkBuffer src_buffer, size_t number_of_sums, size_t min_accumulation_limit, size_t max_accumulation_limit) { - constexpr VkAccessFlags BASE_DST_ACCESS = VK_ACCESS_SHADER_READ_BIT | - VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | - VK_ACCESS_INDIRECT_COMMAND_READ_BIT | - VK_ACCESS_INDEX_READ_BIT | - VK_ACCESS_UNIFORM_READ_BIT; - const VkAccessFlags conditional_access = - device.IsExtConditionalRendering() ? VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT : 0; + constexpr VkAccessFlags2 BASE_DST_ACCESS = VK_ACCESS_2_SHADER_READ_BIT | + VK_ACCESS_2_TRANSFER_READ_BIT | + VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT | + VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT | + VK_ACCESS_2_INDEX_READ_BIT | + VK_ACCESS_2_UNIFORM_READ_BIT; + const VkAccessFlags2 conditional_access = + device.IsExtConditionalRendering() ? VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT : 0; size_t current_runs = number_of_sums; size_t offset = 0; while (current_runs != 0) { @@ -557,16 +561,20 @@ void QueriesPrefixScanPass::Run(VkBuffer accumulation_buffer, VkBuffer dst_buffe scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([this, descriptor_data, min_accumulation_limit, max_accumulation_limit, runs_to_do, used_offset, conditional_access](vk::CommandBuffer cmdbuf) { - static constexpr VkMemoryBarrier read_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 read_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT, }; - const VkMemoryBarrier write_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + const VkMemoryBarrier2 write_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, .dstAccessMask = BASE_DST_ACCESS | conditional_access, }; const QueriesPrefixScanPushConstants uniforms{ @@ -578,14 +586,12 @@ void QueriesPrefixScanPass::Run(VkBuffer accumulation_buffer, VkBuffer dst_buffe const VkDescriptorSet set = descriptor_allocator.Commit(); device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, read_barrier); + cmdbuf.PipelineBarrier(read_barrier); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); cmdbuf.PushConstants(*layout, VK_SHADER_STAGE_COMPUTE_BIT, uniforms); cmdbuf.Dispatch(1, 1, 1); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, 0, write_barrier); + cmdbuf.PipelineBarrier(write_barrier); }); } } @@ -594,21 +600,23 @@ namespace { void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, VkImage vk_image, VkImageAspectFlags aspect_mask, bool is_initialized) { - VkAccessFlags src_access = VK_ACCESS_NONE; + VkAccessFlags2 src_access = VK_ACCESS_2_NONE; VkImageLayout old_layout = VK_IMAGE_LAYOUT_UNDEFINED; - VkPipelineStageFlags src_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + VkPipelineStageFlags2 src_stage = VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT; if (is_initialized) { - src_access = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT; + src_access = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT; old_layout = VK_IMAGE_LAYOUT_GENERAL; src_stage = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER; } scheduler.Record([vk_pipeline, vk_image, aspect_mask, src_access, old_layout, src_stage](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier image_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 image_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = src_stage, .srcAccessMask = src_access, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT, .oldLayout = old_layout, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -622,7 +630,7 @@ void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, V .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - cmdbuf.PipelineBarrier(src_stage, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, image_barrier); + cmdbuf.PipelineBarrier(image_barrier); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, vk_pipeline); }); } @@ -630,12 +638,14 @@ void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, V void RecordUnswizzleEndBarrier(Scheduler& scheduler, VkImage vk_image, VkImageAspectFlags aspect_mask) { scheduler.Record([vk_image, aspect_mask](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier image_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 image_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | + VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -649,8 +659,7 @@ void RecordUnswizzleEndBarrier(Scheduler& scheduler, VkImage vk_image, .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, 0, image_barrier); + cmdbuf.PipelineBarrier(image_barrier); }); } diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.h b/src/video_core/renderer_vulkan/vk_descriptor_pool.h index 6a80f8e107..a524c2a043 100644 --- a/src/video_core/renderer_vulkan/vk_descriptor_pool.h +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.h @@ -65,7 +65,8 @@ private: class DescriptorPool { public: - DescriptorPool(); + +DescriptorPool(); ~DescriptorPool(); DescriptorPool& operator=(const DescriptorPool&) = delete; diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp index 9ca215b425..e52e079969 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp @@ -121,8 +121,9 @@ VkResult MasterSemaphore::SubmitQueue(vk::CommandBuffer& cmdbuf, vk::CommandBuff } } -static constexpr VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; +static constexpr VkPipelineStageFlags2 wait_stage_mask = + VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT; VkResult MasterSemaphore::SubmitQueueTimeline(vk::CommandBuffer& cmdbuf, vk::CommandBuffer& upload_cmdbuf, @@ -130,130 +131,35 @@ VkResult MasterSemaphore::SubmitQueueTimeline(vk::CommandBuffer& cmdbuf, VkSemaphore wait_semaphore, u64 host_tick) { const VkSemaphore timeline_semaphore = *semaphore; - if (device.HasSynchronization2()) { - const std::array cmdbuffer_infos{{ - { - .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, - .pNext = nullptr, - .commandBuffer = *upload_cmdbuf, - .deviceMask = 0, - }, - { - .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, - .pNext = nullptr, - .commandBuffer = *cmdbuf, - .deviceMask = 0, - }, - }}; + const std::array cmdbuffer_infos{{ + { + .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, + .pNext = nullptr, + .commandBuffer = *upload_cmdbuf, + .deviceMask = 0, + }, + { + .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, + .pNext = nullptr, + .commandBuffer = *cmdbuf, + .deviceMask = 0, + }, + }}; - std::array signal_infos{{ - { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, - .pNext = nullptr, - .semaphore = timeline_semaphore, - .value = host_tick, - .stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, - .deviceIndex = 0, - }, - {}, - }}; - u32 num_signal_semaphores = 1; - if (signal_semaphore) { - signal_infos[1] = VkSemaphoreSubmitInfo{ - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, - .pNext = nullptr, - .semaphore = signal_semaphore, - .value = 0, - .stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, - .deviceIndex = 0, - }; - num_signal_semaphores = 2; - } - - const u32 num_wait_semaphores = wait_semaphore ? 1 : 0; - const VkSemaphoreSubmitInfo wait_info{ + std::array signal_infos{{ + { .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, .pNext = nullptr, - .semaphore = wait_semaphore, - .value = 0, - .stageMask = static_cast(wait_stage_mask), + .semaphore = timeline_semaphore, + .value = host_tick, + .stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, .deviceIndex = 0, - }; - - const VkSubmitInfo2 submit_info2{ - .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, - .pNext = nullptr, - .flags = 0, - .waitSemaphoreInfoCount = num_wait_semaphores, - .pWaitSemaphoreInfos = num_wait_semaphores ? &wait_info : nullptr, - .commandBufferInfoCount = static_cast(cmdbuffer_infos.size()), - .pCommandBufferInfos = cmdbuffer_infos.data(), - .signalSemaphoreInfoCount = num_signal_semaphores, - .pSignalSemaphoreInfos = signal_infos.data(), - }; - return device.GetGraphicsQueue().Submit2(submit_info2); - } - - const u32 num_signal_semaphores = signal_semaphore ? 2 : 1; - const std::array signal_values{host_tick, u64(0)}; - const std::array signal_semaphores{timeline_semaphore, signal_semaphore}; - - const std::array cmdbuffers{*upload_cmdbuf, *cmdbuf}; - - const u32 num_wait_semaphores = wait_semaphore ? 1 : 0; - // Pointers must be null when the count is zero (best-practices) - const VkSemaphore* p_wait_sems = - (num_wait_semaphores > 0) ? &wait_semaphore : nullptr; - const VkPipelineStageFlags* p_wait_masks = - (num_wait_semaphores > 0) ? &wait_stage_mask : nullptr; - const VkSemaphore* p_signal_sems = - (num_signal_semaphores > 0) ? signal_semaphores.data() : nullptr; - const u64 wait_zero = 0; // dummy for binary wait - const VkTimelineSemaphoreSubmitInfo timeline_si{ - .sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO, - .pNext = nullptr, - .waitSemaphoreValueCount = num_wait_semaphores, - .pWaitSemaphoreValues = num_wait_semaphores ? &wait_zero : nullptr, - .signalSemaphoreValueCount = num_signal_semaphores, - .pSignalSemaphoreValues = signal_values.data(), - }; - const VkSubmitInfo submit_info{ - .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, - .pNext = &timeline_si, - .waitSemaphoreCount = num_wait_semaphores, - .pWaitSemaphores = p_wait_sems, - .pWaitDstStageMask = p_wait_masks, - .commandBufferCount = static_cast(cmdbuffers.size()), - .pCommandBuffers = cmdbuffers.data(), - .signalSemaphoreCount = num_signal_semaphores, - .pSignalSemaphores = p_signal_sems, - }; - - return device.GetGraphicsQueue().Submit(submit_info); -} - -VkResult MasterSemaphore::SubmitQueueFence(vk::CommandBuffer& cmdbuf, - vk::CommandBuffer& upload_cmdbuf, - VkSemaphore signal_semaphore, VkSemaphore wait_semaphore, - u64 host_tick) { - if (device.HasSynchronization2()) { - const std::array cmdbuffer_infos{{ - { - .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, - .pNext = nullptr, - .commandBuffer = *upload_cmdbuf, - .deviceMask = 0, - }, - { - .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, - .pNext = nullptr, - .commandBuffer = *cmdbuf, - .deviceMask = 0, - }, - }}; - - const u32 num_signal_semaphores = signal_semaphore ? 1 : 0; - const VkSemaphoreSubmitInfo signal_info{ + }, + {}, + }}; + u32 num_signal_semaphores = 1; + if (signal_semaphore) { + signal_infos[1] = VkSemaphoreSubmitInfo{ .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, .pNext = nullptr, .semaphore = signal_semaphore, @@ -261,66 +167,86 @@ VkResult MasterSemaphore::SubmitQueueFence(vk::CommandBuffer& cmdbuf, .stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, .deviceIndex = 0, }; - - const u32 num_wait_semaphores = wait_semaphore ? 1 : 0; - const VkSemaphoreSubmitInfo wait_info{ - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, - .pNext = nullptr, - .semaphore = wait_semaphore, - .value = 0, - .stageMask = static_cast(wait_stage_mask), - .deviceIndex = 0, - }; - - const VkSubmitInfo2 submit_info2{ - .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, - .pNext = nullptr, - .flags = 0, - .waitSemaphoreInfoCount = num_wait_semaphores, - .pWaitSemaphoreInfos = num_wait_semaphores ? &wait_info : nullptr, - .commandBufferInfoCount = static_cast(cmdbuffer_infos.size()), - .pCommandBufferInfos = cmdbuffer_infos.data(), - .signalSemaphoreInfoCount = num_signal_semaphores, - .pSignalSemaphoreInfos = num_signal_semaphores ? &signal_info : nullptr, - }; - - auto fence = GetFreeFence(); - auto result = device.GetGraphicsQueue().Submit2(submit_info2, *fence); - - if (result == VK_SUCCESS) { - std::scoped_lock lock{wait_mutex}; - wait_queue.emplace(host_tick, std::move(fence)); - wait_cv.notify_one(); - } - - return result; + num_signal_semaphores = 2; } - const u32 num_signal_semaphores = signal_semaphore ? 1 : 0; const u32 num_wait_semaphores = wait_semaphore ? 1 : 0; - - const VkSemaphore* p_wait_sems = - (num_wait_semaphores > 0) ? &wait_semaphore : nullptr; - const VkPipelineStageFlags* p_wait_masks = - (num_wait_semaphores > 0) ? &wait_stage_mask : nullptr; - const VkSemaphore* p_signal_sems = - (num_signal_semaphores > 0) ? &signal_semaphore : nullptr; - const std::array cmdbuffers{*upload_cmdbuf, *cmdbuf}; - - const VkSubmitInfo submit_info{ - .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, + const VkSemaphoreSubmitInfo wait_info{ + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, .pNext = nullptr, - .waitSemaphoreCount = num_wait_semaphores, - .pWaitSemaphores = p_wait_sems, - .pWaitDstStageMask = p_wait_masks, - .commandBufferCount = static_cast(cmdbuffers.size()), - .pCommandBuffers = cmdbuffers.data(), - .signalSemaphoreCount = num_signal_semaphores, - .pSignalSemaphores = p_signal_sems, + .semaphore = wait_semaphore, + .value = 0, + .stageMask = wait_stage_mask, + .deviceIndex = 0, + }; + + const VkSubmitInfo2 submit_info2{ + .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, + .pNext = nullptr, + .flags = 0, + .waitSemaphoreInfoCount = num_wait_semaphores, + .pWaitSemaphoreInfos = num_wait_semaphores ? &wait_info : nullptr, + .commandBufferInfoCount = static_cast(cmdbuffer_infos.size()), + .pCommandBufferInfos = cmdbuffer_infos.data(), + .signalSemaphoreInfoCount = num_signal_semaphores, + .pSignalSemaphoreInfos = signal_infos.data(), + }; + return device.GetGraphicsQueue().Submit(submit_info2); +} + +VkResult MasterSemaphore::SubmitQueueFence(vk::CommandBuffer& cmdbuf, + vk::CommandBuffer& upload_cmdbuf, + VkSemaphore signal_semaphore, VkSemaphore wait_semaphore, + u64 host_tick) { + const std::array cmdbuffer_infos{{ + { + .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, + .pNext = nullptr, + .commandBuffer = *upload_cmdbuf, + .deviceMask = 0, + }, + { + .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, + .pNext = nullptr, + .commandBuffer = *cmdbuf, + .deviceMask = 0, + }, + }}; + + const u32 num_signal_semaphores = signal_semaphore ? 1 : 0; + const VkSemaphoreSubmitInfo signal_info{ + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, + .pNext = nullptr, + .semaphore = signal_semaphore, + .value = 0, + .stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, + .deviceIndex = 0, + }; + + const u32 num_wait_semaphores = wait_semaphore ? 1 : 0; + const VkSemaphoreSubmitInfo wait_info{ + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, + .pNext = nullptr, + .semaphore = wait_semaphore, + .value = 0, + .stageMask = wait_stage_mask, + .deviceIndex = 0, + }; + + const VkSubmitInfo2 submit_info2{ + .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, + .pNext = nullptr, + .flags = 0, + .waitSemaphoreInfoCount = num_wait_semaphores, + .pWaitSemaphoreInfos = num_wait_semaphores ? &wait_info : nullptr, + .commandBufferInfoCount = static_cast(cmdbuffer_infos.size()), + .pCommandBufferInfos = cmdbuffer_infos.data(), + .signalSemaphoreInfoCount = num_signal_semaphores, + .pSignalSemaphoreInfos = num_signal_semaphores ? &signal_info : nullptr, }; auto fence = GetFreeFence(); - auto result = device.GetGraphicsQueue().Submit(submit_info, *fence); + auto result = device.GetGraphicsQueue().Submit(submit_info2, *fence); if (result == VK_SUCCESS) { std::scoped_lock lock{wait_mutex}; diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index 9298764546..4db267f724 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -378,18 +378,24 @@ void PresentManager::SetImageCount() { } void PresentManager::DiscardFrame(Frame* frame) { - static constexpr VkPipelineStageFlags wait_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - const VkSemaphore render_ready = *frame->render_ready; - const VkSubmitInfo submit_info{ - .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, + const VkSemaphoreSubmitInfo wait_info{ + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, .pNext = nullptr, - .waitSemaphoreCount = 1U, - .pWaitSemaphores = &render_ready, - .pWaitDstStageMask = &wait_stage, - .commandBufferCount = 0U, - .pCommandBuffers = nullptr, - .signalSemaphoreCount = 0U, - .pSignalSemaphores = nullptr, + .semaphore = *frame->render_ready, + .value = 0, + .stageMask = VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT, + .deviceIndex = 0, + }; + const VkSubmitInfo2 submit_info{ + .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, + .pNext = nullptr, + .flags = 0, + .waitSemaphoreInfoCount = 1U, + .pWaitSemaphoreInfos = &wait_info, + .commandBufferInfoCount = 0U, + .pCommandBufferInfos = nullptr, + .signalSemaphoreInfoCount = 0U, + .pSignalSemaphoreInfos = nullptr, }; std::scoped_lock submit_lock{scheduler.submit_mutex}; @@ -449,11 +455,13 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { const VkImage image{swapchain.CurrentImage()}; const VkExtent2D extent = swapchain.GetExtent(); const std::array pre_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_NONE, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -467,11 +475,13 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -487,11 +497,13 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { }, }; const std::array post_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -505,11 +517,13 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_READ_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT, + .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -525,8 +539,7 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { }, }; - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, {}, - {}, {}, pre_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, pre_barriers); if (blit_supported) { cmdbuf.BlitImage(*frame->image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, image, @@ -539,30 +552,55 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { MakeImageCopy(frame->width, frame->height, extent.width, extent.height)); } - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, {}, - {}, {}, post_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, post_barriers); cmdbuf.End(); const VkSemaphore present_semaphore = swapchain.CurrentPresentSemaphore(); const VkSemaphore render_semaphore = swapchain.CurrentRenderSemaphore(); - const std::array wait_semaphores = {present_semaphore, *frame->render_ready}; - - static constexpr std::array wait_stage_masks{ - VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, + const std::array wait_infos{{ + { + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, + .pNext = nullptr, + .semaphore = present_semaphore, + .value = 0, + .stageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .deviceIndex = 0, + }, + { + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, + .pNext = nullptr, + .semaphore = *frame->render_ready, + .value = 0, + .stageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .deviceIndex = 0, + }, + }}; + const VkCommandBufferSubmitInfo cmdbuf_info{ + .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, + .pNext = nullptr, + .commandBuffer = *cmdbuf, + .deviceMask = 0, + }; + const VkSemaphoreSubmitInfo signal_info{ + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, + .pNext = nullptr, + .semaphore = render_semaphore, + .value = 0, + .stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, + .deviceIndex = 0, }; - const VkSubmitInfo submit_info{ - .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, + const VkSubmitInfo2 submit_info{ + .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, .pNext = nullptr, - .waitSemaphoreCount = 2U, - .pWaitSemaphores = wait_semaphores.data(), - .pWaitDstStageMask = wait_stage_masks.data(), - .commandBufferCount = 1, - .pCommandBuffers = cmdbuf.address(), - .signalSemaphoreCount = 1U, - .pSignalSemaphores = &render_semaphore, + .flags = 0, + .waitSemaphoreInfoCount = 2U, + .pWaitSemaphoreInfos = wait_infos.data(), + .commandBufferInfoCount = 1U, + .pCommandBufferInfos = &cmdbuf_info, + .signalSemaphoreInfoCount = 1U, + .pSignalSemaphoreInfos = &signal_info, }; // Submit the image copy/blit to the swapchain diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 2b5aa24053..7bdb5738c8 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -260,11 +260,13 @@ public: scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([start, amount, base_offset, query_pool, buffer = *resolve_buffer](vk::CommandBuffer cmdbuf) { - const VkBufferMemoryBarrier copy_query_pool_barrier{ - .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, + const VkBufferMemoryBarrier2 copy_query_pool_barrier{ + .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .buffer = buffer, @@ -276,8 +278,7 @@ public: query_pool, static_cast(start), static_cast(amount), buffer, static_cast(base_offset), SamplesQueryBank::QUERY_SIZE, VK_QUERY_RESULT_WAIT_BIT | VK_QUERY_RESULT_64_BIT); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, 0, copy_query_pool_barrier); + cmdbuf.PipelineBarrier(copy_query_pool_barrier); }); offsets[bank_id] = {start, base_offset}; base_offset += amount * SamplesQueryBank::QUERY_SIZE; @@ -862,16 +863,17 @@ public: offset_base += TFBQueryBank::QUERY_SIZE; bank.CloseReference(); } - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_HOST, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - vk::PIPELINE_STAGE_HOST, 0, WRITE_BARRIER); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); std::scoped_lock lk(flush_guard); @@ -928,16 +930,16 @@ private: }); return; } - static constexpr VkMemoryBarrier COUNTER_RESUME_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 COUNTER_RESUME_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT, - .dstAccessMask = VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT, + .srcAccessMask = VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT, + .dstAccessMask = VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT, }; scheduler.Record([this, total = static_cast(buffers_count)](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT, - VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT, 0, - COUNTER_RESUME_BARRIER); + cmdbuf.PipelineBarrier(COUNTER_RESUME_BARRIER); cmdbuf.BeginTransformFeedbackEXT(0, total, counter_buffers.data(), offsets.data()); }); } @@ -1024,33 +1026,35 @@ private: const size_t slot = other; // workaround to compile bug. current_bank->AddReference(); - static constexpr VkMemoryBarrier READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT, + .srcAccessMask = VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, }; - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT, }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([dst_buffer = current_bank->GetBuffer(), src_buffer = counter_buffers[slot_index], src_offset = offsets[slot_index], slot](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT, - VK_PIPELINE_STAGE_TRANSFER_BIT, 0, READ_BARRIER); + cmdbuf.PipelineBarrier(READ_BARRIER); std::array copy{VkBufferCopy{ .srcOffset = src_offset, .dstOffset = slot * TFBQueryBank::QUERY_SIZE, .size = TFBQueryBank::QUERY_SIZE, }}; cmdbuf.CopyBuffer(src_buffer, dst_buffer, copy); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, WRITE_BARRIER); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); return {current_bank_id, slot}; } @@ -1573,28 +1577,30 @@ VideoCommon::StreamerInterface* QueryCacheRuntime::GetStreamerInterface(QueryTyp } void QueryCacheRuntime::Barriers(bool is_prebarrier) { - static constexpr VkMemoryBarrier READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, }; - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER_HOST, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; impl->scheduler.RequestOutsideRenderPassOperationContext(); if (is_prebarrier) { impl->scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - VK_PIPELINE_STAGE_TRANSFER_BIT, 0, READ_BARRIER); + cmdbuf.PipelineBarrier(READ_BARRIER); }); } else { impl->scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER_HOST, 0, WRITE_BARRIER); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); } } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index aa36aa9093..52227ab290 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -649,14 +649,15 @@ void RasterizerVulkan::DispatchCompute() { return; } scheduler.RequestOutsideRenderPassOperationContext(); - static constexpr VkMemoryBarrier READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT, }; - scheduler.Record([](vk::CommandBuffer cmdbuf) { cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - 0, READ_BARRIER); }); + scheduler.Record([](vk::CommandBuffer cmdbuf) { cmdbuf.PipelineBarrier(READ_BARRIER); }); scheduler.Record([pipeline, dim](vk::CommandBuffer cmdbuf) { if (!pipeline->IsBound()) { return; @@ -882,22 +883,42 @@ void RasterizerVulkan::FlushAndInvalidateRegion(DAddr addr, u64 size, void RasterizerVulkan::WaitForIdle() { // Everything but wait pixel operations. This intentionally includes FRAGMENT_SHADER_BIT because // fragment shaders can still write storage buffers. - VkPipelineStageFlags flags = - VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT | - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT | - VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | - VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT; + VkPipelineStageFlags2 flags = + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT | + VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT | + VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT | + VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT | + VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT | VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT; if (device.IsExtTransformFeedbackSupported()) { - flags |= VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT; + flags |= VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT; } query_cache.NotifyWFI(); scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([event = *wfi_event, flags](vk::CommandBuffer cmdbuf) { - cmdbuf.SetEvent(event, flags); - cmdbuf.WaitEvents(event, flags, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, {}, {}, {}); + const VkMemoryBarrier2 barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = flags, + .srcAccessMask = VK_ACCESS_2_NONE, + .dstStageMask = VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT, + .dstAccessMask = VK_ACCESS_2_NONE, + }; + const VkDependencyInfo dependency_info{ + .sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, + .pNext = nullptr, + .dependencyFlags = 0, + .memoryBarrierCount = 1, + .pMemoryBarriers = &barrier, + .bufferMemoryBarrierCount = 0, + .pBufferMemoryBarriers = nullptr, + .imageMemoryBarrierCount = 0, + .pImageMemoryBarriers = nullptr, + }; + cmdbuf.SetEvent(event, dependency_info); + cmdbuf.WaitEvents(event, dependency_info); }); fence_manager.SignalOrdering(); } diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp index 4d8fa15d16..d9aa7698f7 100644 --- a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp @@ -43,10 +43,10 @@ using VideoCore::Surface::SurfaceType; } } - VkAttachmentDescription AttachmentDescription(const Device& device, PixelFormat format, - VkSampleCountFlagBits samples, - VkAttachmentLoadOp load_op, - VkAttachmentStoreOp store_op) { + VkAttachmentDescription2 AttachmentDescription(const Device& device, PixelFormat format, + VkSampleCountFlagBits samples, + VkAttachmentLoadOp load_op, + VkAttachmentStoreOp store_op) { using MaxwellToVK::SurfaceFormat; const SurfaceType surface_type = GetSurfaceType(format); @@ -54,6 +54,8 @@ using VideoCore::Surface::SurfaceType; surface_type == SurfaceType::Stencil; return { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, + .pNext = nullptr, .flags = {}, .format = SurfaceFormat(device, FormatType::Optimal, true, format).format, .samples = samples, @@ -141,16 +143,19 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { } static constexpr size_t MAX_ATTACHMENTS = 2 * std::tuple_size_v + 2; - boost::container::static_vector descriptions; - std::array references{}; + boost::container::static_vector descriptions; + std::array references{}; u32 num_attachments{}; u32 num_colors{}; for (size_t index = 0; index < key.color_formats.size(); ++index) { const PixelFormat format{key.color_formats[index]}; const bool is_valid{format != PixelFormat::Invalid}; - references[index] = VkAttachmentReference{ + references[index] = VkAttachmentReference2{ + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, + .pNext = nullptr, .attachment = is_valid ? num_colors : VK_ATTACHMENT_UNUSED, .layout = VK_IMAGE_LAYOUT_GENERAL, + .aspectMask = 0, }; if (is_valid) { const VkAttachmentLoadOp load_op = (key.color_clear_mask & (1u << index)) != 0 @@ -166,11 +171,14 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { } } const bool has_depth{key.depth_format != PixelFormat::Invalid}; - VkAttachmentReference depth_reference{}; - if (key.depth_format != PixelFormat::Invalid) { - depth_reference = VkAttachmentReference{ + VkAttachmentReference2 depth_reference{}; + if (has_depth) { + depth_reference = VkAttachmentReference2{ + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, + .pNext = nullptr, .attachment = num_colors, .layout = VK_IMAGE_LAYOUT_GENERAL, + .aspectMask = 0, }; const VkAttachmentLoadOp depth_load_op = key.depth_stencil_clear ? VK_ATTACHMENT_LOAD_OP_CLEAR @@ -181,19 +189,23 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { descriptions.push_back(AttachmentDescription(*device, key.depth_format, key.samples, depth_load_op, depth_store_op)); } - std::array resolve_references{}; + std::array resolve_references{}; const bool do_resolve_color = key.resolve_color && key.samples != VK_SAMPLE_COUNT_1_BIT && num_colors > 0; if (do_resolve_color) { for (size_t index = 0; index < key.color_formats.size(); ++index) { const PixelFormat format{key.color_formats[index]}; const bool is_valid{format != PixelFormat::Invalid}; - resolve_references[index] = VkAttachmentReference{ - .attachment = is_valid ? static_cast(descriptions.size()) : VK_ATTACHMENT_UNUSED, + resolve_references[index] = VkAttachmentReference2{ + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, + .pNext = nullptr, + .attachment = is_valid ? static_cast(descriptions.size()) + : VK_ATTACHMENT_UNUSED, .layout = VK_IMAGE_LAYOUT_GENERAL, + .aspectMask = 0, }; if (is_valid) { - VkAttachmentDescription resolve_desc = + VkAttachmentDescription2 resolve_desc = AttachmentDescription(*device, format, VK_SAMPLE_COUNT_1_BIT, VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_STORE_OP_STORE); @@ -205,21 +217,35 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { const bool do_resolve_depth_stencil = key.resolve_depth_stencil && has_depth && key.samples != VK_SAMPLE_COUNT_1_BIT && SupportsDepthStencilResolve(*device, key.depth_format); - VkAttachmentReference depth_resolve_reference{}; + VkAttachmentReference2 depth_resolve_reference{}; if (do_resolve_depth_stencil) { - depth_resolve_reference = VkAttachmentReference{ + depth_resolve_reference = VkAttachmentReference2{ + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, + .pNext = nullptr, .attachment = static_cast(descriptions.size()), .layout = VK_IMAGE_LAYOUT_GENERAL, + .aspectMask = 0, }; - VkAttachmentDescription resolve_desc = + VkAttachmentDescription2 resolve_desc = AttachmentDescription(*device, key.depth_format, VK_SAMPLE_COUNT_1_BIT, VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_STORE_OP_STORE); resolve_desc.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; descriptions.push_back(resolve_desc); } - const VkSubpassDescription subpass{ + const ResolveModes resolve_modes = PickResolveModes(*device, key.depth_format); + const VkSubpassDescriptionDepthStencilResolve depth_stencil_resolve{ + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE, + .pNext = nullptr, + .depthResolveMode = resolve_modes.depth, + .stencilResolveMode = resolve_modes.stencil, + .pDepthStencilResolveAttachment = &depth_resolve_reference, + }; + const VkSubpassDescription2 subpass{ + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, + .pNext = do_resolve_depth_stencil ? &depth_stencil_resolve : nullptr, .flags = 0, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, + .viewMask = 0, .inputAttachmentCount = 0, .pInputAttachments = nullptr, .colorAttachmentCount = num_attachments, @@ -229,106 +255,31 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .preserveAttachmentCount = 0, .pPreserveAttachments = nullptr, }; - const VkSubpassDependency dependency{ - .srcSubpass = 0, // Current subpass - .dstSubpass = 0, // Same subpass (self-dependency) - .srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, - .dstStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, - .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT, - .dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT + const VkMemoryBarrier2 dependency_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT, + .srcAccessMask = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT, }; - - if (device->IsKhrCreateRenderPass2Supported()) { - boost::container::static_vector descriptions2; - for (const VkAttachmentDescription& description : descriptions) { - descriptions2.push_back(VkAttachmentDescription2{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, - .pNext = nullptr, - .flags = description.flags, - .format = description.format, - .samples = description.samples, - .loadOp = description.loadOp, - .storeOp = description.storeOp, - .stencilLoadOp = description.stencilLoadOp, - .stencilStoreOp = description.stencilStoreOp, - .initialLayout = description.initialLayout, - .finalLayout = description.finalLayout, - }); - } - const auto promote = [](const VkAttachmentReference& reference) { - return VkAttachmentReference2{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - .pNext = nullptr, - .attachment = reference.attachment, - .layout = reference.layout, - .aspectMask = 0, - }; - }; - std::array references2{}; - std::array resolve_references2{}; - for (size_t index = 0; index < references.size(); ++index) { - references2[index] = promote(references[index]); - resolve_references2[index] = promote(resolve_references[index]); - } - const VkAttachmentReference2 depth_reference2 = promote(depth_reference); - const VkAttachmentReference2 depth_resolve_reference2 = promote(depth_resolve_reference); - const ResolveModes resolve_modes = PickResolveModes(*device, key.depth_format); - const VkSubpassDescriptionDepthStencilResolve depth_stencil_resolve{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE, - .pNext = nullptr, - .depthResolveMode = resolve_modes.depth, - .stencilResolveMode = resolve_modes.stencil, - .pDepthStencilResolveAttachment = &depth_resolve_reference2, - }; - const VkSubpassDescription2 subpass2{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, - .pNext = do_resolve_depth_stencil ? &depth_stencil_resolve : nullptr, - .flags = 0, - .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, - .viewMask = 0, - .inputAttachmentCount = 0, - .pInputAttachments = nullptr, - .colorAttachmentCount = num_attachments, - .pColorAttachments = references2.data(), - .pResolveAttachments = do_resolve_color ? resolve_references2.data() : nullptr, - .pDepthStencilAttachment = has_depth ? &depth_reference2 : nullptr, - .preserveAttachmentCount = 0, - .pPreserveAttachments = nullptr, - }; - const VkSubpassDependency2 dependency2{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, - .pNext = nullptr, - .srcSubpass = dependency.srcSubpass, - .dstSubpass = dependency.dstSubpass, - .srcStageMask = dependency.srcStageMask, - .dstStageMask = dependency.dstStageMask, - .srcAccessMask = dependency.srcAccessMask, - .dstAccessMask = dependency.dstAccessMask, - .dependencyFlags = dependency.dependencyFlags, - .viewOffset = 0, - }; - pair->second = device->GetLogical().CreateRenderPass2({ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, - .pNext = nullptr, - .flags = 0, - .attachmentCount = static_cast(descriptions2.size()), - .pAttachments = descriptions2.empty() ? nullptr : descriptions2.data(), - .subpassCount = 1, - .pSubpasses = &subpass2, - .dependencyCount = 1, - .pDependencies = &dependency2, - .correlatedViewMaskCount = 0, - .pCorrelatedViewMasks = nullptr, - }); - return *pair->second; - } - - pair->second = device->GetLogical().CreateRenderPass({ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + const VkSubpassDependency2 dependency{ + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, + .pNext = &dependency_barrier, + .srcSubpass = 0, + .dstSubpass = 0, + .srcStageMask = 0, + .dstStageMask = 0, + .srcAccessMask = 0, + .dstAccessMask = 0, + .dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT, + .viewOffset = 0, + }; + pair->second = device->GetLogical().CreateRenderPass2({ + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .pNext = nullptr, .flags = 0, .attachmentCount = static_cast(descriptions.size()), @@ -337,6 +288,8 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .pSubpasses = &subpass, .dependencyCount = 1, .pDependencies = &dependency, + .correlatedViewMaskCount = 0, + .pCorrelatedViewMasks = nullptr, }); return *pair->second; } diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 74379e8063..5c07c99828 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -343,13 +343,15 @@ u64 Scheduler::SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_se const u64 signal_value = master_semaphore->NextTick(); RecordWithUploadBuffer([signal_semaphore, wait_semaphore, signal_value, this](vk::CommandBuffer cmdbuf, vk::CommandBuffer upload_cmdbuf) { - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; - upload_cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, WRITE_BARRIER); + upload_cmdbuf.PipelineBarrier(WRITE_BARRIER); upload_cmdbuf.End(); cmdbuf.End(); @@ -365,7 +367,7 @@ u64 Scheduler::SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_se if (GPU::Logging::IsActive() && Settings::values.gpu_log_vulkan_calls.GetValue()) { GPU::Logging::GPULogger::GetInstance().LogVulkanCall( - "vkQueueSubmit", "", VK_SUCCESS); + "vkQueueSubmit2", "", VK_SUCCESS); } break; case VK_ERROR_DEVICE_LOST: @@ -416,7 +418,7 @@ void Scheduler::EndRenderPass() ranges = renderpass_image_ranges, has_transform_feedback = device.IsExtTransformFeedbackSupported()]( vk::CommandBuffer cmdbuf) { - std::array barriers; + std::array barriers; for (size_t i = 0; i < num_images; ++i) { const VkImageSubresourceRange& range = ranges[i]; const bool is_color = (range.aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) != 0; @@ -424,25 +426,29 @@ void Scheduler::EndRenderPass() & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) !=0; - VkAccessFlags src_access = 0; + VkAccessFlags2 src_access = 0; if (is_color) - src_access |= VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; + src_access |= VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT; else if (is_depth_stencil) - src_access |= VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + src_access |= VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; else - src_access |= VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT - | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + src_access |= VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT + | VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - barriers[i] = VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + barriers[i] = VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT + | VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT + | VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, .srcAccessMask = src_access, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT - | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT - | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT - | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT - | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT + | VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT + | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT + | VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT + | VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -452,19 +458,19 @@ void Scheduler::EndRenderPass() }; } cmdbuf.EndRenderPass(); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, nullptr, nullptr, vk::Span(barriers.data(), num_images)); + cmdbuf.PipelineBarrier(0, {}, {}, vk::Span(barriers.data(), num_images)); if (has_transform_feedback) { - static constexpr VkMemoryBarrier XFB_OUTPUT_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 XFB_OUTPUT_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT, - .dstAccessMask = VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT, + .srcAccessMask = VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT, + .dstStageMask = VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT + | VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT + | VK_ACCESS_2_TRANSFER_READ_BIT, }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, XFB_OUTPUT_BARRIER); + cmdbuf.PipelineBarrier(XFB_OUTPUT_BARRIER); } }); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 33ab5dd57f..18d38f3761 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -689,12 +689,12 @@ struct RangedBarrierRange { void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage image, VkImageAspectFlags aspect_mask, bool is_initialized, std::span copies) { - static constexpr VkAccessFlags WRITE_ACCESS_FLAGS = - VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - static constexpr VkAccessFlags READ_ACCESS_FLAGS = VK_ACCESS_SHADER_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT; + static constexpr VkAccessFlags2 WRITE_ACCESS_FLAGS = + VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + static constexpr VkAccessFlags2 READ_ACCESS_FLAGS = VK_ACCESS_2_SHADER_READ_BIT | + VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT; // Compute exact mip/layer range being written to RangedBarrierRange range; @@ -703,11 +703,15 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im } const VkImageSubresourceRange subresource_range = range.SubresourceRange(aspect_mask); - const VkImageMemoryBarrier read_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 read_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, .srcAccessMask = WRITE_ACCESS_FLAGS, - .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = is_initialized ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_UNDEFINED, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -716,10 +720,14 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im .subresourceRange = subresource_range, }; - const VkImageMemoryBarrier write_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 write_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, .dstAccessMask = WRITE_ACCESS_FLAGS | READ_ACCESS_FLAGS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -729,18 +737,10 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im .subresourceRange = subresource_range, }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, - read_barrier); + cmdbuf.PipelineBarrier(read_barrier); cmdbuf.CopyBufferToImage(src_buffer, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, copies); // TODO: Move this to another API - cmdbuf.PipelineBarrier( - VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - 0, nullptr, nullptr, write_barrier); + cmdbuf.PipelineBarrier(0, {}, {}, write_barrier); } [[nodiscard]] VkImageBlit MakeImageBlit(const Region2D& dst_region, const Region2D& src_region, @@ -940,11 +940,13 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const .layerCount = VK_REMAINING_ARRAY_LAYERS, }; const std::array read_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -952,13 +954,15 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const .image = src_image, .subresourceRange = subresource_range, }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, // Discard contents .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -968,11 +972,13 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const }, }; const std::array write_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_MEMORY_WRITE_BIT | VK_ACCESS_MEMORY_READ_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT | VK_ACCESS_2_MEMORY_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -980,11 +986,13 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const .image = src_image, .subresourceRange = subresource_range, }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_WRITE_BIT | VK_ACCESS_MEMORY_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT | VK_ACCESS_2_MEMORY_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -993,12 +1001,10 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const .subresourceRange = subresource_range, }, }; - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, nullptr, nullptr, read_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, read_barriers); cmdbuf.BlitImage(src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, regions, vk_filter); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, nullptr, nullptr, write_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, write_barriers); }); } } // Anonymous namespace @@ -1253,26 +1259,32 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, for (const VkBufferImageCopy& copy : vk_out_copies) { dst_range.AddLayers(copy.imageSubresource); } - static constexpr VkMemoryBarrier READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, }; - static constexpr VkMemoryBarrier WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; const std::array pre_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1282,10 +1294,12 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, }, }; const std::array middle_in_barrier{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, .dstAccessMask = 0, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1296,13 +1310,15 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, }, }; const std::array middle_out_barrier{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1312,16 +1328,18 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, }, }; const std::array post_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | + VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1330,19 +1348,15 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, .subresourceRange = dst_range.SubresourceRange(dst_aspect_mask), }, }; - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, {}, {}, pre_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, pre_barriers); cmdbuf.CopyImageToBuffer(src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, copy_buffer, vk_in_copies); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, WRITE_BARRIER, nullptr, middle_in_barrier); + cmdbuf.PipelineBarrier(0, WRITE_BARRIER, {}, middle_in_barrier); - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, READ_BARRIER, {}, middle_out_barrier); + cmdbuf.PipelineBarrier(0, READ_BARRIER, {}, middle_out_barrier); cmdbuf.CopyBufferToImage(copy_buffer, dst_image, VK_IMAGE_LAYOUT_GENERAL, vk_out_copies); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, {}, {}, post_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, post_barriers); }); } @@ -1421,13 +1435,15 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst scheduler.Record([filter, dst_region, src_region, dst_image, src_image, dst_layers, src_layers, aspect_mask, is_resolve](vk::CommandBuffer cmdbuf) { const std::array read_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1441,13 +1457,15 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1462,14 +1480,16 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst }, }, }; - VkImageMemoryBarrier write_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2 write_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1483,8 +1503,7 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, nullptr, nullptr, read_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, read_barriers); if (is_resolve) { cmdbuf.ResolveImage(src_image, VK_IMAGE_LAYOUT_GENERAL, dst_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, @@ -1496,8 +1515,7 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst src_image, VK_IMAGE_LAYOUT_GENERAL, dst_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, MakeImageBlit(dst_region, src_region, dst_layers, src_layers), vk_filter); } - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, write_barrier); + cmdbuf.PipelineBarrier(write_barrier); }); } @@ -1661,13 +1679,18 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, src_range.AddLayers(copy.srcSubresource); } const std::array pre_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1675,13 +1698,18 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, .image = src_image, .subresourceRange = src_range.SubresourceRange(aspect_mask), }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1691,10 +1719,15 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, }, }; const std::array post_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, + .dstStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = 0, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1703,16 +1736,21 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, .image = src_image, .subresourceRange = src_range.SubresourceRange(aspect_mask), }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | + VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1721,18 +1759,10 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, .subresourceRange = dst_range.SubresourceRange(aspect_mask), }, }; - cmdbuf.PipelineBarrier( - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, nullptr, nullptr, pre_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, pre_barriers); cmdbuf.CopyImage(src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VideoCommon::FixSmallVectorADL(vk_copies)); - cmdbuf.PipelineBarrier( - VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, nullptr, nullptr, post_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, post_barriers); }); } @@ -1752,16 +1782,16 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, static_cast(copy.src_subresource.base_layer + copy.src_subresource.num_layers) <= shadow->layers) { const VkImageAspectFlags aspect_mask = shadow->aspect_mask; - VkPipelineStageFlags attachment_stage = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; - VkAccessFlags attachment_write = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; - VkAccessFlags attachment_read_write = - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; + VkPipelineStageFlags2 attachment_stage = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT; + VkAccessFlags2 attachment_write = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT; + VkAccessFlags2 attachment_read_write = + VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT; if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) { - attachment_stage = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT; - attachment_write = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - attachment_read_write = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + attachment_stage = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT; + attachment_write = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + attachment_read_write = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; } const VkImage shadow_image = *shadow->image; const VkImage dst_image = dst.Handle(); @@ -1787,11 +1817,13 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, attachment_write, attachment_read_write](vk::CommandBuffer cmdbuf) { const std::array pre_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = attachment_stage | VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = attachment_write, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1800,12 +1832,14 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS}, }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT | attachment_write | - VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = attachment_stage | VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | attachment_write | + VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1816,10 +1850,12 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, }, }; const std::array post_barriers{ - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, + .dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, .dstAccessMask = 0, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1829,12 +1865,14 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS}, }, - VkImageMemoryBarrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, - .dstAccessMask = VK_ACCESS_SHADER_READ_BIT | attachment_read_write | - VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, + .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | attachment_read_write | + VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1844,14 +1882,10 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, VK_REMAINING_ARRAY_LAYERS}, }, }; - cmdbuf.PipelineBarrier(attachment_stage | VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, 0, nullptr, nullptr, - pre_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, pre_barriers); cmdbuf.CopyImage(shadow_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, region); - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, nullptr, nullptr, - post_barriers); + cmdbuf.PipelineBarrier(0, {}, {}, post_barriers); }); return; } @@ -2148,23 +2182,25 @@ void Image::DownloadMemory(std::span buffers_span, std::span o const VkImage temp_vk_image = runtime->AcquireMsaaScratchImage(image_ci); const VkImageAspectFlags temp_aspect_mask = aspect_mask; - const VkAccessFlags attachment_access = - msaa_download_is_depth ? (VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT) - : (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT); - const VkPipelineStageFlags attachment_stage = - msaa_download_is_depth ? (VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT) - : VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; + const VkAccessFlags2 attachment_access = + msaa_download_is_depth ? (VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT) + : (VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT); + const VkPipelineStageFlags2 attachment_stage = + msaa_download_is_depth ? (VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT) + : VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT; scheduler->RequestOutsideRenderPassOperationContext(); scheduler->Record([temp_vk_image, temp_aspect_mask, attachment_access, attachment_stage](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier init_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 init_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT, .srcAccessMask = 0, + .dstStageMask = attachment_stage, .dstAccessMask = attachment_access, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -2179,8 +2215,7 @@ void Image::DownloadMemory(std::span buffers_span, std::span o .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, attachment_stage, 0, - init_barrier); + cmdbuf.PipelineBarrier(init_barrier); }); boost::container::small_vector image_copies; @@ -2220,11 +2255,13 @@ void Image::DownloadMemory(std::span buffers_span, std::span o scheduler->RequestOutsideRenderPassOperationContext(); scheduler->Record([buffers = std::move(buffers_vector), image = temp_vk_image, aspect_mask_ = aspect_mask, vk_copies](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier read_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 read_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -2238,25 +2275,28 @@ void Image::DownloadMemory(std::span buffers_span, std::span o .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, read_barrier); + cmdbuf.PipelineBarrier(read_barrier); for (size_t index = 0; index < buffers.size(); index++) { cmdbuf.CopyImageToBuffer(image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, buffers[index], vk_copies[index]); } - const VkMemoryBarrier memory_write_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + const VkMemoryBarrier2 memory_write_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; - const VkImageMemoryBarrier image_write_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 image_write_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -2270,8 +2310,7 @@ void Image::DownloadMemory(std::span buffers_span, std::span o .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, memory_write_barrier, nullptr, image_write_barrier); + cmdbuf.PipelineBarrier(0, memory_write_barrier, {}, image_write_barrier); }); runtime->ReleaseMsaaScratchImage(temp_vk_image); } @@ -2291,11 +2330,13 @@ void Image::DownloadMemory(std::span buffers_span, std::span o scheduler->RequestOutsideRenderPassOperationContext(); scheduler->Record([buffers = std::move(buffers_vector), image = *original_image, aspect_mask_ = aspect_mask, vk_copies](vk::CommandBuffer cmdbuf) { - const VkImageMemoryBarrier read_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 read_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -2309,25 +2350,28 @@ void Image::DownloadMemory(std::span buffers_span, std::span o .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, read_barrier); + cmdbuf.PipelineBarrier(read_barrier); for (size_t index = 0; index < buffers.size(); index++) { cmdbuf.CopyImageToBuffer(image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, buffers[index], vk_copies[index]); } - const VkMemoryBarrier memory_write_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, + const VkMemoryBarrier2 memory_write_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, }; - const VkImageMemoryBarrier image_write_barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + const VkImageMemoryBarrier2 image_write_barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -2341,8 +2385,7 @@ void Image::DownloadMemory(std::span buffers_span, std::span o .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - 0, memory_write_barrier, nullptr, image_write_barrier); + cmdbuf.PipelineBarrier(0, memory_write_barrier, {}, image_write_barrier); }); } @@ -3198,11 +3241,13 @@ void TextureCacheRuntime::AccelerateImageUpload( void TextureCacheRuntime::TransitionImageLayout(Image& image) { if (!image.ExchangeInitialization()) { - VkImageMemoryBarrier barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + VkImageMemoryBarrier2 barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcAccessMask = VK_ACCESS_NONE, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .srcAccessMask = VK_ACCESS_2_NONE, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -3218,8 +3263,7 @@ void TextureCacheRuntime::TransitionImageLayout(Image& image) { }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([barrier](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, 0, barrier); + cmdbuf.PipelineBarrier(barrier); }); } } diff --git a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp index 095908b6cf..8b18ae7d51 100644 --- a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp +++ b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp @@ -208,16 +208,22 @@ void TurboMode::Run(std::stop_token stop_token) { // Finish. cmdbuf.End(); - const VkSubmitInfo submit_info{ - .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, + const VkCommandBufferSubmitInfo cmdbuf_info{ + .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, .pNext = nullptr, - .waitSemaphoreCount = 0, - .pWaitSemaphores = nullptr, - .pWaitDstStageMask = nullptr, - .commandBufferCount = 1, - .pCommandBuffers = cmdbuf.address(), - .signalSemaphoreCount = 0, - .pSignalSemaphores = nullptr, + .commandBuffer = *cmdbuf, + .deviceMask = 0, + }; + const VkSubmitInfo2 submit_info{ + .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, + .pNext = nullptr, + .flags = 0, + .waitSemaphoreInfoCount = 0, + .pWaitSemaphoreInfos = nullptr, + .commandBufferInfoCount = 1, + .pCommandBufferInfos = &cmdbuf_info, + .signalSemaphoreInfoCount = 0, + .pSignalSemaphoreInfos = nullptr, }; m_device.GetGraphicsQueue().Submit(std::array{submit_info}, *fence); diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 8fd72cb71f..4a90b1a21d 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1427,10 +1427,10 @@ void Device::RemoveUnsuitableExtensions() { VK_KHR_MAINTENANCE_5_EXTENSION_NAME); - // VK_KHR_synchronization2 extensions.synchronization2 = features.synchronization2.synchronization2; - RemoveExtensionFeatureIfUnsuitable(extensions.synchronization2, features.synchronization2, - VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME); + if (!extensions.synchronization2 || !IsKhrCreateRenderPass2Supported()) { + throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); + } } void Device::SetupFamilies(VkSurfaceKHR surface) { diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 0927ca8a05..23dceceb26 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -640,8 +640,7 @@ FN_MAX_LIMIT_LIST /// Returns true if the device supports VK_KHR_depth_stencil_resolve. bool IsKhrDepthStencilResolveSupported() const { - return (extensions.depth_stencil_resolve || instance_version >= VK_API_VERSION_1_2) && - IsKhrCreateRenderPass2Supported(); + return extensions.depth_stencil_resolve || instance_version >= VK_API_VERSION_1_2; } /// Returns the supported resolve modes for the depth aspect. @@ -905,11 +904,6 @@ FN_MAX_LIMIT_LIST bool HasTimelineSemaphore() const; - /// Returns true if the device supports VK_KHR_synchronization2. - bool HasSynchronization2() const { - return extensions.synchronization2; - } - /// Returns the minimum supported version of SPIR-V. u32 SupportedSpirvVersion() const { if (instance_version >= VK_API_VERSION_1_3) { diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index e4c8f518b9..01a19e8cef 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -123,7 +123,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdEndTransformFeedbackEXT); X(vkCmdEndDebugUtilsLabelEXT); X(vkCmdFillBuffer); - X(vkCmdPipelineBarrier); X(vkCmdPipelineBarrier2); X(vkCmdPushConstants); X(vkCmdPushDescriptorSetWithTemplateKHR); @@ -131,13 +130,13 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdSetDepthBias); X(vkCmdSetDepthBias2EXT); X(vkCmdSetDepthBounds); - X(vkCmdSetEvent); + X(vkCmdSetEvent2); X(vkCmdSetScissor); X(vkCmdSetStencilCompareMask); X(vkCmdSetStencilReference); X(vkCmdSetStencilWriteMask); X(vkCmdSetViewport); - X(vkCmdWaitEvents); + X(vkCmdWaitEvents2); X(vkCmdBindVertexBuffers2EXT); X(vkCmdSetCullModeEXT); X(vkCmdSetDepthBoundsTestEnableEXT); @@ -232,7 +231,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkGetSemaphoreCounterValue); X(vkMapMemory); X(vkQueueBindSparse); - X(vkQueueSubmit); X(vkQueueSubmit2); X(vkResetFences); X(vkResetQueryPool); @@ -280,6 +278,12 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { if (!dld.vkQueueSubmit2) { Proc(dld.vkQueueSubmit2, dld, "vkQueueSubmit2KHR", device); } + if (!dld.vkCmdSetEvent2) { + Proc(dld.vkCmdSetEvent2, dld, "vkCmdSetEvent2KHR", device); + } + if (!dld.vkCmdWaitEvents2) { + Proc(dld.vkCmdWaitEvents2, dld, "vkCmdWaitEvents2KHR", device); + } if (!dld.vkCreateRenderPass2) { Proc(dld.vkCreateRenderPass2, dld, "vkCreateRenderPass2KHR", device); diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 5c2d78bc2c..bfa56f084a 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -147,16 +147,16 @@ inline VkResult Filter(VkResult result) { return result; } -inline constexpr VkPipelineStageFlags PIPELINE_STAGE_GRAPHICS_COMPUTE = - VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; +inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_GRAPHICS_COMPUTE = + VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT; -inline constexpr VkPipelineStageFlags PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER = - PIPELINE_STAGE_GRAPHICS_COMPUTE | VK_PIPELINE_STAGE_TRANSFER_BIT; +inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER = + PIPELINE_STAGE_GRAPHICS_COMPUTE | VK_PIPELINE_STAGE_2_TRANSFER_BIT; -inline constexpr VkPipelineStageFlags PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER_HOST = - PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER | VK_PIPELINE_STAGE_HOST_BIT; +inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER_HOST = + PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER | VK_PIPELINE_STAGE_2_HOST_BIT; -inline constexpr VkPipelineStageFlags PIPELINE_STAGE_HOST = VK_PIPELINE_STAGE_HOST_BIT; +inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_HOST = VK_PIPELINE_STAGE_2_HOST_BIT; /// Table holding Vulkan instance function pointers. @@ -239,7 +239,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdEndRenderPass vkCmdEndRenderPass{}; PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT{}; PFN_vkCmdFillBuffer vkCmdFillBuffer{}; - PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier{}; PFN_vkCmdPipelineBarrier2 vkCmdPipelineBarrier2{}; PFN_vkCmdPushConstants vkCmdPushConstants{}; PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR{}; @@ -265,7 +264,7 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdSetDepthBiasEnableEXT vkCmdSetDepthBiasEnableEXT{}; PFN_vkCmdSetLogicOpEnableEXT vkCmdSetLogicOpEnableEXT{}; PFN_vkCmdSetDepthClampEnableEXT vkCmdSetDepthClampEnableEXT{}; - PFN_vkCmdSetEvent vkCmdSetEvent{}; + PFN_vkCmdSetEvent2 vkCmdSetEvent2{}; PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT{}; PFN_vkCmdSetPatchControlPointsEXT vkCmdSetPatchControlPointsEXT{}; PFN_vkCmdSetLogicOpEXT vkCmdSetLogicOpEXT{}; @@ -283,7 +282,7 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdSetColorWriteEnableEXT vkCmdSetColorWriteEnableEXT{}; PFN_vkCmdSetColorBlendEnableEXT vkCmdSetColorBlendEnableEXT{}; PFN_vkCmdSetColorBlendEquationEXT vkCmdSetColorBlendEquationEXT{}; - PFN_vkCmdWaitEvents vkCmdWaitEvents{}; + PFN_vkCmdWaitEvents2 vkCmdWaitEvents2{}; PFN_vkCreateBuffer vkCreateBuffer{}; PFN_vkCreateBufferView vkCreateBufferView{}; PFN_vkCreateCommandPool vkCreateCommandPool{}; @@ -348,7 +347,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkGetSemaphoreCounterValue vkGetSemaphoreCounterValue{}; PFN_vkMapMemory vkMapMemory{}; PFN_vkQueueBindSparse vkQueueBindSparse{}; - PFN_vkQueueSubmit vkQueueSubmit{}; PFN_vkQueueSubmit2 vkQueueSubmit2{}; PFN_vkResetFences vkResetFences{}; PFN_vkResetQueryPool vkResetQueryPool{}; @@ -848,13 +846,7 @@ public: constexpr Queue(VkQueue queue_, const DeviceDispatch& dld_) noexcept : queue{queue_}, dld{&dld_} {} - VkResult Submit(Span submit_infos, - VkFence fence = VK_NULL_HANDLE) const noexcept { - return dld->vkQueueSubmit(queue, submit_infos.size(), submit_infos.data(), fence); - } - - /// Submits using VK_KHR_synchronization2 / Vulkan 1.3 vkQueueSubmit2. - VkResult Submit2(Span submit_infos, + VkResult Submit(Span submit_infos, VkFence fence = VK_NULL_HANDLE) const noexcept { return dld->vkQueueSubmit2(queue, submit_infos.size(), submit_infos.data(), fence); } @@ -1371,103 +1363,50 @@ public: dld->vkCmdDispatchIndirect(handle, indirect_buffer, offset); } - void PipelineBarrier(VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, - VkDependencyFlags dependency_flags, Span memory_barriers, - Span buffer_barriers, - Span image_barriers) const noexcept { - static constexpr u32 MaxBarriers = 16; - if (dld->vkCmdPipelineBarrier2 && memory_barriers.size() <= MaxBarriers && - buffer_barriers.size() <= MaxBarriers && image_barriers.size() <= MaxBarriers) { - const auto src_stage_mask2 = static_cast(src_stage_mask); - const auto dst_stage_mask2 = static_cast(dst_stage_mask); - - std::array memory_barriers2; - for (u32 i = 0; i < memory_barriers.size(); ++i) { - memory_barriers2[i] = VkMemoryBarrier2{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = src_stage_mask2, - .srcAccessMask = static_cast(memory_barriers[i].srcAccessMask), - .dstStageMask = dst_stage_mask2, - .dstAccessMask = static_cast(memory_barriers[i].dstAccessMask), - }; - } - std::array buffer_barriers2; - for (u32 i = 0; i < buffer_barriers.size(); ++i) { - const auto& barrier = buffer_barriers[i]; - buffer_barriers2[i] = VkBufferMemoryBarrier2{ - .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = src_stage_mask2, - .srcAccessMask = static_cast(barrier.srcAccessMask), - .dstStageMask = dst_stage_mask2, - .dstAccessMask = static_cast(barrier.dstAccessMask), - .srcQueueFamilyIndex = barrier.srcQueueFamilyIndex, - .dstQueueFamilyIndex = barrier.dstQueueFamilyIndex, - .buffer = barrier.buffer, - .offset = barrier.offset, - .size = barrier.size, - }; - } - std::array image_barriers2; - for (u32 i = 0; i < image_barriers.size(); ++i) { - const auto& barrier = image_barriers[i]; - image_barriers2[i] = VkImageMemoryBarrier2{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = src_stage_mask2, - .srcAccessMask = static_cast(barrier.srcAccessMask), - .dstStageMask = dst_stage_mask2, - .dstAccessMask = static_cast(barrier.dstAccessMask), - .oldLayout = barrier.oldLayout, - .newLayout = barrier.newLayout, - .srcQueueFamilyIndex = barrier.srcQueueFamilyIndex, - .dstQueueFamilyIndex = barrier.dstQueueFamilyIndex, - .image = barrier.image, - .subresourceRange = barrier.subresourceRange, - }; - } - const VkDependencyInfo dependency_info{ - .sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, - .pNext = nullptr, - .dependencyFlags = dependency_flags, - .memoryBarrierCount = memory_barriers.size(), - .pMemoryBarriers = memory_barriers2.data(), - .bufferMemoryBarrierCount = buffer_barriers.size(), - .pBufferMemoryBarriers = buffer_barriers2.data(), - .imageMemoryBarrierCount = image_barriers.size(), - .pImageMemoryBarriers = image_barriers2.data(), - }; - dld->vkCmdPipelineBarrier2(handle, &dependency_info); - return; - } - dld->vkCmdPipelineBarrier(handle, src_stage_mask, dst_stage_mask, dependency_flags, - memory_barriers.size(), memory_barriers.data(), - buffer_barriers.size(), buffer_barriers.data(), - image_barriers.size(), image_barriers.data()); + void PipelineBarrier(VkDependencyFlags dependency_flags, + Span memory_barriers, + Span buffer_barriers, + Span image_barriers) const noexcept { + const VkDependencyInfo dependency_info{ + .sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, + .pNext = nullptr, + .dependencyFlags = dependency_flags, + .memoryBarrierCount = memory_barriers.size(), + .pMemoryBarriers = memory_barriers.data(), + .bufferMemoryBarrierCount = buffer_barriers.size(), + .pBufferMemoryBarriers = buffer_barriers.data(), + .imageMemoryBarrierCount = image_barriers.size(), + .pImageMemoryBarriers = image_barriers.data(), + }; + dld->vkCmdPipelineBarrier2(handle, &dependency_info); } - void PipelineBarrier(VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, + void PipelineBarrier(VkPipelineStageFlags2 src_stage_mask, VkPipelineStageFlags2 dst_stage_mask, VkDependencyFlags dependency_flags = 0) const noexcept { - PipelineBarrier(src_stage_mask, dst_stage_mask, dependency_flags, {}, {}, {}); + const VkMemoryBarrier2 barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = src_stage_mask, + .srcAccessMask = VK_ACCESS_2_NONE, + .dstStageMask = dst_stage_mask, + .dstAccessMask = VK_ACCESS_2_NONE, + }; + PipelineBarrier(dependency_flags, barrier, {}, {}); } - void PipelineBarrier(VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, - VkDependencyFlags dependency_flags, - const VkMemoryBarrier& memory_barrier) const noexcept { - PipelineBarrier(src_stage_mask, dst_stage_mask, dependency_flags, memory_barrier, {}, {}); + void PipelineBarrier(const VkMemoryBarrier2& memory_barrier, + VkDependencyFlags dependency_flags = 0) const noexcept { + PipelineBarrier(dependency_flags, memory_barrier, {}, {}); } - void PipelineBarrier(VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, - VkDependencyFlags dependency_flags, - const VkBufferMemoryBarrier& buffer_barrier) const noexcept { - PipelineBarrier(src_stage_mask, dst_stage_mask, dependency_flags, {}, buffer_barrier, {}); + void PipelineBarrier(const VkBufferMemoryBarrier2& buffer_barrier, + VkDependencyFlags dependency_flags = 0) const noexcept { + PipelineBarrier(dependency_flags, {}, buffer_barrier, {}); } - void PipelineBarrier(VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, - VkDependencyFlags dependency_flags, - const VkImageMemoryBarrier& image_barrier) const noexcept { - PipelineBarrier(src_stage_mask, dst_stage_mask, dependency_flags, {}, {}, image_barrier); + void PipelineBarrier(const VkImageMemoryBarrier2& image_barrier, + VkDependencyFlags dependency_flags = 0) const noexcept { + PipelineBarrier(dependency_flags, {}, {}, image_barrier); } void BindDescriptorBuffersEXT(Span bindings) const noexcept { @@ -1572,17 +1511,12 @@ public: dld->vkCmdSetDepthBounds(handle, min_depth_bounds, max_depth_bounds); } - void SetEvent(VkEvent event, VkPipelineStageFlags stage_flags) const noexcept { - dld->vkCmdSetEvent(handle, event, stage_flags); + void SetEvent(VkEvent event, const VkDependencyInfo& dependency_info) const noexcept { + dld->vkCmdSetEvent2(handle, event, &dependency_info); } - void WaitEvents(Span events, VkPipelineStageFlags src_stage_mask, - VkPipelineStageFlags dst_stage_mask, Span memory_barriers, - Span buffer_barriers, - Span image_barriers) const noexcept { - dld->vkCmdWaitEvents(handle, events.size(), events.data(), src_stage_mask, dst_stage_mask, - memory_barriers.size(), memory_barriers.data(), buffer_barriers.size(), - buffer_barriers.data(), image_barriers.size(), image_barriers.data()); + void WaitEvents(Span events, const VkDependencyInfo& dependency_info) const noexcept { + dld->vkCmdWaitEvents2(handle, events.size(), events.data(), &dependency_info); } void BindVertexBuffers2EXT(u32 first_binding, u32 binding_count, const VkBuffer* buffers, From f71a80671ca49b182af6134ccf8c9576f97e447b Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 23 Sep 2026 02:37:57 -0400 Subject: [PATCH 087/198] Remove final references to sync1 --- .../renderer_vulkan/present/post_process.cpp | 20 ++++++-- .../renderer_vulkan/present/util.cpp | 47 ++++++++++++++----- .../vulkan_common/vulkan_wrapper.cpp | 7 --- src/video_core/vulkan_common/vulkan_wrapper.h | 3 -- 4 files changed, 50 insertions(+), 27 deletions(-) diff --git a/src/video_core/renderer_vulkan/present/post_process.cpp b/src/video_core/renderer_vulkan/present/post_process.cpp index 07d75b7025..f5164e488e 100644 --- a/src/video_core/renderer_vulkan/present/post_process.cpp +++ b/src/video_core/renderer_vulkan/present/post_process.cpp @@ -134,7 +134,9 @@ vk::RenderPass CreateFxRenderPass(const Device& device, VkFormat format, bool cl initial_layout = VK_IMAGE_LAYOUT_UNDEFINED; } - const VkAttachmentDescription attachment{ + const VkAttachmentDescription2 attachment{ + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, + .pNext = nullptr, .flags = 0, .format = format, .samples = VK_SAMPLE_COUNT_1_BIT, @@ -146,14 +148,20 @@ vk::RenderPass CreateFxRenderPass(const Device& device, VkFormat format, bool cl .finalLayout = VK_IMAGE_LAYOUT_GENERAL, }; - const VkAttachmentReference reference{ + static constexpr VkAttachmentReference2 reference{ + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, + .pNext = nullptr, .attachment = 0, .layout = VK_IMAGE_LAYOUT_GENERAL, + .aspectMask = 0, }; - const VkSubpassDescription subpass{ + const VkSubpassDescription2 subpass{ + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, + .pNext = nullptr, .flags = 0, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, + .viewMask = 0, .inputAttachmentCount = 0, .pInputAttachments = nullptr, .colorAttachmentCount = 1, @@ -164,8 +172,8 @@ vk::RenderPass CreateFxRenderPass(const Device& device, VkFormat format, bool cl .pPreserveAttachments = nullptr, }; - return device.GetLogical().CreateRenderPass(VkRenderPassCreateInfo{ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + return device.GetLogical().CreateRenderPass2(VkRenderPassCreateInfo2{ + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .pNext = nullptr, .flags = 0, .attachmentCount = 1, @@ -174,6 +182,8 @@ vk::RenderPass CreateFxRenderPass(const Device& device, VkFormat format, bool cl .pSubpasses = &subpass, .dependencyCount = 0, .pDependencies = nullptr, + .correlatedViewMaskCount = 0, + .pCorrelatedViewMasks = nullptr, }); } diff --git a/src/video_core/renderer_vulkan/present/util.cpp b/src/video_core/renderer_vulkan/present/util.cpp index 131973bdd6..80d5e19578 100644 --- a/src/video_core/renderer_vulkan/present/util.cpp +++ b/src/video_core/renderer_vulkan/present/util.cpp @@ -203,7 +203,9 @@ vk::ImageView CreateWrappedImageView(const Device& device, vk::Image& image, VkF vk::RenderPass CreateWrappedRenderPass(const Device& device, VkFormat format, VkImageLayout initial_layout) { - const VkAttachmentDescription attachment{ + const VkAttachmentDescription2 attachment{ + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, + .pNext = nullptr, .flags = VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT, .format = format, .samples = VK_SAMPLE_COUNT_1_BIT, @@ -216,14 +218,20 @@ vk::RenderPass CreateWrappedRenderPass(const Device& device, VkFormat format, .finalLayout = VK_IMAGE_LAYOUT_GENERAL, }; - constexpr VkAttachmentReference color_attachment_ref{ + static constexpr VkAttachmentReference2 color_attachment_ref{ + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, + .pNext = nullptr, .attachment = 0, .layout = VK_IMAGE_LAYOUT_GENERAL, + .aspectMask = 0, }; - const VkSubpassDescription subpass_description{ + const VkSubpassDescription2 subpass_description{ + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, + .pNext = nullptr, .flags = 0, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, + .viewMask = 0, .inputAttachmentCount = 0, .pInputAttachments = nullptr, .colorAttachmentCount = 1, @@ -234,18 +242,31 @@ vk::RenderPass CreateWrappedRenderPass(const Device& device, VkFormat format, .pPreserveAttachments = nullptr, }; - constexpr VkSubpassDependency dependency{ - .srcSubpass = VK_SUBPASS_EXTERNAL, - .dstSubpass = 0, - .srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - .dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, + static constexpr VkMemoryBarrier2 dependency_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - .dependencyFlags = 0, + .dstStageMask = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, + .dstAccessMask = + VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, }; - return device.GetLogical().CreateRenderPass(VkRenderPassCreateInfo{ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + static constexpr VkSubpassDependency2 dependency{ + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, + .pNext = &dependency_barrier, + .srcSubpass = VK_SUBPASS_EXTERNAL, + .dstSubpass = 0, + .srcStageMask = 0, + .dstStageMask = 0, + .srcAccessMask = 0, + .dstAccessMask = 0, + .dependencyFlags = 0, + .viewOffset = 0, + }; + + return device.GetLogical().CreateRenderPass2(VkRenderPassCreateInfo2{ + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .pNext = nullptr, .flags = 0, .attachmentCount = 1, @@ -254,6 +275,8 @@ vk::RenderPass CreateWrappedRenderPass(const Device& device, VkFormat format, .pSubpasses = &subpass_description, .dependencyCount = 1, .pDependencies = &dependency, + .correlatedViewMaskCount = 0, + .pCorrelatedViewMasks = nullptr, }); } diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 01a19e8cef..a2ca3b7fa6 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -183,7 +183,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCreatePipelineCache); X(vkCreatePipelineLayout); X(vkCreateQueryPool); - X(vkCreateRenderPass); X(vkCreateRenderPass2); X(vkCreateSampler); X(vkCreateSemaphore); @@ -737,12 +736,6 @@ DescriptorPool Device::CreateDescriptorPool(const VkDescriptorPoolCreateInfo& ci return DescriptorPool(object, handle, *dld); } -RenderPass Device::CreateRenderPass(const VkRenderPassCreateInfo& ci) const { - VkRenderPass object; - Check(dld->vkCreateRenderPass(handle, &ci, nullptr, &object)); - return RenderPass(object, handle, *dld); -} - RenderPass Device::CreateRenderPass2(const VkRenderPassCreateInfo2& ci) const { VkRenderPass object; Check(dld->vkCreateRenderPass2(handle, &ci, nullptr, &object)); diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index bfa56f084a..9c60f03fd2 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -299,7 +299,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCreatePipelineCache vkCreatePipelineCache{}; PFN_vkCreatePipelineLayout vkCreatePipelineLayout{}; PFN_vkCreateQueryPool vkCreateQueryPool{}; - PFN_vkCreateRenderPass vkCreateRenderPass{}; PFN_vkCreateRenderPass2 vkCreateRenderPass2{}; PFN_vkCreateSampler vkCreateSampler{}; PFN_vkCreateSemaphore vkCreateSemaphore{}; @@ -1057,8 +1056,6 @@ public: [[nodiscard]] DescriptorPool CreateDescriptorPool(const VkDescriptorPoolCreateInfo& ci) const; - [[nodiscard]] RenderPass CreateRenderPass(const VkRenderPassCreateInfo& ci) const; - [[nodiscard]] RenderPass CreateRenderPass2(const VkRenderPassCreateInfo2& ci) const; [[nodiscard]] DescriptorSetLayout CreateDescriptorSetLayout( From fd8da678dfaaa35c19a6864bb2cb2ae1a95f6803 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 23 Sep 2026 15:33:27 -0400 Subject: [PATCH 088/198] Re-adjust dispatch draw + masks --- .../renderer_vulkan/vk_buffer_cache.cpp | 72 +++++++++++++------ .../renderer_vulkan/vk_buffer_cache.h | 3 + .../renderer_vulkan/vk_rasterizer.cpp | 17 +++-- .../renderer_vulkan/vk_scheduler.cpp | 3 +- src/video_core/renderer_vulkan/vk_scheduler.h | 2 +- 5 files changed, 64 insertions(+), 33 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 56f0e7b870..dec26f328d 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -24,6 +24,18 @@ namespace Vulkan { namespace { +constexpr u32 COMPACT_VERTEX_BINDINGS = 8; + +template +struct VertexBindings { + std::array buffers; + std::array offsets; + std::array sizes; + std::array strides; + u32 first; + u32 count; +}; + VkBufferCopy MakeBufferCopy(const VideoCommon::BufferCopy& copy) { return VkBufferCopy{ .srcOffset = copy.src_offset, @@ -670,36 +682,52 @@ void BufferCacheRuntime::BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset } } -void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings& bindings) { - boost::container::static_vector buffer_handles(bindings.buffers.size()); - for (u32 i = 0; i < bindings.buffers.size(); ++i) { - auto handle = bindings.buffers[i]->Handle(); - if (handle == VK_NULL_HANDLE) { - bindings.offsets[i] = 0; - bindings.sizes[i] = VK_WHOLE_SIZE; +template +void BufferCacheRuntime::RecordVertexBuffers(const VideoCommon::HostBindings& bindings, + u32 count) { + VertexBindings vertex{}; + vertex.first = bindings.min_index; + vertex.count = count; + for (u32 i = 0; i < count; ++i) { + vertex.buffers[i] = bindings.buffers[i]->Handle(); + vertex.offsets[i] = bindings.offsets[i]; + vertex.sizes[i] = bindings.sizes[i]; + vertex.strides[i] = bindings.strides[i]; + if (vertex.buffers[i] == VK_NULL_HANDLE) { + vertex.offsets[i] = 0; + vertex.sizes[i] = VK_WHOLE_SIZE; if (!device.HasNullDescriptor()) { ReserveNullBuffer(); - handle = *null_buffer; + vertex.buffers[i] = *null_buffer; } } - buffer_handles[i] = handle; - } - const u32 device_max = device.GetMaxVertexInputBindings(); - const u32 min_binding = (std::min)(bindings.min_index, device_max); - const u32 max_binding = (std::min)(bindings.max_index, device_max); - const u32 binding_count = max_binding - min_binding; - if (binding_count == 0) { - return; } if (device.IsExtExtendedDynamicStateSupported()) { - scheduler.Record([bindings_ = std::move(bindings), buffer_handles_ = std::move(buffer_handles), binding_count](vk::CommandBuffer cmdbuf) { - cmdbuf.BindVertexBuffers2EXT(bindings_.min_index, binding_count, buffer_handles_.data(), bindings_.offsets.data(), bindings_.sizes.data(), bindings_.strides.data()); - }); - } else { - scheduler.Record([bindings_ = std::move(bindings), buffer_handles_ = std::move(buffer_handles), binding_count](vk::CommandBuffer cmdbuf) { - cmdbuf.BindVertexBuffers(bindings_.min_index, binding_count, buffer_handles_.data(), bindings_.offsets.data()); + scheduler.Record([vertex](vk::CommandBuffer cmdbuf) { + cmdbuf.BindVertexBuffers2EXT(vertex.first, vertex.count, vertex.buffers.data(), + vertex.offsets.data(), vertex.sizes.data(), + vertex.strides.data()); }); + return; } + scheduler.Record([vertex](vk::CommandBuffer cmdbuf) { + cmdbuf.BindVertexBuffers(vertex.first, vertex.count, vertex.buffers.data(), + vertex.offsets.data()); + }); +} + +void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings& bindings) { + const u32 device_max = device.GetMaxVertexInputBindings(); + const u32 count = (std::min)(bindings.max_index, device_max) - + (std::min)(bindings.min_index, device_max); + if (count == 0) { + return; + } + if (count <= COMPACT_VERTEX_BINDINGS) { + RecordVertexBuffers(bindings, count); + return; + } + RecordVertexBuffers(bindings, count); } void BufferCacheRuntime::BindTransformFeedbackBuffer(u32 index, VkBuffer buffer, u32 offset, diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index fbd8c2e753..582f665b4e 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -244,6 +244,9 @@ private: VkFormat TexelBufferFormat(VideoCore::Surface::PixelFormat format) const; + template + void RecordVertexBuffers(const VideoCommon::HostBindings& bindings, u32 count); + void ReserveNullBuffer(); vk::Buffer CreateNullBuffer(); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 52227ab290..c32cbd2a0d 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -1032,23 +1032,22 @@ void RasterizerVulkan::LoadDiskResources(u64 title_id, std::stop_token stop_load void RasterizerVulkan::FlushWork() { #ifdef __ANDROID__ - static constexpr u32 DRAWS_TO_DISPATCH = 512; - static constexpr u32 CHECK_MASK = 3; + static constexpr u32 DRAWS_TO_DISPATCH = 1024; #else static constexpr u32 DRAWS_TO_DISPATCH = 4096; - static constexpr u32 CHECK_MASK = 7; #endif // __ANDROID__ + static constexpr u32 CHECK_MASK = 7; - static_assert(DRAWS_TO_DISPATCH % (CHECK_MASK + 1) == 0); - if ((++draw_counter & CHECK_MASK) != CHECK_MASK) { + if (++draw_counter >= DRAWS_TO_DISPATCH && + (!scheduler.IsRenderPassActive() || + maxwell3d->dirty.flags[VideoCommon::Dirty::RenderTargets])) { + scheduler.Flush(); + draw_counter = 0; return; } - if (draw_counter < DRAWS_TO_DISPATCH) { + if ((draw_counter & CHECK_MASK) == CHECK_MASK) { scheduler.DispatchWork(); - return; } - scheduler.Flush(); - draw_counter = 0; } AccelerateDMA::AccelerateDMA(BufferCache& buffer_cache_, TextureCache& texture_cache_, diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 5c07c99828..33b03ea8f2 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -13,6 +13,7 @@ #include "video_core/renderer_vulkan/vk_query_cache.h" +#include "common/make_unique_for_overwrite.h" #include "common/settings.h" #include "common/thread.h" #include "video_core/gpu_logging/gpu_logging.h" @@ -484,7 +485,7 @@ void Scheduler::AcquireNewChunk() { if (chunk_reserve.empty()) { // If we don't have anything reserved, we need to make a new chunk. - chunk = std::make_unique(); + chunk = Common::make_unique_for_overwrite(); } else { // Otherwise, we can just take from the reserve. chunk = std::move(chunk_reserve.back()); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index 08ae0bfca1..e82b0414fc 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -251,7 +251,7 @@ private: size_t command_offset = 0; bool submit = false; - alignas(std::max_align_t) std::array data{}; + alignas(std::max_align_t) std::array data; }; struct State { From 3ff00afd5988d7cc894f0b2d03f16fde31009197 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 24 Sep 2026 13:53:54 -0400 Subject: [PATCH 089/198] Some other dead code removal --- .../renderer_vulkan/present/lsfg_common.cpp | 1 - .../renderer_vulkan/present/lsfg_common.h | 5 - .../renderer_vulkan/present/post_process.cpp | 2 - .../renderer_vulkan/present/post_process.h | 3 - .../renderer_vulkan/renderer_vulkan.h | 7 -- .../renderer_vulkan/vk_rasterizer.h | 1 - .../renderer_vulkan/vk_render_pass_cache.cpp | 27 +---- .../renderer_vulkan/vk_state_tracker.cpp | 2 - .../renderer_vulkan/vk_state_tracker.h | 10 -- src/video_core/renderer_vulkan/vk_swapchain.h | 10 -- .../renderer_vulkan/vk_texture_cache.cpp | 6 - .../renderer_vulkan/vk_texture_cache.h | 15 --- .../renderer_vulkan/vk_update_descriptor.h | 4 - .../vulkan_common/vulkan_device.cpp | 17 --- src/video_core/vulkan_common/vulkan_device.h | 47 -------- .../vulkan_common/vulkan_wrapper.cpp | 112 +----------------- src/video_core/vulkan_common/vulkan_wrapper.h | 86 -------------- 17 files changed, 4 insertions(+), 351 deletions(-) diff --git a/src/video_core/renderer_vulkan/present/lsfg_common.cpp b/src/video_core/renderer_vulkan/present/lsfg_common.cpp index 74e5d446d8..e05c7a8b02 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_common.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_common.cpp @@ -286,7 +286,6 @@ LsfgPass::LsfgPass(const Device& device, const LsfgShaders& shaders, u32 shader_ for (const auto& [count, type] : bindings) { types.insert(types.end(), count, type); } - descriptor_count = static_cast(types.size()); descriptor_set_layout = CreateWrappedDescriptorSetLayout( device, std::span{types}, VK_SHADER_STAGE_COMPUTE_BIT); diff --git a/src/video_core/renderer_vulkan/present/lsfg_common.h b/src/video_core/renderer_vulkan/present/lsfg_common.h index bc538f4d1b..33547b1346 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_common.h +++ b/src/video_core/renderer_vulkan/present/lsfg_common.h @@ -204,10 +204,6 @@ public: return *descriptor_set_layout; } - [[nodiscard]] u32 DescriptorCount() const { - return descriptor_count; - } - void Bind(vk::CommandBuffer cmdbuf, VkDescriptorSet set) const; void BindPipeline(vk::CommandBuffer cmdbuf) const; void BindSet(vk::CommandBuffer cmdbuf, VkDescriptorSet set) const; @@ -216,7 +212,6 @@ private: vk::DescriptorSetLayout descriptor_set_layout; vk::PipelineLayout pipeline_layout; vk::Pipeline pipeline; - u32 descriptor_count{}; }; [[nodiscard]] vk::DescriptorPool CreateLsfgDescriptorPool(const Device& device, u32 max_sets); diff --git a/src/video_core/renderer_vulkan/present/post_process.cpp b/src/video_core/renderer_vulkan/present/post_process.cpp index f5164e488e..2027f75828 100644 --- a/src/video_core/renderer_vulkan/present/post_process.cpp +++ b/src/video_core/renderer_vulkan/present/post_process.cpp @@ -611,8 +611,6 @@ bool PostProcessChain::BuildEffects(const Device& device, MemoryAllocator& alloc *vertex_shader->second, *fragment_shader->second, pass); if (out.writes_backbuffer) { - out.backbuffer_slot = static_cast(effect.backbuffer_pass_count % 2); - ++effect.backbuffer_pass_count; for (u32 image = 0; image < m_image_count; ++image) { for (size_t slot = 0; slot < 2; ++slot) { out.framebuffers.push_back(CreateWrappedFramebuffer( diff --git a/src/video_core/renderer_vulkan/present/post_process.h b/src/video_core/renderer_vulkan/present/post_process.h index 9d42bd4751..9238ef0c39 100644 --- a/src/video_core/renderer_vulkan/present/post_process.h +++ b/src/video_core/renderer_vulkan/present/post_process.h @@ -89,7 +89,6 @@ private: u32 num_vertices{3}; bool clear{}; bool writes_backbuffer{}; - u32 backbuffer_slot{}; }; struct Effect { @@ -105,8 +104,6 @@ private: vk::DescriptorSetLayout uniform_layout{}; vk::DescriptorPool descriptor_pool{}; vk::DescriptorSets uniform_sets{}; - size_t backbuffer_pass_count{}; - u32 backbuffer_slots{1}; }; struct FrameImages { diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.h b/src/video_core/renderer_vulkan/renderer_vulkan.h index 87422dd935..b0ceda5905 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.h +++ b/src/video_core/renderer_vulkan/renderer_vulkan.h @@ -59,14 +59,7 @@ public: return device.GetDriverName(); } - // Enhanced platform-specific initialization - void InitializePlatformSpecific(); - private: - void InterpolateFrames(Frame* prev_frame, Frame* curr_frame); - Frame* previous_frame = nullptr; // Store the previous frame for interpolation - VkCommandBuffer BeginSingleTimeCommands(); - void EndSingleTimeCommands(VkCommandBuffer command_buffer); void Report() const; vk::Buffer RenderToBuffer(std::span framebuffers, diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index bb7c5ff09e..ea98948df7 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -180,7 +180,6 @@ private: void UpdateRasterizerDiscardEnable(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateConservativeRasterizationMode(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateLineStippleEnable(Tegra::Engines::Maxwell3D::Regs& regs); - void UpdateLineStipple(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateLineRasterizationMode(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateDepthBiasEnable(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateLogicOpEnable(Tegra::Engines::Maxwell3D::Regs& regs); diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp index d9aa7698f7..8c0921e9e8 100644 --- a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp @@ -255,29 +255,6 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .preserveAttachmentCount = 0, .pPreserveAttachments = nullptr, }; - const VkMemoryBarrier2 dependency_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT, - .srcAccessMask = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT, - .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT, - }; - const VkSubpassDependency2 dependency{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, - .pNext = &dependency_barrier, - .srcSubpass = 0, - .dstSubpass = 0, - .srcStageMask = 0, - .dstStageMask = 0, - .srcAccessMask = 0, - .dstAccessMask = 0, - .dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT, - .viewOffset = 0, - }; pair->second = device->GetLogical().CreateRenderPass2({ .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .pNext = nullptr, @@ -286,8 +263,8 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { .pAttachments = descriptions.empty() ? nullptr : descriptions.data(), .subpassCount = 1, .pSubpasses = &subpass, - .dependencyCount = 1, - .pDependencies = &dependency, + .dependencyCount = 0, + .pDependencies = nullptr, .correlatedViewMaskCount = 0, .pCorrelatedViewMasks = nullptr, }); diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.cpp b/src/video_core/renderer_vulkan/vk_state_tracker.cpp index 0b132c97d6..49b5dded33 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.cpp +++ b/src/video_core/renderer_vulkan/vk_state_tracker.cpp @@ -63,7 +63,6 @@ Maxwell3D::DirtyState::Flags MakeInvalidationFlags() { BlendEnable, ConservativeRasterizationMode, LineStippleEnable, - LineStippleParams, }; Maxwell3D::DirtyState::Flags flags{}; for (const int flag : INVALIDATION_FLAGS) { @@ -228,7 +227,6 @@ void SetupDirtyVertexBindings(Maxwell3D::DirtyState::Tables& tables) { void SetupRasterModes(Maxwell3D::DirtyState::Tables &tables) { auto& table = tables[0]; - table[OFF(line_stipple_params)] = LineStippleParams; table[OFF(conservative_raster_enable)] = ConservativeRasterizationMode; table[OFF(line_anti_alias_enable)] = LineRasterizationMode; } diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.h b/src/video_core/renderer_vulkan/vk_state_tracker.h index 6b47ba4176..eebd25a81e 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.h +++ b/src/video_core/renderer_vulkan/vk_state_tracker.h @@ -56,7 +56,6 @@ enum : u8 { ConservativeRasterizationMode, LineRasterizationMode, LineStippleEnable, - LineStippleParams, DepthBiasEnable, StateEnable, LogicOp, @@ -89,14 +88,6 @@ public: stencil_reset = true; } - void InvalidateViewports() { - (*flags)[Dirty::Viewports] = true; - } - - void InvalidateScissors() { - (*flags)[Dirty::Scissors] = true; - } - void InvalidateStateEnableFlag() { (*flags)[Dirty::StateEnable] = true; } @@ -220,7 +211,6 @@ public: bool TouchLineStippleEnable() { return Exchange(Dirty::LineStippleEnable, false); } - bool TouchLineStipple() { return Exchange(Dirty::LineStippleParams, false); } bool TouchDepthBiasEnable() { return Exchange(Dirty::DepthBiasEnable, false); } diff --git a/src/video_core/renderer_vulkan/vk_swapchain.h b/src/video_core/renderer_vulkan/vk_swapchain.h index d926cc118a..62559355a9 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.h +++ b/src/video_core/renderer_vulkan/vk_swapchain.h @@ -47,11 +47,6 @@ public: return IsSubOptimal() || NeedsPresentModeUpdate(); } - /// Returns true when the swapchain is outdated. - bool IsOutDated() const { - return is_outdated; - } - /// Returns true when the swapchain is suboptimal. bool IsSubOptimal() const { return is_suboptimal; @@ -69,10 +64,6 @@ public: return image_index; } - std::size_t GetFrameIndex() const { - return frame_index; - } - VkImage GetImageIndex(std::size_t index) const { return images[index]; } @@ -112,7 +103,6 @@ public: private: void CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities); void CreateSemaphores(); - void CreateImageViews(); void Destroy(); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 18d38f3761..32d4c5a52d 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -2613,13 +2613,9 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI if (device->ApiVersion() >= VK_API_VERSION_1_3) { const VkFormatProperties3 properties3 = device->GetPhysical().GetFormatProperties3(format_info.format); - supports_depth_comparison = - (properties3.optimalTilingFeatures & - VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT) != 0; supports_minmax_filter = (properties3.optimalTilingFeatures & VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT) != 0; } else { - supports_depth_comparison = true; supports_minmax_filter = (device->GetPhysical().GetFormatProperties(format_info.format).optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT) != 0; @@ -2888,7 +2884,6 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t has_added_anisotropy = max_anisotropy > default_anisotropy; has_linear_filtering = mag_filter == VK_FILTER_LINEAR || min_filter == VK_FILTER_LINEAR || mipmap_mode == VK_SAMPLER_MIPMAP_MODE_LINEAR; - has_depth_comparison = tsc.depth_compare_enabled != 0; has_minmax_reduction = reduction_mode != VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT; has_srgb_border_color = tsc.srgb_conversion != 0 && srgb_border_color != border_color; if (has_minmax_reduction && !device.IsExtSamplerFilterMinmaxSupported()) { @@ -3165,7 +3160,6 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime, resolve_shadow_images[num_resolve_shadows++] = depth_image; } - num_color_buffers = static_cast(num_colors); framebuffer = runtime.device.GetLogical().CreateFramebuffer({ .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, .pNext = nullptr, diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 2e6b547e72..67cf67872b 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -89,10 +89,6 @@ public: void ConvertImage(Framebuffer* dst, ImageView& dst_view, ImageView& src_view); - bool CanAccelerateImageUpload(Image&) const noexcept { - return false; - } - bool CanUploadMSAA() const noexcept { return true; } @@ -234,10 +230,6 @@ public: return samples; } - [[nodiscard]] u32 NumColorBuffers() const noexcept { - return num_color_buffers; - } - [[nodiscard]] u32 NumImages() const noexcept { return num_images; } @@ -285,7 +277,6 @@ private: VkRenderPass renderpass{}; VkExtent2D render_area{}; VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT; - u32 num_color_buffers = 0; u32 num_images = 0; std::array images{}; std::array image_ranges{}; @@ -428,10 +419,6 @@ public: return samples; } - [[nodiscard]] bool SupportsDepthComparison() const noexcept { - return supports_depth_comparison; - } - [[nodiscard]] bool RequiresBorderColorFormat() const noexcept { return requires_border_color_format; } @@ -482,7 +469,6 @@ private: VkComponentMapping swizzle_mapping{}; - bool supports_depth_comparison = false; bool requires_border_color_format = false; bool supports_minmax_filter = false; bool has_identity_swizzle = true; @@ -559,7 +545,6 @@ private: bool has_added_anisotropy{}; bool has_linear_filtering{}; - bool has_depth_comparison{}; bool has_minmax_reduction{}; bool has_custom_border_colors{}; bool has_srgb_border_color{}; diff --git a/src/video_core/renderer_vulkan/vk_update_descriptor.h b/src/video_core/renderer_vulkan/vk_update_descriptor.h index 04d76a8386..1efe39180f 100644 --- a/src/video_core/renderer_vulkan/vk_update_descriptor.h +++ b/src/video_core/renderer_vulkan/vk_update_descriptor.h @@ -47,10 +47,6 @@ public: bool supports_descriptor_buffer_ = false); ~UpdateDescriptorQueue(); - [[nodiscard]] bool UsesDescriptorBuffer() const noexcept { - return use_descriptor_buffer; - } - void TickFrame(); void Acquire(Scheduler& scheduler, size_t required_entries = 0, bool use_descriptor_buffer_ = false); diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 4a90b1a21d..639552341e 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -487,9 +487,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR properties.subgroup_size_control.maxSubgroupSize > GuestWarpSize; is_integrated = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; - is_virtual = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU; - is_non_gpu = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_OTHER || - properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU; supports_d24_depth = IsFormatSupported(VK_FORMAT_D24_UNORM_S8_UINT, @@ -896,10 +893,6 @@ bool Device::GetSuitability(bool requires_swapchain) { // Assume we will be suitable. bool suitable = true; - // Configure properties. - VkPhysicalDeviceVulkan12Features features_1_2{}; - VkPhysicalDeviceVulkan13Features features_1_3{}; - // Configure properties. properties.properties = physical.GetProperties(); @@ -996,16 +989,6 @@ bool Device::GetSuitability(bool requires_swapchain) { // Set next pointer. void** next = &features2.pNext; - // Vulkan 1.2 and 1.3 features - if (instance_version >= VK_API_VERSION_1_2) { - features_1_2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - features_1_3.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; - - features_1_2.pNext = &features_1_3; - - *next = &features_1_2; - } - // Test all features we know about. If the feature is not available in core at our // current API version, and was not enabled by an extension, skip testing the feature. // We set the structure sType explicitly here as it is zeroed by the constructor. diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 23dceceb26..fba45d2385 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -128,7 +128,6 @@ VK_DEFINE_HANDLE(VmaAllocator) EXTENSION_NAME(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME) \ EXTENSION_NAME(VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME) \ EXTENSION_NAME(VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME) \ - EXTENSION_NAME(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME) \ EXTENSION_NAME(VK_EXT_4444_FORMATS_EXTENSION_NAME) \ EXTENSION_NAME(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) \ EXTENSION_NAME(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME) \ @@ -364,11 +363,6 @@ public: return {count[0], count[1], count[2]}; } - /// Returns the maximum size for push constants. - VkDeviceSize GetMaxPushConstantsSize() const { - return properties.properties.limits.maxPushConstantsSize; - } - #define FN_MAX_LIMIT_LIST \ FN_MAX_LIMIT_ELEM(ComputeSharedMemorySize) \ FN_MAX_LIMIT_ELEM(PerStageDescriptorSampledImages) \ @@ -658,13 +652,6 @@ FN_MAX_LIMIT_LIST return properties.depth_stencil_resolve.independentResolveNone == VK_TRUE; } - /// Returns true if depth/stencil operations can be performed efficiently. - /// Either through shader export or hardware blits. - bool CanPerformDepthStencilOperations() const { - return extensions.shader_stencil_export || is_blit_depth24_stencil8_supported || - is_blit_depth32_stencil8_supported; - } - /// Returns true if the device supports VK_EXT_depth_range_unrestricted. bool IsExtDepthRangeUnrestrictedSupported() const { return extensions.depth_range_unrestricted; @@ -705,12 +692,6 @@ FN_MAX_LIMIT_LIST return extensions.transform_feedback && properties.transform_feedback.transformFeedbackDraw; } - /// Returns true if transform feedback query types are supported. - bool IsTransformFeedbackQueriesSupported() const { - return extensions.transform_feedback && - properties.transform_feedback.transformFeedbackQueries; - } - /// Returns true if the device supports VK_EXT_transform_feedback properly. bool AreTransformFeedbackGeometryStreamsSupported() const { return features.transform_feedback.geometryStreams; @@ -745,11 +726,6 @@ FN_MAX_LIMIT_LIST !features.border_color_swizzle.borderColorSwizzleFromImage; } - /// Returns true if borderColorSwizzleFromImage is available. - bool IsBorderColorSwizzleFromImageSupported() const { - return features.border_color_swizzle.borderColorSwizzleFromImage; - } - /// Returns true if the device supports VK_EXT_extended_dynamic_state. bool IsExtExtendedDynamicStateSupported() const { return extensions.extended_dynamic_state; @@ -764,11 +740,6 @@ FN_MAX_LIMIT_LIST return features.extended_dynamic_state2.extendedDynamicState2LogicOp; } - /// Returns true if the device supports VK_EXT_extended_dynamic_state3. - bool IsExtExtendedDynamicState3Supported() const { - return extensions.extended_dynamic_state3; - } - /// Returns true if the device supports VK_EXT_4444_formats. bool IsExt4444FormatsSupported() const { return features.format_a4b4g4r4.formatA4B4G4R4; @@ -973,10 +944,6 @@ FN_MAX_LIMIT_LIST bool MustEmulateBGR565() const; - bool HasExactDepthBiasControl() const { - return features.depth_bias_control.depthBiasExact; - } - u32 GetMaxVertexInputAttributes() const { return properties.properties.limits.maxVertexInputAttributes; } @@ -1029,23 +996,11 @@ FN_MAX_LIMIT_LIST return extensions.maintenance5; } - /// Returns true if polygon mode POINT supports gl_PointSize. - bool SupportsPolygonModePointSize() const { - return extensions.maintenance5 && properties.maintenance5.polygonModePointSize; - } - /// Returns true if depth/stencil swizzle ONE is supported. bool SupportsDepthStencilSwizzleOne() const { return extensions.maintenance5 && properties.maintenance5.depthStencilSwizzleOneSupport; } - /// Returns true if early fragment tests optimizations are available. - bool SupportsEarlyFragmentTests() const { - return extensions.maintenance5 && - properties.maintenance5.earlyFragmentMultisampleCoverageAfterSampleCounting && - properties.maintenance5.earlyFragmentSampleMaskTestBeforeSampleCounting; - } - /// Returns true if the device supports UINT8 index buffer conversion via compute shader. bool SupportsUint8Indices() const { return features.bit8_storage.storageBuffer8BitAccess && @@ -1197,8 +1152,6 @@ private: bool is_blit_depth32_stencil8_supported{}; ///< Support for blitting from and to D32S8. bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. bool is_integrated{}; ///< Is GPU an iGPU. - bool is_virtual{}; ///< Is GPU a virtual GPU. - bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device. bool has_broken_compute{}; ///< Compute shaders can cause crashes bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit bool has_broken_descriptor_aliasing{}; ///< Miscompiles descriptors aliased on one binding diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index a2ca3b7fa6..25c2218c53 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -85,15 +85,11 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkAcquireNextImageKHR); X(vkAllocateCommandBuffers); X(vkAllocateDescriptorSets); - X(vkAllocateMemory); X(vkBeginCommandBuffer); - X(vkBindBufferMemory); - X(vkBindImageMemory); X(vkCmdBeginConditionalRenderingEXT); X(vkCmdBeginQuery); X(vkCmdBeginRenderPass); X(vkCmdBeginTransformFeedbackEXT); - X(vkCmdBeginDebugUtilsLabelEXT); X(vkCmdBindDescriptorSets); X(vkCmdBindIndexBuffer); X(vkCmdBindIndexBuffer2KHR); @@ -121,7 +117,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdEndQuery); X(vkCmdEndRenderPass); X(vkCmdEndTransformFeedbackEXT); - X(vkCmdEndDebugUtilsLabelEXT); X(vkCmdFillBuffer); X(vkCmdPipelineBarrier2); X(vkCmdPushConstants); @@ -155,7 +150,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdSetDepthClampEnableEXT); X(vkCmdSetFrontFaceEXT); X(vkCmdSetLogicOpEXT); - X(vkCmdSetPatchControlPointsEXT); X(vkCmdSetLineWidth); X(vkCmdSetPrimitiveTopologyEXT); X(vkCmdSetStencilOpEXT); @@ -178,7 +172,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCreateFence); X(vkCreateFramebuffer); X(vkCreateGraphicsPipelines); - X(vkCreateImage); X(vkCreateImageView); X(vkCreatePipelineCache); X(vkCreatePipelineLayout); @@ -212,30 +205,21 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkEndCommandBuffer); X(vkFreeCommandBuffers); X(vkFreeDescriptorSets); - X(vkFreeMemory); X(vkGetBufferMemoryRequirements2); X(vkGetDeviceBufferMemoryRequirements); X(vkGetDeviceQueue); X(vkGetEventStatus); X(vkGetFenceStatus); - X(vkGetImageMemoryRequirements); X(vkGetPipelineCacheData); - X(vkGetMemoryFdKHR); -#ifdef _WIN32 - X(vkGetMemoryWin32HandleKHR); -#endif X(vkGetQueryPoolResults); X(vkGetPipelineExecutablePropertiesKHR); X(vkGetPipelineExecutableStatisticsKHR); X(vkGetSemaphoreCounterValue); - X(vkMapMemory); X(vkQueueBindSparse); X(vkQueueSubmit2); X(vkResetFences); X(vkResetQueryPool); X(vkSetDebugUtilsObjectNameEXT); - X(vkSetDebugUtilsObjectTagEXT); - X(vkUnmapMemory); X(vkUpdateDescriptorSetWithTemplate); X(vkUpdateDescriptorSets); X(vkGetBufferDeviceAddress); @@ -319,9 +303,7 @@ bool Load(VkInstance instance, InstanceDispatch& dld) noexcept { // These functions may fail to load depending on the enabled extensions. // Don't return a failure on these. X(vkCreateDebugUtilsMessengerEXT); - X(vkCreateDebugReportCallbackEXT); X(vkDestroyDebugUtilsMessengerEXT); - X(vkDestroyDebugReportCallbackEXT); X(vkDestroySurfaceKHR); X(vkGetPhysicalDeviceFeatures2); X(vkGetPhysicalDeviceFormatProperties2); @@ -334,10 +316,10 @@ bool Load(VkInstance instance, InstanceDispatch& dld) noexcept { X(vkGetSwapchainImagesKHR); X(vkQueuePresentKHR); - return X(vkCreateDevice) && X(vkDestroyDevice) && X(vkDestroyDevice) && + return X(vkCreateDevice) && X(vkDestroyDevice) && X(vkEnumerateDeviceExtensionProperties) && X(vkEnumeratePhysicalDevices) && X(vkGetDeviceProcAddr) && X(vkGetPhysicalDeviceFormatProperties) && - X(vkGetPhysicalDeviceMemoryProperties) && X(vkGetPhysicalDeviceMemoryProperties2) && + X(vkGetPhysicalDeviceMemoryProperties2) && X(vkGetPhysicalDeviceProperties) && X(vkGetPhysicalDeviceQueueFamilyProperties); #undef X } @@ -379,10 +361,6 @@ void Destroy(VkDevice device, VkDescriptorUpdateTemplate handle, dld.vkDestroyDescriptorUpdateTemplate(device, handle, nullptr); } -void Destroy(VkDevice device, VkDeviceMemory handle, const DeviceDispatch& dld) noexcept { - dld.vkFreeMemory(device, handle, nullptr); -} - void Destroy(VkDevice device, VkEvent handle, const DeviceDispatch& dld) noexcept { dld.vkDestroyEvent(device, handle, nullptr); } @@ -444,11 +422,6 @@ void Destroy(VkInstance instance, VkDebugUtilsMessengerEXT handle, dld.vkDestroyDebugUtilsMessengerEXT(instance, handle, nullptr); } -void Destroy(VkInstance instance, VkDebugReportCallbackEXT handle, - const InstanceDispatch& dld) noexcept { - dld.vkDestroyDebugReportCallbackEXT(instance, handle, nullptr); -} - void Destroy(VkInstance instance, VkSurfaceKHR handle, const InstanceDispatch& dld) noexcept { dld.vkDestroySurfaceKHR(instance, handle, nullptr); } @@ -518,13 +491,6 @@ DebugUtilsMessenger Instance::CreateDebugUtilsMessenger( return DebugUtilsMessenger(object, handle, *dld); } -DebugReportCallback Instance::CreateDebugReportCallback( - const VkDebugReportCallbackCreateInfoEXT& create_info) const { - VkDebugReportCallbackEXT object; - Check(dld->vkCreateDebugReportCallbackEXT(handle, &create_info, nullptr, &object)); - return DebugReportCallback(object, handle, *dld); -} - void Image::SetObjectNameEXT(const char* name) const { SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_IMAGE, name); } @@ -565,36 +531,6 @@ void ImageView::SetObjectNameEXT(const char* name) const { SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_IMAGE_VIEW, name); } -int DeviceMemory::GetMemoryFdKHR() const { - const VkMemoryGetFdInfoKHR get_fd_info{ - .sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR, - .pNext = nullptr, - .memory = handle, - .handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, - }; - int fd; - Check(dld->vkGetMemoryFdKHR(owner, &get_fd_info, &fd)); - return fd; -} - -#ifdef _WIN32 -HANDLE DeviceMemory::GetMemoryWin32HandleKHR() const { - const VkMemoryGetWin32HandleInfoKHR get_win32_handle_info{ - .sType = VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR, - .pNext = nullptr, - .memory = handle, - .handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, - }; - HANDLE win32_handle; - Check(dld->vkGetMemoryWin32HandleKHR(owner, &get_win32_handle_info, &win32_handle)); - return win32_handle; -} -#endif - -void DeviceMemory::SetObjectNameEXT(const char* name) const { - SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_DEVICE_MEMORY, name); -} - void Fence::SetObjectNameEXT(const char* name) const { SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_FENCE, name); } @@ -835,36 +771,6 @@ SwapchainKHR Device::CreateSwapchainKHR(const VkSwapchainCreateInfoKHR& ci) cons return SwapchainKHR(object, handle, *dld); } -DeviceMemory Device::TryAllocateMemory(const VkMemoryAllocateInfo& ai) const noexcept { - VkDeviceMemory memory; - if (dld->vkAllocateMemory(handle, &ai, nullptr, &memory) != VK_SUCCESS) { - return {}; - } - return DeviceMemory(memory, handle, *dld); -} - -DeviceMemory Device::AllocateMemory(const VkMemoryAllocateInfo& ai) const { - VkDeviceMemory memory; - Check(dld->vkAllocateMemory(handle, &ai, nullptr, &memory)); - return DeviceMemory(memory, handle, *dld); -} - -VkMemoryRequirements Device::GetBufferMemoryRequirements(VkBuffer buffer, - void* pnext) const noexcept { - const VkBufferMemoryRequirementsInfo2 info{ - .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, - .pNext = nullptr, - .buffer = buffer, - }; - VkMemoryRequirements2 requirements{ - .sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - .pNext = pnext, - .memoryRequirements{}, - }; - dld->vkGetBufferMemoryRequirements2(handle, &info, &requirements); - return requirements.memoryRequirements; -} - VkMemoryRequirements Device::GetDeviceBufferMemoryRequirements( const VkBufferCreateInfo& ci) const noexcept { const VkDeviceBufferMemoryRequirements info{ @@ -881,12 +787,6 @@ VkMemoryRequirements Device::GetDeviceBufferMemoryRequirements( return requirements.memoryRequirements; } -VkMemoryRequirements Device::GetImageMemoryRequirements(VkImage image) const noexcept { - VkMemoryRequirements requirements; - dld->vkGetImageMemoryRequirements(handle, image, &requirements); - return requirements; -} - std::vector Device::GetPipelineExecutablePropertiesKHR( VkPipeline pipeline) const { const VkPipelineInfoKHR info{ @@ -938,14 +838,6 @@ void PhysicalDevice::GetProperties2(VkPhysicalDeviceProperties2& properties) con dld->vkGetPhysicalDeviceProperties2(physical_device, &properties); } -VkPhysicalDeviceFeatures PhysicalDevice::GetFeatures() const noexcept { - VkPhysicalDeviceFeatures2 features2; - features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; - features2.pNext = nullptr; - dld->vkGetPhysicalDeviceFeatures2(physical_device, &features2); - return features2.features; -} - void PhysicalDevice::GetFeatures2(VkPhysicalDeviceFeatures2& features) const noexcept { dld->vkGetPhysicalDeviceFeatures2(physical_device, &features); } diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 9c60f03fd2..48b4b42221 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -169,10 +169,8 @@ struct InstanceDispatch { PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties{}; PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT{}; - PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT{}; PFN_vkCreateDevice vkCreateDevice{}; PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT{}; - PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT{}; PFN_vkDestroyDevice vkDestroyDevice{}; PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR{}; PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties{}; @@ -181,7 +179,6 @@ struct InstanceDispatch { PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2{}; PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties{}; PFN_vkGetPhysicalDeviceFormatProperties2 vkGetPhysicalDeviceFormatProperties2{}; - PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties{}; PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2{}; PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties{}; PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2{}; @@ -200,12 +197,8 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR{}; PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers{}; PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets{}; - PFN_vkAllocateMemory vkAllocateMemory{}; PFN_vkBeginCommandBuffer vkBeginCommandBuffer{}; - PFN_vkBindBufferMemory vkBindBufferMemory{}; - PFN_vkBindImageMemory vkBindImageMemory{}; PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT{}; - PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT{}; PFN_vkCmdBeginQuery vkCmdBeginQuery{}; PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass{}; PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT{}; @@ -234,7 +227,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount{}; PFN_vkCmdDrawIndirectByteCountEXT vkCmdDrawIndirectByteCountEXT{}; PFN_vkCmdEndConditionalRenderingEXT vkCmdEndConditionalRenderingEXT{}; - PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT{}; PFN_vkCmdEndQuery vkCmdEndQuery{}; PFN_vkCmdEndRenderPass vkCmdEndRenderPass{}; PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT{}; @@ -260,13 +252,11 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdSetConservativeRasterizationModeEXT vkCmdSetConservativeRasterizationModeEXT{}; PFN_vkCmdSetLineRasterizationModeEXT vkCmdSetLineRasterizationModeEXT{}; PFN_vkCmdSetLineStippleEnableEXT vkCmdSetLineStippleEnableEXT{}; - PFN_vkCmdSetLineStippleEXT vkCmdSetLineStippleEXT{}; PFN_vkCmdSetDepthBiasEnableEXT vkCmdSetDepthBiasEnableEXT{}; PFN_vkCmdSetLogicOpEnableEXT vkCmdSetLogicOpEnableEXT{}; PFN_vkCmdSetDepthClampEnableEXT vkCmdSetDepthClampEnableEXT{}; PFN_vkCmdSetEvent2 vkCmdSetEvent2{}; PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT{}; - PFN_vkCmdSetPatchControlPointsEXT vkCmdSetPatchControlPointsEXT{}; PFN_vkCmdSetLogicOpEXT vkCmdSetLogicOpEXT{}; PFN_vkCmdSetLineWidth vkCmdSetLineWidth{}; PFN_vkCmdSetPrimitiveTopologyEXT vkCmdSetPrimitiveTopologyEXT{}; @@ -294,7 +284,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCreateFence vkCreateFence{}; PFN_vkCreateFramebuffer vkCreateFramebuffer{}; PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines{}; - PFN_vkCreateImage vkCreateImage{}; PFN_vkCreateImageView vkCreateImageView{}; PFN_vkCreatePipelineCache vkCreatePipelineCache{}; PFN_vkCreatePipelineLayout vkCreatePipelineLayout{}; @@ -328,30 +317,21 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkEndCommandBuffer vkEndCommandBuffer{}; PFN_vkFreeCommandBuffers vkFreeCommandBuffers{}; PFN_vkFreeDescriptorSets vkFreeDescriptorSets{}; - PFN_vkFreeMemory vkFreeMemory{}; PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2{}; PFN_vkGetDeviceBufferMemoryRequirements vkGetDeviceBufferMemoryRequirements{}; PFN_vkGetDeviceQueue vkGetDeviceQueue{}; PFN_vkGetEventStatus vkGetEventStatus{}; PFN_vkGetFenceStatus vkGetFenceStatus{}; - PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements{}; PFN_vkGetPipelineCacheData vkGetPipelineCacheData{}; - PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR{}; -#ifdef _WIN32 - PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR{}; -#endif PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR{}; PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR{}; PFN_vkGetQueryPoolResults vkGetQueryPoolResults{}; PFN_vkGetSemaphoreCounterValue vkGetSemaphoreCounterValue{}; - PFN_vkMapMemory vkMapMemory{}; PFN_vkQueueBindSparse vkQueueBindSparse{}; PFN_vkQueueSubmit2 vkQueueSubmit2{}; PFN_vkResetFences vkResetFences{}; PFN_vkResetQueryPool vkResetQueryPool{}; PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT{}; - PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT{}; - PFN_vkUnmapMemory vkUnmapMemory{}; PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate{}; PFN_vkGetBufferDeviceAddress vkGetBufferDeviceAddress{}; PFN_vkGetDescriptorSetLayoutSizeEXT vkGetDescriptorSetLayoutSizeEXT{}; @@ -381,7 +361,6 @@ void Destroy(VkDevice, VkCommandPool, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorPool, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorSetLayout, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorUpdateTemplate, const DeviceDispatch&) noexcept; -void Destroy(VkDevice, VkDeviceMemory, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkEvent, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkFence, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkFramebuffer, const DeviceDispatch&) noexcept; @@ -397,7 +376,6 @@ void Destroy(VkDevice, VkSwapchainKHR, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkSemaphore, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkShaderModule, const DeviceDispatch&) noexcept; void Destroy(VkInstance, VkDebugUtilsMessengerEXT, const InstanceDispatch&) noexcept; -void Destroy(VkInstance, VkDebugReportCallbackEXT, const InstanceDispatch&) noexcept; void Destroy(VkInstance, VkSurfaceKHR, const InstanceDispatch&) noexcept; VkResult Free(VkDevice, VkDescriptorPool, Span, const DeviceDispatch&) noexcept; @@ -635,7 +613,6 @@ private: }; using DebugUtilsMessenger = Handle; -using DebugReportCallback = Handle; using DescriptorSetLayout = Handle; using DescriptorUpdateTemplate = Handle; using Pipeline = Handle; @@ -668,11 +645,6 @@ public: [[nodiscard]] DebugUtilsMessenger CreateDebugUtilsMessenger( const VkDebugUtilsMessengerCreateInfoEXT& create_info) const; - /// Creates a debug report callback. - /// @throw Exception on creation failure. - [[nodiscard]] DebugReportCallback CreateDebugReportCallback( - const VkDebugReportCallbackCreateInfoEXT& create_info) const; - /// Returns dispatch table. const InstanceDispatch& Dispatch() const noexcept { return *dld; @@ -880,30 +852,6 @@ public: void SetObjectNameEXT(const char* name) const; }; -class DeviceMemory : public Handle { - using Handle::Handle; - -public: - int GetMemoryFdKHR() const; - -#ifdef _WIN32 - HANDLE GetMemoryWin32HandleKHR() const; -#endif - - /// Set object name. - void SetObjectNameEXT(const char* name) const; - - u8* Map(VkDeviceSize offset, VkDeviceSize size) const { - void* data; - Check(dld->vkMapMemory(owner, handle, offset, size, 0, &data)); - return static_cast(data); - } - - void Unmap() const noexcept { - dld->vkUnmapMemory(owner, handle); - } -}; - class Fence : public Handle { using Handle::Handle; @@ -1088,17 +1036,8 @@ public: [[nodiscard]] SwapchainKHR CreateSwapchainKHR(const VkSwapchainCreateInfoKHR& ci) const; - [[nodiscard]] DeviceMemory TryAllocateMemory(const VkMemoryAllocateInfo& ai) const noexcept; - - [[nodiscard]] DeviceMemory AllocateMemory(const VkMemoryAllocateInfo& ai) const; - - VkMemoryRequirements GetBufferMemoryRequirements(VkBuffer buffer, - void* pnext = nullptr) const noexcept; - VkMemoryRequirements GetDeviceBufferMemoryRequirements(const VkBufferCreateInfo& ci) const noexcept; - VkMemoryRequirements GetImageMemoryRequirements(VkImage image) const noexcept; - std::vector GetPipelineExecutablePropertiesKHR( VkPipeline pipeline) const; @@ -1179,8 +1118,6 @@ public: void GetProperties2(VkPhysicalDeviceProperties2&) const noexcept; - VkPhysicalDeviceFeatures GetFeatures() const noexcept; - void GetFeatures2(VkPhysicalDeviceFeatures2&) const noexcept; VkFormatProperties GetFormatProperties(VkFormat) const noexcept; @@ -1566,11 +1503,6 @@ public: dld->vkCmdSetLineStippleEnableEXT(handle, enable ? VK_TRUE : VK_FALSE); } - void SetLineStippleEXT(u32 factor, u16 pattern) const noexcept - { - dld->vkCmdSetLineStippleEXT(handle, factor, pattern); - } - void SetDepthBiasEnableEXT(bool enable) const noexcept { dld->vkCmdSetDepthBiasEnableEXT(handle, enable ? VK_TRUE : VK_FALSE); } @@ -1599,10 +1531,6 @@ public: dld->vkCmdSetLogicOpEXT(handle, logic_op); } - void SetPatchControlPointsEXT(uint32_t patch_control_points) const noexcept { - dld->vkCmdSetPatchControlPointsEXT(handle, patch_control_points); - } - void SetColorWriteMaskEXT(u32 first, Span masks) const noexcept { dld->vkCmdSetColorWriteMaskEXT(handle, first, masks.size(), masks.data()); } @@ -1673,20 +1601,6 @@ public: dld->vkCmdEndConditionalRenderingEXT(handle); } - void BeginDebugUtilsLabelEXT(const char* label, std::span color) const noexcept { - const VkDebugUtilsLabelEXT label_info{ - .sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, - .pNext = nullptr, - .pLabelName = label, - .color{color[0], color[1], color[2], color[3]}, - }; - dld->vkCmdBeginDebugUtilsLabelEXT(handle, &label_info); - } - - void EndDebugUtilsLabelEXT() const noexcept { - dld->vkCmdEndDebugUtilsLabelEXT(handle); - } - private: VkCommandBuffer handle; const DeviceDispatch* dld; From 98ad2d5e4c20e246056281a3288ced8e97ab253a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 24 Sep 2026 15:31:51 -0400 Subject: [PATCH 090/198] Quick tests on payloads --- src/shader_recompiler/ir_opt/texture_pass.cpp | 8 ++++---- src/video_core/gpu.cpp | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index fe34a67555..82e1c1c39e 100644 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp @@ -33,7 +33,8 @@ using TextureInstVector = boost::container::small_vector; constexpr u32 DESCRIPTOR_SIZE = 8; constexpr u32 DESCRIPTOR_SIZE_SHIFT = u32(std::countr_zero(DESCRIPTOR_SIZE)); -constexpr u32 DESCRIPTOR_MAX_COUNT = 1024; +constexpr u32 DESCRIPTOR_MAX_COUNT = 512; +constexpr u32 DESCRIPTOR_CBUF_BYTES = 16 * 1024; u32 DynamicDescriptorSizeShift(const IR::U32& dynamic_offset) { const IR::Inst* const inst = dynamic_offset.InstRecursive(); @@ -48,11 +49,10 @@ u32 DynamicDescriptorSizeShift(const IR::U32& dynamic_offset) { u32 DynamicDescriptorCount(u32 base_offset, u32 size_shift, u32 max_descriptors) { auto const descriptor_limit = (std::max)(1U, max_descriptors); - auto const max_cbuf_bytes = 16 * descriptor_limit; - if (size_shift >= 31 || base_offset >= max_cbuf_bytes) + if (size_shift >= 31 || base_offset >= DESCRIPTOR_CBUF_BYTES) return 1; auto const stride = 1U << size_shift; - auto const available = max_cbuf_bytes - base_offset; + auto const available = DESCRIPTOR_CBUF_BYTES - base_offset; if (available < DESCRIPTOR_SIZE) return 1; auto const available_count = 1U + (available - DESCRIPTOR_SIZE) / stride; diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 9901cf4262..eb834308e0 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -152,6 +152,10 @@ struct GPU::Impl { /// Tick pending requests within the GPU. void TickWork() { + if (last_sync_fence.load(std::memory_order_relaxed) == + current_sync_fence.load(std::memory_order_relaxed)) { + return; + } std::unique_lock lck{sync_request_mutex}; while (!sync_requests.empty()) { auto request = std::move(sync_requests.front()); @@ -328,7 +332,7 @@ struct GPU::Impl { std::list> sync_requests; std::atomic current_sync_fence{}; - u64 last_sync_fence{}; + std::atomic last_sync_fence{}; std::mutex sync_request_mutex; std::condition_variable sync_request_cv; From 108c991431a14b584b5e496be995938b934216da Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 24 Sep 2026 17:57:47 -0400 Subject: [PATCH 091/198] Experiment on descriptors payloads --- src/shader_recompiler/ir_opt/texture_pass.cpp | 2 +- .../renderer_opengl/gl_texture_cache.h | 1 - .../renderer_vulkan/vk_descriptor_buffer.h | 6 +-- .../renderer_vulkan/vk_texture_cache.h | 1 - .../texture_cache/descriptor_table.h | 54 +++++++++++-------- src/video_core/texture_cache/texture_cache.h | 40 +++++--------- .../texture_cache/texture_cache_base.h | 5 -- 7 files changed, 47 insertions(+), 62 deletions(-) diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index 82e1c1c39e..0228ce117d 100644 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp @@ -33,7 +33,7 @@ using TextureInstVector = boost::container::small_vector; constexpr u32 DESCRIPTOR_SIZE = 8; constexpr u32 DESCRIPTOR_SIZE_SHIFT = u32(std::countr_zero(DESCRIPTOR_SIZE)); -constexpr u32 DESCRIPTOR_MAX_COUNT = 512; +constexpr u32 DESCRIPTOR_MAX_COUNT = 128; constexpr u32 DESCRIPTOR_CBUF_BYTES = 16 * 1024; u32 DynamicDescriptorSizeShift(const IR::U32& dynamic_offset) { diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 9f3b244a8d..7c7ee14580 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -364,7 +364,6 @@ private: }; struct TextureCacheParams { - static constexpr bool ENABLE_VALIDATION = true; static constexpr bool FRAMEBUFFER_BLITS = true; static constexpr bool HAS_EMULATED_COPIES = true; static constexpr bool HAS_DEVICE_MEMORY_INFO = true; diff --git a/src/video_core/renderer_vulkan/vk_descriptor_buffer.h b/src/video_core/renderer_vulkan/vk_descriptor_buffer.h index 6f96bcc326..4cde5abcd4 100644 --- a/src/video_core/renderer_vulkan/vk_descriptor_buffer.h +++ b/src/video_core/renderer_vulkan/vk_descriptor_buffer.h @@ -17,9 +17,9 @@ class Device; class Scheduler; class DescriptorBufferRing final { - static constexpr size_t FRAMES_IN_FLIGHT = 8; - static constexpr VkDeviceSize TILER_FRAME_SIZE = 2 * 1024 * 1024; - static constexpr VkDeviceSize DESKTOP_FRAME_SIZE = 4 * 1024 * 1024; + static constexpr size_t FRAMES_IN_FLIGHT = 3; + static constexpr VkDeviceSize TILER_FRAME_SIZE = 5 * 1024 * 1024; + static constexpr VkDeviceSize DESKTOP_FRAME_SIZE = 8 * 1024 * 1024; public: explicit DescriptorBufferRing(const Device& device_, MemoryAllocator& memory_allocator); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 67cf67872b..06ce5a5c32 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -552,7 +552,6 @@ private: }; struct TextureCacheParams { - static constexpr bool ENABLE_VALIDATION = true; static constexpr bool FRAMEBUFFER_BLITS = false; static constexpr bool HAS_EMULATED_COPIES = false; static constexpr bool HAS_DEVICE_MEMORY_INFO = true; diff --git a/src/video_core/texture_cache/descriptor_table.h b/src/video_core/texture_cache/descriptor_table.h index e40c128ab5..ec310803f4 100644 --- a/src/video_core/texture_cache/descriptor_table.h +++ b/src/video_core/texture_cache/descriptor_table.h @@ -7,12 +7,16 @@ #pragma once #include +#include +#include +#include #include #include "common/alignment.h" #include "common/common_types.h" #include "common/div_ceil.h" #include "common/assert.h" +#include "common/slot_vector.h" #include "video_core/memory_manager.h" #include "video_core/rasterizer_interface.h" @@ -21,6 +25,12 @@ namespace VideoCommon { template class DescriptorTable { public: + struct Entry { + T descriptor; + Common::SlotId id; + u32 generation; + }; + [[nodiscard]] bool Synchronize(GPUVAddr gpu_addr, u32 limit) noexcept { bool ret = !(current_gpu_addr == gpu_addr && current_limit == limit); if (ret) { @@ -30,44 +40,42 @@ public: } void Invalidate() noexcept { - std::ranges::fill(read_descriptors, 0); + ++generation; } - [[nodiscard]] std::pair Read(Tegra::MemoryManager const& gpu_memory, u32 index) noexcept { + [[nodiscard]] std::pair Read(Tegra::MemoryManager const& gpu_memory, u32 index) noexcept { DEBUG_ASSERT(index <= current_limit); const GPUVAddr gpu_addr = current_gpu_addr + index * sizeof(T); - std::pair result; - gpu_memory.ReadBlockUnsafe(gpu_addr, std::addressof(result.first), sizeof(T)); - if ((read_descriptors[index / 64] & (1ULL << (index % 64))) != 0) { - result.second = result.first != descriptors[index]; - } else { - read_descriptors[index / 64] |= 1ULL << (index % 64); - result.second = true; + T value{}; + if (!aligned) { + gpu_memory.ReadBlockUnsafe(gpu_addr, std::addressof(value), sizeof(T)); + } else if (const u8* const ptr = gpu_memory.GetPointer(gpu_addr)) { + std::memcpy(std::addressof(value), ptr, sizeof(T)); } - if (result.second) { - descriptors[index] = result.first; + Entry& entry = entries[index]; + const bool is_new = entry.generation != generation || entry.descriptor != value; + if (is_new) { + entry.descriptor = value; + entry.generation = generation; } - return result; + return {entry, is_new}; } void Refresh(GPUVAddr gpu_addr, u32 limit) noexcept { current_gpu_addr = gpu_addr; current_limit = limit; - // Mario Brothership reallocates a lot of times, so use aggressive pre-alloc sizes - // std::vector by default uses quadratic growth, but that isn't even enough to satisfy brothership - const size_t num_descriptors = ((limit + 0x80000) & (~0x7ffff)) + 1; - size_t old_size = read_descriptors.size(); - read_descriptors.resize(Common::DivCeil(num_descriptors, 64U)); - old_size = (std::min)(old_size, read_descriptors.size()); - std::fill(read_descriptors.begin(), read_descriptors.begin() + old_size, 0); - // - descriptors.resize(num_descriptors); + aligned = gpu_addr % sizeof(T) == 0; + ++generation; + if (entries.size() <= limit) { + entries.resize(std::bit_ceil(size_t{limit} + 1)); + } } - std::vector read_descriptors; - std::vector descriptors; + std::vector entries; GPUVAddr current_gpu_addr{}; u32 current_limit{}; + u32 generation{1}; + bool aligned{}; }; } // namespace VideoCommon diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 4092036b9e..2b25184d9b 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -270,14 +270,11 @@ SamplerId TextureCache

::GetSamplerId(u32 index, bool compute) { LOG_DEBUG(HW_GPU, "Invalid sampler index={}", index); return NULL_SAMPLER_ID; } - auto const map_index = index | (compute ? Common::SlotId::TAGGED_VALUE : 0); - auto const [descriptor, is_new] = table.Read(*gpu_memory, index); + auto const [entry, is_new] = table.Read(*gpu_memory, index); if (is_new) { - auto const id = FindSampler(descriptor, compute); - channel_state->sampler_ids.insert_or_assign(map_index, id); - return id; + entry.id = FindSampler(entry.descriptor, compute); } - return channel_state->sampler_ids.find(map_index)->second; + return entry.id; } template @@ -500,26 +497,19 @@ ImageViewId TextureCache

::VisitImageView(u32 index, bool compute) { LOG_DEBUG(HW_GPU, "Invalid image view index={}", index); return NULL_IMAGE_VIEW_ID; } - auto const map_index = index | (compute ? Common::SlotId::TAGGED_VALUE : 0); - // Is new (on the tegra engine side)? - auto const [descriptor, is_new] = table.Read(*gpu_memory, index); + auto const [entry, is_new] = table.Read(*gpu_memory, index); if (is_new) { - if (IsValidEntry(*gpu_memory, descriptor)) { - // Is new (registered view) on the texture cache side? - const auto [pair, is_new_tc] = channel_state->image_views.try_emplace(descriptor); + entry.id = NULL_IMAGE_VIEW_ID; + if (IsValidEntry(*gpu_memory, entry.descriptor)) { + const auto [pair, is_new_tc] = channel_state->image_views.try_emplace(entry.descriptor); if (is_new_tc) - pair->second = CreateImageView(descriptor); - PrepareImageView(pair->second, false, false); - channel_state->image_view_ids.insert_or_assign(map_index, pair->second); - return pair->second; + pair->second = CreateImageView(entry.descriptor); + entry.id = pair->second; } - channel_state->image_view_ids.insert_or_assign(map_index, NULL_IMAGE_VIEW_ID); - return NULL_IMAGE_VIEW_ID; } - auto const it = channel_state->image_view_ids.find(map_index); - if (it->second != NULL_IMAGE_VIEW_ID) - PrepareImageView(it->second, false, false); - return it->second; + if (entry.id != NULL_IMAGE_VIEW_ID) + PrepareImageView(entry.id, false, false); + return entry.id; } template @@ -1296,9 +1286,6 @@ void TextureCache

::InvalidateScale(Image& image) { for (size_t c : active_channel_ids) { auto& channel_info = channel_storage[c]; - if constexpr (ENABLE_VALIDATION) - for (auto& e : channel_info.image_view_ids) - e.second = CORRUPT_ID; channel_info.graphics_image_table.Invalidate(); channel_info.compute_image_table.Invalidate(); } @@ -2295,9 +2282,6 @@ void TextureCache

::DeleteImage(ImageId image_id, bool immediate_delete) { } for (size_t c : active_channel_ids) { auto& channel_info = channel_storage[c]; - if constexpr (ENABLE_VALIDATION) - for (auto& e : channel_info.image_view_ids) - e.second = CORRUPT_ID; channel_info.graphics_image_table.Invalidate(); channel_info.compute_image_table.Invalidate(); } diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 7a46134490..b51f03e532 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -89,9 +89,6 @@ public: std::unordered_map image_views; std::unordered_map samplers; - ::Common::unordered_map sampler_ids; - ::Common::unordered_map image_view_ids; - TextureCacheGPUMap* gpu_page_table = nullptr; TextureCacheGPUMap* sparse_page_table = nullptr; }; @@ -101,8 +98,6 @@ class TextureCache : public VideoCommon::ChannelSetupCaches Date: Thu, 24 Sep 2026 19:13:52 -0400 Subject: [PATCH 092/198] Another try on sparse binding --- src/video_core/buffer_cache/buffer_base.h | 11 ++++++ src/video_core/buffer_cache/buffer_cache.h | 35 +++++++++++++------ .../buffer_cache/buffer_cache_base.h | 3 +- .../renderer_vulkan/vk_buffer_cache.cpp | 1 + .../renderer_vulkan/vk_buffer_cache.h | 6 +--- .../renderer_vulkan/vk_multi_range_buffer.cpp | 11 +----- .../renderer_vulkan/vk_multi_range_buffer.h | 8 ++--- .../renderer_vulkan/vk_query_cache.cpp | 1 + 8 files changed, 44 insertions(+), 32 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h index d7eb21612f..6b2a37ea8c 100644 --- a/src/video_core/buffer_cache/buffer_base.h +++ b/src/video_core/buffer_cache/buffer_base.h @@ -129,13 +129,24 @@ public: write_tick = write_tick_; } + u64 ContentSerial() const noexcept { + return content_serial; + } + + void MarkContentModified() noexcept { + content_serial = ++next_content_serial; + } + private: + static inline u64 next_content_serial = 0; + VAddr cpu_addr = 0; BufferFlagBits flags{}; int stream_score = 0; size_t lru_id = SIZE_MAX; size_t size_bytes = 0; u64 write_tick = 0; + u64 content_serial = ++next_content_serial; }; } // namespace VideoCommon diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index eb214af50e..89d0003207 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -266,6 +266,7 @@ bool BufferCache

::DMACopy(GPUVAddr src_address, GPUVAddr dest_address, u64 am const auto& copy = copies[0]; src_buffer.MarkUsage(copy.src_offset, copy.size); dest_buffer.MarkUsage(copy.dst_offset, copy.size); + dest_buffer.MarkContentModified(); runtime.CopyBuffer(dest_buffer, src_buffer, copies, true); if (has_new_downloads) { memory_tracker.MarkRegionAsGpuModified(*cpu_dest_address, amount); @@ -297,6 +298,7 @@ bool BufferCache

::DMAClear(GPUVAddr dst_address, u64 amount, u32 value) { const u32 offset = dest_buffer.Offset(*cpu_dst_address); runtime.ClearBuffer(dest_buffer, offset, size, value); dest_buffer.MarkUsage(offset, size); + dest_buffer.MarkContentModified(); return true; } @@ -773,6 +775,7 @@ void BufferCache

::BindHostIndexBuffer() { if (draw_state.inline_index_draw_indexes.empty()) { SynchronizeBuffer(buffer, channel_state->index_buffer.device_addr, size); } else { + buffer.MarkContentModified(); if constexpr (USE_MEMORY_MAPS_FOR_UPLOADS) { auto upload_staging = runtime.UploadStagingBuffer(size); std::array copies{{BufferCopy{.src_offset = upload_staging.offset, .dst_offset = 0, .size = size}}}; @@ -1029,11 +1032,13 @@ void BufferCache

::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 template void BufferCache

::ResolveMultiRangeStorage(Binding& binding, - std::vector& pool) { + std::vector& pool, + bool is_written) { binding.segment_first = 0; binding.segment_count = 0; if constexpr (requires { runtime.BindMultiRangeStorageBuffer(u64{}, bool{}); }) { - if (binding.gpu_addr == 0 || binding.size == 0) { + if (binding.gpu_addr == 0 || binding.size == 0 || + (is_written && !runtime.PrefersSparseSources())) { return; } const VirtualSegments* found = @@ -1041,7 +1046,7 @@ void BufferCache

::ResolveMultiRangeStorage(Binding& binding, if (!found || found->size() < 2) { return; } - const VirtualSegments segments = *found; + const VirtualSegments& segments = *found; const u32 first = static_cast(pool.size()); const bool prefer_sparse = runtime.PrefersSparseSources(); for (const VirtualSegment& segment : segments) { @@ -1078,9 +1083,7 @@ bool BufferCache

::BindMultiRangeStorage(const Binding& binding, bool is_writt const MultiRangeSegment& segment = pool[binding.segment_first + index]; Buffer& buffer = slot_buffers[segment.buffer_id]; TouchBuffer(buffer, segment.buffer_id); - if (SynchronizeBuffer(buffer, segment.device_addr, segment.size)) { - runtime.InvalidateMultiRange(key); - } + SynchronizeBuffer(buffer, segment.device_addr, segment.size); const u32 offset = buffer.Offset(segment.device_addr); buffer.MarkUsage(offset, segment.size); if (is_written) { @@ -1456,9 +1459,12 @@ void BufferCache

::UpdateStorageBuffers(size_t stage) { ForEachEnabledBit(channel_state->enabled_storage_buffers[stage], [&](u32 index) { // Resolve buffer Binding& binding = channel_state->storage_buffers[stage][index]; - const BufferId buffer_id = FindBuffer(binding.device_addr, binding.size, false); - binding.buffer_id = buffer_id; - ResolveMultiRangeStorage(binding, graphics_segments); + const bool is_written = ((channel_state->written_storage_buffers[stage] >> index) & 1) != 0; + ResolveMultiRangeStorage(binding, graphics_segments, is_written); + binding.buffer_id = NULL_BUFFER_ID; + if (binding.segment_count == 0 || is_written) { + binding.buffer_id = FindBuffer(binding.device_addr, binding.size, false); + } }); } @@ -1521,8 +1527,12 @@ void BufferCache

::UpdateComputeStorageBuffers() { ForEachEnabledBit(channel_state->enabled_compute_storage_buffers, [&](u32 index) { // Resolve buffer Binding& binding = channel_state->compute_storage_buffers[index]; - binding.buffer_id = FindBuffer(binding.device_addr, binding.size, false); - ResolveMultiRangeStorage(binding, compute_segments); + const bool is_written = ((channel_state->written_compute_storage_buffers >> index) & 1) != 0; + ResolveMultiRangeStorage(binding, compute_segments, is_written); + binding.buffer_id = NULL_BUFFER_ID; + if (binding.segment_count == 0 || is_written) { + binding.buffer_id = FindBuffer(binding.device_addr, binding.size, false); + } }); } @@ -1539,6 +1549,7 @@ void BufferCache

::MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u3 if constexpr (!IS_OPENGL) { Buffer& buffer = slot_buffers[buffer_id]; buffer.setWriteTick(runtime.CurrentTick()); + buffer.MarkContentModified(); } memory_tracker.MarkRegionAsGpuModified(device_addr, size); gpu_modified_ranges.Add(device_addr, size); @@ -1784,6 +1795,7 @@ bool BufferCache

::SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 si template void BufferCache

::UploadMemory(Buffer& buffer, u64 total_size_bytes, u64 largest_copy, std::span copies) { + buffer.MarkContentModified(); if constexpr (USE_MEMORY_MAPS_FOR_UPLOADS) { MappedUploadMemory(buffer, total_size_bytes, copies); } else { @@ -1869,6 +1881,7 @@ void BufferCache

::InlineMemoryImplementation(DAddr dest_address, size_t copy_ BufferId buffer_id = FindBuffer(dest_address, static_cast(copy_size), false); auto& buffer = slot_buffers[buffer_id]; SynchronizeBuffer(buffer, dest_address, static_cast(copy_size)); + buffer.MarkContentModified(); if constexpr (USE_MEMORY_MAPS_FOR_UPLOADS) { auto upload_staging = runtime.UploadStagingBuffer(copy_size); diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index b4af2820d5..80a0b2c7eb 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -235,7 +235,8 @@ public: - void ResolveMultiRangeStorage(Binding& binding, std::vector& pool); + void ResolveMultiRangeStorage(Binding& binding, std::vector& pool, + bool is_written); void UnmapGPUMemory(size_t as_id, GPUVAddr gpu_addr, size_t size); diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index dec26f328d..d3d3d7a437 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -428,6 +428,7 @@ u32 BufferCacheRuntime::GetStorageBufferAlignment() const { } void BufferCacheRuntime::TickFrame(Common::SlotVector& slot_buffers) noexcept { + multi_range_buffers.DrainRetired(scheduler); for (auto it = slot_buffers.begin(); it != slot_buffers.end(); it++) { if (scheduler.IsFree(it->LastUsageTick())) { it->ResetUsageTracking(); diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index 582f665b4e..f83696f0de 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -192,7 +192,7 @@ public: .memory_offset = location.offset, .offset = offset, .size = size, - .write_tick = buffer.getWriteTick(), + .content_serial = buffer.ContentSerial(), .memory_type = location.memory_type, }); multi_range_total += size; @@ -200,10 +200,6 @@ public: bool BindMultiRangeStorageBuffer(u64 key, bool is_written); - void InvalidateMultiRange(u64 key) { - multi_range_buffers.Invalidate(key); - } - void OnBufferDeleted(const Buffer& buffer) { multi_range_buffers.DropOwner(scheduler, buffer.Handle()); } diff --git a/src/video_core/renderer_vulkan/vk_multi_range_buffer.cpp b/src/video_core/renderer_vulkan/vk_multi_range_buffer.cpp index 6d1ae5fc53..68dcab9250 100644 --- a/src/video_core/renderer_vulkan/vk_multi_range_buffer.cpp +++ b/src/video_core/renderer_vulkan/vk_multi_range_buffer.cpp @@ -87,7 +87,7 @@ u64 MultiRangeBufferCache::HashSources(std::span sources u64 MultiRangeBufferCache::HashContent(std::span sources) const { u64 hash = 0xcbf29ce484222325ULL; for (const MultiRangeSource& source : sources) { - hash ^= source.write_tick; + hash ^= source.content_serial; hash *= 0x100000001b3ULL; } return hash; @@ -219,9 +219,6 @@ MultiRangeRef MultiRangeBufferCache::Get(const Device& device, Scheduler& schedu if (sources.empty() || total == 0) { return MultiRangeRef{}; } - if (!retired.empty()) { - DrainRetired(scheduler); - } const u64 geometry = HashSources(sources); const u64 content = HashContent(sources); const auto it = entries.find(key); @@ -335,10 +332,4 @@ void MultiRangeBufferCache::DropOwner(Scheduler& scheduler, VkBuffer owner) { } } -void MultiRangeBufferCache::Invalidate(u64 key) { - if (auto const it = entries.find(key); it != entries.end()) { - it->second.dirty = true; - } -} - } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_multi_range_buffer.h b/src/video_core/renderer_vulkan/vk_multi_range_buffer.h index f40d3aa1f8..d9c065df3f 100644 --- a/src/video_core/renderer_vulkan/vk_multi_range_buffer.h +++ b/src/video_core/renderer_vulkan/vk_multi_range_buffer.h @@ -27,7 +27,7 @@ struct MultiRangeSource { VkDeviceSize memory_offset{}; VkDeviceSize offset{}; VkDeviceSize size{}; - u64 write_tick{}; + u64 content_serial{}; u32 memory_type{}; }; @@ -55,10 +55,10 @@ public: void MarkGathered(u64 key); - void Invalidate(u64 key); - void DropOwner(Scheduler& scheduler, VkBuffer owner); + void DrainRetired(Scheduler& scheduler); + VkDeviceSize block_size{DEFAULT_BLOCK_SIZE}; bool use_sparse{}; @@ -94,8 +94,6 @@ private: void RetireEntry(Scheduler& scheduler, Entry& entry); - void DrainRetired(Scheduler& scheduler); - ::Common::unordered_map entries; boost::container::static_vector retired; u32 sparse_memory_type_bits{}; diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 7bdb5738c8..e14629dfc8 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -1654,6 +1654,7 @@ void QueryCacheRuntime::SyncValues(std::span values, VkBuffer ba const auto post_op = VideoCommon::ObtainBufferOperation::DoNothing; const auto [buffer, offset] = impl->buffer_cache.ObtainCPUBuffer( pair.first, static_cast(pair.second - pair.first), sync_info, post_op); + buffer->MarkContentModified(); impl->buffers_to_upload_to.emplace_back(buffer->Handle(), offset); } }); From 19298b713b9eef4e2264b90107f8dd01440d50fe Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 24 Sep 2026 23:28:37 -0400 Subject: [PATCH 093/198] Removal of WFI + address device creation crash on A6xx --- src/android/app/src/main/jni/native.cpp | 101 +++++++++--------- src/video_core/engines/sw_blitter/blitter.cpp | 3 +- .../renderer_vulkan/vk_rasterizer.cpp | 41 +------ .../renderer_vulkan/vk_rasterizer.h | 1 - .../vulkan_common/vulkan_wrapper.cpp | 31 ------ src/video_core/vulkan_common/vulkan_wrapper.h | 28 ----- 6 files changed, 52 insertions(+), 153 deletions(-) diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 746b00ad11..05b2f081eb 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -855,36 +855,53 @@ jboolean JNICALL Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_supportsCustomDri #endif } +#ifdef ARCHITECTURE_arm64 +namespace { + +struct SystemDriverInfo { + VkPhysicalDeviceProperties properties{}; + VkPhysicalDeviceDriverProperties driver{}; +}; + +SystemDriverInfo QuerySystemDriverInfo(JNIEnv* env, jstring j_hook_lib_dir) { + const std::string hook_lib_dir = Common::Android::GetJString(env, j_hook_lib_dir); + const Common::DynamicLibrary library{adrenotools_open_libvulkan( + RTLD_NOW, 0, nullptr, hook_lib_dir.c_str(), nullptr, nullptr, nullptr, nullptr)}; + Vulkan::vk::InstanceDispatch dld; + const Vulkan::vk::Instance instance = Vulkan::CreateInstance(library, dld, VK_API_VERSION_1_1); + const std::vector devices = instance.EnumeratePhysicalDevices(); + if (devices.empty()) { + throw Vulkan::vk::Exception(VK_ERROR_INITIALIZATION_FAILED); + } + SystemDriverInfo info{}; + info.driver.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES; + VkPhysicalDeviceProperties2 properties2{ + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, + .pNext = &info.driver, + .properties = {}, + }; + Vulkan::vk::PhysicalDevice(devices[0], dld).GetProperties2(properties2); + info.properties = properties2.properties; + return info; +} + +} +#endif + jobjectArray Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_getSystemDriverInfo( JNIEnv* env, jobject j_obj, jobject j_surf, jstring j_hook_lib_dir) { + std::string version_string{"1.1.0"}; + std::string driver_name{"generic"}; #ifdef ARCHITECTURE_arm64 - const char* file_redirect_dir_{}; - int featureFlags{}; - std::string hook_lib_dir = Common::Android::GetJString(env, j_hook_lib_dir); - auto handle = adrenotools_open_libvulkan(RTLD_NOW, featureFlags, nullptr, hook_lib_dir.c_str(), - nullptr, nullptr, file_redirect_dir_, nullptr); - auto driver_library = std::make_shared(handle); - InputCommon::InputSubsystem input_subsystem; - auto window = - std::make_unique(ANativeWindow_fromSurface(env, j_surf), driver_library); - - Vulkan::vk::InstanceDispatch dld; - Vulkan::vk::Instance vk_instance = Vulkan::CreateInstance( - *driver_library, dld, VK_API_VERSION_1_1, Core::Frontend::WindowSystemType::Android); - - auto surface = Vulkan::CreateSurface(vk_instance, window->GetWindowInfo()); - - auto device = Vulkan::CreateDevice(vk_instance, dld, *surface); - - auto driver_version = device.GetDriverVersion(); - auto version_string = - fmt::format("{}.{}.{}", VK_API_VERSION_MAJOR(driver_version), - VK_API_VERSION_MINOR(driver_version), VK_API_VERSION_PATCH(driver_version)); - auto driver_name = device.GetDriverName(); -#else - auto driver_version = "1.0.0"; - auto version_string = "1.1.0"; //Assume lowest Vulkan level - auto driver_name = "generic"; + try { + const SystemDriverInfo info = QuerySystemDriverInfo(env, j_hook_lib_dir); + const u32 driver_version = info.properties.driverVersion; + version_string = + fmt::format("{}.{}.{}", VK_API_VERSION_MAJOR(driver_version), + VK_API_VERSION_MINOR(driver_version), VK_API_VERSION_PATCH(driver_version)); + driver_name = Vulkan::vk::GetDriverName(info.driver); + } catch (...) { + } #endif jobjectArray j_driver_info = env->NewObjectArray(2, Common::Android::GetStringClass(), Common::Android::ToJString(env, version_string)); env->SetObjectArrayElement(j_driver_info, 1, Common::Android::ToJString(env, driver_name)); @@ -893,32 +910,12 @@ jobjectArray Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_getSystemDriverInfo( jstring Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_getGpuModel(JNIEnv *env, jobject j_obj, jobject j_surf, jstring j_hook_lib_dir) { #ifdef ARCHITECTURE_arm64 - const char* file_redirect_dir_{}; - int featureFlags{}; - std::string hook_lib_dir = Common::Android::GetJString(env, j_hook_lib_dir); - auto handle = adrenotools_open_libvulkan(RTLD_NOW, featureFlags, nullptr, hook_lib_dir.c_str(), - nullptr, nullptr, file_redirect_dir_, nullptr); - auto driver_library = std::make_shared(handle); - InputCommon::InputSubsystem input_subsystem; - auto window = - std::make_unique(ANativeWindow_fromSurface(env, j_surf), driver_library); - - Vulkan::vk::InstanceDispatch dld; - Vulkan::vk::Instance vk_instance = Vulkan::CreateInstance( - *driver_library, dld, VK_API_VERSION_1_1, Core::Frontend::WindowSystemType::Android); - - auto surface = Vulkan::CreateSurface(vk_instance, window->GetWindowInfo()); - - auto device = Vulkan::CreateDevice(vk_instance, dld, *surface); - - const std::string model_name{device.GetModelName()}; - - window.release(); - - return Common::Android::ToJString(env, model_name); -#else - return Common::Android::ToJString(env, "no-info"); + try { + return Common::Android::ToJString(env, QuerySystemDriverInfo(env, j_hook_lib_dir).properties.deviceName); + } catch (...) { + } #endif + return Common::Android::ToJString(env, "no-info"); } jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_reloadKeys(JNIEnv* env, jclass clazz) { diff --git a/src/video_core/engines/sw_blitter/blitter.cpp b/src/video_core/engines/sw_blitter/blitter.cpp index 8bcc2f7a76..45df323e52 100644 --- a/src/video_core/engines/sw_blitter/blitter.cpp +++ b/src/video_core/engines/sw_blitter/blitter.cpp @@ -92,7 +92,8 @@ void Bilinear(std::span input, std::span output, size_t src_widt const auto read_src = [&](f32 in_x, f32 in_y) { const size_t read_from = - ((static_cast(in_x) * src_width + static_cast(in_y)) >> 32) * + ((std::min)(static_cast(in_y), src_height - 1) * src_width + + (std::min)(static_cast(in_x), src_width - 1)) * ir_components; return std::span(&input[read_from], ir_components); }; diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index c32cbd2a0d..6a0aef3447 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -226,8 +226,7 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra descriptor_buffer_ring, render_pass_cache, buffer_cache, texture_cache, gpu.ShaderNotify()), accelerate_dma(buffer_cache, texture_cache, scheduler), - fence_manager(*this, gpu, texture_cache, buffer_cache, query_cache, device, scheduler), - wfi_event(device.GetLogical().CreateEvent()) { + fence_manager(*this, gpu, texture_cache, buffer_cache, query_cache, device, scheduler) { scheduler.SetQueryCache(query_cache); } @@ -881,45 +880,7 @@ void RasterizerVulkan::FlushAndInvalidateRegion(DAddr addr, u64 size, } void RasterizerVulkan::WaitForIdle() { - // Everything but wait pixel operations. This intentionally includes FRAGMENT_SHADER_BIT because - // fragment shaders can still write storage buffers. - VkPipelineStageFlags2 flags = - VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT | - VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT | - VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT | - VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT | - VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT | VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT; - if (device.IsExtTransformFeedbackSupported()) { - flags |= VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT; - } - query_cache.NotifyWFI(); - - scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([event = *wfi_event, flags](vk::CommandBuffer cmdbuf) { - const VkMemoryBarrier2 barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = flags, - .srcAccessMask = VK_ACCESS_2_NONE, - .dstStageMask = VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT, - .dstAccessMask = VK_ACCESS_2_NONE, - }; - const VkDependencyInfo dependency_info{ - .sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, - .pNext = nullptr, - .dependencyFlags = 0, - .memoryBarrierCount = 1, - .pMemoryBarriers = &barrier, - .bufferMemoryBarrierCount = 0, - .pBufferMemoryBarriers = nullptr, - .imageMemoryBarrierCount = 0, - .pImageMemoryBarriers = nullptr, - }; - cmdbuf.SetEvent(event, dependency_info); - cmdbuf.WaitEvents(event, dependency_info); - }); fence_manager.SignalOrdering(); } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index ea98948df7..e47104783b 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -221,7 +221,6 @@ private: AccelerateDMA accelerate_dma; FenceManager fence_manager; - vk::Event wfi_event; boost::container::static_vector image_view_indices; std::array image_view_ids; diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 25c2218c53..44e519a3fa 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -125,13 +125,11 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdSetDepthBias); X(vkCmdSetDepthBias2EXT); X(vkCmdSetDepthBounds); - X(vkCmdSetEvent2); X(vkCmdSetScissor); X(vkCmdSetStencilCompareMask); X(vkCmdSetStencilReference); X(vkCmdSetStencilWriteMask); X(vkCmdSetViewport); - X(vkCmdWaitEvents2); X(vkCmdBindVertexBuffers2EXT); X(vkCmdSetCullModeEXT); X(vkCmdSetDepthBoundsTestEnableEXT); @@ -168,7 +166,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCreateDescriptorPool); X(vkCreateDescriptorSetLayout); X(vkCreateDescriptorUpdateTemplate); - X(vkCreateEvent); X(vkCreateFence); X(vkCreateFramebuffer); X(vkCreateGraphicsPipelines); @@ -187,7 +184,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkDestroyDescriptorPool); X(vkDestroyDescriptorSetLayout); X(vkDestroyDescriptorUpdateTemplate); - X(vkDestroyEvent); X(vkDestroyFence); X(vkDestroyFramebuffer); X(vkDestroyImage); @@ -208,7 +204,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkGetBufferMemoryRequirements2); X(vkGetDeviceBufferMemoryRequirements); X(vkGetDeviceQueue); - X(vkGetEventStatus); X(vkGetFenceStatus); X(vkGetPipelineCacheData); X(vkGetQueryPoolResults); @@ -261,12 +256,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { if (!dld.vkQueueSubmit2) { Proc(dld.vkQueueSubmit2, dld, "vkQueueSubmit2KHR", device); } - if (!dld.vkCmdSetEvent2) { - Proc(dld.vkCmdSetEvent2, dld, "vkCmdSetEvent2KHR", device); - } - if (!dld.vkCmdWaitEvents2) { - Proc(dld.vkCmdWaitEvents2, dld, "vkCmdWaitEvents2KHR", device); - } if (!dld.vkCreateRenderPass2) { Proc(dld.vkCreateRenderPass2, dld, "vkCreateRenderPass2KHR", device); @@ -361,10 +350,6 @@ void Destroy(VkDevice device, VkDescriptorUpdateTemplate handle, dld.vkDestroyDescriptorUpdateTemplate(device, handle, nullptr); } -void Destroy(VkDevice device, VkEvent handle, const DeviceDispatch& dld) noexcept { - dld.vkDestroyEvent(device, handle, nullptr); -} - void Destroy(VkDevice device, VkFence handle, const DeviceDispatch& dld) noexcept { dld.vkDestroyFence(device, handle, nullptr); } @@ -590,10 +575,6 @@ std::vector SwapchainKHR::GetImages() const { return images; } -void Event::SetObjectNameEXT(const char* name) const { - SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_EVENT, name); -} - void ShaderModule::SetObjectNameEXT(const char* name) const { SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_SHADER_MODULE, name); } @@ -753,18 +734,6 @@ ShaderModule Device::CreateShaderModule(const VkShaderModuleCreateInfo& ci) cons return ShaderModule(object, handle, *dld); } -Event Device::CreateEvent() const { - static constexpr VkEventCreateInfo ci{ - .sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - }; - - VkEvent object; - Check(dld->vkCreateEvent(handle, &ci, nullptr, &object)); - return Event(object, handle, *dld); -} - SwapchainKHR Device::CreateSwapchainKHR(const VkSwapchainCreateInfoKHR& ci) const { VkSwapchainKHR object; Check(dld->vkCreateSwapchainKHR(handle, &ci, nullptr, &object)); diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 48b4b42221..7898886921 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -255,7 +255,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdSetDepthBiasEnableEXT vkCmdSetDepthBiasEnableEXT{}; PFN_vkCmdSetLogicOpEnableEXT vkCmdSetLogicOpEnableEXT{}; PFN_vkCmdSetDepthClampEnableEXT vkCmdSetDepthClampEnableEXT{}; - PFN_vkCmdSetEvent2 vkCmdSetEvent2{}; PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT{}; PFN_vkCmdSetLogicOpEXT vkCmdSetLogicOpEXT{}; PFN_vkCmdSetLineWidth vkCmdSetLineWidth{}; @@ -272,7 +271,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdSetColorWriteEnableEXT vkCmdSetColorWriteEnableEXT{}; PFN_vkCmdSetColorBlendEnableEXT vkCmdSetColorBlendEnableEXT{}; PFN_vkCmdSetColorBlendEquationEXT vkCmdSetColorBlendEquationEXT{}; - PFN_vkCmdWaitEvents2 vkCmdWaitEvents2{}; PFN_vkCreateBuffer vkCreateBuffer{}; PFN_vkCreateBufferView vkCreateBufferView{}; PFN_vkCreateCommandPool vkCreateCommandPool{}; @@ -280,7 +278,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCreateDescriptorPool vkCreateDescriptorPool{}; PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout{}; PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate{}; - PFN_vkCreateEvent vkCreateEvent{}; PFN_vkCreateFence vkCreateFence{}; PFN_vkCreateFramebuffer vkCreateFramebuffer{}; PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines{}; @@ -299,7 +296,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool{}; PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout{}; PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate{}; - PFN_vkDestroyEvent vkDestroyEvent{}; PFN_vkDestroyFence vkDestroyFence{}; PFN_vkDestroyFramebuffer vkDestroyFramebuffer{}; PFN_vkDestroyImage vkDestroyImage{}; @@ -320,7 +316,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2{}; PFN_vkGetDeviceBufferMemoryRequirements vkGetDeviceBufferMemoryRequirements{}; PFN_vkGetDeviceQueue vkGetDeviceQueue{}; - PFN_vkGetEventStatus vkGetEventStatus{}; PFN_vkGetFenceStatus vkGetFenceStatus{}; PFN_vkGetPipelineCacheData vkGetPipelineCacheData{}; PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR{}; @@ -361,7 +356,6 @@ void Destroy(VkDevice, VkCommandPool, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorPool, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorSetLayout, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorUpdateTemplate, const DeviceDispatch&) noexcept; -void Destroy(VkDevice, VkEvent, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkFence, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkFramebuffer, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkImage, const DeviceDispatch&) noexcept; @@ -908,18 +902,6 @@ public: std::vector GetImages() const; }; -class Event : public Handle { - using Handle::Handle; - -public: - /// Set object name. - void SetObjectNameEXT(const char* name) const; - - VkResult GetStatus() const noexcept { - return dld->vkGetEventStatus(owner, handle); - } -}; - class ShaderModule : public Handle { using Handle::Handle; @@ -1032,8 +1014,6 @@ public: [[nodiscard]] ShaderModule CreateShaderModule(const VkShaderModuleCreateInfo& ci) const; - [[nodiscard]] Event CreateEvent() const; - [[nodiscard]] SwapchainKHR CreateSwapchainKHR(const VkSwapchainCreateInfoKHR& ci) const; VkMemoryRequirements GetDeviceBufferMemoryRequirements(const VkBufferCreateInfo& ci) const noexcept; @@ -1445,14 +1425,6 @@ public: dld->vkCmdSetDepthBounds(handle, min_depth_bounds, max_depth_bounds); } - void SetEvent(VkEvent event, const VkDependencyInfo& dependency_info) const noexcept { - dld->vkCmdSetEvent2(handle, event, &dependency_info); - } - - void WaitEvents(Span events, const VkDependencyInfo& dependency_info) const noexcept { - dld->vkCmdWaitEvents2(handle, events.size(), events.data(), &dependency_info); - } - void BindVertexBuffers2EXT(u32 first_binding, u32 binding_count, const VkBuffer* buffers, const VkDeviceSize* offsets, const VkDeviceSize* sizes, const VkDeviceSize* strides) const noexcept { From 3f3240caed66983a6759e6301c0ff7aced7e6de0 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 24 Sep 2026 23:46:01 -0400 Subject: [PATCH 094/198] Fix android build --- src/android/app/src/main/jni/native.cpp | 62 +++++++++---------- src/video_core/engines/sw_blitter/blitter.cpp | 3 + 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 05b2f081eb..bd4d843473 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -738,6 +738,35 @@ const char* fallback_cpu_detection() { return s_result.c_str(); } +#ifdef ARCHITECTURE_arm64 +struct SystemDriverInfo { + VkPhysicalDeviceProperties properties{}; + VkPhysicalDeviceDriverProperties driver{}; +}; + +SystemDriverInfo QuerySystemDriverInfo(JNIEnv* env, jstring j_hook_lib_dir) { + const std::string hook_lib_dir = Common::Android::GetJString(env, j_hook_lib_dir); + const Common::DynamicLibrary library{adrenotools_open_libvulkan( + RTLD_NOW, 0, nullptr, hook_lib_dir.c_str(), nullptr, nullptr, nullptr, nullptr)}; + Vulkan::vk::InstanceDispatch dld; + const Vulkan::vk::Instance instance = Vulkan::CreateInstance(library, dld, VK_API_VERSION_1_1); + const std::vector devices = instance.EnumeratePhysicalDevices(); + if (devices.empty()) { + throw Vulkan::vk::Exception(VK_ERROR_INITIALIZATION_FAILED); + } + SystemDriverInfo info{}; + info.driver.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES; + VkPhysicalDeviceProperties2 properties2{ + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, + .pNext = &info.driver, + .properties = {}, + }; + Vulkan::vk::PhysicalDevice(devices[0], dld).GetProperties2(properties2); + info.properties = properties2.properties; + return info; +} +#endif + } // namespace extern "C" { @@ -855,39 +884,6 @@ jboolean JNICALL Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_supportsCustomDri #endif } -#ifdef ARCHITECTURE_arm64 -namespace { - -struct SystemDriverInfo { - VkPhysicalDeviceProperties properties{}; - VkPhysicalDeviceDriverProperties driver{}; -}; - -SystemDriverInfo QuerySystemDriverInfo(JNIEnv* env, jstring j_hook_lib_dir) { - const std::string hook_lib_dir = Common::Android::GetJString(env, j_hook_lib_dir); - const Common::DynamicLibrary library{adrenotools_open_libvulkan( - RTLD_NOW, 0, nullptr, hook_lib_dir.c_str(), nullptr, nullptr, nullptr, nullptr)}; - Vulkan::vk::InstanceDispatch dld; - const Vulkan::vk::Instance instance = Vulkan::CreateInstance(library, dld, VK_API_VERSION_1_1); - const std::vector devices = instance.EnumeratePhysicalDevices(); - if (devices.empty()) { - throw Vulkan::vk::Exception(VK_ERROR_INITIALIZATION_FAILED); - } - SystemDriverInfo info{}; - info.driver.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES; - VkPhysicalDeviceProperties2 properties2{ - .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, - .pNext = &info.driver, - .properties = {}, - }; - Vulkan::vk::PhysicalDevice(devices[0], dld).GetProperties2(properties2); - info.properties = properties2.properties; - return info; -} - -} -#endif - jobjectArray Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_getSystemDriverInfo( JNIEnv* env, jobject j_obj, jobject j_surf, jstring j_hook_lib_dir) { std::string version_string{"1.1.0"}; diff --git a/src/video_core/engines/sw_blitter/blitter.cpp b/src/video_core/engines/sw_blitter/blitter.cpp index 45df323e52..a360ffb125 100644 --- a/src/video_core/engines/sw_blitter/blitter.cpp +++ b/src/video_core/engines/sw_blitter/blitter.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later From 7a007fbf487c98f1a5bec97c922a51fff68afaa9 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 25 Sep 2026 01:51:43 -0400 Subject: [PATCH 095/198] Another intent to fix qcom driver bugs with render --- src/video_core/renderer_vulkan/vk_texture_cache.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 32d4c5a52d..279b43b5ff 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -2028,6 +2028,9 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu } current_image = &Image::original_image; storage_image_views.resize(info.resources.levels); + if (original_image) { + runtime->TransitionImageLayout(*this); + } } Image::Image(const VideoCommon::NullImageParams& params) : VideoCommon::ImageBase{params} {} @@ -3238,9 +3241,9 @@ void TextureCacheRuntime::TransitionImageLayout(Image& image) { VkImageMemoryBarrier2 barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .srcStageMask = VK_PIPELINE_STAGE_2_NONE, .srcAccessMask = VK_ACCESS_2_NONE, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, + .dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -3255,9 +3258,8 @@ void TextureCacheRuntime::TransitionImageLayout(Image& image) { .layerCount = VK_REMAINING_ARRAY_LAYERS, }, }; - scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([barrier](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(barrier); + scheduler.RecordWithUploadBuffer([barrier](vk::CommandBuffer, vk::CommandBuffer upload_cmdbuf) { + upload_cmdbuf.PipelineBarrier(barrier); }); } } From a5c5966cd8d7683cafae390662937e5ddb2aa557 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 25 Sep 2026 02:25:13 -0400 Subject: [PATCH 096/198] Keep adjusting barriers --- src/video_core/renderer_vulkan/vk_compute_pass.cpp | 3 +-- src/video_core/renderer_vulkan/vk_texture_cache.cpp | 9 ++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index ca5a267c6a..083b3e900c 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -644,8 +644,7 @@ void RecordUnswizzleEndBarrier(Scheduler& scheduler, VkImage vk_image, .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | - VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 279b43b5ff..50b3bb7caf 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -692,9 +692,6 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im static constexpr VkAccessFlags2 WRITE_ACCESS_FLAGS = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - static constexpr VkAccessFlags2 READ_ACCESS_FLAGS = VK_ACCESS_2_SHADER_READ_BIT | - VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT; // Compute exact mip/layer range being written to RangedBarrierRange range; @@ -725,10 +722,8 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, - .dstAccessMask = WRITE_ACCESS_FLAGS | READ_ACCESS_FLAGS, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, From ab11282def5f26dbc2f98ff37865cfa605ac8d92 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 25 Sep 2026 02:56:40 -0400 Subject: [PATCH 097/198] Keep adjusting the barriers until qcom is finally fixed --- src/video_core/renderer_vulkan/blit_image.cpp | 62 +++---------------- .../renderer_vulkan/vk_rasterizer.cpp | 5 +- .../renderer_vulkan/vk_texture_cache.cpp | 17 +---- 3 files changed, 15 insertions(+), 69 deletions(-) diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 928e7bfb9c..b462572a5b 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -452,34 +452,6 @@ VkExtent2D GetConversionExtent(const ImageView& src_image_view) { }; } -void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayout target_layout, - VkImageLayout source_layout = VK_IMAGE_LAYOUT_GENERAL) { - constexpr VkAccessFlags2 flags{VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_SHADER_READ_BIT}; - const VkImageMemoryBarrier2 barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .srcAccessMask = flags, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = flags, - .oldLayout = source_layout, - .newLayout = target_layout, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = image, - .subresourceRange{ - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .baseMipLevel = 0, - .levelCount = 1, - .baseArrayLayer = 0, - .layerCount = 1, - }, - }; - cmdbuf.PipelineBarrier(barrier); -} - void RecordShaderReadBarrier(Scheduler& scheduler, const ImageView& image_view) { const VkImage image = image_view.ImageHandle(); const VkImageSubresourceRange subresource_range = SubresourceRangeFromView(image_view); @@ -562,25 +534,6 @@ void RecordShaderReadBarrier(Scheduler& scheduler, const ImageView& image_view) }, }); } - -void BeginRenderPass(vk::CommandBuffer& cmdbuf, const Framebuffer* framebuffer) { - const VkRenderPass render_pass = framebuffer->RenderPass(); - const VkFramebuffer framebuffer_handle = framebuffer->Handle(); - const VkExtent2D render_area = framebuffer->RenderArea(); - const VkRenderPassBeginInfo renderpass_bi{ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, - .pNext = nullptr, - .renderPass = render_pass, - .framebuffer = framebuffer_handle, - .renderArea{ - .offset{}, - .extent = render_area, - }, - .clearValueCount = 0, - .pClearValues = nullptr, - }; - cmdbuf.BeginRenderPass(renderpass_bi, VK_SUBPASS_CONTENTS_INLINE); -} } // Anonymous namespace BlitImageHelper::BlitImageHelper(const Device& device_, Scheduler& scheduler_, @@ -686,11 +639,14 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, VkImageView }; const VkPipelineLayout layout = *one_texture_pipeline_layout; const VkPipeline pipeline = FindOrEmplaceColorPipeline(key); - scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([this, dst_framebuffer, src_image_view, src_image, src_sampler, dst_region, - src_region, src_size, pipeline, layout](vk::CommandBuffer cmdbuf) { - TransitionImageLayout(cmdbuf, src_image, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); - BeginRenderPass(cmdbuf, dst_framebuffer); + const auto attachments = + std::span(dst_framebuffer->Images()).first(dst_framebuffer->NumImages()); + if (std::ranges::find(attachments, src_image) != attachments.end()) { + scheduler.RequestOutsideRenderPassOperationContext(); + } + scheduler.RequestRenderpass(dst_framebuffer); + scheduler.Record([this, src_image_view, src_sampler, dst_region, src_region, src_size, + pipeline, layout](vk::CommandBuffer cmdbuf) { const VkDescriptorSet descriptor_set = one_texture_descriptor_allocator.Commit(); UpdateOneTextureDescriptorSet(device, descriptor_set, src_sampler, src_image_view); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); @@ -698,8 +654,8 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, VkImageView nullptr); BindBlitState(cmdbuf, layout, dst_region, src_region, src_size); cmdbuf.Draw(3, 1, 0, 0); - cmdbuf.EndRenderPass(); }); + scheduler.InvalidateState(); } void BlitImageHelper::BlitImpl(const Framebuffer* dst_framebuffer, diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 6a0aef3447..eb0e52c04c 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -421,8 +421,9 @@ void RasterizerVulkan::DrawTexture() { .y = ScaleSrc(draw_texture_state.src_y1)}}; Extent3D src_size = {static_cast(ScaleSrc(texture.size.width)), static_cast(ScaleSrc(texture.size.height)), texture.size.depth}; - blit_image.BlitColor(framebuffer, texture.RenderTarget(), texture.ImageHandle(), - sampler->Handle(), dst_region, src_region, src_size); + blit_image.BlitColor(framebuffer, texture.Handle(Shader::TextureType::Color2D), + texture.ImageHandle(), sampler->Handle(), dst_region, src_region, + src_size); } void RasterizerVulkan::Clear(u32 layer_count) { diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 50b3bb7caf..71eb640975 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1719,10 +1719,7 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, .dstAccessMask = 0, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1736,16 +1733,8 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | - VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, From bcb3fbcf129479846892e0b469bfc4156f851ff3 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 25 Sep 2026 03:42:09 -0400 Subject: [PATCH 098/198] Remove the binding/rt image cache --- .../texture_cache/descriptor_table.h | 6 +- src/video_core/texture_cache/texture_cache.h | 93 +++---------------- .../texture_cache/texture_cache_base.h | 6 -- 3 files changed, 13 insertions(+), 92 deletions(-) diff --git a/src/video_core/texture_cache/descriptor_table.h b/src/video_core/texture_cache/descriptor_table.h index ec310803f4..37022842fe 100644 --- a/src/video_core/texture_cache/descriptor_table.h +++ b/src/video_core/texture_cache/descriptor_table.h @@ -31,12 +31,10 @@ public: u32 generation; }; - [[nodiscard]] bool Synchronize(GPUVAddr gpu_addr, u32 limit) noexcept { - bool ret = !(current_gpu_addr == gpu_addr && current_limit == limit); - if (ret) { + void Synchronize(GPUVAddr gpu_addr, u32 limit) noexcept { + if (current_gpu_addr != gpu_addr || current_limit != limit) { Refresh(gpu_addr, limit); } - return ret; } void Invalidate() noexcept { diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 2b25184d9b..46cead4c35 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -196,65 +196,16 @@ void TextureCache

::FillImageViews(std::span views, bool compu template void TextureCache

::CheckFeedbackLoop(std::span views) { - if (!Settings::values.barrier_feedback_loops.GetValue()) { + if (!rt_depth_image_id || !Settings::values.barrier_feedback_loops.GetValue()) { return; } - - if (render_targets_serial == last_feedback_loop_serial && - texture_bindings_serial == last_feedback_texture_serial) { - if (last_feedback_loop_result) { + const ImageViewId depth_view_id = render_targets.depth_buffer_id; + for (const auto& view : views) { + if (view.id && view.id != depth_view_id && + slot_image_views[view.id].image_id == rt_depth_image_id) { runtime.BarrierFeedbackLoop(); + return; } - return; - } - - if (rt_active_mask == 0) { - last_feedback_loop_serial = render_targets_serial; - last_feedback_texture_serial = texture_bindings_serial; - last_feedback_loop_result = false; - return; - } - const u32 depth_bit = 1u << NUM_RT; - const bool depth_active = (rt_active_mask & depth_bit) != 0; - - const bool requires_barrier = [&] { - for (const auto& view : views) { - if (!view.id) { - continue; - } - - { - bool is_continue = false; - for (size_t i = 0; i < 8; ++i) - is_continue |= (rt_active_mask & (1u << i)) && view.id == render_targets.color_buffer_ids[i]; - if (is_continue) - continue; - } - - if (depth_active && view.id == render_targets.depth_buffer_id) - continue; - - const ImageId view_image_id = slot_image_views[view.id].image_id; - { - bool is_continue = false; - for (size_t i = 0; i < 8; ++i) - is_continue |= (rt_active_mask & (1u << i)) && view_image_id == rt_image_id[i]; - if (is_continue) - continue; - } - if (depth_active && view_image_id == rt_depth_image_id) { - return true; - } - } - - return false; - }(); - - last_feedback_loop_serial = render_targets_serial; - last_feedback_texture_serial = texture_bindings_serial; - last_feedback_loop_result = requires_barrier; - if (requires_barrier) { - runtime.BarrierFeedbackLoop(); } } @@ -293,26 +244,14 @@ void TextureCache

::SynchronizeDescriptors(bool compute) { const bool linked_tsc = kepler_compute->launch_description.linked_tsc; const u32 tic_limit = kepler_compute->regs.tic.limit; const u32 tsc_limit = linked_tsc ? tic_limit : kepler_compute->regs.tsc.limit; - bool bindings_changed = false; - if (channel_state->compute_sampler_table.Synchronize(kepler_compute->regs.tsc.Address(), tsc_limit)) - bindings_changed = true; - if (channel_state->compute_image_table.Synchronize(kepler_compute->regs.tic.Address(), tic_limit)) - bindings_changed = true; - if (bindings_changed) { - ++texture_bindings_serial; - } + channel_state->compute_sampler_table.Synchronize(kepler_compute->regs.tsc.Address(), tsc_limit); + channel_state->compute_image_table.Synchronize(kepler_compute->regs.tic.Address(), tic_limit); } else { const bool linked_tsc = maxwell3d->regs.sampler_binding == Tegra::Engines::Maxwell3D::Regs::SamplerBinding::ViaHeaderBinding; const u32 tic_limit = maxwell3d->regs.tex_header.limit; const u32 tsc_limit = linked_tsc ? tic_limit : maxwell3d->regs.tex_sampler.limit; - bool bindings_changed = false; - if (channel_state->graphics_sampler_table.Synchronize(maxwell3d->regs.tex_sampler.Address(), tsc_limit)) - bindings_changed = true; - if (channel_state->graphics_image_table.Synchronize(maxwell3d->regs.tex_header.Address(), tic_limit)) - bindings_changed = true; - if (bindings_changed) { - ++texture_bindings_serial; - } + channel_state->graphics_sampler_table.Synchronize(maxwell3d->regs.tex_sampler.Address(), tsc_limit); + channel_state->graphics_image_table.Synchronize(maxwell3d->regs.tex_header.Address(), tic_limit); } } @@ -442,19 +381,9 @@ void TextureCache

::UpdateRenderTargets(bool is_clear) { PrepareImageView(depth_buffer_id, true, is_clear && IsFullClear(depth_buffer_id)); - rt_active_mask = 0; - rt_image_id = {}; - for (size_t i = 0; i < rt_image_id.size(); ++i) { - if (ImageViewId const view = render_targets.color_buffer_ids[i]; view) { - rt_active_mask |= 1u << i; - rt_image_id[i] = slot_image_views[view].image_id; - } - } + rt_depth_image_id = {}; if (depth_buffer_id) { - rt_active_mask |= (1u << NUM_RT); rt_depth_image_id = slot_image_views[depth_buffer_id].image_id; - } else { - rt_depth_image_id = ImageId{}; } for (size_t index = 0; index < NUM_RT; ++index) { diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index b51f03e532..0243a68a2d 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -418,13 +418,7 @@ private: RenderTargets render_targets; u64 render_targets_serial = 0; - u32 rt_active_mask = 0; - std::array rt_image_id{}; ImageId rt_depth_image_id{}; - u64 texture_bindings_serial = 0; - u64 last_feedback_loop_serial = 0; - u64 last_feedback_texture_serial = 0; - bool last_feedback_loop_result = false; FramebufferId last_framebuffer_id{}; u64 last_framebuffer_serial = 0; From bc121efc1900d29d469f210ae1ba5dbf2f2a43b1 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 25 Sep 2026 04:32:48 -0400 Subject: [PATCH 099/198] Corrections on the barriers for compute dispatch --- .../renderer_vulkan/vk_rasterizer.cpp | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index eb0e52c04c..4ba8c2abbc 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -625,6 +625,23 @@ void RasterizerVulkan::DispatchCompute() { return; } + static constexpr VkMemoryBarrier2 READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT, + }; + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + }; const auto& qmd{kepler_compute->launch_description}; auto indirect_address = kepler_compute->GetIndirectComputeAddress(); if (indirect_address) { @@ -639,7 +656,9 @@ void RasterizerVulkan::DispatchCompute() { if (!pipeline->IsBound()) { return; } + cmdbuf.PipelineBarrier(READ_BARRIER); cmdbuf.DispatchIndirect(indirect_buffer, indirect_offset); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); return; } @@ -649,20 +668,13 @@ void RasterizerVulkan::DispatchCompute() { return; } scheduler.RequestOutsideRenderPassOperationContext(); - static constexpr VkMemoryBarrier2 READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT, - }; - scheduler.Record([](vk::CommandBuffer cmdbuf) { cmdbuf.PipelineBarrier(READ_BARRIER); }); scheduler.Record([pipeline, dim](vk::CommandBuffer cmdbuf) { if (!pipeline->IsBound()) { return; } + cmdbuf.PipelineBarrier(READ_BARRIER); cmdbuf.Dispatch(dim[0], dim[1], dim[2]); + cmdbuf.PipelineBarrier(WRITE_BARRIER); }); // Log compute dispatch From d2d2220b24491a3e16d3a80ea647a83303741f1a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 25 Sep 2026 18:05:12 -0400 Subject: [PATCH 100/198] Address some regressions with TFB + SSBO's due to WFI removal --- src/video_core/buffer_cache/buffer_base.h | 20 ++++++++++++ src/video_core/buffer_cache/buffer_cache.h | 31 +++++++++++++++++++ .../buffer_cache/buffer_cache_base.h | 15 +++++++++ .../renderer_vulkan/vk_buffer_cache.cpp | 12 +++++++ .../renderer_vulkan/vk_buffer_cache.h | 6 ++++ .../renderer_vulkan/vk_graphics_pipeline.cpp | 4 +++ .../renderer_vulkan/vk_rasterizer.cpp | 1 + .../renderer_vulkan/vk_scheduler.cpp | 28 ++++++++--------- src/video_core/renderer_vulkan/vk_scheduler.h | 23 ++++++++++++++ 9 files changed, 125 insertions(+), 15 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h index 6b2a37ea8c..b8d0d1896f 100644 --- a/src/video_core/buffer_cache/buffer_base.h +++ b/src/video_core/buffer_cache/buffer_base.h @@ -137,6 +137,22 @@ public: content_serial = ++next_content_serial; } + [[nodiscard]] bool HasDrawHazard(u64 pass, u64 wfi, DAddr addr, u64 size) const noexcept { + return draw_write_pass == pass && draw_write_wfi < wfi && addr < draw_write_end && + addr + size > draw_write_begin; + } + + void MarkDrawWrite(u64 pass, u64 wfi, DAddr addr, u64 size) noexcept { + if (draw_write_pass != pass) { + draw_write_pass = pass; + draw_write_begin = addr; + draw_write_end = addr + size; + } + draw_write_wfi = wfi; + draw_write_begin = (std::min)(draw_write_begin, addr); + draw_write_end = (std::max)(draw_write_end, addr + size); + } + private: static inline u64 next_content_serial = 0; @@ -147,6 +163,10 @@ private: size_t size_bytes = 0; u64 write_tick = 0; u64 content_serial = ++next_content_serial; + u64 draw_write_pass = 0; + u64 draw_write_wfi = 0; + DAddr draw_write_begin = 0; + DAddr draw_write_end = 0; }; } // namespace VideoCommon diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 89d0003207..d4c8a61eb7 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -366,6 +366,13 @@ void BufferCache

::DisableGraphicsUniformBuffer(size_t stage, u32 index) { template void BufferCache

::UpdateGraphicsBuffers(bool is_indexed) { + if constexpr (!IS_OPENGL) { + draw_writes.clear(); + draw_pass = runtime.RenderPassSerial(); + draw_wfi = runtime.WaitForIdleSerial(); + draw_hazard = false; + recording_draw = true; + } ReclaimInline(); do { channel_state->has_deleted_buffers = false; @@ -373,6 +380,24 @@ void BufferCache

::UpdateGraphicsBuffers(bool is_indexed) { } while (channel_state->has_deleted_buffers); } +template +bool BufferCache

::TakeDrawHazard() noexcept { + return std::exchange(draw_hazard, false); +} + +template +void BufferCache

::CommitDrawWrites() { + recording_draw = false; + if (draw_writes.empty()) { + return; + } + const u64 pass = runtime.RenderPassSerial(); + for (const DrawWrite& write : draw_writes) { + slot_buffers[write.buffer_id].MarkDrawWrite(pass, draw_wfi, write.device_addr, write.size); + } + runtime.MarkRenderPassWrites(); +} + template void BufferCache

::UpdateComputeBuffers() { ReclaimInline(); @@ -1550,6 +1575,9 @@ void BufferCache

::MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u3 Buffer& buffer = slot_buffers[buffer_id]; buffer.setWriteTick(runtime.CurrentTick()); buffer.MarkContentModified(); + if (recording_draw) { + draw_writes.push_back({buffer_id, device_addr, size}); + } } memory_tracker.MarkRegionAsGpuModified(device_addr, size); gpu_modified_ranges.Add(device_addr, size); @@ -1770,6 +1798,9 @@ void BufferCache

::TouchBuffer(Buffer& buffer, BufferId buffer_id) noexcept { template bool BufferCache

::SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 size) { + if constexpr (!IS_OPENGL) { + draw_hazard |= buffer.HasDrawHazard(draw_pass, draw_wfi, device_addr, size); + } upload_copies.clear(); u64 total_size_bytes = 0; u64 largest_copy = 0; diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 80a0b2c7eb..6730291831 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -260,6 +260,10 @@ public: void UpdateComputeBuffers(); + [[nodiscard]] bool TakeDrawHazard() noexcept; + + void CommitDrawWrites(); + void BindHostGeometryBuffers(bool is_indexed); void BindHostStageBuffers(size_t stage); @@ -520,6 +524,17 @@ private: boost::container::small_vector upload_copies; + struct DrawWrite { + BufferId buffer_id; + DAddr device_addr; + u32 size; + }; + boost::container::small_vector draw_writes; + u64 draw_pass = 0; + u64 draw_wfi = 0; + bool draw_hazard = false; + bool recording_draw = false; + MemoryTracker memory_tracker; Common::RangeSet uncommitted_gpu_modified_ranges; Common::RangeSet gpu_modified_ranges; diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index d3d3d7a437..57494d9649 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -440,6 +440,18 @@ u64 BufferCacheRuntime::CurrentTick() { return scheduler.GetMasterSemaphore().CurrentTick(); } +u64 BufferCacheRuntime::RenderPassSerial() const noexcept { + return scheduler.ActiveRenderPassSerial(); +} + +u64 BufferCacheRuntime::WaitForIdleSerial() const noexcept { + return scheduler.WaitForIdleSerial(); +} + +void BufferCacheRuntime::MarkRenderPassWrites() noexcept { + scheduler.MarkRenderPassWrites(); +} + u64 BufferCacheRuntime::KnownGpuTick() { return scheduler.GetMasterSemaphore().KnownGpuTick(); } diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index f83696f0de..1a8629aee8 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -112,6 +112,12 @@ public: u64 CurrentTick(); + u64 RenderPassSerial() const noexcept; + + u64 WaitForIdleSerial() const noexcept; + + void MarkRenderPassWrites() noexcept; + u64 KnownGpuTick(); void Wait(u64 buffer_tick); diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 101fab301e..767099eea2 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -595,7 +595,11 @@ bool GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling, } } + if (buffer_cache.TakeDrawHazard()) { + scheduler.RequestOutsideRenderPassOperationContext(); + } scheduler.RequestRenderpass(texture_cache.GetFramebuffer()); + buffer_cache.CommitDrawWrites(); if (!is_built.load(std::memory_order::relaxed)) { // Wait for the pipeline to be built scheduler.Record([this](vk::CommandBuffer) { diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 4ba8c2abbc..2562ff1ad3 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -894,6 +894,7 @@ void RasterizerVulkan::FlushAndInvalidateRegion(DAddr addr, u64 size, void RasterizerVulkan::WaitForIdle() { query_cache.NotifyWFI(); + scheduler.NotifyWaitForIdle(); fence_manager.SignalOrdering(); } diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 33b03ea8f2..4cde9c8651 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -98,6 +98,7 @@ void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, VkRenderPass state.renderpass = renderpass; state.framebuffer = framebuffer_handle; state.render_area = render_area; + ++renderpass_serial; if (GPU::Logging::IsActive() && Settings::values.gpu_log_vulkan_calls.GetValue()) { const std::string render_pass_info = @@ -417,8 +418,17 @@ void Scheduler::EndRenderPass() Record([num_images = num_renderpass_images, images = renderpass_images, ranges = renderpass_image_ranges, - has_transform_feedback = device.IsExtTransformFeedbackSupported()]( + num_memory_barriers = + static_cast(std::exchange(renderpass_writes, false))]( vk::CommandBuffer cmdbuf) { + static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + }; std::array barriers; for (size_t i = 0; i < num_images; ++i) { const VkImageSubresourceRange& range = ranges[i]; @@ -459,20 +469,8 @@ void Scheduler::EndRenderPass() }; } cmdbuf.EndRenderPass(); - cmdbuf.PipelineBarrier(0, {}, {}, vk::Span(barriers.data(), num_images)); - if (has_transform_feedback) { - static constexpr VkMemoryBarrier2 XFB_OUTPUT_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT, - .srcAccessMask = VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT, - .dstStageMask = VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT - | VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT - | VK_ACCESS_2_TRANSFER_READ_BIT, - }; - cmdbuf.PipelineBarrier(XFB_OUTPUT_BARRIER); - } + cmdbuf.PipelineBarrier(0, vk::Span(&WRITE_BARRIER, num_memory_barriers), {}, + vk::Span(barriers.data(), num_images)); }); state.renderpass = VkRenderPass{}; diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index e82b0414fc..587ed27f5b 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -77,6 +78,25 @@ public: return state.renderpass != VK_NULL_HANDLE; } + u64 ActiveRenderPassSerial() const noexcept { + if (state.renderpass) { + return renderpass_serial; + } + return (std::numeric_limits::max)(); + } + + u64 WaitForIdleSerial() const noexcept { + return wfi_serial; + } + + void NotifyWaitForIdle() noexcept { + ++wfi_serial; + } + + void MarkRenderPassWrites() noexcept { + renderpass_writes = true; + } + /// Update the pipeline to the current execution context. bool UpdateGraphicsPipeline(GraphicsPipeline* pipeline); @@ -311,6 +331,9 @@ private: State state; + u64 renderpass_serial = 0; + u64 wfi_serial = 0; + bool renderpass_writes = false; u32 num_renderpass_images = 0; std::array renderpass_images{}; std::array renderpass_image_ranges{}; From 63ce0a05273d93f2bd84c568a5ad991519d4c173 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 25 Sep 2026 18:20:25 -0400 Subject: [PATCH 101/198] Fix build --- src/video_core/buffer_cache/buffer_cache.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index d4c8a61eb7..971f40922d 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -387,15 +387,18 @@ bool BufferCache

::TakeDrawHazard() noexcept { template void BufferCache

::CommitDrawWrites() { - recording_draw = false; - if (draw_writes.empty()) { - return; + if constexpr (!IS_OPENGL) { + recording_draw = false; + if (draw_writes.empty()) { + return; + } + const u64 pass = runtime.RenderPassSerial(); + for (const DrawWrite& write : draw_writes) { + slot_buffers[write.buffer_id].MarkDrawWrite(pass, draw_wfi, write.device_addr, + write.size); + } + runtime.MarkRenderPassWrites(); } - const u64 pass = runtime.RenderPassSerial(); - for (const DrawWrite& write : draw_writes) { - slot_buffers[write.buffer_id].MarkDrawWrite(pass, draw_wfi, write.device_addr, write.size); - } - runtime.MarkRenderPassWrites(); } template From ccbaa75e5eb55480d4bebf7fb98c33d1cb69c489 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 25 Sep 2026 19:03:42 -0400 Subject: [PATCH 102/198] Adjust cuts on depth draws --- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 3 +++ src/video_core/renderer_vulkan/vk_scheduler.cpp | 2 ++ src/video_core/renderer_vulkan/vk_scheduler.h | 9 +++++++++ src/video_core/renderer_vulkan/vk_texture_cache.cpp | 4 +++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 2562ff1ad3..c77d032f94 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -264,6 +264,8 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, bool skip_empty, Func&& draw pipeline->SetEngine(maxwell3d, gpu_memory); if (!pipeline->Configure(is_indexed)) return; + scheduler.MarkDepthWrites(maxwell3d->regs.depth_test_enable != 0 && + maxwell3d->regs.depth_write_enabled != 0); UpdateDynamicStates(pipeline->HasDynamicVertexInput()); @@ -583,6 +585,7 @@ void RasterizerVulkan::Clear(u32 layer_count) { if (aspect_flags == 0) { return; } + scheduler.MarkDepthWrites(!can_defer_clear && (aspect_flags & VK_IMAGE_ASPECT_DEPTH_BIT) != 0); if (use_stencil && framebuffer->HasAspectStencilBit() && regs.stencil_front_mask != 0xFF && regs.stencil_front_mask != 0) { diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 4cde9c8651..457221b2b1 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -99,6 +99,7 @@ void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, VkRenderPass state.framebuffer = framebuffer_handle; state.render_area = render_area; ++renderpass_serial; + renderpass_depth_writes = false; if (GPU::Logging::IsActive() && Settings::values.gpu_log_vulkan_calls.GetValue()) { const std::string render_pass_info = @@ -161,6 +162,7 @@ void Scheduler::RealizeDeferredClear() { dc.color_clear_mask, dc.depth_stencil, color_discard_mask, depth_stencil_discard); EndRenderPass(); BeginRenderPassImpl(dc.framebuffer, renderpass, clear_values.data(), count); + renderpass_depth_writes = dc.depth_stencil; } bool Scheduler::DeferColorClear(const Framebuffer* framebuffer, u32 rt_slot, diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index 587ed27f5b..c78faeecb5 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -97,6 +97,14 @@ public: renderpass_writes = true; } + void MarkDepthWrites(bool writes) noexcept { + renderpass_depth_writes |= writes; + } + + bool HasDepthWrites() const noexcept { + return renderpass_depth_writes; + } + /// Update the pipeline to the current execution context. bool UpdateGraphicsPipeline(GraphicsPipeline* pipeline); @@ -334,6 +342,7 @@ private: u64 renderpass_serial = 0; u64 wfi_serial = 0; bool renderpass_writes = false; + bool renderpass_depth_writes = false; u32 num_renderpass_images = 0; std::array renderpass_images{}; std::array renderpass_image_ranges{}; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 71eb640975..9882e1d34c 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1210,7 +1210,9 @@ void TextureCacheRuntime::EraseResolveShadow(VkImage msaa_image) { } void TextureCacheRuntime::BarrierFeedbackLoop() { - scheduler.RequestOutsideRenderPassOperationContext(); + if (scheduler.HasDepthWrites()) { + scheduler.RequestOutsideRenderPassOperationContext(); + } } void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, From 5dc91d7e255bc94463dab53a3ba36b70b6e6ba45 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 25 Sep 2026 23:48:21 -0400 Subject: [PATCH 103/198] Another take on the qcom/turnip missing handling for geometry stages --- .../backend/spirv/emit_spirv.cpp | 33 ++++- .../backend/spirv/emit_spirv_warp.cpp | 127 +++++++++++++----- .../backend/spirv/spirv_emit_context.h | 1 + .../ir_opt/constant_propagation_pass.cpp | 46 +++++-- src/shader_recompiler/profile.h | 3 + .../renderer_vulkan/vk_pipeline_cache.cpp | 15 ++- src/video_core/vulkan_common/vulkan_device.h | 5 + 7 files changed, 178 insertions(+), 52 deletions(-) diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index c221888c09..a903480c78 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp @@ -4,6 +4,7 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include #include #include @@ -439,10 +440,13 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct ctx.AddCapability(spv::Capability::DrawParameters); } if ((info.uses_subgroup_vote || info.uses_subgroup_invocation_id || - info.uses_subgroup_shuffles) && + info.uses_subgroup_shuffles || info.uses_subgroup_mask) && profile.support_vote && profile.SupportsSubgroupStage(ctx.stage)) { ctx.AddCapability(spv::Capability::GroupNonUniformBallot); ctx.AddCapability(spv::Capability::GroupNonUniformShuffle); + if (info.uses_subgroup_shuffles && profile.support_shuffle_relative) { + ctx.AddCapability(spv::Capability::GroupNonUniformShuffleRelative); + } if (!profile.warp_size_potentially_larger_than_guest) { // vote ops are only used when not taking the long path ctx.AddCapability(spv::Capability::GroupNonUniformVote); @@ -521,6 +525,29 @@ void PatchPhiNodes(IR::Program& program, EmitContext& ctx) { return { ctx.Def(phi->Arg(phi_arg)), parent }; }); } + +void RewriteOpcodes(std::vector& code, std::span> rewrites) { + if (rewrites.empty()) { + return; + } + size_t offset = 5; + while (offset + 2 < code.size()) { + const u32 word_count{code[offset] >> 16}; + const auto opcode{static_cast(code[offset] & 0xFFFFu)}; + if (word_count == 0) { + return; + } + if (opcode == spv::Op::OpGroupNonUniformShuffleXor || + opcode == spv::Op::OpGroupNonUniformQuadBroadcast) { + const auto it{std::ranges::find(rewrites, code[offset + 2], + &std::pair::first)}; + if (it != rewrites.end()) { + code[offset] = (code[offset] & 0xFFFF0000u) | static_cast(it->second); + } + } + offset += word_count; + } +} } // Anonymous namespace std::vector EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info, IR::Program& program, Bindings& bindings) { @@ -535,7 +562,9 @@ std::vector EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_in SetupCapabilities(profile, program.info, ctx); SetupTransformFeedbackCapabilities(ctx, main); PatchPhiNodes(program, ctx); - return ctx.Assemble(); + std::vector code{ctx.Assemble()}; + RewriteOpcodes(code, ctx.opcode_rewrites); + return code; } Id EmitPhi(EmitContext& ctx, IR::Inst* inst) { diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp index ffd5d9c29f..8d83509961 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp @@ -77,20 +77,57 @@ Id GetMaxThreadId(EmitContext& ctx, Id thread_id, Id clamp, Id segmentation_mask return ComputeMaxThreadId(ctx, min_thread_id, clamp, not_seg_mask); } -Id SelectValue(EmitContext& ctx, Id in_range, Id value, Id src_thread_id) { - if (!StageSupportsSubgroups(ctx)) { - return value; +Id HostThreadId(EmitContext& ctx, Id thread_id) { + if (!ctx.profile.warp_size_potentially_larger_than_guest) { + return thread_id; } - return ctx.OpSelect( - ctx.U32[1], in_range, - ctx.OpGroupNonUniformShuffle(ctx.U32[1], SubgroupScope(ctx), value, src_thread_id), value); -} - -Id AddPartitionBase(EmitContext& ctx, Id thread_id) { const Id partition_idx{ctx.OpShiftRightLogical(ctx.U32[1], GetThreadId(ctx), ctx.Const(5u))}; const Id partition_base{ctx.OpShiftLeftLogical(ctx.U32[1], partition_idx, ctx.Const(5u))}; return ctx.OpIAdd(ctx.U32[1], thread_id, partition_base); } + +Id GuestLane(EmitContext& ctx, Id index) { + return ctx.OpBitwiseAnd(ctx.U32[1], index, ctx.Const(31U)); +} + +Id ShuffleAbsolute(EmitContext& ctx, Id value, Id src_thread_id) { + if (!ctx.profile.has_broken_spirv_subgroup_shuffle) { + return ctx.OpGroupNonUniformShuffle(ctx.U32[1], SubgroupScope(ctx), value, src_thread_id); + } + Id result{ctx.u32_zero_value}; + for (u32 lane = 0; lane < ctx.profile.max_subgroup_size; ++lane) { + const Id read{ + ctx.OpGroupNonUniformBroadcast(ctx.U32[1], SubgroupScope(ctx), value, ctx.Const(lane))}; + const Id matches{ctx.OpIEqual(ctx.U1, src_thread_id, ctx.Const(lane))}; + result = ctx.OpSelect(ctx.U32[1], matches, read, result); + } + return result; +} + +Id ShuffleRelative(EmitContext& ctx, Id value, Id delta, Id src_thread_id, spv::Op op) { + if (!ctx.profile.support_shuffle_relative) { + return ShuffleAbsolute(ctx, value, HostThreadId(ctx, src_thread_id)); + } + const Id result{ctx.OpGroupNonUniformShuffleXor(ctx.U32[1], SubgroupScope(ctx), value, delta)}; + ctx.opcode_rewrites.emplace_back(result.value, op); + return result; +} + +Id BroadcastLane(EmitContext& ctx, Id value, u32 lane) { + Id result{ + ctx.OpGroupNonUniformBroadcast(ctx.U32[1], SubgroupScope(ctx), value, ctx.Const(lane))}; + if (!ctx.profile.warp_size_potentially_larger_than_guest) { + return result; + } + const Id partition_idx{ctx.OpShiftRightLogical(ctx.U32[1], GetThreadId(ctx), ctx.Const(5u))}; + for (u32 base = 32; base < ctx.profile.max_subgroup_size; base += 32) { + const Id read{ctx.OpGroupNonUniformBroadcast(ctx.U32[1], SubgroupScope(ctx), value, + ctx.Const(base + lane))}; + const Id matches{ctx.OpIEqual(ctx.U1, partition_idx, ctx.Const(base >> 5))}; + result = ctx.OpSelect(ctx.U32[1], matches, read, result); + } + return result; +} } // Anonymous namespace Id EmitLaneId(EmitContext& ctx) { @@ -203,61 +240,75 @@ Id EmitShuffleIndex(EmitContext& ctx, IR::Inst* inst, Id value, Id index, Id cla const Id min_thread_id{ComputeMinThreadId(ctx, thread_id, segmentation_mask)}; const Id max_thread_id{ComputeMaxThreadId(ctx, min_thread_id, clamp, not_seg_mask)}; - const Id lhs{ctx.OpBitwiseAnd(ctx.U32[1], index, not_seg_mask)}; - Id src_thread_id{ctx.OpBitwiseOr(ctx.U32[1], lhs, min_thread_id)}; + const Id lhs{ctx.OpBitwiseAnd(ctx.U32[1], GuestLane(ctx, index), not_seg_mask)}; + const Id src_thread_id{ctx.OpBitwiseOr(ctx.U32[1], lhs, min_thread_id)}; const Id in_range{ctx.OpSLessThanEqual(ctx.U1, src_thread_id, max_thread_id)}; - if (ctx.profile.warp_size_potentially_larger_than_guest) { - src_thread_id = AddPartitionBase(ctx, src_thread_id); - } - SetInBoundsFlag(inst, in_range); - return SelectValue(ctx, in_range, value, src_thread_id); + if (!StageSupportsSubgroups(ctx)) { + return value; + } + const IR::Value lane{inst->Arg(1).Resolve()}; + const IR::Value segment{inst->Arg(3).Resolve()}; + if (lane.IsImmediate() && segment.IsImmediate() && segment.U32() == 0) { + return ctx.OpSelect(ctx.U32[1], in_range, BroadcastLane(ctx, value, lane.U32() & 31), + value); + } + const Id shuffled{ShuffleAbsolute(ctx, value, HostThreadId(ctx, src_thread_id))}; + return ctx.OpSelect(ctx.U32[1], in_range, shuffled, value); } Id EmitShuffleUp(EmitContext& ctx, IR::Inst* inst, Id value, Id index, Id clamp, Id segmentation_mask) { + if (!StageSupportsSubgroups(ctx)) { + SetInBoundsFlag(inst, ctx.false_value); + return value; + } + const Id delta{GuestLane(ctx, index)}; const Id thread_id{EmitLaneId(ctx)}; const Id max_thread_id{GetMaxThreadId(ctx, thread_id, clamp, segmentation_mask)}; - Id src_thread_id{ctx.OpISub(ctx.U32[1], thread_id, index)}; + const Id src_thread_id{ctx.OpISub(ctx.U32[1], thread_id, delta)}; const Id in_range{ctx.OpSGreaterThanEqual(ctx.U1, src_thread_id, max_thread_id)}; - if (ctx.profile.warp_size_potentially_larger_than_guest) { - src_thread_id = AddPartitionBase(ctx, src_thread_id); - } - SetInBoundsFlag(inst, in_range); - return SelectValue(ctx, in_range, value, src_thread_id); + const Id shuffled{ShuffleRelative(ctx, value, delta, src_thread_id, + spv::Op::OpGroupNonUniformShuffleUp)}; + return ctx.OpSelect(ctx.U32[1], in_range, shuffled, value); } Id EmitShuffleDown(EmitContext& ctx, IR::Inst* inst, Id value, Id index, Id clamp, Id segmentation_mask) { + if (!StageSupportsSubgroups(ctx)) { + SetInBoundsFlag(inst, ctx.false_value); + return value; + } + const Id delta{GuestLane(ctx, index)}; const Id thread_id{EmitLaneId(ctx)}; const Id max_thread_id{GetMaxThreadId(ctx, thread_id, clamp, segmentation_mask)}; - Id src_thread_id{ctx.OpIAdd(ctx.U32[1], thread_id, index)}; + const Id src_thread_id{ctx.OpIAdd(ctx.U32[1], thread_id, delta)}; const Id in_range{ctx.OpSLessThanEqual(ctx.U1, src_thread_id, max_thread_id)}; - if (ctx.profile.warp_size_potentially_larger_than_guest) { - src_thread_id = AddPartitionBase(ctx, src_thread_id); - } - SetInBoundsFlag(inst, in_range); - return SelectValue(ctx, in_range, value, src_thread_id); + const Id shuffled{ShuffleRelative(ctx, value, delta, src_thread_id, + spv::Op::OpGroupNonUniformShuffleDown)}; + return ctx.OpSelect(ctx.U32[1], in_range, shuffled, value); } Id EmitShuffleButterfly(EmitContext& ctx, IR::Inst* inst, Id value, Id index, Id clamp, Id segmentation_mask) { + if (!StageSupportsSubgroups(ctx)) { + SetInBoundsFlag(inst, ctx.false_value); + return value; + } + const Id mask{GuestLane(ctx, index)}; const Id thread_id{EmitLaneId(ctx)}; const Id max_thread_id{GetMaxThreadId(ctx, thread_id, clamp, segmentation_mask)}; - Id src_thread_id{ctx.OpBitwiseXor(ctx.U32[1], thread_id, index)}; + const Id src_thread_id{ctx.OpBitwiseXor(ctx.U32[1], thread_id, mask)}; const Id in_range{ctx.OpSLessThanEqual(ctx.U1, src_thread_id, max_thread_id)}; - if (ctx.profile.warp_size_potentially_larger_than_guest) { - src_thread_id = AddPartitionBase(ctx, src_thread_id); - } - SetInBoundsFlag(inst, in_range); - return SelectValue(ctx, in_range, value, src_thread_id); + const Id shuffled{ctx.OpGroupNonUniformShuffleXor(ctx.U32[1], SubgroupScope(ctx), value, mask)}; + return ctx.OpSelect(ctx.U32[1], in_range, shuffled, value); } Id EmitQuadBroadcast(EmitContext& ctx, Id value, Id lane) { @@ -267,10 +318,16 @@ Id EmitQuadBroadcast(EmitContext& ctx, Id value, Id lane) { const Id base{ctx.OpBitwiseAnd(ctx.U32[1], GetThreadId(ctx), ctx.Const(~3u))}; const Id local_lane{ctx.OpBitwiseAnd(ctx.U32[1], lane, ctx.Const(3u))}; const Id src_thread_id{ctx.OpBitwiseOr(ctx.U32[1], base, local_lane)}; - return ctx.OpGroupNonUniformShuffle(ctx.U32[1], SubgroupScope(ctx), value, src_thread_id); + return ShuffleAbsolute(ctx, value, src_thread_id); } Id EmitQuadSwap(EmitContext& ctx, Id value, Id direction) { + if (ctx.profile.support_quad_shuffles) { + const Id result{ + ctx.OpGroupNonUniformQuadBroadcast(ctx.U32[1], SubgroupScope(ctx), value, direction)}; + ctx.opcode_rewrites.emplace_back(result.value, spv::Op::OpGroupNonUniformQuadSwap); + return result; + } const Id xor_mask{ctx.OpIAdd(ctx.U32[1], direction, ctx.Const(1u))}; return ctx.OpGroupNonUniformShuffleXor(ctx.U32[1], SubgroupScope(ctx), value, xor_mask); } diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index 7edc104708..a5821e9e93 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -361,6 +361,7 @@ public: Id frag_depth{}; std::vector interfaces; + std::vector> opcode_rewrites; Id load_const_func_u8{}; Id load_const_func_u16{}; diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp index 57c08588fb..9424de188d 100644 --- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp +++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp @@ -651,6 +651,29 @@ IR::Value GetThroughCast(IR::Value value, IR::Opcode expected_cast) { return value; } +u32 QuadButterflyMask(const IR::Inst& inst) { + if (inst.GetOpcode() == IR::Opcode::QuadSwap) { + const IR::Value direction{inst.Arg(1)}; + if (!direction.IsImmediate()) { + return 0; + } + return direction.U32() + 1; + } + if (inst.GetOpcode() != IR::Opcode::ShuffleButterfly) { + return 0; + } + const IR::Value index{inst.Arg(1)}; + const IR::Value clamp{inst.Arg(2)}; + const IR::Value segmentation_mask{inst.Arg(3)}; + if (!index.IsImmediate() || !clamp.IsImmediate() || !segmentation_mask.IsImmediate()) { + return 0; + } + if (clamp.U32() != 3 || segmentation_mask.U32() != 28) { + return 0; + } + return index.U32(); +} + void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) { const IR::Value swizzle{inst.Arg(2)}; if (!swizzle.IsImmediate()) { @@ -666,7 +689,8 @@ void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) { return; } IR::Inst* const inst2{value_1.InstRecursive()}; - if (inst2->GetOpcode() != IR::Opcode::ShuffleButterfly) { + const u32 lane_mask{QuadButterflyMask(*inst2)}; + if (lane_mask == 0) { return; } const IR::Value value_3{GetThroughCast(inst2->Arg(0).Resolve(), IR::Opcode::BitCastU32F32)}; @@ -678,24 +702,15 @@ void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) { return; } } - const IR::Value index{inst2->Arg(1)}; - const IR::Value clamp{inst2->Arg(2)}; - const IR::Value segmentation_mask{inst2->Arg(3)}; - if (!index.IsImmediate() || !clamp.IsImmediate() || !segmentation_mask.IsImmediate()) { - return; - } - if (clamp.U32() != 3 || segmentation_mask.U32() != 28) { - return; - } if (swizzle_value == 0x99) { // DPdxFine - if (index.U32() == 1) { + if (lane_mask == 1) { IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; inst.ReplaceUsesWith(ir.DPdxFine(IR::F32{inst.Arg(1)})); } } else if (swizzle_value == 0xA5) { // DPdyFine - if (index.U32() == 2) { + if (lane_mask == 2) { IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; inst.ReplaceUsesWith(ir.DPdyFine(IR::F32{inst.Arg(1)})); } @@ -709,6 +724,13 @@ bool FindGradient3DDerivatives(std::array& results, IR::Value coor const auto check_through_shuffle = [](IR::Value input, IR::Value& result) { const IR::Value value_1{GetThroughCast(input.Resolve(), IR::Opcode::BitCastF32U32)}; IR::Inst* const inst2{value_1.InstRecursive()}; + if (inst2->GetOpcode() == IR::Opcode::QuadBroadcast) { + if (!inst2->Arg(1).Resolve().IsImmediate()) { + return false; + } + result = GetThroughCast(inst2->Arg(0).Resolve(), IR::Opcode::BitCastU32F32); + return true; + } if (inst2->GetOpcode() != IR::Opcode::ShuffleIndex) { return false; } diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index d2ac480ab8..8e9c83f888 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h @@ -40,6 +40,7 @@ struct Profile { bool support_shader_quad_control{}; bool support_quad_shuffles{}; bool support_vote{}; + bool support_shuffle_relative{}; u32 supported_subgroup_stages{0x7F}; bool support_viewport_index_layer_non_geometry{}; bool support_viewport_mask{}; @@ -102,6 +103,8 @@ struct Profile { bool ignore_nan_fp_comparisons{}; /// Some drivers have broken support for OpVectorExtractDynamic on subgroup mask inputs bool has_broken_spirv_subgroup_mask_vector_extract_dynamic{}; + bool has_broken_spirv_subgroup_shuffle{}; + u32 max_subgroup_size{}; u32 gl_max_compute_smem_size{}; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 642b9fa223..7c530e1cfb 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -362,7 +362,7 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, const auto subgroup_stage_bit{[subgroup_stages](VkShaderStageFlags flag, Shader::Stage stage) { return (subgroup_stages & flag) != 0 ? (1u << static_cast(stage)) : 0u; }}; - const u32 supported_subgroup_stages{ + u32 supported_subgroup_stages{ subgroup_stage_bit(VK_SHADER_STAGE_VERTEX_BIT, Shader::Stage::VertexA) | subgroup_stage_bit(VK_SHADER_STAGE_VERTEX_BIT, Shader::Stage::VertexB) | subgroup_stage_bit(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, @@ -372,6 +372,9 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, subgroup_stage_bit(VK_SHADER_STAGE_GEOMETRY_BIT, Shader::Stage::Geometry) | subgroup_stage_bit(VK_SHADER_STAGE_FRAGMENT_BIT, Shader::Stage::Fragment) | subgroup_stage_bit(VK_SHADER_STAGE_COMPUTE_BIT, Shader::Stage::Compute)}; + if (driver_id == VK_DRIVER_ID_MESA_TURNIP) { + supported_subgroup_stages &= ~(1u << static_cast(Shader::Stage::Geometry)); + } profile = Shader::Profile{ .supported_spirv = device.SupportedSpirvVersion(), .unified_descriptor_binding = true, @@ -409,6 +412,8 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, .support_shader_quad_control = device.IsKhrShaderQuadControlSupported(), .support_quad_shuffles = device.IsSubgroupFeatureSupported(VK_SUBGROUP_FEATURE_QUAD_BIT), .support_vote = device.IsSubgroupFeatureSupported(VK_SUBGROUP_FEATURE_VOTE_BIT), + .support_shuffle_relative = + device.IsSubgroupFeatureSupported(VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT), .supported_subgroup_stages = supported_subgroup_stages, .support_viewport_index_layer_non_geometry = device.IsExtShaderViewportIndexLayerSupported(), @@ -444,13 +449,17 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA, .has_broken_spirv_clamp = driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, - .has_broken_spirv_position_input = driver_id == false, + .has_broken_spirv_position_input = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, .has_broken_unsigned_image_offsets = false, .has_broken_signed_operations = false, .has_broken_fp16_float_controls = driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY, .has_broken_fp32_denorm_flush = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, .ignore_nan_fp_comparisons = false, - .has_broken_spirv_subgroup_mask_vector_extract_dynamic = false, + .has_broken_spirv_subgroup_mask_vector_extract_dynamic = + driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY && + device.GetDriverVersion() < VK_MAKE_VERSION(512, 672, 0), + .has_broken_spirv_subgroup_shuffle = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, + .max_subgroup_size = device.GetMaxSubgroupSize(), .has_broken_robust = device.IsNvidia() && device.GetNvidiaArch() <= NvidiaArchitecture::Arch_Pascal, .min_ssbo_alignment = device.GetStorageBufferAlignment(), diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index fba45d2385..3e3726651d 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -485,6 +485,11 @@ FN_MAX_LIMIT_LIST return properties.subgroup_properties.supportedStages; } + u32 GetMaxSubgroupSize() const { + return (std::max)(properties.subgroup_properties.subgroupSize, + properties.subgroup_size_control.maxSubgroupSize); + } + /// Returns the maximum number of push descriptors. u32 MaxPushDescriptors() const { return properties.push_descriptor.maxPushDescriptors; From d832f5e156a7108ddb7f6a4b57186146564ab286 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 00:42:58 -0400 Subject: [PATCH 104/198] Re-do geometry compaction pass --- src/shader_recompiler/CMakeLists.txt | 1 + .../frontend/maxwell/translate_program.cpp | 1 + src/shader_recompiler/host_translate_info.h | 1 + .../ir_opt/geometry_compaction_pass.cpp | 129 ++++++++++++++++++ src/shader_recompiler/ir_opt/passes.h | 1 + .../renderer_vulkan/vk_pipeline_cache.cpp | 1 + 6 files changed, 134 insertions(+) create mode 100644 src/shader_recompiler/ir_opt/geometry_compaction_pass.cpp diff --git a/src/shader_recompiler/CMakeLists.txt b/src/shader_recompiler/CMakeLists.txt index 957ed5fb55..cc9ce95d92 100644 --- a/src/shader_recompiler/CMakeLists.txt +++ b/src/shader_recompiler/CMakeLists.txt @@ -172,6 +172,7 @@ add_library(shader_recompiler STATIC ir_opt/constant_propagation_pass.cpp ir_opt/dead_code_elimination_pass.cpp ir_opt/dual_vertex_pass.cpp + ir_opt/geometry_compaction_pass.cpp ir_opt/global_memory_to_storage_buffer_pass.cpp ir_opt/identity_removal_pass.cpp ir_opt/layer_pass.cpp diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp index ebc5a825dd..e7d7e5a6b3 100644 --- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp @@ -299,6 +299,7 @@ IR::Program TranslateProgram(ObjectPool& inst_pool, ObjectPool + +#include "shader_recompiler/frontend/ir/ir_emitter.h" +#include "shader_recompiler/host_translate_info.h" +#include "shader_recompiler/ir_opt/passes.h" + +namespace Shader::Optimization { +namespace { +constexpr int MAX_BALLOT_DEPTH = 8; + +struct SlotAtomic { + IR::Block* block; + IR::Inst* atomic; + IR::Inst* ballot; +}; + +IR::Inst* FindBallot(const IR::Value& value, int depth) { + if (depth > MAX_BALLOT_DEPTH || value.IsImmediate()) { + return nullptr; + } + IR::Inst* const inst{value.InstRecursive()}; + if (inst->GetOpcode() == IR::Opcode::SubgroupBallot) { + return inst; + } + if (inst->GetOpcode() == IR::Opcode::Phi) { + return nullptr; + } + for (size_t index = 0; index < inst->NumArgs(); ++index) { + if (IR::Inst* const ballot{FindBallot(inst->Arg(index), depth + 1)}) { + return ballot; + } + } + return nullptr; +} + +bool IsShuffle(IR::Opcode opcode) { + switch (opcode) { + case IR::Opcode::ShuffleIndex: + case IR::Opcode::ShuffleUp: + case IR::Opcode::ShuffleDown: + case IR::Opcode::ShuffleButterfly: + return true; + default: + return false; + } +} + +IR::U32 PrimitiveSlot(IR::IREmitter& ir, u32 invocations, const IR::U32& amount) { + IR::U32 key{ir.GetAttributeU32(IR::Attribute::PrimitiveId)}; + if (invocations > 1) { + key = ir.IAdd(ir.IMul(key, ir.Imm32(invocations)), ir.InvocationId()); + } + return ir.IMul(key, amount); +} + +bool MergesAtomic(const IR::Inst& phi, const IR::Block& block, const IR::Inst& atomic) { + for (size_t index = 0; index < phi.NumArgs(); ++index) { + const IR::Value arg{phi.Arg(index)}; + if (phi.PhiBlock(index) == &block && !arg.IsImmediate() && + arg.InstRecursive() == &atomic) { + return true; + } + } + return false; +} + +void RewriteMergedSlots(IR::Block& block, IR::Inst& atomic, u32 invocations) { + for (IR::Block* const successor : block.ImmSuccessors()) { + for (IR::Inst& phi : successor->Instructions()) { + if (phi.GetOpcode() != IR::Opcode::Phi || !MergesAtomic(phi, block, atomic)) { + continue; + } + for (size_t index = 0; index < phi.NumArgs(); ++index) { + const IR::Value arg{phi.Arg(index)}; + if (arg.IsImmediate() || !IsShuffle(arg.InstRecursive()->GetOpcode())) { + continue; + } + IR::IREmitter ir{*phi.PhiBlock(index)}; + const IR::U32 amount{arg.InstRecursive()->Arg(0)}; + phi.SetArg(index, PrimitiveSlot(ir, invocations, amount)); + } + } + } +} + +void RewriteAtomic(IR::Block& block, IR::Inst& atomic, u32 invocations) { + const auto insert_point{IR::Block::InstructionList::s_iterator_to(atomic)}; + IR::IREmitter ir{block, insert_point}; + const IR::U32 amount{atomic.Arg(2)}; + const IR::U32 slot{PrimitiveSlot(ir, invocations, amount)}; + block.PrependNewInst(insert_point, IR::Opcode::StorageAtomicUMax32, + {atomic.Arg(0), atomic.Arg(1), ir.IAdd(slot, amount)}); + atomic.ReplaceUsesWith(slot); +} + +void NeutralizePredicate(IR::Inst& ballot) { + const IR::Value pred{ballot.Arg(0)}; + if (!pred.IsImmediate()) { + pred.InstRecursive()->ReplaceUsesWith(IR::Value{true}); + } +} +} + +void GeometryCompactionPass(IR::Program& program, const HostTranslateInfo& host_info) { + if (program.stage != Stage::Geometry || !host_info.single_lane_geometry_subgroups) { + return; + } + boost::container::small_vector slot_atomics; + for (IR::Block* const block : program.post_order_blocks) { + for (IR::Inst& inst : block->Instructions()) { + if (inst.GetOpcode() != IR::Opcode::StorageAtomicIAdd32) { + continue; + } + if (IR::Inst* const ballot{FindBallot(inst.Arg(2), 0)}) { + slot_atomics.push_back({block, &inst, ballot}); + } + } + } + for (const SlotAtomic& slot_atomic : slot_atomics) { + RewriteMergedSlots(*slot_atomic.block, *slot_atomic.atomic, program.invocations); + RewriteAtomic(*slot_atomic.block, *slot_atomic.atomic, program.invocations); + NeutralizePredicate(*slot_atomic.ballot); + } +} + +} diff --git a/src/shader_recompiler/ir_opt/passes.h b/src/shader_recompiler/ir_opt/passes.h index 1e637cb23c..0c2b44e022 100644 --- a/src/shader_recompiler/ir_opt/passes.h +++ b/src/shader_recompiler/ir_opt/passes.h @@ -16,6 +16,7 @@ void CollectShaderInfoPass(Environment& env, IR::Program& program); void ConditionalBarrierPass(IR::Program& program); void ConstantPropagationPass(Environment& env, IR::Program& program); void DeadCodeEliminationPass(IR::Program& program); +void GeometryCompactionPass(IR::Program& program, const HostTranslateInfo& host_info); void GlobalMemoryToStorageBufferPass(IR::Program& program, const HostTranslateInfo& host_info); void IdentityRemovalPass(IR::Program& program); void LowerFp64ToFp32(IR::Program& program); diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 7c530e1cfb..d04d36046e 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -488,6 +488,7 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, .support_viewport_index_layer = device.IsExtShaderViewportIndexLayerSupported(), .support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(), .support_conditional_barrier = device.SupportsConditionalBarriers(), + .single_lane_geometry_subgroups = !profile.SupportsSubgroupStage(Shader::Stage::Geometry), }; host_info.ApplyDescriptorLimitPolicy(); From 9d4355064b7dbc8f72eddee2444a412cccef73e3 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 02:31:24 -0400 Subject: [PATCH 105/198] Another try to make barriers more explicit --- .../renderer_vulkan/vk_buffer_cache.cpp | 66 +++++-------------- .../renderer_vulkan/vk_rasterizer.cpp | 26 ++++---- .../renderer_vulkan/vk_scheduler.cpp | 43 +++++++++--- src/video_core/renderer_vulkan/vk_scheduler.h | 14 ++++ src/video_core/vulkan_common/vulkan_wrapper.h | 25 +++++++ 5 files changed, 103 insertions(+), 71 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 57494d9649..30baf44e9d 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -36,6 +36,24 @@ struct VertexBindings { u32 count; }; +constexpr VkMemoryBarrier2 READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS | VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = vk::ACCESS_TRANSFER, +}; + +constexpr VkMemoryBarrier2 WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS, + .dstAccessMask = vk::ACCESS_BUFFER_INPUTS, +}; + VkBufferCopy MakeBufferCopy(const VideoCommon::BufferCopy& copy) { return VkBufferCopy{ .srcOffset = copy.src_offset, @@ -482,22 +500,6 @@ void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, if (dst_buffer == VK_NULL_HANDLE || src_buffer == VK_NULL_HANDLE) { return; } - static constexpr VkMemoryBarrier2 READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, - }; - static constexpr VkMemoryBarrier2 WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, - }; // Measuring a popular game, this number never exceeds the specified size once data is warmed up boost::container::small_vector vk_copies(copies.size()); @@ -523,14 +525,6 @@ void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, } void BufferCacheRuntime::PreCopyBarrier() { - static constexpr VkMemoryBarrier2 READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, - }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([](vk::CommandBuffer cmdbuf) { cmdbuf.PipelineBarrier(READ_BARRIER); @@ -538,14 +532,6 @@ void BufferCacheRuntime::PreCopyBarrier() { } void BufferCacheRuntime::PostCopyBarrier() { - static constexpr VkMemoryBarrier2 WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, - }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([](vk::CommandBuffer cmdbuf) { cmdbuf.PipelineBarrier(WRITE_BARRIER); @@ -556,22 +542,6 @@ void BufferCacheRuntime::ClearBuffer(VkBuffer dest_buffer, u32 offset, size_t si if (dest_buffer == VK_NULL_HANDLE) { return; } - static constexpr VkMemoryBarrier2 READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, - }; - static constexpr VkMemoryBarrier2 WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, - }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([dest_buffer, offset, size, value](vk::CommandBuffer cmdbuf) { diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index c77d032f94..488fe8019c 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -631,19 +631,19 @@ void RasterizerVulkan::DispatchCompute() { static constexpr VkMemoryBarrier2 READ_BARRIER{ .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = - VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT, + .srcStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = vk::ACCESS_SHADER_RESOURCES, }; - static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + static constexpr VkMemoryBarrier2 INDIRECT_READ_BARRIER{ .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS, .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT | vk::ACCESS_SHADER_RESOURCES, }; const auto& qmd{kepler_compute->launch_description}; auto indirect_address = kepler_compute->GetIndirectComputeAddress(); @@ -653,15 +653,14 @@ void RasterizerVulkan::DispatchCompute() { const auto post_op = VideoCommon::ObtainBufferOperation::DiscardWrite; const auto [buffer, offset] = buffer_cache.ObtainBuffer(*indirect_address, 12, sync_info, post_op); - scheduler.RequestOutsideRenderPassOperationContext(); + scheduler.RequestComputeDispatchContext(); scheduler.Record([pipeline, indirect_buffer = buffer->Handle(), indirect_offset = offset](vk::CommandBuffer cmdbuf) { if (!pipeline->IsBound()) { return; } - cmdbuf.PipelineBarrier(READ_BARRIER); + cmdbuf.PipelineBarrier(INDIRECT_READ_BARRIER); cmdbuf.DispatchIndirect(indirect_buffer, indirect_offset); - cmdbuf.PipelineBarrier(WRITE_BARRIER); }); return; } @@ -670,14 +669,13 @@ void RasterizerVulkan::DispatchCompute() { if (dim[0] > max_dim[0] || dim[1] > max_dim[1] || dim[2] > max_dim[2]) { return; } - scheduler.RequestOutsideRenderPassOperationContext(); + scheduler.RequestComputeDispatchContext(); scheduler.Record([pipeline, dim](vk::CommandBuffer cmdbuf) { if (!pipeline->IsBound()) { return; } cmdbuf.PipelineBarrier(READ_BARRIER); cmdbuf.Dispatch(dim[0], dim[1], dim[2]); - cmdbuf.PipelineBarrier(WRITE_BARRIER); }); // Log compute dispatch diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 457221b2b1..ed7cc1ed19 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -47,6 +47,12 @@ Scheduler::Scheduler(const Device& device_, StateTracker& state_tracker_) : device{device_}, state_tracker{state_tracker_}, master_semaphore{std::make_unique(device)}, command_pool{std::make_unique(*master_semaphore, device)} { + if (device.IsExtTransformFeedbackSupported()) { + renderpass_write_barrier.srcStageMask |= VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT; + renderpass_write_barrier.srcAccessMask |= VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT; + renderpass_write_barrier.dstStageMask |= VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT; + renderpass_write_barrier.dstAccessMask |= VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT; + } AcquireNewChunk(); AllocateWorkerCommandBuffer(); @@ -95,6 +101,7 @@ void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, VkRenderPass const VkClearValue* clear_values, u32 clear_value_count) { const VkFramebuffer framebuffer_handle = framebuffer->Handle(); const VkExtent2D render_area = framebuffer->RenderArea(); + PublishComputeWrites(); state.renderpass = renderpass; state.framebuffer = framebuffer_handle; state.render_area = render_area; @@ -222,6 +229,31 @@ void Scheduler::RequestRenderpass(const Framebuffer* framebuffer) { void Scheduler::RequestOutsideRenderPassOperationContext() { EndRenderPass(); + PublishComputeWrites(); +} + +void Scheduler::RequestComputeDispatchContext() { + EndRenderPass(); + compute_writes = true; +} + +void Scheduler::PublishComputeWrites() { + if (!std::exchange(compute_writes, false)) { + return; + } + Record([](vk::CommandBuffer cmdbuf) { + static constexpr VkMemoryBarrier2 COMPUTE_WRITE_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS | vk::PIPELINE_STAGE_ATTACHMENTS | + VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = + vk::ACCESS_BUFFER_INPUTS | vk::ACCESS_ATTACHMENTS | vk::ACCESS_TRANSFER, + }; + cmdbuf.PipelineBarrier(COMPUTE_WRITE_BARRIER); + }); } bool Scheduler::UpdateGraphicsPipeline(GraphicsPipeline* pipeline) { @@ -420,17 +452,10 @@ void Scheduler::EndRenderPass() Record([num_images = num_renderpass_images, images = renderpass_images, ranges = renderpass_image_ranges, + write_barrier = &renderpass_write_barrier, num_memory_barriers = static_cast(std::exchange(renderpass_writes, false))]( vk::CommandBuffer cmdbuf) { - static constexpr VkMemoryBarrier2 WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, - }; std::array barriers; for (size_t i = 0; i < num_images; ++i) { const VkImageSubresourceRange& range = ranges[i]; @@ -471,7 +496,7 @@ void Scheduler::EndRenderPass() }; } cmdbuf.EndRenderPass(); - cmdbuf.PipelineBarrier(0, vk::Span(&WRITE_BARRIER, num_memory_barriers), {}, + cmdbuf.PipelineBarrier(0, vk::Span(write_barrier, num_memory_barriers), {}, vk::Span(barriers.data(), num_images)); }); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index c78faeecb5..53be37928b 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -73,6 +73,8 @@ public: /// of a renderpass. void RequestOutsideRenderPassOperationContext(); + void RequestComputeDispatchContext(); + /// Returns true when a render pass is currently active in the scheduler state. bool IsRenderPassActive() const { return state.renderpass != VK_NULL_HANDLE; @@ -319,6 +321,8 @@ private: void EndRenderPass(); + void PublishComputeWrites(); + void AcquireNewChunk(); const Device& device; @@ -343,6 +347,16 @@ private: u64 wfi_serial = 0; bool renderpass_writes = false; bool renderpass_depth_writes = false; + bool compute_writes = false; + VkMemoryBarrier2 renderpass_write_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_SHADERS, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS | vk::PIPELINE_STAGE_ATTACHMENTS | + VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = vk::ACCESS_BUFFER_INPUTS | vk::ACCESS_ATTACHMENTS | vk::ACCESS_TRANSFER, + }; u32 num_renderpass_images = 0; std::array renderpass_images{}; std::array renderpass_image_ranges{}; diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 7898886921..72403aff8b 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -158,6 +158,31 @@ inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER_ inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_HOST = VK_PIPELINE_STAGE_2_HOST_BIT; +inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_GRAPHICS_SHADERS = + VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT | VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT; + +inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_BUFFER_INPUTS = + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT | + PIPELINE_STAGE_GRAPHICS_SHADERS | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT; + +inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_ATTACHMENTS = + VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT; + +inline constexpr VkAccessFlags2 ACCESS_SHADER_RESOURCES = + VK_ACCESS_2_UNIFORM_READ_BIT | VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT; + +inline constexpr VkAccessFlags2 ACCESS_BUFFER_INPUTS = + VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_2_INDEX_READ_BIT | + VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT | ACCESS_SHADER_RESOURCES; + +inline constexpr VkAccessFlags2 ACCESS_ATTACHMENTS = + VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + +inline constexpr VkAccessFlags2 ACCESS_TRANSFER = + VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT; + /// Table holding Vulkan instance function pointers. struct InstanceDispatch { From 49c3a79fa8e6508551141e53b20d373937cbf3cf Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 04:13:18 -0400 Subject: [PATCH 106/198] Keep adjusting memory barriers to be more explicit --- src/video_core/renderer_vulkan/blit_image.cpp | 40 +--- src/video_core/renderer_vulkan/blit_image.h | 4 - .../renderer_vulkan/present/util.cpp | 25 +-- .../renderer_vulkan/vk_buffer_cache.cpp | 56 +++-- .../renderer_vulkan/vk_buffer_cache.h | 3 + .../renderer_vulkan/vk_compute_pass.cpp | 61 +++--- .../renderer_vulkan/vk_present_manager.cpp | 14 +- .../renderer_vulkan/vk_query_cache.cpp | 34 ++- .../renderer_vulkan/vk_rasterizer.cpp | 26 +-- .../renderer_vulkan/vk_scheduler.cpp | 47 ++--- src/video_core/renderer_vulkan/vk_scheduler.h | 12 +- .../renderer_vulkan/vk_texture_cache.cpp | 194 +++++++----------- src/video_core/vulkan_common/vulkan_device.h | 26 +++ src/video_core/vulkan_common/vulkan_wrapper.h | 30 ++- 14 files changed, 246 insertions(+), 326 deletions(-) diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index b462572a5b..dad11ae613 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -460,16 +460,8 @@ void RecordShaderReadBarrier(Scheduler& scheduler, const ImageView& image_view) const VkImageMemoryBarrier2 barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | - VK_PIPELINE_STAGE_2_TRANSFER_BIT | - VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT, - .srcAccessMask = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_SHADER_WRITE_BIT | - VK_ACCESS_2_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT, @@ -950,8 +942,8 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = aspect_info.pre_src_stages, - .srcAccessMask = aspect_info.pre_src_access, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = aspect_info.pre_dst_stages, .dstAccessMask = aspect_info.pre_src_dst_access, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -964,8 +956,8 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = aspect_info.pre_src_stages, - .srcAccessMask = aspect_info.pre_src_access, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = aspect_info.pre_dst_stages, .dstAccessMask = aspect_info.pre_dst_dst_access, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1017,8 +1009,8 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, .pNext = nullptr, .srcStageMask = aspect_info.post_src_stages, .srcAccessMask = aspect_info.post_src_access, - .dstStageMask = aspect_info.post_dst_stages, - .dstAccessMask = aspect_info.post_dst_access, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1075,21 +1067,13 @@ void BlitImageHelper::CopyMSAA(RenderPassCache& render_pass_cache, VkImage dst_i .src_view_aspect = VK_IMAGE_ASPECT_COLOR_BIT, .attachment_aspect = VK_IMAGE_ASPECT_COLOR_BIT, .barrier_aspect = VK_IMAGE_ASPECT_COLOR_BIT, - .pre_src_access = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | - VK_ACCESS_2_TRANSFER_WRITE_BIT, .pre_src_dst_access = VK_ACCESS_2_SHADER_READ_BIT, .pre_dst_dst_access = VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, - .pre_src_stages = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT, .pre_dst_stages = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, .post_src_access = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, - .post_dst_access = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_TRANSFER_READ_BIT, .post_src_stages = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, - .post_dst_stages = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT, }; const VkFormat src_vk_format = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, true, src_format).format; @@ -1584,21 +1568,13 @@ void BlitImageHelper::CopyMSAADepth(RenderPassCache& render_pass_cache, VkImage .src_view_aspect = VK_IMAGE_ASPECT_DEPTH_BIT, .attachment_aspect = attachment_aspect, .barrier_aspect = attachment_aspect, - .pre_src_access = - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, .pre_src_dst_access = VK_ACCESS_2_SHADER_READ_BIT, .pre_dst_dst_access = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - .pre_src_stages = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_TRANSFER_BIT, .pre_dst_stages = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT, .post_src_access = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - .post_dst_access = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_TRANSFER_READ_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT, .post_src_stages = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT, - .post_dst_stages = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, }; const VkFormat src_vk_format = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, true, src_format).format; diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index 895d0f8de4..bf9bdfdc41 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h @@ -140,15 +140,11 @@ private: VkImageAspectFlags src_view_aspect; VkImageAspectFlags attachment_aspect; VkImageAspectFlags barrier_aspect; - VkAccessFlags2 pre_src_access; VkAccessFlags2 pre_src_dst_access; VkAccessFlags2 pre_dst_dst_access; - VkPipelineStageFlags2 pre_src_stages; VkPipelineStageFlags2 pre_dst_stages; VkAccessFlags2 post_src_access; - VkAccessFlags2 post_dst_access; VkPipelineStageFlags2 post_src_stages; - VkPipelineStageFlags2 post_dst_stages; }; void BlitImpl(const Framebuffer* dst_framebuffer, const ImageView& src_image_view, diff --git a/src/video_core/renderer_vulkan/present/util.cpp b/src/video_core/renderer_vulkan/present/util.cpp index 80d5e19578..7c9e0aa76d 100644 --- a/src/video_core/renderer_vulkan/present/util.cpp +++ b/src/video_core/renderer_vulkan/present/util.cpp @@ -49,16 +49,13 @@ vk::Image CreateWrappedImage(MemoryAllocator& allocator, VkExtent2D dimensions, void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayout target_layout, VkImageLayout source_layout) { - constexpr VkAccessFlags2 flags{VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_SHADER_READ_BIT}; const VkImageMemoryBarrier2 barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .srcAccessMask = flags, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = flags, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = source_layout, .newLayout = target_layout, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -121,8 +118,8 @@ void DownloadColorImage(vk::CommandBuffer& cmdbuf, VkImage image, VkBuffer buffe const VkImageMemoryBarrier2 read_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -143,8 +140,8 @@ void DownloadColorImage(vk::CommandBuffer& cmdbuf, VkImage image, VkBuffer buffe .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_NONE, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -162,9 +159,9 @@ void DownloadColorImage(vk::CommandBuffer& cmdbuf, VkImage image, VkBuffer buffe .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_HOST, + .dstAccessMask = VK_ACCESS_2_HOST_READ_BIT, }; const VkBufferImageCopy copy{ .bufferOffset = 0, diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 30baf44e9d..7b9287d797 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -36,24 +36,6 @@ struct VertexBindings { u32 count; }; -constexpr VkMemoryBarrier2 READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS | VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = vk::ACCESS_TRANSFER, -}; - -constexpr VkMemoryBarrier2 WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS, - .dstAccessMask = vk::ACCESS_BUFFER_INPUTS, -}; - VkBufferCopy MakeBufferCopy(const VideoCommon::BufferCopy& copy) { return VkBufferCopy{ .srcOffset = copy.src_offset, @@ -392,7 +374,23 @@ BufferCacheRuntime::BufferCacheRuntime(const Device& device_, MemoryAllocator& m staging_pool{staging_pool_}, guest_descriptor_queue{guest_descriptor_queue_}, quad_index_pass(device, scheduler, descriptor_pool, staging_pool, compute_pass_descriptor_queue), - multi_range_buffers(device_) { + multi_range_buffers(device_), + read_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = device_.GetBufferUserStages(), + .srcAccessMask = vk::ACCESS_BUFFER_WRITES, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = vk::ACCESS_TRANSFER, + }, + write_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = device_.GetBufferConsumerStages(), + .dstAccessMask = device_.GetBufferConsumerAccess(), + } { const VkDriverIdKHR driver_id = device.GetDriverID(); limit_dynamic_storage_buffers = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY || driver_id == VK_DRIVER_ID_ARM_PROPRIETARY; @@ -513,28 +511,28 @@ void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, } scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([src_buffer, dst_buffer, vk_copies, barrier](vk::CommandBuffer cmdbuf) { + scheduler.Record([this, src_buffer, dst_buffer, vk_copies, barrier](vk::CommandBuffer cmdbuf) { if (barrier) { - cmdbuf.PipelineBarrier(READ_BARRIER); + cmdbuf.PipelineBarrier(read_barrier); } cmdbuf.CopyBuffer(src_buffer, dst_buffer, VideoCommon::FixSmallVectorADL(vk_copies)); if (barrier) { - cmdbuf.PipelineBarrier(WRITE_BARRIER); + cmdbuf.PipelineBarrier(write_barrier); } }); } void BufferCacheRuntime::PreCopyBarrier() { scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(READ_BARRIER); + scheduler.Record([this](vk::CommandBuffer cmdbuf) { + cmdbuf.PipelineBarrier(read_barrier); }); } void BufferCacheRuntime::PostCopyBarrier() { scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(WRITE_BARRIER); + scheduler.Record([this](vk::CommandBuffer cmdbuf) { + cmdbuf.PipelineBarrier(write_barrier); }); } @@ -544,10 +542,10 @@ void BufferCacheRuntime::ClearBuffer(VkBuffer dest_buffer, u32 offset, size_t si } scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([dest_buffer, offset, size, value](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(READ_BARRIER); + scheduler.Record([this, dest_buffer, offset, size, value](vk::CommandBuffer cmdbuf) { + cmdbuf.PipelineBarrier(read_barrier); cmdbuf.FillBuffer(dest_buffer, offset, size, value); - cmdbuf.PipelineBarrier(WRITE_BARRIER); + cmdbuf.PipelineBarrier(write_barrier); }); } diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index 1a8629aee8..2f40cc2ac1 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -270,6 +270,9 @@ private: boost::container::small_vector multi_range_sources; VkDeviceSize multi_range_total{}; + VkMemoryBarrier2 read_barrier; + VkMemoryBarrier2 write_barrier; + bool limit_dynamic_storage_buffers = false; u32 max_dynamic_storage_buffers = (std::numeric_limits::max)(); }; diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 083b3e900c..2fcba26ce4 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -328,7 +328,7 @@ std::pair Uint8Pass::Assemble(u32 num_vertices, VkBuffer .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, .dstStageMask = VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT, - .dstAccessMask = VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT, + .dstAccessMask = VK_ACCESS_2_INDEX_READ_BIT, }; const VkDescriptorSet set = descriptor_allocator.Commit(); device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); @@ -487,13 +487,13 @@ void ConditionalRenderingResolvePass::Resolve(VkBuffer dst_buffer, VkBuffer src_ scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([this, descriptor_data, compare_to_zero](vk::CommandBuffer cmdbuf) { - static constexpr VkMemoryBarrier2 read_barrier{ + const VkMemoryBarrier2 read_barrier{ .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT | VK_ACCESS_2_SHADER_WRITE_BIT, + .srcStageMask = device.GetBufferUserStages(), + .srcAccessMask = vk::ACCESS_BUFFER_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT, + .dstAccessMask = vk::ACCESS_SHADER_RESOURCES, }; static constexpr VkMemoryBarrier2 write_barrier{ .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, @@ -536,14 +536,22 @@ QueriesPrefixScanPass::QueriesPrefixScanPass( void QueriesPrefixScanPass::Run(VkBuffer accumulation_buffer, VkBuffer dst_buffer, VkBuffer src_buffer, size_t number_of_sums, size_t min_accumulation_limit, size_t max_accumulation_limit) { - constexpr VkAccessFlags2 BASE_DST_ACCESS = VK_ACCESS_2_SHADER_READ_BIT | - VK_ACCESS_2_TRANSFER_READ_BIT | - VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT | - VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT | - VK_ACCESS_2_INDEX_READ_BIT | - VK_ACCESS_2_UNIFORM_READ_BIT; - const VkAccessFlags2 conditional_access = - device.IsExtConditionalRendering() ? VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT : 0; + const VkMemoryBarrier2 read_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = device.GetBufferUserStages(), + .srcAccessMask = vk::ACCESS_BUFFER_WRITES, + .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .dstAccessMask = vk::ACCESS_SHADER_RESOURCES, + }; + const VkMemoryBarrier2 write_barrier{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = device.GetBufferConsumerStages(), + .dstAccessMask = device.GetBufferConsumerAccess(), + }; size_t current_runs = number_of_sums; size_t offset = 0; while (current_runs != 0) { @@ -560,23 +568,8 @@ void QueriesPrefixScanPass::Run(VkBuffer accumulation_buffer, VkBuffer dst_buffe scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([this, descriptor_data, min_accumulation_limit, max_accumulation_limit, - runs_to_do, used_offset, conditional_access](vk::CommandBuffer cmdbuf) { - static constexpr VkMemoryBarrier2 read_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT, - }; - const VkMemoryBarrier2 write_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = BASE_DST_ACCESS | conditional_access, - }; + runs_to_do, used_offset, read_barrier, + write_barrier](vk::CommandBuffer cmdbuf) { const QueriesPrefixScanPushConstants uniforms{ .min_accumulation_base = static_cast(min_accumulation_limit), .max_accumulation_base = static_cast(max_accumulation_limit), @@ -604,9 +597,9 @@ void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, V VkImageLayout old_layout = VK_IMAGE_LAYOUT_UNDEFINED; VkPipelineStageFlags2 src_stage = VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT; if (is_initialized) { - src_access = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT; + src_access = vk::ACCESS_IMAGE_WRITES; old_layout = VK_IMAGE_LAYOUT_GENERAL; - src_stage = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER; + src_stage = vk::PIPELINE_STAGE_IMAGE_USERS; } scheduler.Record([vk_pipeline, vk_image, aspect_mask, src_access, old_layout, src_stage](vk::CommandBuffer cmdbuf) { @@ -643,8 +636,8 @@ void RecordUnswizzleEndBarrier(Scheduler& scheduler, VkImage vk_image, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index 4db267f724..87eb109877 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -458,7 +458,7 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_NONE, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, @@ -478,8 +478,8 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -502,8 +502,8 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_NONE, + .dstAccessMask = VK_ACCESS_2_NONE, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -522,8 +522,8 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT, - .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index e14629dfc8..af8a0502b8 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -869,7 +869,7 @@ public: .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .dstStageMask = vk::PIPELINE_STAGE_HOST, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstAccessMask = VK_ACCESS_2_HOST_READ_BIT, }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([](vk::CommandBuffer cmdbuf) { @@ -1040,7 +1040,7 @@ private: .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([dst_buffer = current_bank->GetBuffer(), @@ -1577,32 +1577,24 @@ VideoCommon::StreamerInterface* QueryCacheRuntime::GetStreamerInterface(QueryTyp } void QueryCacheRuntime::Barriers(bool is_prebarrier) { - static constexpr VkMemoryBarrier2 READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, - }; - static constexpr VkMemoryBarrier2 WRITE_BARRIER{ + VkMemoryBarrier2 barrier{ .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER_HOST, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = impl->device.GetBufferConsumerStages(), + .dstAccessMask = impl->device.GetBufferConsumerAccess(), }; - impl->scheduler.RequestOutsideRenderPassOperationContext(); if (is_prebarrier) { - impl->scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(READ_BARRIER); - }); - } else { - impl->scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(WRITE_BARRIER); - }); + barrier.srcStageMask = impl->device.GetBufferUserStages(); + barrier.srcAccessMask = vk::ACCESS_BUFFER_WRITES; + barrier.dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT; + barrier.dstAccessMask = vk::ACCESS_TRANSFER; } + impl->scheduler.RequestOutsideRenderPassOperationContext(); + impl->scheduler.Record([barrier](vk::CommandBuffer cmdbuf) { + cmdbuf.PipelineBarrier(barrier); + }); } template diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 488fe8019c..a1dc2259a5 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -628,23 +628,14 @@ void RasterizerVulkan::DispatchCompute() { return; } - static constexpr VkMemoryBarrier2 READ_BARRIER{ + const VkMemoryBarrier2 read_barrier{ .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS, + .srcStageMask = device.GetBufferUserStages(), .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, .dstAccessMask = vk::ACCESS_SHADER_RESOURCES, }; - static constexpr VkMemoryBarrier2 INDIRECT_READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, - .dstStageMask = - VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - .dstAccessMask = VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT | vk::ACCESS_SHADER_RESOURCES, - }; const auto& qmd{kepler_compute->launch_description}; auto indirect_address = kepler_compute->GetIndirectComputeAddress(); if (indirect_address) { @@ -654,12 +645,15 @@ void RasterizerVulkan::DispatchCompute() { const auto [buffer, offset] = buffer_cache.ObtainBuffer(*indirect_address, 12, sync_info, post_op); scheduler.RequestComputeDispatchContext(); - scheduler.Record([pipeline, indirect_buffer = buffer->Handle(), - indirect_offset = offset](vk::CommandBuffer cmdbuf) { + VkMemoryBarrier2 indirect_read_barrier = read_barrier; + indirect_read_barrier.dstStageMask |= VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT; + indirect_read_barrier.dstAccessMask |= VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT; + scheduler.Record([pipeline, indirect_buffer = buffer->Handle(), indirect_offset = offset, + indirect_read_barrier](vk::CommandBuffer cmdbuf) { if (!pipeline->IsBound()) { return; } - cmdbuf.PipelineBarrier(INDIRECT_READ_BARRIER); + cmdbuf.PipelineBarrier(indirect_read_barrier); cmdbuf.DispatchIndirect(indirect_buffer, indirect_offset); }); return; @@ -670,11 +664,11 @@ void RasterizerVulkan::DispatchCompute() { return; } scheduler.RequestComputeDispatchContext(); - scheduler.Record([pipeline, dim](vk::CommandBuffer cmdbuf) { + scheduler.Record([pipeline, dim, read_barrier](vk::CommandBuffer cmdbuf) { if (!pipeline->IsBound()) { return; } - cmdbuf.PipelineBarrier(READ_BARRIER); + cmdbuf.PipelineBarrier(read_barrier); cmdbuf.Dispatch(dim[0], dim[1], dim[2]); }); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index ed7cc1ed19..42ecc9c3c6 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -47,11 +47,22 @@ Scheduler::Scheduler(const Device& device_, StateTracker& state_tracker_) : device{device_}, state_tracker{state_tracker_}, master_semaphore{std::make_unique(device)}, command_pool{std::make_unique(*master_semaphore, device)} { + compute_write_barrier = VkMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, + .dstStageMask = device.GetBufferConsumerStages() | vk::PIPELINE_STAGE_ATTACHMENTS, + .dstAccessMask = device.GetBufferConsumerAccess() | vk::ACCESS_ATTACHMENTS, + }; + renderpass_write_barrier = compute_write_barrier; + renderpass_write_barrier.srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_SHADERS; + upload_write_barrier = compute_write_barrier; + upload_write_barrier.srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT; + upload_write_barrier.srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT; if (device.IsExtTransformFeedbackSupported()) { renderpass_write_barrier.srcStageMask |= VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT; renderpass_write_barrier.srcAccessMask |= VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT; - renderpass_write_barrier.dstStageMask |= VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT; - renderpass_write_barrier.dstAccessMask |= VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT; } AcquireNewChunk(); @@ -241,18 +252,8 @@ void Scheduler::PublishComputeWrites() { if (!std::exchange(compute_writes, false)) { return; } - Record([](vk::CommandBuffer cmdbuf) { - static constexpr VkMemoryBarrier2 COMPUTE_WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS | vk::PIPELINE_STAGE_ATTACHMENTS | - VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = - vk::ACCESS_BUFFER_INPUTS | vk::ACCESS_ATTACHMENTS | vk::ACCESS_TRANSFER, - }; - cmdbuf.PipelineBarrier(COMPUTE_WRITE_BARRIER); + Record([barrier = &compute_write_barrier](vk::CommandBuffer cmdbuf) { + cmdbuf.PipelineBarrier(*barrier); }); } @@ -379,15 +380,7 @@ u64 Scheduler::SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_se const u64 signal_value = master_semaphore->NextTick(); RecordWithUploadBuffer([signal_semaphore, wait_semaphore, signal_value, this](vk::CommandBuffer cmdbuf, vk::CommandBuffer upload_cmdbuf) { - static constexpr VkMemoryBarrier2 WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, - }; - upload_cmdbuf.PipelineBarrier(WRITE_BARRIER); + upload_cmdbuf.PipelineBarrier(upload_write_barrier); upload_cmdbuf.End(); cmdbuf.End(); @@ -481,12 +474,8 @@ void Scheduler::EndRenderPass() | VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, .srcAccessMask = src_access, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT - | VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT - | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT - | VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT - | VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index 53be37928b..a7109e4a48 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -348,15 +348,9 @@ private: bool renderpass_writes = false; bool renderpass_depth_writes = false; bool compute_writes = false; - VkMemoryBarrier2 renderpass_write_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_SHADERS, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_BUFFER_INPUTS | vk::PIPELINE_STAGE_ATTACHMENTS | - VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = vk::ACCESS_BUFFER_INPUTS | vk::ACCESS_ATTACHMENTS | vk::ACCESS_TRANSFER, - }; + VkMemoryBarrier2 renderpass_write_barrier{}; + VkMemoryBarrier2 compute_write_barrier{}; + VkMemoryBarrier2 upload_write_barrier{}; u32 num_renderpass_images = 0; std::array renderpass_images{}; std::array renderpass_image_ranges{}; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 9882e1d34c..04b4eabc07 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -689,10 +689,6 @@ struct RangedBarrierRange { void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage image, VkImageAspectFlags aspect_mask, bool is_initialized, std::span copies) { - static constexpr VkAccessFlags2 WRITE_ACCESS_FLAGS = - VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - // Compute exact mip/layer range being written to RangedBarrierRange range; for (const auto& region : copies) { @@ -703,10 +699,8 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im const VkImageMemoryBarrier2 read_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - .srcAccessMask = WRITE_ACCESS_FLAGS, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = is_initialized ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_UNDEFINED, @@ -722,8 +716,8 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -938,8 +932,8 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -952,10 +946,8 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, // Discard contents @@ -972,8 +964,8 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT | VK_ACCESS_2_MEMORY_READ_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -986,8 +978,8 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT | VK_ACCESS_2_MEMORY_READ_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1259,27 +1251,17 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, static constexpr VkMemoryBarrier2 READ_BARRIER{ .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_BUFFER_USERS, + .srcAccessMask = vk::ACCESS_BUFFER_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, - }; - static constexpr VkMemoryBarrier2 WRITE_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstAccessMask = vk::ACCESS_TRANSFER, }; const std::array pre_barriers{ VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1296,8 +1278,8 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = 0, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1310,10 +1292,8 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1330,13 +1310,8 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | - VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1349,7 +1324,7 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, cmdbuf.CopyImageToBuffer(src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, copy_buffer, vk_in_copies); - cmdbuf.PipelineBarrier(0, WRITE_BARRIER, {}, middle_in_barrier); + cmdbuf.PipelineBarrier(0, {}, {}, middle_in_barrier); cmdbuf.PipelineBarrier(0, READ_BARRIER, {}, middle_out_barrier); cmdbuf.CopyBufferToImage(copy_buffer, dst_image, VK_IMAGE_LAYOUT_GENERAL, vk_out_copies); @@ -1435,10 +1410,8 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1457,10 +1430,8 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1482,11 +1453,8 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1679,13 +1647,8 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1698,13 +1661,8 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | - VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | - VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_2_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1721,8 +1679,8 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .dstAccessMask = 0, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1735,8 +1693,8 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1768,17 +1726,6 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, static_cast(copy.src_subresource.base_layer + copy.src_subresource.num_layers) <= shadow->layers) { const VkImageAspectFlags aspect_mask = shadow->aspect_mask; - VkPipelineStageFlags2 attachment_stage = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT; - VkAccessFlags2 attachment_write = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT; - VkAccessFlags2 attachment_read_write = - VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT; - if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) { - attachment_stage = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT | - VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT; - attachment_write = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - attachment_read_write = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - } const VkImage shadow_image = *shadow->image; const VkImage dst_image = dst.Handle(); const VkImageCopy region{ @@ -1799,15 +1746,14 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, .extent = {copy.extent.width, copy.extent.height, 1}, }; scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([shadow_image, dst_image, region, aspect_mask, attachment_stage, - attachment_write, - attachment_read_write](vk::CommandBuffer cmdbuf) { + scheduler.Record([shadow_image, dst_image, region, + aspect_mask](vk::CommandBuffer cmdbuf) { const std::array pre_barriers{ VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = attachment_stage | VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = attachment_write, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1821,9 +1767,8 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = attachment_stage | VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT | attachment_write | - VK_ACCESS_2_TRANSFER_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -1841,8 +1786,8 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, - .dstAccessMask = 0, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -1856,9 +1801,8 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, - .dstAccessMask = VK_ACCESS_2_SHADER_READ_BIT | attachment_read_write | - VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -2243,12 +2187,15 @@ void Image::DownloadMemory(std::span buffers_span, std::span o scheduler->RequestOutsideRenderPassOperationContext(); scheduler->Record([buffers = std::move(buffers_vector), image = temp_vk_image, - aspect_mask_ = aspect_mask, vk_copies](vk::CommandBuffer cmdbuf) { + aspect_mask_ = aspect_mask, vk_copies, + consumer_stages = runtime->device.GetBufferConsumerStages(), + consumer_access = runtime->device.GetBufferConsumerAccess()]( + vk::CommandBuffer cmdbuf) { const VkImageMemoryBarrier2 read_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -2275,17 +2222,17 @@ void Image::DownloadMemory(std::span buffers_span, std::span o .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = consumer_stages, + .dstAccessMask = consumer_access, }; const VkImageMemoryBarrier2 image_write_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -2318,12 +2265,15 @@ void Image::DownloadMemory(std::span buffers_span, std::span o } scheduler->RequestOutsideRenderPassOperationContext(); scheduler->Record([buffers = std::move(buffers_vector), image = *original_image, - aspect_mask_ = aspect_mask, vk_copies](vk::CommandBuffer cmdbuf) { + aspect_mask_ = aspect_mask, vk_copies, + consumer_stages = runtime->device.GetBufferConsumerStages(), + consumer_access = runtime->device.GetBufferConsumerAccess()]( + vk::CommandBuffer cmdbuf) { const VkImageMemoryBarrier2 read_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, .oldLayout = VK_IMAGE_LAYOUT_GENERAL, @@ -2350,17 +2300,17 @@ void Image::DownloadMemory(std::span buffers_span, std::span o .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = consumer_stages, + .dstAccessMask = consumer_access, }; const VkImageMemoryBarrier2 image_write_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, .srcAccessMask = 0, - .dstStageMask = vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, - .dstAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, @@ -3229,8 +3179,8 @@ void TextureCacheRuntime::TransitionImageLayout(Image& image) { .pNext = nullptr, .srcStageMask = VK_PIPELINE_STAGE_2_NONE, .srcAccessMask = VK_ACCESS_2_NONE, - .dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, - .dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 3e3726651d..12d2267876 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -869,6 +869,32 @@ FN_MAX_LIMIT_LIST return extensions.conditional_rendering; } + VkPipelineStageFlags2 GetBufferUserStages() const { + VkPipelineStageFlags2 stages = vk::PIPELINE_STAGE_BUFFER_USERS; + if (IsExtConditionalRendering()) { + stages |= VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT; + } + if (IsExtTransformFeedbackSupported()) { + stages |= VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT; + } + return stages; + } + + VkPipelineStageFlags2 GetBufferConsumerStages() const { + return GetBufferUserStages() | VK_PIPELINE_STAGE_2_HOST_BIT; + } + + VkAccessFlags2 GetBufferConsumerAccess() const { + VkAccessFlags2 access = vk::ACCESS_BUFFER_CONSUMERS; + if (IsExtConditionalRendering()) { + access |= VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT; + } + if (IsExtTransformFeedbackSupported()) { + access |= VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT; + } + return access; + } + bool IsExtAstcDecodeModeSupported() const { return extensions.astc_decode_mode; } diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 72403aff8b..824b567e7f 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -147,15 +147,6 @@ inline VkResult Filter(VkResult result) { return result; } -inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_GRAPHICS_COMPUTE = - VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT; - -inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER = - PIPELINE_STAGE_GRAPHICS_COMPUTE | VK_PIPELINE_STAGE_2_TRANSFER_BIT; - -inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER_HOST = - PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER | VK_PIPELINE_STAGE_2_HOST_BIT; - inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_HOST = VK_PIPELINE_STAGE_2_HOST_BIT; inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_GRAPHICS_SHADERS = @@ -183,6 +174,27 @@ inline constexpr VkAccessFlags2 ACCESS_ATTACHMENTS = inline constexpr VkAccessFlags2 ACCESS_TRANSFER = VK_ACCESS_2_TRANSFER_READ_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT; +inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_BUFFER_USERS = + PIPELINE_STAGE_BUFFER_INPUTS | VK_PIPELINE_STAGE_2_TRANSFER_BIT; + +inline constexpr VkAccessFlags2 ACCESS_BUFFER_WRITES = + VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT; + +inline constexpr VkAccessFlags2 ACCESS_BUFFER_CONSUMERS = + ACCESS_BUFFER_INPUTS | ACCESS_TRANSFER | VK_ACCESS_2_HOST_READ_BIT; + +inline constexpr VkPipelineStageFlags2 PIPELINE_STAGE_IMAGE_USERS = + PIPELINE_STAGE_GRAPHICS_SHADERS | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT | + PIPELINE_STAGE_ATTACHMENTS | VK_PIPELINE_STAGE_2_TRANSFER_BIT; + +inline constexpr VkAccessFlags2 ACCESS_IMAGE_WRITES = + VK_ACCESS_2_SHADER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_TRANSFER_WRITE_BIT; + +inline constexpr VkAccessFlags2 ACCESS_IMAGE_USERS = + VK_ACCESS_2_SHADER_READ_BIT | VK_ACCESS_2_SHADER_WRITE_BIT | ACCESS_ATTACHMENTS | + ACCESS_TRANSFER; + /// Table holding Vulkan instance function pointers. struct InstanceDispatch { From 381d97639f2f9fb5510869d6b62a4056960f73be Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 13:30:28 -0400 Subject: [PATCH 107/198] Rework dynamic rendering impl --- src/video_core/renderer_vulkan/blit_image.cpp | 200 +++++----- src/video_core/renderer_vulkan/blit_image.h | 50 ++- .../renderer_vulkan/vk_graphics_pipeline.cpp | 36 +- .../renderer_vulkan/vk_graphics_pipeline.h | 7 +- .../renderer_vulkan/vk_pipeline_cache.cpp | 9 +- .../renderer_vulkan/vk_pipeline_cache.h | 5 +- .../renderer_vulkan/vk_rasterizer.cpp | 11 +- .../renderer_vulkan/vk_rasterizer.h | 2 - .../renderer_vulkan/vk_render_pass_cache.cpp | 352 +++++++----------- .../renderer_vulkan/vk_render_pass_cache.h | 108 +++--- .../renderer_vulkan/vk_scheduler.cpp | 82 ++-- src/video_core/renderer_vulkan/vk_scheduler.h | 13 +- .../renderer_vulkan/vk_texture_cache.cpp | 195 ++++------ .../renderer_vulkan/vk_texture_cache.h | 32 +- .../vulkan_common/vulkan_device.cpp | 4 +- src/video_core/vulkan_common/vulkan_device.h | 1 + .../vulkan_common/vulkan_wrapper.cpp | 9 + src/video_core/vulkan_common/vulkan_wrapper.h | 10 + 18 files changed, 458 insertions(+), 668 deletions(-) diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index dad11ae613..7b0b784ac6 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -609,7 +609,7 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, const ImageV Tegra::Engines::Fermi2D::Operation operation) { const bool is_linear = filter == Tegra::Engines::Fermi2D::Filter::Bilinear; const BlitImagePipelineKey key{ - .renderpass = dst_framebuffer->RenderPass(), + .formats = dst_framebuffer->Formats(), .operation = operation, }; VkSampler sampler = *nearest_sampler; @@ -626,7 +626,7 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, VkImageView const Region2D& dst_region, const Region2D& src_region, const Extent3D& src_size) { const BlitImagePipelineKey key{ - .renderpass = dst_framebuffer->RenderPass(), + .formats = dst_framebuffer->Formats(), .operation = Tegra::Engines::Fermi2D::Operation::SrcCopy, }; const VkPipelineLayout layout = *one_texture_pipeline_layout; @@ -686,7 +686,7 @@ void BlitImageHelper::BlitColorMSAA(const Framebuffer* dst_framebuffer, const ImageView& src_image_view, const Region2D& dst_region, const Region2D& src_region) { const BlitMSAAPipelineKey key{ - .renderpass = dst_framebuffer->RenderPass(), + .formats = dst_framebuffer->Formats(), .samples = dst_framebuffer->Samples(), }; BlitImpl(dst_framebuffer, src_image_view, dst_region, src_region, @@ -700,7 +700,7 @@ void BlitImageHelper::BlitDepthStencilMSAA(const Framebuffer* dst_framebuffer, const bool blit_stencil = dst_framebuffer->HasAspectStencilBit() && device.IsExtShaderStencilExportSupported(); const BlitMSAAPipelineKey key{ - .renderpass = dst_framebuffer->RenderPass(), + .formats = dst_framebuffer->Formats(), .samples = dst_framebuffer->Samples(), }; VkImageView src_stencil_view = VK_NULL_HANDLE; @@ -715,7 +715,7 @@ void BlitImageHelper::BlitDepthStencilMSAA(const Framebuffer* dst_framebuffer, void BlitImageHelper::BlitDepth(const Framebuffer* dst_framebuffer, ImageView& src_image_view, const Region2D& dst_region, const Region2D& src_region) { BlitImpl(dst_framebuffer, src_image_view, dst_region, src_region, - FindOrEmplaceBlitDepthPipeline(dst_framebuffer->RenderPass()), *nearest_sampler, + FindOrEmplaceBlitDepthPipeline(dst_framebuffer->Formats()), *nearest_sampler, src_image_view.DepthView(), VK_NULL_HANDLE, false); } @@ -729,7 +729,7 @@ void BlitImageHelper::ResolveDepthStencil(const Framebuffer* dst_framebuffer, src_stencil_view = src_image_view.StencilView(); } BlitImpl(dst_framebuffer, src_image_view, dst_region, src_region, - FindOrEmplaceResolveDepthStencilPipeline(dst_framebuffer->RenderPass(), + FindOrEmplaceResolveDepthStencilPipeline(dst_framebuffer->Formats(), resolve_stencil), *nearest_sampler, src_image_view.DepthView(), src_stencil_view, resolve_stencil); } @@ -743,7 +743,7 @@ void BlitImageHelper::BlitDepthStencil(const Framebuffer* dst_framebuffer, ASSERT(operation == Tegra::Engines::Fermi2D::Operation::SrcCopy); const bool blit_stencil = device.IsExtShaderStencilExportSupported(); const BlitImagePipelineKey key{ - .renderpass = dst_framebuffer->RenderPass(), + .formats = dst_framebuffer->Formats(), .operation = operation, }; VkPipeline pipeline{}; @@ -752,7 +752,7 @@ void BlitImageHelper::BlitDepthStencil(const Framebuffer* dst_framebuffer, pipeline = FindOrEmplaceDepthStencilPipeline(key); src_stencil_view = src_image_view.StencilView(); } else { - pipeline = FindOrEmplaceBlitDepthPipeline(key.renderpass); + pipeline = FindOrEmplaceBlitDepthPipeline(key.formats); } BlitImpl(dst_framebuffer, src_image_view, dst_region, src_region, pipeline, *nearest_sampler, src_image_view.DepthView(), src_stencil_view, blit_stencil); @@ -760,25 +760,25 @@ void BlitImageHelper::BlitDepthStencil(const Framebuffer* dst_framebuffer, void BlitImageHelper::ConvertD32ToR32(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertDepthToColorPipeline(convert_d32_to_r32_pipeline, dst_framebuffer->RenderPass()); + ConvertDepthToColorPipeline(convert_d32_to_r32_pipeline, dst_framebuffer->Formats()); Convert(*convert_d32_to_r32_pipeline, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertR32ToD32(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertColorToDepthPipeline(convert_r32_to_d32_pipeline, dst_framebuffer->RenderPass()); + ConvertColorToDepthPipeline(convert_r32_to_d32_pipeline, dst_framebuffer->Formats()); Convert(*convert_r32_to_d32_pipeline, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertD16ToR16(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertDepthToColorPipeline(convert_d16_to_r16_pipeline, dst_framebuffer->RenderPass()); + ConvertDepthToColorPipeline(convert_d16_to_r16_pipeline, dst_framebuffer->Formats()); Convert(*convert_d16_to_r16_pipeline, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertR16ToD16(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertColorToDepthPipeline(convert_r16_to_d16_pipeline, dst_framebuffer->RenderPass()); + ConvertColorToDepthPipeline(convert_r16_to_d16_pipeline, dst_framebuffer->Formats()); Convert(*convert_r16_to_d16_pipeline, dst_framebuffer, src_image_view); } @@ -789,35 +789,35 @@ void BlitImageHelper::ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer, LOG_WARNING(Render_Vulkan, "ConvertABGR8ToD24S8 requires shader_stencil_export, skipping"); return; } - ConvertPipelineDepthTargetEx(convert_abgr8_to_d24s8_pipeline, dst_framebuffer->RenderPass(), + ConvertPipelineDepthTargetEx(convert_abgr8_to_d24s8_pipeline, dst_framebuffer->Formats(), convert_abgr8_to_d24s8_frag); Convert(*convert_abgr8_to_d24s8_pipeline, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertABGR8ToD32F(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertPipelineDepthTargetEx(convert_abgr8_to_d32f_pipeline, dst_framebuffer->RenderPass(), + ConvertPipelineDepthTargetEx(convert_abgr8_to_d32f_pipeline, dst_framebuffer->Formats(), convert_abgr8_to_d32f_frag); Convert(*convert_abgr8_to_d32f_pipeline, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertD32FToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view) { - ConvertPipelineColorTargetEx(convert_d32f_to_abgr8_pipeline, dst_framebuffer->RenderPass(), + ConvertPipelineColorTargetEx(convert_d32f_to_abgr8_pipeline, dst_framebuffer->Formats(), convert_d32f_to_abgr8_frag); ConvertDepthStencil(*convert_d32f_to_abgr8_pipeline, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertD24S8ToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view) { - ConvertPipelineColorTargetEx(convert_d24s8_to_abgr8_pipeline, dst_framebuffer->RenderPass(), + ConvertPipelineColorTargetEx(convert_d24s8_to_abgr8_pipeline, dst_framebuffer->Formats(), convert_d24s8_to_abgr8_frag); ConvertDepthStencil(*convert_d24s8_to_abgr8_pipeline, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertS8D24ToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view) { - ConvertPipelineColorTargetEx(convert_s8d24_to_abgr8_pipeline, dst_framebuffer->RenderPass(), + ConvertPipelineColorTargetEx(convert_s8d24_to_abgr8_pipeline, dst_framebuffer->Formats(), convert_s8d24_to_abgr8_frag); ConvertDepthStencil(*convert_s8d24_to_abgr8_pipeline, dst_framebuffer, src_image_view); } @@ -826,7 +826,7 @@ void BlitImageHelper::ClearColor(const Framebuffer* dst_framebuffer, u8 color_ma const std::array& clear_color, const Region2D& dst_region) { const BlitImagePipelineKey key{ - .renderpass = dst_framebuffer->RenderPass(), + .formats = dst_framebuffer->Formats(), .operation = Tegra::Engines::Fermi2D::Operation::BlendPremult, }; const VkPipeline pipeline = FindOrEmplaceClearColorPipeline(key); @@ -850,7 +850,7 @@ void BlitImageHelper::ClearDepthStencil(const Framebuffer* dst_framebuffer, bool f32 clear_depth, u8 stencil_mask, u32 stencil_ref, u32 stencil_compare_mask, const Region2D& dst_region) { const BlitDepthStencilPipelineKey key{ - .renderpass = dst_framebuffer->RenderPass(), + .formats = dst_framebuffer->Formats(), .depth_clear = depth_clear, .stencil_mask = stencil_mask, .stencil_compare_mask = stencil_compare_mask, @@ -870,7 +870,7 @@ void BlitImageHelper::ClearDepthStencil(const Framebuffer* dst_framebuffer, bool scheduler.InvalidateState(); } -void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, +void BlitImageHelper::CopyMSAAImpl(const RenderingFormats& formats, VkPipeline pipeline, VkPipelineLayout layout, VkImage dst_image, VkFormat dst_vk_format, VkImage src_image, VkFormat src_vk_format, s32 scale_x, s32 scale_y, @@ -906,17 +906,10 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, .offset = dst_offset, .extent = dst_extent, }; - vk::Framebuffer framebuffer = device.GetLogical().CreateFramebuffer(VkFramebufferCreateInfo{ - .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .renderPass = renderpass, - .attachmentCount = 1, - .pAttachments = dst_view.address(), - .width = static_cast(dst_offset.x) + dst_extent.width, - .height = static_cast(dst_offset.y) + dst_extent.height, - .layers = 1, - }); + const VkImageView dst_view_handle = *dst_view; + const RenderingAttachments attachments = + MakeRenderingAttachments(formats, std::span(&dst_view_handle, formats.num_colors), + dst_view_handle, render_area, 1); const MSAACopyPushConstants push_constants{ .dst_offset = {dst_offset.x, dst_offset.y}, .src_offset = {copy.src_offset.x, copy.src_offset.y}, @@ -927,10 +920,10 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, src_stencil_handle = *src_stencil_view; } scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([this, pipeline, layout, sampler, renderpass, - framebuffer_handle = *framebuffer, src_view_handle = *src_view, - src_stencil_handle, src = src_image, dst = dst_image, render_area, - aspect_info, push_constants](vk::CommandBuffer cmdbuf) { + scheduler.Record([this, pipeline, layout, sampler, attachments, + src_view_handle = *src_view, src_stencil_handle, src = src_image, + dst = dst_image, render_area, aspect_info, + push_constants](vk::CommandBuffer cmdbuf) { const VkImageSubresourceRange barrier_range{ .aspectMask = aspect_info.barrier_aspect, .baseMipLevel = 0, @@ -969,16 +962,7 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, }, }; cmdbuf.PipelineBarrier(0, {}, {}, pre_barriers); - const VkRenderPassBeginInfo renderpass_bi{ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, - .pNext = nullptr, - .renderPass = renderpass, - .framebuffer = framebuffer_handle, - .renderArea = render_area, - .clearValueCount = 0, - .pClearValues = nullptr, - }; - cmdbuf.BeginRenderPass(renderpass_bi, VK_SUBPASS_CONTENTS_INLINE); + BeginRendering(cmdbuf, attachments); VkDescriptorSet descriptor_set = VK_NULL_HANDLE; if (src_stencil_handle != VK_NULL_HANDLE) { descriptor_set = two_textures_descriptor_allocator.Commit(); @@ -1003,7 +987,7 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, cmdbuf.SetScissor(0, render_area); cmdbuf.PushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, push_constants); cmdbuf.Draw(3, 1, 0, 0); - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); const VkImageMemoryBarrier2 post_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, @@ -1024,14 +1008,12 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, .tick = scheduler.CurrentTick(), .src_view = std::move(src_view), .dst_view = std::move(dst_view), - .framebuffer = std::move(framebuffer), }); if (copy_stencil) { msaa_copy_resources.push_back(MSAACopyResources{ .tick = scheduler.CurrentTick(), .src_view = std::move(src_stencil_view), .dst_view = vk::ImageView{}, - .framebuffer = vk::Framebuffer{}, }); } } @@ -1039,10 +1021,9 @@ void BlitImageHelper::CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, scheduler.InvalidateState(); } -void BlitImageHelper::CopyMSAA(RenderPassCache& render_pass_cache, VkImage dst_image, - VideoCore::Surface::PixelFormat dst_format, VkImage src_image, - VideoCore::Surface::PixelFormat src_format, u32 num_samples, - std::span copies, +void BlitImageHelper::CopyMSAA(VkImage dst_image, VideoCore::Surface::PixelFormat dst_format, + VkImage src_image, VideoCore::Surface::PixelFormat src_format, + u32 num_samples, std::span copies, bool msaa_to_non_msaa) { const auto [samples_x, samples_y] = VideoCommon::SamplesLog2(static_cast(num_samples)); const s32 scale_x = 1 << samples_x; @@ -1051,14 +1032,10 @@ void BlitImageHelper::CopyMSAA(RenderPassCache& render_pass_cache, VkImage dst_i if (msaa_to_non_msaa) { samples = VK_SAMPLE_COUNT_1_BIT; } - RenderPassKey renderpass_key{}; - renderpass_key.color_formats.fill(VideoCore::Surface::PixelFormat::Invalid); - renderpass_key.color_formats[0] = dst_format; - renderpass_key.depth_format = VideoCore::Surface::PixelFormat::Invalid; - renderpass_key.samples = samples; - const VkRenderPass renderpass = render_pass_cache.Get(renderpass_key); + const RenderingFormats formats = MakeRenderingFormats( + device, std::span(&dst_format, 1), VideoCore::Surface::PixelFormat::Invalid); const MSAACopyPipelineKey key{ - .renderpass = renderpass, + .formats = formats, .samples = samples, .msaa_to_non_msaa = msaa_to_non_msaa, .format_class = FormatClass(dst_format), @@ -1079,7 +1056,7 @@ void BlitImageHelper::CopyMSAA(RenderPassCache& render_pass_cache, VkImage dst_i MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, true, src_format).format; const VkFormat dst_vk_format = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, true, dst_format).format; - CopyMSAAImpl(renderpass, FindOrEmplaceMSAACopyPipeline(key), *msaa_copy_pipeline_layout, + CopyMSAAImpl(formats, FindOrEmplaceMSAACopyPipeline(key), *msaa_copy_pipeline_layout, dst_image, dst_vk_format, src_image, src_vk_format, scale_x, scale_y, copies, aspect_info, false); } @@ -1205,9 +1182,10 @@ VkPipeline BlitImageHelper::FindOrEmplaceColorPipeline(const BlitImagePipelineKe .blendConstants = {0.0f, 0.0f, 0.0f, 0.0f}, }; const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); blit_color_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1221,7 +1199,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceColorPipeline(const BlitImagePipelineKe .pColorBlendState = &color_blend_create_info, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *one_texture_pipeline_layout, - .renderPass = key.renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1237,9 +1214,10 @@ VkPipeline BlitImageHelper::FindOrEmplaceDepthStencilPipeline(const BlitImagePip blit_depth_stencil_keys.push_back(key); const std::array stages = MakeStages(*full_screen_vert, *blit_depth_stencil_frag); const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); blit_depth_stencil_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1253,7 +1231,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceDepthStencilPipeline(const BlitImagePip .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *two_textures_pipeline_layout, - .renderPass = key.renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1290,9 +1267,10 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearColorPipeline(const BlitImagePipel .blendConstants = {0.0f, 0.0f, 0.0f, 0.0f}, }; const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); clear_color_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1306,7 +1284,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearColorPipeline(const BlitImagePipel .pColorBlendState = &color_blend_state_generic_create_info, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *clear_color_pipeline_layout, - .renderPass = key.renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1346,9 +1323,10 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearStencilPipeline( .maxDepthBounds = 0.0f, }; const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); clear_stencil_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1362,7 +1340,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearStencilPipeline( .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *clear_color_pipeline_layout, - .renderPass = key.renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1389,9 +1366,10 @@ VkPipeline BlitImageHelper::FindOrEmplaceBlitColorMSAAPipeline(const BlitMSAAPip .alphaToOneEnable = VK_FALSE, }; const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); blit_msaa_color_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1405,7 +1383,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceBlitColorMSAAPipeline(const BlitMSAAPip .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *one_texture_pipeline_layout, - .renderPass = key.renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1437,9 +1414,10 @@ VkPipeline BlitImageHelper::FindOrEmplaceBlitDepthStencilMSAAPipeline( .alphaToOneEnable = VK_FALSE, }; const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1454,7 +1432,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceBlitDepthStencilMSAAPipeline( .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = blit_stencil ? *two_textures_pipeline_layout : *one_texture_pipeline_layout, - .renderPass = key.renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1462,17 +1439,18 @@ VkPipeline BlitImageHelper::FindOrEmplaceBlitDepthStencilMSAAPipeline( return *pipelines.back(); } -VkPipeline BlitImageHelper::FindOrEmplaceBlitDepthPipeline(VkRenderPass renderpass) { - const auto it = std::ranges::find(blit_depth_keys, renderpass); +VkPipeline BlitImageHelper::FindOrEmplaceBlitDepthPipeline(const RenderingFormats& formats) { + const auto it = std::ranges::find(blit_depth_keys, formats); if (it != blit_depth_keys.end()) { return *blit_depth_pipelines[std::distance(blit_depth_keys.begin(), it)]; } - blit_depth_keys.push_back(renderpass); + blit_depth_keys.push_back(formats); const std::array stages = MakeStages(*full_screen_vert, *blit_depth_frag); const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = formats.CreateInfo(); blit_depth_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1486,7 +1464,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceBlitDepthPipeline(VkRenderPass renderpa .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *one_texture_pipeline_layout, - .renderPass = renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1494,22 +1471,23 @@ VkPipeline BlitImageHelper::FindOrEmplaceBlitDepthPipeline(VkRenderPass renderpa return *blit_depth_pipelines.back(); } -VkPipeline BlitImageHelper::FindOrEmplaceResolveDepthStencilPipeline(VkRenderPass renderpass, - bool resolve_stencil) { +VkPipeline BlitImageHelper::FindOrEmplaceResolveDepthStencilPipeline( + const RenderingFormats& formats, bool resolve_stencil) { auto& keys = resolve_stencil ? resolve_depth_stencil_keys : resolve_depth_keys; auto& pipelines = resolve_stencil ? resolve_depth_stencil_pipelines : resolve_depth_pipelines; - const auto it = std::ranges::find(keys, renderpass); + const auto it = std::ranges::find(keys, formats); if (it != keys.end()) { return *pipelines[std::distance(keys.begin(), it)]; } - keys.push_back(renderpass); + keys.push_back(formats); const std::array stages = MakeStages(*full_screen_vert, resolve_stencil ? *blit_depth_stencil_msaa_frag : *blit_depth_msaa_frag); const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = formats.CreateInfo(); pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1524,7 +1502,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceResolveDepthStencilPipeline(VkRenderPas .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = resolve_stencil ? *two_textures_pipeline_layout : *one_texture_pipeline_layout, - .renderPass = renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1532,10 +1509,9 @@ VkPipeline BlitImageHelper::FindOrEmplaceResolveDepthStencilPipeline(VkRenderPas return *pipelines.back(); } -void BlitImageHelper::CopyMSAADepth(RenderPassCache& render_pass_cache, VkImage dst_image, - VideoCore::Surface::PixelFormat dst_format, VkImage src_image, - VideoCore::Surface::PixelFormat src_format, u32 num_samples, - std::span copies, +void BlitImageHelper::CopyMSAADepth(VkImage dst_image, VideoCore::Surface::PixelFormat dst_format, + VkImage src_image, VideoCore::Surface::PixelFormat src_format, + u32 num_samples, std::span copies, bool copy_stencil, bool msaa_to_non_msaa) { const auto [samples_x, samples_y] = VideoCommon::SamplesLog2(static_cast(num_samples)); const s32 scale_x = 1 << samples_x; @@ -1544,13 +1520,9 @@ void BlitImageHelper::CopyMSAADepth(RenderPassCache& render_pass_cache, VkImage if (msaa_to_non_msaa) { samples = VK_SAMPLE_COUNT_1_BIT; } - RenderPassKey renderpass_key{}; - renderpass_key.color_formats.fill(VideoCore::Surface::PixelFormat::Invalid); - renderpass_key.depth_format = dst_format; - renderpass_key.samples = samples; - const VkRenderPass renderpass = render_pass_cache.Get(renderpass_key); + const RenderingFormats formats = MakeRenderingFormats(device, {}, dst_format); const MSAACopyPipelineKey key{ - .renderpass = renderpass, + .formats = formats, .samples = samples, .msaa_to_non_msaa = msaa_to_non_msaa, .format_class = MSAACopyFormatClass::Float, @@ -1580,7 +1552,7 @@ void BlitImageHelper::CopyMSAADepth(RenderPassCache& render_pass_cache, VkImage MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, true, src_format).format; const VkFormat dst_vk_format = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, true, dst_format).format; - CopyMSAAImpl(renderpass, FindOrEmplaceMSAACopyDepthPipeline(key, copy_stencil), layout, + CopyMSAAImpl(formats, FindOrEmplaceMSAACopyDepthPipeline(key, copy_stencil), layout, dst_image, dst_vk_format, src_image, src_vk_format, scale_x, scale_y, copies, aspect_info, copy_stencil); } @@ -1613,9 +1585,10 @@ VkPipeline BlitImageHelper::FindOrEmplaceMSAACopyPipeline(const MSAACopyPipeline .alphaToOneEnable = VK_FALSE, }; const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); msaa_copy_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1629,7 +1602,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceMSAACopyPipeline(const MSAACopyPipeline .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *msaa_copy_pipeline_layout, - .renderPass = key.renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1691,9 +1663,10 @@ VkPipeline BlitImageHelper::FindOrEmplaceMSAACopyDepthPipeline(const MSAACopyPip }; const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1708,7 +1681,6 @@ VkPipeline BlitImageHelper::FindOrEmplaceMSAACopyDepthPipeline(const MSAACopyPip .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = copy_stencil ? *msaa_copy_depth_stencil_pipeline_layout : *msaa_copy_pipeline_layout, - .renderPass = key.renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, @@ -1716,15 +1688,17 @@ VkPipeline BlitImageHelper::FindOrEmplaceMSAACopyDepthPipeline(const MSAACopyPip return *pipelines.back(); } -void BlitImageHelper::ConvertDepthToColorPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass) { - ConvertPipeline(pipeline, renderpass, false); +void BlitImageHelper::ConvertDepthToColorPipeline(vk::Pipeline& pipeline, + const RenderingFormats& formats) { + ConvertPipeline(pipeline, formats, false); } -void BlitImageHelper::ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass) { - ConvertPipeline(pipeline, renderpass, true); +void BlitImageHelper::ConvertColorToDepthPipeline(vk::Pipeline& pipeline, + const RenderingFormats& formats) { + ConvertPipeline(pipeline, formats, true); } -void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass renderpass, +void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, const RenderingFormats& formats, vk::ShaderModule& module, bool single_texture, bool is_target_depth) { if (pipeline) { @@ -1732,9 +1706,10 @@ void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass ren } const std::array stages = MakeStages(*full_screen_vert, *module); const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = formats.CreateInfo(); pipeline = device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1749,24 +1724,25 @@ void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass ren : &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = single_texture ? *one_texture_pipeline_layout : *two_textures_pipeline_layout, - .renderPass = renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, }); } -void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, +void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, + const RenderingFormats& formats, vk::ShaderModule& module) { - ConvertPipelineEx(pipeline, renderpass, module, false, false); + ConvertPipelineEx(pipeline, formats, module, false, false); } -void BlitImageHelper::ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, +void BlitImageHelper::ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, + const RenderingFormats& formats, vk::ShaderModule& module) { - ConvertPipelineEx(pipeline, renderpass, module, true, true); + ConvertPipelineEx(pipeline, formats, module, true, true); } -void BlitImageHelper::ConvertPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass, +void BlitImageHelper::ConvertPipeline(vk::Pipeline& pipeline, const RenderingFormats& formats, bool is_target_depth) { if (pipeline) { return; @@ -1775,9 +1751,10 @@ void BlitImageHelper::ConvertPipeline(vk::Pipeline& pipeline, VkRenderPass rende is_target_depth ? *convert_float_to_depth_frag : *convert_depth_to_float_frag; const std::array stages = MakeStages(*full_screen_vert, frag_shader); const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + const VkPipelineRenderingCreateInfo rendering_ci = formats.CreateInfo(); pipeline = device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -1792,7 +1769,6 @@ void BlitImageHelper::ConvertPipeline(vk::Pipeline& pipeline, VkRenderPass rende : &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *one_texture_pipeline_layout, - .renderPass = renderpass, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index bf9bdfdc41..d4038c8dae 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h @@ -11,6 +11,7 @@ #include "video_core/engines/fermi_2d.h" #include "video_core/renderer_vulkan/vk_descriptor_pool.h" +#include "video_core/renderer_vulkan/vk_render_pass_cache.h" #include "video_core/surface.h" #include "video_core/texture_cache/types.h" #include "video_core/vulkan_common/vulkan_wrapper.h" @@ -24,21 +25,20 @@ using VideoCommon::Region2D; class Device; class Framebuffer; class ImageView; -class RenderPassCache; class StateTracker; class Scheduler; struct BlitImagePipelineKey { constexpr auto operator<=>(const BlitImagePipelineKey&) const noexcept = default; - VkRenderPass renderpass; + RenderingFormats formats; Tegra::Engines::Fermi2D::Operation operation; }; struct BlitDepthStencilPipelineKey { constexpr auto operator<=>(const BlitDepthStencilPipelineKey&) const noexcept = default; - VkRenderPass renderpass; + RenderingFormats formats; bool depth_clear; u8 stencil_mask; u32 stencil_compare_mask; @@ -54,7 +54,7 @@ enum class MSAACopyFormatClass : u32 { struct MSAACopyPipelineKey { constexpr auto operator<=>(const MSAACopyPipelineKey&) const noexcept = default; - VkRenderPass renderpass; + RenderingFormats formats; VkSampleCountFlagBits samples; bool msaa_to_non_msaa; MSAACopyFormatClass format_class; @@ -63,7 +63,7 @@ struct MSAACopyPipelineKey { struct BlitMSAAPipelineKey { constexpr auto operator<=>(const BlitMSAAPipelineKey&) const noexcept = default; - VkRenderPass renderpass; + RenderingFormats formats; VkSampleCountFlagBits samples; }; @@ -124,16 +124,14 @@ public: u8 stencil_mask, u32 stencil_ref, u32 stencil_compare_mask, const Region2D& dst_region); - void CopyMSAA(RenderPassCache& render_pass_cache, VkImage dst_image, - VideoCore::Surface::PixelFormat dst_format, VkImage src_image, + void CopyMSAA(VkImage dst_image, VideoCore::Surface::PixelFormat dst_format, VkImage src_image, VideoCore::Surface::PixelFormat src_format, u32 num_samples, std::span copies, bool msaa_to_non_msaa); - void CopyMSAADepth(RenderPassCache& render_pass_cache, VkImage dst_image, - VideoCore::Surface::PixelFormat dst_format, VkImage src_image, - VideoCore::Surface::PixelFormat src_format, u32 num_samples, - std::span copies, bool copy_stencil, - bool msaa_to_non_msaa); + void CopyMSAADepth(VkImage dst_image, VideoCore::Surface::PixelFormat dst_format, + VkImage src_image, VideoCore::Surface::PixelFormat src_format, + u32 num_samples, std::span copies, + bool copy_stencil, bool msaa_to_non_msaa); private: struct MSAACopyAspectInfo { @@ -152,7 +150,7 @@ private: VkSampler sampler, VkImageView src_view, VkImageView src_stencil_view, bool blit_stencil); - void CopyMSAAImpl(VkRenderPass renderpass, VkPipeline pipeline, VkPipelineLayout layout, + void CopyMSAAImpl(const RenderingFormats& formats, VkPipeline pipeline, VkPipelineLayout layout, VkImage dst_image, VkFormat dst_vk_format, VkImage src_image, VkFormat src_vk_format, s32 scale_x, s32 scale_y, std::span copies, @@ -178,23 +176,24 @@ private: [[nodiscard]] VkPipeline FindOrEmplaceBlitColorMSAAPipeline(const BlitMSAAPipelineKey& key); [[nodiscard]] VkPipeline FindOrEmplaceBlitDepthStencilMSAAPipeline( const BlitMSAAPipelineKey& key, bool blit_stencil); - [[nodiscard]] VkPipeline FindOrEmplaceBlitDepthPipeline(VkRenderPass renderpass); - [[nodiscard]] VkPipeline FindOrEmplaceResolveDepthStencilPipeline(VkRenderPass renderpass, - bool resolve_stencil); + [[nodiscard]] VkPipeline FindOrEmplaceBlitDepthPipeline(const RenderingFormats& formats); + [[nodiscard]] VkPipeline FindOrEmplaceResolveDepthStencilPipeline( + const RenderingFormats& formats, bool resolve_stencil); - void ConvertPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass, bool is_target_depth); + void ConvertPipeline(vk::Pipeline& pipeline, const RenderingFormats& formats, + bool is_target_depth); - void ConvertDepthToColorPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass); + void ConvertDepthToColorPipeline(vk::Pipeline& pipeline, const RenderingFormats& formats); - void ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass); + void ConvertColorToDepthPipeline(vk::Pipeline& pipeline, const RenderingFormats& formats); - void ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass renderpass, + void ConvertPipelineEx(vk::Pipeline& pipeline, const RenderingFormats& formats, vk::ShaderModule& module, bool single_texture, bool is_target_depth); - void ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, + void ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, const RenderingFormats& formats, vk::ShaderModule& module); - void ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, VkRenderPass renderpass, + void ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, const RenderingFormats& formats, vk::ShaderModule& module); const Device& device; @@ -256,21 +255,20 @@ private: std::vector msaa_copy_depth_stencil_pipelines; std::vector blit_msaa_color_keys; std::vector blit_msaa_color_pipelines; - std::vector blit_depth_keys; + std::vector blit_depth_keys; std::vector blit_depth_pipelines; std::vector blit_msaa_depth_keys; std::vector blit_msaa_depth_pipelines; std::vector blit_msaa_depth_stencil_keys; std::vector blit_msaa_depth_stencil_pipelines; - std::vector resolve_depth_keys; + std::vector resolve_depth_keys; std::vector resolve_depth_pipelines; - std::vector resolve_depth_stencil_keys; + std::vector resolve_depth_stencil_keys; std::vector resolve_depth_stencil_pipelines; struct MSAACopyResources { u64 tick; vk::ImageView src_view; vk::ImageView dst_view; - vk::Framebuffer framebuffer; }; std::deque msaa_copy_resources; vk::Pipeline convert_d32_to_r32_pipeline; diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 767099eea2..950757a502 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -125,22 +125,15 @@ PixelFormat DecodeFormat(u8 encoded_format) { return PixelFormatFromRenderTargetFormat(format); } -RenderPassKey MakeRenderPassKey(const FixedPipelineState& state, const Device& device) { - RenderPassKey key{}; - std::ranges::transform(state.color_formats, key.color_formats.begin(), DecodeFormat); +RenderingFormats PipelineFormats(const FixedPipelineState& state, const Device& device) { + std::array color_formats; + std::ranges::transform(state.color_formats, color_formats.begin(), DecodeFormat); + PixelFormat depth_format = PixelFormat::Invalid; if (state.depth_enabled != 0) { - const auto depth_format{static_cast(state.depth_format.Value())}; - key.depth_format = PixelFormatFromDepthFormat(depth_format); - } else { - key.depth_format = PixelFormat::Invalid; + depth_format = PixelFormatFromDepthFormat( + static_cast(state.depth_format.Value())); } - key.samples = MaxwellToVK::MsaaMode(state.msaa_mode); - const bool has_color = std::ranges::any_of(key.color_formats, [](PixelFormat format) { - return format != PixelFormat::Invalid; - }); - key.resolve_color = - key.samples != VK_SAMPLE_COUNT_1_BIT && has_color && device.IsTiler(); - return key; + return MakeRenderingFormats(device, color_formats, depth_format); } size_t NumAttachments(const FixedPipelineState& state) { @@ -253,8 +246,8 @@ GraphicsPipeline::GraphicsPipeline( const Device& device_, DescriptorPool& descriptor_pool, GuestDescriptorQueue& guest_descriptor_queue_, DescriptorBufferRing& descriptor_buffer_ring_, Common::ThreadWorker* worker_thread, - PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, - const GraphicsPipelineCacheKey& key_, std::array stages, + PipelineStatistics* pipeline_statistics, const GraphicsPipelineCacheKey& key_, + std::array stages, const std::array& infos) : key{key_}, device{device_}, texture_cache{texture_cache_}, buffer_cache{buffer_cache_}, pipeline_cache(pipeline_cache_), scheduler{scheduler_}, @@ -309,11 +302,10 @@ GraphicsPipeline::GraphicsPipeline( } } - auto func{[this, shader_notify, &render_pass_cache, pipeline_statistics] { - const VkRenderPass render_pass{render_pass_cache.Get(MakeRenderPassKey(key.state, device))}; + auto func{[this, shader_notify, pipeline_statistics] { Validate(); try { - MakePipeline(render_pass); + MakePipeline(PipelineFormats(key.state, device)); } catch (const vk::Exception& exception) { LOG_CRITICAL(Render_Vulkan, "Graphics pipeline build failed: {}", exception.what()); std::scoped_lock lock{build_mutex}; @@ -684,7 +676,7 @@ bool GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling, return true; } -void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { +void GraphicsPipeline::MakePipeline(const RenderingFormats& formats) { FixedPipelineState::DynamicState dynamic{}; if (!key.state.extended_dynamic_state) { dynamic = key.state.dynamic_state; @@ -1078,9 +1070,10 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { flags |= VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT; } + const VkPipelineRenderingCreateInfo rendering_ci = formats.CreateInfo(); pipeline = device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = flags, .stageCount = static_cast(shader_stages.size()), .pStages = shader_stages.data(), @@ -1094,7 +1087,6 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { .pColorBlendState = &color_blend_ci, .pDynamicState = &dynamic_state_ci, .layout = *pipeline_layout, - .renderPass = render_pass, .subpass = 0, .basePipelineHandle = nullptr, .basePipelineIndex = 0, diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index b1ac5a3fcc..1371e8ee06 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -67,7 +67,6 @@ namespace Vulkan { class Device; class PipelineStatistics; -class RenderPassCache; class RescalingPushConstant; class RenderAreaPushConstant; class Scheduler; @@ -82,8 +81,8 @@ public: const Device& device, DescriptorPool& descriptor_pool, GuestDescriptorQueue& guest_descriptor_queue, DescriptorBufferRing& descriptor_buffer_ring, Common::ThreadWorker* worker_thread, - PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, - const GraphicsPipelineCacheKey& key, std::array stages, + PipelineStatistics* pipeline_statistics, const GraphicsPipelineCacheKey& key, + std::array stages, const std::array& infos); bool HasDynamicVertexInput() const noexcept { return key.state.dynamic_vertex_input; } @@ -140,7 +139,7 @@ private: bool ConfigureDraw(const RescalingPushConstant& rescaling, const RenderAreaPushConstant& render_are); - void MakePipeline(VkRenderPass render_pass); + void MakePipeline(const RenderingFormats& formats); void Validate(); diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index d04d36046e..ce661670d5 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -343,12 +343,11 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, DescriptorPool& descriptor_pool_, GuestDescriptorQueue& guest_descriptor_queue_, DescriptorBufferRing& descriptor_buffer_ring_, - RenderPassCache& render_pass_cache_, BufferCache& buffer_cache_, - TextureCache& texture_cache_, VideoCore::ShaderNotify& shader_notify_) + BufferCache& buffer_cache_, TextureCache& texture_cache_, + VideoCore::ShaderNotify& shader_notify_) : VideoCommon::ShaderCache{device_memory_}, device{device_}, scheduler{scheduler_}, descriptor_pool{descriptor_pool_}, guest_descriptor_queue{guest_descriptor_queue_}, - descriptor_buffer_ring{descriptor_buffer_ring_}, - render_pass_cache{render_pass_cache_}, buffer_cache{buffer_cache_}, + descriptor_buffer_ring{descriptor_buffer_ring_}, buffer_cache{buffer_cache_}, texture_cache{texture_cache_}, shader_notify{shader_notify_}, use_asynchronous_shaders{Settings::values.use_asynchronous_shaders.GetValue()}, use_vulkan_pipeline_cache{Settings::values.use_vulkan_driver_pipeline_cache.GetValue()}, @@ -896,7 +895,7 @@ std::unique_ptr PipelineCache::CreateGraphicsPipeline( return std::make_unique( scheduler, buffer_cache, texture_cache, vulkan_pipeline_cache, &shader_notify, device, descriptor_pool, guest_descriptor_queue, descriptor_buffer_ring, thread_worker, statistics, - render_pass_cache, key, std::move(modules), infos); + key, std::move(modules), infos); } catch (const Shader::Exception& exception) { auto hash = key.Hash(); diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h index 71dfb46e3d..bebac7cb15 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h @@ -85,7 +85,6 @@ class ComputePipeline; class DescriptorPool; class Device; class PipelineStatistics; -class RenderPassCache; class Scheduler; using VideoCommon::ShaderInfo; @@ -107,8 +106,7 @@ public: explicit PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, const Device& device, Scheduler& scheduler, DescriptorPool& descriptor_pool, GuestDescriptorQueue& guest_descriptor_queue, - DescriptorBufferRing& descriptor_buffer_ring, - RenderPassCache& render_pass_cache, BufferCache& buffer_cache, + DescriptorBufferRing& descriptor_buffer_ring, BufferCache& buffer_cache, TextureCache& texture_cache, VideoCore::ShaderNotify& shader_notify_); ~PipelineCache(); @@ -153,7 +151,6 @@ private: DescriptorPool& descriptor_pool; GuestDescriptorQueue& guest_descriptor_queue; DescriptorBufferRing& descriptor_buffer_ring; - RenderPassCache& render_pass_cache; BufferCache& buffer_cache; TextureCache& texture_cache; VideoCore::ShaderNotify& shader_notify; diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index a1dc2259a5..37b8774f18 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -211,10 +211,10 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra device.IsExtDescriptorBufferSupported()), compute_pass_descriptor_queue(device, UpdateDescriptorQueue::COMPUTE_FRAME_PAYLOAD_SIZE), descriptor_buffer_ring(device, memory_allocator), - blit_image(device, scheduler, state_tracker, descriptor_pool), render_pass_cache(device), - texture_cache_runtime{ - device, scheduler, memory_allocator, staging_pool, - blit_image, render_pass_cache, descriptor_pool, compute_pass_descriptor_queue}, + blit_image(device, scheduler, state_tracker, descriptor_pool), + texture_cache_runtime{device, scheduler, memory_allocator, + staging_pool, blit_image, descriptor_pool, + compute_pass_descriptor_queue}, texture_cache(texture_cache_runtime, device_memory), buffer_cache_runtime(device, memory_allocator, scheduler, staging_pool, guest_descriptor_queue, compute_pass_descriptor_queue, descriptor_pool), @@ -223,8 +223,7 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra staging_pool, compute_pass_descriptor_queue, descriptor_pool, texture_cache), query_cache(gpu, *this, device_memory, query_cache_runtime), pipeline_cache(device_memory, device, scheduler, descriptor_pool, guest_descriptor_queue, - descriptor_buffer_ring, render_pass_cache, buffer_cache, texture_cache, - gpu.ShaderNotify()), + descriptor_buffer_ring, buffer_cache, texture_cache, gpu.ShaderNotify()), accelerate_dma(buffer_cache, texture_cache, scheduler), fence_manager(*this, gpu, texture_cache, buffer_cache, query_cache, device, scheduler) { scheduler.SetQueryCache(query_cache); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index e47104783b..2c45c6c081 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -22,7 +22,6 @@ #include "video_core/renderer_vulkan/vk_fence_manager.h" #include "video_core/renderer_vulkan/vk_pipeline_cache.h" #include "video_core/renderer_vulkan/vk_query_cache.h" -#include "video_core/renderer_vulkan/vk_render_pass_cache.h" #include "video_core/renderer_vulkan/vk_staging_buffer_pool.h" #include "video_core/renderer_vulkan/vk_texture_cache.h" #include "video_core/renderer_vulkan/vk_update_descriptor.h" @@ -209,7 +208,6 @@ private: ComputePassDescriptorQueue compute_pass_descriptor_queue; DescriptorBufferRing descriptor_buffer_ring; BlitImageHelper blit_image; - RenderPassCache render_pass_cache; TextureCacheRuntime texture_cache_runtime; TextureCache texture_cache; diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp index 8c0921e9e8..b6be5317e0 100644 --- a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp @@ -4,9 +4,7 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "common/container/unordered_map.h" - -#include +#include #include "video_core/renderer_vulkan/maxwell_to_vk.h" #include "video_core/renderer_vulkan/vk_render_pass_cache.h" @@ -19,109 +17,90 @@ namespace { using VideoCore::Surface::PixelFormat; using VideoCore::Surface::SurfaceType; - constexpr SurfaceType GetSurfaceType(PixelFormat format) { - switch (format) { - // Depth formats - case PixelFormat::D16_UNORM: - case PixelFormat::D32_FLOAT: - case PixelFormat::X8_D24_UNORM: - return SurfaceType::Depth; +struct AttachmentAspects { + bool depth; + bool stencil; +}; - // Stencil formats - case PixelFormat::S8_UINT: - return SurfaceType::Stencil; +constexpr SurfaceType GetSurfaceType(PixelFormat format) { + switch (format) { + case PixelFormat::D16_UNORM: + case PixelFormat::D32_FLOAT: + case PixelFormat::X8_D24_UNORM: + return SurfaceType::Depth; + case PixelFormat::S8_UINT: + return SurfaceType::Stencil; + case PixelFormat::D24_UNORM_S8_UINT: + case PixelFormat::S8_UINT_D24_UNORM: + case PixelFormat::D32_FLOAT_S8_UINT: + return SurfaceType::DepthStencil; + default: + return SurfaceType::ColorTexture; + } +} - // Depth+Stencil formats - case PixelFormat::D24_UNORM_S8_UINT: - case PixelFormat::S8_UINT_D24_UNORM: - case PixelFormat::D32_FLOAT_S8_UINT: - return SurfaceType::DepthStencil; +constexpr AttachmentAspects GetAttachmentAspects(PixelFormat format) { + const SurfaceType surface_type = GetSurfaceType(format); + return AttachmentAspects{ + .depth = surface_type == SurfaceType::Depth || surface_type == SurfaceType::DepthStencil, + .stencil = + surface_type == SurfaceType::Stencil || surface_type == SurfaceType::DepthStencil, + }; +} - // Everything else is a color texture - default: - return SurfaceType::ColorTexture; - } - } +VkFormat AttachmentFormat(const Device& device, PixelFormat format) { + return MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, true, format).format; +} - VkAttachmentDescription2 AttachmentDescription(const Device& device, PixelFormat format, - VkSampleCountFlagBits samples, - VkAttachmentLoadOp load_op, - VkAttachmentStoreOp store_op) { - using MaxwellToVK::SurfaceFormat; +VkRenderingAttachmentInfo MakeAttachment(VkImageView view) { + return { + .sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, + .pNext = nullptr, + .imageView = view, + .imageLayout = VK_IMAGE_LAYOUT_GENERAL, + .resolveMode = VK_RESOLVE_MODE_NONE, + .resolveImageView = VK_NULL_HANDLE, + .resolveImageLayout = VK_IMAGE_LAYOUT_GENERAL, + .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, + .storeOp = VK_ATTACHMENT_STORE_OP_STORE, + .clearValue = {}, + }; +} +} // Anonymous namespace - const SurfaceType surface_type = GetSurfaceType(format); - const bool has_stencil = surface_type == SurfaceType::DepthStencil || - surface_type == SurfaceType::Stencil; +ResolveModes PickResolveModes(const Device& device, PixelFormat format) { + constexpr VkResolveModeFlagBits mode = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT; - return { - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, - .pNext = nullptr, - .flags = {}, - .format = SurfaceFormat(device, FormatType::Optimal, true, format).format, - .samples = samples, - .loadOp = load_op, - .storeOp = store_op, - .stencilLoadOp = has_stencil ? load_op : VK_ATTACHMENT_LOAD_OP_DONT_CARE, - .stencilStoreOp = has_stencil ? store_op : VK_ATTACHMENT_STORE_OP_DONT_CARE, - .initialLayout = VK_IMAGE_LAYOUT_GENERAL, - .finalLayout = VK_IMAGE_LAYOUT_GENERAL, - }; - } + const AttachmentAspects aspects = GetAttachmentAspects(format); + const bool depth_mode_supported = (device.GetDepthResolveModes() & mode) != 0; + const bool stencil_mode_supported = (device.GetStencilResolveModes() & mode) != 0; - struct ResolveAspects { - bool depth; - bool stencil; - }; - - struct ResolveModes { - VkResolveModeFlagBits depth; - VkResolveModeFlagBits stencil; - }; - - constexpr ResolveAspects GetResolveAspects(PixelFormat format) { - const SurfaceType surface_type = GetSurfaceType(format); - return ResolveAspects{ - .depth = surface_type == SurfaceType::Depth || - surface_type == SurfaceType::DepthStencil, - .stencil = surface_type == SurfaceType::Stencil || - surface_type == SurfaceType::DepthStencil, - }; - } - - ResolveModes PickResolveModes(const Device& device, PixelFormat format) { - constexpr VkResolveModeFlagBits mode = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT; - - const ResolveAspects aspects = GetResolveAspects(format); - const bool depth_mode_supported = (device.GetDepthResolveModes() & mode) != 0; - const bool stencil_mode_supported = (device.GetStencilResolveModes() & mode) != 0; - - ResolveModes modes{ - .depth = VK_RESOLVE_MODE_NONE, - .stencil = VK_RESOLVE_MODE_NONE, - }; - if (aspects.depth && depth_mode_supported) { - modes.depth = mode; - } - if (aspects.stencil && stencil_mode_supported) { - modes.stencil = mode; - } - if (modes.depth == modes.stencil || device.SupportsIndependentResolveNone()) { - return modes; - } - if (modes.depth != VK_RESOLVE_MODE_NONE && stencil_mode_supported) { - modes.stencil = mode; - } else if (modes.stencil != VK_RESOLVE_MODE_NONE && depth_mode_supported) { - modes.depth = mode; - } - return modes; - } - } // Anonymous namespace + ResolveModes modes{ + .depth = VK_RESOLVE_MODE_NONE, + .stencil = VK_RESOLVE_MODE_NONE, + }; + if (aspects.depth && depth_mode_supported) { + modes.depth = mode; + } + if (aspects.stencil && stencil_mode_supported) { + modes.stencil = mode; + } + if (modes.depth == modes.stencil || device.SupportsIndependentResolveNone()) { + return modes; + } + if (modes.depth != VK_RESOLVE_MODE_NONE && stencil_mode_supported) { + modes.stencil = mode; + } else if (modes.stencil != VK_RESOLVE_MODE_NONE && depth_mode_supported) { + modes.depth = mode; + } + return modes; +} bool SupportsDepthStencilResolve(const Device& device, PixelFormat depth_format) { if (depth_format == PixelFormat::Invalid || !device.IsKhrDepthStencilResolveSupported()) { return false; } - const ResolveAspects aspects = GetResolveAspects(depth_format); + const AttachmentAspects aspects = GetAttachmentAspects(depth_format); if (!aspects.depth && !aspects.stencil) { return false; } @@ -133,142 +112,65 @@ bool SupportsDepthStencilResolve(const Device& device, PixelFormat depth_format) return modes.depth == modes.stencil || device.SupportsIndependentResolveNone(); } -RenderPassCache::RenderPassCache(const Device& device_) : device{&device_} {} +RenderingFormats MakeRenderingFormats(const Device& device, std::span colors, + PixelFormat depth) { + RenderingFormats formats{}; + for (size_t index = 0; index < colors.size(); ++index) { + if (colors[index] == PixelFormat::Invalid) { + continue; + } + formats.colors[index] = AttachmentFormat(device, colors[index]); + formats.num_colors = static_cast(index + 1); + } + if (depth == PixelFormat::Invalid) { + return formats; + } + const VkFormat depth_format = AttachmentFormat(device, depth); + const AttachmentAspects aspects = GetAttachmentAspects(depth); + if (aspects.depth) { + formats.depth = depth_format; + } + if (aspects.stencil) { + formats.stencil = depth_format; + } + return formats; +} -VkRenderPass RenderPassCache::Get(const RenderPassKey& key) { - std::scoped_lock lock{mutex}; - const auto [pair, is_new] = cache.try_emplace(key); - if (!is_new) { - return *pair->second; - } - static constexpr size_t MAX_ATTACHMENTS = - 2 * std::tuple_size_v + 2; - boost::container::static_vector descriptions; - std::array references{}; - u32 num_attachments{}; - u32 num_colors{}; - for (size_t index = 0; index < key.color_formats.size(); ++index) { - const PixelFormat format{key.color_formats[index]}; - const bool is_valid{format != PixelFormat::Invalid}; - references[index] = VkAttachmentReference2{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - .pNext = nullptr, - .attachment = is_valid ? num_colors : VK_ATTACHMENT_UNUSED, - .layout = VK_IMAGE_LAYOUT_GENERAL, - .aspectMask = 0, - }; - if (is_valid) { - const VkAttachmentLoadOp load_op = (key.color_clear_mask & (1u << index)) != 0 - ? VK_ATTACHMENT_LOAD_OP_CLEAR - : VK_ATTACHMENT_LOAD_OP_LOAD; - const VkAttachmentStoreOp store_op = (key.color_discard_mask & (1u << index)) != 0 - ? VK_ATTACHMENT_STORE_OP_DONT_CARE - : VK_ATTACHMENT_STORE_OP_STORE; - descriptions.push_back( - AttachmentDescription(*device, format, key.samples, load_op, store_op)); - num_attachments = static_cast(index + 1); - ++num_colors; - } - } - const bool has_depth{key.depth_format != PixelFormat::Invalid}; - VkAttachmentReference2 depth_reference{}; - if (has_depth) { - depth_reference = VkAttachmentReference2{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - .pNext = nullptr, - .attachment = num_colors, - .layout = VK_IMAGE_LAYOUT_GENERAL, - .aspectMask = 0, - }; - const VkAttachmentLoadOp depth_load_op = key.depth_stencil_clear - ? VK_ATTACHMENT_LOAD_OP_CLEAR - : VK_ATTACHMENT_LOAD_OP_LOAD; - const VkAttachmentStoreOp depth_store_op = key.depth_stencil_discard - ? VK_ATTACHMENT_STORE_OP_DONT_CARE - : VK_ATTACHMENT_STORE_OP_STORE; - descriptions.push_back(AttachmentDescription(*device, key.depth_format, key.samples, - depth_load_op, depth_store_op)); - } - std::array resolve_references{}; - const bool do_resolve_color = - key.resolve_color && key.samples != VK_SAMPLE_COUNT_1_BIT && num_colors > 0; - if (do_resolve_color) { - for (size_t index = 0; index < key.color_formats.size(); ++index) { - const PixelFormat format{key.color_formats[index]}; - const bool is_valid{format != PixelFormat::Invalid}; - resolve_references[index] = VkAttachmentReference2{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - .pNext = nullptr, - .attachment = is_valid ? static_cast(descriptions.size()) - : VK_ATTACHMENT_UNUSED, - .layout = VK_IMAGE_LAYOUT_GENERAL, - .aspectMask = 0, - }; - if (is_valid) { - VkAttachmentDescription2 resolve_desc = - AttachmentDescription(*device, format, VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_DONT_CARE, - VK_ATTACHMENT_STORE_OP_STORE); - resolve_desc.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; - descriptions.push_back(resolve_desc); - } - } - } - const bool do_resolve_depth_stencil = key.resolve_depth_stencil && has_depth && - key.samples != VK_SAMPLE_COUNT_1_BIT && - SupportsDepthStencilResolve(*device, key.depth_format); - VkAttachmentReference2 depth_resolve_reference{}; - if (do_resolve_depth_stencil) { - depth_resolve_reference = VkAttachmentReference2{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - .pNext = nullptr, - .attachment = static_cast(descriptions.size()), - .layout = VK_IMAGE_LAYOUT_GENERAL, - .aspectMask = 0, - }; - VkAttachmentDescription2 resolve_desc = - AttachmentDescription(*device, key.depth_format, VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_STORE_OP_STORE); - resolve_desc.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; - descriptions.push_back(resolve_desc); - } - const ResolveModes resolve_modes = PickResolveModes(*device, key.depth_format); - const VkSubpassDescriptionDepthStencilResolve depth_stencil_resolve{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE, - .pNext = nullptr, - .depthResolveMode = resolve_modes.depth, - .stencilResolveMode = resolve_modes.stencil, - .pDepthStencilResolveAttachment = &depth_resolve_reference, +RenderingAttachments MakeRenderingAttachments(const RenderingFormats& formats, + std::span colors, + VkImageView depth, const VkRect2D& render_area, + u32 layers) { + RenderingAttachments attachments{ + .render_area = render_area, + .num_colors = formats.num_colors, + .layers = layers, }; - const VkSubpassDescription2 subpass{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, - .pNext = do_resolve_depth_stencil ? &depth_stencil_resolve : nullptr, + attachments.colors.fill(MakeAttachment(VK_NULL_HANDLE)); + std::ranges::transform(colors, attachments.colors.begin(), MakeAttachment); + attachments.depth = MakeAttachment(VK_NULL_HANDLE); + attachments.stencil = attachments.depth; + if (formats.depth != VK_FORMAT_UNDEFINED) { + attachments.depth.imageView = depth; + } + if (formats.stencil != VK_FORMAT_UNDEFINED) { + attachments.stencil.imageView = depth; + } + return attachments; +} + +void BeginRendering(vk::CommandBuffer cmdbuf, const RenderingAttachments& attachments) { + cmdbuf.BeginRendering(VkRenderingInfo{ + .sType = VK_STRUCTURE_TYPE_RENDERING_INFO, + .pNext = nullptr, .flags = 0, - .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, + .renderArea = attachments.render_area, + .layerCount = attachments.layers, .viewMask = 0, - .inputAttachmentCount = 0, - .pInputAttachments = nullptr, - .colorAttachmentCount = num_attachments, - .pColorAttachments = references.data(), - .pResolveAttachments = do_resolve_color ? resolve_references.data() : nullptr, - .pDepthStencilAttachment = has_depth ? &depth_reference : nullptr, - .preserveAttachmentCount = 0, - .pPreserveAttachments = nullptr, - }; - pair->second = device->GetLogical().CreateRenderPass2({ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, - .pNext = nullptr, - .flags = 0, - .attachmentCount = static_cast(descriptions.size()), - .pAttachments = descriptions.empty() ? nullptr : descriptions.data(), - .subpassCount = 1, - .pSubpasses = &subpass, - .dependencyCount = 0, - .pDependencies = nullptr, - .correlatedViewMaskCount = 0, - .pCorrelatedViewMasks = nullptr, + .colorAttachmentCount = attachments.num_colors, + .pColorAttachments = attachments.colors.data(), + .pDepthAttachment = &attachments.depth, + .pStencilAttachment = &attachments.stencil, }); - return *pair->second; } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.h b/src/video_core/renderer_vulkan/vk_render_pass_cache.h index 0edad4639e..a9c5b4e6a5 100644 --- a/src/video_core/renderer_vulkan/vk_render_pass_cache.h +++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.h @@ -6,77 +6,67 @@ #pragma once -#include -#include "common/container/unordered_map.h" +#include +#include -#include "common/container_hash.h" #include "video_core/surface.h" #include "video_core/vulkan_common/vulkan_wrapper.h" namespace Vulkan { -struct RenderPassKey { - bool operator==(const RenderPassKey&) const noexcept = default; - - std::array color_formats; - VideoCore::Surface::PixelFormat depth_format; - VkSampleCountFlagBits samples; - bool resolve_color; - bool resolve_depth_stencil; - u32 color_clear_mask; - bool depth_stencil_clear; - u32 color_discard_mask; - bool depth_stencil_discard; -}; - -} // namespace Vulkan - -namespace std { -template <> -struct hash { - static_assert(std::tuple_size_v <= 8); - static_assert(static_cast(VideoCore::Surface::PixelFormat::Invalid) <= 0xFF); - static_assert(static_cast(VideoCore::Surface::PixelFormat::Max) <= 0xFF); - static_assert(VK_SAMPLE_COUNT_64_BIT <= 0xFF); - - [[nodiscard]] size_t operator()(const Vulkan::RenderPassKey& key) const noexcept { - u64 formats = 0; - for (size_t index = 0; index < key.color_formats.size(); ++index) { - formats |= static_cast(key.color_formats[index]) << (index * 8); - } - const u64 state = static_cast(key.depth_format) | - (static_cast(key.samples) << 8) | - (static_cast(key.color_clear_mask) << 16) | - (static_cast(key.color_discard_mask) << 24) | - (static_cast(key.resolve_color) << 32) | - (static_cast(key.depth_stencil_clear) << 33) | - (static_cast(key.resolve_depth_stencil) << 34) | - (static_cast(key.depth_stencil_discard) << 35); - size_t seed = 0; - Common::HashCombine(seed, formats); - Common::HashCombine(seed, state); - return seed; - } -}; -} // namespace std - -namespace Vulkan { - class Device; +struct RenderingFormats { + constexpr auto operator<=>(const RenderingFormats&) const noexcept = default; + + [[nodiscard]] VkPipelineRenderingCreateInfo CreateInfo() const noexcept { + return { + .sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO, + .pNext = nullptr, + .viewMask = 0, + .colorAttachmentCount = num_colors, + .pColorAttachmentFormats = colors.data(), + .depthAttachmentFormat = depth, + .stencilAttachmentFormat = stencil, + }; + } + + std::array colors{}; + u32 num_colors{}; + VkFormat depth{}; + VkFormat stencil{}; +}; + +struct RenderingAttachments { + std::array colors; + VkRenderingAttachmentInfo depth; + VkRenderingAttachmentInfo stencil; + VkRect2D render_area; + u32 num_colors; + u32 layers; +}; + +struct ResolveModes { + VkResolveModeFlagBits depth; + VkResolveModeFlagBits stencil; +}; + [[nodiscard]] bool SupportsDepthStencilResolve(const Device& device, VideoCore::Surface::PixelFormat depth_format); -class RenderPassCache { -public: - explicit RenderPassCache(const Device& device_); +[[nodiscard]] ResolveModes PickResolveModes(const Device& device, + VideoCore::Surface::PixelFormat format); - VkRenderPass Get(const RenderPassKey& key); +[[nodiscard]] RenderingFormats MakeRenderingFormats( + const Device& device, std::span colors, + VideoCore::Surface::PixelFormat depth); -private: - const Device* device{}; - ::Common::unordered_map cache; - std::mutex mutex; -}; +[[nodiscard]] RenderingAttachments MakeRenderingAttachments(const RenderingFormats& formats, + std::span colors, + VkImageView depth, + const VkRect2D& render_area, + u32 layers); + +void BeginRendering(vk::CommandBuffer cmdbuf, const RenderingAttachments& attachments); } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 42ecc9c3c6..ec01fbfcae 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -108,45 +108,22 @@ void Scheduler::DispatchWork() { } } -void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, VkRenderPass renderpass, - const VkClearValue* clear_values, u32 clear_value_count) { - const VkFramebuffer framebuffer_handle = framebuffer->Handle(); - const VkExtent2D render_area = framebuffer->RenderArea(); +void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, + const RenderingAttachments& attachments) { PublishComputeWrites(); - state.renderpass = renderpass; - state.framebuffer = framebuffer_handle; - state.render_area = render_area; + state.framebuffer_id = framebuffer->Id(); ++renderpass_serial; renderpass_depth_writes = false; if (GPU::Logging::IsActive() && Settings::values.gpu_log_vulkan_calls.GetValue()) { + const VkExtent2D render_area = attachments.render_area.extent; const std::string render_pass_info = fmt::format("renderArea={}x{}, numImages={}", render_area.width, render_area.height, framebuffer->NumImages()); GPU::Logging::GPULogger::GetInstance().LogRenderPassBegin(render_pass_info); } - std::array values{}; - for (u32 i = 0; i < clear_value_count && i < values.size(); ++i) { - values[i] = clear_values[i]; - } - Record([renderpass, framebuffer_handle, render_area, values, clear_value_count]( - vk::CommandBuffer cmdbuf) { - const VkRenderPassBeginInfo renderpass_bi{ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, - .pNext = nullptr, - .renderPass = renderpass, - .framebuffer = framebuffer_handle, - .renderArea = - { - .offset = {.x = 0, .y = 0}, - .extent = render_area, - }, - .clearValueCount = clear_value_count, - .pClearValues = clear_value_count != 0 ? values.data() : nullptr, - }; - cmdbuf.BeginRenderPass(renderpass_bi, VK_SUBPASS_CONTENTS_INLINE); - }); + Record([attachments](vk::CommandBuffer cmdbuf) { BeginRendering(cmdbuf, attachments); }); num_renderpass_images = framebuffer->NumImages(); renderpass_images = framebuffer->Images(); renderpass_image_ranges = framebuffer->ImageRanges(); @@ -160,26 +137,30 @@ void Scheduler::RealizeDeferredClear() { const DeferredClear dc = deferred_clear; deferred_clear = {}; - std::array clear_values{}; - u32 count = 0; - const RenderPassKey& base = dc.framebuffer->RenderPassKeyBase(); - for (u32 slot = 0; slot < 8; ++slot) { - if (base.color_formats[slot] == VideoCore::Surface::PixelFormat::Invalid) { + RenderingAttachments attachments = dc.framebuffer->Attachments(); + for (u32 slot = 0; slot < attachments.num_colors; ++slot) { + if ((dc.color_clear_mask & (1u << slot)) == 0) { continue; } - clear_values[count++] = dc.color_values[slot]; + VkRenderingAttachmentInfo& attachment = attachments.colors[slot]; + attachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; + attachment.clearValue = dc.color_values[slot]; + if (dc.framebuffer->DiscardsMsaaColor()) { + attachment.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; + } } - if (base.depth_format != VideoCore::Surface::PixelFormat::Invalid) { - clear_values[count++] = dc.depth_stencil_value; + if (dc.depth_stencil) { + for (VkRenderingAttachmentInfo* const attachment : + {&attachments.depth, &attachments.stencil}) { + attachment->loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; + attachment->clearValue = dc.depth_stencil_value; + if (dc.framebuffer->DiscardsMsaaDepthStencil()) { + attachment->storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; + } + } } - const u32 color_discard_mask = - dc.framebuffer->DiscardsMsaaColor() ? dc.color_clear_mask : 0u; - const bool depth_stencil_discard = - dc.depth_stencil && dc.framebuffer->DiscardsMsaaDepthStencil(); - const VkRenderPass renderpass = dc.framebuffer->RenderPassVariant( - dc.color_clear_mask, dc.depth_stencil, color_discard_mask, depth_stencil_discard); EndRenderPass(); - BeginRenderPassImpl(dc.framebuffer, renderpass, clear_values.data(), count); + BeginRenderPassImpl(dc.framebuffer, attachments); renderpass_depth_writes = dc.depth_stencil; } @@ -225,17 +206,12 @@ void Scheduler::RequestRenderpass(const Framebuffer* framebuffer) { RealizeDeferredClear(); return; } - const VkRenderPass renderpass = framebuffer->RenderPass(); - const VkFramebuffer framebuffer_handle = framebuffer->Handle(); - const VkExtent2D render_area = framebuffer->RenderArea(); - if (renderpass == state.renderpass && framebuffer_handle == state.framebuffer && - render_area.width == state.render_area.width && - render_area.height == state.render_area.height) { + if (framebuffer->Id() == state.framebuffer_id) { return; } // Ends any active pass and realizes a deferred clear EndRenderPass(); - BeginRenderPassImpl(framebuffer, renderpass, nullptr, 0); + BeginRenderPassImpl(framebuffer, framebuffer->Attachments()); } void Scheduler::RequestOutsideRenderPassOperationContext() { @@ -427,7 +403,7 @@ void Scheduler::EndPendingOperations() { void Scheduler::EndRenderPass() { RealizeDeferredClear(); - if (!state.renderpass) { + if (state.framebuffer_id == 0) { return; } @@ -484,12 +460,12 @@ void Scheduler::EndRenderPass() .subresourceRange = range, }; } - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); cmdbuf.PipelineBarrier(0, vk::Span(write_barrier, num_memory_barriers), {}, vk::Span(barriers.data(), num_images)); }); - state.renderpass = VkRenderPass{}; + state.framebuffer_id = 0; num_renderpass_images = 0; } diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index a7109e4a48..e4fa647132 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -36,6 +36,7 @@ class GraphicsPipeline; class StateTracker; struct QueryCacheParams; +struct RenderingAttachments; /// The scheduler abstracts command buffer and fence management with an interface that's able to do /// OpenGL-like operations on Vulkan command buffers. @@ -77,11 +78,11 @@ public: /// Returns true when a render pass is currently active in the scheduler state. bool IsRenderPassActive() const { - return state.renderpass != VK_NULL_HANDLE; + return state.framebuffer_id != 0; } u64 ActiveRenderPassSerial() const noexcept { - if (state.renderpass) { + if (state.framebuffer_id != 0) { return renderpass_serial; } return (std::numeric_limits::max)(); @@ -285,9 +286,7 @@ private: }; struct State { - VkRenderPass renderpass{}; - VkFramebuffer framebuffer{}; - VkExtent2D render_area = {0, 0}; + u64 framebuffer_id = 0; GraphicsPipeline* graphics_pipeline = nullptr; bool is_rescaling = false; bool rescaling_defined = false; @@ -305,8 +304,8 @@ private: }; /// Begins a render pass for the given framebuffer, optionally with clear values. - void BeginRenderPassImpl(const Framebuffer* framebuffer, VkRenderPass renderpass, - const VkClearValue* clear_values, u32 clear_value_count); + void BeginRenderPassImpl(const Framebuffer* framebuffer, + const RenderingAttachments& attachments); /// If a deferred clear is pending. void RealizeDeferredClear(); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 04b4eabc07..2d3934468a 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -994,18 +994,42 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const cmdbuf.PipelineBarrier(0, {}, {}, write_barriers); }); } +void RecordInitialLayout(Scheduler& scheduler, VkImage image, VkImageAspectFlags aspect_mask) { + const VkImageMemoryBarrier2 barrier{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_NONE, + .srcAccessMask = VK_ACCESS_2_NONE, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, + .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, + .newLayout = VK_IMAGE_LAYOUT_GENERAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = image, + .subresourceRange{ + .aspectMask = aspect_mask, + .baseMipLevel = 0, + .levelCount = VK_REMAINING_MIP_LEVELS, + .baseArrayLayer = 0, + .layerCount = VK_REMAINING_ARRAY_LAYERS, + }, + }; + scheduler.RecordWithUploadBuffer([barrier](vk::CommandBuffer, vk::CommandBuffer upload_cmdbuf) { + upload_cmdbuf.PipelineBarrier(barrier); + }); +} } // Anonymous namespace TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& scheduler_, MemoryAllocator& memory_allocator_, StagingBufferPool& staging_buffer_pool_, BlitImageHelper& blit_image_helper_, - RenderPassCache& render_pass_cache_, DescriptorPool& descriptor_pool, ComputePassDescriptorQueue& compute_pass_descriptor_queue) : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, - render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} { + resolution{Settings::values.resolution_info} { if (Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::Gpu) { astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue, memory_allocator); @@ -1159,6 +1183,7 @@ VkImageView TextureCacheRuntime::GetOrCreateResolveShadow(VkImage msaa_image, Vk .layerCount = layers, }, }); + RecordInitialLayout(scheduler, *shadow.image, aspect_mask); shadow.format = format; shadow.extent = extent; shadow.layers = layers; @@ -1485,10 +1510,6 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst } void TextureCacheRuntime::ConvertImage(Framebuffer* dst, ImageView& dst_view, ImageView& src_view) { - if (!dst->RenderPass()) { - return; - } - switch (dst_view.format) { case PixelFormat::R16_UNORM: if (src_view.format == PixelFormat::D16_UNORM) { @@ -1824,17 +1845,17 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, if ((dst_aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) != 0) { const bool copies_stencil = (dst_aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT) != 0 && device.IsExtShaderStencilExportSupported(); - blit_image_helper.CopyMSAADepth(render_pass_cache, dst.Handle(), dst.info.format, - src.Handle(), src.info.format, num_samples, copies, - copies_stencil, msaa_to_non_msaa); + blit_image_helper.CopyMSAADepth(dst.Handle(), dst.info.format, src.Handle(), + src.info.format, num_samples, copies, copies_stencil, + msaa_to_non_msaa); return; } if ((dst_aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) == 0) { UNIMPLEMENTED_MSG("Copying images with different samples is not supported."); return; } - blit_image_helper.CopyMSAA(render_pass_cache, dst.Handle(), dst.info.format, src.Handle(), - src.info.format, num_samples, copies, msaa_to_non_msaa); + blit_image_helper.CopyMSAA(dst.Handle(), dst.info.format, src.Handle(), src.info.format, + num_samples, copies, msaa_to_non_msaa); } u64 TextureCacheRuntime::GetDeviceLocalMemory() const { @@ -2032,14 +2053,13 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset, } if (msaa_upload_is_depth) { - runtime->blit_image_helper.CopyMSAADepth(runtime->render_pass_cache, Handle(), - info.format, temp_vk_image, info.format, - info.num_samples, + runtime->blit_image_helper.CopyMSAADepth(Handle(), info.format, temp_vk_image, + info.format, info.num_samples, {image_copies.data(), image_copies.size()}, msaa_upload_copies_stencil, false); } else { - runtime->blit_image_helper.CopyMSAA(runtime->render_pass_cache, Handle(), info.format, - temp_vk_image, info.format, info.num_samples, + runtime->blit_image_helper.CopyMSAA(Handle(), info.format, temp_vk_image, info.format, + info.num_samples, {image_copies.data(), image_copies.size()}, false); } initialized = true; @@ -2165,13 +2185,11 @@ void Image::DownloadMemory(std::span buffers_span, std::span o if (msaa_download_is_depth) { runtime->blit_image_helper.CopyMSAADepth( - runtime->render_pass_cache, temp_vk_image, info.format, Handle(), info.format, - info.num_samples, {image_copies.data(), image_copies.size()}, - msaa_download_copies_stencil, true); + temp_vk_image, info.format, Handle(), info.format, info.num_samples, + {image_copies.data(), image_copies.size()}, msaa_download_copies_stencil, true); } else { - runtime->blit_image_helper.CopyMSAA(runtime->render_pass_cache, temp_vk_image, - info.format, Handle(), info.format, - info.num_samples, + runtime->blit_image_helper.CopyMSAA(temp_vk_image, info.format, Handle(), + info.format, info.num_samples, {image_copies.data(), image_copies.size()}, true); } @@ -2981,9 +2999,6 @@ Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span color_buffers, ImageView* depth_buffer, bool is_rescaled_) { - boost::container::small_vector attachments; - RenderPassKey renderpass_key{}; + std::array color_formats{}; + std::array color_views{}; + PixelFormat depth_format = PixelFormat::Invalid; + VkImageView depth_view = VK_NULL_HANDLE; s32 num_layers = 1; is_rescaled = is_rescaled_; @@ -3010,15 +3027,15 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime, for (size_t index = 0; index < NUM_RT; ++index) { const ImageView* const color_buffer = color_buffers[index]; if (!color_buffer) { - renderpass_key.color_formats[index] = PixelFormat::Invalid; + color_formats[index] = PixelFormat::Invalid; continue; } width = (std::min)(width, is_rescaled ? resolution.ScaleUp(color_buffer->size.width) : color_buffer->size.width); height = (std::min)(height, is_rescaled ? resolution.ScaleUp(color_buffer->size.height) : color_buffer->size.height); - attachments.push_back(color_buffer->RenderTarget()); - renderpass_key.color_formats[index] = color_buffer->format; + color_views[index] = color_buffer->RenderTarget(); + color_formats[index] = color_buffer->format; num_layers = (std::max)(num_layers, color_buffer->range.extent.layers); images[num_images] = color_buffer->ImageHandle(); image_ranges[num_images] = MakeSubresourceRange(color_buffer); @@ -3026,7 +3043,7 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime, samples = color_buffer->Samples(); ++num_images; } - const size_t num_colors = attachments.size(); + const size_t num_colors = num_images; VkImage depth_image = VK_NULL_HANDLE; VkImageAspectFlags depth_aspect_mask = 0; if (depth_buffer) { @@ -3034,8 +3051,8 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime, : depth_buffer->size.width); height = (std::min)(height, is_rescaled ? resolution.ScaleUp(depth_buffer->size.height) : depth_buffer->size.height); - attachments.push_back(depth_buffer->RenderTarget()); - renderpass_key.depth_format = depth_buffer->format; + depth_view = depth_buffer->RenderTarget(); + depth_format = depth_buffer->format; num_layers = (std::max)(num_layers, depth_buffer->range.extent.layers); images[num_images] = depth_buffer->ImageHandle(); const VkImageSubresourceRange subresource_range = MakeSubresourceRange(depth_buffer); @@ -3046,70 +3063,60 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime, has_stencil = (subresource_range.aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT) != 0; depth_image = depth_buffer->ImageHandle(); depth_aspect_mask = subresource_range.aspectMask; - } else { - renderpass_key.depth_format = PixelFormat::Invalid; } - renderpass_key.samples = samples; const bool do_resolve_color = ENABLE_MSAA_TILER_RESOLVE && samples != VK_SAMPLE_COUNT_1_BIT && num_colors > 0 && runtime.device.IsTiler(); - renderpass_key.resolve_color = do_resolve_color; const bool do_resolve_depth_stencil = ENABLE_MSAA_TILER_RESOLVE && samples != VK_SAMPLE_COUNT_1_BIT && depth_image != VK_NULL_HANDLE && - runtime.device.IsTiler() && - SupportsDepthStencilResolve(runtime.device, renderpass_key.depth_format); - renderpass_key.resolve_depth_stencil = do_resolve_depth_stencil; + runtime.device.IsTiler() && SupportsDepthStencilResolve(runtime.device, depth_format); discard_msaa_color = ENABLE_MSAA_RESOLVE_CONSUME && ENABLE_MSAA_COLOR_DISCARD && do_resolve_color; discard_msaa_depth_stencil = ENABLE_MSAA_RESOLVE_CONSUME && ENABLE_MSAA_DEPTH_STENCIL_DISCARD && do_resolve_depth_stencil; - renderpass = runtime.render_pass_cache.Get(renderpass_key); - render_pass_key = renderpass_key; - render_pass_cache = &runtime.render_pass_cache; runtime_ptr = &runtime; + id = ++runtime.framebuffer_serial; render_area.width = (std::min)(render_area.width, width); render_area.height = (std::min)(render_area.height, height); + const u32 layers = static_cast((std::max)(num_layers, 1)); + formats = MakeRenderingFormats(runtime.device, color_formats, depth_format); + attachments = MakeRenderingAttachments(formats, color_views, depth_view, + VkRect2D{.offset = {0, 0}, .extent = render_area}, + layers); + if (do_resolve_color) { - const u32 layers = static_cast((std::max)(num_layers, 1)); for (size_t index = 0; index < NUM_RT; ++index) { - const PixelFormat format = renderpass_key.color_formats[index]; - if (format == PixelFormat::Invalid) { + if (color_formats[index] == PixelFormat::Invalid) { continue; } - const VkFormat vk_format = - MaxwellToVK::SurfaceFormat(runtime.device, FormatType::Optimal, true, format).format; const VkImage msaa_image = images[rt_map[index]]; - attachments.push_back(runtime.GetOrCreateResolveShadow( - msaa_image, vk_format, render_area, layers, VK_IMAGE_ASPECT_COLOR_BIT)); + VkRenderingAttachmentInfo& attachment = attachments.colors[index]; + attachment.resolveMode = VK_RESOLVE_MODE_AVERAGE_BIT; + if (VideoCore::Surface::IsPixelFormatInteger(color_formats[index])) { + attachment.resolveMode = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT; + } + attachment.resolveImageView = runtime.GetOrCreateResolveShadow( + msaa_image, formats.colors[index], render_area, layers, VK_IMAGE_ASPECT_COLOR_BIT); resolve_shadow_images[num_resolve_shadows++] = msaa_image; } } if (do_resolve_depth_stencil) { - const u32 layers = static_cast((std::max)(num_layers, 1)); const VkFormat vk_format = - MaxwellToVK::SurfaceFormat(runtime.device, FormatType::Optimal, true, - renderpass_key.depth_format) + MaxwellToVK::SurfaceFormat(runtime.device, FormatType::Optimal, true, depth_format) .format; - attachments.push_back(runtime.GetOrCreateResolveShadow(depth_image, vk_format, render_area, - layers, depth_aspect_mask)); + const VkImageView resolve_view = runtime.GetOrCreateResolveShadow( + depth_image, vk_format, render_area, layers, depth_aspect_mask); + const ResolveModes modes = PickResolveModes(runtime.device, depth_format); + attachments.depth.resolveMode = modes.depth; + attachments.depth.resolveImageView = resolve_view; + attachments.stencil.resolveMode = modes.stencil; + attachments.stencil.resolveImageView = resolve_view; resolve_shadow_images[num_resolve_shadows++] = depth_image; } - - framebuffer = runtime.device.GetLogical().CreateFramebuffer({ - .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .renderPass = renderpass, - .attachmentCount = static_cast(attachments.size()), - .pAttachments = attachments.data(), - .width = render_area.width, - .height = render_area.height, - .layers = static_cast((std::max)(num_layers, 1)), - }); } void Framebuffer::MarkResolveShadowsUpToDate() const { @@ -3121,36 +3128,6 @@ void Framebuffer::MarkResolveShadowsUpToDate() const { } } -VkRenderPass Framebuffer::RenderPassVariant(u32 color_clear_mask, bool depth_stencil_clear, - u32 color_discard_mask, - bool depth_stencil_discard) const { - if (color_clear_mask == 0 && !depth_stencil_clear && color_discard_mask == 0 && - !depth_stencil_discard) { - return renderpass; - } - static_assert(NUM_RT <= 8); - const u32 variant_key = color_clear_mask | (color_discard_mask << 8) | - (static_cast(depth_stencil_clear) << 16) | - (static_cast(depth_stencil_discard) << 17); - for (u32 index = 0; index < num_memoized_variants; ++index) { - if (variant_keys[index] == variant_key) { - return variant_render_passes[index]; - } - } - RenderPassKey key = render_pass_key; - key.color_clear_mask = color_clear_mask; - key.depth_stencil_clear = depth_stencil_clear; - key.color_discard_mask = color_discard_mask; - key.depth_stencil_discard = depth_stencil_discard; - const VkRenderPass variant = render_pass_cache->Get(key); - if (num_memoized_variants < variant_keys.size()) { - variant_keys[num_memoized_variants] = variant_key; - variant_render_passes[num_memoized_variants] = variant; - ++num_memoized_variants; - } - return variant; -} - void TextureCacheRuntime::AccelerateImageUpload( Image& image, const StagingBufferRef& map, std::span swizzles) { @@ -3174,29 +3151,7 @@ void TextureCacheRuntime::AccelerateImageUpload( void TextureCacheRuntime::TransitionImageLayout(Image& image) { if (!image.ExchangeInitialization()) { - VkImageMemoryBarrier2 barrier{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_NONE, - .srcAccessMask = VK_ACCESS_2_NONE, - .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, - .dstAccessMask = vk::ACCESS_IMAGE_USERS, - .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, - .newLayout = VK_IMAGE_LAYOUT_GENERAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = image.Handle(), - .subresourceRange{ - .aspectMask = image.AspectMask(), - .baseMipLevel = 0, - .levelCount = VK_REMAINING_MIP_LEVELS, - .baseArrayLayer = 0, - .layerCount = VK_REMAINING_ARRAY_LAYERS, - }, - }; - scheduler.RecordWithUploadBuffer([barrier](vk::CommandBuffer, vk::CommandBuffer upload_cmdbuf) { - upload_cmdbuf.PipelineBarrier(barrier); - }); + RecordInitialLayout(scheduler, image.Handle(), image.AspectMask()); } } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 06ce5a5c32..c41583dcb4 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -36,7 +36,6 @@ class Device; class Image; class ImageView; class Framebuffer; -class RenderPassCache; class StagingBufferPool; class Scheduler; @@ -46,7 +45,6 @@ public: MemoryAllocator& memory_allocator_, StagingBufferPool& staging_buffer_pool_, BlitImageHelper& blit_image_helper_, - RenderPassCache& render_pass_cache_, DescriptorPool& descriptor_pool, ComputePassDescriptorQueue& compute_pass_descriptor_queue); @@ -150,7 +148,6 @@ public: MemoryAllocator& memory_allocator; StagingBufferPool& staging_buffer_pool; BlitImageHelper& blit_image_helper; - RenderPassCache& render_pass_cache; std::optional astc_decoder_pass; std::optional bl_unswizzle_2d_pass; std::optional bl_unswizzle_3d_pass; @@ -184,6 +181,7 @@ public: std::vector msaa_scratch_images; ::Common::unordered_map resolve_shadows; std::vector> pending_resolve_shadows; + u64 framebuffer_serial{}; }; class Framebuffer { @@ -206,22 +204,18 @@ public: std::span color_buffers, ImageView* depth_buffer, bool is_rescaled = false); - [[nodiscard]] VkFramebuffer Handle() const noexcept { - return *framebuffer; + [[nodiscard]] u64 Id() const noexcept { + return id; } - [[nodiscard]] VkRenderPass RenderPass() const noexcept { - return renderpass; + [[nodiscard]] const RenderingFormats& Formats() const noexcept { + return formats; } - [[nodiscard]] const RenderPassKey& RenderPassKeyBase() const noexcept { - return render_pass_key; + [[nodiscard]] const RenderingAttachments& Attachments() const noexcept { + return attachments; } - [[nodiscard]] VkRenderPass RenderPassVariant(u32 color_clear_mask, bool depth_stencil_clear, - u32 color_discard_mask, - bool depth_stencil_discard) const; - [[nodiscard]] VkExtent2D RenderArea() const noexcept { return render_area; } @@ -271,10 +265,9 @@ public: void MarkResolveShadowsUpToDate() const; private: - static constexpr size_t NUM_MEMOIZED_RENDER_PASS_VARIANTS = 8; - - vk::Framebuffer framebuffer; - VkRenderPass renderpass{}; + RenderingFormats formats{}; + RenderingAttachments attachments{}; + u64 id{}; VkExtent2D render_area{}; VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT; u32 num_images = 0; @@ -287,13 +280,8 @@ private: std::array resolve_shadow_images{}; u32 num_resolve_shadows = 0; TextureCacheRuntime* runtime_ptr{nullptr}; - RenderPassKey render_pass_key{}; - RenderPassCache* render_pass_cache{nullptr}; bool discard_msaa_color{}; bool discard_msaa_depth_stencil{}; - mutable std::array variant_keys{}; - mutable std::array variant_render_passes{}; - mutable u32 num_memoized_variants{}; }; class Image : public VideoCommon::ImageBase { diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 639552341e..756e6a49a2 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1411,7 +1411,9 @@ void Device::RemoveUnsuitableExtensions() { extensions.synchronization2 = features.synchronization2.synchronization2; - if (!extensions.synchronization2 || !IsKhrCreateRenderPass2Supported()) { + extensions.dynamic_rendering = features.dynamic_rendering.dynamicRendering; + if (!extensions.synchronization2 || !extensions.dynamic_rendering || + !IsKhrCreateRenderPass2Supported()) { throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 12d2267876..a23f9b6334 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -43,6 +43,7 @@ VK_DEFINE_HANDLE(VmaAllocator) FEATURE(KHR, VulkanMemoryModel, VULKAN_MEMORY_MODEL, vulkan_memory_model) #define FOR_EACH_VK_FEATURE_1_3(FEATURE) \ + FEATURE(KHR, DynamicRendering, DYNAMIC_RENDERING, dynamic_rendering) \ FEATURE(EXT, ImageRobustness, IMAGE_ROBUSTNESS, robust_image_access) \ FEATURE(EXT, ShaderDemoteToHelperInvocation, SHADER_DEMOTE_TO_HELPER_INVOCATION, \ shader_demote_to_helper_invocation) \ diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 44e519a3fa..c4d99d08f4 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -89,6 +89,7 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdBeginConditionalRenderingEXT); X(vkCmdBeginQuery); X(vkCmdBeginRenderPass); + X(vkCmdBeginRendering); X(vkCmdBeginTransformFeedbackEXT); X(vkCmdBindDescriptorSets); X(vkCmdBindIndexBuffer); @@ -116,6 +117,7 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdEndConditionalRenderingEXT); X(vkCmdEndQuery); X(vkCmdEndRenderPass); + X(vkCmdEndRendering); X(vkCmdEndTransformFeedbackEXT); X(vkCmdFillBuffer); X(vkCmdPipelineBarrier2); @@ -257,6 +259,13 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { Proc(dld.vkQueueSubmit2, dld, "vkQueueSubmit2KHR", device); } + if (!dld.vkCmdBeginRendering) { + Proc(dld.vkCmdBeginRendering, dld, "vkCmdBeginRenderingKHR", device); + } + if (!dld.vkCmdEndRendering) { + Proc(dld.vkCmdEndRendering, dld, "vkCmdEndRenderingKHR", device); + } + if (!dld.vkCreateRenderPass2) { Proc(dld.vkCreateRenderPass2, dld, "vkCreateRenderPass2KHR", device); } diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 824b567e7f..2007658c35 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -238,6 +238,7 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT{}; PFN_vkCmdBeginQuery vkCmdBeginQuery{}; PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass{}; + PFN_vkCmdBeginRendering vkCmdBeginRendering{}; PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT{}; PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets{}; PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer{}; @@ -266,6 +267,7 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdEndConditionalRenderingEXT vkCmdEndConditionalRenderingEXT{}; PFN_vkCmdEndQuery vkCmdEndQuery{}; PFN_vkCmdEndRenderPass vkCmdEndRenderPass{}; + PFN_vkCmdEndRendering vkCmdEndRendering{}; PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT{}; PFN_vkCmdFillBuffer vkCmdFillBuffer{}; PFN_vkCmdPipelineBarrier2 vkCmdPipelineBarrier2{}; @@ -1194,6 +1196,14 @@ public: dld->vkCmdEndRenderPass(handle); } + void BeginRendering(const VkRenderingInfo& rendering_info) const noexcept { + dld->vkCmdBeginRendering(handle, &rendering_info); + } + + void EndRendering() const noexcept { + dld->vkCmdEndRendering(handle); + } + void BeginQuery(VkQueryPool query_pool, u32 query, VkQueryControlFlags flags) const noexcept { dld->vkCmdBeginQuery(handle, query_pool, query, flags); } From 1a65725a35e2ca1f31affdbb0ddcc72c3dbff4e7 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 13:37:49 -0400 Subject: [PATCH 108/198] Fix licenses --- src/shader_recompiler/ir_opt/constant_propagation_pass.cpp | 2 +- src/shader_recompiler/ir_opt/passes.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp index 9424de188d..6285fef16f 100644 --- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp +++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project diff --git a/src/shader_recompiler/ir_opt/passes.h b/src/shader_recompiler/ir_opt/passes.h index 0c2b44e022..1ddbc58f7b 100644 --- a/src/shader_recompiler/ir_opt/passes.h +++ b/src/shader_recompiler/ir_opt/passes.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later From d6f69e14dc555cd410fa69d88ffbe9953cb33f16 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 14:59:01 -0400 Subject: [PATCH 109/198] experiment with depth ranges --- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 10 +++++++++- src/video_core/renderer_vulkan/vk_rasterizer.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 37b8774f18..ec30f2fa84 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -1299,10 +1299,18 @@ void RasterizerVulkan::UpdateScissorsState(Tegra::Engines::Maxwell3D::Regs& regs } void RasterizerVulkan::UpdateDepthBias(Tegra::Engines::Maxwell3D::Regs& regs) { - if (!state_tracker.TouchDepthBias()) { + const bool zeta_changed = + std::exchange(depth_bias_zeta_format, regs.zeta.format) != regs.zeta.format; + const bool bias_changed = state_tracker.TouchDepthBias(); + if (!bias_changed && !zeta_changed) { return; } float units = regs.depth_bias / 2.0f; + const bool is_float = regs.zeta.format == Tegra::DepthFormat::Z32_FLOAT || + regs.zeta.format == Tegra::DepthFormat::Z32_FLOAT_X24S8_UINT; + if (is_float && !device.IsExtDepthBiasControlSupported()) { + units *= 256.0f; + } const bool is_d24 = regs.zeta.format == Tegra::DepthFormat::Z24_UNORM_S8_UINT || regs.zeta.format == Tegra::DepthFormat::X8Z24_UNORM || regs.zeta.format == Tegra::DepthFormat::S8Z24_UNORM || diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 2c45c6c081..e1f14cdbf3 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -225,6 +225,7 @@ private: boost::container::static_vector sampler_handles; u32 draw_counter = 0; + Tegra::DepthFormat depth_bias_zeta_format{}; }; } // namespace Vulkan From 16483a27edfc1b532222ce7f4a18cb529620f3c0 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 15:43:34 -0400 Subject: [PATCH 110/198] Remove PostCopyBarrier on buffers --- src/video_core/buffer_cache/buffer_cache.h | 4 +++- src/video_core/renderer_vulkan/vk_compute_pipeline.cpp | 4 ---- src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 4 ---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 971f40922d..95610c7c14 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1822,7 +1822,9 @@ bool BufferCache

::SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 si } const std::span copies_span(upload_copies.data(), upload_copies.size()); UploadMemory(buffer, total_size_bytes, largest_copy, copies_span); - any_buffer_uploaded = true; + if constexpr (IS_OPENGL) { + any_buffer_uploaded = true; + } return false; } diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index 29356cfcec..840ff5897b 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp @@ -247,10 +247,6 @@ bool ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, buffer_cache.UpdateComputeBuffers(); buffer_cache.BindHostComputeBuffers(); - if (buffer_cache.any_buffer_uploaded) { - buffer_cache.runtime.PostCopyBarrier(); - buffer_cache.any_buffer_uploaded = false; - } RescalingPushConstant rescaling; const VideoCommon::SamplerId* samplers_it{samplers.data()}; diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 950757a502..5c7a88e81e 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -540,10 +540,6 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { if constexpr (Spec::enabled_stages[4]) { prepare_stage(4); } - if (buffer_cache.any_buffer_uploaded) { - buffer_cache.runtime.PostCopyBarrier(); - buffer_cache.any_buffer_uploaded = false; - } texture_cache.UpdateRenderTargets(false); texture_cache.CheckFeedbackLoop(std::span{views.data(), views.size()}); From 656370e70a7346992346ab00841008083043104c Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 16:43:23 -0400 Subject: [PATCH 111/198] Upload only images needed --- .../renderer_vulkan/vk_texture_cache.cpp | 16 ++++++++++++---- src/video_core/texture_cache/image_base.h | 1 + src/video_core/texture_cache/texture_cache.h | 3 ++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 2d3934468a..51aedac099 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -2078,17 +2078,25 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset, return; } - scheduler->RequestOutsideRenderPassOperationContext(); auto vk_copies = TransformBufferImageCopies(copies, offset, aspect_mask); const VkBuffer src_buffer = buffer; const VkImage vk_image = *original_image; const VkImageAspectFlags vk_aspect_mask = aspect_mask; const bool was_initialized = std::exchange(initialized, true); - scheduler->Record([src_buffer, vk_image, vk_aspect_mask, was_initialized, - vk_copies](vk::CommandBuffer cmdbuf) { + auto copy = [src_buffer, vk_image, vk_aspect_mask, was_initialized, + vk_copies](vk::CommandBuffer cmdbuf) { CopyBufferToImage(cmdbuf, src_buffer, vk_image, vk_aspect_mask, was_initialized, VideoCommon::FixSmallVectorADL(vk_copies)); - }); + }; + if (True(flags & ImageFlagBits::ReorderableUpload)) { + scheduler->RecordWithUploadBuffer( + [copy = std::move(copy)](vk::CommandBuffer, vk::CommandBuffer upload_cmdbuf) { + copy(upload_cmdbuf); + }); + } else { + scheduler->RequestOutsideRenderPassOperationContext(); + scheduler->Record(std::move(copy)); + } if (is_rescaled) { ScaleUp(); diff --git a/src/video_core/texture_cache/image_base.h b/src/video_core/texture_cache/image_base.h index 9e0a293962..3c597a7f1d 100644 --- a/src/video_core/texture_cache/image_base.h +++ b/src/video_core/texture_cache/image_base.h @@ -45,6 +45,7 @@ enum class ImageFlagBits : u32 { AsynchronousDecode = 1 << 16, IsDecoding = 1 << 17, ///< Is currently being decoded asynchronously. + ReorderableUpload = 1 << 18, }; DECLARE_ENUM_FLAG_OPERATORS(ImageFlagBits) diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 46cead4c35..a38fbd4dbc 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1471,8 +1471,9 @@ ImageId TextureCache

::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA DeleteImage(overlap_id); } - // TODO: Only upload what we need + new_image.flags |= ImageFlagBits::ReorderableUpload; RefreshContents(new_image, new_image_id); + new_image.flags &= ~ImageFlagBits::ReorderableUpload; if (can_rescale) { ScaleUp(new_image); From f3ce6acf530ba657475a9942eb50466c4cf1efcb Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 17:21:32 -0400 Subject: [PATCH 112/198] Another intent on load store op none impl --- .../renderer_vulkan/vk_graphics_pipeline.cpp | 34 +++++++++- .../renderer_vulkan/vk_rasterizer.cpp | 3 - .../renderer_vulkan/vk_scheduler.cpp | 66 +++++++++++++++---- src/video_core/renderer_vulkan/vk_scheduler.h | 33 ++++++---- src/video_core/vulkan_common/vulkan_device.h | 6 ++ 5 files changed, 116 insertions(+), 26 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 5c7a88e81e..792e7d2e7c 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -136,6 +136,37 @@ RenderingFormats PipelineFormats(const FixedPipelineState& state, const Device& return MakeRenderingFormats(device, color_formats, depth_format); } +struct AttachmentAccess { + u32 touched; + u32 written; +}; + +AttachmentAccess MakeAttachmentAccess(const Maxwell& regs) { + AttachmentAccess access{}; + for (size_t index = 0; index < Maxwell::NumRenderTargets; ++index) { + size_t mask_index = index; + if (regs.color_mask_common) { + mask_index = 0; + } + const auto& mask = regs.color_mask[mask_index]; + if (mask.R || mask.G || mask.B || mask.A) { + access.touched |= 1u << index; + access.written |= 1u << index; + } + } + if (regs.depth_test_enable || regs.depth_bounds_enable) { + access.touched |= Scheduler::DEPTH_ATTACHMENT_BIT; + } + if (regs.depth_test_enable && regs.depth_write_enabled) { + access.written |= Scheduler::DEPTH_ATTACHMENT_BIT; + } + if (regs.stencil_enable) { + access.touched |= Scheduler::STENCIL_ATTACHMENT_BIT; + access.written |= Scheduler::STENCIL_ATTACHMENT_BIT; + } + return access; +} + size_t NumAttachments(const FixedPipelineState& state) { size_t num{}; for (size_t index = 0; index < Maxwell::NumRenderTargets; ++index) { @@ -586,7 +617,8 @@ bool GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling, if (buffer_cache.TakeDrawHazard()) { scheduler.RequestOutsideRenderPassOperationContext(); } - scheduler.RequestRenderpass(texture_cache.GetFramebuffer()); + const AttachmentAccess access = MakeAttachmentAccess(maxwell3d->regs); + scheduler.RequestRenderpass(texture_cache.GetFramebuffer(), access.touched, access.written); buffer_cache.CommitDrawWrites(); if (!is_built.load(std::memory_order::relaxed)) { // Wait for the pipeline to be built diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index ec30f2fa84..835aacf675 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -263,8 +263,6 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, bool skip_empty, Func&& draw pipeline->SetEngine(maxwell3d, gpu_memory); if (!pipeline->Configure(is_indexed)) return; - scheduler.MarkDepthWrites(maxwell3d->regs.depth_test_enable != 0 && - maxwell3d->regs.depth_write_enabled != 0); UpdateDynamicStates(pipeline->HasDynamicVertexInput()); @@ -584,7 +582,6 @@ void RasterizerVulkan::Clear(u32 layer_count) { if (aspect_flags == 0) { return; } - scheduler.MarkDepthWrites(!can_defer_clear && (aspect_flags & VK_IMAGE_ASPECT_DEPTH_BIT) != 0); if (use_stencil && framebuffer->HasAspectStencilBit() && regs.stencil_front_mask != 0xFF && regs.stencil_front_mask != 0) { diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index ec01fbfcae..024b75e584 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -27,6 +27,15 @@ #include "video_core/vulkan_common/vulkan_wrapper.h" namespace Vulkan { +namespace { +struct BeginRenderingCommand { + void operator()(vk::CommandBuffer cmdbuf, vk::CommandBuffer) const { + BeginRendering(cmdbuf, attachments); + } + + RenderingAttachments attachments; +}; +} // Anonymous namespace void Scheduler::CommandChunk::ExecuteAll(vk::CommandBuffer cmdbuf, vk::CommandBuffer upload_cmdbuf) { @@ -104,6 +113,7 @@ void Scheduler::DispatchWork() { work_queue.push(std::move(chunk)); } event_cv.notify_all(); + recorded_attachments = nullptr; AcquireNewChunk(); } } @@ -113,7 +123,8 @@ void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, PublishComputeWrites(); state.framebuffer_id = framebuffer->Id(); ++renderpass_serial; - renderpass_depth_writes = false; + attachments_touched = 0; + attachments_written = 0; if (GPU::Logging::IsActive() && Settings::values.gpu_log_vulkan_calls.GetValue()) { const VkExtent2D render_area = attachments.render_area.extent; @@ -123,7 +134,13 @@ void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, GPU::Logging::GPULogger::GetInstance().LogRenderPassBegin(render_pass_info); } - Record([attachments](vk::CommandBuffer cmdbuf) { BeginRendering(cmdbuf, attachments); }); + BeginRenderingCommand command{attachments}; + BeginRenderingCommand* recorded = chunk->Record(command); + if (recorded == nullptr) { + DispatchWork(); + recorded = chunk->Record(command); + } + recorded_attachments = &recorded->attachments; num_renderpass_images = framebuffer->NumImages(); renderpass_images = framebuffer->Images(); renderpass_image_ranges = framebuffer->ImageRanges(); @@ -161,7 +178,9 @@ void Scheduler::RealizeDeferredClear() { } EndRenderPass(); BeginRenderPassImpl(dc.framebuffer, attachments); - renderpass_depth_writes = dc.depth_stencil; + if (dc.depth_stencil) { + attachments_written |= DEPTH_ATTACHMENT_BIT | STENCIL_ATTACHMENT_BIT; + } } bool Scheduler::DeferColorClear(const Framebuffer* framebuffer, u32 rt_slot, @@ -201,17 +220,16 @@ void Scheduler::FlushDeferredClear() { EndRenderPass(); } -void Scheduler::RequestRenderpass(const Framebuffer* framebuffer) { +void Scheduler::RequestRenderpass(const Framebuffer* framebuffer, u32 touched, u32 written) { if (deferred_clear.framebuffer == framebuffer) { RealizeDeferredClear(); - return; + } else if (framebuffer->Id() != state.framebuffer_id) { + // Ends any active pass and realizes a deferred clear + EndRenderPass(); + BeginRenderPassImpl(framebuffer, framebuffer->Attachments()); } - if (framebuffer->Id() == state.framebuffer_id) { - return; - } - // Ends any active pass and realizes a deferred clear - EndRenderPass(); - BeginRenderPassImpl(framebuffer, framebuffer->Attachments()); + attachments_touched |= touched; + attachments_written |= written; } void Scheduler::RequestOutsideRenderPassOperationContext() { @@ -224,6 +242,28 @@ void Scheduler::RequestComputeDispatchContext() { compute_writes = true; } +void Scheduler::RelaxAttachmentOps(RenderingAttachments& attachments) const { + const bool load_op_none = device.IsLoadOpNoneSupported(); + const auto relax = [&](VkRenderingAttachmentInfo& attachment, u32 bit) { + if (attachment.imageView == VK_NULL_HANDLE || + attachment.resolveMode != VK_RESOLVE_MODE_NONE || + attachment.loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR || + attachment.storeOp != VK_ATTACHMENT_STORE_OP_STORE || + (attachments_written & bit) != 0) { + return; + } + attachment.storeOp = VK_ATTACHMENT_STORE_OP_NONE; + if (load_op_none && (attachments_touched & bit) == 0) { + attachment.loadOp = VK_ATTACHMENT_LOAD_OP_NONE; + } + }; + for (u32 slot = 0; slot < attachments.num_colors; ++slot) { + relax(attachments.colors[slot], 1u << slot); + } + relax(attachments.depth, DEPTH_ATTACHMENT_BIT); + relax(attachments.stencil, STENCIL_ATTACHMENT_BIT); +} + void Scheduler::PublishComputeWrites() { if (!std::exchange(compute_writes, false)) { return; @@ -406,6 +446,10 @@ void Scheduler::EndRenderPass() if (state.framebuffer_id == 0) { return; } + if (recorded_attachments != nullptr) { + RelaxAttachmentOps(*recorded_attachments); + recorded_attachments = nullptr; + } query_cache->CounterClose(VideoCommon::QueryType::StreamingByteCount); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index e4fa647132..a4bd593f40 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -42,6 +42,10 @@ struct RenderingAttachments; /// OpenGL-like operations on Vulkan command buffers. class Scheduler { public: + static constexpr u32 DEPTH_ATTACHMENT_BIT = 1u << 8; + static constexpr u32 STENCIL_ATTACHMENT_BIT = 1u << 9; + static constexpr u32 ALL_ATTACHMENTS = 0x3FF; + explicit Scheduler(const Device& device, StateTracker& state_tracker); ~Scheduler(); @@ -59,7 +63,8 @@ public: void DispatchWork(); /// Requests to begin a renderpass. - void RequestRenderpass(const Framebuffer* framebuffer); + void RequestRenderpass(const Framebuffer* framebuffer, u32 touched = ALL_ATTACHMENTS, + u32 written = ALL_ATTACHMENTS); /// Defers a full-attachment color clear so it becomes the next render pass. bool DeferColorClear(const Framebuffer* framebuffer, u32 rt_slot, const VkClearValue& value); @@ -100,12 +105,8 @@ public: renderpass_writes = true; } - void MarkDepthWrites(bool writes) noexcept { - renderpass_depth_writes |= writes; - } - bool HasDepthWrites() const noexcept { - return renderpass_depth_writes; + return (attachments_written & DEPTH_ATTACHMENT_BIT) != 0; } /// Update the pipeline to the current execution context. @@ -235,6 +236,10 @@ private: command(cmdbuf, upload_cmdbuf); } + T& Get() noexcept { + return command; + } + private: T command; }; @@ -244,16 +249,18 @@ private: void ExecuteAll(vk::CommandBuffer cmdbuf, vk::CommandBuffer upload_cmdbuf); template - bool Record(T& command) { + T* Record(T& command) { using FuncType = TypedCommand; static_assert(sizeof(FuncType) < sizeof(data), "Lambda is too large"); command_offset = Common::AlignUp(command_offset, alignof(FuncType)); if (command_offset > sizeof(data) - sizeof(FuncType)) { - return false; + return nullptr; } Command* const current_last = last; - last = new (data.data() + command_offset) FuncType(std::move(command)); + FuncType* const recorded = + new (data.data() + command_offset) FuncType(std::move(command)); + last = recorded; if (current_last) { current_last->SetNext(last); @@ -261,7 +268,7 @@ private: first = last; } command_offset += sizeof(FuncType); - return true; + return &recorded->Get(); } void MarkSubmit() { @@ -322,6 +329,8 @@ private: void PublishComputeWrites(); + void RelaxAttachmentOps(RenderingAttachments& attachments) const; + void AcquireNewChunk(); const Device& device; @@ -345,8 +354,10 @@ private: u64 renderpass_serial = 0; u64 wfi_serial = 0; bool renderpass_writes = false; - bool renderpass_depth_writes = false; bool compute_writes = false; + u32 attachments_touched = 0; + u32 attachments_written = 0; + RenderingAttachments* recorded_attachments = nullptr; VkMemoryBarrier2 renderpass_write_barrier{}; VkMemoryBarrier2 compute_write_barrier{}; VkMemoryBarrier2 upload_write_barrier{}; diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index a23f9b6334..69f21a6f50 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -106,6 +106,8 @@ VK_DEFINE_HANDLE(VmaAllocator) EXTENSION(KHR, SWAPCHAIN, swapchain) \ EXTENSION(KHR, SWAPCHAIN_MUTABLE_FORMAT, swapchain_mutable_format) \ EXTENSION(KHR, IMAGE_FORMAT_LIST, image_format_list) \ + EXTENSION(KHR, LOAD_STORE_OP_NONE, load_store_op_none) \ + EXTENSION(EXT, LOAD_STORE_OP_NONE, load_store_op_none_ext) \ EXTENSION(NV, DEVICE_DIAGNOSTICS_CONFIG, device_diagnostics_config) \ EXTENSION(NV, GEOMETRY_SHADER_PASSTHROUGH, geometry_shader_passthrough) \ EXTENSION(NV, VIEWPORT_ARRAY2, viewport_array2) \ @@ -669,6 +671,10 @@ FN_MAX_LIMIT_LIST } /// Returns true if the device supports VK_EXT_depth_bias_control. + bool IsLoadOpNoneSupported() const { + return extensions.load_store_op_none || extensions.load_store_op_none_ext; + } + bool IsExtDepthBiasControlSupported() const { return extensions.depth_bias_control; } From f6cd6128fff6b42a504ac5a1376041720c3ba5af Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 18:28:32 -0400 Subject: [PATCH 113/198] Experiment on tfb draws again --- src/video_core/buffer_cache/buffer_base.h | 13 +++++++++---- src/video_core/buffer_cache/buffer_cache.h | 17 ++++++++++------- src/video_core/buffer_cache/buffer_cache_base.h | 7 +++++-- .../renderer_vulkan/vk_graphics_pipeline.cpp | 4 ---- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h index b8d0d1896f..cdfb235ef0 100644 --- a/src/video_core/buffer_cache/buffer_base.h +++ b/src/video_core/buffer_cache/buffer_base.h @@ -137,18 +137,22 @@ public: content_serial = ++next_content_serial; } - [[nodiscard]] bool HasDrawHazard(u64 pass, u64 wfi, DAddr addr, u64 size) const noexcept { - return draw_write_pass == pass && draw_write_wfi < wfi && addr < draw_write_end && - addr + size > draw_write_begin; + [[nodiscard]] bool HasDrawHazard(u64 pass, u64 wfi, DAddr addr, u64 size, + bool check_feedback) const noexcept { + return draw_write_pass == pass && + (draw_write_wfi < wfi || (check_feedback && draw_write_feedback)) && + addr < draw_write_end && addr + size > draw_write_begin; } - void MarkDrawWrite(u64 pass, u64 wfi, DAddr addr, u64 size) noexcept { + void MarkDrawWrite(u64 pass, u64 wfi, DAddr addr, u64 size, bool feedback) noexcept { if (draw_write_pass != pass) { draw_write_pass = pass; draw_write_begin = addr; draw_write_end = addr + size; + draw_write_feedback = false; } draw_write_wfi = wfi; + draw_write_feedback |= feedback; draw_write_begin = (std::min)(draw_write_begin, addr); draw_write_end = (std::max)(draw_write_end, addr + size); } @@ -167,6 +171,7 @@ private: u64 draw_write_wfi = 0; DAddr draw_write_begin = 0; DAddr draw_write_end = 0; + bool draw_write_feedback = false; }; } // namespace VideoCommon diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 95610c7c14..087d7ac1f8 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -395,7 +395,7 @@ void BufferCache

::CommitDrawWrites() { const u64 pass = runtime.RenderPassSerial(); for (const DrawWrite& write : draw_writes) { slot_buffers[write.buffer_id].MarkDrawWrite(pass, draw_wfi, write.device_addr, - write.size); + write.size, write.feedback); } runtime.MarkRenderPassWrites(); } @@ -1202,8 +1202,8 @@ void BufferCache

::BindHostTransformFeedbackBuffers() { Buffer& buffer = slot_buffers[binding.buffer_id]; TouchBuffer(buffer, binding.buffer_id); size = binding.size; - SynchronizeBuffer(buffer, binding.device_addr, size); - MarkWrittenBuffer(binding.buffer_id, binding.device_addr, size); + SynchronizeBuffer(buffer, binding.device_addr, size, false); + MarkWrittenBuffer(binding.buffer_id, binding.device_addr, size, true); offset = buffer.Offset(binding.device_addr); buffer.MarkUsage(offset, size); host_buffer = &buffer; @@ -1573,13 +1573,14 @@ void BufferCache

::UpdateComputeTextureBuffers() { } template -void BufferCache

::MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u32 size) { +void BufferCache

::MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u32 size, + bool feedback) { if constexpr (!IS_OPENGL) { Buffer& buffer = slot_buffers[buffer_id]; buffer.setWriteTick(runtime.CurrentTick()); buffer.MarkContentModified(); if (recording_draw) { - draw_writes.push_back({buffer_id, device_addr, size}); + draw_writes.push_back({buffer_id, device_addr, size, feedback}); } } memory_tracker.MarkRegionAsGpuModified(device_addr, size); @@ -1800,9 +1801,11 @@ void BufferCache

::TouchBuffer(Buffer& buffer, BufferId buffer_id) noexcept { } template -bool BufferCache

::SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 size) { +bool BufferCache

::SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 size, + bool check_feedback) { if constexpr (!IS_OPENGL) { - draw_hazard |= buffer.HasDrawHazard(draw_pass, draw_wfi, device_addr, size); + draw_hazard |= + buffer.HasDrawHazard(draw_pass, draw_wfi, device_addr, size, check_feedback); } upload_copies.clear(); u64 total_size_bytes = 0; diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 6730291831..d1f9ff5f97 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -443,7 +443,8 @@ private: void UpdateComputeTextureBuffers(); - void MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u32 size); + void MarkWrittenBuffer(BufferId buffer_id, DAddr device_addr, u32 size, + bool feedback = false); [[nodiscard]] BufferId FindBuffer(DAddr device_addr, u32 size, bool sparse_compatible); @@ -465,7 +466,8 @@ private: void TouchBuffer(Buffer& buffer, BufferId buffer_id) noexcept; - bool SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 size); + bool SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 size, + bool check_feedback = true); void UploadMemory(Buffer& buffer, u64 total_size_bytes, u64 largest_copy, std::span copies); @@ -528,6 +530,7 @@ private: BufferId buffer_id; DAddr device_addr; u32 size; + bool feedback; }; boost::container::small_vector draw_writes; u64 draw_pass = 0; diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 792e7d2e7c..d0be8fbded 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -532,10 +532,6 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { bind_stage_info(4); } - if (regs.transform_feedback_enabled != 0) { - scheduler.RequestOutsideRenderPassOperationContext(); - } - buffer_cache.UpdateGraphicsBuffers(is_indexed); buffer_cache.BindHostGeometryBuffers(is_indexed); From 4ce91d18b8afc324fa50d137abe9a22a493b5d84 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 18:50:48 -0400 Subject: [PATCH 114/198] Avoid constant calls to fixed pipelines --- .../renderer_vulkan/fixed_pipeline_state.cpp | 77 ++++++++++++------- .../renderer_vulkan/fixed_pipeline_state.h | 9 +-- .../renderer_vulkan/vk_graphics_pipeline.cpp | 4 +- .../renderer_vulkan/vk_pipeline_cache.cpp | 2 +- 4 files changed, 53 insertions(+), 39 deletions(-) diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index 0ced890929..82f2fad005 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp @@ -119,11 +119,14 @@ void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFe xfb_enabled.Assign(regs.transform_feedback_enabled != 0); ndc_minus_one_to_one.Assign(regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1 : 0); polygon_mode.Assign(PackPolygonMode(regs.polygon_mode_front)); - tessellation_primitive.Assign(static_cast(regs.tessellation.params.domain_type.Value())); - tessellation_spacing.Assign(static_cast(regs.tessellation.params.spacing.Value())); - tessellation_clockwise.Assign(regs.tessellation.params.output_primitives.Value() == - Maxwell::Tessellation::OutputPrimitives::Triangles_CW); - patch_control_points_minus_one.Assign(regs.patch_vertices - 1); + if (topology_ == Maxwell::PrimitiveTopology::Patches) { + tessellation_primitive.Assign( + static_cast(regs.tessellation.params.domain_type.Value())); + tessellation_spacing.Assign(static_cast(regs.tessellation.params.spacing.Value())); + tessellation_clockwise.Assign(regs.tessellation.params.output_primitives.Value() == + Maxwell::Tessellation::OutputPrimitives::Triangles_CW); + patch_control_points_minus_one.Assign(regs.patch_vertices - 1); + } const bool can_collapse_topology_class = features.has_extended_dynamic_state && features.has_extended_dynamic_state_2; topology.Assign(can_collapse_topology_class @@ -168,19 +171,26 @@ void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFe smooth_lines.Assign(regs.line_anti_alias_enable != 0 ? 1 : 0); alpha_to_coverage_enabled.Assign(regs.anti_alias_alpha_control.alpha_to_coverage != 0 ? 1 : 0); alpha_to_one_enabled.Assign(regs.anti_alias_alpha_control.alpha_to_one != 0 ? 1 : 0); - app_stage.Assign(maxwell3d.engine_state); - depth_bounds_min = static_cast(regs.depth_bounds[0]); - depth_bounds_max = static_cast(regs.depth_bounds[1]); - - line_stipple_factor = regs.line_stipple_params.factor; - line_stipple_pattern = regs.line_stipple_params.pattern; + line_stipple_factor = 0; + line_stipple_pattern = 0; + if (regs.line_stipple_enable || features.has_dynamic_state3_line_stipple_enable) { + line_stipple_factor = regs.line_stipple_params.factor; + line_stipple_pattern = regs.line_stipple_params.pattern; + } for (size_t i = 0; i < regs.rt.size(); ++i) { color_formats[i] = static_cast(regs.rt[i].format); } - alpha_test_ref = std::bit_cast(regs.alpha_test_ref); - point_size = std::bit_cast(regs.point_size); + alpha_test_ref = 0; + if (regs.alpha_test_enabled != 0) { + alpha_test_ref = std::bit_cast(regs.alpha_test_ref); + } + point_size = 0; + if (topology_ == Maxwell::PrimitiveTopology::Points || + regs.IsShaderConfigEnabled(Maxwell::ShaderType::Geometry)) { + point_size = std::bit_cast(regs.point_size); + } if (maxwell3d.dirty.flags[Dirty::VertexInput]) { if (features.has_dynamic_vertex_input) { @@ -314,28 +324,34 @@ void FixedPipelineState::DynamicState::Refresh(const Maxwell& regs) { packed_front_face = 1 - packed_front_face; } - front.action_stencil_fail.Assign(PackStencilOp(regs.stencil_front_op.fail)); - front.action_depth_fail.Assign(PackStencilOp(regs.stencil_front_op.zfail)); - front.action_depth_pass.Assign(PackStencilOp(regs.stencil_front_op.zpass)); - front.test_func.Assign(PackComparisonOp(regs.stencil_front_op.func)); - if (regs.stencil_two_side_enable) { - back.action_stencil_fail.Assign(PackStencilOp(regs.stencil_back_op.fail)); - back.action_depth_fail.Assign(PackStencilOp(regs.stencil_back_op.zfail)); - back.action_depth_pass.Assign(PackStencilOp(regs.stencil_back_op.zpass)); - back.test_func.Assign(PackComparisonOp(regs.stencil_back_op.func)); - } else { - back.action_stencil_fail.Assign(front.action_stencil_fail); - back.action_depth_fail.Assign(front.action_depth_fail); - back.action_depth_pass.Assign(front.action_depth_pass); - back.test_func.Assign(front.test_func); + if (regs.stencil_enable) { + front.action_stencil_fail.Assign(PackStencilOp(regs.stencil_front_op.fail)); + front.action_depth_fail.Assign(PackStencilOp(regs.stencil_front_op.zfail)); + front.action_depth_pass.Assign(PackStencilOp(regs.stencil_front_op.zpass)); + front.test_func.Assign(PackComparisonOp(regs.stencil_front_op.func)); + if (regs.stencil_two_side_enable) { + back.action_stencil_fail.Assign(PackStencilOp(regs.stencil_back_op.fail)); + back.action_depth_fail.Assign(PackStencilOp(regs.stencil_back_op.zfail)); + back.action_depth_pass.Assign(PackStencilOp(regs.stencil_back_op.zpass)); + back.test_func.Assign(PackComparisonOp(regs.stencil_back_op.func)); + } else { + back.action_stencil_fail.Assign(front.action_stencil_fail); + back.action_depth_fail.Assign(front.action_depth_fail); + back.action_depth_pass.Assign(front.action_depth_pass); + back.test_func.Assign(front.test_func); + } } stencil_enable.Assign(regs.stencil_enable); depth_write_enable.Assign(regs.depth_write_enabled); depth_bounds_enable.Assign(regs.depth_bounds_enable); depth_test_enable.Assign(regs.depth_test_enable); front_face.Assign(packed_front_face); - depth_test_func.Assign(PackComparisonOp(regs.depth_test_func)); - cull_face.Assign(PackCullFace(regs.gl_cull_face)); + if (regs.depth_test_enable) { + depth_test_func.Assign(PackComparisonOp(regs.depth_test_func)); + } + if (regs.gl_cull_test_enabled) { + cull_face.Assign(PackCullFace(regs.gl_cull_face)); + } cull_enable.Assign(regs.gl_cull_test_enabled != 0 ? 1 : 0); } @@ -364,6 +380,9 @@ void FixedPipelineState::DynamicState::Refresh3(const Maxwell& regs, const DynamicFeatures& features) { if (!features.has_dynamic_state3_logic_op_enable) { logic_op_enable.Assign(regs.logic_op.enable != 0 ? 1 : 0); + if (!regs.logic_op.enable) { + logic_op.Assign(0); + } } if (!features.has_dynamic_state3_depth_clamp_enable) { depth_clamp_disabled.Assign(regs.viewport_clip_control.geometry_clip == diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.h b/src/video_core/renderer_vulkan/fixed_pipeline_state.h index 36a4b4b7a2..3f10c8f2e5 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.h +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.h @@ -230,7 +230,6 @@ struct FixedPipelineState { BitField<14, 1, u32> smooth_lines; BitField<15, 1, u32> alpha_to_coverage_enabled; BitField<16, 1, u32> alpha_to_one_enabled; - BitField<17, 3, Tegra::Engines::Maxwell3D::EngineHint> app_stage; }; std::array color_formats; @@ -238,6 +237,8 @@ struct FixedPipelineState { u32 driver_version; u32 alpha_test_ref; u32 point_size; + u32 line_stipple_factor; + u32 line_stipple_pattern; std::array viewport_swizzles; union { @@ -254,12 +255,6 @@ struct FixedPipelineState { VideoCommon::TransformFeedbackState xfb_state; - u32 depth_bounds_min; - u32 depth_bounds_max; - - u32 line_stipple_factor; - u32 line_stipple_pattern; - void Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFeatures& features); size_t Hash() const noexcept; diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index d0be8fbded..f80a679bee 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -929,8 +929,8 @@ void GraphicsPipeline::MakePipeline(const RenderingFormats& formats) { .stencilTestEnable = dynamic.stencil_enable, .front = GetStencilFaceState(dynamic.front), .back = GetStencilFaceState(dynamic.back), - .minDepthBounds = f32(key.state.depth_bounds_min), - .maxDepthBounds = f32(key.state.depth_bounds_max), + .minDepthBounds = 0.0f, + .maxDepthBounds = 1.0f, }; if (dynamic.depth_bounds_enable && !device.IsDepthBoundsSupported()) { LOG_WARNING(Render_Vulkan, "Depth bounds is enabled but not supported"); diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index ce661670d5..14428c20c2 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -62,7 +62,7 @@ using VideoCommon::FileEnvironment; using VideoCommon::GenericEnvironment; using VideoCommon::GraphicsEnvironment; -constexpr u32 CACHE_VERSION = 18; +constexpr u32 CACHE_VERSION = 19; constexpr size_t VULKAN_CACHE_FLUSH_PIPELINES = 128; constexpr size_t VULKAN_CACHE_FLUSH_MIN_SECONDS = 30; constexpr std::array VULKAN_CACHE_MAGIC_NUMBER{'y', 'u', 'z', 'u', 'v', 'k', 'c', 'h'}; From d8fc94093d1cadccae0a15fcb788c61bb3174cbe Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 21:14:21 -0400 Subject: [PATCH 115/198] More work on GS --- .../frontend/maxwell/translate_program.cpp | 109 ++++++++++++++++-- src/shader_recompiler/host_translate_info.h | 1 + .../renderer_vulkan/vk_pipeline_cache.cpp | 1 + 3 files changed, 104 insertions(+), 7 deletions(-) diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp index e7d7e5a6b3..a7b0ad4cba 100644 --- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp @@ -5,7 +5,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include +#include #include +#include #include #include @@ -172,7 +175,17 @@ std::map GenerateLegacyToGenericMappings( void EmitGeometryPassthrough(IR::IREmitter& ir, const IR::Program& program, const Shader::VaryingState& passthrough_mask, bool passthrough_position, - std::optional passthrough_layer_attr) { + std::optional passthrough_layer_attr, + std::optional viewport_mask_reg) { + constexpr std::array CULLED_POSITION{2.0f, 2.0f, 2.0f, 1.0f}; + IR::U1 culled{ir.Imm1(false)}; + IR::U32 viewport{ir.Imm32(0)}; + if (viewport_mask_reg) { + const IR::U32 mask{ir.GetReg(*viewport_mask_reg)}; + const IR::U32 lowest_bit{ir.BitwiseAnd(mask, IR::U32{ir.INeg(mask)})}; + culled = ir.IEqual(mask, ir.Imm32(0)); + viewport = IR::U32{ir.Select(culled, ir.Imm32(0), ir.FindUMsb(lowest_bit))}; + } for (u32 i = 0; i < program.output_vertices; i++) { // Assign generics from input for (u32 j = 0; j < 32; j++) { @@ -190,10 +203,19 @@ void EmitGeometryPassthrough(IR::IREmitter& ir, const IR::Program& program, if (passthrough_position) { // Assign position from input const IR::Attribute attr = IR::Attribute::PositionX; - ir.SetAttribute(attr + 0, ir.GetAttribute(attr + 0, ir.Imm32(i)), ir.Imm32(0)); - ir.SetAttribute(attr + 1, ir.GetAttribute(attr + 1, ir.Imm32(i)), ir.Imm32(0)); - ir.SetAttribute(attr + 2, ir.GetAttribute(attr + 2, ir.Imm32(i)), ir.Imm32(0)); - ir.SetAttribute(attr + 3, ir.GetAttribute(attr + 3, ir.Imm32(i)), ir.Imm32(0)); + for (u32 component = 0; component < 4; ++component) { + IR::F32 value{ir.GetAttribute(attr + component, ir.Imm32(i))}; + if (viewport_mask_reg) { + value = IR::F32{ + ir.Select(culled, ir.Imm32(CULLED_POSITION[component]), value)}; + } + ir.SetAttribute(attr + component, value, ir.Imm32(0)); + } + } + + if (viewport_mask_reg) { + ir.SetAttribute(IR::Attribute::ViewportIndex, ir.BitCast(viewport), + ir.Imm32(0)); } if (passthrough_layer_attr) { @@ -219,19 +241,91 @@ u32 GetOutputTopologyVertices(OutputTopology output_topology) { } } +std::optional FindFreeRegister(const IR::Program& program) { + std::bitset used; + for (IR::Block* const block : program.blocks) { + for (const IR::Inst& inst : block->Instructions()) { + const IR::Opcode opcode{inst.GetOpcode()}; + if (opcode == IR::Opcode::GetRegister || opcode == IR::Opcode::SetRegister) { + used.set(IR::RegIndex(inst.Arg(0).Reg())); + } + } + } + for (size_t index = IR::NUM_USER_REGS; index-- > 0;) { + if (!used.test(index)) { + return static_cast(index); + } + } + return std::nullopt; +} + +std::optional LowerViewportMask(const IR::Program& program) { + const std::optional reg{FindFreeRegister(program)}; + if (!reg || program.blocks.empty()) { + return std::nullopt; + } + bool stores_mask{}; + for (IR::Block* const block : program.blocks) { + for (IR::Inst& inst : block->Instructions()) { + if (inst.GetOpcode() != IR::Opcode::SetAttribute || + inst.Arg(0).Attribute() != IR::Attribute::ViewportMask) { + continue; + } + IR::IREmitter ir{*block, IR::Block::InstructionList::s_iterator_to(inst)}; + ir.SetReg(*reg, ir.BitCast(IR::F32{inst.Arg(1)})); + inst.Invalidate(); + stores_mask = true; + } + } + if (!stores_mask) { + return std::nullopt; + } + IR::Block& entry{*program.blocks.front()}; + IR::IREmitter ir{entry, entry.begin()}; + ir.SetReg(*reg, ir.Imm32(1)); + return reg; +} + void LowerGeometryPassthrough(const IR::Program& program, const HostTranslateInfo& host_info) { + std::optional viewport_mask_reg; + if (!host_info.support_viewport_mask) { + viewport_mask_reg = LowerViewportMask(program); + } for (IR::Block* const block : program.blocks) { for (IR::Inst& inst : block->Instructions()) { if (inst.GetOpcode() == IR::Opcode::Epilogue) { IR::IREmitter ir{*block, IR::Block::InstructionList::s_iterator_to(inst)}; EmitGeometryPassthrough( ir, program, program.info.passthrough, - program.info.passthrough.AnyComponent(IR::Attribute::PositionX), {}); + program.info.passthrough.AnyComponent(IR::Attribute::PositionX), {}, + viewport_mask_reg); } } } } +void TightenOutputVertices(IR::Program& program) { + if (program.stage != Stage::Geometry || program.is_geometry_passthrough) { + return; + } + const bool has_loops = std::ranges::any_of(program.syntax_list, [](const auto& node) { + return node.type == IR::AbstractSyntaxNode::Type::Loop; + }); + if (has_loops) { + return; + } + u32 num_emits = 0; + for (IR::Block* const block : program.blocks) { + for (const IR::Inst& inst : block->Instructions()) { + if (inst.GetOpcode() == IR::Opcode::EmitVertex) { + ++num_emits; + } + } + } + if (num_emits != 0) { + program.output_vertices = (std::min)(program.output_vertices, num_emits); + } +} } // Anonymous namespace IR::Program TranslateProgram(ObjectPool& inst_pool, ObjectPool& block_pool, @@ -306,6 +400,7 @@ IR::Program TranslateProgram(ObjectPool& inst_pool, ObjectPool& inst_pool, IR::IREmitter ir{*current_block}; EmitGeometryPassthrough(ir, program, program.info.stores, true, - source_program.info.emulated_layer); + source_program.info.emulated_layer, std::nullopt); IR::Block* return_block{block_pool.Create(inst_pool)}; IR::IREmitter{*return_block}.Epilogue(); diff --git a/src/shader_recompiler/host_translate_info.h b/src/shader_recompiler/host_translate_info.h index 0128ee07eb..44df85ccb2 100644 --- a/src/shader_recompiler/host_translate_info.h +++ b/src/shader_recompiler/host_translate_info.h @@ -34,6 +34,7 @@ struct HostTranslateInfo { bool needs_demote_reorder{}; ///< True when the device needs DemoteToHelperInvocation reordered bool support_snorm_render_buffer{}; ///< True when the device supports SNORM render buffers bool support_viewport_index_layer{}; ///< True when the device supports gl_Layer in VS + bool support_viewport_mask{}; bool support_geometry_shader_passthrough{}; ///< True when the device supports geometry ///< passthrough shaders bool support_conditional_barrier{}; ///< True when the device supports barriers in conditional diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 14428c20c2..4f42474a05 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -485,6 +485,7 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, driver_id == VK_DRIVER_ID_SAMSUNG_PROPRIETARY, .support_snorm_render_buffer = true, .support_viewport_index_layer = device.IsExtShaderViewportIndexLayerSupported(), + .support_viewport_mask = device.IsNvViewportArray2Supported(), .support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(), .support_conditional_barrier = device.SupportsConditionalBarriers(), .single_lane_geometry_subgroups = !profile.SupportsSubgroupStage(Shader::Stage::Geometry), From 7d61946b7ce50c0ee8fc8b35a9f62b11044e3ee2 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 21:33:17 -0400 Subject: [PATCH 116/198] Tfb fix x62132321 --- src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index f80a679bee..0a8a2af973 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -532,6 +532,10 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { bind_stage_info(4); } + if (regs.transform_feedback_enabled != 0) { + scheduler.RequestOutsideRenderPassOperationContext(); + } + buffer_cache.UpdateGraphicsBuffers(is_indexed); buffer_cache.BindHostGeometryBuffers(is_indexed); From b8d9f44421e9638fc3b7a56d7fcdf41b58debc55 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 21:38:39 -0400 Subject: [PATCH 117/198] Another change on GS --- src/shader_recompiler/frontend/maxwell/translate_program.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp index a7b0ad4cba..a8517266c0 100644 --- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp @@ -242,7 +242,7 @@ u32 GetOutputTopologyVertices(OutputTopology output_topology) { } std::optional FindFreeRegister(const IR::Program& program) { - std::bitset used; + std::bitset used; for (IR::Block* const block : program.blocks) { for (const IR::Inst& inst : block->Instructions()) { const IR::Opcode opcode{inst.GetOpcode()}; From dfe0b7e7c7b21d7192a66be4506bdc7cad716c14 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 26 Sep 2026 23:23:38 -0400 Subject: [PATCH 118/198] A quick test on global memory cbuf tracker --- .../backend/glasm/emit_glasm_memory.cpp | 14 ++++++---- .../backend/glsl/glsl_emit_context.cpp | 2 +- .../backend/spirv/spirv_emit_context.cpp | 27 ++++++++++++------- .../frontend/maxwell/translate_program.cpp | 6 ++++- .../global_memory_to_storage_buffer_pass.cpp | 1 + src/shader_recompiler/shader_info.h | 1 + 6 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp index 9319ea007f..ee39ec2a47 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -32,10 +35,10 @@ void GlobalStorageOp(EmitContext& ctx, Register address, bool pointer_based, std std::string_view else_expr = {}) { const size_t num_buffers{ctx.info.storage_buffers_descriptors.size()}; for (size_t index = 0; index < num_buffers; ++index) { - if (!ctx.info.nvn_buffer_used[index]) { + const auto& ssbo{ctx.info.storage_buffers_descriptors[index]}; + if (!ssbo.is_global_fallback) { continue; } - const auto& ssbo{ctx.info.storage_buffers_descriptors[index]}; const u64 ssbo_align_mask{~(ctx.profile.min_ssbo_alignment - 1U)}; ctx.Add("LDC.U64 DC.x,c{}[{}];" // unaligned_ssbo_addr "AND.U64 DC.x,DC.x,{};" // ssbo_addr = unaligned_ssbo_addr & ssbo_align_mask @@ -65,9 +68,10 @@ void GlobalStorageOp(EmitContext& ctx, Register address, bool pointer_based, std if (!else_expr.empty()) { ctx.Add("{}", else_expr); } - const size_t num_used_buffers{ctx.info.nvn_buffer_used.count()}; - for (size_t index = 0; index < num_used_buffers; ++index) { - ctx.Add("ENDIF;"); + for (const auto& ssbo : ctx.info.storage_buffers_descriptors) { + if (ssbo.is_global_fallback) { + ctx.Add("ENDIF;"); + } } } diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index a2df6159fb..4f4d420bd7 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp @@ -633,7 +633,7 @@ std::string EmitContext::DefineGlobalMemoryFunctions() { std::string load_func_128{"uvec4 LoadGlobal128(uint64_t addr){"}; const size_t num_buffers{info.storage_buffers_descriptors.size()}; for (size_t index = 0; index < num_buffers; ++index) { - if (!info.nvn_buffer_used[index]) { + if (!info.storage_buffers_descriptors[index].is_global_fallback) { continue; } define_body(write_func, index, "{0}[uint(addr-{1})>>2]=data;return;}}"); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index b562e82983..c5471a6f71 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -948,12 +948,16 @@ void EmitContext::DefineGlobalMemoryFunctions(const Info& info) { const auto define_body{[&](DefPtr ssbo_member, Id addr, Id element_pointer, u32 shift, auto&& callback) { AddLabel(); + const Id addr_words{OpBitcast(U32[2], addr)}; + const Id addr_low{OpCompositeExtract(U32[1], addr_words, 0U)}; + const Id addr_high{OpCompositeExtract(U32[1], addr_words, 1U)}; + const Id align_mask{Const(~(static_cast(profile.min_ssbo_alignment) - 1U))}; const size_t num_buffers{info.storage_buffers_descriptors.size()}; for (size_t index = 0; index < num_buffers; ++index) { - if (!info.nvn_buffer_used[index]) { + const auto& ssbo{info.storage_buffers_descriptors[index]}; + if (!ssbo.is_global_fallback) { continue; } - const auto& ssbo{info.storage_buffers_descriptors[index]}; const Id ssbo_addr_cbuf_offset{Const(ssbo.cbuf_offset / 8)}; const Id ssbo_size_cbuf_offset{Const(ssbo.cbuf_offset / 4 + 2)}; const Id ssbo_addr_pointer{OpAccessChain( @@ -961,20 +965,23 @@ void EmitContext::DefineGlobalMemoryFunctions(const Info& info) { const Id ssbo_size_pointer{OpAccessChain(uniform_types.U32, cbufs[ssbo.cbuf_index].U32, zero, ssbo_size_cbuf_offset)}; - const u64 ssbo_align_mask{~(profile.min_ssbo_alignment - 1U)}; - const Id unaligned_addr{OpBitcast(U64, OpLoad(U32[2], ssbo_addr_pointer))}; - const Id ssbo_addr{OpBitwiseAnd(U64, unaligned_addr, Constant(U64, ssbo_align_mask))}; - const Id ssbo_size{OpUConvert(U64, OpLoad(U32[1], ssbo_size_pointer))}; - const Id ssbo_end{OpIAdd(U64, ssbo_addr, ssbo_size)}; - const Id cond{OpLogicalAnd(U1, OpUGreaterThanEqual(U1, addr, ssbo_addr), - OpULessThan(U1, addr, ssbo_end))}; + const Id ssbo_addr{OpLoad(U32[2], ssbo_addr_pointer)}; + const Id ssbo_low{ + OpBitwiseAnd(U32[1], OpCompositeExtract(U32[1], ssbo_addr, 0U), align_mask)}; + const Id ssbo_high{OpCompositeExtract(U32[1], ssbo_addr, 1U)}; + const Id ssbo_size{OpLoad(U32[1], ssbo_size_pointer)}; + const Id ssbo_offset{OpISub(U32[1], addr_low, ssbo_low)}; + const Id borrow{ + OpSelect(U32[1], OpULessThan(U1, addr_low, ssbo_low), Const(1U), zero)}; + const Id cond{ + OpLogicalAnd(U1, OpULessThan(U1, ssbo_offset, ssbo_size), + OpIEqual(U1, OpISub(U32[1], addr_high, borrow), ssbo_high))}; const Id then_label{OpLabel()}; const Id else_label{OpLabel()}; OpSelectionMerge(else_label, spv::SelectionControlMask::MaskNone); OpBranchConditional(cond, then_label, else_label); AddLabel(then_label); const Id ssbo_id{ssbos[index].*ssbo_member}; - const Id ssbo_offset{OpUConvert(U32[1], OpISub(U64, addr, ssbo_addr))}; const Id ssbo_index{OpShiftRightLogical(U32[1], ssbo_offset, Const(shift))}; const Id ssbo_pointer{OpAccessChain(element_pointer, ssbo_id, zero, ssbo_index)}; callback(ssbo_pointer); diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp index a8517266c0..d1d45d6b33 100644 --- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp @@ -121,9 +121,12 @@ void AddNVNStorageBuffers(IR::Program& program) { continue; } const u32 offset{base + index * descriptor_size}; - const auto it{std::ranges::find(descs, offset, &StorageBufferDescriptor::cbuf_offset)}; + const auto it{std::ranges::find_if(descs, [&](const StorageBufferDescriptor& desc) { + return desc.cbuf_index == driver_cbuf && desc.cbuf_offset == offset; + })}; if (it != descs.end()) { it->is_written |= program.info.stores_global_memory; + it->is_global_fallback = true; continue; } descs.push_back({ @@ -131,6 +134,7 @@ void AddNVNStorageBuffers(IR::Program& program) { .cbuf_offset = offset, .count = 1, .is_written = program.info.stores_global_memory, + .is_global_fallback = true, }); } } diff --git a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp index f49d54e7ab..ba05295fab 100644 --- a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp +++ b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp @@ -562,6 +562,7 @@ void JoinStorageInfo(Info& base, Info& source) { })}; if (it != descriptors.end()) { it->is_written |= desc.is_written; + it->is_global_fallback |= desc.is_global_fallback; continue; } descriptors.push_back(desc); diff --git a/src/shader_recompiler/shader_info.h b/src/shader_recompiler/shader_info.h index 71309e040e..b8d760a30e 100644 --- a/src/shader_recompiler/shader_info.h +++ b/src/shader_recompiler/shader_info.h @@ -172,6 +172,7 @@ struct StorageBufferDescriptor { u32 cbuf_offset; u32 count; bool is_written; + bool is_global_fallback{}; auto operator<=>(const StorageBufferDescriptor&) const = default; }; From 14b6160fcd00c7d98a375907b9b03912f3accad6 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sun, 27 Sep 2026 01:15:26 -0400 Subject: [PATCH 119/198] first try on dynamic rendering unused attachments --- .../renderer_vulkan/fixed_pipeline_state.cpp | 46 ++++++++++++++++--- .../renderer_vulkan/fixed_pipeline_state.h | 4 +- .../renderer_vulkan/vk_pipeline_cache.cpp | 6 ++- .../renderer_vulkan/vk_scheduler.cpp | 31 +++++++++---- src/video_core/shader_cache.cpp | 11 +++++ src/video_core/shader_cache.h | 2 + .../vulkan_common/vulkan_device.cpp | 6 +++ src/video_core/vulkan_common/vulkan_device.h | 8 +++- 8 files changed, 94 insertions(+), 20 deletions(-) diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index 82f2fad005..aadcf9f241 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp @@ -88,6 +88,18 @@ bool ComputeAttachment0DualSourceBlend(const Maxwell& regs) { : uses_dual_source(regs.blend); } +bool WritesColorTarget(const Maxwell& regs, size_t index, bool static_masks) { + if (!static_masks || (index == 0 && regs.anti_alias_alpha_control.alpha_to_coverage != 0)) { + return true; + } + size_t mask_index = index; + if (regs.color_mask_common) { + mask_index = 0; + } + const auto& mask = regs.color_mask[mask_index]; + return mask.R || mask.G || mask.B || mask.A; +} + void RefreshXfbState(VideoCommon::TransformFeedbackState& state, const Maxwell& regs) { std::ranges::transform(regs.transform_feedback.controls, state.layouts.begin(), [](const auto& layout) { @@ -101,7 +113,8 @@ void RefreshXfbState(VideoCommon::TransformFeedbackState& state, const Maxwell& } } // Anonymous namespace -void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFeatures& features) { +void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFeatures& features, + u32 color_outputs) { const Maxwell& regs = maxwell3d.regs; const auto topology_ = maxwell3d.draw_manager.draw_state.topology; @@ -141,8 +154,13 @@ void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFe regs.alpha_test_enabled != 0 ? regs.alpha_test_func : Maxwell::ComparisonOp::Always_GL; alpha_test_func.Assign(PackComparisonOp(test_func)); early_z.Assign(regs.mandated_early_z != 0 ? 1 : 0); - depth_enabled.Assign(regs.zeta_enable != 0 ? 1 : 0); - depth_format.Assign(static_cast(regs.zeta.format)); + const bool drop_unused = features.has_dynamic_rendering_unused_attachments; + const bool depth_used = regs.depth_test_enable || regs.depth_bounds_enable || + regs.stencil_enable || extended_dynamic_state; + if (regs.zeta_enable != 0 && regs.zeta.Address() != 0 && (depth_used || !drop_unused)) { + depth_enabled.Assign(1); + depth_format.Assign(static_cast(regs.zeta.format)); + } y_negate.Assign(regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft ? 1 : 0); bool use_last_provoking_vertex = false; @@ -179,8 +197,18 @@ void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFe line_stipple_pattern = regs.line_stipple_params.pattern; } - for (size_t i = 0; i < regs.rt.size(); ++i) { - color_formats[i] = static_cast(regs.rt[i].format); + const bool static_masks = + !features.has_extended_dynamic_state_3_blend && !features.has_color_write_enable; + const auto previous_formats = color_formats; + color_formats.fill(static_cast(Tegra::RenderTargetFormat::NONE)); + const size_t num_targets = (std::min)(size_t{regs.rt_control.count}, color_formats.size()); + for (size_t index = 0; index < num_targets; ++index) { + const bool used = ((color_outputs >> index) & 1) != 0 && + WritesColorTarget(regs, index, static_masks); + if (regs.rt[index].Address() == 0 || (drop_unused && !used)) { + continue; + } + color_formats[index] = static_cast(regs.rt[index].format); } alpha_test_ref = 0; if (regs.alpha_test_enabled != 0) { @@ -251,11 +279,15 @@ void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFe dynamic_state.Refresh2(regs, topology_, extended_dynamic_state_2); } if (!extended_dynamic_state_3_blend) { - if (maxwell3d.dirty.flags[Dirty::Blending]) { + if (maxwell3d.dirty.flags[Dirty::Blending] || color_formats != previous_formats) { maxwell3d.dirty.flags[Dirty::Blending] = false; for (size_t index = 0; index < attachments.size(); ++index) { - attachments[index].Refresh(regs, index); auto& attachment = attachments[index]; + attachment.raw = 0; + if (color_formats[index] == static_cast(Tegra::RenderTargetFormat::NONE)) { + continue; + } + attachment.Refresh(regs, index); if (color_write_enable_dynamic && attachment.mask_r == 0 && attachment.mask_g == 0 && attachment.mask_b == 0 && attachment.mask_a == 0) { diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.h b/src/video_core/renderer_vulkan/fixed_pipeline_state.h index 3f10c8f2e5..6e114ec111 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.h +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.h @@ -38,6 +38,7 @@ struct DynamicFeatures { bool has_provoking_vertex_first_mode; bool has_provoking_vertex_last_mode; bool has_provoking_vertex_tf_preserve; + bool has_dynamic_rendering_unused_attachments; }; struct FixedPipelineState { @@ -255,7 +256,8 @@ struct FixedPipelineState { VideoCommon::TransformFeedbackState xfb_state; - void Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFeatures& features); + void Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFeatures& features, + u32 color_outputs); size_t Hash() const noexcept; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 4f42474a05..dd55b576e8 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -62,7 +62,7 @@ using VideoCommon::FileEnvironment; using VideoCommon::GenericEnvironment; using VideoCommon::GraphicsEnvironment; -constexpr u32 CACHE_VERSION = 19; +constexpr u32 CACHE_VERSION = 20; constexpr size_t VULKAN_CACHE_FLUSH_PIPELINES = 128; constexpr size_t VULKAN_CACHE_FLUSH_MIN_SECONDS = 30; constexpr std::array VULKAN_CACHE_MAGIC_NUMBER{'y', 'u', 'z', 'u', 'v', 'k', 'c', 'h'}; @@ -551,6 +551,8 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, device.SupportsProvokingVertexLastMode(); dynamic_features.has_provoking_vertex_tf_preserve = device.SupportsTransformFeedbackProvokingVertexPreservation(); + dynamic_features.has_dynamic_rendering_unused_attachments = + device.IsExtDynamicRenderingUnusedAttachmentsSupported(); } PipelineCache::~PipelineCache() { @@ -566,7 +568,7 @@ GraphicsPipeline* PipelineCache::CurrentGraphicsPipeline() { current_pipeline = nullptr; return nullptr; } - graphics_key.state.Refresh(*maxwell3d, dynamic_features); + graphics_key.state.Refresh(*maxwell3d, dynamic_features, fragment_color_outputs); if (current_pipeline) { GraphicsPipeline* const next{current_pipeline->Next(graphics_key)}; diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 024b75e584..36f0bef803 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -244,24 +244,37 @@ void Scheduler::RequestComputeDispatchContext() { void Scheduler::RelaxAttachmentOps(RenderingAttachments& attachments) const { const bool load_op_none = device.IsLoadOpNoneSupported(); + const bool drop_unused = device.IsExtDynamicRenderingUnusedAttachmentsSupported(); const auto relax = [&](VkRenderingAttachmentInfo& attachment, u32 bit) { - if (attachment.imageView == VK_NULL_HANDLE || - attachment.resolveMode != VK_RESOLVE_MODE_NONE || + if (attachment.imageView == VK_NULL_HANDLE) { + return true; + } + if (attachment.resolveMode != VK_RESOLVE_MODE_NONE || attachment.loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR || attachment.storeOp != VK_ATTACHMENT_STORE_OP_STORE || (attachments_written & bit) != 0) { - return; + return false; } attachment.storeOp = VK_ATTACHMENT_STORE_OP_NONE; - if (load_op_none && (attachments_touched & bit) == 0) { - attachment.loadOp = VK_ATTACHMENT_LOAD_OP_NONE; - } + return (attachments_touched & bit) == 0; }; for (u32 slot = 0; slot < attachments.num_colors; ++slot) { - relax(attachments.colors[slot], 1u << slot); + VkRenderingAttachmentInfo& color = attachments.colors[slot]; + if (!relax(color, 1u << slot)) { + continue; + } + if (drop_unused) { + color.imageView = VK_NULL_HANDLE; + } else if (load_op_none) { + color.loadOp = VK_ATTACHMENT_LOAD_OP_NONE; + } + } + const bool depth_unused = relax(attachments.depth, DEPTH_ATTACHMENT_BIT); + const bool stencil_unused = relax(attachments.stencil, STENCIL_ATTACHMENT_BIT); + if (drop_unused && depth_unused && stencil_unused) { + attachments.depth.imageView = VK_NULL_HANDLE; + attachments.stencil.imageView = VK_NULL_HANDLE; } - relax(attachments.depth, DEPTH_ATTACHMENT_BIT); - relax(attachments.stencil, STENCIL_ATTACHMENT_BIT); } void Scheduler::PublishComputeWrites() { diff --git a/src/video_core/shader_cache.cpp b/src/video_core/shader_cache.cpp index f1aff2810f..d2d6ffeca1 100644 --- a/src/video_core/shader_cache.cpp +++ b/src/video_core/shader_cache.cpp @@ -49,6 +49,7 @@ bool ShaderCache::RefreshStages(std::array& unique_hashes) { return last_shaders_valid; } dirty[VideoCommon::Dirty::Shaders] = false; + fragment_color_outputs = 0; const GPUVAddr base_addr{maxwell3d->regs.program_region.Address()}; for (size_t index = 0; index < Tegra::Engines::Maxwell3D::Regs::MaxShaderProgram; ++index) { @@ -78,6 +79,9 @@ bool ShaderCache::RefreshStages(std::array& unique_hashes) { } shader_infos[index] = shader_info; unique_hashes[index] = shader_info->unique_hash; + if (program == Tegra::Engines::Maxwell3D::Regs::ShaderType::Pixel) { + fragment_color_outputs = shader_info->color_outputs; + } } last_shaders_valid = true; return true; @@ -241,6 +245,13 @@ const ShaderInfo* ShaderCache::MakeShaderInfo(GenericEnvironment& env, VAddr cpu info->unique_hash = env.CalculateHash(); info->size_bytes = env.ReadSizeBytes(); } + if (env.ShaderStage() == Shader::Stage::Fragment) { + for (u32 target = 0; target < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets; ++target) { + if (env.SPH().ps.HasOutputComponents(target)) { + info->color_outputs |= 1U << target; + } + } + } const size_t size_bytes{info->size_bytes}; const ShaderInfo* const result{info.get()}; Register(std::move(info), cpu_addr, size_bytes); diff --git a/src/video_core/shader_cache.h b/src/video_core/shader_cache.h index 997f2b0371..aec003d166 100644 --- a/src/video_core/shader_cache.h +++ b/src/video_core/shader_cache.h @@ -36,6 +36,7 @@ class GenericEnvironment; struct ShaderInfo { u64 unique_hash{}; size_t size_bytes{}; + u32 color_outputs{}; }; class ShaderCache : public VideoCommon::ChannelSetupCaches { @@ -98,6 +99,7 @@ protected: std::array shader_infos{}; bool last_shaders_valid = false; + u32 fragment_color_outputs{}; private: /// @brief Tries to obtain a cached shader starting in a given address diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 756e6a49a2..76bfe29fdf 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1247,6 +1247,12 @@ void Device::RemoveUnsuitableExtensions() { RemoveExtensionFeatureIfUnsuitable(extensions.descriptor_buffer, features.descriptor_buffer, VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME); + extensions.dynamic_rendering_unused_attachments = + features.dynamic_rendering_unused_attachments.dynamicRenderingUnusedAttachments; + RemoveExtensionFeatureIfUnsuitable(extensions.dynamic_rendering_unused_attachments, + features.dynamic_rendering_unused_attachments, + VK_EXT_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_EXTENSION_NAME); + // VK_EXT_extended_dynamic_state extensions.extended_dynamic_state = features.extended_dynamic_state.extendedDynamicState; RemoveExtensionFeatureIfUnsuitable(extensions.extended_dynamic_state, diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 69f21a6f50..e023e95fc2 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -61,6 +61,8 @@ VK_DEFINE_HANDLE(VmaAllocator) FEATURE(EXT, DepthBiasControl, DEPTH_BIAS_CONTROL, depth_bias_control) \ FEATURE(EXT, DepthClipControl, DEPTH_CLIP_CONTROL, depth_clip_control) \ FEATURE(EXT, DescriptorBuffer, DESCRIPTOR_BUFFER, descriptor_buffer) \ + FEATURE(EXT, DynamicRenderingUnusedAttachments, DYNAMIC_RENDERING_UNUSED_ATTACHMENTS, \ + dynamic_rendering_unused_attachments) \ FEATURE(EXT, ExtendedDynamicState, EXTENDED_DYNAMIC_STATE, extended_dynamic_state) \ FEATURE(EXT, ExtendedDynamicState2, EXTENDED_DYNAMIC_STATE_2, extended_dynamic_state2) \ FEATURE(EXT, ExtendedDynamicState3, EXTENDED_DYNAMIC_STATE_3, extended_dynamic_state3) \ @@ -670,11 +672,15 @@ FN_MAX_LIMIT_LIST return extensions.depth_clip_control; } - /// Returns true if the device supports VK_EXT_depth_bias_control. bool IsLoadOpNoneSupported() const { return extensions.load_store_op_none || extensions.load_store_op_none_ext; } + bool IsExtDynamicRenderingUnusedAttachmentsSupported() const { + return extensions.dynamic_rendering_unused_attachments; + } + + /// Returns true if the device supports VK_EXT_depth_bias_control. bool IsExtDepthBiasControlSupported() const { return extensions.depth_bias_control; } From 2d5c79c9f38d4034cf4196f39a7a7fc97373f7ea Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sun, 27 Sep 2026 02:44:37 -0400 Subject: [PATCH 120/198] Address some bugs with load none vs lrz --- src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index aadcf9f241..9a2dc76202 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp @@ -202,12 +202,15 @@ void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFe const auto previous_formats = color_formats; color_formats.fill(static_cast(Tegra::RenderTargetFormat::NONE)); const size_t num_targets = (std::min)(size_t{regs.rt_control.count}, color_formats.size()); + size_t num_formats = 0; for (size_t index = 0; index < num_targets; ++index) { const bool used = ((color_outputs >> index) & 1) != 0 && WritesColorTarget(regs, index, static_masks); - if (regs.rt[index].Address() == 0 || (drop_unused && !used)) { - continue; + if (regs.rt[index].Address() != 0 && (used || !drop_unused)) { + num_formats = index + 1; } + } + for (size_t index = 0; index < num_formats; ++index) { color_formats[index] = static_cast(regs.rt[index].format); } alpha_test_ref = 0; From ef7cde0c2b1c05158383ed6dfd127bd2e0dc5118 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sun, 27 Sep 2026 02:48:26 -0400 Subject: [PATCH 121/198] Barrier feedback loops toggle android --- .../yuzu_emu/features/settings/model/BooleanSetting.kt | 1 + .../features/settings/model/view/SettingsItem.kt | 7 +++++++ .../features/settings/ui/SettingsFragmentPresenter.kt | 1 + src/android/app/src/main/res/values/strings.xml | 2 ++ src/common/settings.h | 9 +++++++-- 5 files changed, 18 insertions(+), 2 deletions(-) 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 63747cd241..4b3648d4e3 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 @@ -27,6 +27,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_ASYNCHRONOUS_GPU_EMULATION("use_asynchronous_gpu_emulation"), RENDERER_ASYNCHRONOUS_SHADERS("use_asynchronous_shaders"), RENDERER_REACTIVE_FLUSHING("use_reactive_flushing"), + RENDERER_BARRIER_FEEDBACK_LOOPS("barrier_feedback_loops"), ENABLE_BUFFER_HISTORY("enable_buffer_history"), USE_OPTIMIZED_VERTEX_BUFFERS("use_optimized_vertex_buffers"), ENABLE_GPU_BUFFER_READBACK("enable_gpu_buffer_readback"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index b6b42c366c..d04ce0567f 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -853,6 +853,13 @@ abstract class SettingsItem( descriptionId = R.string.renderer_reactive_flushing_description ) ) + put( + SwitchSetting( + BooleanSetting.RENDERER_BARRIER_FEEDBACK_LOOPS, + titleId = R.string.renderer_barrier_feedback_loops, + descriptionId = R.string.renderer_barrier_feedback_loops_description + ) + ) put( SwitchSetting( BooleanSetting.ENABLE_BUFFER_HISTORY, 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 4cfa885fb4..060d0dae3b 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 @@ -548,6 +548,7 @@ class SettingsFragmentPresenter( add(BooleanSetting.RENDERER_USE_DISK_SHADER_CACHE.key) add(BooleanSetting.RENDERER_FORCE_MAX_CLOCK.key) add(BooleanSetting.RENDERER_REACTIVE_FLUSHING.key) + add(BooleanSetting.RENDERER_BARRIER_FEEDBACK_LOOPS.key) add(BooleanSetting.ENABLE_BUFFER_HISTORY.key) add(BooleanSetting.ENABLE_GPU_BUFFER_READBACK.key) add(BooleanSetting.USE_OPTIMIZED_VERTEX_BUFFERS.key) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 025922df8d..2238a9ec4c 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -582,6 +582,8 @@ This hack can increase performance by running GPU emulation asynchronously at the cost of graphical issues and increased crash rates by timing-related operations. Use reactive flushing Improves rendering accuracy in some games at the cost of performance. + Barrier feedback loops + Improves rendering of transparency effects in specific games at the cost of performance. Enable buffer history Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Enable GPU Buffer Readback diff --git a/src/common/settings.h b/src/common/settings.h index 10c5042539..4ca2368064 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -595,8 +595,13 @@ struct Values { "use_reactive_flushing", Category::RendererAdvanced}; - SwitchableSetting barrier_feedback_loops{linkage, true, "barrier_feedback_loops", - Category::RendererAdvanced}; + SwitchableSetting barrier_feedback_loops{linkage, + true, + "barrier_feedback_loops", + Category::RendererAdvanced, + Specialization::Default, + true, + true}; SwitchableSetting enable_buffer_history{linkage, false, From 815325cceca948030cf476dce7c46d901e4e4df5 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Sun, 27 Sep 2026 12:48:45 +0200 Subject: [PATCH 122/198] [loader] add ZBIC (zstd variant) NSO decompression support for Switch 22.0+ (#4482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- A new NSO compression method was introduced in Switch 22.0.0. This is a customized variant of zstd and is used when NSO flags have bit 7 set. Key characteristics: - ZSTD_MAGICNUMBER is set to 0x4349425A (b'ZBIC') instead of 0xFD2FB528 - ZSTD_LEGACY_SUPPORT is set to 0 - ZSTD_TRACE is set to 1, zstd version used is 1.5.7 (10507) - FSE_readNCount is replaced with a BIC (Binary Interpolative Coding) version which improves compression of entropy tables significantly Source: https://switchbrew.org/wiki/22.0.0 Implementation: - Detect ZBIC segments via NSO flag bit 7 (NsoFlags_UseZbicCompression) and/or ZBIC magic scan in nso.cpp - Fall back to LZ4 when ZBIC is not detected or returns unexpected size - Handle segment 0 alternate offset (0x100 vs 0x108) for both ZBIC and LZ4 References: - Atmosphère loader/strat zstd-zbic integration: https://github.com/Atmosphere-NX/Atmosphere/commit/082115187a0509cb6b8a757de639a4e4741b8712 - nxdumptool ZBIC segment compression support: https://github.com/DarkMatterCore/nxdumptool/commit/441e5c0904f29427987433be4eb057a2843d222a - STORM_SWITCH ZBIC implementation: https://github.com/ReiKatari/STORM_SWITCH/commit/1e09eb82b760aaf340b810031400991c0740c091 Tested with firmware 23.0.0 and ZBIC-compressed NSOs. Co-authored-by: xbzk Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4482 Reviewed-by: CamilleLaVey Reviewed-by: lizzie Reviewed-by: Maufeat --- cpmfile.json | 5 ++++ externals/CMakeLists.txt | 5 ++++ src/common/CMakeLists.txt | 6 +++++ src/common/zbic_compression.cpp | 46 +++++++++++++++++++++++++++++++++ src/common/zbic_compression.h | 15 +++++++++++ src/core/loader/nso.cpp | 35 ++++++++++++++++++++++--- src/core/loader/nso.h | 6 +++++ 7 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 src/common/zbic_compression.cpp create mode 100644 src/common/zbic_compression.h diff --git a/cpmfile.json b/cpmfile.json index f574bf5668..616235f27a 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -333,6 +333,11 @@ "repo": "herumi/xbyak", "version": "v7.40.1" }, + "zbic": { + "hash": "fbe2f37986377d7f0d96ae3224c80b5971df6e8b6961f68061f1975ebb2e8cb78f07b90f014b007be4023dbf5513581504e7f7d61a5237cb2a8a7a61ae11e482", + "repo": "kinnay/zbic", + "version": "11b08f2712264bbed731545085cbd9702096ceb7" + }, "zlib": { "hash": "16fea4df307a68cf0035858abe2fd550250618a97590e202037acd18a666f57afc10f8836cbbd472d54a0e76539d0e558cb26f059d53de52ff90634bbf4f47d4", "min_version": "1.2", diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index a211b7f013..cb1deceb96 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -48,6 +48,11 @@ if (NOT TARGET stb::headers) add_library(stb::headers ALIAS stb) endif() +AddJsonPackage(NAME zbic DOWNLOAD_ONLY) +set(ZBIC_INCLUDE_DIR + "${zbic_SOURCE_DIR}/src" + PARENT_SCOPE) + # ItaniumDemangle (Windows only) if (WIN32 AND NOT TARGET LLVM::Demangle) add_library(demangle demangle/ItaniumDemangle.cpp) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 0517f0b9e1..5d1b30a549 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -137,6 +137,8 @@ add_library( uuid.cpp uuid.h vector_math.h + zbic_compression.cpp + zbic_compression.h zstd_compression.cpp zstd_compression.h fs/ryujinx_compat.h fs/ryujinx_compat.cpp @@ -147,6 +149,10 @@ add_library( net/net.h net/net.cpp container/unordered_map.h container/unordered_set.h) +set_source_files_properties(zbic_compression.cpp PROPERTIES + INCLUDE_DIRECTORIES "${ZBIC_INCLUDE_DIR}" + COMPILE_OPTIONS "$<$:-Wno-unused-function;-Wno-missing-declarations;-Wno-shadow>") + if(WIN32) target_sources(common PRIVATE windows/timer_resolution.cpp windows/timer_resolution.h) diff --git a/src/common/zbic_compression.cpp b/src/common/zbic_compression.cpp new file mode 100644 index 0000000000..5e0e4d947b --- /dev/null +++ b/src/common/zbic_compression.cpp @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include + +#include "common/zbic_compression.h" + +#define ZSTD_ZBIC_SUPPORT 1 +#define ZSTDLIB_VISIBLE static +#define ZSTDLIB_HIDDEN static +#define ZSTDERRORLIB_VISIBLE static +#define ZSTDERRORLIB_HIDDEN static +#undef ZSTD_MULTITHREAD + +#if defined(__ANDROID__) +#undef _GNU_SOURCE +#endif + +#include "zstd.h" +#define g_ZSTD_threading_useless_symbol g_ZSTD_zbic_threading_useless_symbol +#include "zstd.c" +#undef g_ZSTD_threading_useless_symbol + +namespace Common::Compression { + +bool IsZBIC(std::span src) { + if (src.size() < sizeof(u32)) { + return false; + } + u32 magic = 0; + std::memcpy(&magic, src.data(), sizeof(u32)); + return magic == ZSTD_MAGICNUMBER; // 0x4349425A ("ZBIC") +} + +int DecompressDataZBIC(std::span dst, std::span src) { + if (dst.empty() || src.empty()) { + return -1; + } + const size_t res = ZSTD_decompress(dst.data(), dst.size(), src.data(), src.size()); + if (ZSTD_isError(res)) { + return -1; + } + return static_cast(res); +} + +} // namespace Common::Compression diff --git a/src/common/zbic_compression.h b/src/common/zbic_compression.h new file mode 100644 index 0000000000..c36a559388 --- /dev/null +++ b/src/common/zbic_compression.h @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include +#include "common/common_types.h" + +namespace Common::Compression { + +[[nodiscard]] bool IsZBIC(std::span src); + +[[nodiscard]] int DecompressDataZBIC(std::span dst, std::span src); + +} // namespace Common::Compression diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 0a3dc5885b..ea1d1c9ecd 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -7,12 +7,14 @@ #include #include #include +#include #include #include "common/common_funcs.h" #include "common/hex_util.h" #include "common/logging.h" #include "common/lz4_compression.h" +#include "common/zbic_compression.h" #include "common/settings.h" #include "common/swap.h" #include "core/core.h" @@ -104,11 +106,36 @@ std::optional AppLoader_NSO::LoadModule(Kernel::KProcess& process, Core:: for (std::size_t i = 0; i < nso_header.segments.size(); ++i) { nso_file.Read(compressed_data.data(), nso_header.segments_compressed_size[i], nso_header.segments[i].offset); if (nso_header.IsSegmentCompressed(i)) { - int r = Common::Compression::DecompressDataLZ4(decompressed_size.data(), nso_header.segments[i].size, compressed_data.data(), nso_header.segments_compressed_size[i]); - ASSERT(r == int(nso_header.segments[i].size)); - std::memcpy(codeset.memory.data() + module_start + nso_header.segments[i].location, decompressed_size.data(), nso_header.segments[i].size); + if (nso_header.IsZBICCompressed()) { + // ZBIC compression + const int r = Common::Compression::DecompressDataZBIC( + std::span{decompressed_size}.first(nso_header.segments[i].size), + std::span{compressed_data}.first(nso_header.segments_compressed_size[i]) + ); + ASSERT(r > 0); + } else { + // LZ4 compression + int r = Common::Compression::DecompressDataLZ4( + decompressed_size.data(), + nso_header.segments[i].size, + compressed_data.data(), + nso_header.segments_compressed_size[i] + ); + ASSERT(r == int(nso_header.segments[i].size)); + } + + std::memcpy( + codeset.memory.data() + module_start + nso_header.segments[i].location, + decompressed_size.data(), + nso_header.segments[i].size + ); } else { - std::memcpy(codeset.memory.data() + module_start + nso_header.segments[i].location, compressed_data.data(), nso_header.segments[i].size); + // Not compressed + std::memcpy( + codeset.memory.data() + module_start + nso_header.segments[i].location, + compressed_data.data(), + nso_header.segments[i].size + ); } codeset.segments[i].addr = module_start + nso_header.segments[i].location; codeset.segments[i].offset = module_start + nso_header.segments[i].location; diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index 6356697e33..4a373edd07 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -58,6 +61,9 @@ struct NSOHeader { std::array segment_hashes; bool IsSegmentCompressed(size_t segment_num) const; + bool IsZBICCompressed() const { + return ((flags >> 7) & 1) != 0; + } }; static_assert(sizeof(NSOHeader) == 0x100, "NSOHeader has incorrect size."); static_assert(std::is_trivially_copyable_v, "NSOHeader must be trivially copyable."); From 2d6f28c50ea689e8ab8f5138061e293c131ccf0c Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 29 Sep 2026 16:13:50 -0400 Subject: [PATCH 123/198] Some work around CAS --- .../backend/spirv/emit_spirv_atomic.cpp | 72 ++-- .../backend/spirv/emit_spirv_instructions.h | 52 +-- .../backend/spirv/emit_spirv_memory.cpp | 86 ++--- .../backend/spirv/spirv_emit_context.cpp | 346 ++++++++++++------ .../backend/spirv/spirv_emit_context.h | 16 +- .../impl/atomic_operations_global_memory.cpp | 9 +- .../translate/impl/barrier_operations.cpp | 8 +- .../translate/impl/load_store_memory.cpp | 5 +- .../translate/impl/not_implemented.cpp | 14 +- .../ir_opt/collect_shader_info_pass.cpp | 4 +- 10 files changed, 347 insertions(+), 265 deletions(-) diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp index d1c08c1131..465c40277a 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp @@ -417,48 +417,48 @@ Id EmitStorageAtomicMaxF32x2(EmitContext& ctx, const IR::Value& binding, const I return ctx.OpPackHalf2x16(ctx.U32[1], result); } -Id EmitGlobalAtomicIAdd32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicIAdd32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicIAdd32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicSMin32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicSMin32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicSMin32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicUMin32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicUMin32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicUMin32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicSMax32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicSMax32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicSMax32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicUMax32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicUMax32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicUMax32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicInc32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicInc32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicInc32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicDec32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicDec32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicDec32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicAnd32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicAnd32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicAnd32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicOr32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicOr32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicOr32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicXor32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicXor32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicXor32, ctx.U32[1], address, value); } -Id EmitGlobalAtomicExchange32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicExchange32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicExchange32, ctx.U32[1], address, value); } Id EmitGlobalAtomicIAdd64(EmitContext&) { @@ -549,32 +549,32 @@ Id EmitGlobalAtomicExchange32x2(EmitContext&) { throw NotImplementedException("SPIR-V Instruction"); } -Id EmitGlobalAtomicAddF32(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicAddF32(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicAddF32, ctx.F32[1], address, value); } -Id EmitGlobalAtomicAddF16x2(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicAddF16x2(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicAddF16x2, ctx.U32[1], address, value); } -Id EmitGlobalAtomicAddF32x2(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicAddF32x2(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicAddF32x2, ctx.U32[1], address, value); } -Id EmitGlobalAtomicMinF16x2(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicMinF16x2(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicMinF16x2, ctx.U32[1], address, value); } -Id EmitGlobalAtomicMinF32x2(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicMinF32x2(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicMinF32x2, ctx.U32[1], address, value); } -Id EmitGlobalAtomicMaxF16x2(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicMaxF16x2(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicMaxF16x2, ctx.U32[1], address, value); } -Id EmitGlobalAtomicMaxF32x2(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitGlobalAtomicMaxF32x2(EmitContext& ctx, Id address, Id value) { + return ctx.CallGlobalMemory(IR::Opcode::GlobalAtomicMaxF32x2, ctx.U32[1], address, value); } } // namespace Shader::Backend::SPIRV diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h index 165ec3fe84..9d49289dd7 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h @@ -90,17 +90,17 @@ Id EmitUndefU8(EmitContext& ctx); Id EmitUndefU16(EmitContext& ctx); Id EmitUndefU32(EmitContext& ctx); Id EmitUndefU64(EmitContext& ctx); -void EmitLoadGlobalU8(EmitContext& ctx); -void EmitLoadGlobalS8(EmitContext& ctx); -void EmitLoadGlobalU16(EmitContext& ctx); -void EmitLoadGlobalS16(EmitContext& ctx); +Id EmitLoadGlobalU8(EmitContext& ctx, Id address); +Id EmitLoadGlobalS8(EmitContext& ctx, Id address); +Id EmitLoadGlobalU16(EmitContext& ctx, Id address); +Id EmitLoadGlobalS16(EmitContext& ctx, Id address); Id EmitLoadGlobal32(EmitContext& ctx, Id address); Id EmitLoadGlobal64(EmitContext& ctx, Id address); Id EmitLoadGlobal128(EmitContext& ctx, Id address); -void EmitWriteGlobalU8(EmitContext& ctx); -void EmitWriteGlobalS8(EmitContext& ctx); -void EmitWriteGlobalU16(EmitContext& ctx); -void EmitWriteGlobalS16(EmitContext& ctx); +void EmitWriteGlobalU8(EmitContext& ctx, Id address, Id value); +void EmitWriteGlobalS8(EmitContext& ctx, Id address, Id value); +void EmitWriteGlobalU16(EmitContext& ctx, Id address, Id value); +void EmitWriteGlobalS16(EmitContext& ctx, Id address, Id value); void EmitWriteGlobal32(EmitContext& ctx, Id address, Id value); void EmitWriteGlobal64(EmitContext& ctx, Id address, Id value); void EmitWriteGlobal128(EmitContext& ctx, Id address, Id value); @@ -415,17 +415,17 @@ Id EmitStorageAtomicMaxF16x2(EmitContext& ctx, const IR::Value& binding, const I Id value); Id EmitStorageAtomicMaxF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, Id value); -Id EmitGlobalAtomicIAdd32(EmitContext& ctx); -Id EmitGlobalAtomicSMin32(EmitContext& ctx); -Id EmitGlobalAtomicUMin32(EmitContext& ctx); -Id EmitGlobalAtomicSMax32(EmitContext& ctx); -Id EmitGlobalAtomicUMax32(EmitContext& ctx); -Id EmitGlobalAtomicInc32(EmitContext& ctx); -Id EmitGlobalAtomicDec32(EmitContext& ctx); -Id EmitGlobalAtomicAnd32(EmitContext& ctx); -Id EmitGlobalAtomicOr32(EmitContext& ctx); -Id EmitGlobalAtomicXor32(EmitContext& ctx); -Id EmitGlobalAtomicExchange32(EmitContext& ctx); +Id EmitGlobalAtomicIAdd32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicSMin32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicUMin32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicSMax32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicUMax32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicInc32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicDec32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicAnd32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicOr32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicXor32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicExchange32(EmitContext& ctx, Id address, Id value); Id EmitGlobalAtomicIAdd64(EmitContext& ctx); Id EmitGlobalAtomicSMin64(EmitContext& ctx); Id EmitGlobalAtomicUMin64(EmitContext& ctx); @@ -448,13 +448,13 @@ Id EmitGlobalAtomicAnd32x2(EmitContext& ctx); Id EmitGlobalAtomicOr32x2(EmitContext& ctx); Id EmitGlobalAtomicXor32x2(EmitContext& ctx); Id EmitGlobalAtomicExchange32x2(EmitContext& ctx); -Id EmitGlobalAtomicAddF32(EmitContext& ctx); -Id EmitGlobalAtomicAddF16x2(EmitContext& ctx); -Id EmitGlobalAtomicAddF32x2(EmitContext& ctx); -Id EmitGlobalAtomicMinF16x2(EmitContext& ctx); -Id EmitGlobalAtomicMinF32x2(EmitContext& ctx); -Id EmitGlobalAtomicMaxF16x2(EmitContext& ctx); -Id EmitGlobalAtomicMaxF32x2(EmitContext& ctx); +Id EmitGlobalAtomicAddF32(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicAddF16x2(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicAddF32x2(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicMinF16x2(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicMinF32x2(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicMaxF16x2(EmitContext& ctx, Id address, Id value); +Id EmitGlobalAtomicMaxF32x2(EmitContext& ctx, Id address, Id value); Id EmitLogicalOr(EmitContext& ctx, Id a, Id b); Id EmitLogicalAnd(EmitContext& ctx, Id a, Id b); Id EmitLogicalXor(EmitContext& ctx, Id a, Id b); diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp index bef4421fed..cc72f4baf1 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp @@ -69,93 +69,71 @@ void WriteStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& &StorageDefinitions::U32, index_offset); } -void WriteStorageByCasLoop(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, - Id value, Id bit_offset, Id bit_count) { +void WriteStorageBits(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, + Id value, Id bit_offset, Id bit_count) { const Id pointer{StoragePointer(ctx, binding, offset, ctx.storage_types.U32, sizeof(u32), &StorageDefinitions::U32)}; - ctx.OpFunctionCall(ctx.TypeVoid(), ctx.write_storage_cas_loop_func, pointer, value, bit_offset, - bit_count); + ctx.AtomicBitFieldInsert(pointer, value, bit_offset, bit_count); } } // Anonymous namespace -void EmitLoadGlobalU8(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitLoadGlobalU8(EmitContext& ctx, Id address) { + return ctx.CallGlobalMemory(IR::Opcode::LoadGlobalU8, ctx.U32[1], address, ctx.u32_zero_value); } -void EmitLoadGlobalS8(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitLoadGlobalS8(EmitContext& ctx, Id address) { + return ctx.CallGlobalMemory(IR::Opcode::LoadGlobalS8, ctx.U32[1], address, ctx.u32_zero_value); } -void EmitLoadGlobalU16(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitLoadGlobalU16(EmitContext& ctx, Id address) { + return ctx.CallGlobalMemory(IR::Opcode::LoadGlobalU16, ctx.U32[1], address, + ctx.u32_zero_value); } -void EmitLoadGlobalS16(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +Id EmitLoadGlobalS16(EmitContext& ctx, Id address) { + return ctx.CallGlobalMemory(IR::Opcode::LoadGlobalS16, ctx.U32[1], address, + ctx.u32_zero_value); } Id EmitLoadGlobal32(EmitContext& ctx, Id address) { - if (ctx.profile.support_int64) { - return ctx.OpFunctionCall(ctx.U32[1], ctx.load_global_func_u32, address); - } - LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation"); - return ctx.Const(0u); + return ctx.CallGlobalMemory(IR::Opcode::LoadGlobal32, ctx.U32[1], address, ctx.u32_zero_value); } Id EmitLoadGlobal64(EmitContext& ctx, Id address) { - if (ctx.profile.support_int64) { - return ctx.OpFunctionCall(ctx.U32[2], ctx.load_global_func_u32x2, address); - } - LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation"); - return ctx.Const(0u, 0u); + return ctx.CallGlobalMemory(IR::Opcode::LoadGlobal64, ctx.U32[2], address, ctx.u32_zero_value); } Id EmitLoadGlobal128(EmitContext& ctx, Id address) { - if (ctx.profile.support_int64) { - return ctx.OpFunctionCall(ctx.U32[4], ctx.load_global_func_u32x4, address); - } - LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation"); - return ctx.Const(0u, 0u, 0u, 0u); + return ctx.CallGlobalMemory(IR::Opcode::LoadGlobal128, ctx.U32[4], address, + ctx.u32_zero_value); } -void EmitWriteGlobalU8(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +void EmitWriteGlobalU8(EmitContext& ctx, Id address, Id value) { + ctx.CallGlobalMemory(IR::Opcode::WriteGlobalU8, ctx.void_id, address, value); } -void EmitWriteGlobalS8(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +void EmitWriteGlobalS8(EmitContext& ctx, Id address, Id value) { + ctx.CallGlobalMemory(IR::Opcode::WriteGlobalS8, ctx.void_id, address, value); } -void EmitWriteGlobalU16(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +void EmitWriteGlobalU16(EmitContext& ctx, Id address, Id value) { + ctx.CallGlobalMemory(IR::Opcode::WriteGlobalU16, ctx.void_id, address, value); } -void EmitWriteGlobalS16(EmitContext&) { - throw NotImplementedException("SPIR-V Instruction"); +void EmitWriteGlobalS16(EmitContext& ctx, Id address, Id value) { + ctx.CallGlobalMemory(IR::Opcode::WriteGlobalS16, ctx.void_id, address, value); } void EmitWriteGlobal32(EmitContext& ctx, Id address, Id value) { - if (ctx.profile.support_int64) { - ctx.OpFunctionCall(ctx.void_id, ctx.write_global_func_u32, address, value); - return; - } - LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation"); + ctx.CallGlobalMemory(IR::Opcode::WriteGlobal32, ctx.void_id, address, value); } void EmitWriteGlobal64(EmitContext& ctx, Id address, Id value) { - if (ctx.profile.support_int64) { - ctx.OpFunctionCall(ctx.void_id, ctx.write_global_func_u32x2, address, value); - return; - } - LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation"); + ctx.CallGlobalMemory(IR::Opcode::WriteGlobal64, ctx.void_id, address, value); } void EmitWriteGlobal128(EmitContext& ctx, Id address, Id value) { - if (ctx.profile.support_int64) { - ctx.OpFunctionCall(ctx.void_id, ctx.write_global_func_u32x4, address, value); - return; - } - LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation"); + ctx.CallGlobalMemory(IR::Opcode::WriteGlobal128, ctx.void_id, address, value); } Id EmitLoadStorageU8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) { @@ -239,7 +217,7 @@ void EmitWriteStorageU8(EmitContext& ctx, const IR::Value& binding, const IR::Va WriteStorage(ctx, binding, offset, ctx.OpSConvert(ctx.U8, value), ctx.storage_types.U8, sizeof(u8), &StorageDefinitions::U8); } else { - WriteStorageByCasLoop(ctx, binding, offset, value, ctx.BitOffset8(offset), ctx.Const(8u)); + WriteStorageBits(ctx, binding, offset, value, ctx.BitOffset8(offset), ctx.Const(8u)); } } @@ -250,7 +228,7 @@ void EmitWriteStorageS8(EmitContext& ctx, const IR::Value& binding, const IR::Va WriteStorage(ctx, binding, offset, ctx.OpSConvert(ctx.S8, value), ctx.storage_types.S8, sizeof(s8), &StorageDefinitions::S8); } else { - WriteStorageByCasLoop(ctx, binding, offset, value, ctx.BitOffset8(offset), ctx.Const(8u)); + WriteStorageBits(ctx, binding, offset, value, ctx.BitOffset8(offset), ctx.Const(8u)); } } @@ -261,7 +239,7 @@ void EmitWriteStorageU16(EmitContext& ctx, const IR::Value& binding, const IR::V WriteStorage(ctx, binding, offset, ctx.OpSConvert(ctx.U16, value), ctx.storage_types.U16, sizeof(u16), &StorageDefinitions::U16); } else { - WriteStorageByCasLoop(ctx, binding, offset, value, ctx.BitOffset16(offset), ctx.Const(16u)); + WriteStorageBits(ctx, binding, offset, value, ctx.BitOffset16(offset), ctx.Const(16u)); } } @@ -272,7 +250,7 @@ void EmitWriteStorageS16(EmitContext& ctx, const IR::Value& binding, const IR::V WriteStorage(ctx, binding, offset, ctx.OpSConvert(ctx.S16, value), ctx.storage_types.S16, sizeof(s16), &StorageDefinitions::S16); } else { - WriteStorageByCasLoop(ctx, binding, offset, value, ctx.BitOffset16(offset), ctx.Const(16u)); + WriteStorageBits(ctx, binding, offset, value, ctx.BitOffset16(offset), ctx.Const(16u)); } } diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index c5471a6f71..605de049d6 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -486,8 +486,7 @@ EmitContext::EmitContext(const Profile& profile_, const RuntimeInfo& runtime_inf DefineTextures(program.info, texture_binding, bindings.texture_scaling_index); DefineImages(program.info, image_binding, bindings.image_scaling_index); DefineAttributeMemAccess(program.info); - DefineWriteStorageCasLoopFunction(program.info); - DefineGlobalMemoryFunctions(program.info); + DefineGlobalMemoryFunctions(program); DefineRescalingInput(program.info); DefineRenderArea(program.info); } @@ -532,6 +531,24 @@ Id EmitContext::BitOffset16(const IR::Value& offset) { return OpBitwiseAnd(U32[1], OpShiftLeftLogical(U32[1], Def(offset), Const(3u)), Const(16u)); } +Id EmitContext::CallGlobalMemory(IR::Opcode opcode, Id result_type, Id address, Id value) { + if (profile.support_int64) { + return OpFunctionCall(result_type, global_memory_funcs.at(opcode), address, value); + } + if (result_type.value == void_id.value) { + return Id{}; + } + return ConstantNull(result_type); +} + +void EmitContext::AtomicBitFieldInsert(Id pointer, Id value, Id offset, Id count) { + const Id scope{Const(static_cast(spv::Scope::Device))}; + const Id mask{OpBitFieldInsert(U32[1], u32_zero_value, Const(0xFFFFFFFFU), offset, count)}; + const Id bits{OpBitFieldInsert(U32[1], u32_zero_value, value, offset, count)}; + OpAtomicAnd(U32[1], pointer, scope, u32_zero_value, OpNot(U32[1], mask)); + OpAtomicOr(U32[1], pointer, scope, u32_zero_value, bits); +} + void EmitContext::DefineCommonTypes(const Info& info) { void_id = TypeVoid(); @@ -889,142 +906,241 @@ void EmitContext::DefineAttributeMemAccess(const Info& info) { } } -void EmitContext::DefineWriteStorageCasLoopFunction(const Info& info) { - if (profile.support_int8 && profile.support_int16) { - return; - } - if (!info.uses_int8 && !info.uses_int16) { - return; - } - - AddCapability(spv::Capability::VariablePointersStorageBuffer); - - const Id ptr_type{TypePointer(spv::StorageClass::StorageBuffer, U32[1])}; - const Id func_type{TypeFunction(void_id, ptr_type, U32[1], U32[1], U32[1])}; - const Id func{OpFunction(void_id, spv::FunctionControlMask::MaskNone, func_type)}; - const Id pointer{OpFunctionParameter(ptr_type)}; - const Id value{OpFunctionParameter(U32[1])}; - const Id bit_offset{OpFunctionParameter(U32[1])}; - const Id bit_count{OpFunctionParameter(U32[1])}; - - AddLabel(); - const Id scope_device{Const(1u)}; - const Id ordering_relaxed{u32_zero_value}; - const Id body_label{OpLabel()}; - const Id continue_label{OpLabel()}; - const Id endloop_label{OpLabel()}; - const Id beginloop_label{OpLabel()}; - OpBranch(beginloop_label); - - AddLabel(beginloop_label); - OpLoopMerge(endloop_label, continue_label, spv::LoopControlMask::MaskNone); - OpBranch(body_label); - - AddLabel(body_label); - const Id expected_value{OpLoad(U32[1], pointer)}; - const Id desired_value{OpBitFieldInsert(U32[1], expected_value, value, bit_offset, bit_count)}; - const Id actual_value{OpAtomicCompareExchange(U32[1], pointer, scope_device, ordering_relaxed, - ordering_relaxed, desired_value, expected_value)}; - const Id store_successful{OpIEqual(U1, expected_value, actual_value)}; - OpBranchConditional(store_successful, endloop_label, continue_label); - - AddLabel(endloop_label); - OpReturn(); - - AddLabel(continue_label); - OpBranch(beginloop_label); - - OpFunctionEnd(); - - write_storage_cas_loop_func = func; -} - -void EmitContext::DefineGlobalMemoryFunctions(const Info& info) { +void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { + const Info& info{program.info}; if (!info.uses_global_memory || !profile.support_int64) { return; } - using DefPtr = Id StorageDefinitions::*; const Id zero{u32_zero_value}; - const auto define_body{[&](DefPtr ssbo_member, Id addr, Id element_pointer, u32 shift, - auto&& callback) { + const Id scope{Const(static_cast(spv::Scope::Device))}; + const Id align_mask{Const(~(static_cast(profile.min_ssbo_alignment) - 1U))}; + const auto word_pointer{[&](Id ssbo, Id word, u32 element) { + return OpAccessChain(storage_types.U32.element, ssbo, zero, + OpIAdd(U32[1], word, Const(element))); + }}; + const auto cbuf_word{[&](u32 index, u32 offset) { + if (profile.support_descriptor_aliasing) { + return OpLoad(U32[1], OpAccessChain(uniform_types.U32, cbufs[index].U32, zero, + Const(offset / 4))); + } + const Id vector{OpLoad(U32[4], OpAccessChain(uniform_types.U32x4, cbufs[index].U32x4, + zero, Const(offset / 16)))}; + return OpCompositeExtract(U32[1], vector, (offset / 4) % 4); + }}; + const auto bits{[&](Id offset, u32 count) { + return OpBitwiseAnd(U32[1], OpShiftLeftLogical(U32[1], offset, Const(3U)), + Const(32U - count)); + }}; + const auto define{[&](IR::Opcode opcode, Id result_type, Id value_type, auto&& callback) { + const std::array params{U64, value_type}; + const Id func{OpFunction(result_type, spv::FunctionControlMask::MaskNone, + TypeFunction(result_type, params))}; + const Id addr{OpFunctionParameter(U64)}; + const Id value{OpFunctionParameter(value_type)}; + const bool returns_value{result_type.value != void_id.value}; AddLabel(); const Id addr_words{OpBitcast(U32[2], addr)}; const Id addr_low{OpCompositeExtract(U32[1], addr_words, 0U)}; const Id addr_high{OpCompositeExtract(U32[1], addr_words, 1U)}; - const Id align_mask{Const(~(static_cast(profile.min_ssbo_alignment) - 1U))}; - const size_t num_buffers{info.storage_buffers_descriptors.size()}; - for (size_t index = 0; index < num_buffers; ++index) { - const auto& ssbo{info.storage_buffers_descriptors[index]}; - if (!ssbo.is_global_fallback) { + for (size_t index = 0; index < info.storage_buffers_descriptors.size(); ++index) { + const auto& desc{info.storage_buffers_descriptors[index]}; + if (!desc.is_global_fallback) { continue; } - const Id ssbo_addr_cbuf_offset{Const(ssbo.cbuf_offset / 8)}; - const Id ssbo_size_cbuf_offset{Const(ssbo.cbuf_offset / 4 + 2)}; - const Id ssbo_addr_pointer{OpAccessChain( - uniform_types.U32x2, cbufs[ssbo.cbuf_index].U32x2, zero, ssbo_addr_cbuf_offset)}; - const Id ssbo_size_pointer{OpAccessChain(uniform_types.U32, cbufs[ssbo.cbuf_index].U32, - zero, ssbo_size_cbuf_offset)}; - - const Id ssbo_addr{OpLoad(U32[2], ssbo_addr_pointer)}; const Id ssbo_low{ - OpBitwiseAnd(U32[1], OpCompositeExtract(U32[1], ssbo_addr, 0U), align_mask)}; - const Id ssbo_high{OpCompositeExtract(U32[1], ssbo_addr, 1U)}; - const Id ssbo_size{OpLoad(U32[1], ssbo_size_pointer)}; - const Id ssbo_offset{OpISub(U32[1], addr_low, ssbo_low)}; + OpBitwiseAnd(U32[1], cbuf_word(desc.cbuf_index, desc.cbuf_offset), align_mask)}; + const Id ssbo_high{cbuf_word(desc.cbuf_index, desc.cbuf_offset + 4)}; + const Id ssbo_size{cbuf_word(desc.cbuf_index, desc.cbuf_offset + 8)}; + const Id offset{OpISub(U32[1], addr_low, ssbo_low)}; const Id borrow{ OpSelect(U32[1], OpULessThan(U1, addr_low, ssbo_low), Const(1U), zero)}; - const Id cond{ - OpLogicalAnd(U1, OpULessThan(U1, ssbo_offset, ssbo_size), - OpIEqual(U1, OpISub(U32[1], addr_high, borrow), ssbo_high))}; + const Id cond{OpLogicalAnd(U1, OpULessThan(U1, offset, ssbo_size), + OpIEqual(U1, OpISub(U32[1], addr_high, borrow), ssbo_high))}; const Id then_label{OpLabel()}; const Id else_label{OpLabel()}; OpSelectionMerge(else_label, spv::SelectionControlMask::MaskNone); OpBranchConditional(cond, then_label, else_label); AddLabel(then_label); - const Id ssbo_id{ssbos[index].*ssbo_member}; - const Id ssbo_index{OpShiftRightLogical(U32[1], ssbo_offset, Const(shift))}; - const Id ssbo_pointer{OpAccessChain(element_pointer, ssbo_id, zero, ssbo_index)}; - callback(ssbo_pointer); + const Id word{OpShiftRightLogical(U32[1], offset, Const(2U))}; + const Id result{callback(ssbos[index].U32, word, offset, value)}; + if (returns_value) { + OpReturnValue(result); + } else { + OpReturn(); + } AddLabel(else_label); } - }}; - const auto define_load{[&](DefPtr ssbo_member, Id element_pointer, Id type, u32 shift) { - const Id function_type{TypeFunction(type, U64)}; - const Id func_id{OpFunction(type, spv::FunctionControlMask::MaskNone, function_type)}; - const Id addr{OpFunctionParameter(U64)}; - define_body(ssbo_member, addr, element_pointer, shift, - [&](Id ssbo_pointer) { OpReturnValue(OpLoad(type, ssbo_pointer)); }); - OpReturnValue(ConstantNull(type)); - OpFunctionEnd(); - return func_id; - }}; - const auto define_write{[&](DefPtr ssbo_member, Id element_pointer, Id type, u32 shift) { - const Id function_type{TypeFunction(void_id, U64, type)}; - const Id func_id{OpFunction(void_id, spv::FunctionControlMask::MaskNone, function_type)}; - const Id addr{OpFunctionParameter(U64)}; - const Id data{OpFunctionParameter(type)}; - define_body(ssbo_member, addr, element_pointer, shift, [&](Id ssbo_pointer) { - OpStore(ssbo_pointer, data); + if (returns_value) { + OpReturnValue(ConstantNull(result_type)); + } else { OpReturn(); - }); - OpReturn(); + } OpFunctionEnd(); - return func_id; + global_memory_funcs.emplace(opcode, func); }}; - const auto define{ - [&](DefPtr ssbo_member, const StorageTypeDefinition& type_def, Id type, size_t size) { - const Id element_type{type_def.element}; - const u32 shift{static_cast(std::countr_zero(size))}; - const Id load_func{define_load(ssbo_member, element_type, type, shift)}; - const Id write_func{define_write(ssbo_member, element_type, type, shift)}; - return std::make_pair(load_func, write_func); - }}; - std::tie(load_global_func_u32, write_global_func_u32) = - define(&StorageDefinitions::U32, storage_types.U32, U32[1], sizeof(u32)); - std::tie(load_global_func_u32x2, write_global_func_u32x2) = - define(&StorageDefinitions::U32x2, storage_types.U32x2, U32[2], sizeof(u32[2])); - std::tie(load_global_func_u32x4, write_global_func_u32x4) = - define(&StorageDefinitions::U32x4, storage_types.U32x4, U32[4], sizeof(u32[4])); + const auto load{[&](Id type, u32 count) { + return [&, type, count](Id ssbo, Id word, Id, Id) { + std::array words{}; + for (u32 element = 0; element < count; ++element) { + words[element] = OpLoad(U32[1], word_pointer(ssbo, word, element)); + } + if (count == 1) { + return words[0]; + } + return OpCompositeConstruct(type, std::span(words.data(), count)); + }; + }}; + const auto store{[&](u32 count) { + return [&, count](Id ssbo, Id word, Id, Id value) { + if (count == 1) { + OpStore(word_pointer(ssbo, word, 0), value); + return Id{}; + } + for (u32 element = 0; element < count; ++element) { + OpStore(word_pointer(ssbo, word, element), + OpCompositeExtract(U32[1], value, element)); + } + return Id{}; + }; + }}; + const auto extract{[&](bool is_signed, u32 count) { + return [&, is_signed, count](Id ssbo, Id word, Id offset, Id) { + const Id loaded{OpLoad(U32[1], word_pointer(ssbo, word, 0))}; + if (is_signed) { + return OpBitFieldSExtract(U32[1], loaded, bits(offset, count), Const(count)); + } + return OpBitFieldUExtract(U32[1], loaded, bits(offset, count), Const(count)); + }; + }}; + const auto insert{[&](u32 count) { + return [&, count](Id ssbo, Id word, Id offset, Id value) { + AtomicBitFieldInsert(word_pointer(ssbo, word, 0), value, bits(offset, count), + Const(count)); + return Id{}; + }; + }}; + const auto atomic{[&](Id (Sirit::Module::*func)(Id, Id, Id, Id, Id)) { + return [&, func](Id ssbo, Id word, Id, Id value) { + return (this->*func)(U32[1], word_pointer(ssbo, word, 0), scope, zero, value); + }; + }}; + const auto cas{[&](Id type, Id helper) { + return [&, type, helper](Id ssbo, Id word, Id, Id value) { + return OpFunctionCall(type, helper, word, value, ssbo); + }; + }}; + const auto packed{[&](bool is_half, Id helper) { + return [&, is_half, helper](Id ssbo, Id word, Id, Id value) { + if (is_half) { + return OpBitcast(U32[1], OpFunctionCall(F16[2], helper, word, value, ssbo)); + } + return OpPackHalf2x16(U32[1], OpFunctionCall(F32[2], helper, word, value, ssbo)); + }; + }}; + for (const IR::Block* const block : program.post_order_blocks) { + for (const IR::Inst& inst : block->Instructions()) { + const IR::Opcode opcode{inst.GetOpcode()}; + if (global_memory_funcs.contains(opcode)) { + continue; + } + switch (opcode) { + case IR::Opcode::LoadGlobalU8: + define(opcode, U32[1], U32[1], extract(false, 8)); + break; + case IR::Opcode::LoadGlobalS8: + define(opcode, U32[1], U32[1], extract(true, 8)); + break; + case IR::Opcode::LoadGlobalU16: + define(opcode, U32[1], U32[1], extract(false, 16)); + break; + case IR::Opcode::LoadGlobalS16: + define(opcode, U32[1], U32[1], extract(true, 16)); + break; + case IR::Opcode::LoadGlobal32: + define(opcode, U32[1], U32[1], load(U32[1], 1)); + break; + case IR::Opcode::LoadGlobal64: + define(opcode, U32[2], U32[1], load(U32[2], 2)); + break; + case IR::Opcode::LoadGlobal128: + define(opcode, U32[4], U32[1], load(U32[4], 4)); + break; + case IR::Opcode::WriteGlobalU8: + case IR::Opcode::WriteGlobalS8: + define(opcode, void_id, U32[1], insert(8)); + break; + case IR::Opcode::WriteGlobalU16: + case IR::Opcode::WriteGlobalS16: + define(opcode, void_id, U32[1], insert(16)); + break; + case IR::Opcode::WriteGlobal32: + define(opcode, void_id, U32[1], store(1)); + break; + case IR::Opcode::WriteGlobal64: + define(opcode, void_id, U32[2], store(2)); + break; + case IR::Opcode::WriteGlobal128: + define(opcode, void_id, U32[4], store(4)); + break; + case IR::Opcode::GlobalAtomicIAdd32: + define(opcode, U32[1], U32[1], atomic(&Sirit::Module::OpAtomicIAdd)); + break; + case IR::Opcode::GlobalAtomicSMin32: + define(opcode, U32[1], U32[1], atomic(&Sirit::Module::OpAtomicSMin)); + break; + case IR::Opcode::GlobalAtomicUMin32: + define(opcode, U32[1], U32[1], atomic(&Sirit::Module::OpAtomicUMin)); + break; + case IR::Opcode::GlobalAtomicSMax32: + define(opcode, U32[1], U32[1], atomic(&Sirit::Module::OpAtomicSMax)); + break; + case IR::Opcode::GlobalAtomicUMax32: + define(opcode, U32[1], U32[1], atomic(&Sirit::Module::OpAtomicUMax)); + break; + case IR::Opcode::GlobalAtomicAnd32: + define(opcode, U32[1], U32[1], atomic(&Sirit::Module::OpAtomicAnd)); + break; + case IR::Opcode::GlobalAtomicOr32: + define(opcode, U32[1], U32[1], atomic(&Sirit::Module::OpAtomicOr)); + break; + case IR::Opcode::GlobalAtomicXor32: + define(opcode, U32[1], U32[1], atomic(&Sirit::Module::OpAtomicXor)); + break; + case IR::Opcode::GlobalAtomicExchange32: + define(opcode, U32[1], U32[1], atomic(&Sirit::Module::OpAtomicExchange)); + break; + case IR::Opcode::GlobalAtomicInc32: + define(opcode, U32[1], U32[1], cas(U32[1], increment_cas_ssbo)); + break; + case IR::Opcode::GlobalAtomicDec32: + define(opcode, U32[1], U32[1], cas(U32[1], decrement_cas_ssbo)); + break; + case IR::Opcode::GlobalAtomicAddF32: + define(opcode, F32[1], F32[1], cas(F32[1], f32_add_cas)); + break; + case IR::Opcode::GlobalAtomicAddF16x2: + define(opcode, U32[1], F16[2], packed(true, f16x2_add_cas)); + break; + case IR::Opcode::GlobalAtomicMinF16x2: + define(opcode, U32[1], F16[2], packed(true, f16x2_min_cas)); + break; + case IR::Opcode::GlobalAtomicMaxF16x2: + define(opcode, U32[1], F16[2], packed(true, f16x2_max_cas)); + break; + case IR::Opcode::GlobalAtomicAddF32x2: + define(opcode, U32[1], F32[2], packed(false, f32x2_add_cas)); + break; + case IR::Opcode::GlobalAtomicMinF32x2: + define(opcode, U32[1], F32[2], packed(false, f32x2_min_cas)); + break; + case IR::Opcode::GlobalAtomicMaxF32x2: + define(opcode, U32[1], F32[2], packed(false, f32x2_max_cas)); + break; + default: + break; + } + } + } } void EmitContext::DefineRescalingInput(const Info& info) { diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index a5821e9e93..68761e1f1a 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include "common/container/unordered_set.h" @@ -173,6 +174,9 @@ public: [[nodiscard]] Id BitOffset8(const IR::Value& offset); [[nodiscard]] Id BitOffset16(const IR::Value& offset); + Id CallGlobalMemory(IR::Opcode opcode, Id result_type, Id address, Id value); + void AtomicBitFieldInsert(Id pointer, Id value, Id offset, Id count); + Id Const(u32 value) { return Constant(U32[1], value); } @@ -335,14 +339,7 @@ public: Id f32x2_min_cas{}; Id f32x2_max_cas{}; - Id write_storage_cas_loop_func{}; - - Id load_global_func_u32{}; - Id load_global_func_u32x2{}; - Id load_global_func_u32x4{}; - Id write_global_func_u32{}; - Id write_global_func_u32x2{}; - Id write_global_func_u32x4{}; + std::unordered_map global_memory_funcs; bool need_input_position_indirect{}; Id input_position{}; @@ -393,8 +390,7 @@ private: void DefineTextures(const Info& info, u32& binding, u32& scaling_index); void DefineImages(const Info& info, u32& binding, u32& scaling_index); void DefineAttributeMemAccess(const Info& info); - void DefineWriteStorageCasLoopFunction(const Info& info); - void DefineGlobalMemoryFunctions(const Info& info); + void DefineGlobalMemoryFunctions(const IR::Program& program); void DefineRescalingInput(const Info& info); void DefineRescalingInputPushConstant(); void DefineRescalingInputUniformConstant(); diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp index 75087777dd..9497c33e30 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project @@ -93,7 +93,7 @@ IR::U64 AtomOffset(TranslatorVisitor& v, u64 insn) { } const mem{insn}; const IR::U64 address{[&]() -> IR::U64 { - if (mem.e == 0) + if (mem.e == 0 || mem.addr_reg == IR::Reg::RZ) return v.ir.UConvert(64, v.X(mem.addr_reg)); return v.L(mem.addr_reg); }()}; @@ -108,14 +108,9 @@ IR::U64 AtomOffset(TranslatorVisitor& v, u64 insn) { return v.ir.IAdd(address, v.ir.Imm64(addr_offset)); } -// INC, DEC for U32/S32/U64 does nothing -// ADD, INC, DEC for S64 does nothing -// Only ADD does something for F32 -// Only ADD, MIN and MAX does something for F16x2 bool AtomOpNotApplicable(AtomSize size, AtomOp op) { // TODO: SAFEADD switch (size) { - case AtomSize::U32: case AtomSize::S32: case AtomSize::U64: return (op == AtomOp::INC || op == AtomOp::DEC); diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp index aa494e24cc..c210f634b0 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project @@ -36,6 +36,12 @@ void TranslatorVisitor::DEPBAR(u64) { // DEPBAR is a no-op } +void TranslatorVisitor::CCTL(u64) {} + +void TranslatorVisitor::CCTLL(u64) {} + +void TranslatorVisitor::CCTLT(u64) {} + void TranslatorVisitor::BAR(u64 insn) { enum class Mode { RedPopc, diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp index 8f2cf897d4..d700a05d59 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -55,7 +58,7 @@ IR::U64 Address(TranslatorVisitor& v, u64 insn) { } const mem{insn}; const IR::U64 address{[&]() -> IR::U64 { - if (mem.e == 0) { + if (mem.e == 0 || mem.addr_reg == IR::Reg::RZ) { // LDG/STG without .E uses a 32-bit pointer, zero-extend it return v.ir.UConvert(64, v.X(mem.addr_reg)); } diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp index 369af8e03a..5e12c37430 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project @@ -43,18 +43,6 @@ void TranslatorVisitor::CAL(u64) { // CAL is a no-op } -void TranslatorVisitor::CCTL(u64) { - ThrowNotImplemented(Opcode::CCTL); -} - -void TranslatorVisitor::CCTLL(u64) { - ThrowNotImplemented(Opcode::CCTLL); -} - -void TranslatorVisitor::CCTLT(u64) { - ThrowNotImplemented(Opcode::CCTLT); -} - void TranslatorVisitor::CONT(u64) { ThrowNotImplemented(Opcode::CONT); } diff --git a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp index 9010c2bf68..def242be8f 100644 --- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp +++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp @@ -424,8 +424,8 @@ void VisitUsages(Info& info, IR::Inst& inst) { case IR::Opcode::LoadGlobal128: info.uses_int64 = true; info.uses_global_memory = true; - info.used_constant_buffer_types |= IR::Type::U32 | IR::Type::U32x2; - info.used_storage_buffer_types |= IR::Type::U32 | IR::Type::U32x2 | IR::Type::U32x4; + info.used_constant_buffer_types |= IR::Type::U32; + info.used_storage_buffer_types |= IR::Type::U32; break; case IR::Opcode::LoadLocal: case IR::Opcode::WriteLocal: From 213d9fb4a7c13b12ac296d3d07e72d47af942122 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 29 Sep 2026 17:46:53 -0400 Subject: [PATCH 124/198] Just force reads on 8/16bits --- .../backend/spirv/spirv_emit_context.cpp | 49 +++++--- .../ir_opt/collect_shader_info_pass.cpp | 4 + .../ir_opt/constant_propagation_pass.cpp | 16 +++ .../global_memory_to_storage_buffer_pass.cpp | 110 +++++++++++++++--- 4 files changed, 144 insertions(+), 35 deletions(-) diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index 605de049d6..f174251625 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -962,7 +962,7 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { OpBranchConditional(cond, then_label, else_label); AddLabel(then_label); const Id word{OpShiftRightLogical(U32[1], offset, Const(2U))}; - const Id result{callback(ssbos[index].U32, word, offset, value)}; + const Id result{callback(ssbos[index], word, offset, value)}; if (returns_value) { OpReturnValue(result); } else { @@ -978,11 +978,22 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { OpFunctionEnd(); global_memory_funcs.emplace(opcode, func); }}; + const auto vector_pointer{[&](const StorageDefinitions& ssbo, Id word, u32 count) { + if (count == 2) { + return OpAccessChain(storage_types.U32x2.element, ssbo.U32x2, zero, + OpShiftRightLogical(U32[1], word, Const(1U))); + } + return OpAccessChain(storage_types.U32x4.element, ssbo.U32x4, zero, + OpShiftRightLogical(U32[1], word, Const(2U))); + }}; const auto load{[&](Id type, u32 count) { - return [&, type, count](Id ssbo, Id word, Id, Id) { + return [&, type, count](const StorageDefinitions& ssbo, Id word, Id, Id) { + if (count > 1 && profile.support_descriptor_aliasing) { + return OpLoad(type, vector_pointer(ssbo, word, count)); + } std::array words{}; for (u32 element = 0; element < count; ++element) { - words[element] = OpLoad(U32[1], word_pointer(ssbo, word, element)); + words[element] = OpLoad(U32[1], word_pointer(ssbo.U32, word, element)); } if (count == 1) { return words[0]; @@ -991,21 +1002,25 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { }; }}; const auto store{[&](u32 count) { - return [&, count](Id ssbo, Id word, Id, Id value) { + return [&, count](const StorageDefinitions& ssbo, Id word, Id, Id value) { + if (count > 1 && profile.support_descriptor_aliasing) { + OpStore(vector_pointer(ssbo, word, count), value); + return Id{}; + } if (count == 1) { - OpStore(word_pointer(ssbo, word, 0), value); + OpStore(word_pointer(ssbo.U32, word, 0), value); return Id{}; } for (u32 element = 0; element < count; ++element) { - OpStore(word_pointer(ssbo, word, element), + OpStore(word_pointer(ssbo.U32, word, element), OpCompositeExtract(U32[1], value, element)); } return Id{}; }; }}; const auto extract{[&](bool is_signed, u32 count) { - return [&, is_signed, count](Id ssbo, Id word, Id offset, Id) { - const Id loaded{OpLoad(U32[1], word_pointer(ssbo, word, 0))}; + return [&, is_signed, count](const StorageDefinitions& ssbo, Id word, Id offset, Id) { + const Id loaded{OpLoad(U32[1], word_pointer(ssbo.U32, word, 0))}; if (is_signed) { return OpBitFieldSExtract(U32[1], loaded, bits(offset, count), Const(count)); } @@ -1013,28 +1028,28 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { }; }}; const auto insert{[&](u32 count) { - return [&, count](Id ssbo, Id word, Id offset, Id value) { - AtomicBitFieldInsert(word_pointer(ssbo, word, 0), value, bits(offset, count), + return [&, count](const StorageDefinitions& ssbo, Id word, Id offset, Id value) { + AtomicBitFieldInsert(word_pointer(ssbo.U32, word, 0), value, bits(offset, count), Const(count)); return Id{}; }; }}; const auto atomic{[&](Id (Sirit::Module::*func)(Id, Id, Id, Id, Id)) { - return [&, func](Id ssbo, Id word, Id, Id value) { - return (this->*func)(U32[1], word_pointer(ssbo, word, 0), scope, zero, value); + return [&, func](const StorageDefinitions& ssbo, Id word, Id, Id value) { + return (this->*func)(U32[1], word_pointer(ssbo.U32, word, 0), scope, zero, value); }; }}; const auto cas{[&](Id type, Id helper) { - return [&, type, helper](Id ssbo, Id word, Id, Id value) { - return OpFunctionCall(type, helper, word, value, ssbo); + return [&, type, helper](const StorageDefinitions& ssbo, Id word, Id, Id value) { + return OpFunctionCall(type, helper, word, value, ssbo.U32); }; }}; const auto packed{[&](bool is_half, Id helper) { - return [&, is_half, helper](Id ssbo, Id word, Id, Id value) { + return [&, is_half, helper](const StorageDefinitions& ssbo, Id word, Id, Id value) { if (is_half) { - return OpBitcast(U32[1], OpFunctionCall(F16[2], helper, word, value, ssbo)); + return OpBitcast(U32[1], OpFunctionCall(F16[2], helper, word, value, ssbo.U32)); } - return OpPackHalf2x16(U32[1], OpFunctionCall(F32[2], helper, word, value, ssbo)); + return OpPackHalf2x16(U32[1], OpFunctionCall(F32[2], helper, word, value, ssbo.U32)); }; }}; for (const IR::Block* const block : program.post_order_blocks) { diff --git a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp index def242be8f..441058c64d 100644 --- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp +++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp @@ -632,6 +632,8 @@ void VisitUsages(Info& info, IR::Inst& inst) { case IR::Opcode::StorageAtomicExchange32: info.used_storage_buffer_types |= IR::Type::U32; break; + case IR::Opcode::LoadGlobal64: + case IR::Opcode::WriteGlobal64: case IR::Opcode::LoadStorage64: case IR::Opcode::WriteStorage64: case IR::Opcode::StorageAtomicIAdd32x2: @@ -645,6 +647,8 @@ void VisitUsages(Info& info, IR::Inst& inst) { case IR::Opcode::StorageAtomicExchange32x2: info.used_storage_buffer_types |= IR::Type::U32x2; break; + case IR::Opcode::LoadGlobal128: + case IR::Opcode::WriteGlobal128: case IR::Opcode::LoadStorage128: case IR::Opcode::WriteStorage128: info.used_storage_buffer_types |= IR::Type::U32x4; diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp index 6285fef16f..279d32d9e4 100644 --- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp +++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp @@ -414,6 +414,14 @@ void FoldSelect(IR::Inst& inst) { } } +void FoldAtomicWrap(IR::Inst& inst, IR::Opcode opcode, u32 addend) { + const IR::Value limit{inst.Arg(1)}; + if (limit.IsImmediate() && limit.U32() == 0xFFFFFFFFU) { + inst.ReplaceOpcode(opcode); + inst.SetArg(1, IR::Value{addend}); + } +} + void FoldFPAdd32(IR::Inst& inst) { if (FoldWhenAllImmediates(inst, [](f32 a, f32 b) { return a + b; })) { return; @@ -1104,6 +1112,14 @@ void ConstantPropagation(Environment& env, IR::Block& block, IR::Inst& inst) { IR::Opcode::CompositeInsertF16x4); case IR::Opcode::FSwizzleAdd: return FoldFSwizzleAdd(block, inst); + case IR::Opcode::GlobalAtomicInc32: + return FoldAtomicWrap(inst, IR::Opcode::GlobalAtomicIAdd32, 1U); + case IR::Opcode::GlobalAtomicDec32: + return FoldAtomicWrap(inst, IR::Opcode::GlobalAtomicIAdd32, 0xFFFFFFFFU); + case IR::Opcode::SharedAtomicInc32: + return FoldAtomicWrap(inst, IR::Opcode::SharedAtomicIAdd32, 1U); + case IR::Opcode::SharedAtomicDec32: + return FoldAtomicWrap(inst, IR::Opcode::SharedAtomicIAdd32, 0xFFFFFFFFU); case IR::Opcode::GetCbufF32: case IR::Opcode::GetCbufU32: if (env.HasHLEMacroState()) { diff --git a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp index ba05295fab..bf40b0695b 100644 --- a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp +++ b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp @@ -4,14 +4,15 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include +#include #include #include #include "common/alignment.h" #include "shader_recompiler/frontend/ir/basic_block.h" -#include "shader_recompiler/frontend/ir/breadth_first_search.h" #include "shader_recompiler/frontend/ir/ir_emitter.h" #include "shader_recompiler/frontend/ir/value.h" #include "shader_recompiler/host_translate_info.h" @@ -49,6 +50,7 @@ using StorageBufferSet = using StorageInstVector = small_vector; using StorageWritesSet = flat_set, small_vector>; +using LocalStores = std::multimap; struct StorageInfo { StorageBufferSet set; @@ -333,7 +335,7 @@ std::optional TrackLowAddress(IR::Inst* inst) { } /// Tries to track the storage buffer address used by a global memory instruction -std::optional Track(const IR::Value& value, const Bias* bias) { +StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStores& local_stores) { const auto pred{[bias](const IR::Inst* inst) -> std::optional { if (inst->GetOpcode() != IR::Opcode::GetCbufU32 && inst->GetOpcode() != IR::Opcode::GetCbufU32x2) { @@ -366,11 +368,83 @@ std::optional Track(const IR::Value& value, const Bias* bias) } return storage_buffer; }}; - return BreadthFirstSearch(value, pred); + StorageBufferSet result; + std::unordered_set visited; + small_vector pending; + const auto push{[&](const IR::Value& arg) { + if (!arg.IsImmediate() && visited.insert(arg.InstRecursive()).second) { + pending.push_back(arg.InstRecursive()); + } + }}; + push(value); + while (!pending.empty()) { + const IR::Inst* const inst{pending.back()}; + pending.pop_back(); + if (const std::optional storage_buffer{pred(inst)}) { + result.insert(*storage_buffer); + continue; + } + switch (inst->GetOpcode()) { + case IR::Opcode::LoadLocal: + if (inst->Arg(0).IsImmediate()) { + const auto [begin, end]{local_stores.equal_range(inst->Arg(0).U32())}; + for (auto it = begin; it != end; ++it) { + push(it->second); + } + } + continue; + case IR::Opcode::SelectU32: + case IR::Opcode::SelectU64: + push(inst->Arg(1)); + push(inst->Arg(2)); + continue; + case IR::Opcode::GetCbufU8: + case IR::Opcode::GetCbufS8: + case IR::Opcode::GetCbufU16: + case IR::Opcode::GetCbufS16: + case IR::Opcode::GetCbufU32: + case IR::Opcode::GetCbufF32: + case IR::Opcode::GetCbufU32x2: + case IR::Opcode::LoadSharedU8: + case IR::Opcode::LoadSharedS8: + case IR::Opcode::LoadSharedU16: + case IR::Opcode::LoadSharedS16: + case IR::Opcode::LoadSharedU32: + case IR::Opcode::LoadSharedU64: + case IR::Opcode::LoadSharedU128: + continue; + default: + break; + } + if (IsGlobalMemory(*inst) || inst->MayHaveSideEffects()) { + continue; + } + for (size_t arg = 0; arg < inst->NumArgs(); ++arg) { + push(inst->Arg(arg)); + } + } + return result; +} + +LocalStores GatherLocalStores(const IR::Program& program) { + LocalStores stores; + for (IR::Block* const block : program.post_order_blocks) { + for (const IR::Inst& inst : block->Instructions()) { + if (inst.GetOpcode() != IR::Opcode::WriteLocal) { + continue; + } + if (!inst.Arg(0).IsImmediate()) { + return {}; + } + stores.emplace(inst.Arg(0).U32(), inst.Arg(1)); + } + } + return stores; } /// Collects the storage buffer used by a global memory instruction and the instruction itself -void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info) { +void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info, + const LocalStores& local_stores) { // NVN puts storage buffers in a specific range, we have to bias towards these addresses to // avoid getting false positives static constexpr Bias nvn_bias{ @@ -387,25 +461,24 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info) } // First try to find storage buffers in the NVN address const IR::U32 low_addr{low_addr_info->value}; - std::optional storage_buffer{Track(low_addr, &nvn_bias)}; - if (!storage_buffer) { + StorageBufferSet candidates{Track(low_addr, &nvn_bias, local_stores)}; + if (candidates.empty()) { // If it fails, track without a bias - storage_buffer = Track(low_addr, nullptr); - if (!storage_buffer) { - // If that also fails, use NVN fallbacks - LOG_WARNING(Shader, "Storage buffer failed to track, using global memory fallbacks"); - return; - } - LOG_WARNING(Shader, "Storage buffer tracked without bias, index {} offset {}", - storage_buffer->index, storage_buffer->offset); + candidates = Track(low_addr, nullptr, local_stores); } + if (candidates.size() != 1) { + // If that also fails, use NVN fallbacks + LOG_WARNING(Shader, "Storage buffer failed to track, using global memory fallbacks"); + return; + } + const StorageBufferAddr storage_buffer{*candidates.begin()}; // Collect storage buffer and the instruction if (IsGlobalMemoryWrite(inst)) { - info.writes.insert(*storage_buffer); + info.writes.insert(storage_buffer); } - info.set.insert(*storage_buffer); + info.set.insert(storage_buffer); info.to_replace.push_back(StorageInst{ - .storage_buffer{*storage_buffer}, + .storage_buffer{storage_buffer}, .inst = &inst, .block = &block, }); @@ -525,12 +598,13 @@ void Replace(IR::Block& block, IR::Inst& inst, const IR::U32& storage_index, void GlobalMemoryToStorageBufferPass(IR::Program& program, const HostTranslateInfo& host_info) { StorageInfo info; + const LocalStores local_stores{GatherLocalStores(program)}; for (IR::Block* const block : program.post_order_blocks) { for (IR::Inst& inst : block->Instructions()) { if (!IsGlobalMemory(inst)) { continue; } - CollectStorageBuffers(*block, inst, info); + CollectStorageBuffers(*block, inst, info, local_stores); } } for (const StorageBufferAddr& storage_buffer : info.set) { From a82f31a310c5dc7cae50c47b3306510a24cc36a6 Mon Sep 17 00:00:00 2001 From: xbzk Date: Wed, 30 Sep 2026 00:57:23 +0200 Subject: [PATCH 125/198] [settings,qt] merge of "disable controller applet" toggle with "controller applet mode" picker (#4498) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Small good simplification to nuke a toggle which costed me almost an entire day of work when fixing controller applet issues: There were two settings related to Controller applet: -"disable controller applet", which is a boolean toggle; -"controller configuration" applet mode, which is a "Real"/"Custom" picker; All i did was to nuke the toggle and add a third option "Disabled" to the picker. Users which used the disable toggle will have to pick Disabled; Real/Custom settings wont be affected since their indexes remains. All options tested against diablo 3. All working as intended. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4498 Reviewed-by: lizzie Reviewed-by: MaranBr --- src/common/settings_enums.h | 2 +- src/qt_common/config/shared_translation.cpp | 4 +--- src/qt_common/config/uisettings.h | 2 -- src/yuzu/configuration/configure_applets.h | 4 +++- src/yuzu/configuration/shared_widget.cpp | 12 ++++++++---- src/yuzu/main_window.cpp | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index 55acb0ae8c..eaf3ec541d 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h @@ -150,7 +150,7 @@ ENUM(ScalingFilter, NearestNeighbor, Bilinear, Bicubic, Gaussian, Lanczos, Scale ENUM(AntiAliasing, None, Fxaa, Smaa); ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch); ENUM(ConsoleMode, Handheld, Docked); -ENUM(AppletMode, HLE, LLE); +ENUM(AppletMode, HLE, LLE, Disabled); ENUM(SpirvOptimizeMode, Never, OnLoad, Always); ENUM(GpuClock, Normal, Boost, Overclock) ENUM(GpuUnswizzleSize, VerySmall, Small, Normal, Large, VeryLarge) diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index d61c84e278..29fbd32de5 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -342,9 +342,6 @@ std::unique_ptr InitializeTranslations(QObject* parent) { "it bypasses such prompts and directly exits the emulation.")); INSERT(UISettings, hide_mouse, tr("Hide mouse on inactivity"), tr("Hides the mouse after 2.5s of inactivity.")); - INSERT(UISettings, controller_applet_disabled, tr("Disable controller applet"), - tr("Forcibly disables the use of the controller applet in emulated programs.\n" - "When a program attempts to open the controller applet, it is immediately closed.")); INSERT(UISettings, check_for_updates, tr("Check for updates"), tr("Whether or not to check for updates upon startup.")); @@ -380,6 +377,7 @@ std::unique_ptr ComboboxEnumeration(QObject* parent) { { PAIR(AppletMode, HLE, tr("Custom frontend")), PAIR(AppletMode, LLE, tr("Real applet")), + PAIR(AppletMode, Disabled, tr("Disabled")), }}); translations->insert({Settings::EnumMetadata::Index(), diff --git a/src/qt_common/config/uisettings.h b/src/qt_common/config/uisettings.h index 794d1a029b..a790cfcc22 100644 --- a/src/qt_common/config/uisettings.h +++ b/src/qt_common/config/uisettings.h @@ -127,8 +127,6 @@ struct Values { Setting hide_mouse{ linkage, true, "hideInactiveMouse", Category::UiGeneral, Settings::Specialization::Default, true, true}; - Setting controller_applet_disabled{linkage, false, "disableControllerApplet", - Category::UiGeneral}; // Set when Vulkan is known to crash the application bool has_broken_vulkan = false; diff --git a/src/yuzu/configuration/configure_applets.h b/src/yuzu/configuration/configure_applets.h index 54f494d2f1..b794b49e0b 100644 --- a/src/yuzu/configuration/configure_applets.h +++ b/src/yuzu/configuration/configure_applets.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -8,7 +11,6 @@ class QCheckBox; class QLineEdit; -class QComboBox; class QDateTimeEdit; namespace Core { class System; diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp index 0f59ee23a6..5e8e04be58 100644 --- a/src/yuzu/configuration/shared_widget.cpp +++ b/src/yuzu/configuration/shared_widget.cpp @@ -140,7 +140,12 @@ QWidget* Widget::CreateCombobox(std::function& serializer, if (combobox_enumerations.contains(type)) { enumeration = &combobox_enumerations.at(type); for (const auto& [id, name] : *enumeration) { - combobox->addItem(name); + if (type == Settings::EnumMetadata::Index() && + id == static_cast(Settings::AppletMode::Disabled) && + setting.Id() != Settings::values.controller_applet_mode.Id()) { + continue; + } + combobox->addItem(name, id); } } else { return combobox; @@ -158,9 +163,8 @@ QWidget* Widget::CreateCombobox(std::function& serializer, const u32 setting_value = std::strtoul(setting.ToString().c_str(), nullptr, 0); combobox->setCurrentIndex(find_index(setting_value)); - serializer = [this, enumeration]() { - int current = combobox->currentIndex(); - return std::to_string(enumeration->at(current).first); + serializer = [this]() { + return std::to_string(combobox->currentData().toUInt()); }; restore_func = [this, find_index]() { diff --git a/src/yuzu/main_window.cpp b/src/yuzu/main_window.cpp index e2807e80ff..60bfbae5cd 100644 --- a/src/yuzu/main_window.cpp +++ b/src/yuzu/main_window.cpp @@ -1786,7 +1786,7 @@ bool MainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPar QtCommon::system->SetFrontendAppletSet({ std::make_unique(*this), // Amiibo Settings - (UISettings::values.controller_applet_disabled.GetValue() == true) + (Settings::values.controller_applet_mode.GetValue() == Settings::AppletMode::Disabled) ? nullptr : std::make_unique(*this), // Controller Selector std::make_unique(*this), // Error Display From 3f78512c83fca84a36bb450a10043b368830f8b0 Mon Sep 17 00:00:00 2001 From: xbzk Date: Wed, 30 Sep 2026 00:58:29 +0200 Subject: [PATCH 126/198] [ro] add TLS patching for runtime NROs (#4492) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Aimed to fix Biomutant which stucks in a bootloop due to guest being unable to reach correct thread local storage (TLS) This fixes runtime NRO loading by properly patching the guest TLS (TPIDR_EL0) path. Steps: -Read the loaded NRO image into a temporary buffer. -Run the NCE patcher on it. -Produce a patch section / relocated code. -Map that patch section as executable memory in the target process. Game still has intermittent visual issues which can be solved with GPU level accurate, but that causes a huge performance drop in exchange. Someone else will resume this one. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4492 Reviewed-by: CamilleLaVey Reviewed-by: lizzie --- src/core/hle/service/ro/ro.cpp | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/ro/ro.cpp b/src/core/hle/service/ro/ro.cpp index 13de9f96c8..b847811fe5 100644 --- a/src/core/hle/service/ro/ro.cpp +++ b/src/core/hle/service/ro/ro.cpp @@ -16,6 +16,10 @@ #include "core/hle/service/ro/ro_types.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" +#ifdef HAS_NCE +#include "core/arm/nce/patcher.h" +#include "core/hle/kernel/k_shared_memory.h" +#endif namespace Service::RO { @@ -386,7 +390,7 @@ public: R_SUCCEED(); } - Result MapManualLoadModuleMemory(u64* out_address, size_t context_id, u64 nro_address, + Result MapManualLoadModuleMemory(Kernel::KernelCore& kernel, u64* out_address, size_t context_id, u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size) { // Get context. ProcessContext* context = this->GetContextById(context_id); @@ -421,7 +425,31 @@ public: R_TRY(context->ValidateNro(std::addressof(nro_info->module_id), std::addressof(rx_size), std::addressof(ro_size), std::addressof(rw_size), nro_info->base_address, nro_size, bss_size)); +#ifdef HAS_NCE + if (Settings::IsNceEnabled()) { + auto* process = context->GetProcess(); + auto& memory = process->GetMemory(); + std::vector image(total_size); + memory.ReadBlock(nro_info->base_address, image.data(), rx_size); + + Kernel::CodeSet::Segment code{.size = static_cast(rx_size)}; + Core::NCE::Patcher patch; + patch.PatchText(image, code); + patch.RelocateAndCopy(nro_info->base_address, code, image, nullptr); + + const u64 patch_address = nro_info->base_address + total_size; + const size_t patch_size = patch.GetSectionSize(); + constexpr auto permission = Kernel::Svc::MemoryPermission::ReadExecute; + + auto* patch_memory = Kernel::KSharedMemory::Create(kernel); + R_TRY(patch_memory->Initialize(kernel, kernel.System().DeviceMemory(), process, permission, permission, patch_size)); + std::memcpy(patch_memory->GetPointer(), image.data() + total_size, patch_size); + R_TRY(process->AddSharedMemory(kernel, patch_memory, patch_address, patch_size)); + R_TRY(patch_memory->Map(*process, patch_address, patch_size, permission)); + memory.WriteBlock(nro_info->base_address, image.data(), rx_size); + } +#endif // Set NRO perms. R_TRY(SetNroPerms(context->GetProcess(), nro_info->base_address, rx_size, ro_size, rw_size + bss_size)); @@ -531,7 +559,7 @@ public: Result MapManualLoadModuleMemory(Out out_load_address, ClientProcessId client_pid, u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size) { R_TRY(m_ro->ValidateProcess(m_context_id, *client_pid)); - R_RETURN(m_ro->MapManualLoadModuleMemory(out_load_address.Get(), m_context_id, nro_address, + R_RETURN(m_ro->MapManualLoadModuleMemory(system.Kernel(), out_load_address.Get(), m_context_id, nro_address, nro_size, bss_address, bss_size)); } From f8b76511041bb54070c52d1d09ea07d8108c592a Mon Sep 17 00:00:00 2001 From: Eden CI Date: Wed, 30 Sep 2026 02:00:44 +0200 Subject: [PATCH 127/198] [dist, android] Update translations from Transifex for Sep 28 (#4494) Automatic translation update for Sep 28 Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4494 Reviewed-by: MaranBr --- dist/languages/ar.ts | 928 ++++++++++++++++++++-------------------- dist/languages/ca.ts | 895 +++++++++++++++++++------------------- dist/languages/cs.ts | 895 +++++++++++++++++++------------------- dist/languages/da.ts | 895 +++++++++++++++++++------------------- dist/languages/de.ts | 903 +++++++++++++++++++------------------- dist/languages/el.ts | 895 +++++++++++++++++++------------------- dist/languages/es.ts | 895 +++++++++++++++++++------------------- dist/languages/fi.ts | 895 +++++++++++++++++++------------------- dist/languages/fr.ts | 895 +++++++++++++++++++------------------- dist/languages/hu.ts | 895 +++++++++++++++++++------------------- dist/languages/id.ts | 895 +++++++++++++++++++------------------- dist/languages/it.ts | 895 +++++++++++++++++++------------------- dist/languages/ja_JP.ts | 895 +++++++++++++++++++------------------- dist/languages/ko_KR.ts | 903 +++++++++++++++++++------------------- dist/languages/nb.ts | 895 +++++++++++++++++++------------------- dist/languages/nl.ts | 895 +++++++++++++++++++------------------- dist/languages/pl.ts | 895 +++++++++++++++++++------------------- dist/languages/pt_BR.ts | 895 +++++++++++++++++++------------------- dist/languages/pt_PT.ts | 895 +++++++++++++++++++------------------- dist/languages/ru_RU.ts | 903 +++++++++++++++++++------------------- dist/languages/sv.ts | 903 +++++++++++++++++++------------------- dist/languages/tr_TR.ts | 895 +++++++++++++++++++------------------- dist/languages/uk.ts | 895 +++++++++++++++++++------------------- dist/languages/vi.ts | 895 +++++++++++++++++++------------------- dist/languages/vi_VN.ts | 895 +++++++++++++++++++------------------- dist/languages/zh_CN.ts | 903 +++++++++++++++++++------------------- dist/languages/zh_TW.ts | 895 +++++++++++++++++++------------------- 27 files changed, 11874 insertions(+), 12364 deletions(-) diff --git a/dist/languages/ar.ts b/dist/languages/ar.ts index bb259d2870..9a735c85be 100644 --- a/dist/languages/ar.ts +++ b/dist/languages/ar.ts @@ -564,7 +564,7 @@ Options lower than 1X can cause artifacts. Window Adapting Filter: - :مرشح تكييف النافذة + :مرشح التكيف مع النافذة @@ -617,7 +617,7 @@ Exclusive fullscreen may offer better performance and better Freesync/Gsync supp Aspect Ratio: - :نسبة العرض إلى الارتفاع + :نسبة الأبعاد @@ -779,7 +779,7 @@ Unreal Engine 4 games often see the most significant changes thereof. Anisotropic Filtering: - الترشيح المتباين الخواص: + :الترشيح متباين الخواص @@ -791,7 +791,7 @@ Safe to set at 16x on most GPUs. GPU Mode: - وضع وحدة معالجة الرسومات: + :وضع وحدة معالجة الرسومات @@ -827,66 +827,52 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. - يتحكم في سلوك تزامن حاجز وحدة معالجة الرسوميات. -الخيار الفوري هو الأسرع، لكنه قد يسبب بعض المشاكل. -الوضع المتوازن يوفر توافقًا أفضل وقد يحل بعض المشاكل في بعض الألعاب. -الدقة تحسّن التوافق أكثر مقابل بعض الأداء. -الوضع الصارم هو الخيار الأبطأ، لكنه يمكن أن يصلح المشاكل التي تتطلب مزامنة أكثر صرامة. -الإعداد الافتراضي يتبع إعداد دقة وحدة معالجة الرسومات. +Default follows the GPU Mode setting. + يتحكم في سلوك مزامنة حاجز وحدة معالجة الرسومات. +يُعد الخيار فوري الأسرع، لكنه قد يتسبب في بعض المشكلات. +يوفر الخيار متوازن توافقًا أفضل وقد يعمل على حل المشكلات في بعض الألعاب. +يعمل الخيار دقيق على تحسين التوافق بشكل أكبر على حساب بعض الأداء. +يتبع الخيار افتراضي إعداد وضع وحدة معالجة الرسومات. - Enable GPU buffer readback - تفعيل قراءة مخزن وحدة معالجة الرسومات - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - يحافظ على البيانات المعدلة بواسطة وحدة معالجة الرسومات عن طريق قراءتها قبل رفعها. -بعض الألعاب تحتاج هذا لعرض تأثيرات معينة بشكل صحيح. - - - Enable asynchronous shader compilation تفعيل تجميع التظليل غير المتزامن - + May reduce shader stutter. قد يقلل من تقطع التظليل. - + GPU Clocks سرعات وحدة معالجة الرسومات - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. يجعل اللعبة تعتقد أن عمل وحدة معالجة الرسومات ينتهي بشكل أسرع مما هو عليه في الواقع، لذلك تتوقف عن خفض الدقة ومسافة العرض لتتناسب مع سرعات جهاز Switch. - + GPU Unswizzle إلغاء ترتيب بيانات وحدة معالجة الرسومات - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. باستخدام حوسبة وحدة معالجة الرسومات BCn 3D يسرع فك تشفير نسيج. قم بتعطيله في حالة حدوث أعطال أو مشاكل في الرسومات. - + GPU Unswizzle Max Texture Size الحد الأقصى لحجم النسيج في وحدة معالجة الرسومات بعد إعادة ترتيب البيانات - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -895,48 +881,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size حجم تدفق إلغاء ترتيب بيانات وحدة معالجة الرسومات - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. يحدد الحد الأقصى لكمية بيانات النسيج (بالميغابايت) التي تتم معالجتها لكل إطار. يمكن أن تقلل القيم الأعلى من التقطع أثناء تحميل النسيج، ولكنها قد تؤثر على اتساق الإطارات. - + GPU Unswizzle Chunk Size حجم كتلة إلغاء ترتيب بيانات وحدة معالجة الرسومات - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. يُحدد هذا الخيار عدد شرائح العمق التي تتم معالجتها في عملية إرسال واحدة. زيادة هذا الخيار قد تُحسّن الإنتاجية على وحدات معالجة الرسومات المتطورة، ولكنها قد تُسبب أخطاء في إعادة تعيين وقت الاستجابة أو انقطاع الاتصال ببرنامج التشغيل على الأجهزة ذات المواصفات الأقل. - + Use Vulkan pipeline cache Vulkan استخدام ذاكرة التخزين المؤقتة لخط أنابيب - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. يُفعّل ذاكرة التخزين المؤقت لخطوط الأنابيب الخاصة ببائع وحدة معالجة الرسومات. بتخزين ملفات ذاكرة التخزين المؤقتة للخطوط الداخلية Vulkan يمكن أن يؤدي هذا الخيار إلى تحسين وقت تحميل التظليل بشكل كبير في الحالات التي لا يقوم فيها برنامج تشغيل. - + Enable Compute Pipelines (Intel Vulkan Only) (Intel Vulkan فقط) تمكين خطوط أنابيب الحوسبة - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -945,192 +931,192 @@ Compute pipelines are always enabled on all other drivers. خطوط أنابيب الحوسبة مفعلة دائمًا على جميع برامج التشغيل الأخرى. - + Enable Reactive Flushing تمكين التنظيف التفاعلي - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. يستخدم التنظيف التفاعلي بدلاً من التنظيف التنبئي، مما يسمح بمزامنة الذاكرة بشكل أكثر دقة. - + Sync to framerate of video playback المزامنة مع معدل الإطارات لتشغيل الفيديو - + Run the game at normal speed during video playback, even when the framerate is unlocked. قم بتشغيل اللعبة بالسرعة العادية أثناء تشغيل الفيديو، حتى عندما يكون معدل الإطارات مفتوحًا. - + Barrier feedback loops حلقات التغذية الراجعة للحواجز - + Improves rendering of transparency effects in specific games. يحسن عرض تأثيرات الشفافية في بعض الألعاب المحددة. - + Enable buffer history تمكين سجل التخزين المؤقت - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. يُتيح هذا الخيار الوصول إلى حالات التخزين المؤقت السابقة. وقد يُحسّن جودة العرض وثبات الأداء في بعض الألعاب. - + Fix bloom effects إصلاح تأثيرات التوهج - + Removes bloom in Burnout. يزيل التوهج في وضع الاحتراق. - + Enable Legacy Rescale Pass تفعيل ميزة إعادة التحجيم القديمة - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. قد يصلح مشاكل إعادة القياس في بعض الألعاب بالاعتماد على سلوك من التنفيذ السابق. حل لسلوك قديم يصلح تشوهات الخطوط على بطاقات AMD وIntel الرسومية، ووميض النسيج الرمادي على بطاقات Nvidia الرسومية في لعبة Luigi's Mansion 3. - + Extended Dynamic State الحالة الديناميكية الموسعة - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. يتحكم في عدد الميزات التي يمكن استخدامها في الحالة الديناميكية الموسعة.تسمح الحالات الأعلى بمزيد من الميزات ويمكن أن تزيد من الأداء، ولكنها قد تسبب مشكلات رسومية إضافية. - + Vertex Input Dynamic State حالة ديناميكية لإدخال الرأس - + Enables vertex input dynamic state feature for better quality and performance. يتيح ميزة الحالة الديناميكية لإدخال الرأس لتحسين الجودة والأداء. - + Sample Shading تظليل العينة - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. يسمح لمظلل الأجزاء بالتنفيذ لكل عينة في جزء متعدد العينات بدلاً من مرة واحدة لكل جزء. يحسن جودة الرسومات على حساب الأداء. القيم الأعلى تحسن الجودة ولكنها تقلل من الأداء. - + RNG Seed مولد الأرقام العشوائية - + Controls the seed of the random number generator. Mainly used for speedrunning. يتحكم في بذرة مولد الأرقام العشوائية. يُستخدم بشكل رئيسي في سباقات السرعة. - + Device Name اسم الجهاز - + The name of the console. اسم وحدة التحكم. - + Homebrew Args Homebrew وسائط - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). (noglsl -مثل) عند التشغيل Homebrew سطر الأوامر الوسائط المُمررة إلى - + Custom RTC Date: :تاريخ التوقيت الحقيقي المخصص - + This option allows to change the clock of the console. Can be used to manipulate time in games. يتيح لك هذا الخيار تغيير ساعة وحدة التحكم. يمكن استخدامه للتحكم بالوقت في الألعاب. - + The number of seconds from the current unix time عدد الثواني من وقت يونكس الحالي - + Language: :اللغة - + This option can be overridden when region setting is auto-select يمكن تجاوز هذا الخيار عند تحديد إعداد المنطقة تلقائيًا - + Region: :المنطقة - + The region of the console. منطقة وحدة التحكم. - + Time Zone: :المنطقة الزمنية - + The time zone of the console. المنطقة الزمنية لوحدة التحكم. - + Sound Output Mode: :وضع إخراج الصوت - + Console Mode: :وضع وحدة التحكم - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1139,1042 +1125,1037 @@ Setting to Handheld can help improve performance for low end systems. يُمكن أن يُساعد الضبط على الوضع المحمول على تحسين أداء الأجهزة منخفضة المواصفات. - + Prompt for user profile on boot المطالبة بملف تعريف المستخدم عند التشغيل - + Useful if multiple people use the same PC. مفيد إذا كان هناك عدة أشخاص يستخدمون نفس الكمبيوتر. - + Pause when not in focus توقف عند عدم التركيز - + Pauses emulation when focusing on other windows. يوقف المحاكاة عند التركيز على نوافذ أخرى. - + Confirm before stopping emulation تأكيد قبل إيقاف المحاكاة - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. يتجاوز المطالبات التي تطلب تأكيد إيقاف المحاكاة. يؤدي تمكينه إلى تجاوز هذه المطالبات والخروج مباشرة من المحاكاة. - + Hide mouse on inactivity إخفاء الماوس عند عدم النشاط - + Hides the mouse after 2.5s of inactivity. يخفي الماوس بعد 2.5 ثانية من عدم النشاط. - + Disable controller applet تعطيل تطبيق التحكم - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. يُعطّل استخدام أداة التحكم في البرامج المُحاكاة قسرًا. عند محاولة أي برنامج فتح أداة التحكم، تُغلق فورًا. - + Check for updates التحقق من توفر التحديثات - + Whether or not to check for updates upon startup. ما إذا كان يجب التحقق من التحديثات عند بدء التشغيل أم لا. - + Enable Gamemode تمكين وضع اللعبة - + Force X11 as Graphics Backend كخلفية رسومات X11 فرض - + Custom frontend الواجهة الأمامية المخصصة - + Real applet تطبيق صغير حقيقي - + Never أبداً - + On Load عند التحميل - + Always دائماً - + CPU وحدة المعالجة المركزية - + GPU وحدة معالجة الرسومات - + CPU Asynchronous وحدة المعالجة المركزية غير المتزامنة - + Uncompressed (Best quality) Uncompressed (أفضل جودة) - + BC1 (Low quality) BC1 (جودة منخفضة) - + BC3 (Medium quality) BC3 (جودة متوسطة) - - + + Auto تلقائي - + 30 FPS 30 إطارًا في الثانية - + 60 FPS 60 إطارًا في الثانية - + 90 FPS 90 إطارًا في الثانية - + 120 FPS 120 إطارًا في الثانية - + Conservative محافظ - + Aggressive عدواني - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null لا شيء - + Fast سريع - - - + + + Accurate دقه - - - + + + Default افتراضي - + Unsafe (fast) غير آمن (سريع) - + Safe (stable) آمن (مستقر) - + Immediate فوري - + Balanced متوازن - - Strict - صارم - - - + Unsafe غير آمن - + Paranoid (disables most optimizations) جنون العظمة (يعطل معظم التحسينات) - + Debugging تصحيح الأخطاء - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed نافذة بلا حدود - + Exclusive Fullscreen شاشة كاملة حصرية - + No Video Output لا يوجد إخراج فيديو - + CPU Video Decoding فك تشفير فيديو وحدة المعالجة المركزية - + GPU Video Decoding (Default) فك تشفير فيديو وحدة معالجة الرسومات (افتراضي) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [تجريبي] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [تجريبي] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [تجريبي] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [تجريبي] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [تجريبي] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution دقة فائقة للألعاب من سنابدراغون - + Snapdragon Game Super Resolution EdgeDir دقة فائقة للألعاب من سنابدراغون EdgeDir - + None لا شيء - + FXAA FXAA - + SMAA SMAA - + Default (16:9) (16:9) افتراضي - + Force 4:3 4:3 فرض - + Force 21:9 21:9 فرض - + Force 16:10 16:10 فرض - + Stretch to Window تمديد إلى النافذة - + Automatic تلقائي - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) اليابانية (日本語) - + American English الإنجليزية الأمريكية - + French (français) الفرنسية (français) - + German (Deutsch) الألمانية (Deutsch) - + Italian (italiano) الإيطالية (Italiano) - + Spanish (español) الإسبانية (español) - + Chinese الصينية - + Korean (한국어) الكورية (한국어) - + Dutch (Nederlands) الهولندية (Nederlands) - + Portuguese (português) البرتغالية (Português) - + Russian (Русский) الروسية (Русский) - + Taiwanese تايواني - + British English الإنجليزية البريطانية - + Canadian French الكندية الفرنسية - + Latin American Spanish أمريكا اللاتينية الإسبانية - + Simplified Chinese الصينية المبسطة - + Traditional Chinese (正體中文) الصينية التقليدية (正體中文) - + Brazilian Portuguese (português do Brasil) البرتغالية البرازيلية (português do Brasil) - + Polish (polska) البولندية (polska) - + Thai (แบบไทย) التايلاندية (แบบไทย) - - + + Japan اليابان - + USA الولايات المتحدة الأمريكية - + Europe أوروبا - + Australia أستراليا - + China الصين - + Korea كوريا - + Taiwan تايوان - + Auto (%1) Auto select time zone تلقائي (%1) - + Default (%1) Default time zone افتراضي (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba كوبا - + EET EET - + Egypt مصر - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT توقيت غرينتش - + GMT+0 توقيت غرينتش +0 - + GMT-0 -0 توقيت غرينتش - + GMT0 0 توقيت غرينتش - + Greenwich غرينتش - + Hongkong هونغ كونغ - + HST HST - + Iceland أيسلندا - + Iran إيران - + Israel إسرائيل - + Jamaica جامايكا - + Kwajalein Kwajalein - + Libya ليبيا - + MET توقيت وسط أوروبا - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland بولندا - + Portugal البرتغال - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore سنغافورة - + Turkey تركيا - + UCT UCT - + Universal عالمي - + UTC UTC - + W-SU W-SU - + WET توقيت غرب أوروبا - + Zulu Zulu - + Mono أحادي - + Stereo مجسم - + Surround محيطي - + 4GB DRAM (Default) 4GB DRAM (افتراضي) - + 6GB DRAM (Unsafe) 6GB DRAM (غير آمنة) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (غير آمنة) - + 12GB DRAM (Unsafe) 12GB DRAM (غير آمنة) - + Docked الإرساء - + Handheld محمول - - + + Normal قياسي - - + + Boost تعزيز - - + + Overclock كسر السرعة - + Always ask (Default) اسأل دائمًا (افتراضي) - + Only if game specifies not to stop فقط إذا حددت اللعبة عدم التوقف - + Never ask لا تسأل أبدا - + Very Small (16 MB) صغير جدًا (16 ميغابايت) - + Small (32 MB) صغير (32 ميغابايت) - + Normal (128 MB) قياسي (128 ميغابايت) - + Large (256 MB) كبير (256 ميغابايت) - + Very Large (512 MB) كبير جدًا (512 ميغابايت) - + Very Low (4 MB) منخفض جدًا (4 ميغابايت) - + Low (8 MB) منخفض (8 ميغابايت) - + Normal (16 MB) قياسي (16 ميغابايت) - + Medium (32 MB) متوسط (32 ميغابايت) - + High (64 MB) عالي (64 ميغابايت) - + Very Low (32) منخفض جدًا (32) - + Low (64) منخفض (64) - + Normal (128) قياسي (128) - + Medium (256) متوسط (256) - + High (512) عالي (512) - + Disabled معطل - + ExtendedDynamicState 1 الحالة الديناميكية الممتدة 1 - + ExtendedDynamicState 2 الحالة الديناميكية الممتدة 2 - + ExtendedDynamicState 3 الحالة الديناميكية الممتدة 3 - + Tree View عرض قائمة - + Grid View عرض شبكة @@ -5008,12 +4989,12 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t Active preset: %1 (modified). Press Reset Values to go back to how it ships. - الإعداد المسبق النشط: 1% (معدّل). اضغط على إعادة تعيين القيم للعودة إلى الإعدادات الافتراضية. + الإعداد المسبق النشط: %1 (معدّل). اضغط على إعادة تعيين القيم للعودة إلى الإعدادات الافتراضية. Active preset: %1 - الإعداد المسبق النشط: 1% + الإعداد المسبق النشط: %1 @@ -7061,7 +7042,7 @@ Debug Message: - + &Pause &إيقاف مؤقت @@ -7212,7 +7193,7 @@ Debug Message: - + &Start &بدء @@ -7223,7 +7204,7 @@ Debug Message: - + R&ecord ت&سجيل @@ -7314,7 +7295,7 @@ Debug Message: - + None لا شيء @@ -7340,405 +7321,406 @@ Debug Message: &عرض دائري - + Small (32x32) صغير (32x32) - + Standard (64x64) قياسي (64x64) - + Large (128x128) كبير (128x128) - + Full Size (256x256) حجم كامل (256x256) - + Broken Vulkan Installation Detected Vulkan تم الكشف عن تلف في تثبيت - + Vulkan initialization failed during boot. أثناء التشغيل Vulkan فشل تهيئة. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping تشغيل لعبة - + Loading Web Applet... جارٍ تحميل تطبيق الويب... - - + + Disable Web Applet تعطيل تطبيق الويب - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) قد يؤدي تعطيل أداة الويب إلى سلوك غير محدد، ويجب استخدامه فقط مع لعبة Super Mario 3D All-Stars. هل أنت متأكد من رغبتك في تعطيل أداة الويب؟ (يمكن إعادة تفعيلها في إعدادات التصحيح.) - + The amount of shaders currently being built كمية التظليلات التي يتم بناؤها حاليًا - + The current selected resolution scaling multiplier. مضاعف قياس الدقة المحددة حالياً. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Switch سرعة المحاكاة الحالية. تشير القيم الأعلى أو الأقل من 100٪ إلى أن المحاكاة تعمل بشكل أسرع أو أبطأ من. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. عدد الإطارات في الثانية التي تعرضها اللعبة حاليًا. يختلف هذا العدد من لعبة إلى أخرى ومن مشهد إلى آخر. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. الوقت المستغرق لمحاكاة إطار على جهاز سويتش، بدون احتساب تحديد الإطارات أو المزامنة العمودية. لمحاكاة بسرعة كاملة، يجب أن يكون هذا في حدود 16.67 مللي ثانية كحد أقصى. - + Unmute إلغاء كتم الصوت - + Mute كتم الصوت - + Reset Volume إعادة تعيين مستوى الصوت - + Configure Effects... إعداد التأثيرات... - + &Clear Recent Files &مسح الملفات الحديثة - + &Continue &متابعة - + Warning: Outdated Game Format تحذير: تنسيق اللعبة قديم - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. أنت تستخدم تنسيق مجلد ROM المُفكك لهذه اللعبة، وهو تنسيق قديم استُبدل بآخر مثل NCA وNAX وXCI وNSP. تفتقر مجلدات ROM المُفككة إلى الأيقونات والبيانات الوصفية ودعم التحديثات. <br>لتوضيح تنسيقات Switch المختلفة التي يدعمها Eden، يُرجى مراجعة دليل المستخدم. لن تظهر هذه الرسالة مرة أخرى. - - + + Error while loading ROM! ROM خطأ أثناء تحميل - + The ROM format is not supported. غير مدعوم ROM تنسيق. - + An error occurred initializing the video core. حدث خطأ أثناء تهيئة نواة الفيديو. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - عادةً ما يحدث هذا بسبب برامج تشغيل بطاقة الرسوميات GPU القديمة. يرجى الاطلاع على ملف السجل لمزيد من التفاصيل. انظر: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'> كيفية الوصول إلى ملفات السجل</a>. + عادةً ما يحدث هذا بسبب برامج تشغيل وحدة معالجة الرسومات القديمة. يرجى الاطلاع على السجل لمزيد من التفاصيل. انظر: +<a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>كيفية الوصول إلى ملفات السجلات</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. حدث خطأ أثناء تحميل ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Discord/Stoat يرجى إعادة تحميل ملفاتك أو طلب المساعدة على - + An unknown error occurred. Please see the log for more details. حدث خطأ غير معروف. يرجى الاطلاع على السجل لمزيد من التفاصيل. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... جارٍ إغلاق البرنامج... - + Save Data بيانات الحفظ - + Mod Data بيانات التعديل - + Error Opening %1 Folder خطأ في فتح المجلد %1 - - + + Folder does not exist! المجلد غير موجود! - + Remove Installed Game Contents? إزالة محتويات اللعبة المثبتة؟ - + Remove Installed Game Update? إزالة تحديث اللعبة المثبت؟ - + Remove Installed Game DLC? إزالة المحتوى القابل للتنزيل المثبت للعبة؟ - + Remove Entry إزالة الإدخال - + Delete OpenGL Transferable Shader Cache? OpenGL Shader حذف ذاكرة التخزين المؤقتة القابلة للنقل لـ - + Delete Vulkan Transferable Shader Cache? Vulkan Shader حذف ذاكرة التخزين المؤقتة القابلة للنقل لـ - + Delete All Transferable Shader Caches? حذف جميع مخازن ذاكرة التظليل القابلة للنقل؟ - + Remove Custom Game Configuration? إزالة إعدادات اللعبة المخصص؟ - + Remove Cache Storage? إزالة ذاكرة التخزين المؤقتة؟ - + Remove File إزالة الملف - + Remove Play Time Data إزالة بيانات زمن اللعب - + Reset play time? إعادة تعيين زمن اللعب؟ - - + + RomFS Extraction Failed! RomFS فشل استخراج - + There was an error copying the RomFS files or the user cancelled the operation. أو قام المستخدم بإلغاء العملية RomFS حدث خطأ أثناء نسخ ملفات - + Full كامل - + Skeleton Skeleton - + Select RomFS Dump Mode RomFS حدد وضع تفريغ - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. الرجاء تحديد الطريقة التي تريد بها تفريغ RomFS. <br>سيتم نسخ جميع الملفات إلى المجلد الجديد في أثناء <br>قيام الهيكل العظمي بإنشاء بنية المجلد فقط. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root لا توجد مساحة فارغة كافية في %1 لاستخراج نظام الملفات RomFS. يُرجى تحرير مساحة أو اختيار مجلد تفريغ آخر من: المحاكاة > التكوين > النظام > نظام الملفات > تفريغ الجذر. - + Extracting RomFS... RomFS استخراج... - - + + Cancel إلغاء - + RomFS Extraction Succeeded! بنجاح RomFS تم استخراج! - + The operation completed successfully. تمت العملية بنجاح. - + Error Opening %1 خطأ في فتح %1 - + Select Directory حدد المجلد - + Properties خصائص - + The game properties could not be loaded. تعذر تحميل خصائص اللعبة. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. تشغيل الملف القابل للتنفيذ (%1)؛؛جميع الملفات (*.*) - + Load File تحميل الملف - + Open Extracted ROM Directory المستخرج ROM فتح ملف - + Invalid Directory Selected تم تحديد مجلد غير صالح - + The directory you have selected does not contain a 'main' file. لا يحتوي المجلد الذي حددته على ملف رئيسي - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files تثبيت الملفات - + %n file(s) remaining %n ملف (ملفات) متبقية%n ملف (ملفات) متبقية%n ملف (ملفات) متبقية%n ملف (ملفات) متبقية%n ملف (ملفات) متبقية%n ملف (ملفات) متبقية - + Installing file "%1"... تثبيت الملف ”%1“... - - + + Install Results نتائج التثبيت - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. لتجنب أي تعارضات محتملة، ننصح المستخدمين بعدم تثبيت الألعاب الأساسية على الذاكرة الداخلية. يرجى استخدام هذه الميزة فقط لتثبيت التحديثات والمحتوى القابل للتنزيل. - + %n file(s) were newly installed %n تم تثبيت ملف (ملفات) جديدة @@ -7750,7 +7732,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) were overwritten %n تم استبدال ملف (ملفات) @@ -7762,7 +7744,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) failed to install %n فشل تثبيت ملف (ملفات) @@ -7774,324 +7756,324 @@ Please, only use this feature to install updates and DLC. - + System Application تطبيق النظام - + System Archive أرشيف النظام - + System Application Update تحديث تطبيق النظام - + Firmware Package (Type A) حزمة الفيرموير (النوع أ) - + Firmware Package (Type B) حزمة الفيرموير (النوع ب) - + Game لعبة - + Game Update تحديث اللعبة - + Game DLC الخاص باللعبة DLC الـ - + Delta Title Delta عنوان - + Select NCA Install Type... NCA حدد نوع تثبيت... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) يرجى تحديد نوع اللعبة التي ترغب في تثبيت NCA عليها: (في معظم الحالات، يكون الإعداد الافتراضي "لعبة" مناسبًا.) - + Failed to Install فشل التثبيت - + The title type you selected for the NCA is invalid. غير صالح NCA نوع العنوان الذي حددته لـ. - + File not found لم يتم العثور على الملف - + File "%1" not found لم يتم العثور على الملف "%1" - + OK موافق - + Function Disabled الوظيفة معطلة - + Compatibility list reporting is currently disabled. Check back later! تقارير قائمة التوافق معطلة حاليًا. يرجى التحقق لاحقًا! - + Error opening URL خطأ في فتح الرابط - + Unable to open the URL "%1". تعذر فتح الرابط ”%1“ - + TAS Recording TAS تسجيل - + Overwrite file of player 1? الكتابة فوق ملف اللاعب 1؟ - + Invalid config detected تم اكتشاف إعدادات غير صالح - + Handheld controller can't be used on docked mode. Pro controller will be selected. لا يمكن استخدام وحدة التحكم المحمولة في وضع الإرساء. سيتم اختيار وحدة تحكم احترافية. - - + + Amiibo أميبو - - + + The current amiibo has been removed تمت إزالة أميبو الحالي. - + Error خطأ - - + + The current game is not looking for amiibos اللعبة الحالية لا تبحث عن أميبو - + Amiibo File (%1);; All Files (*.*) جميع الملفات (%1)؛؛ ملف أميبو (*.*) - + Load Amiibo تحميل أميبو - + Error loading Amiibo data خطأ أثناء تحميل بيانات أميبو - + The selected file is not a valid amiibo الملف المحدد ليس أميبو صالح - + The selected file is already on use الملف المحدد قيد الاستخدام بالفعل - + An unknown error occurred حدث خطأ غير معروف - + No firmware available لا يوجد فيرموير متوفر - + Firmware Corrupted الفيرموير تالف - + Unknown applet تطبيق غير معروف - + Applet doesn't map to a known value. لا يرتبط التطبيق المصغر بقيمة معروفة. - + Record not found لم يتم العثور على السجل - + Applet not found. Please reinstall firmware. لم يتم العثور على التطبيق المصغر. يرجى إعادة تثبيت الفيرموير. - + Capture Screenshot التقاط لقطة شاشة - + PNG Image (*.png) PNG Image (*.png) - + TAS state: Running %1/%2 حالة TAS: تشغيل %1/%2 - + TAS state: Recording %1 حالة TAS: تسجيل %1 - + TAS state: Idle %1/%2 حالة TAS: خامل %1/%2 - + TAS State: Invalid حالة TAS: غير صالحة - + &Stop Running &إيقاف التشغيل - + Stop R&ecording إيقاف ال&تسجيل - + Building: %n shader(s) بناء: %n تظليل(ات)بناء: %n تظليل(ات)بناء: %n تظليل(ات)بناء: %n تظليل(ات)بناء: %n تظليل(ات)بناء: %n تظليل(ات) - + Scale: %1x %1 is the resolution scaling factor الدقة: %1x - + Speed: %1% / %2% السرعة: %1% / %2% - + Speed: %1% السرعة: %1% - + Game: %1 FPS - اللعبة: %1 FPS + اللعبة: %1 إطاراً في الثانية - + Frame: %1 ms الإطار: %1 ms - + NO AA NO AA - + NO FX NO FX - + FX FX - + VOLUME: MUTE الصوت: كتم الصوت - + VOLUME: %1% Volume percentage (e.g. 50%) %1% :الصوت - + Derivation Components Missing مكونات الاشتقاق مفقودة - + Decryption keys are missing. Install them now? مفاتيح فك التشفير مفقودة. هل تريد تثبيتها الآن؟ - + Wayland Detected! Wayland تم الكشف عن - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8102,74 +8084,74 @@ Would you like to force it for future launches? هل ترغب في فرض استخدامه في عمليات التشغيل المستقبلية؟ - + Use X11 X11 استخدم - + Continue with Wayland Wayland متابعة مع - + Don't show again لا تعرض مرة أخرى - + Restart Required إعادة التشغيل مطلوبة - + Restart Eden to apply the X11 backend. X11 أعد تشغيل إيدن لتطبيق الخلفية - + Slow بطيء - + Turbo تيربو - + Unlocked إلغاء القفل - + Select RomFS Dump Target RomFS حدد هدف تفريغ - + Please select which RomFS you would like to dump. الذي تريد تفريغه RomFS الرجاء تحديد - + Are you sure you want to close Eden? هل أنت متأكد من أنك تريد إغلاق إيدن؟ - - - + + + Eden إيدن - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. هل أنت متأكد من أنك تريد إيقاف المحاكاة؟ سيتم فقدان أي تقدم لم يتم حفظه. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? @@ -8688,7 +8670,7 @@ p, li { white-space: pre-wrap; } FPS - معدل الإطارات في الثانية + إطار في الثانية @@ -8698,7 +8680,7 @@ p, li { white-space: pre-wrap; } %1 fps - %1 معدل الإطارات في الثانية + %1 إطار في الثانية diff --git a/dist/languages/ca.ts b/dist/languages/ca.ts index df14f1d565..01653df505 100644 --- a/dist/languages/ca.ts +++ b/dist/languages/ca.ts @@ -784,1332 +784,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Llavor de GNA - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Nom del dispositiu - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Idioma: - + This option can be overridden when region setting is auto-select - + Region: Regió: - + The region of the console. - + Time Zone: Zona horària: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: Mode de la consola - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Ocultar el cursor del ratolí en cas d'inactivitat - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Activa el mode joc - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never Mai - + On Load - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservador - + Aggressive Agressiu - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Ensamblat d'ombrejadors, només NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, només AMD/Mesa) - + Null Nul - + Fast Ràpid - - - + + + Accurate Precís - - - + + + Default Valor predeterminat - + Unsafe (fast) Insegur (ràpid) - + Safe (stable) Segur (estable) - + Immediate - + Balanced Equilibrat - - Strict - - - - + Unsafe Insegur - + Paranoid (disables most optimizations) Paranoic (desactiva la majoria d'optimitzacions) - + Debugging Depuració - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Finestra sense vores - + Exclusive Fullscreen Pantalla completa exclusiva - + No Video Output Sense sortida de vídeo - + CPU Video Decoding Descodificació de vídeo a la CPU - + GPU Video Decoding (Default) Descodificació de vídeo a la GPU (Valor predeterminat) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Veí més proper - + Bilinear Bilineal - + Bicubic Bicúbic - + Gaussian Gaussià - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution Super resolució AMD FidelityFX - + Area Àrea - + MMPX MMPX - + Zero-Tangent Tangència zero - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Cap - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Valor predeterminat (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 - + Stretch to Window Estirar a la finestra - + Automatic Automàtic - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonès (日本語) - + American English Anglès americà - + French (français) Francès (français) - + German (Deutsch) Alemany (Deutsch) - + Italian (italiano) Italià (italiano) - + Spanish (español) Castellà (español) - + Chinese Xinès - + Korean (한국어) Coreà (한국어) - + Dutch (Nederlands) Holandès (Nederlands) - + Portuguese (português) Portuguès (português) - + Russian (Русский) Rus (Русский) - + Taiwanese Taiwanès - + British English Anglès britànic - + Canadian French Francès canadenc - + Latin American Spanish Espanyol llatinoamericà - + Simplified Chinese Xinès simplificat - + Traditional Chinese (正體中文) Xinès tradicional (正體中文) - + Brazilian Portuguese (português do Brasil) Portuguès brasiler (português do Brasil) - + Polish (polska) Polonès (polska) - + Thai (แบบไทย) Tailandès (แบบไทย) - - + + Japan Japó - + USA EUA - + Europe Europa - + Australia Austràlia - + China Xina - + Korea Corea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Per defecte (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland Islàndia - + Iran Iran - + Israel Isreal - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polònia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estèreo - + Surround Envoltant - + 4GB DRAM (Default) 4GB DRAM (Insegur) - + 6GB DRAM (Unsafe) 6GB DRAM (Insegur) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Insegur) - + 12GB DRAM (Unsafe) 12GB DRAM (Insegur) - + Docked Sobretaula - + Handheld Portàtil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop Tan sols si el joc especifica no parar - + Never ask No preguntar mai - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6985,7 +6968,7 @@ Debug Message: - + &Pause &Pausar @@ -7136,7 +7119,7 @@ Debug Message: - + &Start &Iniciar @@ -7147,7 +7130,7 @@ Debug Message: - + R&ecord E&nregistrar @@ -7238,7 +7221,7 @@ Debug Message: - + None Cap @@ -7264,737 +7247,737 @@ Debug Message: - + Small (32x32) Petit (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute Desilenciar - + Mute Silenciar - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full Complet - + Skeleton Esquelet - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel Cancel·lar - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties Propietats - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File Carregar arxiu - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files Instal·lar arxius - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game Joc - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK D'acord - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor Escala: %1x - + Speed: %1% / %2% Velocitat: %1% / %2% - + Speed: %1% Velocitat: %1% - + Game: %1 FPS Joc: %1 FPS - + Frame: %1 ms Fotograma: %1 ms - + NO AA SENSE AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) VOLUMEN: %1% - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8002,74 +7985,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow Lent - + Turbo Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/cs.ts b/dist/languages/cs.ts index 3f2a2cffd9..b4a990d3f4 100644 --- a/dist/languages/cs.ts +++ b/dist/languages/cs.ts @@ -784,1332 +784,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Název Zařízení - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Jazyk: - + This option can be overridden when region setting is auto-select - + Region: Region: - + The region of the console. - + Time Zone: Časové Pásmo: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Potvrzení před zastavením emulace - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Skrýt myš při neaktivitě - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Automatické - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Přesné - - - + + + Default Výchozí - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe Nebezpečné - + Paranoid (disables most optimizations) Paranoidní (zakáže většinu optimizací) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Okno bez okrajů - + Exclusive Fullscreen Exkluzivní - + No Video Output - + CPU Video Decoding - + GPU Video Decoding (Default) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) - + 3X (2160p/3240p) - + 4X (2880p/4320p) - + 5X (3600p/5400p) - + 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor - + Bilinear Bilineární - + Bicubic - + Gaussian - + Lanczos - + ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Žádné - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Výchozí (16:9) - + Force 4:3 Vynutit 4:3 - + Force 21:9 Vynutit 21:9 - + Force 16:10 - + Stretch to Window Roztáhnout podle okna - + Automatic - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonština (日本語) - + American English - + French (français) Francouzština (français) - + German (Deutsch) Nemčina (Deutsch) - + Italian (italiano) Italština (Italiano) - + Spanish (español) Španělština (español) - + Chinese Čínština - + Korean (한국어) Korejština (한국어) - + Dutch (Nederlands) Holandština (Nederlands) - + Portuguese (português) Portugalština (português) - + Russian (Русский) Ruština (Русский) - + Taiwanese Tajwanština - + British English Britská Angličtina - + Canadian French Kanadská Francouzština - + Latin American Spanish Latinsko Americká Španělština - + Simplified Chinese Zjednodušená Čínština - + Traditional Chinese (正體中文) Tradiční Čínština (正體中文) - + Brazilian Portuguese (português do Brasil) Brazilská Portugalština (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonsko - + USA USA - + Europe Evropa - + Australia Austrálie - + China Čína - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egypt - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamajka - + Kwajalein Kwajalein - + Libya Lybie - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polsko - + Portugal Portugalsko - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turecko - + UCT UCT - + Universal Univerzální - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Zadokovaná - + Handheld Příruční - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Vždy se zeptat (Výchozí) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6975,7 +6958,7 @@ Debug Message: - + &Pause &Pauza @@ -7126,7 +7109,7 @@ Debug Message: - + &Start &Start @@ -7137,7 +7120,7 @@ Debug Message: - + R&ecord @@ -7228,7 +7211,7 @@ Debug Message: - + None @@ -7254,737 +7237,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7992,74 +7975,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/da.ts b/dist/languages/da.ts index d4dbe2fa31..a1ad0d6597 100644 --- a/dist/languages/da.ts +++ b/dist/languages/da.ts @@ -786,1332 +786,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG-Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Region - + The region of the console. - + Time Zone: Tidszone - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Skjul mus ved inaktivitet - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Automatisk - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Nøjagtig - - - + + + Default Standard - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe Usikker - + Paranoid (disables most optimizations) Paranoid (deaktiverer de fleste optimeringer) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Uindrammet Vindue - + Exclusive Fullscreen Eksklusiv Fuld Skærm - + No Video Output Ingen Video-Output - + CPU Video Decoding CPU-Video Afkodning - + GPU Video Decoding (Default) GPU-Video Afkodning (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75X (540p/810p) [EKSPERIMENTEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor Nærmeste Nabo - + Bilinear Bilineær - + Bicubic Bikubisk - + Gaussian Gausisk - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tving 4:3 - + Force 21:9 Tving 21:9 - + Force 16:10 - + Stretch to Window Stræk til Vindue - + Automatic - + 2x - + 4x - + 8x - + 16x - + Japanese (日本語) Japansk (日本語) - + American English - + French (français) Fransk (français) - + German (Deutsch) Tysk (Deutsch) - + Italian (italiano) Italiensk (italiano) - + Spanish (español) Spansk (español) - + Chinese Kinesisk - + Korean (한국어) Koreansk (한국어) - + Dutch (Nederlands) Hollandsk (Nederlands) - + Portuguese (português) Portugisisk (português) - + Russian (Русский) Russisk (Русский) - + Taiwanese Taiwanesisk - + British English Britisk Engelsk - + Canadian French Candadisk Fransk - + Latin American Spanish Latinamerikansk Spansk - + Simplified Chinese Forenklet Kinesisk - + Traditional Chinese (正體中文) Traditionelt Kinesisk (正體中文) - + Brazilian Portuguese (português do Brasil) Braziliansk Portugisisk (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China Kina - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ægypten - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Tyrkiet - + UCT UCT - + Universal Universel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Dokket - + Handheld Håndholdt - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6983,7 +6966,7 @@ Debug Message: - + &Pause @@ -7134,7 +7117,7 @@ Debug Message: - + &Start @@ -7145,7 +7128,7 @@ Debug Message: - + R&ecord @@ -7236,7 +7219,7 @@ Debug Message: - + None @@ -7262,737 +7245,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8000,74 +7983,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/de.ts b/dist/languages/de.ts index 0c142d2709..d6b1fdbcb5 100644 --- a/dist/languages/de.ts +++ b/dist/languages/de.ts @@ -831,66 +831,48 @@ Standard folgt der GPU-Genauigkeit Einstellung. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. - Steuert das GPU-Zaunobjekt-Synchronisations-Verhalten. -Direkt ist die schnellste Option, kann aber zu Problemen führen. -Ausbalanciert bietet bessere Kompatibilität und kann in manchen Spielen Probleme beheben. -Genau bietet noch bessere Kompatibilität auf Kosten von etwas Leisung. -Strikt ist die langsamste Option, kann aber Probleme beheben, die striktere Synchronisation erfordern. -Standard folgt der GPU-Genauigkeit Einstellung. +Default follows the GPU Mode setting. + - Enable GPU buffer readback - GPU-Puffer-Rücklesung aktivieren - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - Bewahrt von der GPU modifizierte Pufferdaten, indem diese vor dem Hochladen zurückgelesen werden. -Einige Spiele benötigen dies, um bestimmte Effekte korrekt darzustellen. - - - Enable asynchronous shader compilation Aktiviere asynchrones Shader-Kompilieren - + May reduce shader stutter. Kann Shader-Ruckler reduzieren. - + GPU Clocks GPU-Takte - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. Führt dazu, dass das Spiel glaubt, die Arbeit der GPU würde früher fertig sein, als sie eigentlich ist. Dadurch hört das Spiel auf die Auflösung und Render-Distanz zu verringern um sich den Takten der Switch anzupassen. - + GPU Unswizzle GPU-Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Beschleunigt die Dekodierung von BCn-3D-Texturen mithilfe von GPU-Rechenleistung. Deaktiviere diese Option, falls Abstürze oder Grafikfehler auftreten. - + GPU Unswizzle Max Texture Size GPU-Unswizzle max. Texturgröße - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -899,48 +881,48 @@ Während die GPU für mittelgroße und große Texturen schneller ist, kann die C Passen Sie diesen Wert an, um das Gleichgewicht zwischen GPU-Beschleunigung und CPU-Overhead zu finden. - + GPU Unswizzle Stream Size GPU-Unswizzle-Streamgröße - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Legt die maximale Menge an Texturdaten (in MiB) fest, die pro Bild verarbeitet wird. Höhere Werte können Ruckeln beim Laden von Texturen verringern, können sich jedoch auf die Bildrate auswirken. - + GPU Unswizzle Chunk Size GPU-Unswizzle Chunk-Größe - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Legt die Anzahl der Tiefenschnitte fest, die in einem einzelnen Durchlauf verarbeitet werden. Eine Erhöhung dieses Werts kann den Durchsatz auf High-End-GPUs verbessern, bei schwächerer Hardware jedoch zu TDR- oder Treiber-Auszeiten führen. - + Use Vulkan pipeline cache Vulkan-Pipeline-Cache verwenden - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Aktiviert den herstellerspezifischen Pipeline-Cache der GPU. Diese Option kann die Ladezeit von Shadern erheblich verkürzen, wenn der Vulkan-Treiber die Pipeline-Cache-Dateien nicht intern speichert. - + Enable Compute Pipelines (Intel Vulkan Only) Aktiviere Compute-Pipelines (Nur Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -949,194 +931,194 @@ Diese Einstellung ist nur bei proprietären Intel-Treibern vorhanden und kann be Bei allen anderen Treibern sind die Rechen-Rohrleitungen immer aktiviert. - + Enable Reactive Flushing Aktiviere Reactives Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Benutzt Reactive-Flushing anstatt Predictive-Flushing, welches akkurateres Speicher-Synchronisieren erlaubt. - + Sync to framerate of video playback Synchronisiere mit Bildrate von Video-Wiedergaben - + Run the game at normal speed during video playback, even when the framerate is unlocked. Lasse das Spiel in der normalen Geschwindigkeit abspielen, trotz freigeschalteter Bildrate - + Barrier feedback loops Barrier-Feedback-Schleifen - + Improves rendering of transparency effects in specific games. Verbessert das Rendering von Transparenzeffekten in bestimmten Spielen. - + Enable buffer history Puffer-Verlauf aktivieren - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Ermöglicht den Zugriff auf frühere Pufferzustände. Diese Option kann in manchen Spielen die Darstellungsqualität und die Leistungsstabilität verbessern. - + Fix bloom effects Bloom-Effekte beheben - + Removes bloom in Burnout. Entfernt Bloom in Burnout. - + Enable Legacy Rescale Pass „Legacy Rescale Pass“ aktivieren - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Behebt möglicherweise Probleme mit der Skalierung in einigen Spielen, indem auf das Verhalten der vorherigen Implementierung zurückgegriffen wird. Eine Umgehungslösung für das alte Verhalten, die Linienartefakte auf AMD- und Intel-GPUs sowie graues Texturflackern auf Nvidia-GPUs in „Luigi’s Mansion 3“ behebt. - + Extended Dynamic State Erweiterter dynamischer Zustand - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Legt die Anzahl der Funktionen fest, die im erweiterten dynamischen Modus verwendet werden können. Höhere Stufen ermöglichen mehr Funktionen und können die Leistung steigern, können jedoch zusätzliche grafische Probleme verursachen. - + Vertex Input Dynamic State Dynamischer Zustand der Scheitelpunkteingabe - + Enables vertex input dynamic state feature for better quality and performance. Aktiviert die Funktion für den dynamischen Status der Scheitelpunkteingabe, um eine bessere Qualität und Leistung zu erzielen. - + Sample Shading Probe-Schattierung - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Ermöglicht es dem Fragment-Shader, pro Abtastwert in einem mehrfach abgetasteten Fragment ausgeführt zu werden, anstatt nur einmal pro Fragment. Verbessert die Grafikqualität auf Kosten der Leistung. Höhere Werte verbessern die Qualität, beeinträchtigen jedoch die Leistung. - + RNG Seed Startwert für den Zufallszahlengenerator - + Controls the seed of the random number generator. Mainly used for speedrunning. Steuert den Startwert des Zufallszahlengenerators. Wird hauptsächlich für Schnelldurchläufe verwendet. - + Device Name Gerätename - + The name of the console. Der Name der Konsole. - + Homebrew Args Homebrew-Argumente - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Befehlszeilenargumente, die beim Start an Homebrew übergeben werden (z. B. -noglsl). - + Custom RTC Date: Benutzerdefinierte Echtzeituhrdatum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Diese Option erlaubt die Änderung der Uhr der Konsole. Kann benutzt werden um Zeit in Spielen zu manipulieren. - + The number of seconds from the current unix time Die Anzahl der Sekunden seit dem aktuellen Unix-Zeitstempel - + Language: Sprache: - + This option can be overridden when region setting is auto-select Diese Option kann überschrieben werden, wenn die Regionseinstellung auf „Automatische Auswahl“ steht - + Region: Region: - + The region of the console. Die Region der Konsole. - + Time Zone: Zeitzone: - + The time zone of the console. Die Zeitzone der Konsole. - + Sound Output Mode: Tonausgangsmodus: - + Console Mode: Konsolenmodus: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1145,1042 +1127,1037 @@ Je nach dieser Einstellung ändern sich bei Spielen die Auflösung, die Detailst Die Einstellung auf „Handgerät“ kann dazu beitragen, die Leistung auf Systemen mit geringerer Leistung zu verbessern. - + Prompt for user profile on boot Beim Systemstart nach dem Benutzerprofil fragen - + Useful if multiple people use the same PC. Nützlich, wenn mehrere Personen denselben PC nutzen. - + Pause when not in focus Pausieren, wenn nicht im Fokus - + Pauses emulation when focusing on other windows. Pausiert die Emulation, wenn der Fokus auf andere Fenster wechselt. - + Confirm before stopping emulation Vor dem Stoppen der Emulation bestätigen - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Überschreibt die Abfragen zur Bestätigung des Beendens der Emulation. Wenn diese Option aktiviert ist, werden solche Abfragen umgangen und die Emulation wird direkt beendet. - + Hide mouse on inactivity Mauszeiger verbergen - + Hides the mouse after 2.5s of inactivity. Verbirgt den Mauszeiger nach 2,5 Sekunden Inaktivität. - + Disable controller applet Controller-Applet deaktivieren - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Deaktiviert die Verwendung des Controller-Applets in emulierten Programmen zwangsweise. Wenn ein Programm versucht, das Controller-Applet zu öffnen, wird es sofort geschlossen. - + Check for updates Auf Aktualisierungen überprüfen - + Whether or not to check for updates upon startup. Ob nach Aktualisierungen während des Startens gesucht werden soll. - + Enable Gamemode Spielmodus aktivieren - + Force X11 as Graphics Backend X11 als Grafik-Backend erzwingen - + Custom frontend Benutzerdefiniertes Frontend - + Real applet Echtes Applet - + Never Niemals - + On Load Beim Laden - + Always Immer - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Asynchron - + Uncompressed (Best quality) Unkomprimiert (Beste Qualität) - + BC1 (Low quality) BC1 (Niedrige Qualität) - + BC3 (Medium quality) BC3 (Mittlere Qualität) - - + + Auto Auto - + 30 FPS 30 BpS - + 60 FPS 60 BpS - + 90 FPS 90 BpS - + 120 FPS 120 BpS - + Conservative Konservativ - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembler-Shader, nur NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (experimentell, nur AMD/Mesa) - + Null Null - + Fast Schnell - - - + + + Accurate Akkurat - - - + + + Default Vorgabe - + Unsafe (fast) Unsicher (schnell) - + Safe (stable) Sicher (stabil) - + Immediate Direkt - + Balanced Ausgeglichen - - Strict - Strikt - - - + Unsafe Unsicher - + Paranoid (disables most optimizations) Paranoid (deaktiviert die meisten Optimierungen) - + Debugging Fehlerbehebung - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Rahmenloses Fenster - + Exclusive Fullscreen Exklusiver Vollbildmodus - + No Video Output Keine Videoausgabe - + CPU Video Decoding CPU Video Dekodierung - + GPU Video Decoding (Default) GPU Video Dekodierung (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5X (360p/540p) [EXPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75X (540p/810p) [EXPERIMENTELL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1,5X (1080p/1620p) [EXPERIMENTELL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest-Neighbor - + Bilinear Bilinear - + Bicubic Bikubisch - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super-Auflösung - + Area Bereich - + MMPX MMPX - + Zero-Tangent Nulltangente - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Spiel-Superauflösung - + Snapdragon Game Super Resolution EdgeDir Snapdragon Spiel-Superauflösung EdgeDir - + None Keiner - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Vorgabe (16:9) - + Force 4:3 4:3 erzwingen - + Force 21:9 21:9 erzwingen - + Force 16:10 16:10 erzwingen - + Stretch to Window Auf Fenster anpassen - + Automatic Automatisch - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japanisch (日本語) - + American English Amerikanisches Englisch - + French (français) Französisch (français) - + German (Deutsch) Deutsch (German) - + Italian (italiano) Italienisch (italiano) - + Spanish (español) Spanisch (español) - + Chinese Chinesisch - + Korean (한국어) Koreanisch (한국어) - + Dutch (Nederlands) Niederländisch (Nederlands) - + Portuguese (português) Portugiesisch (português) - + Russian (Русский) Russisch (Русский) - + Taiwanese Taiwanesisch - + British English Britisches Englisch - + Canadian French Kanadisches Französisch - + Latin American Spanish Lateinamerikanisches Spanisch - + Simplified Chinese Vereinfachtes Chinesisch - + Traditional Chinese (正體中文) Traditionelles Chinesisch (正體中文) - + Brazilian Portuguese (português do Brasil) Brasilianisches Portugiesisch (português do Brasil) - + Polish (polska) Polnisch (Polen) - + Thai (แบบไทย) Thailändisch (Thailändische Version) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China China - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Automatisch (%1) - + Default (%1) Default time zone Standard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Ägypten - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Türkei - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Vorgabe) - + 6GB DRAM (Unsafe) 6GB DRAM (Unsicher) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Unsicher) - + 12GB DRAM (Unsafe) 12GB DRAM (Unsicher) - + Docked Angedockt - + Handheld Handgerät - - + + Normal Normal - - + + Boost Beschleunigung - - + + Overclock Übertaktung - + Always ask (Default) Immer fragen (Vorgabe) - + Only if game specifies not to stop Nur wenn ein Spiel vorgibt, nicht zu stoppen - + Never ask Niemals fragen - + Very Small (16 MB) Sehr klein (16 MB) - + Small (32 MB) Klein (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Groß (256 MB) - + Very Large (512 MB) Sehr groß (512 MB) - + Very Low (4 MB) Sehr niedrig (4 MB) - + Low (8 MB) Niedrig (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Mittel (32 MB) - + High (64 MB) Hoch (64 MB) - + Very Low (32) Sehr niedrig (32) - + Low (64) Niedrig (64) - + Normal (128) Normal (128) - + Medium (256) Mittel (256) - + High (512) Hoch (512) - + Disabled Deaktiviert - + ExtendedDynamicState 1 ErweiterterDynamischerZustand 1 - + ExtendedDynamicState 2 ErweiterterDynamischerZustand 2 - + ExtendedDynamicState 3 ErweiterterDynamischerZustand 3 - + Tree View Baumansicht - + Grid View Rasteransicht @@ -7077,7 +7054,7 @@ Fehlerbehebungs-Meldung: - + &Pause &Pause @@ -7228,7 +7205,7 @@ Fehlerbehebungs-Meldung: - + &Start &Start @@ -7239,7 +7216,7 @@ Fehlerbehebungs-Meldung: - + R&ecord Aufnahme @@ -7330,7 +7307,7 @@ Fehlerbehebungs-Meldung: - + None Keine @@ -7356,405 +7333,405 @@ Fehlerbehebungs-Meldung: &Karussellansicht - + Small (32x32) Klein (32x32) - + Standard (64x64) Standard (64x64) - + Large (128x128) Groß (128x128) - + Full Size (256x256) Volle Größe (256x256) - + Broken Vulkan Installation Detected Defekte Vulkan-Installation erkannt - + Vulkan initialization failed during boot. Initialisierung von Vulkan ist beim Systemstart fehlgeschlagen. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Spiel wird ausgeführt - + Loading Web Applet... Web-Applet wird geladen... - - + + Disable Web Applet Web-Applet deaktivieren - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Das Deaktivieren des Web-Applets kann zu unvorhersehbarem Verhalten führen und sollte nur bei „Super Mario 3D All-Stars“ verwendet werden. Möchtest du das Web-Applet wirklich deaktivieren? (Dies kann in den Fehlerbehebungs-Einstellungen wieder aktiviert werden.) - + The amount of shaders currently being built Die Anzahl der Shader, die derzeit erstellt werden - + The current selected resolution scaling multiplier. Der aktuell ausgewählte Skalierungsfaktor für die Auflösung. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Aktuelle Emulationsgeschwindigkeit. Werte über oder unter 100 % bedeuten, dass die Emulation schneller oder langsamer läuft als auf einer Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Wie viele Bilder pro Sekunde das Spiel derzeit anzeigt. Dies variiert von Spiel zu Spiel und von Szene zu Szene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Die Zeit, die für die Emulation eines Switch-Frames benötigt wird, ohne Berücksichtigung von Framelimiting oder V-Sync. Bei einer Emulation mit voller Geschwindigkeit sollte dieser Wert höchstens 16,67 ms betragen. - + Unmute Stummschaltung aufheben - + Mute Stummschalten - + Reset Volume Lautstärke zurücksetzen - + Configure Effects... - + &Clear Recent Files &Zuletzt verwendete Dateien löschen - + &Continue &Fortfahren - + Warning: Outdated Game Format Warnung: Veraltetes Spielformat - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Du verwendest für dieses Spiel das dekontruierte ROM-Verzeichnisformat - ein veraltetes Format, das durch andere Formate wie NCA, NAX, XCI oder NSP abgelöst wurde. Dekonstruierten ROM-Verzeichnissen fehlen Symbole, Metadaten und die Unterstützung für Aktualisierungen. <br>Eine Erläuterung der verschiedenen Switch-Formate, die Eden unterstützt, findest du in unserem Benutzerhandbuch. Diese Meldung wird nicht erneut angezeigt. - - + + Error while loading ROM! Fehler beim Laden des ROMs! - + The ROM format is not supported. Das ROM-Format wird nicht unterstützt. - + An error occurred initializing the video core. Beim Initialisieren des Videokerns ist ein Fehler aufgetreten. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Fehler beim Laden des ROMs! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Bitte erstelle deine Dateien erneut oder bitte auf Discord/Stoat um Hilfe. - + An unknown error occurred. Please see the log for more details. Es ist ein unbekannter Fehler aufgetreten. Weitere Informationen findest du im Protokoll. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Software wird geschlossen... - + Save Data Speicherdaten - + Mod Data Mod-Daten - + Error Opening %1 Folder Fehler beim Öffnen des Ordners %1 - - + + Folder does not exist! Der Ordner existiert nicht! - + Remove Installed Game Contents? Installierte Spielinhalte entfernen? - + Remove Installed Game Update? Installierte Spielaktualisierung entfernen? - + Remove Installed Game DLC? Installiertes Spiel-DLC entfernen? - + Remove Entry Eintrag entfernen - + Delete OpenGL Transferable Shader Cache? Den übertragbaren Shader-Cache von OpenGL löschen? - + Delete Vulkan Transferable Shader Cache? Den übertragbaren Shader-Cache von Vulkan löschen? - + Delete All Transferable Shader Caches? Alle übertragbaren Shader-Caches löschen? - + Remove Custom Game Configuration? Benutzerdefinierte Spielkonfiguration entfernen? - + Remove Cache Storage? Cache-Speicher löschen? - + Remove File Datei entfernen - + Remove Play Time Data Wiedergabezeitdaten löschen - + Reset play time? Spielzeit zurücksetzen? - - + + RomFS Extraction Failed! RomFS-Extraktion fehlgeschlagen! - + There was an error copying the RomFS files or the user cancelled the operation. Beim Kopieren der RomFS-Dateien ist ein Fehler aufgetreten oder der Benutzer hat den Vorgang abgebrochen. - + Full Vollständig - + Skeleton Skelett - + Select RomFS Dump Mode RomFS-Auslesemodus auswählen - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Bitte wähle aus, wie das RomFS kopiert werden soll. <br>Vollständig kopiert alle Dateien in das neue Verzeichnis, während <br>Skelett lediglich die Verzeichnisstruktur erstellt. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root Unter %1 ist nicht genügend Speicherplatz vorhanden, um das RomFS zu extrahieren. Bitte schaffe Speicherplatz oder wähle unter „Emulation > Konfigurieren > System > Dateisystem > Dump-Stammverzeichnis“ ein anderes Dump-Verzeichnis aus. - + Extracting RomFS... RomFS wird extrahiert... - - + + Cancel Abbrechen - + RomFS Extraction Succeeded! RomFS wurde erfolgreich extrahiert! - + The operation completed successfully. Der Vorgang wurde erfolgreich abgeschlossen. - + Error Opening %1 Fehler beim Öffnen von %1 - + Select Directory Verzeichnis auswählen - + Properties Eigenschaften - + The game properties could not be loaded. Die Spieleigenschaften konnten nicht geladen werden. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Switch-Ausführungsdatei (%1);;Alle Dateien (*.*) - + Load File Datei laden - + Open Extracted ROM Directory Verzeichnis mit dem extrahierten ROM öffnen - + Invalid Directory Selected Ungültiges Verzeichnis ausgewählt - + The directory you have selected does not contain a 'main' file. Das von dir ausgewählte Verzeichnis enthält keine „main“-Datei. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Installierbare Switch-Dateien (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX-Kassetten-Image (*.xci) - + Install Files Dateien installieren - + %n file(s) remaining %n Datei(en) verbleiben%n Datei(en) verbleiben - + Installing file "%1"... Datei „%1“ wird installiert... - - + + Install Results Installationsergebnisse - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Um mögliche Konflikte zu vermeiden, raten wir davon ab, Basisspiele auf dem NAND-Speicher zu installieren. Bitte nutze diese Funktion ausschließlich zur Installation von Aktualisierungen und DLCs. - + %n file(s) were newly installed %n Datei(en) wurden neu installiert @@ -7762,7 +7739,7 @@ Bitte nutze diese Funktion ausschließlich zur Installation von Aktualisierungen - + %n file(s) were overwritten %n Datei(en) wurden überschrieben @@ -7770,7 +7747,7 @@ Bitte nutze diese Funktion ausschließlich zur Installation von Aktualisierungen - + %n file(s) failed to install %n Datei(en) konnten nicht installiert werden @@ -7778,324 +7755,324 @@ Bitte nutze diese Funktion ausschließlich zur Installation von Aktualisierungen - + System Application Systemanwendung - + System Archive Systemarchiv - + System Application Update System-Anwendungsaktualisierung - + Firmware Package (Type A) Firmware-Paket (Typ A) - + Firmware Package (Type B) Firmware-Paket (Typ B) - + Game Spiel - + Game Update Spielaktualisierung - + Game DLC Spiel-DLC - + Delta Title Delta-Titel - + Select NCA Install Type... NCA-Installationstyp auswählen... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Bitte wähle den Titeltyp aus, unter dem du diese NCA installieren möchtest: (In den meisten Fällen ist die Vorgabe „Spiel“ ausreichend.) - + Failed to Install Installation fehlgeschlagen - + The title type you selected for the NCA is invalid. Der von dir für die NCA ausgewählte Titel ist ungültig. - + File not found Datei nicht gefunden - + File "%1" not found Datei „%1“ nicht gefunden - + OK OK - + Function Disabled Funktion deaktiviert - + Compatibility list reporting is currently disabled. Check back later! Die Anzeige der Kompatibilitätsliste ist derzeit deaktiviert. Schaue später noch einmal vorbei! - + Error opening URL Fehler beim Öffnen der URL - + Unable to open the URL "%1". Die URL „%1“ kann nicht geöffnet werden. - + TAS Recording TAS-Aufnahme - + Overwrite file of player 1? Datei von Spieler 1 überschreiben? - + Invalid config detected Ungültige Konfiguration erkannt - + Handheld controller can't be used on docked mode. Pro controller will be selected. Der Handgerät-Controller kann im angedockten Modus nicht verwendet werden. Es wird der Pro-Controller ausgewählt. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Das aktuelle amiibo wurde entfernt - + Error Fehler - - + + The current game is not looking for amiibos Das aktuelle Spiel sucht nicht nach Amiibos - + Amiibo File (%1);; All Files (*.*) Amiibo-Datei (%1);; Alle Dateien (*.*) - + Load Amiibo Amiibo laden - + Error loading Amiibo data Fehler beim Laden der Amiibo-Daten - + The selected file is not a valid amiibo Die ausgewählte Datei ist kein gültiges amiibo - + The selected file is already on use Die ausgewählte Datei wird bereits verwendet - + An unknown error occurred Ein unbekannter Fehler ist aufgetreten - + No firmware available Keine Firmware verfügbar - + Firmware Corrupted Firmware beschädigt - + Unknown applet Unbekanntes Applet - + Applet doesn't map to a known value. „Applet“ lässt sich keinem bekannten Wert zuordnen. - + Record not found Aufnahme nicht gefunden - + Applet not found. Please reinstall firmware. Applet nicht gefunden. Bitte installiere die Firmware neu. - + Capture Screenshot Bildschirmfoto aufnehmen - + PNG Image (*.png) PNG-Bild (*.png) - + TAS state: Running %1/%2 TAS-Status: %1/%2 läuft - + TAS state: Recording %1 TAS-Status: %1 wird aufgenommen - + TAS state: Idle %1/%2 TAS-Status: Leerlauf %1/%2 - + TAS State: Invalid TAS-Status: Ungültig - + &Stop Running &Ausführung beenden - + Stop R&ecording Aufnahme beenden - + Building: %n shader(s) Erstellung: %n SchattiererErstelle: %n Shader - + Scale: %1x %1 is the resolution scaling factor Maßstab: 1:1 - + Speed: %1% / %2% Geschwindigkeit: %1% / %2% - + Speed: %1% Geschwindigkeit: %1% - + Game: %1 FPS Spiel: %1 FPS - + Frame: %1 ms Frame: %1 ms - + NO AA Kein AA - + NO FX - + FX - + VOLUME: MUTE LAUTSTÄRKE: STUMM - + VOLUME: %1% Volume percentage (e.g. 50%) LAUTSTÄRKE: %1% - + Derivation Components Missing Ableitungskomponenten fehlen - + Decryption keys are missing. Install them now? Entschlüsselungsschlüssel fehlen. Möchtest du diese jetzt installieren? - + Wayland Detected! Wayland erkannt! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8106,74 +8083,74 @@ Es wird empfohlen, stattdessen X11 zu verwenden. Möchtest du dies für zukünftige Starts erzwingen? - + Use X11 X11 verwenden - + Continue with Wayland Mit Wayland fortfahren - + Don't show again Nicht mehr anzeigen - + Restart Required Neustart erforderlich - + Restart Eden to apply the X11 backend. Starte Eden neu, um das X11-Backend zu aktivieren. - + Slow Langsam - + Turbo Turbo - + Unlocked Entsperrt - + Select RomFS Dump Target RomFS-Ausleseziel auswählen - + Please select which RomFS you would like to dump. Bitte wähle aus, welches RomFS du auslesen möchtest. - + Are you sure you want to close Eden? Möchtest du Eden wirklich schließen? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Möchtest du die Emulation wirklich beenden? Alle nicht gespeicherten Fortschritte gehen dabei verloren. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/el.ts b/dist/languages/el.ts index c579eb7f72..a9a5dd9012 100644 --- a/dist/languages/el.ts +++ b/dist/languages/el.ts @@ -786,1332 +786,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Περιφέρεια: - + The region of the console. - + Time Zone: Ζώνη Ώρας: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Απόκρυψη δρομέα ποντικιού στην αδράνεια - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Αυτόματη - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Ακριβής - - - + + + Default Προεπιλεγμένο - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe Επισφαλής - + Paranoid (disables most optimizations) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Παραθυροποιημένο Χωρίς Όρια - + Exclusive Fullscreen Αποκλειστική Πλήρης Οθόνη - + No Video Output Χωρίς Έξοδο Βίντεο - + CPU Video Decoding Αποκωδικοποίηση Βίντεο CPU - + GPU Video Decoding (Default) Αποκωδικοποίηση Βίντεο GPU (Προεπιλογή) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [ΠΕΙΡΑΜΑΤΙΚΟ] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor Πλησιέστερος Γείτονας - + Bilinear Διγραμμικό - + Bicubic Δικυβικό - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Κανένα - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Προεπιλογή (16:9) - + Force 4:3 Επιβολή 4:3 - + Force 21:9 Επιβολή 21:9 - + Force 16:10 Επιβολή 16:10 - + Stretch to Window Επέκταση στο Παράθυρο - + Automatic Αυτόματα - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Ιαπωνικά (日本語) - + American English - + French (français) Γαλλικά (Français) - + German (Deutsch) Γερμανικά (Deutsch) - + Italian (italiano) Ιταλικά (Italiano) - + Spanish (español) Ισπανικά (Español) - + Chinese Κινέζικα - + Korean (한국어) Κορεάτικα (한국어) - + Dutch (Nederlands) Ολλανδικά (Nederlands) - + Portuguese (português) Πορτογαλικά (Português) - + Russian (Русский) Ρώσικα (Русский) - + Taiwanese Ταϊβανέζικα - + British English Βρετανικά Αγγλικά - + Canadian French Καναδικά Γαλλικά - + Latin American Spanish Λατινοαμερικάνικα Ισπανικά - + Simplified Chinese Απλοποιημένα Κινέζικα - + Traditional Chinese (正體中文) Παραδοσιακά Κινέζικα (正體中文) - + Brazilian Portuguese (português do Brasil) Πορτογαλικά Βραζιλίας (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Ιαπωνία - + USA ΗΠΑ - + Europe Ευρώπη - + Australia Αυστραλία - + China Κίνα - + Korea Κορέα - + Taiwan Ταϊβάν - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Κούβα - + EET EET - + Egypt Αίγυπτος - + Eire - + EST EST - + EST5EDT EST5EDT - + GB - + GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Γκρήνουιτς - + Hongkong Χονγκ Κονγκ - + HST HST - + Iceland Ισλανδία - + Iran Ιράν - + Israel Ισραήλ - + Jamaica Ιαμαϊκή - + Kwajalein - + Libya Λιβύη - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Ναβάχο - + NZ - + NZ-CHAT - + Poland Πολωνία - + Portugal Πορτογαλία - + PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Σιγκαπούρη - + Turkey Τουρκία - + UCT UCT - + Universal Παγκόσμια - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu - + Mono Μονοφωνικό - + Stereo Στέρεοφωνικό - + Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6974,7 +6957,7 @@ Debug Message: - + &Pause &Παύση @@ -7125,7 +7108,7 @@ Debug Message: - + &Start &Έναρξη @@ -7136,7 +7119,7 @@ Debug Message: - + R&ecord @@ -7227,7 +7210,7 @@ Debug Message: - + None @@ -7253,737 +7236,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7991,74 +7974,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/es.ts b/dist/languages/es.ts index 1ae327cff0..949145a741 100644 --- a/dist/languages/es.ts +++ b/dist/languages/es.ts @@ -828,60 +828,48 @@ Predeterminado sigue el ajuste de la precisión de GPU. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - Activar la lectura del búfer de la GPU - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation Activa la compilación de shaders asincrónicos - + May reduce shader stutter. Puede reducir los tirones causados por la carga de sombreadores. - + GPU Clocks Relojes de GPU - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle Desentrelazado de la GPU - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Acelera la decodificación de texturas 3D BCn mediante computación de la GPU. Desactívela si experimenta problemas o fallos gráficos. - + GPU Unswizzle Max Texture Size Tamaño máximo de textura de desentrelazado de la GPU - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -890,46 +878,46 @@ Aunque la GPU es más rápida para texturas medianas y grandes, la CPU puede ser Ajuste este valor para encontrar el equilibrio entre la aceleración de la GPU y la sobrecarga de la CPU. - + GPU Unswizzle Stream Size Tamaño del flujo de desentrelazado de la GPU - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Establece la cantidad máxima de datos de textura (en MiB) procesados ​​por cada fotograma. Valores más altos pueden reducir la distorsión durante la carga de texturas, pero pueden afectar a la consistencia de los fotogramas. - + GPU Unswizzle Chunk Size Tamaño del trozo de desentrelazado de la GPU - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Determina la cantidad de cortes de profundidad procesados ​​en un solo envío. Aumentar este valor puede mejorar el rendimiento en una GPU de gama alta, pero puede causar tirones y problemas en los tiempos de respuesta en hardware más modesto. - + Use Vulkan pipeline cache Usar caché de canalización de Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Activa la caché de canalización específica del fabricante. Esta opción puede mejorar los tiempos de cargas de sombreadores en el caso de que el controlador de Vulkan no lo almacene internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Activar la canalizaciones de cómputo (solo Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -938,194 +926,194 @@ Este ajuste solo existe para los controladores propietarios de Intel y puede cau En los demás controladores, la canalización de cómputo siempre está activada. - + Enable Reactive Flushing Activar limpieza reactiva - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Usa limpieza de memoria reactiva en vez de predictiva, permitiendo una sincronización de memoria más precisa. - + Sync to framerate of video playback Sincronizar a fotogramas de reproducción de vídeo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Ejecuta el juego a velocidad normal durante la reproducción de vídeos, incluso cuando no hay límite de fotogramas. - + Barrier feedback loops Bucles de feedback de barrera - + Improves rendering of transparency effects in specific games. Mejora la renderización de los efectos de transparencia en ciertos juegos. - + Enable buffer history Activar el historial del búfer - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Habilita el acceso a estados de búfer anteriores. Esta opción puede mejorar la calidad de renderizado y la consistencia en el rendimiento de algunos juegos. - + Fix bloom effects Arreglar efectos de resplandor - + Removes bloom in Burnout. Elimina el resplandor en Burnout. - + Enable Legacy Rescale Pass Activar el pase de reescalado heredado - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Puede arreglar los problemas de reescalado en algunos juegos confiando en el comportamiento de la implementación anterior. Solución alternativa de comportamiento heredado que corrige los artefactos de línea de la GPU AMD y el parpadeo de texturas gris de la GPU Nvidia en Luigis Mansion 3. - + Extended Dynamic State Estado dinámico extendido - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Controla el número de funciones que pueden ser usadas en el Estado Dinámico Extendido. Números más altos permiten úsar más funciones y pueden aumentar el rendimiento, pero tambén pueden causar errores gráficos. - + Vertex Input Dynamic State Estado dinámico de entrada de vértices - + Enables vertex input dynamic state feature for better quality and performance. Activa la función de estado dinámico de entrada de vértices para una mejor calidad y rendimiento. - + Sample Shading Sombreado de muestra - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permite que el sombreador de fragmentos se ejecute por muestra en un fragmento multimuestreado, en lugar de una sola vez por fragmento. Mejora la calidad de los gráficos a costa de rendimiento. Los valores más altos mejoran la calidad, pero reducen el rendimiento. - + RNG Seed Semilla de GNA - + Controls the seed of the random number generator. Mainly used for speedrunning. Controla la semilla del generador de números aleatorios. Usado principalmente para speedrunning. - + Device Name Nombre del dispositivo - + The name of the console. El nombre de la consola - + Homebrew Args Argumentos Homebrew - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Argumentos en la línea de comandos pasados al homebrew al ser lanzado (p.e. -noglsl). - + Custom RTC Date: Fecha Personalizada RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Esta opción permite cambiar el reloj de la consola. Puede ser usado para manipular el tiempo en juegos. - + The number of seconds from the current unix time Número de segundos de la hora actual de Unix - + Language: Idioma: - + This option can be overridden when region setting is auto-select Esta opción puede ser reemplazada cuando la configuración de región está en selección automática. - + Region: Región: - + The region of the console. La Región de la Consola. - + Time Zone: Zona horaria: - + The time zone of the console. La zona horaria de la consola. - + Sound Output Mode: Método de salida de sonido: - + Console Mode: Modo consola: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1134,1041 +1122,1036 @@ Los juegos cambiarán su resolución, detalles y compatibilidad con los mandos s Configurar el modo portátil puede mejorar el rendimiento en sistemas de gama baja. - + Prompt for user profile on boot Solicitud para perfil de usuario al arrancar - + Useful if multiple people use the same PC. Útil si múltiples personas usan la misma PC - + Pause when not in focus Pausar cuando la ventana no esté activa - + Pauses emulation when focusing on other windows. Pausa la emulación cuando otra ventana diferente está activa. - + Confirm before stopping emulation Confirmar detención - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Anula las solicitudes de confirmación para detener la emulación. Al habilitar esta opción, se omiten dichas solicitudes y se sale directamente de la emulación. - + Hide mouse on inactivity Ocultar el cursor por inactividad. - + Hides the mouse after 2.5s of inactivity. Oculta el mouse después de 2.5s de inactividad. - + Disable controller applet Desactivar applet de mandos - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Desactiva forzosamente el uso del applet del controlador en programas emulados. Cuando un programa intenta abrir el applet del controlador, se cierra inmediatamente. - + Check for updates Buscar actualizaciones - + Whether or not to check for updates upon startup. Si se deben buscar actualizaciones al iniciar o no. - + Enable Gamemode Activar Modo Juego - + Force X11 as Graphics Backend Forzar X11 como motor gráfico - + Custom frontend Interfaz personalizada - + Real applet Applet real - + Never Nunca - + On Load Al cargar - + Always Siempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU asíncrona - + Uncompressed (Best quality) Sin compresión (Mejor calidad) - + BC1 (Low quality) BC1 (Calidad baja) - + BC3 (Medium quality) BC3 (Calidad media) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservativo - + Aggressive Agresivo - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Ensamblado de sombreadores, solo NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, solo AMD/Mesa) - + Null Ninguno - + Fast Rápido - - - + + + Accurate Preciso - - - + + + Default Predeterminado - + Unsafe (fast) Inseguro (rápido) - + Safe (stable) Seguro (estable) - + Immediate Inmediato - + Balanced Balanceado - - Strict - Estricto - - - + Unsafe Impreciso - + Paranoid (disables most optimizations) Paranoico (Deshabilita la mayoría de optimizaciones) - + Debugging Depuración - + Dynarmic DynARMic - + NCE NCE - + Borderless Windowed Ventana sin bordes - + Exclusive Fullscreen Pantalla completa - + No Video Output Sin salida de vídeo - + CPU Video Decoding Decodificación de vídeo en la CPU - + GPU Video Decoding (Default) Decodificación de vídeo en GPU (Por defecto) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] x0,5 (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] x0,75 (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) x1 (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] x1,5 (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) x2 (1440p/2160p) - + 3X (2160p/3240p) x3 (2160p/3240p) - + 4X (2880p/4320p) x4 (2880p/4320p) - + 5X (3600p/5400p) x5 (3600p/5400p) - + 6X (4320p/6480p) x6 (4320p/6480p) - + 7X (5040p/7560p) x7 (5040p/7560p) - + 8X (5760p/8640p) x8 (5760p/8640p) - + Nearest Neighbor Vecino más próximo - + Bilinear Bilineal - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution Super Resolución AMD FidelityFX - + Area Área - + MMPX MMPX - + Zero-Tangent Tangente cero - + B-Spline Ranura B - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Super resolución de juego Snapdragon - + Snapdragon Game Super Resolution EdgeDir Filo direcorio de super resolución de juego Snapdragon - + None Ninguno - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Predeterminado (16:9) - + Force 4:3 Forzar 4:3 - + Force 21:9 Forzar 21:9 - + Force 16:10 Forzar 16:10 - + Stretch to Window Estirar a la ventana - + Automatic Automático - + 2x x2 - + 4x x4 - + 8x x8 - + 16x x16 - + Japanese (日本語) Japonés (日本語) - + American English Inglés estadounidense - + French (français) Francés (français) - + German (Deutsch) Alemán (deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Español - + Chinese Chino - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandés (nederlands) - + Portuguese (português) Portugués (português) - + Russian (Русский) Ruso (Русский) - + Taiwanese Taiwanés - + British English Inglés británico - + Canadian French Francés canadiense - + Latin American Spanish Español latinoamericano - + Simplified Chinese Chino simplificado - + Traditional Chinese (正體中文) Chino tradicional (正體中文) - + Brazilian Portuguese (português do Brasil) Portugués brasileño (português do Brasil) - + Polish (polska) Polaco (polska) - + Thai (แบบไทย) Tailandés (แบบไทย) - - + + Japan Japón - + USA EEUU - + Europe Europa - + Australia Australia - + China China - + Korea Corea - + Taiwan Taiwán - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Predeterminada (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipto - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Irán - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polonia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turquía - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulú - + Mono Mono - + Stereo Estéreo - + Surround Envolvente - + 4GB DRAM (Default) 4GB DRAM (Por defecto) - + 6GB DRAM (Unsafe) 6GB DRAM (Inseguro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Inseguro) - + 12GB DRAM (Unsafe) 12GB DRAM (Inseguro) - + Docked Sobremesa - + Handheld Portátil - - + + Normal Normal - - + + Boost Impulso - - + + Overclock Overclock - + Always ask (Default) Preguntar siempre (Por defecto) - + Only if game specifies not to stop Solo si el juego pide no ser cerrado - + Never ask Nunca preguntar - + Very Small (16 MB) Muy pequeño (16 MB) - + Small (32 MB) Pequeño (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Muy grande (512 MB) - + Very Low (4 MB) Muy bajo (4 MB) - + Low (8 MB) Bajo (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Medio (32 MB) - + High (64 MB) Alto (64 MB) - + Very Low (32) Muy bajo (32) - + Low (64) Bajo (64) - + Normal (128) Normal (128) - + Medium (256) Medio (256) - + High (512) Alto (512) - + Disabled Desactivado - + ExtendedDynamicState 1 ModoDynamicoExtendido 1 - + ExtendedDynamicState 2 ModoDynamicoExtendido 2 - + ExtendedDynamicState 3 ModoDynamicoExtendido 3 - + Tree View Vista en árbol - + Grid View Vista en cuadrícula @@ -7065,7 +7048,7 @@ Mensaje de depuración: - + &Pause &Pausar @@ -7216,7 +7199,7 @@ Mensaje de depuración: - + &Start &Iniciar @@ -7227,7 +7210,7 @@ Mensaje de depuración: - + R&ecord G&rabar @@ -7318,7 +7301,7 @@ Mensaje de depuración: - + None Nada @@ -7344,405 +7327,405 @@ Mensaje de depuración: Vista de &carrusel - + Small (32x32) Pequeño (32x32) - + Standard (64x64) Estandar (64x64) - + Large (128x128) Grande (128x128) - + Full Size (256x256) Tamaño completo (256x256) - + Broken Vulkan Installation Detected Detectada instalación fallida de Vulkan - + Vulkan initialization failed during boot. La inicialización de Vulkan falló durante el arranque. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Ejecutando un juego - + Loading Web Applet... Cargando applet web... - - + + Disable Web Applet Desactivar applet web - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Desactivar el applet web puede causar comportamientos inesperados y debería solo ser usado con Super Mario 3D All-Stars. ¿Está seguro de que quiere desactivar el applet web? (Puede ser activado en las ajustes de depuración.) - + The amount of shaders currently being built La cantidad de sombreadores que se están contruyendo actualmente - + The current selected resolution scaling multiplier. El multiplicador de escalado de resolución seleccionado actualmente. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Velocidad de emulación actual. Los valores superiores o inferiores al 100% indican que la emulación se ejecuta más rápida o más lenta que en una Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. La cantidad de fotogramas por segundo que muestra el juego actualmente. Esto varía según el juego y la escena. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Tiempo empleado en emular un fotograma de la Switch, sin contar la limitación de fotogramas ni la sincronización vertical. Para una emulación a máxima velocidad, debería ser de 16,67 ms como máximo. - + Unmute Desilenciar - + Mute Silenciar - + Reset Volume Restablecer volumen - + Configure Effects... - + &Clear Recent Files &Limpiar archivos recientes - + &Continue &Continuar - + Warning: Outdated Game Format Advertencia: formato del juego obsoleto - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Estás usando el formato de directorio ROM deconstruido para este juego, el cual es un formato obsoleto que ha sido reemplazado por otros como NCA, NAX, XCI o NSP. Los directorios ROM deconstruidos carecen de iconos, metadatos y compatibilidad con actualizaciones.<br>Para obtener una explicación de los distintos formatos de Switch compatibles con Eden, consulta nuestro manual de usuario. Este mensaje no volverá a aparecer de nuevo. - - + + Error while loading ROM! ¡Error al cargar la ROM! - + The ROM format is not supported. El formato de la ROM no está soportado. - + An error occurred initializing the video core. Se produjo un error al inicializar el núcleo de video. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. ¡Error al cargar la ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Por favor vuelva a volcar sus archivos, o pida ayuda en Discord/Stoat. - + An unknown error occurred. Please see the log for more details. Ha ocurrido un error desconocido. Por favor mire el registro para más detalles. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Cerrando el programa... - + Save Data Datos de guardado - + Mod Data Datos del mod - + Error Opening %1 Folder Error abriendo la carpeta %1 - - + + Folder does not exist! ¡La carpeta no existe! - + Remove Installed Game Contents? ¿Eliminar el contenido instalado del juego? - + Remove Installed Game Update? ¿Eliminar la actualización instalada del juego? - + Remove Installed Game DLC? ¿Eliminar el contenido descargable instalado del juego? - + Remove Entry Eliminar entrada - + Delete OpenGL Transferable Shader Cache? ¿Desea eliminar el caché transferible de sombreadores de OpenGL? - + Delete Vulkan Transferable Shader Cache? ¿Desea eliminar el caché transferible de sombreadores de Vulkan? - + Delete All Transferable Shader Caches? ¿Desea eliminar todo el caché transferible de sombreadores? - + Remove Custom Game Configuration? ¿Borrar configuración personalizada del juego? - + Remove Cache Storage? ¿Borrar el almacenamiento de caché? - + Remove File Eliminar archivo - + Remove Play Time Data Eliminar datos del tiempo de juego - + Reset play time? ¿Reiniciar el tiempo de juego? - - + + RomFS Extraction Failed! ¡Fallo al extraer el RomFS! - + There was an error copying the RomFS files or the user cancelled the operation. Ocurrió un error al copiar los archivos de la RomFS o el usuario canceló la operación. - + Full Completo - + Skeleton Esqueleto - + Select RomFS Dump Mode Seleccione el método de volcado del RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Por favor selecciona como quieres que sea volcada la RomFS.<br>Completa copiará todos los archivos en el nuevo directorio mientras que <br>esqueleto solo creará la estructura de los directorios. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root No hay suficiente espacio libre en %1 para extraer la RomFS. Por favor libera espacio o selecciona un directorio de volcado diferente en Emulación > Configurar > Sistema > Sistema de archivos > Volcado raiz - + Extracting RomFS... Extrayendo el RomFS... - - + + Cancel Cancelar - + RomFS Extraction Succeeded! ¡La extracción del RomFS ha sido un éxito! - + The operation completed successfully. La operación se completó con éxito. - + Error Opening %1 Error al abrir %1 - + Select Directory Seleccionar directorio - + Properties Propiedades - + The game properties could not be loaded. No se pudieron cargar las propiedades del juego. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Ejecutable de Switch (%1);;Todos los archivos (*.*) - + Load File Cargar archivo - + Open Extracted ROM Directory Abrir directorio de la ROM extraída - + Invalid Directory Selected Seleccionado directorio inválido - + The directory you have selected does not contain a 'main' file. El directorio seleccionado no contiene un archivo 'main'. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Archivo de Switch instalable (*.nca *.nsp *.xci);;Archivo de contenido de Nintendo (*.nca);;Paquete de envío de Nintendo (*.nsp);;Imagen de cartucho NX (*.xci) - + Install Files Instalar archivos - + %n file(s) remaining %n archivo(s) restantes%n archivo(s) restantes%n archivo(s) restantes - + Installing file "%1"... Instalando el archivo "%1"... - - + + Install Results Resultados de la instalación - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Para evitar posibles conflictos, desaconsejamos instalar juegos base en la NAND. Por favor, use solo esta función para instalar actualizaciones y contenido descargable. - + %n file(s) were newly installed %n archivo(s) se instalaron recientemente @@ -7751,7 +7734,7 @@ Por favor, use solo esta función para instalar actualizaciones y contenido desc - + %n file(s) were overwritten %n archivo(s) fueron sobreescritos @@ -7760,7 +7743,7 @@ Por favor, use solo esta función para instalar actualizaciones y contenido desc - + %n file(s) failed to install fallo al instalar %n archivo(s) @@ -7769,324 +7752,324 @@ Por favor, use solo esta función para instalar actualizaciones y contenido desc - + System Application Aplicación del sistema - + System Archive Archivo del sistema - + System Application Update Actualización de la aplicación del sistema - + Firmware Package (Type A) Paquete de firmware (Tipo A) - + Firmware Package (Type B) Paquete de firmware (Tipo B) - + Game Juego - + Game Update Actualización del juego - + Game DLC Contenido descargable del juego - + Delta Title Título Delta - + Select NCA Install Type... Seleccione el tipo de instalación NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Seleccione el tipo de título en el que desea instalar este NCA: (En la mayoría de los casos, la opción predeterminada "Juego" es suficiente). - + Failed to Install Fallo al instalar - + The title type you selected for the NCA is invalid. El tipo de título que ha seleccionado para el NCA es inválido. - + File not found Archivo no encontrado - + File "%1" not found Archivo "%1" no encontrado - + OK Aceptar - + Function Disabled Función desactivada - + Compatibility list reporting is currently disabled. Check back later! Los informes de la lista de compatibilidad están deshabilitados. ¡Vuelva más tarde! - + Error opening URL Error abriendo URL - + Unable to open the URL "%1". No se pudo abrir URL "%1". - + TAS Recording Grabación TAS - + Overwrite file of player 1? ¿Sobrescribir el archivo del jugador 1? - + Invalid config detected Detectada configuración inválida - + Handheld controller can't be used on docked mode. Pro controller will be selected. El mando del modo portátil no puede usarse en el modo sobremesa. El mando pro será seleccionado en su lugar. - - + + Amiibo Amiibo - - + + The current amiibo has been removed El amiibo actual fue borrado - + Error Error - - + + The current game is not looking for amiibos El juego actual no está buscando amiibos - + Amiibo File (%1);; All Files (*.*) Archivo Amiibo (%1);; Todos los archivos (*.*) - + Load Amiibo Cargar Amiibo - + Error loading Amiibo data Error al cargar los datos del Amiibo - + The selected file is not a valid amiibo El archivo seleccionado no es un amiibo válido - + The selected file is already on use El archivo seleccionado se encuentra en uso - + An unknown error occurred Ha ocurrido un error desconocido - + No firmware available No hay firmware disponible - + Firmware Corrupted Firmware corrompido - + Unknown applet Applet desconocido - + Applet doesn't map to a known value. Applet no asigna a un valor conocido. - + Record not found Grabación no encontrada - + Applet not found. Please reinstall firmware. Apple no encontrado. Por favor vuelva a instalar el firmware. - + Capture Screenshot Captura de pantalla - + PNG Image (*.png) Imagen PNG (*.png) - + TAS state: Running %1/%2 Estado de TAS: Ejecutando %1/%2 - + TAS state: Recording %1 Estado de TAS: Grabando %1 - + TAS state: Idle %1/%2 Estado de TAS: Inactivo %1/%2 - + TAS State: Invalid Estado de TAS: Inválido - + &Stop Running &Parar de ejecutarse - + Stop R&ecording &Parar grabación - + Building: %n shader(s) Construyendo: %n sombreador(es)Construyendo: %n sombreador(es)Construyendo: %n sombreador(es) - + Scale: %1x %1 is the resolution scaling factor Escala: %1x - + Speed: %1% / %2% Velocidad: %1% / %2% - + Speed: %1% Velocidad: %1% - + Game: %1 FPS Juego: %1 FPS - + Frame: %1 ms Fotograma: %1 ms - + NO AA NO AA - + NO FX - + FX - + VOLUME: MUTE VOLUMEN: SILENCIADO - + VOLUME: %1% Volume percentage (e.g. 50%) VOLUMEN: %1% - + Derivation Components Missing Componentes de derivación ausentes - + Decryption keys are missing. Install them now? Las claves de desencriptado están ausentes. ¿Desea instalarlas ahora? - + Wayland Detected! ¡Wayland detectado! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8097,74 +8080,74 @@ Se recomienda usar X11 en su lugar. ¿Le gustaría forzar a usarlo en futuras ejecuciones? - + Use X11 Usar X11 - + Continue with Wayland Continuar con Wayland - + Don't show again No mostrar de nuevo - + Restart Required Reinicio requerido - + Restart Eden to apply the X11 backend. Reinicie Eden para aplicar el motor X11. - + Slow Lento - + Turbo Turbo - + Unlocked Desbloqueado - + Select RomFS Dump Target Seleccione el destinatario para el volcado del RomFS - + Please select which RomFS you would like to dump. Por favor seleccione que RomFS desea volcar. - + Are you sure you want to close Eden? ¿Está seguro de que quiere cerrar Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. ¿Está seguro de que desea parar la emulación? Cualquier progreso sin guardar se perderá. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/fi.ts b/dist/languages/fi.ts index bd5898a82f..5918e93a67 100644 --- a/dist/languages/fi.ts +++ b/dist/languages/fi.ts @@ -786,1332 +786,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: - + The region of the console. - + Time Zone: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate - - - + + + Default - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe - + Paranoid (disables most optimizations) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed - + Exclusive Fullscreen - + No Video Output - + CPU Video Decoding - + GPU Video Decoding (Default) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) - + 3X (2160p/3240p) - + 4X (2880p/4320p) - + 5X (3600p/5400p) - + 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor - + Bilinear - + Bicubic - + Gaussian - + Lanczos - + ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None - + FXAA - + SMAA - + Default (16:9) - + Force 4:3 - + Force 21:9 - + Force 16:10 - + Stretch to Window - + Automatic - + 2x - + 4x - + 8x - + 16x - + Japanese (日本語) - + American English - + French (français) - + German (Deutsch) - + Italian (italiano) - + Spanish (español) - + Chinese - + Korean (한국어) - + Dutch (Nederlands) - + Portuguese (português) - + Russian (Русский) - + Taiwanese - + British English - + Canadian French - + Latin American Spanish - + Simplified Chinese - + Traditional Chinese (正體中文) - + Brazilian Portuguese (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan - + USA - + Europe - + Australia - + China - + Korea - + Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET - + CST6CDT - + Cuba - + EET - + Egypt - + Eire - + EST - + EST5EDT - + GB - + GB-Eire - + GMT - + GMT+0 - + GMT-0 - + GMT0 - + Greenwich - + Hongkong - + HST - + Iceland - + Iran - + Israel - + Jamaica - + Kwajalein - + Libya - + MET - + MST - + MST7MDT - + Navajo - + NZ - + NZ-CHAT - + Poland - + Portugal - + PRC - + PST8PDT - + ROC - + ROK - + Singapore - + Turkey - + UCT - + Universal - + UTC - + W-SU - + WET - + Zulu - + Mono - + Stereo - + Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked - + Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6952,7 +6935,7 @@ Debug Message: - + &Pause &Pysäytä @@ -7103,7 +7086,7 @@ Debug Message: - + &Start &Käynnistä @@ -7114,7 +7097,7 @@ Debug Message: - + R&ecord @@ -7205,7 +7188,7 @@ Debug Message: - + None @@ -7231,737 +7214,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7969,74 +7952,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/fr.ts b/dist/languages/fr.ts index 5d9bb8908a..70562e75f1 100644 --- a/dist/languages/fr.ts +++ b/dist/languages/fr.ts @@ -825,105 +825,93 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation Activer la compilation asynchrone des shaders - + May reduce shader stutter. Peut réduire les saccades dues aux shaders. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Utiliser le cache de pipeline Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Active le cache de pipeline spécifique au fournisseur de GPU. Cette option peut améliorer considérablement le temps de chargement des shaders dans les cas où le pilote Vulkan ne stocke pas les fichiers de cache de pipeline en interne. - + Enable Compute Pipelines (Intel Vulkan Only) Activer les pipelines de calcul (Vulkan sur Intel uniquement) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -932,95 +920,95 @@ Ce réglage n’existe que pour les pilotes propriétaires Intel et peut provoqu Les pipelines de calcul sont toujours activés sur tous les autres pilotes. - + Enable Reactive Flushing Activer le Vidage Réactif - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Utilise une purge réactive au lieu d'une purge prédictive, permettant une synchronisation de la mémoire plus précise. - + Sync to framerate of video playback Synchro la fréquence d'image de la relecture du vidéo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Éxécuter le jeu à une vitesse normale pendant la relecture du vidéo, même-ci la fréquence d'image est dévérouillée. - + Barrier feedback loops Boucles de rétroaction de barrière - + Improves rendering of transparency effects in specific games. Améliore le rendu des effets de transparence dans des jeux spécifiques. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State État dynamique étendu - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading Échantillonnage de shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permet au shader de fragments de s’exécuter pour chaque échantillon dans un fragment multi-échantillonné, au lieu d’une seule fois par fragment. @@ -1028,96 +1016,96 @@ Améliore la qualité graphique au prix de performances réduites. Des valeurs plus élevées améliorent la qualité mais dégradent les performances. - + RNG Seed Seed RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Contrôle la graine du générateur de nombres aléatoires. Principalement utilisé pour le speedrun. - + Device Name Nom de l'appareil - + The name of the console. Nom de la console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Date RTC personnalisée : - + This option allows to change the clock of the console. Can be used to manipulate time in games. Cette option permet de modifier l’horloge de la console. Peut être utilisée pour manipuler le temps dans les jeux. - + The number of seconds from the current unix time Nombre de secondes écoulées depuis le 1er janvier 1970. - + Language: Langue : - + This option can be overridden when region setting is auto-select Cette option peut être remplacée lorsque la région est sur auto. - + Region: Région : - + The region of the console. Région de la console. - + Time Zone: Fuseau horaire : - + The time zone of the console. Fuseau horaire de la console. - + Sound Output Mode: Mode de sortie sonore : - + Console Mode: Mode console : - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1126,1042 +1114,1037 @@ Les jeux adaptent leur résolution, leurs paramètres graphiques et les manettes Passer en mode Portable peut améliorer les performances sur les systèmes peu puissants. - + Prompt for user profile on boot Choisir l’utilisateur au démarrage. - + Useful if multiple people use the same PC. Utile si plusieurs personnes utilisent le même PC. - + Pause when not in focus Pause lorsque la fenêtre n’est pas active. - + Pauses emulation when focusing on other windows. Met l’émulation en pause dès que l’utilisateur change de fenêtre. - + Confirm before stopping emulation Confirmer avant d'arrêter l'émulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Ignore les demandes de confirmation pour arrêter l’émulation. L’activer permet de contourner ces confirmations et de quitter directement l’émulation. - + Hide mouse on inactivity Cacher la souris en cas d'inactivité - + Hides the mouse after 2.5s of inactivity. Cache le curseur après 2,5 secondes d’inactivité. - + Disable controller applet Désactiver l'applet du contrôleur - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Désactive de force le menu de configuration des manettes dans les programmes émulés. Lorsqu’un programme tente d’ouvrir ce menu, il est immédiatement fermé. - + Check for updates Rechercher des mises à jours - + Whether or not to check for updates upon startup. Vérifier ou non les mises à jour au démarrage. - + Enable Gamemode Activer le mode jeu - + Force X11 as Graphics Backend Forcer X11 comme moteur graphique - + Custom frontend Interface personnalisée - + Real applet Applet réel - + Never Jamais - + On Load Au chargement - + Always Toujours - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Asynchrone - + Uncompressed (Best quality) Non compressé (Meilleure qualité) - + BC1 (Low quality) BC1 (Basse qualité) - + BC3 (Medium quality) BC3 (Qualité moyenne) - - + + Auto Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Conservateur - + Aggressive Agressif - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Nul - + Fast Rapide - - - + + + Accurate Précis - - - + + + Default Par défaut - + Unsafe (fast) Insecure (rapide) - + Safe (stable) Sûr (stable) - + Immediate - + Balanced Moyen - - Strict - - - - + Unsafe Risqué - + Paranoid (disables most optimizations) Paranoïaque (désactive la plupart des optimisations) - + Debugging Débogage - + Dynarmic Dynamique - + NCE NCE - + Borderless Windowed Fenêtré sans bordure - + Exclusive Fullscreen Plein écran exclusif - + No Video Output Pas de sortie vidéo - + CPU Video Decoding Décodage Vidéo sur le CPU - + GPU Video Decoding (Default) Décodage Vidéo sur le GPU (par défaut) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPÉRIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPÉRIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1,25X (900p/1350p) [EXPÉRIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPÉRIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Plus proche voisin - + Bilinear Bilinéaire - + Bicubic Bicubique - + Gaussian Gaussien - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area (Par zone) - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Aucun - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Par défaut (16:9) - + Force 4:3 Forcer le 4:3 - + Force 21:9 Forcer le 21:9 - + Force 16:10 Forcer le 16:10 - + Stretch to Window Étirer à la fenêtre - + Automatic Automatique - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonais (日本語) - + American English Anglais Américain - + French (français) Français (français) - + German (Deutsch) Allemand (Deutsch) - + Italian (italiano) Italien (italiano) - + Spanish (español) Espagnol (español) - + Chinese Chinois - + Korean (한국어) Coréen (한국어) - + Dutch (Nederlands) Néerlandais (Nederlands) - + Portuguese (português) Portugais (português) - + Russian (Русский) Russe (Русский) - + Taiwanese Taïwanais - + British English Anglais Britannique - + Canadian French Français Canadien - + Latin American Spanish Espagnol d'Amérique Latine - + Simplified Chinese Chinois Simplifié - + Traditional Chinese (正體中文) Chinois Traditionnel (正體中文) - + Brazilian Portuguese (português do Brasil) Portugais Brésilien (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japon - + USA É.-U.A. - + Europe Europe - + Australia Australie - + China Chine - + Korea Corée - + Taiwan Taïwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Par défaut (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Égypte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland Islande - + Iran Iran - + Israel Israël - + Jamaica Jamaïque - + Kwajalein Kwajalein - + Libya Libye - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Pologne - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapour - + Turkey Turquie - + UCT UCT - + Universal Universel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stéréo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (Par défaut) - + 6GB DRAM (Unsafe) 6 GB DRAM (Risqué) - + 8GB DRAM 8GO DRAM - + 10GB DRAM (Unsafe) 10GO DRAM (Insecure) - + 12GB DRAM (Unsafe) 12GO DRAM (Insecure) - + Docked Mode TV - + Handheld Mode Portable - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Toujours demander (par défaut) - + Only if game specifies not to stop Uniquement si le jeu précise de ne pas s'arrêter - + Never ask Jamais demander - + Very Small (16 MB) Très petit (16Mo) - + Small (32 MB) Petit (32Mo) - + Normal (128 MB) Normal (128Mo) - + Large (256 MB) Large (256Mo) - + Very Large (512 MB) Très large (512Mo) - + Very Low (4 MB) Très faible (4 Mo) - + Low (8 MB) Faible (8 Mo) - + Normal (16 MB) Normal (16 Mo) - + Medium (32 MB) Moyen (32 Mo) - + High (64 MB) Élevé (64 Mo) - + Very Low (32) Très faible (32) - + Low (64) Faible (64) - + Normal (128) Normal (128) - + Medium (256) Moyen (256) - + High (512) Élevé (512) - + Disabled Désactivé - + ExtendedDynamicState 1 État dynamique étendu 1 - + ExtendedDynamicState 2 État dynamique étendu 2 - + ExtendedDynamicState 3 État dynamique étendu 3 - + Tree View Vue en liste - + Grid View Vue en grille @@ -7042,7 +7025,7 @@ Message de débogage : - + &Pause &Pause @@ -7193,7 +7176,7 @@ Message de débogage : - + &Start &Démarrer @@ -7204,7 +7187,7 @@ Message de débogage : - + R&ecord En&registrer @@ -7295,7 +7278,7 @@ Message de débogage : - + None Aucun @@ -7321,737 +7304,737 @@ Message de débogage : - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute Remettre le son - + Mute Couper le son - + Reset Volume Réinitialiser le volume - + Configure Effects... - + &Clear Recent Files - + &Continue &Continuer - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... Fermeture du logiciel... - + Save Data Données de sauvegarde - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? Réinitialiser le temps de jeu ? - - + + RomFS Extraction Failed! L'extraction de la RomFS a échoué ! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel Annuler - + RomFS Extraction Succeeded! Extraction de la RomFS réussi ! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties Propriétés - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game Jeu - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install Échec de l'installation - + The title type you selected for the NCA is invalid. - + File not found Fichier non trouvé - + File "%1" not found - + OK OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo Amiibo - - + + The current amiibo has been removed - + Error Erreur - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo Charger un Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted Firmware corrompu - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE VOLUME : MUET - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! Wayland détecté ! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8059,74 +8042,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/hu.ts b/dist/languages/hu.ts index 2b5a634afa..7e4617a12c 100644 --- a/dist/languages/hu.ts +++ b/dist/languages/hu.ts @@ -792,1332 +792,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Vulkan pipeline gyorsítótár használata. - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Reaktív ürítés használata - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Reaktív ürítést használ a prediktív ürítés helyett, ami pontosabb memóriaszinkronizálást tesz lehetővé. - + Sync to framerate of video playback Szinkronizálás a videolejátszás képkockasebességéhez - + Run the game at normal speed during video playback, even when the framerate is unlocked. A játék futtatása normál sebességgel videolejátszás közben, még akkor is, ha a képkockasebesség fel van oldva. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. Javítja az átlátszósági effektek megjelenítését bizonyos játékokban. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Eszköznév - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Egyéni RTC dátum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Nyelv: - + This option can be overridden when region setting is auto-select - + Region: Régió: - + The region of the console. - + Time Zone: Időzóna: - + The time zone of the console. - + Sound Output Mode: Hangkimeneti mód: - + Console Mode: Konzol mód: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Emuláció leállításának megerősítése - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Egér elrejtése inaktivitáskor - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Vezérlő applet letiltása - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Játékmód engedélyezése - + Force X11 as Graphics Backend - + Custom frontend Egyéni frontend - + Real applet Valódi applet - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU aszinkron - + Uncompressed (Best quality) Tömörítetlen (legjobb minőség) - + BC1 (Low quality) BC1 (alacsony minőség) - + BC3 (Medium quality) BC3 (közepes minőség) - - + + Auto Automatikus - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Takarékos - + Aggressive Aggresszív - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Pontos - - - + + + Default Alapértelmezett - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe Nem biztonságos - + Paranoid (disables most optimizations) Paranoid (a legtöbb optimalizálást letiltja) - + Debugging - + Dynarmic Dinamikus - + NCE NCE - + Borderless Windowed Szegély nélküli ablak - + Exclusive Fullscreen Exkluzív teljes képernyő - + No Video Output Nincs videokimenet - + CPU Video Decoding CPU videódekódolás - + GPU Video Decoding (Default) GPU videódekódolás (alapértelmezett) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [KÍSÉRLETI] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [KÍSÉRLETI] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [KÍSÉRLETI] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Legközelebbi szomszéd - + Bilinear Bilineáris - + Bicubic Bikubikus - + Gaussian Gauss-féle - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nincs - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Alapértelmezett (16:9) - + Force 4:3 4:3 kényszerítése - + Force 21:9 21:9 kényszerítése - + Force 16:10 16:10 kényszerítése - + Stretch to Window Ablakhoz nyújtás - + Automatic Automatikus - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japán (日本語) - + American English Amerikai angol - + French (français) Francia (français) - + German (Deutsch) Német (Deutsch) - + Italian (italiano) Olasz (italiano) - + Spanish (español) Spanyol (español) - + Chinese Kínai - + Korean (한국어) Koreai (한국어) - + Dutch (Nederlands) Holland (Nederlands) - + Portuguese (português) Portugál (português) - + Russian (Русский) Orosz (Русский) - + Taiwanese Tajvani - + British English Brit Angol - + Canadian French Kanadai francia - + Latin American Spanish Latin-amerikai spanyol - + Simplified Chinese Egyszerűsített kínai - + Traditional Chinese (正體中文) Hagyományos kínai (正體中文) - + Brazilian Portuguese (português do Brasil) Brazíliai portugál (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japán - + USA USA - + Europe Európa - + Australia Ausztrália - + China Kína - + Korea Korea - + Taiwan Tajvan - + Auto (%1) Auto select time zone Automatikus (%1) - + Default (%1) Default time zone Alapértelmezett (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Egyiptom - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Izland - + Iran Irán - + Israel Izrael - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navahó - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Lengyelország - + Portugal Portugália - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Szingapúr - + Turkey Törökország - + UCT UCT - + Universal Univerzális - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Sztereó - + Surround Térhangzás - + 4GB DRAM (Default) 4GB DRAM (Alapértelmezett) - + 6GB DRAM (Unsafe) 6GB DRAM (Nem biztonságos) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Dokkolt - + Handheld Kézi - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Mindig kérdezz rá (alapértelmezett) - + Only if game specifies not to stop Csak akkor, ha a játék kifejezetten kéri a folytatást. - + Never ask Soha ne kérdezz rá - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6968,7 +6951,7 @@ Debug Message: - + &Pause &Szünet @@ -7119,7 +7102,7 @@ Debug Message: - + &Start &Indítás @@ -7130,7 +7113,7 @@ Debug Message: - + R&ecord F&elvétel @@ -7221,7 +7204,7 @@ Debug Message: - + None @@ -7247,737 +7230,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -7985,74 +7968,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/id.ts b/dist/languages/id.ts index f2ae975eca..160fa812be 100644 --- a/dist/languages/id.ts +++ b/dist/languages/id.ts @@ -803,1333 +803,1316 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation Gunakan kompilasi shader asinkron - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Gunakan pipeline cache Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Memungkinkan cache pipeline spesifik vendor GPU. Opsi ini dapat meningkatkan waktu pemuatan shader secara signifikan dalam kasus di mana driver Vulkan tidak menyimpan file cache pipeline secara internal. - + Enable Compute Pipelines (Intel Vulkan Only) Aktifkan Pipa Komputasi (Hanya Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Aktifkan Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Menggunakan pemadatan reaktif alih-alih pemadatan prediktif, memungkinkan sinkronisasi memori yang lebih akurat. - + Sync to framerate of video playback Sinkronkan dengan kecepatan pemutaran video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Jalankan permainan dengan kecepatan normal selama pemutaran video, bahkan ketika framerate tidak terkunci. - + Barrier feedback loops Loop umpan balik penghalang - + Improves rendering of transparency effects in specific games. Meningkatkan rendering efek transparansi dalam game tertentu. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects Perbaiki efek bloom - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading Pencahayaan Sampel - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Benih RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Nama Perangkat - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Tanggal RTC Kustom: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Bahasa - + This option can be overridden when region setting is auto-select - + Region: Wilayah: - + The region of the console. - + Time Zone: Zona Waktu: - + The time zone of the console. - + Sound Output Mode: Mode keluaran suara. - + Console Mode: Mode Konsol - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Konfirmasi sebelum menghentikan emulasi - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Sembunyikan mouse saat tidak aktif - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Nonaktifkan aplikasi pengontrol - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates Cek Pembaruan - + Whether or not to check for updates upon startup. - + Enable Gamemode Aktifkan Mode Permainan - + Force X11 as Graphics Backend - + Custom frontend Tampilan depan kustom - + Real applet Aplikasi nyata - + Never Tidak Pernah - + On Load - + Always Selalu - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU sinkron - + Uncompressed (Best quality) Tidak terkompresi (Kualitas Terbaik) - + BC1 (Low quality) BC1 (Kualitas rendah) - + BC3 (Medium quality) BC3 (Kualitas sedang) - - + + Auto Otomatis - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Konservatif - + Aggressive Agresif - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast Cepat - - - + + + Accurate Akurat - - - + + + Default Bawaan - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced Seimbang - - Strict - - - - + Unsafe Berbahaya - + Paranoid (disables most optimizations) Paranoid (menonaktifkan sebagian besar optimasi) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Layar Tanpa Batas - + Exclusive Fullscreen Layar Penuh Eksklusif - + No Video Output Tidak ada Keluaran Suara - + CPU Video Decoding Penguraian Video menggunakan CPU - + GPU Video Decoding (Default) Penguraian Video menggunakan GPU (Bawaan) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EKSPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EKSPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EKSPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Biliner - + Bicubic Bikubik - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Tak ada - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Bawaan (16:9) - + Force 4:3 Paksa 4:3 - + Force 21:9 Paksa 21:9 - + Force 16:10 Paksa 16:10 - + Stretch to Window Regangkan ke Layar - + Automatic Otomatis - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Jepang (日本語) - + American English Bahasa Inggris Amerika - + French (français) Prancis (français) - + German (Deutsch) Jerman (Deutsch) - + Italian (italiano) Italia (italiano) - + Spanish (español) Spanyol (español) - + Chinese Cina - + Korean (한국어) Korea (한국어) - + Dutch (Nederlands) Belanda (Nederlands) - + Portuguese (português) Portugis (português) - + Russian (Русский) Rusia (Русский) - + Taiwanese Taiwan - + British English Inggris Britania - + Canadian French Prancis Kanada - + Latin American Spanish Spanyol Amerika Latin - + Simplified Chinese Cina Sederhana - + Traditional Chinese (正體中文) Cina Tradisional (正體中文) - + Brazilian Portuguese (português do Brasil) Portugis Brazil (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Jepang - + USA USA - + Europe Eropa - + Australia Australia - + China Tiongkok - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Bawaan (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Mesir - + Eire Éire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Éire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Iran - + Israel Israel - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polandia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turki - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Bawaan) - + 6GB DRAM (Unsafe) 6GB DRAM (Tidak Aman) - + 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Tidak Aman) - + 12GB DRAM (Unsafe) 12GB DRAM (Tidak Aman) - + Docked Terpasang - + Handheld Jinjing - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Selalu tanyakan (Bawaan) - + Only if game specifies not to stop Hanya jika permainan menentukan untuk tidak berhenti - + Never ask Jangan pernah bertanya - + Very Small (16 MB) Sangat Kecil (16 MB) - + Small (32 MB) Kecil (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Sedang (256) - + High (512) Tinggi (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -7002,7 +6985,7 @@ Debug Message: - + &Pause &Jeda @@ -7153,7 +7136,7 @@ Debug Message: - + &Start &Mulai @@ -7164,7 +7147,7 @@ Debug Message: - + R&ecord R&ekam @@ -7255,7 +7238,7 @@ Debug Message: - + None @@ -7281,737 +7264,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8019,74 +8002,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/it.ts b/dist/languages/it.ts index caac64d9ed..c0b01945ad 100644 --- a/dist/languages/it.ts +++ b/dist/languages/it.ts @@ -826,105 +826,93 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation Abilita la compilazione asincrona degli shader - + May reduce shader stutter. Può ridurre i fenomeni di stuttering (scatti) causati dagli shader. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Usa la cache delle pipeline di Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Abilita la cache delle pipeline specifica del produttore della GPU. Quest'opzione può ridurre di molto i tempi di caricamento degli shader nei casi in cui il driver Vulkan non memorizza la cache delle pipeline internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Abilita le compute pipeline (solo per Vulkan su Intel) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -933,192 +921,192 @@ Quest'impostazione esiste solo per i driver proprietari Intel e potrebbe fa Le compute pipelines sono sempre attivate su tutti gli altri drivers. - + Enable Reactive Flushing Abilita il flushing reattivo - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Utilizza il flushing reattivo invece di quello predittivo, al fine di ottenere una sincronizzazione della memoria più accurata. - + Sync to framerate of video playback Sincronizza il framerate a quello del video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Esegue il gioco a velocità normale durante le cutscene, anche quando il framerate è sbloccato. - + Barrier feedback loops Barrier feedback loops - + Improves rendering of transparency effects in specific games. Migliora il rendering degli effetti di trasparenza in alcuni giochi. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State Stato dinamico esteso - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Controlla il numero di funzionalità che possono essere usate con lo stato dinamico esteso. Gli stati più alti consentono più funzionalità e possono migliorare le prestazioni, ma possono causare ulteriori problemi grafici. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading Sample shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permette al fragment shader di eseguire per campione in un frammento multi-campione invece che una volta per frammento. Migliora la qualità grafica a scapito delle prestazioni. Alti valori migliorano la qualità ma peggiorano le prestazioni. - + RNG Seed Seed RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Controlla il seme del generatore di numeri casuali. Principalmente utilizzato per le speedrun. - + Device Name Nome del dispositivo - + The name of the console. Il nome della console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Data RTC personalizzata: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Quest'opzione permette di modificare l'orologio della console. Può essere usato per manipolare il tempo nei giochi. - + The number of seconds from the current unix time Il numero di secondi dal tempo Unix attuale - + Language: Lingua: - + This option can be overridden when region setting is auto-select Può essere rimpiazzato se il fuso orario della Regione è impostato su Auto - + Region: Regione: - + The region of the console. La regione della console. - + Time Zone: Fuso orario: - + The time zone of the console. Il fuso orario della console. - + Sound Output Mode: Modalità di output del suono: - + Console Mode: Modalità console: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1127,1042 +1115,1037 @@ I giochi ne terranno conto e modificheranno la risoluzione, i dettagli e i contr Impostare l'opzione su "Portatile" può aiutare a migliorare le prestazioni sui sistemi meno potenti. - + Prompt for user profile on boot Scegli il profilo utente all'avvio - + Useful if multiple people use the same PC. Utile se più persone utilizzano lo stesso PC. - + Pause when not in focus Metti in pausa quando la finestra non è in primo piano - + Pauses emulation when focusing on other windows. Mette in pausa l'emulazione quando altre finestre sono in primo piano. - + Confirm before stopping emulation Chiedi conferma prima di arrestare l'emulazione - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Sovrascrive le richieste di conferma per fermare l'emulazione. Abilitarla bypassa queste richieste e l'emulazione cesserà immediatamente. - + Hide mouse on inactivity Nascondi il puntatore del mouse se inattivo - + Hides the mouse after 2.5s of inactivity. Nasconde il mouse dopo 2,5 secondi di inattività. - + Disable controller applet Disabilita l'applet controller - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Disabilita forzatamente l'uso dell'applet del controller nei programmi emulati. Quando un programma proverà ad aprire l'applet del controller, quest'ultimo verrà immediatamente chiuso. - + Check for updates Controlla la presenza di aggiornamenti - + Whether or not to check for updates upon startup. Determina se controllare o meno la presenza di aggiornamenti all'avvio. - + Enable Gamemode Abilita Gamemode - + Force X11 as Graphics Backend Forza l'uso del back-end grafico X11 - + Custom frontend Frontend personalizzato - + Real applet Applet reale - + Never Mai - + On Load Al caricamento - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU (Asincrono) - + Uncompressed (Best quality) Nessuna compressione (qualità migliore) - + BC1 (Low quality) BC1 (qualità bassa) - + BC3 (Medium quality) BC3 (qualità media) - - + + Auto Automatico - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservativa - + Aggressive Aggressiva - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (shader assembly, solo NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (sperimentale, solo AMD/MESA) - + Null Nullo - + Fast Veloce - - - + + + Accurate Accurata - - - + + + Default Predefinito - + Unsafe (fast) Non sicuro (veloce) - + Safe (stable) Sicuro (stabile) - + Immediate - + Balanced Bilanciata - - Strict - - - - + Unsafe Non sicura - + Paranoid (disables most optimizations) Paranoica (disabilita la maggior parte delle ottimizzazioni) - + Debugging Debug - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Finestra senza bordi - + Exclusive Fullscreen Schermo intero esclusivo - + No Video Output Nessun output video - + CPU Video Decoding Decodifica video CPU - + GPU Video Decoding (Default) Decodifica video GPU (predefinita) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [SPERIMENTALE] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [SPERIMENTALE] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [SPERIMENTALE] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [SPERIMENTALE] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [SPERIMENTALE] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest neighbor - + Bilinear Bilineare - + Bicubic Bicubico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nessuna - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Predefinito (16:9) - + Force 4:3 Forza 4:3 - + Force 21:9 Forza 21:9 - + Force 16:10 Forza 16:10 - + Stretch to Window Allunga a finestra - + Automatic Automatico - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Giapponese (日本語) - + American English Inglese americano - + French (français) Francese (français) - + German (Deutsch) Tedesco (Deutsch) - + Italian (italiano) Italiano - + Spanish (español) Spagnolo (español) - + Chinese Cinese - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Olandese (Nederlands) - + Portuguese (português) Portoghese (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanese - + British English Inglese britannico - + Canadian French Francese canadese - + Latin American Spanish Spagnolo latino-americano - + Simplified Chinese Cinese semplificato - + Traditional Chinese (正體中文) Cinese tradizionale (正體中文) - + Brazilian Portuguese (português do Brasil) Portoghese brasiliano (português do Brasil) - + Polish (polska) Polacco (polska) - + Thai (แบบไทย) Thailandese (แบบไทย) - - + + Japan Giappone - + USA USA - + Europe Europa - + Australia Australia - + China Cina - + Korea Corea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Automatico (%1) - + Default (%1) Default time zone Predefinito (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egitto - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islanda - + Iran Iran - + Israel Israele - + Jamaica Giamaica - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polonia - + Portugal Portogallo - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turchia - + UCT UCT - + Universal Universale - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Predefinito) - + 6GB DRAM (Unsafe) 6GB DRAM (Non sicuro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Non sicuro) - + 12GB DRAM (Unsafe) 12GB DRAM (Non sicuro) - + Docked Dock - + Handheld Portatile - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Chiedi sempre (Predefinito) - + Only if game specifies not to stop Solo se il gioco richiede di non essere arrestato - + Never ask Non chiedere mai - + Very Small (16 MB) Molto piccola (16 MB) - + Small (32 MB) Piccola (32 MB) - + Normal (128 MB) Normale (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Molto grande (512 MB) - + Very Low (4 MB) Molto bassa (4 MB) - + Low (8 MB) Bassa (8 MB) - + Normal (16 MB) Normale (16 MB) - + Medium (32 MB) Media (32 MB) - + High (64 MB) Alta (64 MB) - + Very Low (32) Molto basso (32) - + Low (64) Basso (64) - + Normal (128) Normale (128) - + Medium (256) Medio (256) - + High (512) Alto (512) - + Disabled Disabilitato - + ExtendedDynamicState 1 Stato dinamico esteso 1 - + ExtendedDynamicState 2 Stato dinamico esteso 2 - + ExtendedDynamicState 3 Stato dinamico esteso 3 - + Tree View Vista ad albero - + Grid View Vista a griglia @@ -7062,7 +7045,7 @@ Messaggio debug: - + &Pause &Pausa @@ -7213,7 +7196,7 @@ Messaggio debug: - + &Start &Avvia @@ -7224,7 +7207,7 @@ Messaggio debug: - + R&ecord R&egistra @@ -7315,7 +7298,7 @@ Messaggio debug: - + None Nessuno @@ -7341,405 +7324,405 @@ Messaggio debug: - + Small (32x32) Piccola (32x32) - + Standard (64x64) Normale (64x64) - + Large (128x128) Grande (128x128) - + Full Size (256x256) Intera (256x256) - + Broken Vulkan Installation Detected Rilevata installazione di Vulkan non funzionante - + Vulkan initialization failed during boot. L'inizializzazione di Vulkan è fallita durante l'avvio. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Gioco in esecuzione - + Loading Web Applet... Caricamento dell'applet web... - - + + Disable Web Applet Disabilita l'applet web - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Disabilitare l'applet web potrebbe causare dei comportamenti indesiderati e andrebbe fatto solo con Super Mario 3D All-Stars. Sei sicuro di voler procedere? (Puoi riabilitarlo quando vuoi nelle impostazioni di debug.) - + The amount of shaders currently being built Il numero di shader in fase di compilazione - + The current selected resolution scaling multiplier. Il moltiplicatore attuale della risoluzione. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Velocità attuale dell'emulazione. Valori più alti o più bassi di 100% indicano che l'emulazione sta funzionando più velocemente o lentamente rispetto a una Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Il numero di fotogrammi al secondo che il gioco sta attualmente renderizzando. Può variare in base al gioco e alla situazione. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Tempo necessario per emulare un fotogramma della Switch, senza tenere conto del limite al framerate o del V-Sync. Per un'emulazione alla massima velocità, il valore non dovrebbe essere superiore a 16.67 ms. - + Unmute Riattiva - + Mute Silenzia - + Reset Volume Reimposta volume - + Configure Effects... - + &Clear Recent Files &Cancella i file recenti - + &Continue &Continua - + Warning: Outdated Game Format Attenzione: Formato del gioco obsoleto - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Stai usando una cartella contenente una ROM decostruita per avviare questo gioco, che è un formato obsoleto e sostituito da NCA, NAX, XCI o NSP. Le ROM decostruite non hanno icone né metadati e non supportano gli aggiornamenti.<br>Per una spiegazione sui vari formati della console Switch supportati da Eden, consulta il manuale utente. Non riceverai di nuovo questo avviso. - - + + Error while loading ROM! Errore nel caricamento della ROM! - + The ROM format is not supported. Il formato della ROM non è supportato. - + An error occurred initializing the video core. Errore durante l'inizializzazione del componente video di base - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Errore nel caricamento della ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Esegui un nuovo dump dei tuoi file o chiedi aiuto su Discord/Stoat. - + An unknown error occurred. Please see the log for more details. Si è verificato un errore sconosciuto. Consulta il log per maggiori dettagli. - - + + (64-bit) (64 bit) - - + + (32-bit) (32 bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Chiusura del software in corso... - + Save Data Dati di salvataggio - + Mod Data Dati delle mod - + Error Opening %1 Folder Impossibile aprire la cartella %1 - - + + Folder does not exist! La cartella non esiste! - + Remove Installed Game Contents? Rimuovere il contenuto del gioco installato? - + Remove Installed Game Update? Rimuovere l'aggiornamento installato? - + Remove Installed Game DLC? Rimuovere il DLC installato? - + Remove Entry Rimuovi voce - + Delete OpenGL Transferable Shader Cache? Vuoi rimuovere la cache trasferibile degli shader OpenGL? - + Delete Vulkan Transferable Shader Cache? Vuoi rimuovere la cache trasferibile degli shader Vulkan? - + Delete All Transferable Shader Caches? Vuoi rimuovere tutte le cache trasferibili degli shader? - + Remove Custom Game Configuration? Rimuovere la configurazione personalizzata del gioco? - + Remove Cache Storage? Rimuovere la cache del gioco? - + Remove File Rimuovi file - + Remove Play Time Data Reimposta il tempo di gioco - + Reset play time? Vuoi reimpostare il tempo di gioco? - - + + RomFS Extraction Failed! Estrazione RomFS fallita! - + There was an error copying the RomFS files or the user cancelled the operation. Si è verificato un errore durante la copia dei file del RomFS o l'operazione è stata annullata dall'utente. - + Full Completa - + Skeleton Cartelle - + Select RomFS Dump Mode Seleziona la modalità di estrazione del RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Seleziona come vorresti estrarre il RomFS. <br>La modalità Completa copierà tutti i file in una nuova cartella mentre<br>la modalità Cartelle creerà solamente la struttura delle cartelle. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root Non c'è abbastanza spazio disponibile in %1 per estrarre il RomFS. Libera lo spazio o seleziona una cartella di estrazione diversa in Emulazione > Configura > Sistema > File system > Cartella di estrazione - + Extracting RomFS... Estrazione RomFS in corso... - - + + Cancel Annulla - + RomFS Extraction Succeeded! Estrazione RomFS riuscita! - + The operation completed successfully. L'operazione è stata completata con successo. - + Error Opening %1 Impossibile aprire %1 - + Select Directory Seleziona cartella - + Properties Proprietà - + The game properties could not be loaded. Non è stato possibile caricare le proprietà del gioco. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Eseguibile Switch (%1);;Tutti i file (*.*) - + Load File Carica file - + Open Extracted ROM Directory Apri la cartella della ROM estratta - + Invalid Directory Selected Cartella selezionata non valida - + The directory you have selected does not contain a 'main' file. La cartella che hai selezionato non contiene un file "main". - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) File Switch installabili (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files Installa file - + %n file(s) remaining %n file rimanente%n di file rimanenti%n file rimanenti - + Installing file "%1"... Installazione del file "%1"... - - + + Install Results Risultati dell'installazione - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Per evitare possibli conflitti, sconsigliamo di installare i giochi base su NAND. Usa questa funzione solo per installare aggiornamenti e DLC. - + %n file(s) were newly installed %n nuovo file è stato installato @@ -7748,7 +7731,7 @@ Usa questa funzione solo per installare aggiornamenti e DLC. - + %n file(s) were overwritten %n file è stato sovrascritto @@ -7757,7 +7740,7 @@ Usa questa funzione solo per installare aggiornamenti e DLC. - + %n file(s) failed to install %n file non è stato installato a causa di errori @@ -7766,324 +7749,324 @@ Usa questa funzione solo per installare aggiornamenti e DLC. - + System Application Applicazione di sistema - + System Archive Archivio di sistema - + System Application Update Aggiornamento di un'applicazione di sistema - + Firmware Package (Type A) Pacchetto firmware (tipo A) - + Firmware Package (Type B) Pacchetto firmware (tipo B) - + Game Gioco - + Game Update Aggiornamento di gioco - + Game DLC DLC - + Delta Title Titolo delta - + Select NCA Install Type... Seleziona il tipo di installazione NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Seleziona il tipo del file NCA da installare: (Nella maggior parte dei casi, il valore predefinito "Gioco" va bene) - + Failed to Install Installazione fallita - + The title type you selected for the NCA is invalid. Il tipo che hai selezionato per il file NCA non è valido. - + File not found File non trovato - + File "%1" not found File "%1" non trovato - + OK OK - + Function Disabled Funzionalità disabilitata - + Compatibility list reporting is currently disabled. Check back later! La segnalazione della compatibilità è al momento disabilitata. Torna a controllare più avanti! - + Error opening URL Impossibile aprire l'URL - + Unable to open the URL "%1". Non è stato possibile aprire l'URL "%1". - + TAS Recording Registrazione TAS - + Overwrite file of player 1? Vuoi sovrascrivere il file del giocatore 1? - + Invalid config detected Rilevata configurazione non valida - + Handheld controller can't be used on docked mode. Pro controller will be selected. Il controller portatile non può essere utilizzato in modalità dock. Verrà selezionato il controller Pro. - - + + Amiibo Amiibo - - + + The current amiibo has been removed L'Amiibo corrente è stato rimosso - + Error Errore - - + + The current game is not looking for amiibos Il gioco in uso non è alla ricerca di Amiibo - + Amiibo File (%1);; All Files (*.*) File Amiibo (%1);; Tutti i file (*.*) - + Load Amiibo Carica Amiibo - + Error loading Amiibo data Impossibile caricare i dati dell'Amiibo - + The selected file is not a valid amiibo Il file selezionato non è un Amiibo valido - + The selected file is already on use Il file selezionato è già in uso - + An unknown error occurred Si è verificato un errore sconosciuto - + No firmware available Nessun firmware disponibile - + Firmware Corrupted Firmware corrotto - + Unknown applet Applet sconosciuto - + Applet doesn't map to a known value. L'applet non è associato a un valore noto. - + Record not found Non trovato - + Applet not found. Please reinstall firmware. Applet non trovato. Reinstalla il firmware. - + Capture Screenshot Cattura screenshot - + PNG Image (*.png) Immagine PNG (*.png) - + TAS state: Running %1/%2 Stato TAS: In esecuzione (%1/%2) - + TAS state: Recording %1 Stato TAS: Registrazione in corso (%1) - + TAS state: Idle %1/%2 Stato TAS: In attesa (%1/%2) - + TAS State: Invalid Stato TAS: Non valido - + &Stop Running &Interrompi esecuzione - + Stop R&ecording Interrompi r&egistrazione - + Building: %n shader(s) Compilazione di %n shaderCompilazione di %n shaderCompilazione di %n shader - + Scale: %1x %1 is the resolution scaling factor Risoluzione: %1x - + Speed: %1% / %2% Velocità: %1% / %2% - + Speed: %1% Velocità: %1% - + Game: %1 FPS Gioco: %1 FPS - + Frame: %1 ms Frame: %1 ms - + NO AA NO AA - + NO FX - + FX - + VOLUME: MUTE VOLUME: MUTO - + VOLUME: %1% Volume percentage (e.g. 50%) VOLUME: %1% - + Derivation Components Missing Componenti di derivazione mancanti - + Decryption keys are missing. Install them now? Chiavi di crittografia mancanti. Vuoi installarle ora? - + Wayland Detected! Wayland rilevato! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8094,74 +8077,74 @@ Si consiglia invece di usare X11. Vuoi forzare l'uso di quest'ultimo per i prossimi avvii? - + Use X11 Usa X11 - + Continue with Wayland Continua con Wayland - + Don't show again Non mostrare di nuovo - + Restart Required Riavvio richiesto - + Restart Eden to apply the X11 backend. Riavvia Eden per usare il back-end X11. - + Slow Lento - + Turbo Turbo - + Unlocked Sbloccato - + Select RomFS Dump Target Seleziona RomFS da estrarre - + Please select which RomFS you would like to dump. Seleziona quale RomFS vorresti estrarre. - + Are you sure you want to close Eden? Sei sicuro di voler uscire da Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Sei sicuro di voler arrestare l'emulazione? Tutti i progressi non salvati verranno perduti. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/ja_JP.ts b/dist/languages/ja_JP.ts index 8aa2c78060..f16621c044 100644 --- a/dist/languages/ja_JP.ts +++ b/dist/languages/ja_JP.ts @@ -789,1332 +789,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Vulkan パイプラインキャッシュを使用 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) コンピュート・パイプラインの有効化(インテル Vulkan のみ) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback ビデオ再生のフレームレートに同期する - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. 特定のゲームにおける透明エフェクトのレンダリングを改善します。 - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed 乱数シード値の変更 - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name デバイス名 - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: 言語: - + This option can be overridden when region setting is auto-select - + Region: 地域: - + The region of the console. - + Time Zone: タイムゾーン: - + The time zone of the console. - + Sound Output Mode: 音声出力モード: - + Console Mode: コンソールモード: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation エミュレーションを停止する前に確認する - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity 非アクティブ時にマウスカーソルを隠す - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet コントローラーアプレットの無効化 - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 非同期 - + Uncompressed (Best quality) 圧縮しない (最高品質) - + BC1 (Low quality) BC1 (低品質) - + BC3 (Medium quality) BC3 (中品質) - - + + Auto 自動 - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (アセンブリシェーダー、NVIDIA のみ) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V(実験的、AMD/Mesaのみ) - + Null - + Fast - - - + + + Accurate 正確 - - - + + + Default デフォルト - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe 不安定 - + Paranoid (disables most optimizations) パラノイド (ほとんどの最適化を無効化) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed ボーダーレスウィンドウ - + Exclusive Fullscreen 排他的フルスクリーン - + No Video Output ビデオ出力しない - + CPU Video Decoding ビデオをCPUでデコード - + GPU Video Decoding (Default) ビデオをGPUでデコード (デフォルト) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [実験的] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [実験的] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [実験的] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area - + MMPX MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None なし - + FXAA FXAA - + SMAA SMAA - + Default (16:9) デフォルト (16:9) - + Force 4:3 強制 4:3 - + Force 21:9 強制 21:9 - + Force 16:10 強制 16:10 - + Stretch to Window ウィンドウに合わせる - + Automatic 自動 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日本語 - + American English アメリカ英語 - + French (français) フランス語 (français) - + German (Deutsch) ドイツ語 (Deutsch) - + Italian (italiano) イタリア語 (italiano) - + Spanish (español) スペイン語 (español) - + Chinese 中国語 - + Korean (한국어) 韓国語 (한국어) - + Dutch (Nederlands) オランダ語 (Nederlands) - + Portuguese (português) ポルトガル語 (português) - + Russian (Русский) ロシア語 (Русский) - + Taiwanese 台湾語 - + British English イギリス英語 - + Canadian French カナダフランス語 - + Latin American Spanish ラテンアメリカスペイン語 - + Simplified Chinese 簡体字中国語 - + Traditional Chinese (正體中文) 繁体字中国語 (正體中文) - + Brazilian Portuguese (português do Brasil) ブラジルポルトガル語 (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan 日本 - + USA アメリカ - + Europe ヨーロッパ - + Australia オーストラリア - + China 中国 - + Korea 韓国 - + Taiwan 台湾 - + Auto (%1) Auto select time zone 自動 (%1) - + Default (%1) Default time zone 既定 (%1) - + CET 中央ヨーロッパ時間 - + CST6CDT CST6CDT - + Cuba キューバ - + EET 東ヨーロッパ標準時 - + Egypt エジプト - + Eire アイルランド - + EST アメリカ東部標準時 - + EST5EDT EST5EDT - + GB GB - + GB-Eire イギリス-アイルランド - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich グリニッジ - + Hongkong 香港 - + HST ハワイ標準時 - + Iceland アイスランド - + Iran イラン - + Israel イスラエル - + Jamaica ジャマイカ - + Kwajalein クェゼリン - + Libya リビア - + MET 中東時間 - + MST MST - + MST7MDT MST7MDT - + Navajo ナバホ - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland ポーランド - + Portugal ポルトガル - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore シンガポール - + Turkey トルコ - + UCT UCT - + Universal ユニバーサル - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu ズールー - + Mono モノラル - + Stereo ステレオ - + Surround サラウンド - + 4GB DRAM (Default) 4GB DRAM (デフォルト) - + 6GB DRAM (Unsafe) 6GB DRAM (不安定) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld 携帯モード - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) 常に確認する (デフォルト) - + Only if game specifies not to stop ゲームが停止しないように指定しているときのみ - + Never ask 確認しない - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled 無効 - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6991,7 +6974,7 @@ Debug Message: - + &Pause 中断(&P) @@ -7142,7 +7125,7 @@ Debug Message: - + &Start 実行(&S) @@ -7153,7 +7136,7 @@ Debug Message: - + R&ecord 記録(&R) @@ -7244,7 +7227,7 @@ Debug Message: - + None @@ -7270,737 +7253,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8008,74 +7991,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/ko_KR.ts b/dist/languages/ko_KR.ts index e636dc2030..881fe138d3 100644 --- a/dist/languages/ko_KR.ts +++ b/dist/languages/ko_KR.ts @@ -833,66 +833,48 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. - GPU 펜스 동기화 동작을 제어합니다. -즉시는 가장 빠른 옵션이지만 일부 문제가 발생할 수 있습니다. -균형은 호환성이 더 좋고 일부 게임에서 발생하는 문제를 해결할 수 있습니다. -정확은 성능 저하를 감수하고 호환성을 더욱 향상시킵니다. -엄격은 가장 느린 옵션이지만 더 엄격한 동기화가 필요한 문제를 해결할 수 있습니다. -기본값은 GPU 정확도 설정을 따릅니다. +Default follows the GPU Mode setting. + - Enable GPU buffer readback - GPU 버퍼 되읽기 활성화 - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - 수정된 GPU 데이터를 업로드하기 전에 다시 읽어들여 보존합니다. -일부 게임에서는 특정 효과를 제대로 렌더링하기 위해 이 기능이 필요합니다. - - - Enable asynchronous shader compilation 비동기 셰이더 컴파일 활성화 - + May reduce shader stutter. 셰이더 끊김 현상을 줄일 수 있습니다. - + GPU Clocks GPU 클럭 - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. 게임이 GPU 작업이 실제보다 더 빨리 완료된다고 착각하게 만들어, 스위치의 클럭 속도에 맞추기 위해 해상도와 렌더 거리를 낮추는 작업을 중단하게 합니다. - + GPU Unswizzle GPU 언스위즐 - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. GPU 컴퓨팅을 사용하여 BCn 3D 텍스처 디코딩을 가속화합니다. 충돌이나 그래픽 결함이 발생하는 경우 이 기능을 비활성화하세요. - + GPU Unswizzle Max Texture Size GPU 언스위즐 최대 텍스처 크기 - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -901,48 +883,48 @@ GPU는 중간 및 큰 크기의 텍스처에서 더 빠르지만, 매우 작은 이 값을 조정하여 GPU 가속과 CPU 오버헤드 간의 균형을 찾으세요. - + GPU Unswizzle Stream Size GPU 언스위즐 스트림 크기 - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. 프레임당 처리할 최대 텍스처 데이터 양(MiB 단위)을 설정합니다. 값이 높을수록 텍스처 로딩 중 끊김 현상을 줄일 수 있지만 프레임 일관성에 영향을 미칠 수 있습니다. - + GPU Unswizzle Chunk Size GPU 언스위즐 청크 크기 - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. 단일 디스패치에서 처리할 깊이 슬라이스 수를 결정합니다. 이 값을 높이면 고성능 GPU에서 처리량이 향상될 수 있지만, 성능이 낮은 하드웨어에서는 TDR 오류나 드라이버 시간 초과가 발생할 수 있습니다. - + Use Vulkan pipeline cache Vulkan 파이프라인 캐시 사용 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. GPU 제조사별 파이프라인 캐시를 활성화합니다. 이 옵션은 Vulkan 드라이버가 파이프라인 캐시 파일을 내부에 저장하지 않는 경우 셰이더 로딩 시간을 크게 향상시킬 수 있습니다. - + Enable Compute Pipelines (Intel Vulkan Only) 컴퓨트 파이프라인 활성화(인텔 Vulkan 전용) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -951,194 +933,194 @@ Compute pipelines are always enabled on all other drivers. 다른 모든 드라이버에서는 컴퓨트 파이프라인이 항상 활성화됩니다. - + Enable Reactive Flushing 반응형 플러싱 활성화 - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. 예측형 플러싱 대신 반응형 플러싱을 사용하여 보다 정확한 메모리 동기화를 가능하게 합니다. - + Sync to framerate of video playback 비디오 재생 프레임 속도에 동기화 - + Run the game at normal speed during video playback, even when the framerate is unlocked. 프레임률 제한이 해제된 경우에도 비디오 재생 중에는 게임을 정상 속도로 실행합니다. - + Barrier feedback loops 피드백 루프 차단 - + Improves rendering of transparency effects in specific games. 특정 게임에서 투명 효과 렌더링을 개선합니다. - + Enable buffer history 버퍼 기록 활성화 - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. 이전 버퍼 상태에 접근할 수 있도록 합니다. 이 옵션은 일부 게임에서 렌더링 품질과 성능 일관성을 향상시킬 수 있습니다. - + Fix bloom effects 블룸 효과 수정 - + Removes bloom in Burnout. Burnout에서의 블룸 현상을 제거합니다. - + Enable Legacy Rescale Pass 기존 크기 조정 무시 활성화 - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. 이전 구현의 동작을 활용하여 일부 게임에서 발생하는 크기 조정 문제를 해결할 수 있습니다. 루이지 맨션 3에서 발생했던 AMD 및 인텔 GPU의 선 아티팩트 현상과 Nvidia GPU의 회색 텍스처 깜빡임 현상을 해결하는 기존 반응에 대한 예비 해결책입니다. - + Extended Dynamic State 확장된 동적 상태 - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. 확장된 동적 상태에서 사용할 수 있는 기능의 수를 제어합니다. 상태 수가 많을수록 더 많은 기능을 사용할 수 있고 성능이 향상될 수 있지만, 추가적인 그래픽 문제가 발생할 수 있습니다. - + Vertex Input Dynamic State 정점 입력 동적 상태 - + Enables vertex input dynamic state feature for better quality and performance. 정점 입력의 동적 상태 기능을 활성화하여 품질과 성능을 향상시킵니다. - + Sample Shading 샘플 셰이딩 - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. 조각 셰이더가 다중샘플 조각에서 한 번당 한 조각이 아닌 샘플별로 실행될 수 있도록 합니다. 성능 저하를 감수하고 그래픽 품질을 향상시킵니다. 값이 높을수록 품질은 향상되지만 성능은 저하됩니다. - + RNG Seed RNG 시드 - + Controls the seed of the random number generator. Mainly used for speedrunning. 난수 생성기의 시드 값을 제어합니다. 주로 스피드런에 사용됩니다. - + Device Name 장치 이름 - + The name of the console. 콘솔의 이름 - + Homebrew Args 홈브루 인수 - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). 홈브루 실행 시 전달되는 명령줄 인수(예: -noglsl). - + Custom RTC Date: 사용자 지정 RTC 날짜: - + This option allows to change the clock of the console. Can be used to manipulate time in games. 이 옵션을 사용하면 콘솔의 시간을 변경할 수 있습니다. 게임 내 시간을 조작하는 데 사용할 수 있습니다. - + The number of seconds from the current unix time 현재 unix 시간으로부터 경과한 초 수 - + Language: 언어: - + This option can be overridden when region setting is auto-select 이 옵션은 지역 설정이 자동 선택으로 되어 있을 경우 번복될 수 있습니다. - + Region: 지역: - + The region of the console. 콘솔의 지역 - + Time Zone: 시간대: - + The time zone of the console. 콘솔의 시간대 - + Sound Output Mode: 소리 출력 모드: - + Console Mode: 콘솔 모드: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1147,1042 +1129,1037 @@ Setting to Handheld can help improve performance for low end systems. 휴대 모드로 설정하면 저사양 시스템의 성능을 향상시키는 데 도움이 될 수 있습니다. - + Prompt for user profile on boot 부팅 시 유저 프로필 입력 요청 - + Useful if multiple people use the same PC. 여러 사람이 같은 PC를 사용할 때 유용합니다. - + Pause when not in focus 초점이 맞지 않을 때 일시 중지 - + Pauses emulation when focusing on other windows. 다른 창에 초점을 맞출 때 에뮬레이션을 일시 중지합니다. - + Confirm before stopping emulation 에뮬레이션을 중지하기 전에 확인 - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. 에뮬레이션 중지를 확인하는 메시지를 무시합니다. 이 옵션을 활성화하면 이러한 메시지를 건너뛰고 에뮬레이션을 바로 종료합니다. - + Hide mouse on inactivity 마우스 커서가 비활동 상태일 때 숨기기 - + Hides the mouse after 2.5s of inactivity. 마우스 커서가 2.5초 동안 활동이 없으면 숨깁니다. - + Disable controller applet 컨트롤러 애플릿 비활성화 - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. 에뮬레이트된 프로그램에서 컨트롤러 애플릿 사용을 강제적으로 비활성화합니다. 프로그램이 컨트롤러 애플릿을 열려고 하면 즉시 닫힙니다. - + Check for updates 업데이트 확인 - + Whether or not to check for updates upon startup. 시작 시 업데이트를 확인할지 여부. - + Enable Gamemode 게임 모드 활성화 - + Force X11 as Graphics Backend X11을 그래픽 백엔드로 강제 설정 - + Custom frontend 사용자 정의 프론트엔드 - + Real applet 실제 애플릿 - + Never 안 함 - + On Load 로드 시 - + Always 항상 - + CPU CPU - + GPU GPU - + CPU Asynchronous 비동기 CPU - + Uncompressed (Best quality) 비압축(최고 품질) - + BC1 (Low quality) BC1(저품질) - + BC3 (Medium quality) BC3(중간 품질) - - + + Auto 자동 - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative 소극적 - + Aggressive 적극적 - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM(어셈블리 셰이더, NVIDIA 전용) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V(실험적, AMD/Mesa 전용) - + Null Null - + Fast 고속 - - - + + + Accurate 정확 - - - + + + Default 기본값 - + Unsafe (fast) 불안전(빠름) - + Safe (stable) 안전(안정적) - + Immediate 즉시 - + Balanced 균형 - - Strict - 염격 - - - + Unsafe 불안전 - + Paranoid (disables most optimizations) 편집증적(대부분의 최적화를 비활성화함) - + Debugging 디버깅 - + Dynarmic 동적 - + NCE NCE - + Borderless Windowed 테두리 없는 창 - + Exclusive Fullscreen 독점 전체 화면 - + No Video Output 비디오 출력 없음 - + CPU Video Decoding CPU 비디오 디코딩 - + GPU Video Decoding (Default) GPU 비디오 디코딩(기본값) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [실험적] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [실험적] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [실험적] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [실험적] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [실험적] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 최단입점 - + Bilinear 쌍선형 - + Bicubic 쌍입방 - + Gaussian 가우시안 - + Lanczos 란초스 - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area 영역 - + MMPX MMPX - + Zero-Tangent 제로탄젠트 - + B-Spline B-스플라인 - + Mitchell 미첼 - + Spline-1 스플라인-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None 없음 - + FXAA FXAA - + SMAA SMAA - + Default (16:9) 기본(16:9) - + Force 4:3 강제 4:3 - + Force 21:9 강제 21:9 - + Force 16:10 강제 16:10 - + Stretch to Window 화면 늘리기 - + Automatic 자동 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 일본어(日本語) - + American English 미국식 영어 - + French (français) 프랑스어(français) - + German (Deutsch) 독일어(Deutsch) - + Italian (italiano) 이탈리아어(italiano) - + Spanish (español) 스페인어(español) - + Chinese 중국어 - + Korean (한국어) 한국어(Korean) - + Dutch (Nederlands) 네덜란드어(Nederlands) - + Portuguese (português) 포르투갈어(português) - + Russian (Русский) 러시아어(Русский) - + Taiwanese 대만어 - + British English 영국식 영어 - + Canadian French 캐나다 프랑스어 - + Latin American Spanish 라틴아메리카 스페인어 - + Simplified Chinese 중국어 간체 - + Traditional Chinese (正體中文) 중국어 번체(正體中文) - + Brazilian Portuguese (português do Brasil) 브라질 포르투갈어(português do Brasil) - + Polish (polska) 폴란드어(polska) - + Thai (แบบไทย) 태국어(แบบไทย) - - + + Japan 일본 - + USA 미국 - + Europe 유럽 - + Australia 호주 - + China 중국 - + Korea 대한민국 - + Taiwan 대만 - + Auto (%1) Auto select time zone 자동(%1) - + Default (%1) Default time zone 기본(%1) - + CET CET - + CST6CDT CST6CDT - + Cuba 쿠바 - + EET EET - + Egypt 이집트 - + Eire 아일랜드 - + EST EST - + EST5EDT EST5EDT - + GB 영국 - + GB-Eire 영국-아일랜드 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 그리니치 - + Hongkong 홍콩 - + HST HST - + Iceland 아이슬란드 - + Iran 이란 - + Israel 이스라엘 - + Jamaica 자메이카 - + Kwajalein 콰잘레인 - + Libya 리비아 - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo 나바호 - + NZ 뉴질랜드 - + NZ-CHAT 뉴질랜드-채텀 - + Poland 폴란드 - + Portugal 포르투갈 - + PRC 중국 - + PST8PDT PST8PDT - + ROC 대만 - + ROK 대한민국 - + Singapore 싱가포르 - + Turkey 터키 - + UCT UCT - + Universal 세계 - + UTC UTC - + W-SU 모스크바 - + WET WET - + Zulu Zulu - + Mono 모노 - + Stereo 스테레오 - + Surround 서라운드 - + 4GB DRAM (Default) 4GB DRAM(기본값) - + 6GB DRAM (Unsafe) 6GB DRAM(불안전) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM(불안전) - + 12GB DRAM (Unsafe) 12GB DRAM(불안전) - + Docked 독 모드 - + Handheld 휴대 모드 - - + + Normal 보통 - - + + Boost 부스트 - - + + Overclock 오버클럭 - + Always ask (Default) 항상 묻기(기본값) - + Only if game specifies not to stop 게임에서 멈추지 말라고 명시한 경우에만 - + Never ask 절대 묻지 않음 - + Very Small (16 MB) 아주 작은 크기(16 MB) - + Small (32 MB) 작은 크기(32 MB) - + Normal (128 MB) 보통 크기(128 MB) - + Large (256 MB) 큰 크기(256 MB) - + Very Large (512 MB) 아주 큰 크기(512 MB) - + Very Low (4 MB) 매우 낮은 크기(4 MB) - + Low (8 MB) 낮은 크기(8 MB) - + Normal (16 MB) 보통 크기(16 MB) - + Medium (32 MB) 중간 크기(32 MB) - + High (64 MB) 높은 크기(64 MB) - + Very Low (32) 매우 낮은 크기(32) - + Low (64) 낮은 크기(64) - + Normal (128) 보통 크기(128) - + Medium (256) 보통(256) - + High (512) 빠름(512) - + Disabled 비활성화됨 - + ExtendedDynamicState 1 확장된 동적 상태 1 - + ExtendedDynamicState 2 확장된 동적 상태 2 - + ExtendedDynamicState 3 확장된 동적 상태 3 - + Tree View 트리 보기 - + Grid View 격자 보기 @@ -7079,7 +7056,7 @@ Debug Message: - + &Pause 일시중지(&P) @@ -7230,7 +7207,7 @@ Debug Message: - + &Start 시작(&S) @@ -7241,7 +7218,7 @@ Debug Message: - + R&ecord 기록(&e) @@ -7332,7 +7309,7 @@ Debug Message: - + None 없음 @@ -7358,743 +7335,743 @@ Debug Message: 캐러셀 보기(&C) - + Small (32x32) 작은 크기(32x32) - + Standard (64x64) 기본 크기(64x64) - + Large (128x128) 큰 크기(128x128) - + Full Size (256x256) 전체 크기(256x256) - + Broken Vulkan Installation Detected 손상된 Vulkan 설치가 발견됨 - + Vulkan initialization failed during boot. 부팅 중 Vulkan 초기화에 실패했습니다. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping 게임 실행 중 - + Loading Web Applet... 웹 애플릿을 불러오는 중... - - + + Disable Web Applet 웹 애플릿 비활성화 - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) 웹 애플릿을 비활성화하면 예기치 않은 동작이 발생할 수 있으며 슈퍼 마리오 3D 컬렉션에서만 사용해야 합니다. 웹 애플릿을 비활성화하겠습니까? (디버그 설정에서 다시 활성화할 수 있습니다.) - + The amount of shaders currently being built 현재 구축 중인 셰이더 수 - + The current selected resolution scaling multiplier. 현재 선택된 해상도 조정 배율입니다. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. 현재 에뮬레이션 속도입니다. 100%보다 높거나 낮은 값은 에뮬레이션이 스위치보다 빠르거나 느리게 실행되고 있음을 나타냅니다. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. 현재 게임이 표시하는 초당 프레임 수입니다. 이 값은 게임 및 장면에 따라 다릅니다. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. 프레임 제한이나 수직 동기화를 제외하고 스위치 프레임을 에뮬레이션하는 데 걸리는 시간입니다. 최고 속도 에뮬레이션의 경우 최대 16.67 밀리초입니다. - + Unmute 음소거 해제 - + Mute 음소거 - + Reset Volume 볼륨 재설정 - + Configure Effects... - + &Clear Recent Files 최근 파일 지우기(&C) - + &Continue 재개(&C) - + Warning: Outdated Game Format 경고: 구식 게임 형식입니다 - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. 현재 이 게임에 대해 구형 형식인 분해된 ROM 디렉터리 형식을 사용하고 있습니다. 이 형식은 NCA, NAX, XCI 또는 NSP와 같은 다른 형식으로 대체되었습니다. 분해된 ROM 디렉터리에는 아이콘, 메타데이터 및 업데이트 지원 기능이 없습니다.<br>Eden에서 지원하는 다양한 스위치 형식에 대한 자세한 내용은 사용자 설명서를 참조해 주세요. 이 메시지는 다시 표시되지 않습니다. - - + + Error while loading ROM! ROM 불러오는 중 오류 발생! - + The ROM format is not supported. 해당 ROM 형식은 지원되지 않습니다. - + An error occurred initializing the video core. 비디오 코어 초기화 중 오류가 발생했습니다. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. ROM 불러오는 중 오류 발생! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>파일을 다시 덤프하거나 디스코드/Stoat에서 도움을 요청해 주세요. - + An unknown error occurred. Please see the log for more details. 알 수 없는 오류가 발생했습니다. 자세한 내용은 로그를 참조해 주세요. - - + + (64-bit) (64비트) - - + + (32-bit) (32비트) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... 소프트웨어 닫는 중... - + Save Data 저장 데이터 - + Mod Data 모드 데이터 - + Error Opening %1 Folder %1 폴더 여는 중 오류 발생 - - + + Folder does not exist! 폴더가 존재하지 않습니다! - + Remove Installed Game Contents? 설치된 게임 콘텐츠를 제거하겠습니까? - + Remove Installed Game Update? 설치된 게임 업데이트를 제거하겠습니까? - + Remove Installed Game DLC? 설치된 게임 DLC를 제거하겠습니까? - + Remove Entry 항목 제거 - + Delete OpenGL Transferable Shader Cache? OpenGL 이동 가능한 셰이더 캐시를 삭제하겠습니까? - + Delete Vulkan Transferable Shader Cache? Vulkan 이동 가능한 셰이더 캐시를 삭제하겠습니까? - + Delete All Transferable Shader Caches? 이동 가능한 셰이더 캐시를 모두 삭제하겠습니까? - + Remove Custom Game Configuration? 사용자 지정 게임 구성을 제거하겠습니까? - + Remove Cache Storage? 캐시 저장소를 제거하겠습니까? - + Remove File 파일 제거 - + Remove Play Time Data 플레이 시간 데이터 제거 - + Reset play time? 플레이 시간을 재설정하겠습니까? - - + + RomFS Extraction Failed! RomFS 추출 실패! - + There was an error copying the RomFS files or the user cancelled the operation. RomFS 파일을 복사하는 중에 오류가 발생했거나 사용자가 작업을 취소했습니다. - + Full 전체 - + Skeleton 뼈대 - + Select RomFS Dump Mode RomFS 덤프 모드 선택 - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. RomFS 덤프 방식을 선택해 주세요. 전체를 선택하면 모든 파일이 새 디렉터리로 복사되고, 뼈대를 선택하면 디렉터리 구조만 생성됩니다. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root %1 위치에 RomFS를 추출할 수 있는 여유 공간이 부족합니다. 공간을 확보하거나 에뮬레이션 > 구성 > 시스템 > 파일 시스템 > 덤프 경로에서 다른 덤프 디렉터리를 선택해 주세요. - + Extracting RomFS... RomFS 추출 중... - - + + Cancel 취소 - + RomFS Extraction Succeeded! RomFS 추출 성공! - + The operation completed successfully. 작업이 성공적으로 완료되었습니다. - + Error Opening %1 %1을(를) 여는 중 오류 발생 - + Select Directory 디렉터리 선택 - + Properties 속성 - + The game properties could not be loaded. 게임 속성을 불러올 수 없습니다. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. 스위치 실행 파일(%1);;모든 파일(*.*) - + Load File 파일 불러오기 - + Open Extracted ROM Directory 추출된 ROM 디렉터리 열기 - + Invalid Directory Selected 유효하지 않은 디렉터리 선택됨 - + The directory you have selected does not contain a 'main' file. 선택한 디렉터리에는 'main' 파일이 없습니다. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) 설치 가능한 스위치 파일(*.nca, *.nsp, *.xci);;닌텐도 콘텐츠 아카이브(*.nca);;닌텐도 제출 패키지(*.nsp);;NX 카트리지 이미지(*.xci) - + Install Files 파일 설치 - + %n file(s) remaining %n개 파일 남음 - + Installing file "%1"... "%1" 파일 설치 중... - - + + Install Results 설치 결과 - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. 잠재적인 충돌을 방지하기 위해 저희는 사용자가 기본 게임을 NAND에 설치하는 것은 권장하지 않습니다. 이 기능은 업데이트 및 DLC 설치에만 사용해 주세요. - + %n file(s) were newly installed %n개 파일이 새로 설치됨 - + %n file(s) were overwritten %n개 파일이 덮어쓰기됨 - + %n file(s) failed to install %n개 파일 설치 실패 - + System Application 시스템 애플리케이션 - + System Archive 시스템 아카이브 - + System Application Update 시스템 애플리케이션 업데이트 - + Firmware Package (Type A) 펌웨어 패키지(A타입) - + Firmware Package (Type B) 펌웨어 패키지(B타입) - + Game 게임 - + Game Update 게임 업데이트 - + Game DLC 게임 DLC - + Delta Title 델타 타이틀 - + Select NCA Install Type... NCA 설치 유형 선택... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) 이 NCA를 설치할 타이틀 유형을 선택해 주세요: (대부분의 경우 기본값인 '게임'을 선택하면 됩니다.) - + Failed to Install 설치 실패 - + The title type you selected for the NCA is invalid. NCA에 대해 선택한 타이틀 유형이 유효하지 않습니다. - + File not found 파일을 찾을 수 없음 - + File "%1" not found "%1" 파일을 찾을 수 없음 - + OK 확인 - + Function Disabled 기능 비활성화됨 - + Compatibility list reporting is currently disabled. Check back later! 호환성 목록 보고 옵션이 현재 비활성화되어 있습니다. 나중에 다시 확인해 주세요! - + Error opening URL URL 여는 중 오류 발생 - + Unable to open the URL "%1". "%1" URL을 열 수 없습니다. - + TAS Recording TAS 녹화 - + Overwrite file of player 1? 플레이어 1의 파일을 덮어쓰겠습니까? - + Invalid config detected 무효한 구성이 발견됨 - + Handheld controller can't be used on docked mode. Pro controller will be selected. 휴대 모드 컨트롤러는 독 모드에서 사용할 수 없습니다. Pro 컨트롤러로 선택됩니다. - - + + Amiibo Amiibo - - + + The current amiibo has been removed 현재 amiibo가 제거됨 - + Error 오류 - - + + The current game is not looking for amiibos 현재 게임은 amiibo를 찾고 있지 않습니다 - + Amiibo File (%1);; All Files (*.*) Amiibo 파일(%1);; 모든 파일(*.*) - + Load Amiibo Amiibo 불러오기 - + Error loading Amiibo data Amiibo 데이터 불러오는 중 오류 발생 - + The selected file is not a valid amiibo 선택한 파일은 유효한 amiibo가 아닙니다 - + The selected file is already on use 선택한 파일은 이미 사용 중입니다 - + An unknown error occurred 알 수 없는 오류 발생 - + No firmware available 사용 가능한 펌웨어 없음 - + Firmware Corrupted 펌웨어 손상됨 - + Unknown applet 알 수 없는 애플릿 - + Applet doesn't map to a known value. 애플릿이 알려진 값에 매핑되지 않습니다. - + Record not found 기록을 찾을 수 없음 - + Applet not found. Please reinstall firmware. 애플릿을 찾을 수 없습니다. 펌웨어를 다시 설치해 주세요. - + Capture Screenshot 스크린샷 캡처 - + PNG Image (*.png) PNG 이미지(*.png) - + TAS state: Running %1/%2 TAS 상태: %1/%2 실행 중 - + TAS state: Recording %1 TAS 상태: %1 녹화 중 - + TAS state: Idle %1/%2 TAS 상태: %1/%2 유휴 - + TAS State: Invalid TAS 상태: 무효 - + &Stop Running 실행 중지(&S) - + Stop R&ecording 녹화 중지(&e) - + Building: %n shader(s) 구축 중: %n개 셰이더 - + Scale: %1x %1 is the resolution scaling factor 크기: %1x - + Speed: %1% / %2% 속도: %1% / %2% - + Speed: %1% 속도: %1% - + Game: %1 FPS 게임: %1 FPS - + Frame: %1 ms 프레임: %1 밀리초 - + NO AA AA 없음 - + NO FX - + FX - + VOLUME: MUTE 볼륨: 음소거 - + VOLUME: %1% Volume percentage (e.g. 50%) 볼륨: %1% - + Derivation Components Missing 파생 구성 요소 누락 - + Decryption keys are missing. Install them now? 복호화 키가 없습니다. 지금 설치하겠습니까? - + Wayland Detected! Wayland 발견됨! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8105,74 +8082,74 @@ Would you like to force it for future launches? 향후 출시를 위해 Wayland 사용을 강제하겠습니까? - + Use X11 X11 사용 - + Continue with Wayland Wayland와 계속 - + Don't show again 다시 보지 않기 - + Restart Required 재시작이 필요함 - + Restart Eden to apply the X11 backend. X11 백엔드를 적용하려면 Eden을 다시 시작하세요. - + Slow 저속 - + Turbo 터보 - + Unlocked 제한 해제 - + Select RomFS Dump Target RomFS 덤프 대상 선택 - + Please select which RomFS you would like to dump. 덤프할 RomFS를 선택하세요. - + Are you sure you want to close Eden? 정말 Eden을 닫겠습니까? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. 정말 에뮬레이션을 중지하겠습니까? 저장되지 않은 진행 상황은 모두 손실됩니다. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/nb.ts b/dist/languages/nb.ts index 0965db5041..5d77604547 100644 --- a/dist/languages/nb.ts +++ b/dist/languages/nb.ts @@ -786,1332 +786,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Bruk Vulkan-rørledningsbuffer - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Aktiver Reaktiv Tømming - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback Synkroniser med bildefrekvensen for videoavspilling - + Run the game at normal speed during video playback, even when the framerate is unlocked. Kjør spillet i normal hastighet under videoavspilling, selv når bildefrekvensen er låst opp. - + Barrier feedback loops Tilbakekoblingssløyfer for barrierer - + Improves rendering of transparency effects in specific games. Forbedrer gjengivelsen av transparenseffekter i spesifikke spill. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG-frø - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Enhetsnavn - + The name of the console. Konsollens navn. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Selvvalgt RTC-dato: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Språk: - + This option can be overridden when region setting is auto-select - + Region: Region: - + The region of the console. Konsollens region. - + Time Zone: Tidssone: - + The time zone of the console. Konsollens tidssone. - + Sound Output Mode: Lydutdatamodus: - + Console Mode: Konsollmodus: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Bekreft før stopping av emulering - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Gjem mus under inaktivitet - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Deaktiver kontroller-appleten - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates Se etter oppdateringer - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never Aldri - + On Load - + Always Alltid - + CPU CPU - + GPU Skjermkort - + CPU Asynchronous - + Uncompressed (Best quality) Ukomprimert (Best kvalitet) - + BC1 (Low quality) BC1 (Lav kvalitet) - + BC3 (Medium quality) BC3 (Middels kvalitet) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (eksperimentelt, kun AMD/Mesa) - + Null Null - + Fast Rask - - - + + + Accurate Nøyaktig - - - + + + Default Standard - + Unsafe (fast) Utrygg (raskt) - + Safe (stable) Trygg (stabil) - + Immediate - + Balanced Balansert - - Strict - - - - + Unsafe Utrygt - + Paranoid (disables most optimizations) Paranoid (deaktiverer de fleste optimaliseringer) - + Debugging - + Dynarmic - + NCE NCE - + Borderless Windowed Rammeløst vindu - + Exclusive Fullscreen Eksklusiv fullskjerm - + No Video Output Ingen videoutdata - + CPU Video Decoding CPU-videodekoding - + GPU Video Decoding (Default) GPU-videodekoding (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0,25× (180p/270p) [EKSPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5× (360p/540p) [EKSPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75× (540p/810p) [EKSPERIMENTELL] - + 1X (720p/1080p) 1× (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1,25× (900p/1350p) [EKSPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1,5× (1080p/1620p) [EKSPERIMENTELL] - + 2X (1440p/2160p) 2× (1440p/2160p) - + 3X (2160p/3240p) 3× (2160p/3240p) - + 4X (2880p/4320p) 4× (2880p/4320p) - + 5X (3600p/5400p) 5× (3600p/5400p) - + 6X (4320p/6480p) 6× (4320p/6480p) - + 7X (5040p/7560p) 7× (5040p/7560p) - + 8X (5760p/8640p) 8× (5760p/8640p) - + Nearest Neighbor Nærmeste nabo - + Bilinear Bilineær - + Bicubic Bikubisk - + Gaussian Gaussisk - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Område - + MMPX MMPX - + Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tving 4:3 - + Force 21:9 Tving 21:9 - + Force 16:10 Tving 16:10 - + Stretch to Window Strekk til vinduet - + Automatic Automatisk - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japansk (日本語) - + American English Amerikansk engelsk - + French (français) Fransk (français) - + German (Deutsch) Tysk (Deutsch) - + Italian (italiano) Italiensk (italiano) - + Spanish (español) Spansk (español) - + Chinese Kinesisk - + Korean (한국어) Koreansk (한국어) - + Dutch (Nederlands) Nederlandsk (Nederlands) - + Portuguese (português) Portugisisk (português) - + Russian (Русский) Russisk (Русский) - + Taiwanese Taiwansk - + British English Britisk engelsk - + Canadian French Kanadisk fransk - + Latin American Spanish Latinamerikansk spansk - + Simplified Chinese Forenklet kinesisk - + Traditional Chinese (正體中文) Tradisjonell kinesisk (正體中文) - + Brazilian Portuguese (português do Brasil) Brasiliansk portugisisk (português do Brasil) - + Polish (polska) Polsk (polska) - + Thai (แบบไทย) Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australia - + China Folkerepublikken Kina - + Korea Korea - + Taiwan Taiwan (Republikken Kina) - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standard (%1) - + CET Sentraleuropeisk tid - + CST6CDT CST6CDT - + Cuba Cuba - + EET Østeuropeisk tid - + Egypt Egypt - + Eire Republikken Irland - + EST EST - + EST5EDT EST5EDT - + GB Storbritannia - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC Folkerepublikken Kina - + PST8PDT PST8PDT - + ROC Taiwan (Republikken Kina) - + ROK Sør-Korea - + Singapore Singapore - + Turkey Tyrkia - + UCT UCT - + Universal Universalt - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (Standard) - + 6GB DRAM (Unsafe) 6 GB DRAM (Utrygt) - + 8GB DRAM 8 GB DRAM - + 10GB DRAM (Unsafe) 10 GB DRAM (Utrygt) - + 12GB DRAM (Unsafe) 12 GB DRAM (Utrygt) - + Docked I dokking - + Handheld Håndholdt - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Spør alltid (Standard) - + Only if game specifies not to stop - + Never ask Aldri spør - + Very Small (16 MB) Veldig liten (16 MB) - + Small (32 MB) Liten (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Stor (256 MB) - + Very Large (512 MB) Veldig stor (512 MB) - + Very Low (4 MB) Veldig lav (4 MB) - + Low (8 MB) Lav (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Middels (32 MB) - + High (64 MB) Høy (64 MB) - + Very Low (32) Svært lav (32) - + Low (64) Lav (64) - + Normal (128) Normal (128) - + Medium (256) Middels (256) - + High (512) Høy (512) - + Disabled Skrudd av - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6988,7 +6971,7 @@ Debug Message: - + &Pause &Pause @@ -7139,7 +7122,7 @@ Debug Message: - + &Start &Start @@ -7150,7 +7133,7 @@ Debug Message: - + R&ecord T&a opp @@ -7241,7 +7224,7 @@ Debug Message: - + None Ingen @@ -7267,737 +7250,737 @@ Debug Message: - + Small (32x32) Liten (32x32) - + Standard (64x64) Standard (64x64) - + Large (128x128) Stor (128x128) - + Full Size (256x256) Full størrelse (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Kjører et spill - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute Slå på lyd - + Mute Demp - + Reset Volume Tilbakestill volum - + Configure Effects... - + &Clear Recent Files &Tøm nylige filer - + &Continue &Fortsett - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... Lukker programvare ... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! Mappen finnes ikke! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File Fjern fil - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full Full - + Skeleton Skjelett - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... Utvinner RomFS... - - + + Cancel Avbryt - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory Velg mappe - + Properties Egenskaper - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... Installerer filen «%1» ... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application Systemapp - + System Archive Systemarkiv - + System Application Update - + Firmware Package (Type A) Fastvarepakke (Type A) - + Firmware Package (Type B) Fastvarepakke (Type B) - + Game Spill - + Game Update Spilloppdatering - + Game DLC Spill-DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found Filen ble ikke funnet - + File "%1" not found - + OK OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL Feil under åpning av URL - + Unable to open the URL "%1". - + TAS Recording TAS-opptak - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo amiibo - - + + The current amiibo has been removed - + Error Feil - - + + The current game is not looking for amiibos Det nåværende spillet ser ikke etter amiiboer - + Amiibo File (%1);; All Files (*.*) amiibo-fil (%1);; Alle filer (*.*) - + Load Amiibo Last inn amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available Ingen fastvare tilgjengelig - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot Ta skjermklipp - + PNG Image (*.png) PNG-bilde (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor Skala: %1x - + Speed: %1% / %2% Hastighet: %1% / %2% - + Speed: %1% Hastighet: %1% - + Game: %1 FPS Spill: %1 FPS - + Frame: %1 ms Ramme: %1 ms - + NO AA INGEN AA - + NO FX - + FX - + VOLUME: MUTE VOLUM: DEMP - + VOLUME: %1% Volume percentage (e.g. 50%) VOLUM: %1% - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8005,74 +7988,74 @@ Would you like to force it for future launches? - + Use X11 Bruk X11 - + Continue with Wayland - + Don't show again Ikke vis igjen - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow Treg - + Turbo Turbo - + Unlocked Ubegrenset - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/nl.ts b/dist/languages/nl.ts index 6a6f9b21b3..02b1520724 100644 --- a/dist/languages/nl.ts +++ b/dist/languages/nl.ts @@ -793,1332 +793,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Gebruik Vulkan-pijplijn-cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Schakel Reactive Flushing In - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Apparaatnaam - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Aangepaste RTC Datum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Taal: - + This option can be overridden when region setting is auto-select - + Region: Regio: - + The region of the console. - + Time Zone: Tijdzone: - + The time zone of the console. - + Sound Output Mode: Geluidsuitvoermodus: - + Console Mode: Console Modus: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Bevestig voordat u de emulatie stopt - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Verberg muis wanneer inactief - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Controller-applet uitschakelen - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) BC1 (Lage Kwaliteit) - + BC3 (Medium quality) BC3 (Gemiddelde kwaliteit) - - + + Auto Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Accuraat - - - + + + Default Standaard - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe Onveilig - + Paranoid (disables most optimizations) Paranoid (schakelt de meeste optimalisaties uit) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Randloos Venster - + Exclusive Fullscreen Exclusief Volledig Scherm - + No Video Output Geen Video-uitvoer - + CPU Video Decoding CPU Videodecodering - + GPU Video Decoding (Default) GPU Videodecodering (Standaard) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTEEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTEEL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Geen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standaart (16:9) - + Force 4:3 Forceer 4:3 - + Force 21:9 Forceer 21:9 - + Force 16:10 Forceer 16:10 - + Stretch to Window Uitrekken naar Venster - + Automatic Automatisch - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japans (日本語) - + American English Amerikaans-Engels - + French (français) Frans (Français) - + German (Deutsch) Duits (Deutsch) - + Italian (italiano) Italiaans (italiano) - + Spanish (español) Spaans (Español) - + Chinese Chinees - + Korean (한국어) Koreaans (한국어) - + Dutch (Nederlands) Nederlands (Nederlands) - + Portuguese (português) Portugees (português) - + Russian (Русский) Russisch (Русский) - + Taiwanese Taiwanese - + British English Brits-Engels - + Canadian French Canadees-Frans - + Latin American Spanish Latijns-Amerikaans Spaans - + Simplified Chinese Vereenvoudigd Chinees - + Traditional Chinese (正體中文) Traditioneel Chinees (正體中文) - + Brazilian Portuguese (português do Brasil) Braziliaans-Portugees (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australië - + China China - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standaard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egypte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Ijsland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libië - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turkije - + UCT UCT - + Universal Universeel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6984,7 +6967,7 @@ Debug Message: - + &Pause &Onderbreken @@ -7135,7 +7118,7 @@ Debug Message: - + &Start &Start @@ -7146,7 +7129,7 @@ Debug Message: - + R&ecord Opnemen @@ -7237,7 +7220,7 @@ Debug Message: - + None @@ -7263,737 +7246,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8001,74 +7984,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/pl.ts b/dist/languages/pl.ts index 6ab9b388b4..8e76bb191e 100644 --- a/dist/languages/pl.ts +++ b/dist/languages/pl.ts @@ -824,105 +824,93 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation Włącz asynchroniczną kompilację shaderów - + May reduce shader stutter. Może zmniejszyć zacięcia spowodowane kompilacją shaderów. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Użyj pamięci podręcznej strumienia dla Vulkana - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Włącza specyficzną dla producenta GPU pamięć podręczną potoków. Ta opcja może znacząco skrócić czas ładowania shaderów w przypadkach, gdy sterownik Vulkan nie przechowuje wewnętrznie plików pamięci podręcznej potoków. - + Enable Compute Pipelines (Intel Vulkan Only) Włącz potoki obliczeniowe (tylko Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -931,192 +919,192 @@ To ustawienie istnieje wyłącznie dla sterowników Intela i może spowodować b Na wszystkich pozostałych sterownikach potoki obliczeniowe są zawsze włączone. - + Enable Reactive Flushing Włącz reaktywne opróżnianie buforów - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Używa opróżniania reaktywnego zamiast predykcyjnego, co umożliwia dokładniejsze synchronizowanie pamięci. - + Sync to framerate of video playback Synchronizuj do liczby klatek odtwarzanego wideo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Uruchamiaj grę z normalną prędkością podczas odtwarzania wideo, nawet przy odblokowanej liczbie klatek na sekundę. - + Barrier feedback loops Pętle sprzężenia zwrotnego barier - + Improves rendering of transparency effects in specific games. Poprawia renderowanie efektów przezroczystości w niektórych grach. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State Rozszerzony stan dynamiczny - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Kontroluje liczbę funkcji, które mogą być używane w Extended Dynamic State. Wyższe poziomy pozwalają na użycie większej liczby funkcji i mogą zwiększyć wydajność, ale mogą powodować dodatkowe problemy z grafiką. - + Vertex Input Dynamic State Dynamiczny stan wejścia wierzchołków - + Enables vertex input dynamic state feature for better quality and performance. Włącza funkcję dynamicznego stanu wejścia wierzchołków, poprawiając jakość i wydajność. - + Sample Shading Cieniowanie próbkowe - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Pozwala wykonywać shader fragmentów dla każdej próbki we fragmencie wielokrotnie próbkowanym zamiast raz dla każdego fragmentu. Poprawia jakość grafiki kosztem wydajności. Wyższe wartości poprawiają jakość, ale obniżają wydajność. - + RNG Seed Ziarno RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Ustala ziarno generatora liczb losowych. Głównie używane do speedrunów. - + Device Name Nazwa urządzenia - + The name of the console. The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Własna data RTC - + This option allows to change the clock of the console. Can be used to manipulate time in games. Ta opcja pozwala zmienić zegar konsoli. Może służyć do manipulowania czasem w grach. - + The number of seconds from the current unix time Liczba sekund od bieżącego czasu Unix - + Language: Język: - + This option can be overridden when region setting is auto-select Ta opcja może zostać nadpisana, gdy ustawienie regionu to automatyczny wybór. - + Region: Region: - + The region of the console. Region konsoli. - + Time Zone: Strefa czasowa: - + The time zone of the console. Strefa czasowa konsoli. - + Sound Output Mode: Tryb wyjścia dźwięku: - + Console Mode: Tryb konsoli - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1125,1042 +1113,1037 @@ W zależności od tego ustawienia gry zmienią swoją rozdzielczość, szczegó Ustawienie na Handheld może poprawić wydajność na słabszych komputerach. - + Prompt for user profile on boot Pytaj o profil użytkownika przy uruchomieniu. - + Useful if multiple people use the same PC. Przydatne, gdy z tego samego PC korzysta wiele osób. - + Pause when not in focus Wstrzymuj, gdy okno nie jest aktywne - + Pauses emulation when focusing on other windows. Wstrzymuje emulację po przełączeniu na inne okna. - + Confirm before stopping emulation Potwierdzaj przed zatrzymaniem emulacji - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Nadpisuje monity z prośbą o potwierdzenie zatrzymania emulacji. Włączenie powoduje pominięcie takich monitów i bezpośrednie wyjście z emulacji. - + Hide mouse on inactivity Ukryj mysz przy braku aktywności - + Hides the mouse after 2.5s of inactivity. Ukrywa kursor po 2,5 s bezczynności. - + Disable controller applet Wyłącz aplet kontrolera - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Wymusza wyłączenie użycia apletu kontrolera w oprogramowaniu uruchamianym w emulacji. Jeśli emulowane oprogramowanie próbuje otworzyć aplet kontrolera, jest on natychmiast zamykany. - + Check for updates Sprawdź aktualizacje - + Whether or not to check for updates upon startup. Czy sprawdzać aktualizacje przy uruchomieniu. - + Enable Gamemode Włącz Tryb gry - + Force X11 as Graphics Backend Wymuś X11 jako backend grafiki - + Custom frontend Niestandardowy frontend - + Real applet Prawdziwy aplet - + Never Nigdy - + On Load Przy wczytywaniu - + Always Zawsze - + CPU CPU - + GPU GPU - + CPU Asynchronous Asynchroniczne CPU - + Uncompressed (Best quality) Brak (najlepsza jakość) - + BC1 (Low quality) BC1 (niska jakość) - + BC3 (Medium quality) BC3 (średnia jakość) - - + + Auto Automatyczny - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Konserwatywny - + Aggressive Agresywny - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast Szybkie - - - + + + Accurate Dokładny - - - + + + Default Domyślny - + Unsafe (fast) Niezalecane (szybkie) - + Safe (stable) Bezpieczne (stabilne) - + Immediate - + Balanced Zrównoważony - - Strict - - - - + Unsafe Niebezpieczny - + Paranoid (disables most optimizations) Paranoiczne (wyłącza większość optymalizacji) - + Debugging Debugowanie - + Dynarmic Dynamiczny - + NCE NCE - + Borderless Windowed W oknie (Bezramkowy) - + Exclusive Fullscreen Exclusive Fullscreen - + No Video Output Brak wyjścia wideo - + CPU Video Decoding Dekodowanie Wideo przez CPU - + GPU Video Decoding (Default) Dekodowanie Wideo przez GPU (Domyślne) - + 0.25X (180p/270p) [EXPERIMENTAL] 0,25x (180p/270p) [EKSPERYMENTALNE] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5x (360p/540p) [EKSPERYMENTALNE] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EKSPERYMENTALNE] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EKSPERYMENTALNE] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [Ekperymentalnie] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Najbliższy sąsiadujący - + Bilinear Bilinearny - + Bicubic Bikubiczny - + Gaussian Kulisty - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Obszar - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Żadna (wyłączony) - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Domyślne (16:9) - + Force 4:3 Wymuś 4:3 - + Force 21:9 Wymuś 21:9 - + Force 16:10 Wymuś 16:10 - + Stretch to Window Rozciągnij do Okna - + Automatic Automatyczne - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japoński (日本語) - + American English Angielski Amerykański - + French (français) Francuski (français) - + German (Deutsch) Niemiecki (Niemcy) - + Italian (italiano) Włoski (italiano) - + Spanish (español) Hiszpański (español) - + Chinese Chiński - + Korean (한국어) Koreański (한국어) - + Dutch (Nederlands) Duński (Holandia) - + Portuguese (português) Portugalski (português) - + Russian (Русский) Rosyjski (Русский) - + Taiwanese Tajwański - + British English Angielski Brytyjski - + Canadian French Fancuski (Kanada) - + Latin American Spanish Hiszpański (Latin American) - + Simplified Chinese Chiński (Uproszczony) - + Traditional Chinese (正體中文) Chiński tradycyjny (正體中文) - + Brazilian Portuguese (português do Brasil) Portugalski (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonia - + USA USA - + Europe Europa - + Australia Australia - + China Chiny - + Korea Korea - + Taiwan Tajwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Domyślne (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipt - + Eire Irlandia - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Iran - + Israel Izrael - + Jamaica Jamajka - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polska - + Portugal Portugalia - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turcja - + UCT UCT - + Universal Uniwersalny - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Domyślne) - + 6GB DRAM (Unsafe) 6GB DRAM (NIebezpieczne) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (NIebezpieczne) - + 12GB DRAM (Unsafe) 12GB DRAM (NIebezpieczne) - + Docked Zadokowany - + Handheld Przenośnie - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Zawsze pytaj (Domyślne) - + Only if game specifies not to stop Tylko jeśli gra określa, aby nie zatrzymywać - + Never ask Nie pytaj więcej - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Średnie (256) - + High (512) Wysokie (512) - + Disabled Wyłączone - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View - + Grid View @@ -7051,7 +7034,7 @@ Komunikat debugowania: - + &Pause &Pauza @@ -7202,7 +7185,7 @@ Komunikat debugowania: - + &Start &Start @@ -7213,7 +7196,7 @@ Komunikat debugowania: - + R&ecord &Nagraj @@ -7304,7 +7287,7 @@ Komunikat debugowania: - + None Żadna (wyłączony) @@ -7330,406 +7313,406 @@ Komunikat debugowania: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected Wykryto uszkodzoną instalację Vulkan - + Vulkan initialization failed during boot. Inicjalizacja Vulkana nie powiodła się podczas uruchamiania. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Gra uruchomiona - + Loading Web Applet... Ładowanie apletu internetowego... - - + + Disable Web Applet Wyłącz Aplet sieciowy - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Wyłączenie apletu sieciowego może prowadzić do nieprzewidywalnego działania i powinno być używane wyłącznie z Super Mario 3D All-Stars. Na pewno chcesz wyłączyć aplet sieciowy? (Tę opcję można ponownie włączyć w ustawieniach debugowania). - + The amount of shaders currently being built Liczba shaderów aktualnie budowanych - + The current selected resolution scaling multiplier. Aktualnie wybrany mnożnik skalowania rozdzielczości. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Bieżąca prędkość emulacji. Wartości wyższe lub niższe niż 100% oznaczają, że emulacja działa odpowiednio szybciej lub wolniej niż na Switchu. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Liczba klatek na sekundę aktualnie wyświetlanych przez grę. Wartość ta zależy od gry oraz od konkretnej sceny. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Czas potrzebny na emulację jednej klatki Switcha, bez uwzględniania ogranicznika klatek i synchronizacji pionowej. Dla emulacji z pełną prędkością powinno to być maksymalnie 16,67 ms. - + Unmute Wyłącz wyciszenie - + Mute Wycisz - + Reset Volume Zresetuj głośność - + Configure Effects... - + &Clear Recent Files &Usuń Ostatnie pliki - + &Continue &Kontynuuj - + Warning: Outdated Game Format Ostrzeżenie: Nieaktualny format gry - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Używasz dla tej gry formatu katalogu zdekonstruowanego ROM-u, który jest przestarzały i został zastąpiony innymi formatami, takimi jak NCA, NAX, XCI czy NSP. Katalogi takich ROM-ów nie zawierają ikon, metadanych ani nie obsługują aktualizacji.<br>Aby uzyskać wyjaśnienie dotyczące różnych formatów Switcha obsługiwanych przez Eden, zajrzyj do naszego podręcznika użytkownika. Ten komunikat nie zostanie wyświetlony ponownie. - - + + Error while loading ROM! Błąd podczas wczytywania ROMu! - + The ROM format is not supported. Ten format ROMu nie jest wspierany. - + An error occurred initializing the video core. Wystąpił błąd podczas inicjowania rdzenia wideo. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Błąd podczas wczytywania ROMu! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Proszę ponownie zrzucić pliki lub poprosić o pomoc na Discordzie/Stoat. - + An unknown error occurred. Please see the log for more details. Wystąpił nieznany błąd. Więcej informacji można znaleźć w pliku log. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Zamykanie aplikacji... - + Save Data Zapis danych - + Mod Data Dane modów - + Error Opening %1 Folder Błąd podczas otwierania folderu %1 - - + + Folder does not exist! Folder nie istnieje! - + Remove Installed Game Contents? Usunąć zainstalowaną zawartość gry? - + Remove Installed Game Update? Usunąć zainstalowaną aktualizację gry? - + Remove Installed Game DLC? Usunąć zainstalowane DLC gry? - + Remove Entry Usuń wpis - + Delete OpenGL Transferable Shader Cache? Usunąć przenośną pamięć podręczną shaderów OpenGL? - + Delete Vulkan Transferable Shader Cache? Usunąć przenośną pamięć podręczną shaderów Vulkan? - + Delete All Transferable Shader Caches? Usunąć wszystkie przenośne pamięci podręczne shaderów? - + Remove Custom Game Configuration? Usunąć niestandardową konfigurację gry? - + Remove Cache Storage? Usunąć pamięć podręczną? - + Remove File Usuń plik - + Remove Play Time Data Usuń dane czasu gry - + Reset play time? Zresetować czas gry? - - + + RomFS Extraction Failed! Wyodrębnianie RomFS nie powiodło się! - + There was an error copying the RomFS files or the user cancelled the operation. Wystąpił błąd podczas kopiowania plików RomFS lub użytkownik przerwał operację. - + Full Pełny - + Skeleton Szkielet - + Select RomFS Dump Mode Wybierz tryb zrzutu RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Wybierz sposób wykonania zrzutu RomFS. <br>Tryb „Pełny” skopiuje wszystkie pliki do nowego katalogu, <br>natomiast „Szkielet” utworzy jedynie strukturę katalogów. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root Nie ma wystarczająco miejsca w %1 aby wyodrębnić RomFS. Zwolnij trochę miejsca, albo zmień ścieżkę zrzutu RomFs w Emulacja > Konfiguruj > System > System Plików > Źródło Zrzutu - + Extracting RomFS... Wypakowywanie RomFS... - - + + Cancel Anuluj - + RomFS Extraction Succeeded! Wypakowanie RomFS zakończone pomyślnie! - + The operation completed successfully. Operacja zakończona pomyślnie. - + Error Opening %1 Błąd podczas otwierania %1 - + Select Directory Wybierz folder - + Properties Właściwości - + The game properties could not be loaded. Właściwości tej gry nie mogły zostać załadowane. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Plik wykonywalny Switcha (%1);;Wszystkie pliki (*.*) - + Load File Załaduj plik - + Open Extracted ROM Directory Otwórz folder wypakowanego ROMu - + Invalid Directory Selected Wybrano niewłaściwy folder - + The directory you have selected does not contain a 'main' file. Wybrany folder nie zawiera 'głównego' pliku. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Instalacyjne pliki Switch'a (*.nca *.nsp *.xci);;Archiwum zawartości Nintendo (*.nca);;Pakiet poddany Nintendo (*.nsp);;Obraz z kartridża NX (*.xci) - + Install Files Zainstaluj pliki - + %n file(s) remaining Pozostał %n plikPozostały %n plikiPozostało %n plikówPozostało %n plików - + Installing file "%1"... Instalowanie pliku "%1"... - - + + Install Results Wynik instalacji - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Aby uniknąć ewentualnych konfliktów, odradzamy użytkownikom instalowanie gier na NAND. Proszę, używaj tej funkcji tylko do instalowania łatek i DLC. - + %n file(s) were newly installed %n plik został nowo zainstalowany @@ -7739,7 +7722,7 @@ Proszę, używaj tej funkcji tylko do instalowania łatek i DLC. - + %n file(s) were overwritten %n plik został nadpisany @@ -7749,7 +7732,7 @@ Proszę, używaj tej funkcji tylko do instalowania łatek i DLC. - + %n file(s) failed to install Nie udało się zainstalować %n pliku @@ -7759,324 +7742,324 @@ Proszę, używaj tej funkcji tylko do instalowania łatek i DLC. - + System Application Aplikacja systemowa - + System Archive Archiwum systemu - + System Application Update Aktualizacja aplikacji systemowej - + Firmware Package (Type A) Paczka systemowa (Typ A) - + Firmware Package (Type B) Paczka systemowa (Typ B) - + Game Gra - + Game Update Aktualizacja gry - + Game DLC Dodatek do gry - + Delta Title Tytuł Delta - + Select NCA Install Type... Wybierz typ instalacji NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Wybierz typ tytułu, do którego chcesz zainstalować ten NCA, jako: (W większości przypadków domyślna "gra" jest w porządku.) - + Failed to Install Instalacja nieudana - + The title type you selected for the NCA is invalid. Typ tytułu wybrany dla NCA jest nieprawidłowy. - + File not found Nie znaleziono pliku - + File "%1" not found Nie znaleziono pliku "%1" - + OK OK - + Function Disabled Funkcja wyłączona - + Compatibility list reporting is currently disabled. Check back later! Zgłaszanie do listy kompatybilności jest obecnie wyłączone. Spróbuj ponownie później! - + Error opening URL Błąd otwierania adresu URL - + Unable to open the URL "%1". Nie można otworzyć adresu URL "%1". - + TAS Recording Nagrywanie TAS - + Overwrite file of player 1? Nadpisać plik gracza 1? - + Invalid config detected Wykryto nieprawidłową konfigurację - + Handheld controller can't be used on docked mode. Pro controller will be selected. Nie można używać kontrolera handheld w trybie zadokowanym. Zostanie wybrany kontroler Pro. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Amiibo zostało "zdjęte" - + Error Błąd - - + + The current game is not looking for amiibos Ta gra nie szuka amiibo - + Amiibo File (%1);; All Files (*.*) Plik Amiibo (%1);;Wszyskie pliki (*.*) - + Load Amiibo Zamontuj Amiibo - + Error loading Amiibo data Błąd podczas ładowania danych Amiibo - + The selected file is not a valid amiibo Wybrany plik nie jest poprawnym amiibo - + The selected file is already on use Wybrany plik jest już w użyciu - + An unknown error occurred Wystąpił nieznany błąd - + No firmware available Brak dostępnego firmware'u - + Firmware Corrupted Uszkodzony Firmware - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot Zrób zrzut ekranu - + PNG Image (*.png) Obrazek PNG (*.png) - + TAS state: Running %1/%2 Status TAS: Działa %1%2 - + TAS state: Recording %1 Status TAS: Nagrywa %1 - + TAS state: Idle %1/%2 Status TAS: Bezczynny %1%2 - + TAS State: Invalid Status TAS: Niepoprawny - + &Stop Running &Wyłącz - + Stop R&ecording Przestań &Nagrywać - + Building: %n shader(s) Budowanie: %n shaderBudowanie: %n shaderyBudowanie: %n shaderówBudowanie: %n shaderów - + Scale: %1x %1 is the resolution scaling factor Skala: %1x - + Speed: %1% / %2% Prędkość: %1% / %2% - + Speed: %1% Prędkość: %1% - + Game: %1 FPS Gra: %1 FPS - + Frame: %1 ms Klatka: %1 ms - + NO AA BEZ AA - + NO FX - + FX - + VOLUME: MUTE Głośność: Wyciszony - + VOLUME: %1% Volume percentage (e.g. 50%) Głośność: %1% - + Derivation Components Missing Brak komponentów wyprowadzania - + Decryption keys are missing. Install them now? - + Wayland Detected! Wykryto Waylanda! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8086,74 +8069,74 @@ Zaleca się zamiast tego używać X11. Czy chcesz wymusić jego użycie przy przyszłych uruchomieniach? - + Use X11 Używaj X11 - + Continue with Wayland Kontynuuj z Waylandem - + Don't show again Nie pokazuj ponownie - + Restart Required Wymagane ponowne uruchomienie - + Restart Eden to apply the X11 backend. Uruchom ponownie Edena, aby zastosować backend X11. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target Wybierz cel zrzutu RomFS - + Please select which RomFS you would like to dump. Proszę wybrać RomFS, jakie chcesz zrzucić. - + Are you sure you want to close Eden? Czy na pewno chcesz zamknąć Edena? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Czy na pewno chcesz zatrzymać emulację? Wszystkie niezapisane postępy zostaną utracone. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/pt_BR.ts b/dist/languages/pt_BR.ts index 7113730221..a180d00364 100644 --- a/dist/languages/pt_BR.ts +++ b/dist/languages/pt_BR.ts @@ -824,60 +824,48 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation Ativar compilação assíncrona de shaders - + May reduce shader stutter. Pode reduzir travamentos de shaders. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Acelera a decodificação de texturas 3D BCn usando processamento da GPU. Desative se ocorrerem travamentos ou falhas gráficas. - + GPU Unswizzle Max Texture Size Tamanho Máximo de Textura para GPU Unswizzle - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -886,48 +874,48 @@ A GPU é mais rápida para texturas médias e grandes, mas a CPU pode ser mais e Ajuste para encontrar o equilíbrio entre aceleração da GPU e sobrecarga da CPU. - + GPU Unswizzle Stream Size Tamanho do Fluxo de GPU Unswizzle - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Define a quantidade máxima de dados de textura (em MiB) processados por quadro. Valores mais altos podem reduzir travamentos durante o carregamento de texturas, mas podem afetar a consistência dos quadros. - + GPU Unswizzle Chunk Size Tamanho do Bloco de GPU Unswizzle - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Determina o número de fatias de profundidade processadas em uma única execução. Aumentar esse valor pode melhorar o desempenho em GPUs avançadas, mas pode causar TDR ou tempo limite do driver em hardwares mais fracos. - + Use Vulkan pipeline cache Utilizar cache de pipeline do Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Habilita o cache de pipeline da fabricante da GPU. Esta opção pode melhorar o tempo de carregamento de shaders significantemente em casos onde o driver Vulkan não armazena o cache de pipeline internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Habilitar Pipeline de Computação (Somente Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -936,194 +924,194 @@ Esta configuração existe apenas para drivers proprietários da Intel e pode ca Pipelines de computação estão sempre habilitados em outros drivers. - + Enable Reactive Flushing Habilitar Flushing Reativo - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Usa flushing reativo ao invés de flushing preditivo, permitindo mais precisão na sincronização da memória. - + Sync to framerate of video playback Sincronizar com o framerate da reprodução de vídeo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Executa o jogo na velocidade normal durante a reprodução de vídeo, mesmo se o framerate estiver desbloqueado. - + Barrier feedback loops Ciclos de feedback de barreira - + Improves rendering of transparency effects in specific games. Melhora a renderização de efeitos de transparência em jogos específicos. - + Enable buffer history Ativar histórico de buffer - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Permite acesso a estados anteriores do buffer. Esta opção pode melhorar a qualidade de renderização e a consistência de desempenho em alguns jogos. - + Fix bloom effects Corrigir efeitos de bloom - + Removes bloom in Burnout. Remove o bloom no Burnout. - + Enable Legacy Rescale Pass Ativar Passagem de Redimensionamento Legada - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Pode corrigir problemas de redimensionamento em alguns jogos, baseando-se no comportamento da implementação anterior. Solução legada que corrige artefatos de linha em GPUs AMD e Intel, e cintilação de texturas cinzas em GPUs Nvidia no Luigi's Mansion 3. - + Extended Dynamic State Estado Dinâmico Estendido - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Controla o número de recursos que podem ser usados no Estado Dinâmico Estendido. Estados mais altos permitem mais recursos e podem aumentar o desempenho, mas também podem causar problemas gráficos adicionais. - + Vertex Input Dynamic State Estado Dinâmico de Entrada de Vértices - + Enables vertex input dynamic state feature for better quality and performance. Ativa o recurso de estado dinâmico de entrada de vértices para melhor qualidade e desempenho. - + Sample Shading Sombreamento por Amostragem - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permite que o shader de fragmento seja processado por cada amostra em fragmentos multiamostrados, em vez de uma única vez por fragmento. Melhora a qualidade gráfica ao custo de desempenho. Valores mais altos aumentam a qualidade, mas reduzem a performance. - + RNG Seed Semente de RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Controla a semente do gerador de números aleatórios. Usado principalmente em speedruns. - + Device Name Nome do Dispositivo - + The name of the console. O nome do console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Data personalizada do RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Esta opção permite alterar o relógio do console. Pode ser usada para manipular o tempo nos jogos. - + The number of seconds from the current unix time Número de segundos a partir do tempo Unix atual - + Language: Idioma: - + This option can be overridden when region setting is auto-select Esta opção pode ser substituída quando a configuração de região estiver em seleção automática - + Region: Região: - + The region of the console. A região do console. - + Time Zone: Fuso Horário: - + The time zone of the console. O fuso horário do console. - + Sound Output Mode: Modo de saída de som - + Console Mode: Modo Console: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1132,1042 +1120,1037 @@ Os jogos ajustarão resolução, detalhes e controladores suportados conforme es Definir como Portátil pode ajudar a melhorar o desempenho em sistemas mais fracos. - + Prompt for user profile on boot Solicitar perfil de usuário na inicialização - + Useful if multiple people use the same PC. Útil se várias pessoas usam o mesmo PC. - + Pause when not in focus Pausar quando não estiver em foco - + Pauses emulation when focusing on other windows. Pausa a emulação ao focar em outras janelas. - + Confirm before stopping emulation Confirmar antes de parar a emulação - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Substitui as confirmações ao parar a emulação. Ao ativar, ignora esses avisos e encerra diretamente a emulação. - + Hide mouse on inactivity Esconder rato quando inactivo. - + Hides the mouse after 2.5s of inactivity. Oculta o mouse após 2,5s de inatividade. - + Disable controller applet Desabilitar applet de controle - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Desativa forçadamente o uso do applet de controle em programas emulados. Quando um programa tenta abrir o applet, ele é imediatamente fechado. - + Check for updates Verificar atualizações - + Whether or not to check for updates upon startup. Define se deve verificar atualizações na inicialização. - + Enable Gamemode Habilitar Gamemode - + Force X11 as Graphics Backend Forçar X11 como backend gráfico - + Custom frontend Frontend customizado - + Real applet Applet real - + Never Nunca - + On Load Ao carregar - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Assíncrona - + Uncompressed (Best quality) Descompactado (Melhor Qualidade) - + BC1 (Low quality) BC1 (Baixa qualidade) - + BC3 (Medium quality) BC3 (Média qualidade) - - + + Auto Automático - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservador - + Aggressive Agressivo - + Vulkan Vulcano - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Shaders em Assembly, apenas NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, apenas AMD/Mesa) - + Null Nenhum - + Fast Rápido - - - + + + Accurate Preciso - - - + + + Default Padrão - + Unsafe (fast) Inseguro (rápido) - + Safe (stable) Seguro (estável) - + Immediate - + Balanced Balanceado - - Strict - - - - + Unsafe Inseguro - + Paranoid (disables most optimizations) Paranoia (desativa a maioria das otimizações) - + Debugging Depuração - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Janela sem bordas - + Exclusive Fullscreen Tela cheia exclusiva - + No Video Output Sem saída de vídeo - + CPU Video Decoding Decodificação de vídeo pela CPU - + GPU Video Decoding (Default) Decodificação de vídeo pela GPU (Padrão) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Vizinho mais próximo - + Bilinear Bilinear - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Área - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nenhum - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Padrão (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 Forçar 16:10 - + Stretch to Window Esticar à Janela - + Automatic Automático - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonês (日本語) - + American English Inglês Americano - + French (français) Francês (français) - + German (Deutsch) Alemão (Deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Espanhol (español) - + Chinese Chinês - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandês (Nederlands) - + Portuguese (português) Português (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanês - + British English Inglês Britânico - + Canadian French Francês Canadense - + Latin American Spanish Espanhol Latino-Americano - + Simplified Chinese Chinês Simplificado - + Traditional Chinese (正體中文) Chinês Tradicional (正 體 中文) - + Brazilian Portuguese (português do Brasil) Português do Brasil (Brazilian Portuguese) - + Polish (polska) Polonês (polska) - + Thai (แบบไทย) Tailandês (แบบไทย) - - + + Japan Japão - + USA EUA - + Europe Europa - + Australia Austrália - + China China - + Korea Coreia - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Padrão (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egito - + Eire Irlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islândia - + Iran Irã - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polônia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estéreo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Padrão) - + 6GB DRAM (Unsafe) 6GB DRAM (Não seguro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Inseguro) - + 12GB DRAM (Unsafe) 12GB DRAM (Inseguro) - + Docked Ancorado - + Handheld Portátil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Sempre perguntar (Padrão) - + Only if game specifies not to stop Somente se o jogo especificar para não parar - + Never ask Nunca perguntar - + Very Small (16 MB) Muito Pequeno (16 MB) - + Small (32 MB) Pequeno (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Muito Grande (512 MB) - + Very Low (4 MB) Muito Baixo (4 MB) - + Low (8 MB) Baixo (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Médio (32 MB) - + High (64 MB) Alto (64 MB) - + Very Low (32) Muito Baixo (32) - + Low (64) Baixo (64) - + Normal (128) Normal (128) - + Medium (256) Médio (256) - + High (512) Alto (512) - + Disabled Desativado - + ExtendedDynamicState 1 Estado Dinâmico Estendido 1 - + ExtendedDynamicState 2 Estado Dinâmico Estendido 2 - + ExtendedDynamicState 3 Estado Dinâmico Estendido 3 - + Tree View Visualização em Árvore - + Grid View Visualização em Grade @@ -7058,7 +7041,7 @@ Mensagem de Depuração: - + &Pause &Pausa @@ -7209,7 +7192,7 @@ Mensagem de Depuração: - + &Start &Começar @@ -7220,7 +7203,7 @@ Mensagem de Depuração: - + R&ecord G&ravar @@ -7311,7 +7294,7 @@ Mensagem de Depuração: - + None Nenhum @@ -7337,738 +7320,738 @@ Mensagem de Depuração: - + Small (32x32) Pequeno (32x32) - + Standard (64x64) Padrão (64x64) - + Large (128x128) Grande (128x128) - + Full Size (256x256) Tamanho completo (256x256) - + Broken Vulkan Installation Detected Detectada Instalação Defeituosa do Vulkan - + Vulkan initialization failed during boot. Inicialização do Vulkan falhou durante o boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Rodando um jogo - + Loading Web Applet... Carregando Applet Web... - - + + Disable Web Applet Desativar Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Desativar o Applet Web pode problemas indefinidos e deverá apenas ser usando com o Super Mario 3D All-Stars. Você tem certeza que quer desativar o Applet Web? (Isso pode ser reativado nas Configurações de Depuração.) - + The amount of shaders currently being built A Quantidade total de Shaders está sendo atualmente construída - + The current selected resolution scaling multiplier. A atual multiplicação de escala de resolução selecionada. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Velocidade atual da emulação. Valores altos ou mais baixo que 100% indicam que o emulador está rodando mais rápido ou mais lento que um Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Quantos quadros por segundo o jogo está mostrando atualmente. Isto varia de jogo para jogo e de cena a cena. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory Selecionar Diretório - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory Abrir o Diretório da ROM extraída - + Invalid Directory Selected Diretório selecionado inválido - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo Amiibo - - + + The current amiibo has been removed O Amiibo atual foi removido - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8076,74 +8059,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/pt_PT.ts b/dist/languages/pt_PT.ts index e637008132..ae1b0929d6 100644 --- a/dist/languages/pt_PT.ts +++ b/dist/languages/pt_PT.ts @@ -793,1333 +793,1316 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Utilizar cache de pipeline do Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Habilita o cache de pipeline da fabricante da GPU. Esta opção pode melhorar o tempo de carregamento de shaders significantemente em casos onde o driver Vulkan não armazena o cache de pipeline internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Habilitar Pipeline de Computação (Somente Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Habilitar Flushing Reativo - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Usa flushing reativo ao invés de flushing preditivo, permitindo mais precisão na sincronização da memória. - + Sync to framerate of video playback Sincronizar com o framerate da reprodução de vídeo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Executa o jogo na velocidade normal durante a reprodução de vídeo, mesmo se o framerate estiver desbloqueado. - + Barrier feedback loops Ciclos de feedback de barreira - + Improves rendering of transparency effects in specific games. Melhora a renderização de efeitos de transparência em jogos específicos. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Semente de RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Nome do Dispositivo - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Data personalizada do RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Idioma: - + This option can be overridden when region setting is auto-select - + Region: Região: - + The region of the console. - + Time Zone: Fuso Horário: - + The time zone of the console. - + Sound Output Mode: Modo de saída de som - + Console Mode: Modo Console: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Confirmar antes de parar a emulação - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Esconder rato quando inactivo. - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Desabilitar miniaplicativo de controle - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Habilitar Gamemode - + Force X11 as Graphics Backend - + Custom frontend Frontend customizado - + Real applet Miniaplicativo real - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Assíncrona - + Uncompressed (Best quality) Descompactado (Melhor Q - + BC1 (Low quality) BC1 (Baixa qualidade) - + BC3 (Medium quality) BC3 (Média qualidade) - - + + Auto Automático - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Conservador - + Aggressive Agressivo - + Vulkan Vulcano - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Nenhum (desativado) - + Fast - - - + + + Accurate Preciso - - - + + + Default Padrão - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe Inseguro - + Paranoid (disables most optimizations) Paranoia (desativa a maioria das otimizações) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Janela sem bordas - + Exclusive Fullscreen Tela cheia exclusiva - + No Video Output Sem saída de vídeo - + CPU Video Decoding Decodificação de vídeo pela CPU - + GPU Video Decoding (Default) Decodificação de vídeo pela GPU (Padrão) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Vizinho mais próximo - + Bilinear Bilinear - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nenhum - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Padrão (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 Forçar 16:10 - + Stretch to Window Esticar à Janela - + Automatic Automático - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonês (日本語) - + American English Inglês Americano - + French (français) Francês (français) - + German (Deutsch) Alemão (Deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Espanhol (español) - + Chinese Chinês - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandês (Nederlands) - + Portuguese (português) Português (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanês - + British English Inglês Britânico - + Canadian French Francês Canadense - + Latin American Spanish Espanhol Latino-Americano - + Simplified Chinese Chinês Simplificado - + Traditional Chinese (正體中文) Chinês Tradicional (正 體 中文) - + Brazilian Portuguese (português do Brasil) Português do Brasil (Brazilian Portuguese) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japão - + USA EUA - + Europe Europa - + Australia Austrália - + China China - + Korea Coreia - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Padrão (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipto - + Eire Irlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islândia - + Iran Irão - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polónia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estéreo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Padrão) - + 6GB DRAM (Unsafe) 6GB DRAM (Não seguro) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Ancorado - + Handheld Portátil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Sempre perguntar (Padrão) - + Only if game specifies not to stop Somente se o jogo especificar para não parar - + Never ask Nunca perguntar - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6989,7 +6972,7 @@ Debug Message: - + &Pause &Pausa @@ -7140,7 +7123,7 @@ Debug Message: - + &Start &Começar @@ -7151,7 +7134,7 @@ Debug Message: - + R&ecord G&ravar @@ -7242,7 +7225,7 @@ Debug Message: - + None @@ -7268,737 +7251,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8006,74 +7989,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/ru_RU.ts b/dist/languages/ru_RU.ts index 5d0bfe8ea0..c1276416b1 100644 --- a/dist/languages/ru_RU.ts +++ b/dist/languages/ru_RU.ts @@ -827,66 +827,48 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. - Управляет поведением синхронизации через барьеры ГПУ. -Мгновенный — самый быстрый вариант, но может вызывать некоторые проблемы. -Сбалансированный обеспечивает лучшую совместимость и может исправлять проблемы в некоторых играх. -Точный ещё больше повышает совместимость ценой некоторого снижения производительности. -Строгий — самый медленный вариант, но может исправлять проблемы, требующие более строгой синхронизации. -По умолчанию соответствует настройке точности ГПУ. +Default follows the GPU Mode setting. + - Enable GPU buffer readback - Включить обратное чтение буфера ГПУ - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - Сохраняет измененные ГПУ данные путем чтения их обратно перед выгрузками. -Некоторые игры требуют этого, чтобы рендерить определенные эффекты правильно. - - - Enable asynchronous shader compilation Включить асинхронную компиляцию шейдеров - + May reduce shader stutter. Может уменьшить фризы, вызванные компиляцией шейдеров. - + GPU Clocks Частоты GPU - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. Заставляет игру думать, что GPU завершает свою работу быстрее, чем на самом деле, чтобы она перестала подстраиваться под частоты Switch, понижать разрешение и дальность прорисовки. - + GPU Unswizzle GPU-десвиззлинг (GPU Unswizzle) - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Ускоряет декодирование 3D-текстур BCn с использованием вычислений GPU. Отключите при возникновении сбоев или графических артефактов. - + GPU Unswizzle Max Texture Size Максимальный размер текстур для GPU-десвиззлинга - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -895,48 +877,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size Размер потока GPU-десвиззлинга - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Задает максимальный объем данных текстур (в МиБ), обрабатываемый за кадр. Более высокие значения могут уменьшить подергивания при загрузке текстур, но это может повлиять на стабильность кадров. - + GPU Unswizzle Chunk Size Размер блока GPU-десвиззлинга - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Определяет количество слоев глубины, обрабатываемых за один вызов. Увеличение этого значения может повысить пропускную способность на производительных GPU, но на слабом оборудовании способно вызвать TDR или тайм-ауты драйвера. - + Use Vulkan pipeline cache Использовать кэш конвейеров Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Включает кэш конвейеров, зависящий от производителя GPU. Эта опция может значительно ускорить загрузку шейдеров в тех случаях, когда драйвер Vulkan не сохраняет такие файлы кэша внутри себя. - + Enable Compute Pipelines (Intel Vulkan Only) Включить вычислительные конвейеры (только для Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -945,194 +927,194 @@ Compute pipelines are always enabled on all other drivers. На остальных драйверах вычислительные конвейеры всегда включены. - + Enable Reactive Flushing Включить реактивный сброс - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Использует реактивный сброс (Reactive Flushing) вместо прогнозирующего, обеспечивая более точную синхронизацию памяти. - + Sync to framerate of video playback Синхронизировать с частотой кадров видео - + Run the game at normal speed during video playback, even when the framerate is unlocked. Поддерживать нормальную скорость игры во время воспроизведения видео, даже если частота кадров разблокирована. - + Barrier feedback loops Циклы обратной связи барьеров - + Improves rendering of transparency effects in specific games. Улучшает отрисовку эффектов прозрачности в некоторых играх. - + Enable buffer history Включить историю буфера - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Предоставляет доступ к предыдущим состояниям буфера. В некоторых играх может повысить качество рендеринга и стабильность производительности. - + Fix bloom effects Исправить эффекты bloom - + Removes bloom in Burnout. Удаляет эффект bloom в игре Burnout. - + Enable Legacy Rescale Pass Включить устаревший режим масштабирования - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Может исправить проблемы масштабирования в некоторых играх, используя поведение предыдущей реализации. Это обходное решение устраняет артефакты линий на GPU AMD и Intel, а также мерцание серых текстур на GPU Nvidia в Luigis Mansion 3. - + Extended Dynamic State Расширенное динамическое состояние (Extended Dynamic State) - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Определяет количество функций, доступных в Extended Dynamic State. Более высокие значения позволяют использовать больше функций и иногда повышают производительность, но могут вызвать дополнительные графические проблемы. - + Vertex Input Dynamic State Динамическое состояние ввода вершин (Vertex Input Dynamic State) - + Enables vertex input dynamic state feature for better quality and performance. Включает функцию динамического состояния ввода вершин для улучшения качества и производительности. - + Sample Shading Множественное затенение (Sample Shading) - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Позволяет фрагментному шейдеру выполняться для каждого сэмпла в мультисемплированном фрагменте вместо одного раза. Повышает качество графики за счет снижения производительности. Более высокие значения повышают качество, но сильнее снижают производительность. - + RNG Seed Сид RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Задает начальное значение генератора случайных чисел. В основном используется для спидранов. - + Device Name Название устройства - + The name of the console. Имя консоли. - + Homebrew Args Аргументы Homebrew - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Аргументы командной строки при запуске homebrew (например, -noglsl). - + Custom RTC Date: Пользовательская RTC-дата: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Позволяет изменить системные часы консоли. Может использоваться для изменения времени в играх. - + The number of seconds from the current unix time Количество секунд от текущего UNIX-времени. - + Language: Язык: - + This option can be overridden when region setting is auto-select Эта настройка может быть переопределена при автоматическом выборе региона. - + Region: Регион: - + The region of the console. Регион консоли. - + Time Zone: Часовой пояс: - + The time zone of the console. Часовой пояс консоли. - + Sound Output Mode: Режим вывода звука: - + Console Mode: Консольный режим: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1141,1042 +1123,1037 @@ Setting to Handheld can help improve performance for low end systems. Установка в портативный режим может повысить производительность на слабых системах. - + Prompt for user profile on boot Запрашивать профиль пользователя при запуске игры - + Useful if multiple people use the same PC. Полезно, если одним ПК пользуются несколько человек. - + Pause when not in focus Приостанавливать, если окно не активно - + Pauses emulation when focusing on other windows. Приостанавливает эмуляцию при переключении на другие окна. - + Confirm before stopping emulation Запрашивать подтверждение перед остановкой эмуляции - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Убирает запросы на подтверждение остановки эмуляции. При включении этой настройки эмуляция завершается сразу, без подтверждения. - + Hide mouse on inactivity Скрывать курсор при бездействии - + Hides the mouse after 2.5s of inactivity. Скрывает курсор мыши после 2,5 секунд бездействия. - + Disable controller applet Отключить апплет контроллера - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Принудительно отключает использование апплета контроллера в эмулируемых программах. При попытке открыть апплет он сразу закрывается. - + Check for updates Проверять обновления - + Whether or not to check for updates upon startup. Проверять обновления при запуске. - + Enable Gamemode Включить режим игры - + Force X11 as Graphics Backend Принудительно использовать X11 как графический бэкенд - + Custom frontend Собственный интерфейс эмулятора - + Real applet Приложение из прошивки - + Never Никогда - + On Load При загрузке - + Always Всегда - + CPU CPU - + GPU GPU - + CPU Asynchronous Асинхронный CPU - + Uncompressed (Best quality) Без сжатия (наилучшее качество) - + BC1 (Low quality) BC1 (низкое качество) - + BC3 (Medium quality) BC3 (среднее качество) - - + + Auto Авто - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Консервативный - + Aggressive Агрессивный - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (ассемблерные шейдеры, только для NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (экспериментальный, только для AMD/Mesa) - + Null Null - + Fast Производительность - - - + + + Accurate Точность - - - + + + Default По умолчанию - + Unsafe (fast) Небезопасно (быстро) - + Safe (stable) Безопасно (стабильно) - + Immediate Мгновенный - + Balanced Баланс - - Strict - Строгий - - - + Unsafe Небезопасно - + Paranoid (disables most optimizations) Параноик (отключает большинство оптимизаций) - + Debugging Отладка - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Безрамочный режим - + Exclusive Fullscreen Эксклюзивный полноэкранный - + No Video Output Отсутствие видеовыхода - + CPU Video Decoding Декодирование видео на CPU - + GPU Video Decoding (Default) Декодирование видео на GPU (По умолчанию) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [Экспериментально] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [Экспериментально] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [Экспериментально] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [ЭКПЕРИМЕНТАЛЬНО] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [Экспериментально] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Ближайший сосед (Nearest Neighbor) - + Bilinear Билинейный - + Bicubic Бикубический - + Gaussian По Гауссу - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX™️ Super Resolution - + Area Область (Area) - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Никакой - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Стандартное (16:9) - + Force 4:3 Принудительно 4:3 - + Force 21:9 Принудительно 21:9 - + Force 16:10 Принудительно 16:10 - + Stretch to Window Растянуть до окна - + Automatic Автоматически - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Японский (日本語) - + American English Американский английский - + French (français) Французский (français) - + German (Deutsch) Немецкий (Deutsch) - + Italian (italiano) Итальянский (italiano) - + Spanish (español) Испанский (español) - + Chinese Китайский - + Korean (한국어) Корейский (한국어) - + Dutch (Nederlands) Голландский (Nederlands) - + Portuguese (português) Португальский (português) - + Russian (Русский) Русский - + Taiwanese Тайваньский - + British English Британский английский - + Canadian French Канадский французский - + Latin American Spanish Латиноамериканский испанский - + Simplified Chinese Упрощённый китайский - + Traditional Chinese (正體中文) Традиционный китайский (正體中文) - + Brazilian Portuguese (português do Brasil) Бразильский португальский (português do Brasil) - + Polish (polska) Польский (polska) - + Thai (แบบไทย) Тайский (แบบไทย) - - + + Japan Япония - + USA США - + Europe Европа - + Australia Австралия - + China Китай - + Korea Корея - + Taiwan Тайвань - + Auto (%1) Auto select time zone Авто (%1) - + Default (%1) Default time zone По умолчанию (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Куба - + EET EET - + Egypt Египет - + Eire Эйре - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Эйре - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Гринвич - + Hongkong Гонконг - + HST HST - + Iceland Исландия - + Iran Иран - + Israel Израиль - + Jamaica Ямайка - + Kwajalein Кваджалейн - + Libya Ливия - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Навахо - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Польша - + Portugal Португалия - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Сингапур - + Turkey Турция - + UCT UCT - + Universal Универсальный - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Зулу - + Mono Моно - + Stereo Стерео - + Surround Объемный звук - + 4GB DRAM (Default) 4 ГБ ОЗУ (По умолчанию) - + 6GB DRAM (Unsafe) 6 ГБ ОЗУ (Небезопасно) - + 8GB DRAM 8 ГБ ОЗУ - + 10GB DRAM (Unsafe) 10 ГБ ОЗУ (Небезопасно) - + 12GB DRAM (Unsafe) 12 ГБ ОЗУ (Небезопасно) - + Docked В док-станции - + Handheld Портативный - - + + Normal Нормальная - - + + Boost Ускоренная - - + + Overclock Разгон - + Always ask (Default) Всегда спрашивать (По умолчанию) - + Only if game specifies not to stop Только если игра указывает не останавливать - + Never ask Никогда не спрашивать - + Very Small (16 MB) Очень маленький (16 МБ) - + Small (32 MB) Маленький (32 МБ) - + Normal (128 MB) Нормальный (128 МБ) - + Large (256 MB) Большой (256 МБ) - + Very Large (512 MB) Очень большой (512 МБ) - + Very Low (4 MB) Очень низкий (4 МБ) - + Low (8 MB) Низкий (8 МБ) - + Normal (16 MB) Нормальный (16 МБ) - + Medium (32 MB) Средний (32 МБ) - + High (64 MB) Высокий (64 МБ) - + Very Low (32) Очень низкий (32) - + Low (64) Низкий (64) - + Normal (128) Нормальный (128) - + Medium (256) Средний (256) - + High (512) Высокий (512) - + Disabled Отключено - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View Древовидный - + Grid View Сетчатый @@ -7075,7 +7052,7 @@ Debug Message: - + &Pause &Пауза @@ -7226,7 +7203,7 @@ Debug Message: - + &Start &Запустить @@ -7237,7 +7214,7 @@ Debug Message: - + R&ecord З&апись @@ -7328,7 +7305,7 @@ Debug Message: - + None Никакой @@ -7354,405 +7331,405 @@ Debug Message: &В Виде Карусели - + Small (32x32) Маленький (32х32) - + Standard (64x64) Стандартный (64х64) - + Large (128x128) Большой (128х128) - + Full Size (256x256) Полноразмерный (256х256) - + Broken Vulkan Installation Detected Обнаружена поврежденная установка Vulkan - + Vulkan initialization failed during boot. Не удалось выполнить инициализацию Vulkan во время загрузки. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Запущена игра - + Loading Web Applet... Загрузка веб-апплета... - - + + Disable Web Applet Отключить веб-апплет - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Отключение веб-апплета может привести к неожиданному поведению и должно использоваться только, если вы хотите запустить Super Mario 3D All-Stars. Вы уверены, что хотите отключить веб-апплет? (Его можно снова включить в настройках отладки.) - + The amount of shaders currently being built Количество создаваемых шейдеров на данный момент - + The current selected resolution scaling multiplier. Текущий выбранный множитель масштабирования разрешения. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Текущая скорость эмуляции. Значения выше или ниже 100% указывают на то, что эмуляция идет быстрее или медленнее, чем на Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Количество кадров в секунду в данный момент. Значение будет различаться между играми и сценами. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Время, которое нужно для эмуляции одного кадра Switch, не принимая во внимание ограничение FPS или вертикальную синхронизацию. Для эмуляции в полной скорости значение должно быть не больше 16,67 мс. - + Unmute Включить звук - + Mute Выключить звук - + Reset Volume Сбросить громкость - + Configure Effects... - + &Clear Recent Files &Очистить недавние файлы - + &Continue &Продолжить - + Warning: Outdated Game Format Предупреждение: устаревший формат игры - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Для этой игры вы используете разархивированный формат ROM'а, который является устаревшим и был заменен другими, такими как NCA, NAX, XCI или NSP. В разархивированных каталогах ROM'а отсутствуют иконки, метаданные и поддержка обновлений.<br><br>Для получения информации о различных форматах Switch, поддерживаемых Eden, ознакомьтесь с руководством пользователя. Это сообщение больше не будет отображаться. - - + + Error while loading ROM! Ошибка при загрузке ROM'а! - + The ROM format is not supported. Формат ROM'а не поддерживается. - + An error occurred initializing the video core. Произошла ошибка при инициализации видеоядра. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Ошибка при загрузке ROM'а! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Пожалуйста, пересоздайте дампы ваших файлов или обратитесь за помощью в Discord/Stoat. - + An unknown error occurred. Please see the log for more details. Произошла неизвестная ошибка. Пожалуйста, проверьте журнал для подробностей. - - + + (64-bit) (64-bit) - - + + (32-bit) (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Закрываем программу... - + Save Data Сохранения - + Mod Data Данные модов - + Error Opening %1 Folder Ошибка при открытии папки %1 - - + + Folder does not exist! Папка не существует! - + Remove Installed Game Contents? Удалить установленное содержимое игр? - + Remove Installed Game Update? Удалить установленное обновление игры? - + Remove Installed Game DLC? Удалить установленные DLC игры? - + Remove Entry Удалить запись - + Delete OpenGL Transferable Shader Cache? Удалить переносной кэш шейдеров OpenGL? - + Delete Vulkan Transferable Shader Cache? Удалить переносной кэш шейдеров Vulkan? - + Delete All Transferable Shader Caches? Удалить весь переносной кэш шейдеров? - + Remove Custom Game Configuration? Удалить пользовательскую настройку игры? - + Remove Cache Storage? Удалить кэш-хранилище? - + Remove File Удалить файл - + Remove Play Time Data Удалить данные игрового времени - + Reset play time? Сбросить время игры? - - + + RomFS Extraction Failed! Не удалось извлечь RomFS! - + There was an error copying the RomFS files or the user cancelled the operation. Произошла ошибка при копировании файлов RomFS или пользователь отменил операцию. - + Full Полный - + Skeleton Скелет - + Select RomFS Dump Mode Выберите режим дампа RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Пожалуйста, выберите, как вы хотите выполнить дамп RomFS. <br>Полный скопирует все файлы в новую папку, в то время как <br>скелет создаст только структуру папок. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root В %1 недостаточно свободного места для извлечения RomFS. Пожалуйста, освободите место или выберите другую папку для дампа в Эмуляция > Параметры > Система > Файловая система > Корень дампа - + Extracting RomFS... Извлечение RomFS... - - + + Cancel Отмена - + RomFS Extraction Succeeded! Извлечение RomFS прошло успешно! - + The operation completed successfully. Операция выполнена успешно. - + Error Opening %1 Ошибка при открытии %1 - + Select Directory Выбрать папку - + Properties Свойства - + The game properties could not be loaded. Не удалось загрузить свойства игры. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Исполняемый файл Switch (%1);;Все файлы (*.*) - + Load File Загрузить файл - + Open Extracted ROM Directory Открыть папку извлеченного ROM'а - + Invalid Directory Selected Выбрана недопустимая папка - + The directory you have selected does not contain a 'main' file. Папка, которую вы выбрали, не содержит файла 'main'. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Устанавливаемый файл Switch (*.nca *.nsp *.xci);;Архив контента Nintendo (*.nca);;Пакет подачи Nintendo (*.nsp);;Образ картриджа NX (*.xci) - + Install Files Установить файлы - + %n file(s) remaining %n файл(ов) осталось%n файл(ов) осталось%n файл(ов) осталось%n файл(ов) осталось - + Installing file "%1"... Установка "%1"... - - + + Install Results Результаты - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Чтобы избежать возможных конфликтов, мы не рекомендуем пользователям устанавливать игры в NAND. Пожалуйста, используйте эту функцию только для установки обновлений и DLC. - + %n file(s) were newly installed %n файл(ов) были установлены недавно @@ -7762,7 +7739,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) were overwritten %n файл(ов) были перезаписаны @@ -7772,7 +7749,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) failed to install %n файл(ов) не удалось установить @@ -7782,324 +7759,324 @@ Please, only use this feature to install updates and DLC. - + System Application Системное приложение - + System Archive Системный архив - + System Application Update Обновление системного приложения - + Firmware Package (Type A) Пакет прошивки (Тип А) - + Firmware Package (Type B) Пакет прошивки (Тип Б) - + Game Игра - + Game Update Обновление игры - + Game DLC DLC игры - + Delta Title Дельта-титул - + Select NCA Install Type... Выберите тип установки NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Пожалуйста, выберите тип приложения, который вы хотите установить для этого NCA: (В большинстве случаев, подходит стандартный выбор «Игра».) - + Failed to Install Ошибка установки - + The title type you selected for the NCA is invalid. Тип приложения, который вы выбрали для NCA, недействителен. - + File not found Файл не найден - + File "%1" not found Файл "%1" не найден - + OK ОК - + Function Disabled Функция отключена - + Compatibility list reporting is currently disabled. Check back later! Отправка отчетов о совместимости временно отключена. Доступ будет восстановлен позднее! - + Error opening URL Ошибка при открытии URL - + Unable to open the URL "%1". Не удалось открыть URL: "%1". - + TAS Recording Запись TAS - + Overwrite file of player 1? Перезаписать файл игрока 1? - + Invalid config detected Обнаружена недопустимая конфигурация - + Handheld controller can't be used on docked mode. Pro controller will be selected. Портативный контроллер не может быть использован в режиме док-станции. Будет выбран контроллер Pro. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Текущий amiibo был удален - + Error Ошибка - - + + The current game is not looking for amiibos Текущая игра не ищет amiibo - + Amiibo File (%1);; All Files (*.*) Файл Amiibo (%1);; Все Файлы (*.*) - + Load Amiibo Загрузить Amiibo - + Error loading Amiibo data Ошибка загрузки данных Amiibo - + The selected file is not a valid amiibo Выбранный файл не является допустимым amiibo - + The selected file is already on use Выбранный файл уже используется - + An unknown error occurred Произошла неизвестная ошибка - + No firmware available Прошивка недоступна - + Firmware Corrupted Прошивка повреждена - + Unknown applet Неизвестный апплет - + Applet doesn't map to a known value. Апплет не соответствует ни одному известному значению. - + Record not found Запись не найдена - + Applet not found. Please reinstall firmware. Апплет не найден. Пожалуйста, переустановите прошивку. - + Capture Screenshot Сделать скриншот - + PNG Image (*.png) Изображение PNG (*.png) - + TAS state: Running %1/%2 Состояние TAS: Выполняется %1/%2 - + TAS state: Recording %1 Состояние TAS: Записывается %1 - + TAS state: Idle %1/%2 Состояние TAS: Простой %1/%2 - + TAS State: Invalid Состояние TAS: Неверное - + &Stop Running &Остановка - + Stop R&ecording &Закончить запись - + Building: %n shader(s) Компиляция %n шейдер(ов)Компиляция %n шейдер(ов)Компиляция %n шейдер(ов)Компиляция %n шейдер(ов) - + Scale: %1x %1 is the resolution scaling factor Масштаб: %1x - + Speed: %1% / %2% Скорость: %1% / %2% - + Speed: %1% Скорость: %1% - + Game: %1 FPS Игра: %1 FPS - + Frame: %1 ms Кадр: %1 мс - + NO AA БЕЗ СГЛАЖИВАНИЯ - + NO FX - + FX - + VOLUME: MUTE ГРОМКОСТЬ: ЗАГЛУШЕНА - + VOLUME: %1% Volume percentage (e.g. 50%) ГРОМКОСТЬ: %1% - + Derivation Components Missing Отсутствуют необходимые компоненты - + Decryption keys are missing. Install them now? Ключи дешифрования отсутствуют. Хотите установить их? - + Wayland Detected! Обнаружен Wayland! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8110,74 +8087,74 @@ Would you like to force it for future launches? Хотите включить X11 для последующих запусков? - + Use X11 Использовать X11 - + Continue with Wayland Продолжить с Wayland - + Don't show again Больше не показывать - + Restart Required Требуется перезапуск - + Restart Eden to apply the X11 backend. Перезапустите Eden, чтобы применить X11. - + Slow Замедлено - + Turbo Турбо - + Unlocked Разблокировано - + Select RomFS Dump Target Выбор цели для дампа RomFS - + Please select which RomFS you would like to dump. Выберите RomFS, который вы хотите извлечь. - + Are you sure you want to close Eden? Вы уверены, что хотите закрыть Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Вы уверены, что хотите остановить эмуляцию? Любой несохраненный прогресс будет потерян. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/sv.ts b/dist/languages/sv.ts index 1b20b42158..b5cfbaa063 100644 --- a/dist/languages/sv.ts +++ b/dist/languages/sv.ts @@ -834,66 +834,48 @@ Standard följer inställningen för GPU-noggrannhet. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. - Styr synkroniseringsbeteendet för GPU-staket. -Omedelbar är det snabbaste alternativet, men kan orsaka vissa problem. -Balanserad ger bättre kompatibilitet och kan lösa problem i vissa spel. -Exakt förbättrar kompatibiliteten ytterligare på bekostnad av viss prestanda. -Strikt är långsammast, men kan lösa problem som kräver striktare synkronisering. -Standard följer inställningen för GPU-noggrannhet. +Default follows the GPU Mode setting. + - Enable GPU buffer readback - Aktivera återläsning av GPU-buffert - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - Bevarar data som ändrats av GPU:n genom att läsa tillbaka dem före uppladdning. -Vissa spel kräver detta för att vissa effekter ska återges korrekt. - - - Enable asynchronous shader compilation Aktivera asynkron shaderkompilering - + May reduce shader stutter. Kan minska shader-hackighet. - + GPU Clocks GPU-klockfrekvenser - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. Får spelet att tro att GPU-arbetet avslutas snabbare än det gör, så att det slutar sänka upplösning och ritaravstånd för att passa Switch-klockfrekvenserna. - + GPU Unswizzle GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Accelererar avkodning av BCn 3D-texturer med hjälp av GPU-beräkningar. Inaktivera om du upplever krascher eller grafiska fel. - + GPU Unswizzle Max Texture Size Maximal texturstorlek för GPU Unswizzle - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -902,48 +884,48 @@ GPU är snabbare för medelstora och stora texturer, men CPU kan vara effektivar Justera detta för att hitta balansen mellan GPU-acceleration och CPU-överbelastning. - + GPU Unswizzle Stream Size Strömstorlek för GPU Unswizzle - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Ställer in den maximala mängden texturdata (i MiB) som bearbetas per bildruta. Högre värden kan minska hackighet under texturinläsning men kan påverka bildrutans konsistens. - + GPU Unswizzle Chunk Size Chunk-storlek för GPU Unswizzle - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Bestämmer antalet djupskivor som bearbetas i en enda sändning. Att öka detta kan förbättra genomströmningen på avancerade GPU:er, men kan orsaka TDR eller drivrutinstidsgränser på svagare hårdvara. - + Use Vulkan pipeline cache Använda Vulkan pipeline-cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Aktiverar GPU-leverantörsspecifik pipeline-cache. Det här alternativet kan förbättra laddningstiden för shaders avsevärt i fall där Vulkan-drivrutinen inte lagrar pipeline-cache-filer internt. - + Enable Compute Pipelines (Intel Vulkan Only) Aktivera compute pipelines (endast Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -952,194 +934,194 @@ Denna inställning finns endast för Intels egna drivrutiner och kan orsaka kras Beräkningspipelines är alltid aktiverade på alla andra drivrutiner. - + Enable Reactive Flushing Aktivera Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Använder reaktiv rensning i stället för prediktiv rensning, vilket ger mer exakt minnessynkning. - + Sync to framerate of video playback Synkronisera med bildfrekvensen för videouppspelning - + Run the game at normal speed during video playback, even when the framerate is unlocked. Kör spelet i normal hastighet under videouppspelning, även när bildfrekvensen är upplåst. - + Barrier feedback loops Återkopplingsloopar för barriärer - + Improves rendering of transparency effects in specific games. Förbättrar renderingen av transparenseffekter i vissa spel. - + Enable buffer history Aktivera bufferthistorik - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Aktiverar åtkomst till tidigare bufferttillstånd. Det här alternativet kan förbättra renderingskvaliteten och prestandakonsistensen i vissa spel. - + Fix bloom effects Korrigera bloom-effekter - + Removes bloom in Burnout. Tar bort bloom i Burnout. - + Enable Legacy Rescale Pass Aktivera äldre omskalningspass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Kan åtgärda skalningsproblem i vissa spel genom att förlita sig på beteendet från den tidigare implementeringen. Äldre beteende som åtgärdar linjeartefakter på AMD- och Intel-GPU:er och grå texturflimmer på Nvidia-GPU:er i Luigis Mansion 3. - + Extended Dynamic State Utökad dynamisk status - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Kontrollerar antalet funktioner som kan användas i utökat dynamiskt tillstånd. Högre tillstånd möjliggör fler funktioner och kan öka prestandan, men kan orsaka ytterligare grafiska problem. - + Vertex Input Dynamic State Dynamiskt tillstånd för vertexinmatning - + Enables vertex input dynamic state feature for better quality and performance. Aktiverar funktionen för dynamiskt tillstånd för vertexinmatning för bättre kvalitet och prestanda. - + Sample Shading Provskuggning - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Tillåter fragment-shadern att exekveras per prov i ett multisamplade fragment istället för en gång per fragment. Förbättrar grafikens kvalitet på bekostnad av prestanda. Högre värden förbättrar kvaliteten men försämrar prestandan. - + RNG Seed RNG-frö - + Controls the seed of the random number generator. Mainly used for speedrunning. Att kontrollera fröet till slumptalsgeneratorn. Används främst för speedrunning. - + Device Name Enhetsnamn - + The name of the console. Konsolens namn. - + Homebrew Args Homebrew-argument - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Kommandoradsargument som skickas till homebrew vid start (t.ex. -noglsl). - + Custom RTC Date: Anpassat RTC-datum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Med det här alternativet kan du ändra klockan på konsolen. Kan användas för att manipulera tiden i spel. - + The number of seconds from the current unix time Antalet sekunder från aktuell Unix-tid - + Language: Språk: - + This option can be overridden when region setting is auto-select Det här alternativet kan åsidosättas när regioninställningen är automatiskt vald. - + Region: Region: - + The region of the console. Konsolens region. - + Time Zone: Tidszon: - + The time zone of the console. Konsolens tidszon. - + Sound Output Mode: Ljudutmatningsläge: - + Console Mode: Konsolläge: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1148,1042 +1130,1037 @@ Spel ändrar upplösning, detaljer och stödda kontroller beroende på denna ins Inställningen Handhållen kan förbättra prestandan för enklare system. - + Prompt for user profile on boot Fråga efter användarprofil vid uppstart - + Useful if multiple people use the same PC. Användbart om flera personer använder samma dator. - + Pause when not in focus Pausa när inte i fokus - + Pauses emulation when focusing on other windows. Pausar emulering när fokus är på andra fönster. - + Confirm before stopping emulation Bekräfta innan emuleringen stoppas - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Åsidosätter frågor om att bekräfta att emuleringen ska avslutas. Om du aktiverar den hoppar du över sådana uppmaningar och avslutar emuleringen direkt. - + Hide mouse on inactivity Dölj musen vid inaktivitet - + Hides the mouse after 2.5s of inactivity. Döljer musen efter 2,5 sekunders inaktivitet. - + Disable controller applet Inaktivera kontroller-appleten - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Inaktiverar med tvång användningen av kontrollerappletten i emulerade program. När ett program försöker öppna kontrollerappletten stängs den omedelbart. - + Check for updates Leta efter uppdateringar - + Whether or not to check for updates upon startup. Om uppdateringar ska sökas vid start eller inte. - + Enable Gamemode Aktivera Gamemode - + Force X11 as Graphics Backend Tvinga X11 som grafikbackend - + Custom frontend Anpassad frontend - + Real applet Verklig applet - + Never Aldrig - + On Load Vid inläsning - + Always Alltid - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU asynkron - + Uncompressed (Best quality) Okomprimerad (bästa kvalitet) - + BC1 (Low quality) BC1 (låg kvalitet) - + BC3 (Medium quality) BC3 (medelhög kvalitet) - - + + Auto Auto - + 30 FPS 30 bilder/s - + 60 FPS 60 bilder/s - + 90 FPS 90 bilder/s - + 120 FPS 120 bilder/s - + Conservative Konservativ - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembly Shaders, endast NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimentell, endast AMD/Mesa) - + Null Null - + Fast Snabb - - - + + + Accurate Exakt - - - + + + Default Standard - + Unsafe (fast) Osäker (snabb) - + Safe (stable) Säker (stabil) - + Immediate Omedelbar - + Balanced Balanserad - - Strict - Strikt - - - + Unsafe Inte säker - + Paranoid (disables most optimizations) Paranoid (inaktiverar de flesta optimeringar) - + Debugging Felsökning - + Dynarmic Dynarmisk - + NCE NCE - + Borderless Windowed Ramlöst fönsterläge - + Exclusive Fullscreen Exklusiv helskärm - + No Video Output Ingen videoutgång - + CPU Video Decoding CPU-videoavkodning - + GPU Video Decoding (Default) GPU videoavkodning (standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTELL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTELL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Närmsta granne - + Bilinear Bilinjär - + Bicubic Bikubisk - + Gaussian Gaussisk - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Område - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tvinga 4:3 - + Force 21:9 Tvinga 21:9 - + Force 16:10 Tvinga 16:10 - + Stretch to Window Sträck ut till fönster - + Automatic Automatiskt - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japanska (日本語) - + American English Amerikansk engelska - + French (français) Franska (français) - + German (Deutsch) Tyska (Deutsch) - + Italian (italiano) Italienska (italiano) - + Spanish (español) Spanska (español) - + Chinese Kinesiska - + Korean (한국어) Koreanska (한국어) - + Dutch (Nederlands) Nederländska (Nederlands) - + Portuguese (português) Portugisiska (português) - + Russian (Русский) Ryska (Русский) - + Taiwanese Taiwanesiska - + British English Brittisk engelska - + Canadian French Kanadensisk franska - + Latin American Spanish Latinamerikansk spanska - + Simplified Chinese Förenklad kinesiska - + Traditional Chinese (正體中文) Traditionell kinesiska (正體中文) - + Brazilian Portuguese (português do Brasil) Brasiliansk portugisiska (português do Brasil) - + Polish (polska) Polska (polska) - + Thai (แบบไทย) Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China Kina - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Egypten - + Eire Irland - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irland - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turkiet - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET VÅT - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (standard) - + 6GB DRAM (Unsafe) 6 GB DRAM (osäker) - + 8GB DRAM 8 GB DRAM - + 10GB DRAM (Unsafe) 10 GB DRAM (osäker) - + 12GB DRAM (Unsafe) 12 GB DRAM (osäker) - + Docked Dockad - + Handheld Handhållen - - + + Normal Normal - - + + Boost Förstärk - - + + Overclock Överklocka - + Always ask (Default) Fråga alltid (standard) - + Only if game specifies not to stop Endast om spelet anger att det inte ska stoppas - + Never ask Fråga aldrig - + Very Small (16 MB) Mycket liten (16 MB) - + Small (32 MB) Liten (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Stor (256 MB) - + Very Large (512 MB) Mycket stor (512 MB) - + Very Low (4 MB) Mycket låg (4 MB) - + Low (8 MB) Låg (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Medium (32 MB) - + High (64 MB) Hög (64 MB) - + Very Low (32) Mycket låg (32) - + Low (64) Låg (64) - + Normal (128) Normal (128) - + Medium (256) Medium (256) - + High (512) Hög (512) - + Disabled Inaktiverad - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View Trädvy - + Grid View Rutnätsvy @@ -7082,7 +7059,7 @@ Felsökningsmeddelande: - + &Pause &Paus @@ -7233,7 +7210,7 @@ Felsökningsmeddelande: - + &Start &Starta @@ -7244,7 +7221,7 @@ Felsökningsmeddelande: - + R&ecord Spela &in @@ -7335,7 +7312,7 @@ Felsökningsmeddelande: - + None Ingen @@ -7361,405 +7338,405 @@ Felsökningsmeddelande: &Karusellvy - + Small (32x32) Liten (32x32) - + Standard (64x64) Standard (64x64) - + Large (128x128) Stor (128x128) - + Full Size (256x256) Full storlek (256x256) - + Broken Vulkan Installation Detected Felaktig Vulkan-installation upptäcktes - + Vulkan initialization failed during boot. Vulkan-initialiseringen misslyckades under uppstarten. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Kör ett spel - + Loading Web Applet... Läser in webbapplet... - - + + Disable Web Applet Inaktivera webbapplet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Att inaktivera webbappletten kan leda till odefinierat beteende och bör endast användas med Super Mario 3D All-Stars. Är du säker på att du vill inaktivera webbappletten? (Detta kan återaktiveras i felsökningsinställningarna.) - + The amount of shaders currently being built Antalet shaders som för närvarande byggs - + The current selected resolution scaling multiplier. Den aktuella valda multiplikatorn för upplösningsskalning. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Aktuell emuleringshastighet. Värden högre eller lägre än 100% indikerar att emuleringen körs snabbare eller långsammare än en Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Hur många bildrutor per sekund spelet för närvarande visar. Detta varierar från spel till spel och från scen till scen. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Tid som krävs för att emulera en Switch-bildruta, exklusive bildbegränsning eller v-synkronisering. För emulering i full hastighet bör detta vara högst 16,67 ms. - + Unmute Aktivera ljud - + Mute Tyst - + Reset Volume Återställ volym - + Configure Effects... Konfigurera effekter... - + &Clear Recent Files &Töm tidigare filer - + &Continue &Fortsätt - + Warning: Outdated Game Format Varning: Föråldrat spelformat - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Du använder det dekonstruerade ROM-katalogformatet för detta spel, vilket är ett föråldrat format som har ersatts av andra format såsom NCA, NAX, XCI eller NSP. Dekonstruerade ROM-kataloger saknar ikoner, metadata och uppdateringsstöd.<br> För en förklaring av de olika Switch-format som Eden har stöd för, se vår användarhandbok. Detta meddelande kommer inte att visas igen. - - + + Error while loading ROM! Fel vid inläsning av ROM! - + The ROM format is not supported. ROM-formatet stöds inte. - + An error occurred initializing the video core. Ett fel uppstod vid initialiseringen av videokärnan. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. Detta orsakas vanligtvis av inaktuella grafikdrivrutiner. Se loggen för mer information. Se: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>Så här kommer du åt loggfiler</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Fel vid inläsning av ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Dumpa dina filer igen eller fråga på Discord/Stoat för hjälp. - + An unknown error occurred. Please see the log for more details. Ett okänt fel har uppstått. Se loggen för mer information. - - + + (64-bit) (64-bitar) - - + + (32-bit) (32-bitar) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Stänger programvara... - + Save Data Sparat data - + Mod Data Mod-data - + Error Opening %1 Folder Fel vid öppning av mappen %1 - - + + Folder does not exist! Mappen finns inte! - + Remove Installed Game Contents? Ta bort installerat spelinnehåll? - + Remove Installed Game Update? Ta bort installerad speluppdatering? - + Remove Installed Game DLC? Ta bort installerat spel-DLC? - + Remove Entry Ta bort post - + Delete OpenGL Transferable Shader Cache? Ta bort OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? Ta bort Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? Ta bort alla Transferable Shader Caches? - + Remove Custom Game Configuration? Ta bort anpassad spelkonfiguration? - + Remove Cache Storage? Ta bort cachelagring? - + Remove File Ta bort fil - + Remove Play Time Data Ta bort data om speltid - + Reset play time? Nollställ speltid? - - + + RomFS Extraction Failed! Extrahering av RomFS misslyckades! - + There was an error copying the RomFS files or the user cancelled the operation. Det uppstod ett fel vid kopieringen av RomFS-filerna eller så avbröt användaren åtgärden. - + Full Fullständigt - + Skeleton Skelett - + Select RomFS Dump Mode Välj dumpläge för RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Välj hur du vill att RomFS ska dumpas. <br>Fullständigt kopierar alla filer till den nya katalogen, medan <br>skelett endast skapar katalogstrukturen. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root Det finns inte tillräckligt med ledigt utrymme på %1 för att extrahera RomFS. Frigör utrymme eller välj en annan dumpkatalog under Emulering > Konfigurera > System > Filsystem > Dumprot. - + Extracting RomFS... Extraherar RomFS... - - + + Cancel Avbryt - + RomFS Extraction Succeeded! Extrahering av RomFS lyckades! - + The operation completed successfully. Operationen slutfördes. - + Error Opening %1 Fel vid öppning av %1 - + Select Directory Välj katalog - + Properties Egenskaper - + The game properties could not be loaded. Spelegenskaperna kunde inte läsas in. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Körbar Switch-fil (%1);;Alla filer (*.*) - + Load File Läs in fil - + Open Extracted ROM Directory Öppna katalog för extraherad ROM - + Invalid Directory Selected Ogiltig katalog valdes - + The directory you have selected does not contain a 'main' file. Den katalog du har valt innehåller ingen ”main”-fil. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Installerbar Switch-fil (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files Installera filer - + %n file(s) remaining %n fil återstår%n filer återstår - + Installing file "%1"... Installerar filen "%1"... - - + + Install Results Installationsresultat - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. För att undvika eventuella konflikter avråder vi användare från att installera basspel på NAND. Använd endast denna funktion för att installera uppdateringar och DLC. - + %n file(s) were newly installed %n ny fil installerades @@ -7767,7 +7744,7 @@ Använd endast denna funktion för att installera uppdateringar och DLC. - + %n file(s) were overwritten %n fil skrevs över @@ -7775,7 +7752,7 @@ Använd endast denna funktion för att installera uppdateringar och DLC. - + %n file(s) failed to install %n fil gick inte att installera @@ -7783,324 +7760,324 @@ Använd endast denna funktion för att installera uppdateringar och DLC. - + System Application Systemapplikation - + System Archive Systemarkiv - + System Application Update Uppdatering för systemapplikation - + Firmware Package (Type A) Firmware-paket (Type A) - + Firmware Package (Type B) Firmware-paket (Type B) - + Game Spel - + Game Update Speluppdatering - + Game DLC DLC för spel - + Delta Title Deltatitel - + Select NCA Install Type... Välj NCA-installationstyp... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Välj vilken typ av titel du vill installera denna NCA som: (I de flesta fall är standardinställningen ”Spel” tillräcklig.) - + Failed to Install Misslyckades med att installera - + The title type you selected for the NCA is invalid. Den titeltypen du valt för NCA är ogiltig. - + File not found Filen hittades inte - + File "%1" not found Filen "%1" hittades inte - + OK Ok - + Function Disabled Funktion inaktiverad - + Compatibility list reporting is currently disabled. Check back later! Rapportering till kompatibilitetslistan är för närvarande inaktiverad. Kom tillbaka senare! - + Error opening URL Fel vid öppning av URL - + Unable to open the URL "%1". Det går inte att öppna URL:en ”%1”. - + TAS Recording TAS-inspelning - + Overwrite file of player 1? Skriv över fil för spelare 1? - + Invalid config detected Ogiltig konfiguration upptäcktes - + Handheld controller can't be used on docked mode. Pro controller will be selected. Handhållen kontroller kan inte användas i dockat läge. Pro-kontrollern kommer att väljas. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Den aktuella amiibo har tagits bort. - + Error Fel - - + + The current game is not looking for amiibos Det aktuella spelet letar inte efter amiibos - + Amiibo File (%1);; All Files (*.*) Amiibo-fil (%1);; Alla filer (*.*) - + Load Amiibo Läs in Amiibo - + Error loading Amiibo data Fel vid läsning av Amiibo-data - + The selected file is not a valid amiibo Den valda filen är inte en giltig amiibo. - + The selected file is already on use Den valda filen används redan - + An unknown error occurred Ett okänt fel uppstod - + No firmware available Ingen firmware tillgänglig - + Firmware Corrupted Firmware är skadat - + Unknown applet Okänd applet - + Applet doesn't map to a known value. Appleten mappar inte till ett känt värde. - + Record not found Posten hittades inte - + Applet not found. Please reinstall firmware. Appleten hittades inte. Installera om fast programvara. - + Capture Screenshot Ta skärmbild - + PNG Image (*.png) PNG-bild (*.png) - + TAS state: Running %1/%2 TAS-tillstånd: Kör %1/%2 - + TAS state: Recording %1 TAS-tillstånd: Spelar in %1 - + TAS state: Idle %1/%2 TAS-tillstånd: Overksam %1/%2 - + TAS State: Invalid TAS-tillstånd: Ogiltig - + &Stop Running &Stoppa körning - + Stop R&ecording Stoppa i&nspelning - + Building: %n shader(s) Bygger: %n shaderBygger: %n shaders - + Scale: %1x %1 is the resolution scaling factor Skala: %1x - + Speed: %1% / %2% Hastighet: %1% / %2% - + Speed: %1% Hastighet: %1% - + Game: %1 FPS Spel: %1 bilder/s - + Frame: %1 ms Bildruta: %1 ms - + NO AA NO AA - + NO FX INGA FX - + FX FX - + VOLUME: MUTE VOLYM: TYST - + VOLUME: %1% Volume percentage (e.g. 50%) VOLYM: %1% - + Derivation Components Missing Deriveringskomponenter saknas - + Decryption keys are missing. Install them now? Avkrypteringsnycklar saknas. Installera dem nu? - + Wayland Detected! Wayland upptäcktes! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8111,74 +8088,74 @@ Det rekommenderas att använda X11 istället. Vill du tvinga det för framtida starter? - + Use X11 Använd X11 - + Continue with Wayland Fortsätt med Wayland - + Don't show again Visa inte igen - + Restart Required Omstart krävs - + Restart Eden to apply the X11 backend. Starta om Eden för att tillämpa X11-backend. - + Slow Långsam - + Turbo Turbo - + Unlocked Upplåst - + Select RomFS Dump Target Välj RomFS-dumpmål - + Please select which RomFS you would like to dump. Välj vilken RomFS du vill dumpa. - + Are you sure you want to close Eden? Är du säker på att du vill stänga Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Är du säker på att du vill stoppa emuleringen? Alla osparade framsteg kommer att gå förlorade. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/tr_TR.ts b/dist/languages/tr_TR.ts index d200ff2994..7bb09e316e 100644 --- a/dist/languages/tr_TR.ts +++ b/dist/languages/tr_TR.ts @@ -802,1333 +802,1316 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation Asenkron gölgelendirici derlemeyi etkinleştir - + May reduce shader stutter. Gölgelendirici/shader takılmalarını azaltabilir. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Vulkan pipeline önbelleği kullan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Grafik kartı üreticisine özel işlem hattı önbelleğini etkinleştirir. Bu seçenek, Vulkan sürücüsünün işlem hattı önbellek dosyalarını dahili olarak saklamadığı durumlarda gölgelendirici yükleme süresini önemli ölçüde iyileştirebilir. - + Enable Compute Pipelines (Intel Vulkan Only) Hesaplama İşlem Hatlarını Etkinleştir (Yalnızca Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. Bazı oyunlar için gereklidir. Bu ayar yalnızca Intel'in tescilli sürücüleri için mevcuttur ve etkinleştirilirse çökmeye neden olabilir. Hesaplama işlem hatları diğer tüm sürücülerde her zaman etkindir. - + Enable Reactive Flushing Reaktif Temizlemeyi Etkinleştir - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Tahminli temizleme yerine reaktif temizleme kullanarak daha doğru bellek senkronizasyonu sağlar. - + Sync to framerate of video playback Video oynatma kare hızına senkronize et - + Run the game at normal speed during video playback, even when the framerate is unlocked. Kare hızı kilidi açık olsa bile video oynatımı sırasında oyunu normal hızda çalıştırır. - + Barrier feedback loops Bariyer geri besleme döngüleri - + Improves rendering of transparency effects in specific games. Belirli oyunlarda şeffaflık efektlerinin oluşturulmasını iyileştirir. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State Genişletilmiş Dinamik Durum - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Genişletilmiş Dinamik Durumda kullanılabilecek özelliklerin sayısını kontrol eder. Daha yüksek durumlar daha fazla özelliğe izin verir ve performansı artırabilir, ancak ek grafik sorunlarına neden olabilir. - + Vertex Input Dynamic State Vertex Dinamik Durumu - + Enables vertex input dynamic state feature for better quality and performance. Daha iyi kalite ve performans için Vertex dinamik durum özelliğini etkinleştirir. - + Sample Shading Örnek Gölgelendirme - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Parça gölgelendiricinin, her parça için bir kez yerine çoklu örneklenmiş bir parçadaki her örnek için yürütülmesine olanak tanır. Performans pahasına grafik kalitesini artırır. Daha yüksek değerler kaliteyi artırır ancak performansı düşürür. - + RNG Seed RNG çekirdeği - + Controls the seed of the random number generator. Mainly used for speedrunning. Rastgele sayı üretecinin tohumunu kontrol eder. Esas olarak hızlı bitirme denemeleri için kullanılır. - + Device Name Cihaz İsmi - + The name of the console. Konsolun adı - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Özel RTC Tarihi - + This option allows to change the clock of the console. Can be used to manipulate time in games. Bu seçenek konsolun saatini değiştirmeye olanak tanır. Oyunlarda zamanı manipüle etmek için kullanılabilir. - + The number of seconds from the current unix time Mevcut unix zamanından itibaren saniye sayısı - + Language: Dil: - + This option can be overridden when region setting is auto-select Bölge ayarı otomatik seçim olduğunda bu seçenek geçersiz kılınabilir. - + Region: Bölge: - + The region of the console. Konsolun bölgesi - + Time Zone: Saat Dilimi: - + The time zone of the console. Konsolun saat dilimi - + Sound Output Mode: Ses Çıkış Modu: - + Console Mode: Konsol Modu: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. Konsolun Yerleşik veya El Modunda olup olmadığını seçer. Oyunlar bu ayara bağlı olarak çözünürlüklerini, detaylarını ve desteklenen kontrolcülerini değiştirecektir. El Moduna ayarlamak, düşük seviyeli sistemler için performansı artırmaya yardımcı olabilir. - + Prompt for user profile on boot Açılışta kullanıcı profili için sor - + Useful if multiple people use the same PC. Aynı bilgisayarı birden fazla kişi kullanıyorsa yararlıdır. - + Pause when not in focus Odaklı değilken duraklat - + Pauses emulation when focusing on other windows. Diğer pencerelere odaklanıldığında emülasyonu duraklatır. - + Confirm before stopping emulation Emülasyonu durdurmadan önce onayla - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Emülasyonu durdurma onayı isteklerini/istemlerini geçersiz kılar. Etkinleştirildiğinde, bu tür istekleri/istemleri atlar ve emülasyonu doğrudan/dirket olarak kapatır. - + Hide mouse on inactivity Hareketsizlik durumunda imleci gizle - + Hides the mouse after 2.5s of inactivity. 2,5 saniye hareketsizlikten sonra fareyi gizler. - + Disable controller applet Kontrolcü aplikasyonunu devre dışı bırak - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Emüle edilen programlarda kontrolcü aplikasyonunun kullanımını zorla devre dışı bırakır. Bir program kontrolcü aplikasyonunu açmaya çalıştığında, aplikasyon anında kapatılır. - + Check for updates Güncellemeleri Kontrol Et - + Whether or not to check for updates upon startup. Başlangıçta güncellemelerin kontrol edilip edilmeyeceği. - + Enable Gamemode Oyun Modunu/Gamemode Etkinleştir - + Force X11 as Graphics Backend Grafik arka ucu olarak X11'i zorla - + Custom frontend Özel ön yüz - + Real applet Gerçek aplikasyon - + Never Asla - + On Load Yüklemede - + Always Her zaman - + CPU CPU - + GPU GPU - + CPU Asynchronous Asenkron CPU - + Uncompressed (Best quality) Sıkıştırılmamış (En iyi kalite) - + BC1 (Low quality) BC1 (Düşük kalite) - + BC3 (Medium quality) BC3 (Orta kalite) - - + + Auto Otomatik - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Muhafazakar - + Aggressive Agresif - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Boş - + Fast Hızlı - - - + + + Accurate Doğru - - - + + + Default Varsayılan - + Unsafe (fast) Güvenli Değil (hızlı) - + Safe (stable) Güvenli (Stabil) - + Immediate - + Balanced Dengeli - - Strict - - - - + Unsafe Güvensiz - + Paranoid (disables most optimizations) Paranoya (çoğu optimizasyonu kapatır) - + Debugging Hata ayıklama - + Dynarmic Dinamik - + NCE NCE - + Borderless Windowed Kenarlıksız Tam Ekran - + Exclusive Fullscreen Ayrılmış Tam Ekran - + No Video Output Video Çıkışı Yok - + CPU Video Decoding CPU Video Decoding - + GPU Video Decoding (Default) GPU Video Decoding (Varsayılan) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [DENEYSEL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [DENEYSEL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [DENEYSEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [DENEYSEL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [DENEYSEL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor En Yakın Komşu Algoritması - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gausyen - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Süper Çözünürlük - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Yok - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Varsayılan (16:9) - + Force 4:3 4:3'e Zorla - + Force 21:9 21:9'a Zorla - + Force 16:10 16:10'a Zorla - + Stretch to Window Ekrana Sığdır - + Automatic Otomatik - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonca (日本語) - + American English Amerikan İngilizcesi - + French (français) Fransızca (français) - + German (Deutsch) Almanca (Deutsch) - + Italian (italiano) İtalyanca (italiano) - + Spanish (español) İspanyolca (español) - + Chinese Çince - + Korean (한국어) Korece (한국어) - + Dutch (Nederlands) Flemenkçe (Nederlands) - + Portuguese (português) Portekizce (português) - + Russian (Русский) Rusça (Русский) - + Taiwanese Tayvanca - + British English İngiliz İngilizcesi - + Canadian French Kanada Fransızcası - + Latin American Spanish Latin Amerika İspanyolcası - + Simplified Chinese Basitleştirilmiş Çince - + Traditional Chinese (正體中文) Geleneksel Çince (正體中文) - + Brazilian Portuguese (português do Brasil) Brezilya Portekizcesi (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonya - + USA ABD - + Europe Avrupa - + Australia Avustralya - + China Çin - + Korea Kore - + Taiwan Tayvan - + Auto (%1) Auto select time zone Otomatik (%1) - + Default (%1) Default time zone Varsayılan (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Küba - + EET EET - + Egypt Mısır - + Eire İrlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-İrlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 MT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland İzlanda - + Iran İran - + Israel İsrail - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navaho - + NZ Yeni Zelanda - + NZ-CHAT Chatham Adaları - + Poland Polonya - + Portugal Portekiz - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Türkiye - + UCT UCT - + Universal Evrensel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Varsayılan) - + 6GB DRAM (Unsafe) 6GB DRAM (Güvenli Değil) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Güvenli Değil) - + 12GB DRAM (Unsafe) 12GB DRAM (Güvenli Değil) - + Docked Dock Modu Aktif - + Handheld Taşınabilir - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Her zaman sor (Varsayılan) - + Only if game specifies not to stop Sadece oyun durdurulmamasını belirtirse - + Never ask Asla sorma - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Orta (256) - + High (512) Yüksek (512) - + Disabled Devre Dışı - + ExtendedDynamicState 1 Genişletilmiş Dinamik Durum 1 - + ExtendedDynamicState 2 Genişletilmiş Dinamik Durum 2 - + ExtendedDynamicState 3 Genişletilmiş Dinamik Durum 3 - + Tree View - + Grid View @@ -7016,7 +6999,7 @@ Debug Message: - + &Pause &Duraklat @@ -7167,7 +7150,7 @@ Debug Message: - + &Start B&aşlat @@ -7178,7 +7161,7 @@ Debug Message: - + R&ecord K&aydet @@ -7269,7 +7252,7 @@ Debug Message: - + None @@ -7295,737 +7278,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected Bozuk Vulkan Kurulumu Algılandı - + Vulkan initialization failed during boot. Açılış sırasında Vulkan başlatma işlemi başarısız oldu. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Bir oyun çalıştırılıyor - + Loading Web Applet... Web Uygulaması Yükleniyor... - - + + Disable Web Applet Web Uygulamasını Devre Dışı Bırak - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute Sesi aç - + Mute Sessize al - + Reset Volume Sesi Sıfırla - + Configure Effects... - + &Clear Recent Files &Son Dosyaları Temizle - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL URL açılırken hata oluştu - + Unable to open the URL "%1". - + TAS Recording TAS İşlemi Kaydı - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Mevcut Amiibo kaldırıldı - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted Donanım Yazılımı/Firmware Bozuk - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 TAS durumu: %1/%2 Çalışıyor - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor Ölçek: %1x - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8033,74 +8016,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/uk.ts b/dist/languages/uk.ts index 055787457d..4b7e94bfe9 100644 --- a/dist/languages/uk.ts +++ b/dist/languages/uk.ts @@ -829,60 +829,48 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation Увімкнути асинхронну компіляцію шейдерів - + May reduce shader stutter. Може зменшити шейдерні затримки. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle Розпакування за допомогою ГП - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Прискорює декодування 3D-текстур BCn застосовуючи обчислення за допомогою ГП. Вимкніть у разі збоїв або проблем із графікою. - + GPU Unswizzle Max Texture Size Максимальний розмір текстур для розпакування за допомогою ГП - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -891,48 +879,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size Розмір потоку розпакування за допомогою ГП - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Встановлює максимальний обсяг даних текстур (у МіБ) для обробки на кадр. Вищі значення здатні зменшити затримки під час завантаження текстур, але можуть вплинути на стабільність кадрів. - + GPU Unswizzle Chunk Size Розмір блоків розпакування за допомогою ГП - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Визначає кількість зрізів глибини, оброблених за одне відправлення. Збільшення здатне покращити пропускну здатність на потужних ГП, але може призвести до TDR або затримок драйвера зі слабшим устаткуванням. - + Use Vulkan pipeline cache Використовувати кеш конвеєра Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Вмикає особливий для різних виробників ГП кеш конвеєра. Це налаштування може значно зменшити час завантаження шейдерів у випадках, коли драйвер Vulkan не зберігає власний кеш конвеєра. - + Enable Compute Pipelines (Intel Vulkan Only) Увімкнути обчислювальні конвеєри (лише Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -941,194 +929,194 @@ Compute pipelines are always enabled on all other drivers. Обчислювальні конвеєри завжди увімкнені у всіх інших драйверах. - + Enable Reactive Flushing Увімкнути реактивне очищення - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Використовує реактивне очищення замість прогнозованого, забезпечуючи точнішу синхронізацію пам’яті. - + Sync to framerate of video playback Синхронізувати частоту кадрів з відтворенням відео - + Run the game at normal speed during video playback, even when the framerate is unlocked. Відтворювати гру з нормальною швидкістю під час відтворення відео навіть при розблокованій частоті кадрів. - + Barrier feedback loops Бар’єрні цикли відгуку - + Improves rendering of transparency effects in specific games. Покращує візуалізацію ефектів прозорості в деяких іграх. - + Enable buffer history Увімкнути історію буфера - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Вмикає доступ до попередніх станів буфера. Цей параметр може покращити якість візуалізації та стабільну продуктивність у деяких іграх. - + Fix bloom effects Виправити ефекти світіння - + Removes bloom in Burnout. Прибирає світіння в Burnout. - + Enable Legacy Rescale Pass Увімкнути застаріле масштабування - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. Може виправити проблеми з масштабуванням в іграх, покладаючись на поведінку з попередньої імплементації. Застаріле масштабування виправляє артефакти з лініями на ГП від AMD та Intel, а також сіре блимання текстур на ГП від Nvidia в Luigis Mansion 3. - + Extended Dynamic State Розширений динамічний стан - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Керує кількістю функцій, які можна використовувати в «Розширеному динамічному стані». Вищі значення допускають більше функцій і можуть збільшити продуктивність, але можуть спричинити додаткові проблеми з графікою. - + Vertex Input Dynamic State Динамічний стан введення вершин - + Enables vertex input dynamic state feature for better quality and performance. Вмикає можливість динамічного стану введення вершин для кращих якості й продуктивності. - + Sample Shading Шейдинг зразків - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Дозволяє виконувати фрагмент шейдера для кожного зразка в багатозразковому фрагменті замість одного разу для кожного фрагмента. Покращує якість графікі ціною втрати продуктивності. Вищі значення покращують якість, але погіршують продуктивність. - + RNG Seed Початкове значення RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Керує початковим значення генератора випадкових чисел. Зазвичай використовується в спідранах. - + Device Name Назва пристрою - + The name of the console. Назва консолі. - + Homebrew Args Параметри запуску Homebrew - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Параметри командного рядка, що передаються Homebrew при запуску (як-от noglsl). - + Custom RTC Date: Користувацька дата RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Це налаштування дозволяє змінити час годинника консолі. Можна використовувати для маніпуляцій із часом в іграх. - + The number of seconds from the current unix time Кількість секунд від поточного unix-часу. - + Language: Мова: - + This option can be overridden when region setting is auto-select Це налаштування може перевизначитися, якщо налаштування регіону вибирається автоматично - + Region: Регіон: - + The region of the console. Регіон консолі. - + Time Zone: Часовий пояс: - + The time zone of the console. Часовий пояс консолі. - + Sound Output Mode: Режим виведення звуку: - + Console Mode: Режим консолі: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1137,1042 +1125,1037 @@ Setting to Handheld can help improve performance for low end systems. Налаштування «Портативний» може покращити продуктивність на слабких системах. - + Prompt for user profile on boot Запитувати профіль користувача під час запуску - + Useful if multiple people use the same PC. Корисно, якщо одним комп’ютером користуються кілька користувачів. - + Pause when not in focus Призупиняти, якщо не у фокусі - + Pauses emulation when focusing on other windows. Призупиняє емуляцію при фокусування на інших вікнах. - + Confirm before stopping emulation Підтверджувати зупинку емуляції - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Перевизначає запити на підтвердження зупинки емуляції. Увімкнення обходить такі запити й одразу зупиняє емуляцію. - + Hide mouse on inactivity Приховувати курсор миші при бездіяльності - + Hides the mouse after 2.5s of inactivity. Приховує курсор миші після 2,5 с її бездіяльності. - + Disable controller applet Вимкнути аплет контролера - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. Примусово вимикає використання в емульованих програмах аплета контролера. Якщо програма спробує відкрити аплет контролера, він одразу закриється. - + Check for updates Перевіряти оновлення - + Whether or not to check for updates upon startup. Чи перевіряти оновлення при запуску. - + Enable Gamemode Увімкнути ігровий режим - + Force X11 as Graphics Backend Примусово використовувати X11 як графічний бекенд - + Custom frontend Користувацький фронтенд - + Real applet Справжній аплет - + Never Ніколи - + On Load При завантаженні - + Always Завжди - + CPU ЦП - + GPU ГП - + CPU Asynchronous Асинхронно ЦП - + Uncompressed (Best quality) Без стиснення (Найкраща якість) - + BC1 (Low quality) ВС1 (Низька якість) - + BC3 (Medium quality) ВС3 (Середня якість) - - + + Auto Автоматично - + 30 FPS 30 к/с - + 60 FPS 60 к/с - + 90 FPS 90 к/с - + 120 FPS 120 к/с - + Conservative Заощадження - + Aggressive Агресивно - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (асемблерні шейдери, лише NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (експериментально, лише AMD/Mesa) - + Null Нічого - + Fast Швидко - - - + + + Accurate Точно - - - + + + Default Стандартно - + Unsafe (fast) Небезпечно (швидко) - + Safe (stable) Безпечно (стабільно) - + Immediate - + Balanced Збалансовано - - Strict - - - - + Unsafe Небезпечно - + Paranoid (disables most optimizations) Параноїк (вимикає більшість оптимізацій) - + Debugging Зневадження - + Dynarmic Динамічно - + NCE NCE - + Borderless Windowed Безрамкове вікно - + Exclusive Fullscreen Ексклюзивний повноекранний - + No Video Output Виведення відео відсутнє - + CPU Video Decoding Декодування відео на ЦП - + GPU Video Decoding (Default) Декодування відео на ГП (стандатно) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [ЕКСПЕРИМЕНТАЛЬНО] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [ЕКСПЕРИМЕНТАЛЬНО] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [ЕКСПЕРИМЕНТАЛЬНО] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [ЕКСПЕРИМЕНТАЛЬНО] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [ЕКСПЕРИМЕНТАЛЬНО] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Найближчий сусід - + Bilinear Білінійний - + Bicubic Бікубічний - + Gaussian Ґаусса - + Lanczos Ланцоша - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Області - + MMPX MMPX - + Zero-Tangent Нульовий тангенс - + B-Spline B-Spline - + Mitchell Мітчелла - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Немає - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Стандартно (16:9) - + Force 4:3 Примусово 4:3 - + Force 21:9 Примусово 21:9 - + Force 16:10 Примусово 16:10 - + Stretch to Window Розтягнути до вікна - + Automatic Автоматично - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Японська (日本語) - + American English Американська англійська - + French (français) Французька (français) - + German (Deutsch) Німецька (Deutsch) - + Italian (italiano) Італійська (italiano) - + Spanish (español) Іспанська (español) - + Chinese Китайська - + Korean (한국어) Корейська (한국어) - + Dutch (Nederlands) Нідерландська (Nederlands) - + Portuguese (português) Португальська (português) - + Russian (Русский) Російська (Русский) - + Taiwanese Тайванська - + British English Британська англійська - + Canadian French Канадська французька - + Latin American Spanish Латиноамериканська іспанська - + Simplified Chinese Спрощена китайська - + Traditional Chinese (正體中文) Традиційна китайська (正體中文) - + Brazilian Portuguese (português do Brasil) Бразильська португальська (português do Brasil) - + Polish (polska) Польська (polska) - + Thai (แบบไทย) Тайська (แบบไทย) - - + + Japan Японія - + USA США - + Europe Європа - + Australia Австралія - + China Китай - + Korea Корея - + Taiwan Тайвань - + Auto (%1) Auto select time zone Автоматично (%1) - + Default (%1) Default time zone Стандартно (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Куба - + EET EET - + Egypt Єгипет - + Eire Ейре - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Гринвіч - + Hongkong Гонконг - + HST HST - + Iceland Ісландія - + Iran Іран - + Israel Ізраїль - + Jamaica Ямайка - + Kwajalein Кваджалейн - + Libya Лівія - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Навахо - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Польща - + Portugal Португалія - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Сінгапур - + Turkey Туреччина - + UCT UCT - + Universal Універсальний - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Зулу - + Mono Моно - + Stereo Стерео - + Surround Об’ємний - + 4GB DRAM (Default) 4GB DRAM (стандартно) - + 6GB DRAM (Unsafe) 6GB DRAM (небезпечно) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (небезпечно) - + 12GB DRAM (Unsafe) 12GB DRAM (небезпечно) - + Docked У докстанції - + Handheld Портативний - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Завжди запитувати (стандартно) - + Only if game specifies not to stop Лише якщо гра вказує не зупиняти - + Never ask Ніколи не запитувати - + Very Small (16 MB) Дуже малий (16 МБ) - + Small (32 MB) Малий (32 МБ) - + Normal (128 MB) Нормальний (128 МБ) - + Large (256 MB) Великий (256 МБ) - + Very Large (512 MB) Дуже великий (512 МБ) - + Very Low (4 MB) Дуже низький (4 МБ) - + Low (8 MB) Низький (8 МБ) - + Normal (16 MB) Нормальний (16 МБ) - + Medium (32 MB) Середній (32 МБ) - + High (64 MB) Високий (64 МБ) - + Very Low (32) Дуже низький (32) - + Low (64) Низький (64) - + Normal (128) Нормальний (128) - + Medium (256) Середньо (256) - + High (512) Високо (512) - + Disabled Вимкнено - + ExtendedDynamicState 1 Розширений динамічний стан 1 - + ExtendedDynamicState 2 Розширений динамічний стан 2 - + ExtendedDynamicState 3 Розширений динамічний стан 3 - + Tree View Дерево вибору - + Grid View Таблиця @@ -7070,7 +7053,7 @@ Debug Message: - + &Pause [&P] Призупинити @@ -7221,7 +7204,7 @@ Debug Message: - + &Start [&S] Запустити @@ -7232,7 +7215,7 @@ Debug Message: - + R&ecord [&E] Запис @@ -7323,7 +7306,7 @@ Debug Message: - + None Жодного @@ -7349,405 +7332,405 @@ Debug Message: - + Small (32x32) Маленький (32х32) - + Standard (64x64) Стандартний (64х64) - + Large (128x128) Великий (128х128) - + Full Size (256x256) Повнорозмірний (256х256) - + Broken Vulkan Installation Detected Виявлено пошкоджене встановлення Vulkan - + Vulkan initialization failed during boot. Не вдалося ініціалізувати Vulkan під час запуску. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping Запущено гру - + Loading Web Applet... Завантаження вебаплета... - - + + Disable Web Applet Вимкнути вебаплет - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) Вимкнення вебапплета може призвести до несподіваної поведінки, і це слід робити лише для Super Mario 3D All-Stars. Ви впевнені, що хочете вимкнути вебапплет? (Його можна знову увімкнути в налаштуваннях зневадження.) - + The amount of shaders currently being built Кількість наразі створених шейдерів - + The current selected resolution scaling multiplier. Наразі вибраний множник масштабування роздільності. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. Поточна швидкість емуляції. Значення вище або нижче 100% вказують на те, що емуляція йде швидше або повільніше, ніж на Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. Частота кадрів, яку наразі показує гра. Значення змінюватиметься залежно від гри та з кожною сценою. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. Час, потрібний для емуляції 1 кадру Switch, не враховуючи обмеження частоти кадрів або вертикальну синхронізацію. Для повношвидкісної емуляції значення повинно бути не вище 16,67 мс. - + Unmute Увімкнути звук - + Mute Вимкнути звук - + Reset Volume Скинути гучність - + Configure Effects... - + &Clear Recent Files [&C] Очистити нещодавні файли - + &Continue [&C] Продовжити - + Warning: Outdated Game Format Увага: Застарілий формат гри - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. Для цієї гри ви використовуєте формат теки з деконструйованим ROM, який є застарілим форматом, заміненим на інші, як-от NCA, NAX, XCI, або NSP. У тек із деконструйованими ROM немає значків, метаданих, а також вони не підтримують оновлення.<br>Для подробиць стосовно різноманітних форматів Switch, які підтримує Eden, ознайомтеся з нашим посібником користувача. Це повідомлення не буде показано знову. - - + + Error while loading ROM! Помилка під час завантаження ROM! - + The ROM format is not supported. Непідтримуваний формат ROM. - + An error occurred initializing the video core. Сталася помилка під час ініціалізації відеоядра. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. Помилка під час завантаження ROM! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>Створіть новий дамп файлів або зверніться по допомогу в Discord/Stoat. - + An unknown error occurred. Please see the log for more details. Сталася невідома помилка. Ознайомтеся з журналом, щоб дізнатися подробиці. - - + + (64-bit) (64-бітовий) - - + + (32-bit) (32-бітовий) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... Закриття програмного засобу... - + Save Data Дані збережень - + Mod Data Дані модів - + Error Opening %1 Folder Помилка під час відкриття теки «%1» - - + + Folder does not exist! Теки не існує! - + Remove Installed Game Contents? Вилучити встановлений вміст гри? - + Remove Installed Game Update? Вилучити встановлені оновлення гри? - + Remove Installed Game DLC? Вилучити встановлені доповнення гри? - + Remove Entry Вилучити запис - + Delete OpenGL Transferable Shader Cache? Видалити переміщуваний кеш шейдерів OpenGL? - + Delete Vulkan Transferable Shader Cache? Видалити переміщуваний кеш шейдерів Vulkan? - + Delete All Transferable Shader Caches? Видалити весь переміщуваний кеш шейдерів? - + Remove Custom Game Configuration? Вилучити користувацькі налаштування гри? - + Remove Cache Storage? Вилучити сховище кешу? - + Remove File Вилучити файл - + Remove Play Time Data Вилучити дані награного часу - + Reset play time? Скинути награний час? - - + + RomFS Extraction Failed! Не вдалося видобути RomFS! - + There was an error copying the RomFS files or the user cancelled the operation. Під час копіювання файлів RomFS сталася помилка або користувач скасував операцію. - + Full Повний - + Skeleton Скелет - + Select RomFS Dump Mode Виберіть режим створення дампу RomFS - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. Виберіть, як ви хочете виконати дамп RomFS <br>Повний скопіює всі файли до нової теки, тоді як <br>скелет створить лише структуру тек. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root За адресою «%1» недостатньо вільного місця для видобування RomFS. Звільніть місце або виберіть іншу теку для створення дампу в «Емуляція» → «Налаштувати» → «Система» → «Файлова система» → «Коренева тека дампів». - + Extracting RomFS... Видобування RomFS... - - + + Cancel Скасувати - + RomFS Extraction Succeeded! RomFS видобуто успішно! - + The operation completed successfully. Операцію успішно виконано. - + Error Opening %1 Помилка під час відкриття «%1» - + Select Directory Вибрати теку - + Properties Властивості - + The game properties could not be loaded. Неможливо завантажити властивості гри. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Виконуваний файл Switch (%1);;Усі файли (*.*) - + Load File Завантажити файл - + Open Extracted ROM Directory Відкрити теку видобутого ROM - + Invalid Directory Selected Вибрано неправильну теку - + The directory you have selected does not contain a 'main' file. Вибрана тека не містить файлу «main». - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) Встановлюваний файл Switch (*.nca, *.nsp, *.xci);;Архів вмісту Nintendo (*.nca);;Пакет подання Nintendo (*.nsp);;Образ картриджа NX (*.xci) - + Install Files Встановити файли - + %n file(s) remaining Лишився 1 файлЛишилося %n файлиЛишилося %n файлівЛишилося %n файлів - + Installing file "%1"... Встановлення файлу «%1»... - - + + Install Results Результати встановлення - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. Щоб уникнути можливих конфліктів, ми не радимо користувачам встановлювати ігри в NAND. Користуйтеся цією функцією лише для встановлення оновлень і доповнень. - + %n file(s) were newly installed Щойно встановлено %n файл @@ -7757,7 +7740,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) were overwritten Перезаписано %n файл @@ -7767,7 +7750,7 @@ Please, only use this feature to install updates and DLC. - + %n file(s) failed to install Не вдалося встановити %n файл @@ -7777,324 +7760,324 @@ Please, only use this feature to install updates and DLC. - + System Application Системний застосунок - + System Archive Системний архів - + System Application Update Оновлення системного застосунку - + Firmware Package (Type A) Пакет прошивки (Тип А) - + Firmware Package (Type B) Пакет прошивки (Тип Б) - + Game Гра - + Game Update Оновлення гри - + Game DLC Доповнення гри - + Delta Title Проєкт «Дельта» - + Select NCA Install Type... Виберіть тип встановлення NCA... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) Виберіть тип проєкту, який ви хочете встановити для цього NCA: (У більшості випадків підходить стандартний вибір «Гра».) - + Failed to Install Не вдалося встановити - + The title type you selected for the NCA is invalid. Тип проєкту, який ви вибрали для NCA, неправильний. - + File not found Файл не виявлено - + File "%1" not found Файл «%1» не виявлено - + OK Гаразд - + Function Disabled Функцію вимкнену - + Compatibility list reporting is currently disabled. Check back later! Звітування для переліку сумісності наразі вимкнено. Зазирніть пізніше! - + Error opening URL Помилка під час відкриття URL - + Unable to open the URL "%1". Не вдалося відкрити URL: «%1». - + TAS Recording Записування TAS - + Overwrite file of player 1? Перезаписати файл гравця 1? - + Invalid config detected Виявлено неправильне налаштування - + Handheld controller can't be used on docked mode. Pro controller will be selected. Портативний контролер неможливо використовувати в режимі докстанції. Буде вибрано контролер Pro. - - + + Amiibo Amiibo - - + + The current amiibo has been removed Поточний amiibo вилучено - + Error Помилка - - + + The current game is not looking for amiibos Поточна гра не очікує amiibo - + Amiibo File (%1);; All Files (*.*) Файл amiibo (%1);; Усі файли (*.*) - + Load Amiibo Завантажити amiibo - + Error loading Amiibo data Помилка під час завантаження даних amiibo - + The selected file is not a valid amiibo Вибраний файл не є дійсним amiibo - + The selected file is already on use Вибраний файл уже використовується - + An unknown error occurred Сталася невідома помилка - + No firmware available Немає доступних прошивок - + Firmware Corrupted Прошивка пошкоджена - + Unknown applet Невідомий аплет - + Applet doesn't map to a known value. Аплет не призначено до відомого значення. - + Record not found Запис не виявлено - + Applet not found. Please reinstall firmware. Аплет не виявлено. Перевстановіть прошивку. - + Capture Screenshot Зробити знімок екрана - + PNG Image (*.png) Зображення PNG (*.png) - + TAS state: Running %1/%2 Стан TAS: Працює %1/%2 - + TAS state: Recording %1 Стан TAS: Триває запис %1 - + TAS state: Idle %1/%2 Стан TAS: Бездіяльність %1/%2 - + TAS State: Invalid Стан TAS: Неправильний - + &Stop Running [&S] Зупинити - + Stop R&ecording [&E] Зупинити запис - + Building: %n shader(s) Компіляція: %n шейдерКомпіляція: %n шейдериКомпіляція: %n шейдерівКомпіляція: %n шейдерів - + Scale: %1x %1 is the resolution scaling factor Масштаб: %1x - + Speed: %1% / %2% Швидкість: %1% / %2% - + Speed: %1% Швидкість: %1% - + Game: %1 FPS Гра: %1 к/с - + Frame: %1 ms Кадр: %1 мс - + NO AA БЕЗ ЗГЛАДЖУВАННЯ - + NO FX - + FX - + VOLUME: MUTE ГУЧНІСТЬ: ВИМКНЕНО - + VOLUME: %1% Volume percentage (e.g. 50%) ГУЧНІСТЬ: %1% - + Derivation Components Missing Відсутні компоненти виведення - + Decryption keys are missing. Install them now? Відсутні ключі шифрування. Встановити їх зараз? - + Wayland Detected! Виявлено Wayland! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8105,74 +8088,74 @@ Would you like to force it for future launches? Хочете примусово увімкнути його для наступних запусків? - + Use X11 Використовувати X11 - + Continue with Wayland Продовжити з Wayland - + Don't show again Не показувати знову - + Restart Required Потрібен перезапуск - + Restart Eden to apply the X11 backend. Перезапуск Eden для застосування бекенду X11. - + Slow Сповільнення - + Turbo Прискорення - + Unlocked Розблоковано - + Select RomFS Dump Target Виберіть розташування для створення дампу RomFS - + Please select which RomFS you would like to dump. Виберіть, який дамп RomFS ви хочете створити. - + Are you sure you want to close Eden? Ви впевнені, що хочете закрити Eden? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. Ви впевнені, що хочете зупинити емуляцію? Увесь незбережений поступ буде втрачено. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/vi.ts b/dist/languages/vi.ts index a65e346ea0..a2042eb499 100644 --- a/dist/languages/vi.ts +++ b/dist/languages/vi.ts @@ -786,1332 +786,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Dùng bộ nhớ đệm pipeline Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Bật xả tương ứng - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback Đồng bộ hóa với tốc độ khung hình khi phát video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Chạy game với tốc độ bình thường trong quá trình phát video, ngay cả khi tốc độ khung hình được mở khóa. - + Barrier feedback loops Vòng lặp phản hồi rào cản - + Improves rendering of transparency effects in specific games. Cải thiện hiệu quả kết xuất của hiệu ứng trong suốt trong một số game. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Hạt giống RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Tên thiết bị - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Vùng: - + The region of the console. - + Time Zone: Múi giờ: - + The time zone of the console. - + Sound Output Mode: Chế độ đầu ra âm thanh: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Ẩn con trỏ chuột khi không dùng - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Vô hiệu hoá applet tay cầm - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) Không nén (Chất lượng tốt nhất) - + BC1 (Low quality) BC1 (Chất lượng thấp) - + BC3 (Medium quality) BC3 (Chất lượng trung bình) - - + + Auto Tự động - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Chính xác - - - + + + Default Mặc định - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe Không an toàn - + Paranoid (disables most optimizations) Paranoid (vô hiệu hoá hầu hết sự tối ưu) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Cửa sổ không viền - + Exclusive Fullscreen Toàn màn hình - + No Video Output Không có đầu ra video - + CPU Video Decoding Giải mã video bằng CPU - + GPU Video Decoding (Default) Giải mã video bằng GPU (Mặc định) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [THỬ NGHIỆM] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [THỬ NGHIỆM] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Không có - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Mặc định (16:9) - + Force 4:3 Dùng 4:3 - + Force 21:9 Dùng 21:9 - + Force 16:10 Dùng 16:10 - + Stretch to Window Mở rộng đến cửa sổ - + Automatic Tự động - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Tiếng Nhật (日本語) - + American English Tiếng Anh Mỹ - + French (français) Tiếng Pháp (French) - + German (Deutsch) Tiếng Đức (Deutsch) - + Italian (italiano) Tiếng Ý (italiano) - + Spanish (español) Tiếng Tây Ban Nha (Español) - + Chinese Tiếng Trung - + Korean (한국어) Tiếng Hàn (한국어) - + Dutch (Nederlands) Tiếng Hà Lan (Nederlands) - + Portuguese (português) Tiếng Bồ Đào Nha (Portuguese) - + Russian (Русский) Tiếng Nga (Русский) - + Taiwanese Tiếng Đài Loan - + British English Tiếng Anh Anh - + Canadian French Tiếng Pháp Canada - + Latin American Spanish Tiếng Tây Ban Nha Mỹ Latinh - + Simplified Chinese Tiếng Trung giản thể - + Traditional Chinese (正體中文) Tiếng Trung phồn thể (正體中文) - + Brazilian Portuguese (português do Brasil) Tiếng Bồ Đào Nha Brasil (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Nhật Bản - + USA Hoa Kỳ - + Europe Châu Âu - + Australia Úc - + China Trung Quốc - + Korea Hàn Quốc - + Taiwan Đài Loan - + Auto (%1) Auto select time zone Tự động (%1) - + Default (%1) Default time zone Mặc định (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ai Cập - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hồng Kông - + HST HST - + Iceland Iceland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Ba Lan - + Portugal Bồ Đào Nha - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Thổ Nhĩ Kỳ - + UCT UCT - + Universal Quốc tế - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6989,7 +6972,7 @@ Debug Message: - + &Pause &Tạm dừng @@ -7140,7 +7123,7 @@ Debug Message: - + &Start &Bắt đầu @@ -7151,7 +7134,7 @@ Debug Message: - + R&ecord G&hi lại @@ -7242,7 +7225,7 @@ Debug Message: - + None @@ -7268,737 +7251,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8006,74 +7989,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/vi_VN.ts b/dist/languages/vi_VN.ts index 3dd8f18281..6acff0c2da 100644 --- a/dist/languages/vi_VN.ts +++ b/dist/languages/vi_VN.ts @@ -786,1332 +786,1315 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Dùng Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Bật xả tương ứng - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback Đồng bộ hóa với tốc độ khung hình khi phát video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Chạy game với tốc độ bình thường trong quá trình phát video, ngay cả khi tốc độ khung hình được mở khóa. - + Barrier feedback loops Vòng lặp phản hồi rào cản - + Improves rendering of transparency effects in specific games. Cải thiện hiệu quả hiển thị của hiệu ứng trong suốt trong một số trò chơi. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Hạt giống RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Tên thiết bị - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Vùng: - + The region of the console. - + Time Zone: Múi giờ: - + The time zone of the console. - + Sound Output Mode: Chế độ đầu ra âm thanh - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Ẩn con trỏ chuột khi không dùng - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet Vô hiệu hoá applet tay cầm - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) Không nén (Chất lượng tốt nhất) - + BC1 (Low quality) BC1 (Chất lượng thấp) - + BC3 (Medium quality) BC3 (Chất lượng trung bình) - - + + Auto Tự động - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Tuyệt đối - - - + + + Default Mặc định - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe Tương đối - + Paranoid (disables most optimizations) Paranoid (vô hiệu hoá hầu hết sự tối ưu) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Cửa sổ không viền - + Exclusive Fullscreen Toàn màn hình - + No Video Output Không Video Đầu Ra - + CPU Video Decoding Giải mã video bằng CPU - + GPU Video Decoding (Default) Giải mã video bằng GPU (Mặc định) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [THỬ NGHIỆM] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [THỬ NGHIỆM] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian ScaleForce - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Trống - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Mặc định (16:9) - + Force 4:3 Dùng 4:3 - + Force 21:9 Dùng 21:9 - + Force 16:10 Dung 16:10 - + Stretch to Window Kéo dãn đến cửa sổ phần mềm - + Automatic Tự động - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Tiếng Nhật (日本語) - + American English Tiếng Anh Mỹ - + French (français) Tiếng Pháp (French) - + German (Deutsch) Tiếng Đức (Deutsch) - + Italian (italiano) Tiếng Ý (italiano) - + Spanish (español) Tiếng Tây Ban Nha (Spanish) - + Chinese Tiếng Trung - + Korean (한국어) Tiếng Hàn (한국어) - + Dutch (Nederlands) Tiếng Hà Lan (Dutch) - + Portuguese (português) Tiếng Bồ Đào Nha (Portuguese) - + Russian (Русский) Tiếng Nga (Русский) - + Taiwanese Tiếng Đài Loan - + British English Tiếng Anh UK (British English) - + Canadian French Tiếng Pháp Canada - + Latin American Spanish Tiếng Mỹ La-tinh - + Simplified Chinese Tiếng Trung giản thể - + Traditional Chinese (正體中文) Tiếng Trung phồn thể (正體中文) - + Brazilian Portuguese (português do Brasil) Tiếng Bồ Đào Nha của người Brazil (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Nhật Bản - + USA Hoa Kỳ - + Europe Châu Âu - + Australia Châu Úc - + China Trung Quốc - + Korea Hàn Quốc - + Taiwan Đài Loan - + Auto (%1) Auto select time zone Tự động (%1) - + Default (%1) Default time zone Mặc định (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ai Cập - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hồng Kông - + HST HST - + Iceland Iceland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Ba Lan - + Portugal Bồ Đào Nha - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Thổ Nhĩ Kỳ - + UCT UCT - + Universal Quốc tế - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Chế độ cắm TV - + Handheld Cầm tay - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -6989,7 +6972,7 @@ Debug Message: - + &Pause &Tạm dừng @@ -7140,7 +7123,7 @@ Debug Message: - + &Start &Bắt đầu @@ -7151,7 +7134,7 @@ Debug Message: - + R&ecord G&hi @@ -7242,7 +7225,7 @@ Debug Message: - + None @@ -7268,737 +7251,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8006,74 +7989,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/zh_CN.ts b/dist/languages/zh_CN.ts index 29ff0fe772..46c8fd8014 100644 --- a/dist/languages/zh_CN.ts +++ b/dist/languages/zh_CN.ts @@ -833,65 +833,47 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. - 控制 GPU 围栏同步行为。 -“即时”是速度最快的选项,但可能会引入一些问题。 -“均衡”提供了更好的兼容性,可能修复某些游戏中的问题。 -“精确”在牺牲部分性能的前提下进一步提升兼容性。 -“严格”是速度最慢的选项,但可以修复那些要求更严格同步的问题。 -默认遵循 GPU “精确”设定。 +Default follows the GPU Mode setting. + - Enable GPU buffer readback - 开启 GPU 缓冲区回读 - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - 通过在上传前读取来保留 GPU 修改的数据。 -某些游戏需要这样才能正确渲染某些效果。 - - - Enable asynchronous shader compilation 开启异步着色器编译 - + May reduce shader stutter. 可能减少着色器卡顿。 - + GPU Clocks GPU 时钟频率 - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. 通过让游戏误以为 GPU 的处理速度比实际更快,以避免游戏为了适应 Switch 的时钟频率而降低分辨率和渲染距离。 - + GPU Unswizzle GPU 还原 - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. 利用 GPU 计算来加速 BCn 格式 3D 纹理的解码。如果遇到崩溃或画面花屏,请禁用此项。 - + GPU Unswizzle Max Texture Size GPU 还原最大纹理尺寸 - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -900,48 +882,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size GPU 还原流大小 - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. 设置每帧处理的纹理数据最大量(单位:MiB)。 较高的数值可以减少纹理加载时的卡顿,但可能会影响帧率的稳定性(即造成帧时间波动)。 - + GPU Unswizzle Chunk Size GPU 还原块大小 - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. 确定在单次调度(Dispatch)中处理的深度切片(Depth Slices)数量。 增加此数值可以提高高端 GPU 的吞吐量(处理效率),但在性能较弱的硬件上可能会引发 TDR(驱动程序重置)或驱动超时。 - + Use Vulkan pipeline cache 启用 Vulkan 管线缓存 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. 启用 GPU 供应商专用的管线缓存。 在 Vulkan 驱动程序内部不存储管线缓存的情况下,此选项可显著提高着色器加载速度。 - + Enable Compute Pipelines (Intel Vulkan Only) 启用计算管线 (仅限 Intel 显卡 Vulkan 模式) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -950,193 +932,193 @@ Compute pipelines are always enabled on all other drivers. 在所有其他驱动程序上始终启用计算管线。 - + Enable Reactive Flushing 启用反应性刷新 - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. 使用反应性刷新取代预测性刷新,从而更精确地同步内存。 - + Sync to framerate of video playback 播放视频时帧率同步 - + Run the game at normal speed during video playback, even when the framerate is unlocked. 在视频播放期间以正常速度运行游戏,即使帧率未锁定。 - + Barrier feedback loops 屏障反馈环路 - + Improves rendering of transparency effects in specific games. 改进某些游戏中透明效果的渲染。 - + Enable buffer history 启用缓冲区历史 - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. 允许访问之前的缓冲状态。 这个选项可能会提升某些游戏的渲染质量和性能一致性。 - + Fix bloom effects 修复泛光效果 - + Removes bloom in Burnout. 去除《火爆狂飙》中的泛光特效。 - + Enable Legacy Rescale Pass 启用旧版缩放 - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. 通过依赖之前实现的行为,可能会修复部分游戏的缩放重叠问题。 修复 AMD 和 Intel 显卡上的线条伪影,以及《路易斯洋楼3》中 Nvidia 显卡的灰色纹理闪烁的遗留行为变通方法。 - + Extended Dynamic State 扩展动态状态 - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. 控制在扩展动态状态中可使用的函数数量。更高的数值允许启用更多功能,并可能提升性能,但同时也可能导致额外的图形问题。 - + Vertex Input Dynamic State 顶点输入动态状态 - + Enables vertex input dynamic state feature for better quality and performance. 开启顶点输入动态状态功能来获得更好的质量和性能。 - + Sample Shading 采样着色 - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. 允许片段着色器在多重采样的片段中每个样本执行一次而不是每个片段执行一次。可以提高图形质量,但会降低性能。 更高的值可以提高质量但会降低性能。 - + RNG Seed 随机数生成器种子 - + Controls the seed of the random number generator. Mainly used for speedrunning. 控制随机数生成器的种子。 主要用于竞速游戏。 - + Device Name 设备名称 - + The name of the console. 主机的数量。 - + Homebrew Args 自制软件参数 - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). 启动 homebrew 时需要传递的命令行参数 (例如 -noglsl)。 - + Custom RTC Date: 自定义系统时间: - + This option allows to change the clock of the console. Can be used to manipulate time in games. 此选项允许更改控制台的时钟。 可用于操纵游戏中的时间。 - + The number of seconds from the current unix time 来自当前 unix 时间的秒数。 - + Language: 语言: - + This option can be overridden when region setting is auto-select 当区域设置为自动选择时可以使用此选项替代。 - + Region: 地区: - + The region of the console. 主机的区域。 - + Time Zone: 时区: - + The time zone of the console. 主机的时区。 - + Sound Output Mode: 声音输出模式: - + Console Mode: 控制台模式: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1145,1042 +1127,1037 @@ Setting to Handheld can help improve performance for low end systems. 将设置为掌机模式可以帮助低端系统提高性能。 - + Prompt for user profile on boot 启动时提示选择用户账户 - + Useful if multiple people use the same PC. 在多人使用相同的 PC 时有效。 - + Pause when not in focus 在丢失焦点时暂停 - + Pauses emulation when focusing on other windows. 当焦点位于其它窗口时暂停模拟器。 - + Confirm before stopping emulation 停止模拟时需要确认 - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. 替代提示以确认停止模拟。 启用它将绕过此类提示并直接退出模拟。 - + Hide mouse on inactivity 自动隐藏鼠标光标 - + Hides the mouse after 2.5s of inactivity. 在 2.5 秒无活动后隐藏鼠标。 - + Disable controller applet 禁用控制器小程序 - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. 强制禁止在模拟程序中使用控制器小程序。 当程序尝试打开控制器小程序时,它会立即被关闭。 - + Check for updates 检查更新 - + Whether or not to check for updates upon startup. 在启动时是否检查更新。 - + Enable Gamemode 启用游戏模式 - + Force X11 as Graphics Backend 强制使用 X11 作为图形后端 - + Custom frontend 自定义前端 - + Real applet 真实的小程序 - + Never 永不 - + On Load 加载时 - + Always 总是 - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 异步模拟 - + Uncompressed (Best quality) 不压缩 (最高质量) - + BC1 (Low quality) BC1 (低质量) - + BC3 (Medium quality) BC3 (中等质量) - - + + Auto 自动 - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative 保守模式 - + Aggressive 激进模式 - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (汇编着色器,仅限 NVIDIA 显卡) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (实验性,仅限 AMD/Mesa) - + Null 无 - + Fast 高速 - - - + + + Accurate 高精度 - - - + + + Default 系统默认 - + Unsafe (fast) 不安全(快速) - + Safe (stable) 安全(稳定) - + Immediate 即时 - + Balanced 平衡 - - Strict - 严格 - - - + Unsafe 低精度 - + Paranoid (disables most optimizations) 偏执模式 (禁用绝大多数优化项) - + Debugging 调试 - + Dynarmic 动态编译 - + NCE 本机代码执行 - + Borderless Windowed 无边框窗口 - + Exclusive Fullscreen 独占全屏 - + No Video Output 无视频输出 - + CPU Video Decoding CPU 视频解码 - + GPU Video Decoding (Default) GPU 视频解码 (默认) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [实验性] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [实验性] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [实验性] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [实验性] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [实验性] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 近邻取样 - + Bilinear 双线性过滤 - + Bicubic 双三线过滤 - + Gaussian 高斯模糊 - + Lanczos Lanczos - + ScaleForce 强制缩放 - + AMD FidelityFX Super Resolution AMD FidelityFX 超级分辨率 - + Area 区域 - + MMPX MMPX - + Zero-Tangent 零切线 - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution 骁龙游戏超级分辨率 - + Snapdragon Game Super Resolution EdgeDir 骁龙游戏超级分辨率 EdgeDir - + None 无 - + FXAA 快速近似抗锯齿 - + SMAA 子像素形态学抗锯齿 - + Default (16:9) 默认 (16:9) - + Force 4:3 强制 4:3 - + Force 21:9 强制 21:9 - + Force 16:10 强制 16:10 - + Stretch to Window 拉伸窗口 - + Automatic 自动 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日语 (日本語) - + American English 美式英语 - + French (français) 法语 (français) - + German (Deutsch) 德语 (Deutsch) - + Italian (italiano) 意大利语 (italiano) - + Spanish (español) 西班牙语 (español) - + Chinese 中文 - + Korean (한국어) 韩语 (한국어) - + Dutch (Nederlands) 荷兰语 (Nederlands) - + Portuguese (português) 葡萄牙语 (português) - + Russian (Русский) 俄语 (Русский) - + Taiwanese 台湾中文 - + British English 英式英语 - + Canadian French 加拿大法语 - + Latin American Spanish 拉美西班牙语 - + Simplified Chinese 简体中文 - + Traditional Chinese (正體中文) 繁体中文 (正體中文) - + Brazilian Portuguese (português do Brasil) 巴西-葡萄牙语 (português do Brasil) - + Polish (polska) 波兰语(波兰语) - + Thai (แบบไทย) 泰语 - - + + Japan 日本 - + USA 美国 - + Europe 欧洲 - + Australia 澳大利亚 - + China 中国 - + Korea 韩国 - + Taiwan 台湾地区 - + Auto (%1) Auto select time zone 自动 (%1) - + Default (%1) Default time zone 默认 (%1) - + CET 欧洲中部时间 - + CST6CDT 古巴标准时间&古巴夏令时 - + Cuba 古巴 - + EET 东欧时间 - + Egypt 埃及 - + Eire 爱尔兰 - + EST 东部标准时间 - + EST5EDT 东部标准时间&东部夏令时 - + GB 英国 - + GB-Eire 英国-爱尔兰时间 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 格林威治 - + Hongkong 香港 - + HST 美国夏威夷时间 - + Iceland 冰岛 - + Iran 伊朗 - + Israel 以色列 - + Jamaica 牙买加 - + Kwajalein 夸贾林环礁 - + Libya 利比亚 - + MET 中欧时间 - + MST 山区标准时间 (北美) - + MST7MDT 山区标准时间&山区夏令时 (北美) - + Navajo 纳瓦霍 - + NZ 新西兰时间 - + NZ-CHAT NZ-CHAT - + Poland 波兰 - + Portugal 葡萄牙 - + PRC 中国标准时间 - + PST8PDT 太平洋标准时间&太平洋夏令时 - + ROC 台湾时间 - + ROK 韩国时间 - + Singapore 新加坡 - + Turkey 土耳其 - + UCT UCT - + Universal 世界时间 - + UTC 协调世界时 - + W-SU 欧洲-莫斯科时间 - + WET 西欧时间 - + Zulu 祖鲁 - + Mono 单声道 - + Stereo 立体声 - + Surround 环绕声 - + 4GB DRAM (Default) 4GB DRAM (默认) - + 6GB DRAM (Unsafe) 6GB DRAM (不安全) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (不安全) - + 12GB DRAM (Unsafe) 12GB DRAM (不安全) - + Docked 主机模式 - + Handheld 掌机模式 - - + + Normal 正常 - - + + Boost 升频 - - + + Overclock 超频 - + Always ask (Default) 总是询问 (默认) - + Only if game specifies not to stop 仅当游戏不希望停止时 - + Never ask 从不询问 - + Very Small (16 MB) 很小 (16 MB) - + Small (32 MB) 较小 (32 MB) - + Normal (128 MB) 正常 (128 MB) - + Large (256 MB) 较大 (256 MB) - + Very Large (512 MB) 很大 (512 MB) - + Very Low (4 MB) 很低 (4 MB) - + Low (8 MB) 低 (8 MB) - + Normal (16 MB) 正常 (16 MB) - + Medium (32 MB) 中 (32 MB) - + High (64 MB) 高 (64 MB) - + Very Low (32) 很低 (32) - + Low (64) 低 (64) - + Normal (128) 正常 (128) - + Medium (256) 中(256) - + High (512) 高(512) - + Disabled 禁用 - + ExtendedDynamicState 1 扩展动态状态 1 - + ExtendedDynamicState 2 扩展动态状态 2 - + ExtendedDynamicState 3 扩展动态状态 3 - + Tree View 树景视图 - + Grid View 网格视图 @@ -7064,7 +7041,7 @@ Debug Message: - + &Pause 暂停 (&P) @@ -7215,7 +7192,7 @@ Debug Message: - + &Start 开始 (&S) @@ -7226,7 +7203,7 @@ Debug Message: - + R&ecord 录制 (&E) @@ -7317,7 +7294,7 @@ Debug Message: - + None 无 @@ -7343,742 +7320,742 @@ Debug Message: 轮播视图(&C) - + Small (32x32) 小 (32x32) - + Standard (64x64) 标准 (64x64) - + Large (128x128) 大 (128x128) - + Full Size (256x256) 最大 (256x256) - + Broken Vulkan Installation Detected 检测到损坏的 Vulkan 安装 - + Vulkan initialization failed during boot. 在启动时初始化 Vulkan 失败。 - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping 运行游戏 - + Loading Web Applet... 正在加载 Web 小程序... - - + + Disable Web Applet 禁用 Web 小程序 - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) 禁用网页小程序可能会导致未定义的行为并且应仅在 超级马里奥 3D 全明星中使用。您确定要禁用网页小程序吗? (这可以在调试设置中重新启用。) - + The amount of shaders currently being built 当前正在构建的着色器数量 - + The current selected resolution scaling multiplier. 当前选择的分辨率缩放倍数。 - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. 当前模拟速度。高于或低于 100% 的数值表示模拟运行比 Switch 快或慢。 - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. 游戏当前显示的每秒帧数。这个数值会因游戏和场景的不同而有所变化。 - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. 模拟 Switch 一帧所需的时间,不包括帧限制或垂直同步。为了全速模拟这个时间最多应为 16.67 毫秒。 - + Unmute 取消静音 - + Mute 静音 - + Reset Volume 重置音量 - + Configure Effects... 配置效果... - + &Clear Recent Files 清除最近的文件(&C) - + &Continue 继续(&C) - + Warning: Outdated Game Format 警告: 游戏格式过时 - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. 您正在为此游戏使用解包 ROM 目录格式,这是一种已过时的格式,它已被 NCA、NAX、XCI 或 NSP 等其他格式取代。解包 ROM 目录缺少图标、元数据和更新支持。<br>有关 Eden 支持的各种 Switch 格式的说明请查阅我们的用户手册。此消息将不再显示。 - - + + Error while loading ROM! 加载 ROM 时出错! - + The ROM format is not supported. 不支持该 ROM 格式。 - + An error occurred initializing the video core. 初始化视频核心时发生错误。 - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. 这通常是因为过时的 GPU 驱动所导致的。具体情况请查看日志。请查阅: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>如何访问日志文件</a>。 - + Error while loading ROM! %1 %1 signifies a numeric error code. 加载 ROM 时出错! %1 - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. %1<br>请重新导出您的文件,或在 Discord/Stoat 上寻求帮助。 - + An unknown error occurred. Please see the log for more details. 发生未知错误。请查看日志以获取更多详情。 - - + + (64-bit) (64 位) - - + + (32-bit) (32 位) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit %1 %2 - + Closing software... 正在关闭软件... - + Save Data 存档数据 - + Mod Data Mod 数据 - + Error Opening %1 Folder 打开 %1 文件夹出错 - - + + Folder does not exist! 文件夹不存在! - + Remove Installed Game Contents? 是否移除已安装的游戏内容? - + Remove Installed Game Update? 是否移除已安装的游戏更新? - + Remove Installed Game DLC? 是否移除已安装的游戏 DLC? - + Remove Entry 删除条目 - + Delete OpenGL Transferable Shader Cache? 要删除 OpenGL 可传输着色器缓存吗? - + Delete Vulkan Transferable Shader Cache? 要删除 Vulkan 可传输着色器缓存吗? - + Delete All Transferable Shader Caches? 删除所有可传输的着色器缓存? - + Remove Custom Game Configuration? 是否移除自定义游戏配置? - + Remove Cache Storage? 要清除缓存存储吗? - + Remove File 删除文件 - + Remove Play Time Data 删除游戏时间数据 - + Reset play time? 要重置播放时间吗? - - + + RomFS Extraction Failed! RomFS 提取失败! - + There was an error copying the RomFS files or the user cancelled the operation. 复制 RomFS 文件时出错或用户取消了操作。 - + Full 完整 - + Skeleton 结构 - + Select RomFS Dump Mode 选择 RomFS 转储模式 - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. 请选择您希望如何导出 RomFS。<br>&quot;完整&quot; 将把所有文件复制到新的目录中,而<br>&quot;结构&quot; 仅会创建目录结构。</br></br> - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root %1 的可用空间不足,无法提取 RomFS。请释放空间或在模拟 > 配置 > 系统 > 文件系统 > 转储根目录,中选择其它目录 - + Extracting RomFS... 正在提取 RomFS... - - + + Cancel 取消 - + RomFS Extraction Succeeded! RomFS 提取成功! - + The operation completed successfully. 操作已成功完成。 - + Error Opening %1 打开 %1 时出错 - + Select Directory 选择目录 - + Properties 属性 - + The game properties could not be loaded. 无法加载游戏属性。 - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. Switch 可执行文件 (%1);;所有文件 (*.*) - + Load File 加载文件 - + Open Extracted ROM Directory 打开已提取的 ROM 目录 - + Invalid Directory Selected 选择的目录无效 - + The directory you have selected does not contain a 'main' file. 您选择的目录不包含 'main' 文件。 - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) 可安装的 Switch 文件 (*.nca *.nsp *.xci);;任天堂内容档案 (*.nca);;任天堂提交包 (*.nsp);;NX 卡带镜像 (*.xci) - + Install Files 安装文件 - + %n file(s) remaining 剩余 %n 个文件 - + Installing file "%1"... 正在安装文件 "%1"... - - + + Install Results 安装结果 - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. 为了避免可能的冲突,我们不鼓励用户将基础游戏安装到 NAND。 请仅使用此功能来安装更新和 DLC。 - + %n file(s) were newly installed 已新安装 %n 个文件 - + %n file(s) were overwritten 已覆盖了 %n 个文件 - + %n file(s) failed to install %n 个文件安装失败 - + System Application 系统应用 - + System Archive 系统档案 - + System Application Update 系统应用更新 - + Firmware Package (Type A) 固件包 (类型 A) - + Firmware Package (Type B) 固件包 (类型 B) - + Game 游戏 - + Game Update 游戏更新 - + Game DLC 游戏可下载内容 - + Delta Title Delta 标题 - + Select NCA Install Type... 选择 NCA 安装类型... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) 请选择您希望将此 NCA 安装为的标题类型: (在大多数情况下,默认的 '游戏' 就可以。) - + Failed to Install 安装失败 - + The title type you selected for the NCA is invalid. 您为 NCA 选择的标题类型无效。 - + File not found 找不到文件 - + File "%1" not found 未找到文件 "%1" - + OK 确定 - + Function Disabled 功能已被关闭 - + Compatibility list reporting is currently disabled. Check back later! 兼容性列表报告目前已被禁用。请稍后再查看! - + Error opening URL 打开网址出错 - + Unable to open the URL "%1". 无法打开 URL "%1"。 - + TAS Recording TAS 录像 - + Overwrite file of player 1? 要覆盖玩家 1 的文件吗? - + Invalid config detected 检测到无效配置 - + Handheld controller can't be used on docked mode. Pro controller will be selected. 手柄在主机模式下无法使用。将选择 Pro 手柄。 - - + + Amiibo Amiibo - - + + The current amiibo has been removed 当前的 amiibo 已被移除 - + Error 错误 - - + + The current game is not looking for amiibos 当前游戏不支持寻找 amiibo - + Amiibo File (%1);; All Files (*.*) Amiibo 文件 (%1);; 所有文件 (*.*) - + Load Amiibo 读取 Amiibo - + Error loading Amiibo data 加载 Amiibo 数据出错 - + The selected file is not a valid amiibo 所选文件不是有效的 amiibo - + The selected file is already on use 所选文件正在使用中 - + An unknown error occurred 发生未知错误 - + No firmware available 没有可用的固件 - + Firmware Corrupted 固件已损坏 - + Unknown applet 未知小程序 - + Applet doesn't map to a known value. 无法识别该小程序对应的值。 - + Record not found 找不到记录程序 - + Applet not found. Please reinstall firmware. 找不到小程序。请重新安装固件。 - + Capture Screenshot 截取屏幕截图 - + PNG Image (*.png) PNG 图像 (*.png) - + TAS state: Running %1/%2 TAS 状态: 正在运行 %1/%2 - + TAS state: Recording %1 TAS 状态: 正在录制 %1 - + TAS state: Idle %1/%2 TAS 状态: 空闲 %1/%2 - + TAS State: Invalid TAS 状态: 无效 - + &Stop Running 停止运行(&S) - + Stop R&ecording 停止录制(&A) - + Building: %n shader(s) 正在编译:%n 个着色器 - + Scale: %1x %1 is the resolution scaling factor 缩放: %1x - + Speed: %1% / %2% 速度: %1% / %2% - + Speed: %1% 速度: %1% - + Game: %1 FPS 游戏: %1 FPS - + Frame: %1 ms 帧: %1 ms - + NO AA 无 AA - + NO FX 无 FX - + FX FX - + VOLUME: MUTE 音量: 静音 - + VOLUME: %1% Volume percentage (e.g. 50%) 音量: %1% - + Derivation Components Missing 缺少派生组件 - + Decryption keys are missing. Install them now? 缺少解密密钥。现在安装吗? - + Wayland Detected! 检测到 Wayland! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8089,74 +8066,74 @@ Would you like to force it for future launches? 您想要在未来的启动中强制执行吗? - + Use X11 使用 X11 - + Continue with Wayland 继续使用 Wayland - + Don't show again 不再显示 - + Restart Required 需要重新启动 - + Restart Eden to apply the X11 backend. 重新启动 Eden 以应用 X11 后端。 - + Slow 慢速 - + Turbo 加速 - + Unlocked 解锁 - + Select RomFS Dump Target 选择 RomFS 转储目标 - + Please select which RomFS you would like to dump. 请选择您想要转储的 RomFS。 - + Are you sure you want to close Eden? 您确实要关闭 Eden 吗? - - - + + + Eden Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. 您确定要停止模拟吗?任何未保存的进度将会丢失。 - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? diff --git a/dist/languages/zh_TW.ts b/dist/languages/zh_TW.ts index 50b1b30118..678757a328 100644 --- a/dist/languages/zh_TW.ts +++ b/dist/languages/zh_TW.ts @@ -812,1333 +812,1316 @@ Default follows the GPU Accuracy setting. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. -Strict is the slowest option, but can fix issues that require stricter synchronization. -Default follows the GPU Accuracy setting. +Default follows the GPU Mode setting. - Enable GPU buffer readback - - - - - Preserves GPU-modified data by reading it back before uploading. -Some games require this to render certain effects properly. - - - - Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache 启用 Vulkan 管线缓存 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. 启用 GPU 供应商专用的管线缓存。 在 Vulkan 驱动程序内部不存储管线缓存的情况下,此选项可显著提高着色器加载速度。 - + Enable Compute Pipelines (Intel Vulkan Only) 启用计算管线 (仅限 Intel 显卡 Vulkan 模式) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing 启用反应性刷新 - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. 使用反应性刷新取代预测性刷新,从而更精确地同步内存。 - + Sync to framerate of video playback 播放视频时帧率同步 - + Run the game at normal speed during video playback, even when the framerate is unlocked. 在视频播放期间以正常速度运行游戏,即使帧率未锁定。 - + Barrier feedback loops 屏障反馈循环 - + Improves rendering of transparency effects in specific games. 改进某些游戏中透明效果的渲染。 - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - + Enable Legacy Rescale Pass - + May fix rescale issues in some games by relying on behavior from the previous implementation. Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed 隨機種子 - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name 裝置名稱 - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: 自定义系统时间: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: 语言: - + This option can be overridden when region setting is auto-select - + Region: 區域: - + The region of the console. - + Time Zone: 時區: - + The time zone of the console. - + Sound Output Mode: 音訊輸出模式: - + Console Mode: 控制台模式: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation 停止模拟时需要确认 - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity 滑鼠閒置時自動隱藏 - + Hides the mouse after 2.5s of inactivity. - + Disable controller applet 禁用控制器程序 - + Forcibly disables the use of the controller applet in emulated programs. When a program attempts to open the controller applet, it is immediately closed. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode 启用游戏模式 - + Force X11 as Graphics Backend - + Custom frontend 自定义前端 - + Real applet 真实的小程序 - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 异步模拟 - + Uncompressed (Best quality) 不壓縮 (最高品質) - + BC1 (Low quality) BC1 (低品質) - + BC3 (Medium quality) BC3 (中品質) - - + + Auto 自動 - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative 保守模式(节省 VRAM) - + Aggressive 激进模式 - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null 無 - + Fast - - - + + + Accurate 高精度 - - - + + + Default 預設 - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - - Strict - - - - + Unsafe 低精度 - + Paranoid (disables most optimizations) 偏执模式 (禁用绝大多数优化项) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed 無邊框視窗 - + Exclusive Fullscreen 全螢幕獨占 - + No Video Output 無視訊輸出 - + CPU Video Decoding CPU 視訊解碼 - + GPU Video Decoding (Default) GPU 視訊解碼(預設) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [实验性] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [實驗性] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [實驗性] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 最近鄰 - + Bilinear 雙線性 - + Bicubic 雙立方 - + Gaussian 高斯 - + Lanczos - + ScaleForce 強制縮放 - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None 無 - + FXAA FXAA - + SMAA SMAA - + Default (16:9) 預設 (16:9) - + Force 4:3 強制 4:3 - + Force 21:9 強制 21:9 - + Force 16:10 強制 16:10 - + Stretch to Window 延伸視窗 - + Automatic 自動 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日文 (日本語) - + American English 美式英语 - + French (français) 法文 (français) - + German (Deutsch) 德文 (Deutsch) - + Italian (italiano) 義大利文 (italiano) - + Spanish (español) 西班牙文 (español) - + Chinese 中文 - + Korean (한국어) 韓文 (한국어) - + Dutch (Nederlands) 荷蘭文 (Nederlands) - + Portuguese (português) 葡萄牙文 (português) - + Russian (Русский) 俄文 (Русский) - + Taiwanese 台灣中文 - + British English 英式英文 - + Canadian French 加拿大法文 - + Latin American Spanish 拉丁美洲西班牙文 - + Simplified Chinese 簡體中文 - + Traditional Chinese (正體中文) 正體中文 (正體中文) - + Brazilian Portuguese (português do Brasil) 巴西-葡萄牙語 (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan 日本 - + USA 美國 - + Europe 歐洲 - + Australia 澳洲 - + China 中國 - + Korea 南韓 - + Taiwan 台灣 - + Auto (%1) Auto select time zone 自動 (%1) - + Default (%1) Default time zone 預設 (%1) - + CET 中歐 - + CST6CDT CST6CDT - + Cuba 古巴 - + EET EET - + Egypt 埃及 - + Eire 愛爾蘭 - + EST 北美東部 - + EST5EDT EST5EDT - + GB GB - + GB-Eire 英國-愛爾蘭 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 格林威治 - + Hongkong 香港 - + HST 夏威夷 - + Iceland 冰島 - + Iran 伊朗 - + Israel 以色列 - + Jamaica 牙買加 - + Kwajalein 瓜加林環礁 - + Libya 利比亞 - + MET 中歐 - + MST 北美山區 - + MST7MDT MST7MDT - + Navajo 納瓦霍 - + NZ 紐西蘭 - + NZ-CHAT 紐西蘭-查塔姆群島 - + Poland 波蘭 - + Portugal 葡萄牙 - + PRC 中國 - + PST8PDT 太平洋 - + ROC 臺灣 - + ROK 韓國 - + Singapore 新加坡 - + Turkey 土耳其 - + UCT UCT - + Universal 世界 - + UTC UTC - + W-SU 莫斯科 - + WET 西歐 - + Zulu 協調世界時 - + Mono 單聲道 - + Stereo 立體聲 - + Surround 環繞音效 - + 4GB DRAM (Default) 4GB DRAM (默认) - + 6GB DRAM (Unsafe) 6GB DRAM (不安全) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked TV - + Handheld 掌機模式 - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) 总是询问 (默认) - + Only if game specifies not to stop 仅当游戏不希望停止时 - + Never ask 从不询问 - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + Disabled - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View @@ -7014,7 +6997,7 @@ Debug Message: - + &Pause 暫停(&P) @@ -7165,7 +7148,7 @@ Debug Message: - + &Start 開始(&S) @@ -7176,7 +7159,7 @@ Debug Message: - + R&ecord 錄製 (&E) @@ -7267,7 +7250,7 @@ Debug Message: - + None @@ -7293,737 +7276,737 @@ Debug Message: - + Small (32x32) - + Standard (64x64) - + Large (128x128) - + Full Size (256x256) - + Broken Vulkan Installation Detected - + Vulkan initialization failed during boot. - + Running a game TRANSLATORS: This string is shown to the user to explain why yuzu needs to prevent the computer from sleeping - + Loading Web Applet... - - + + Disable Web Applet - + Disabling the web applet can lead to undefined behavior and should only be used with Super Mario 3D All-Stars. Are you sure you want to disable the web applet? (This can be re-enabled in the Debug settings.) - + The amount of shaders currently being built - + The current selected resolution scaling multiplier. - + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. - + Time taken to emulate a Switch frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. - + Unmute - + Mute - + Reset Volume - + Configure Effects... - + &Clear Recent Files - + &Continue - + Warning: Outdated Game Format - + You are using the deconstructed ROM directory format for this game, which is an outdated format that has been superseded by others such as NCA, NAX, XCI, or NSP. Deconstructed ROM directories lack icons, metadata, and update support.<br>For an explanation of the various Switch formats Eden supports, out our user handbook. This message will not be shown again. - - + + Error while loading ROM! - + The ROM format is not supported. - + An error occurred initializing the video core. - + This is usually caused by outdated GPU drivers. Please see the log for more details. See: <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>How to access log files</a>. - + Error while loading ROM! %1 %1 signifies a numeric error code. - + %1<br>Please redump your files or ask on Discord/Stoat for help. %1 signifies an error string. - + An unknown error occurred. Please see the log for more details. - - + + (64-bit) - - + + (32-bit) - - + + %1 %2 %1 is the title name. %2 indicates if the title is 64-bit or 32-bit - + Closing software... - + Save Data - + Mod Data - + Error Opening %1 Folder - - + + Folder does not exist! - + Remove Installed Game Contents? - + Remove Installed Game Update? - + Remove Installed Game DLC? - + Remove Entry - + Delete OpenGL Transferable Shader Cache? - + Delete Vulkan Transferable Shader Cache? - + Delete All Transferable Shader Caches? - + Remove Custom Game Configuration? - + Remove Cache Storage? - + Remove File - + Remove Play Time Data - + Reset play time? - - + + RomFS Extraction Failed! - + There was an error copying the RomFS files or the user cancelled the operation. - + Full - + Skeleton - + Select RomFS Dump Mode - + Please select the how you would like the RomFS dumped.<br>Full will copy all of the files into the new directory while <br>skeleton will only create the directory structure. - + There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - + Extracting RomFS... - - + + Cancel - + RomFS Extraction Succeeded! - + The operation completed successfully. - + Error Opening %1 - + Select Directory - + Properties - + The game properties could not be loaded. - + Switch Executable (%1);;All Files (*.*) %1 is an identifier for the Switch executable file extensions. - + Load File - + Open Extracted ROM Directory - + Invalid Directory Selected - + The directory you have selected does not contain a 'main' file. - + Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive (*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge Image (*.xci) - + Install Files - + %n file(s) remaining - + Installing file "%1"... - - + + Install Results - + To avoid possible conflicts, we discourage users from installing base games to the NAND. Please, only use this feature to install updates and DLC. - + %n file(s) were newly installed - + %n file(s) were overwritten - + %n file(s) failed to install - + System Application - + System Archive - + System Application Update - + Firmware Package (Type A) - + Firmware Package (Type B) - + Game - + Game Update - + Game DLC - + Delta Title - + Select NCA Install Type... - + Please select the type of title you would like to install this NCA as: (In most instances, the default 'Game' is fine.) - + Failed to Install - + The title type you selected for the NCA is invalid. - + File not found - + File "%1" not found - + OK - + Function Disabled - + Compatibility list reporting is currently disabled. Check back later! - + Error opening URL - + Unable to open the URL "%1". - + TAS Recording - + Overwrite file of player 1? - + Invalid config detected - + Handheld controller can't be used on docked mode. Pro controller will be selected. - - + + Amiibo - - + + The current amiibo has been removed - + Error - - + + The current game is not looking for amiibos - + Amiibo File (%1);; All Files (*.*) - + Load Amiibo - + Error loading Amiibo data - + The selected file is not a valid amiibo - + The selected file is already on use - + An unknown error occurred - + No firmware available - + Firmware Corrupted - + Unknown applet - + Applet doesn't map to a known value. - + Record not found - + Applet not found. Please reinstall firmware. - + Capture Screenshot - + PNG Image (*.png) - + TAS state: Running %1/%2 - + TAS state: Recording %1 - + TAS state: Idle %1/%2 - + TAS State: Invalid - + &Stop Running - + Stop R&ecording - + Building: %n shader(s) - + Scale: %1x %1 is the resolution scaling factor - + Speed: %1% / %2% - + Speed: %1% - + Game: %1 FPS - + Frame: %1 ms - + NO AA - + NO FX - + FX - + VOLUME: MUTE - + VOLUME: %1% Volume percentage (e.g. 50%) - + Derivation Components Missing - + Decryption keys are missing. Install them now? - + Wayland Detected! - + Wayland is known to have significant performance issues and mysterious bugs. It's recommended to use X11 instead. @@ -8031,74 +8014,74 @@ Would you like to force it for future launches? - + Use X11 - + Continue with Wayland - + Don't show again - + Restart Required - + Restart Eden to apply the X11 backend. - + Slow - + Turbo - + Unlocked - + Select RomFS Dump Target - + Please select which RomFS you would like to dump. - + Are you sure you want to close Eden? - - - + + + Eden - + Are you sure you want to stop the emulation? Any unsaved progress will be lost. - + The currently running application has requested Eden to not exit. Would you like to bypass this and exit anyway? From 08917afe0e29b3bb7ddeb3b405b76832841cc96d Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 29 Sep 2026 21:57:46 -0400 Subject: [PATCH 128/198] God has forsaken me to BDA --- .../backend/glasm/emit_glasm_memory.cpp | 8 +- .../backend/glsl/glsl_emit_context.cpp | 3 +- .../backend/spirv/emit_spirv.h | 5 + .../backend/spirv/spirv_emit_context.cpp | 183 ++++++++++++++---- .../backend/spirv/spirv_emit_context.h | 2 + .../global_memory_to_storage_buffer_pass.cpp | 18 +- src/shader_recompiler/profile.h | 1 + src/shader_recompiler/shader_info.h | 1 + src/video_core/buffer_cache/buffer_cache.h | 72 +++++++ .../buffer_cache/buffer_cache_base.h | 19 ++ .../renderer_vulkan/pipeline_helper.h | 8 +- .../renderer_vulkan/vk_compute_pipeline.cpp | 14 +- .../renderer_vulkan/vk_graphics_pipeline.cpp | 15 +- .../renderer_vulkan/vk_graphics_pipeline.h | 3 + .../renderer_vulkan/vk_pipeline_cache.cpp | 1 + 15 files changed, 301 insertions(+), 52 deletions(-) diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp index ee39ec2a47..905c8d2bb8 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp @@ -41,17 +41,17 @@ void GlobalStorageOp(EmitContext& ctx, Register address, bool pointer_based, std } const u64 ssbo_align_mask{~(ctx.profile.min_ssbo_alignment - 1U)}; ctx.Add("LDC.U64 DC.x,c{}[{}];" // unaligned_ssbo_addr - "AND.U64 DC.x,DC.x,{};" // ssbo_addr = unaligned_ssbo_addr & ssbo_align_mask "LDC.U32 RC.x,c{}[{}];" // ssbo_size_u32 "CVT.U64.U32 DC.y,RC.x;" // ssbo_size = ssbo_size_u32 - "ADD.U64 DC.y,DC.y,DC.x;" // ssbo_end = ssbo_addr + ssbo_size + "ADD.U64 DC.y,DC.y,DC.x;" // ssbo_end = unaligned_ssbo_addr + ssbo_size + "AND.U64 DC.x,DC.x,{};" // ssbo_addr = unaligned_ssbo_addr & ssbo_align_mask "SGE.U64 RC.x,{}.x,DC.x;" // a = input_addr >= ssbo_addr ? -1 : 0 "SLT.U64 RC.y,{}.x,DC.y;" // b = input_addr < ssbo_end ? -1 : 0 "AND.U.CC RC.x,RC.x,RC.y;" // cond = a && b "IF NE.x;" // if cond "SUB.U64 DC.x,{}.x,DC.x;", // offset = input_addr - ssbo_addr - ssbo.cbuf_index, ssbo.cbuf_offset, ssbo_align_mask, ssbo.cbuf_index, - ssbo.cbuf_offset + 8, address, address, address); + ssbo.cbuf_index, ssbo.cbuf_offset, ssbo.cbuf_index, ssbo.cbuf_offset + 8, + ssbo_align_mask, address, address, address); if (pointer_based) { ctx.Add("PK64.U DC.y,c[{}];" // host_ssbo = cbuf "ADD.U64 DC.x,DC.x,DC.y;" // host_addr = host_ssbo + offset diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index 4f4d420bd7..25887792d7 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp @@ -618,7 +618,8 @@ std::string EmitContext::DefineGlobalMemoryFunctions() { const auto size_vec{fmt::format("uvec2({},{})", size_xy[0], size_xy[1])}; const auto comp_lhs{fmt::format("(addr>={})", ssbo_addr)}; - const auto comp_rhs{fmt::format("(addr<({}+uint64_t({})))", ssbo_addr, size_vec)}; + const auto comp_rhs{fmt::format("(addr<(packUint2x32(uvec2({},{}))+uint64_t({})))", + addr_xy[0], addr_xy[1], size_vec)}; const auto comparison{fmt::format("if({}&&{}){{", comp_lhs, comp_rhs)}; func += comparison; diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.h b/src/shader_recompiler/backend/spirv/emit_spirv.h index c88f07c9ce..53e4e7dbb9 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv.h @@ -29,6 +29,11 @@ struct RescalingLayout { struct RenderAreaLayout { std::array render_area; }; +struct GlobalPointerLayout { + std::array table; + u32 count; +}; +constexpr u32 GLOBAL_POINTER_LAYOUT_OFFSET = 64; constexpr u32 RESCALING_LAYOUT_WORDS_OFFSET = offsetof(RescalingLayout, rescaling_textures); constexpr u32 RESCALING_LAYOUT_DOWN_FACTOR_OFFSET = offsetof(RescalingLayout, down_factor); constexpr u32 RENDERAREA_LAYOUT_OFFSET = offsetof(RenderAreaLayout, render_area); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index f174251625..6906f42d09 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -486,9 +486,9 @@ EmitContext::EmitContext(const Profile& profile_, const RuntimeInfo& runtime_inf DefineTextures(program.info, texture_binding, bindings.texture_scaling_index); DefineImages(program.info, image_binding, bindings.image_scaling_index); DefineAttributeMemAccess(program.info); - DefineGlobalMemoryFunctions(program); DefineRescalingInput(program.info); DefineRenderArea(program.info); + DefineGlobalMemoryFunctions(program); } EmitContext::~EmitContext() = default; @@ -911,12 +911,48 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { if (!info.uses_global_memory || !profile.support_int64) { return; } + struct Access { + const StorageDefinitions* ssbo; + Id word; + Id address; + }; const Id zero{u32_zero_value}; const Id scope{Const(static_cast(spv::Scope::Device))}; const Id align_mask{Const(~(static_cast(profile.min_ssbo_alignment) - 1U))}; - const auto word_pointer{[&](Id ssbo, Id word, u32 element) { - return OpAccessChain(storage_types.U32.element, ssbo, zero, - OpIAdd(U32[1], word, Const(element))); + Id physical_u32{}; + Id physical_u32x4{}; + if (uses_global_pointers) { + AddCapability(spv::Capability::PhysicalStorageBufferAddresses); + AddExtension("SPV_KHR_physical_storage_buffer"); + SetMemoryModel(spv::AddressingModel::PhysicalStorageBuffer64, spv::MemoryModel::GLSL450); + physical_u32 = TypePointer(spv::StorageClass::PhysicalStorageBuffer, U32[1]); + physical_u32x4 = TypePointer(spv::StorageClass::PhysicalStorageBuffer, U32[4]); + } + const auto word_pointer{[&](const Access& access, u32 element) { + if (access.ssbo) { + return OpAccessChain(storage_types.U32.element, access.ssbo->U32, zero, + OpIAdd(U32[1], access.word, Const(element))); + } + return OpConvertUToPtr(physical_u32, + OpIAdd(U64, access.address, Constant(U64, u64{element} * 4))); + }}; + const auto load_word{[&](const Access& access, u32 element) { + if (access.ssbo) { + return OpLoad(U32[1], word_pointer(access, element)); + } + return OpLoad(U32[1], word_pointer(access, element), spv::MemoryAccessMask::Aligned, 4U); + }}; + const auto store_word{[&](const Access& access, u32 element, Id value) { + if (access.ssbo) { + OpStore(word_pointer(access, element), value); + return; + } + OpStore(word_pointer(access, element), value, spv::MemoryAccessMask::Aligned, 4U); + }}; + const auto load_entry{[&](Id address) { + const Id entry{OpLoad(U32[4], OpConvertUToPtr(physical_u32x4, address), + spv::MemoryAccessMask::Aligned, 16U)}; + return std::pair{entry, OpBitcast(U64, OpVectorShuffle(U32[2], entry, entry, 0U, 1U))}; }}; const auto cbuf_word{[&](u32 index, u32 offset) { if (profile.support_descriptor_aliasing) { @@ -938,7 +974,19 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { const Id addr{OpFunctionParameter(U64)}; const Id value{OpFunctionParameter(value_type)}; const bool returns_value{result_type.value != void_id.value}; + const auto finish{[&](Id result) { + if (returns_value) { + OpReturnValue(result); + } else { + OpReturn(); + } + }}; AddLabel(); + Id entry_index{}; + if (uses_global_pointers) { + entry_index = AddLocalVariable(TypePointer(spv::StorageClass::Function, U32[1]), + spv::StorageClass::Function, zero); + } const Id addr_words{OpBitcast(U32[2], addr)}; const Id addr_low{OpCompositeExtract(U32[1], addr_words, 0U)}; const Id addr_high{OpCompositeExtract(U32[1], addr_words, 1U)}; @@ -947,8 +995,7 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { if (!desc.is_global_fallback) { continue; } - const Id ssbo_low{ - OpBitwiseAnd(U32[1], cbuf_word(desc.cbuf_index, desc.cbuf_offset), align_mask)}; + const Id ssbo_low{cbuf_word(desc.cbuf_index, desc.cbuf_offset)}; const Id ssbo_high{cbuf_word(desc.cbuf_index, desc.cbuf_offset + 4)}; const Id ssbo_size{cbuf_word(desc.cbuf_index, desc.cbuf_offset + 8)}; const Id offset{OpISub(U32[1], addr_low, ssbo_low)}; @@ -961,15 +1008,55 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { OpSelectionMerge(else_label, spv::SelectionControlMask::MaskNone); OpBranchConditional(cond, then_label, else_label); AddLabel(then_label); - const Id word{OpShiftRightLogical(U32[1], offset, Const(2U))}; - const Id result{callback(ssbos[index], word, offset, value)}; - if (returns_value) { - OpReturnValue(result); - } else { - OpReturn(); - } + const Id aligned_offset{ + OpISub(U32[1], addr_low, OpBitwiseAnd(U32[1], ssbo_low, align_mask))}; + const Id word{OpShiftRightLogical(U32[1], aligned_offset, Const(2U))}; + finish(callback(Access{&ssbos[index], word, Id{}}, aligned_offset, value)); AddLabel(else_label); } + if (uses_global_pointers) { + const Id table_pointer{ + OpAccessChain(TypePointer(spv::StorageClass::PushConstant, U32[2]), + rescaling_push_constants, Const(global_pointer_member_index))}; + const Id count_pointer{ + OpAccessChain(TypePointer(spv::StorageClass::PushConstant, U32[1]), + rescaling_push_constants, Const(global_pointer_member_index + 1))}; + const Id table{OpBitcast(U64, OpLoad(U32[2], table_pointer))}; + const Id count{OpLoad(U32[1], count_pointer)}; + const Id header_label{OpLabel()}; + const Id body_label{OpLabel()}; + const Id hit_label{OpLabel()}; + const Id skip_label{OpLabel()}; + const Id continue_label{OpLabel()}; + const Id merge_label{OpLabel()}; + OpBranch(header_label); + AddLabel(header_label); + const Id entry{OpLoad(U32[1], entry_index)}; + const Id in_table{OpULessThan(U1, entry, count)}; + OpLoopMerge(merge_label, continue_label, spv::LoopControlMask::MaskNone); + OpBranchConditional(in_table, body_label, merge_label); + AddLabel(body_label); + const Id entry_address{OpIAdd( + U64, table, OpUConvert(U64, OpShiftLeftLogical(U32[1], entry, Const(5U))))}; + const auto [guest, guest_base]{load_entry(entry_address)}; + const Id guest_offset{OpISub(U64, addr, guest_base)}; + const Id guest_size{OpUConvert(U64, OpCompositeExtract(U32[1], guest, 2U))}; + const Id hit{OpULessThan(U1, guest_offset, guest_size)}; + OpSelectionMerge(skip_label, spv::SelectionControlMask::MaskNone); + OpBranchConditional(hit, hit_label, skip_label); + AddLabel(hit_label); + const Id host_base{ + load_entry(OpIAdd(U64, entry_address, Constant(U64, u64{16}))).second}; + const Id target{OpBitwiseAnd(U64, OpIAdd(U64, host_base, guest_offset), + Constant(U64, ~u64{3}))}; + finish(callback(Access{nullptr, Id{}, target}, addr_low, value)); + AddLabel(skip_label); + OpBranch(continue_label); + AddLabel(continue_label); + OpStore(entry_index, OpIAdd(U32[1], entry, Const(1U))); + OpBranch(header_label); + AddLabel(merge_label); + } if (returns_value) { OpReturnValue(ConstantNull(result_type)); } else { @@ -987,13 +1074,13 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { OpShiftRightLogical(U32[1], word, Const(2U))); }}; const auto load{[&](Id type, u32 count) { - return [&, type, count](const StorageDefinitions& ssbo, Id word, Id, Id) { - if (count > 1 && profile.support_descriptor_aliasing) { - return OpLoad(type, vector_pointer(ssbo, word, count)); + return [&, type, count](const Access& access, Id, Id) { + if (count > 1 && access.ssbo && profile.support_descriptor_aliasing) { + return OpLoad(type, vector_pointer(*access.ssbo, access.word, count)); } std::array words{}; for (u32 element = 0; element < count; ++element) { - words[element] = OpLoad(U32[1], word_pointer(ssbo.U32, word, element)); + words[element] = load_word(access, element); } if (count == 1) { return words[0]; @@ -1002,25 +1089,24 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { }; }}; const auto store{[&](u32 count) { - return [&, count](const StorageDefinitions& ssbo, Id word, Id, Id value) { - if (count > 1 && profile.support_descriptor_aliasing) { - OpStore(vector_pointer(ssbo, word, count), value); + return [&, count](const Access& access, Id, Id value) { + if (count > 1 && access.ssbo && profile.support_descriptor_aliasing) { + OpStore(vector_pointer(*access.ssbo, access.word, count), value); return Id{}; } if (count == 1) { - OpStore(word_pointer(ssbo.U32, word, 0), value); + store_word(access, 0, value); return Id{}; } for (u32 element = 0; element < count; ++element) { - OpStore(word_pointer(ssbo.U32, word, element), - OpCompositeExtract(U32[1], value, element)); + store_word(access, element, OpCompositeExtract(U32[1], value, element)); } return Id{}; }; }}; const auto extract{[&](bool is_signed, u32 count) { - return [&, is_signed, count](const StorageDefinitions& ssbo, Id word, Id offset, Id) { - const Id loaded{OpLoad(U32[1], word_pointer(ssbo.U32, word, 0))}; + return [&, is_signed, count](const Access& access, Id offset, Id) { + const Id loaded{load_word(access, 0)}; if (is_signed) { return OpBitFieldSExtract(U32[1], loaded, bits(offset, count), Const(count)); } @@ -1028,28 +1114,36 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { }; }}; const auto insert{[&](u32 count) { - return [&, count](const StorageDefinitions& ssbo, Id word, Id offset, Id value) { - AtomicBitFieldInsert(word_pointer(ssbo.U32, word, 0), value, bits(offset, count), + return [&, count](const Access& access, Id offset, Id value) { + AtomicBitFieldInsert(word_pointer(access, 0), value, bits(offset, count), Const(count)); return Id{}; }; }}; const auto atomic{[&](Id (Sirit::Module::*func)(Id, Id, Id, Id, Id)) { - return [&, func](const StorageDefinitions& ssbo, Id word, Id, Id value) { - return (this->*func)(U32[1], word_pointer(ssbo.U32, word, 0), scope, zero, value); + return [&, func](const Access& access, Id, Id value) { + return (this->*func)(U32[1], word_pointer(access, 0), scope, zero, value); }; }}; const auto cas{[&](Id type, Id helper) { - return [&, type, helper](const StorageDefinitions& ssbo, Id word, Id, Id value) { - return OpFunctionCall(type, helper, word, value, ssbo.U32); + return [&, type, helper](const Access& access, Id, Id value) { + if (!access.ssbo) { + return ConstantNull(type); + } + return OpFunctionCall(type, helper, access.word, value, access.ssbo->U32); }; }}; const auto packed{[&](bool is_half, Id helper) { - return [&, is_half, helper](const StorageDefinitions& ssbo, Id word, Id, Id value) { - if (is_half) { - return OpBitcast(U32[1], OpFunctionCall(F16[2], helper, word, value, ssbo.U32)); + return [&, is_half, helper](const Access& access, Id, Id value) { + if (!access.ssbo) { + return ConstantNull(U32[1]); } - return OpPackHalf2x16(U32[1], OpFunctionCall(F32[2], helper, word, value, ssbo.U32)); + const Id ssbo{access.ssbo->U32}; + if (is_half) { + return OpBitcast(U32[1], OpFunctionCall(F16[2], helper, access.word, value, ssbo)); + } + return OpPackHalf2x16(U32[1], + OpFunctionCall(F32[2], helper, access.word, value, ssbo)); }; }}; for (const IR::Block* const block : program.post_order_blocks) { @@ -1159,7 +1253,9 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { } void EmitContext::DefineRescalingInput(const Info& info) { - if (!info.uses_rescaling_uniform) { + uses_global_pointers = info.uses_global_pointers && profile.support_buffer_device_address && + profile.support_int64 && profile.unified_descriptor_binding; + if (!info.uses_rescaling_uniform && !uses_global_pointers) { return; } if (profile.unified_descriptor_binding) { @@ -1170,7 +1266,7 @@ void EmitContext::DefineRescalingInput(const Info& info) { } void EmitContext::DefineRescalingInputPushConstant() { - boost::container::static_vector members{}; + boost::container::static_vector members{}; u32 member_index{0}; rescaling_textures_type = TypeArray(U32[1], Const(4u)); @@ -1187,6 +1283,11 @@ void EmitContext::DefineRescalingInputPushConstant() { members.push_back(F32[1]); rescaling_downfactor_member_index = member_index++; } + if (uses_global_pointers) { + members.push_back(U32[2]); + members.push_back(U32[1]); + global_pointer_member_index = member_index; + } const Id push_constant_struct{TypeStruct(std::span(members.data(), members.size()))}; Decorate(push_constant_struct, spv::Decoration::Block); Name(push_constant_struct, "ResolutionInfo"); @@ -1205,6 +1306,14 @@ void EmitContext::DefineRescalingInputPushConstant() { static_cast(offsetof(RescalingLayout, down_factor))); MemberName(push_constant_struct, rescaling_downfactor_member_index, "down_factor"); } + if (uses_global_pointers) { + MemberDecorate(push_constant_struct, global_pointer_member_index, spv::Decoration::Offset, + GLOBAL_POINTER_LAYOUT_OFFSET); + MemberDecorate(push_constant_struct, global_pointer_member_index + 1, + spv::Decoration::Offset, + GLOBAL_POINTER_LAYOUT_OFFSET + + static_cast(offsetof(GlobalPointerLayout, count))); + } const Id pointer_type{TypePointer(spv::StorageClass::PushConstant, push_constant_struct)}; rescaling_push_constants = AddGlobalVariable(pointer_type, spv::StorageClass::PushConstant); Name(rescaling_push_constants, "rescaling_push_constants"); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index 68761e1f1a..904686e2c7 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -307,6 +307,8 @@ public: u32 rescaling_textures_member_index{}; u32 rescaling_images_member_index{}; u32 rescaling_downfactor_member_index{}; + u32 global_pointer_member_index{}; + bool uses_global_pointers{}; u32 texture_rescaling_index{}; u32 image_rescaling_index{}; diff --git a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp index bf40b0695b..339b6aabd1 100644 --- a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp +++ b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp @@ -56,6 +56,7 @@ struct StorageInfo { StorageBufferSet set; StorageInstVector to_replace; StorageWritesSet writes; + bool pointers{}; }; /// Returns true when the instruction is a global memory instruction @@ -335,7 +336,8 @@ std::optional TrackLowAddress(IR::Inst* inst) { } /// Tries to track the storage buffer address used by a global memory instruction -StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStores& local_stores) { +StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStores& local_stores, + bool& from_memory) { const auto pred{[bias](const IR::Inst* inst) -> std::optional { if (inst->GetOpcode() != IR::Opcode::GetCbufU32 && inst->GetOpcode() != IR::Opcode::GetCbufU32x2) { @@ -386,6 +388,8 @@ StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStor } switch (inst->GetOpcode()) { case IR::Opcode::LoadLocal: + from_memory |= + !inst->Arg(0).IsImmediate() || !local_stores.contains(inst->Arg(0).U32()); if (inst->Arg(0).IsImmediate()) { const auto [begin, end]{local_stores.equal_range(inst->Arg(0).U32())}; for (auto it = begin; it != end; ++it) { @@ -405,6 +409,7 @@ StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStor case IR::Opcode::GetCbufU32: case IR::Opcode::GetCbufF32: case IR::Opcode::GetCbufU32x2: + continue; case IR::Opcode::LoadSharedU8: case IR::Opcode::LoadSharedS8: case IR::Opcode::LoadSharedU16: @@ -412,11 +417,13 @@ StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStor case IR::Opcode::LoadSharedU32: case IR::Opcode::LoadSharedU64: case IR::Opcode::LoadSharedU128: + from_memory = true; continue; default: break; } if (IsGlobalMemory(*inst) || inst->MayHaveSideEffects()) { + from_memory = true; continue; } for (size_t arg = 0; arg < inst->NumArgs(); ++arg) { @@ -457,18 +464,21 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info, const std::optional low_addr_info{TrackLowAddress(&inst)}; if (!low_addr_info) { // Failed to track the low address, use NVN fallbacks + info.pointers = true; return; } // First try to find storage buffers in the NVN address const IR::U32 low_addr{low_addr_info->value}; - StorageBufferSet candidates{Track(low_addr, &nvn_bias, local_stores)}; + bool from_memory{}; + StorageBufferSet candidates{Track(low_addr, &nvn_bias, local_stores, from_memory)}; if (candidates.empty()) { // If it fails, track without a bias - candidates = Track(low_addr, nullptr, local_stores); + candidates = Track(low_addr, nullptr, local_stores, from_memory); } if (candidates.size() != 1) { // If that also fails, use NVN fallbacks LOG_WARNING(Shader, "Storage buffer failed to track, using global memory fallbacks"); + info.pointers |= from_memory; return; } const StorageBufferAddr storage_buffer{*candidates.begin()}; @@ -615,6 +625,7 @@ void GlobalMemoryToStorageBufferPass(IR::Program& program, const HostTranslateIn .is_written = info.writes.contains(storage_buffer), }); } + program.info.uses_global_pointers = info.pointers; for (const StorageInst& storage_inst : info.to_replace) { const StorageBufferAddr storage_buffer{storage_inst.storage_buffer}; const auto it{info.set.find(storage_inst.storage_buffer)}; @@ -628,6 +639,7 @@ void GlobalMemoryToStorageBufferPass(IR::Program& program, const HostTranslateIn } void JoinStorageInfo(Info& base, Info& source) { + base.uses_global_pointers |= source.uses_global_pointers; auto& descriptors = base.storage_buffers_descriptors; for (auto& desc : source.storage_buffers_descriptors) { auto it{std::ranges::find_if(descriptors, [&desc](const auto& existing) { diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index 8e9c83f888..3b5b159384 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h @@ -47,6 +47,7 @@ struct Profile { bool support_typeless_image_loads{}; bool support_demote_to_helper_invocation{}; bool support_int64_atomics{}; + bool support_buffer_device_address{}; bool support_shared_int64_atomics{}; bool support_derivative_control{}; bool support_geometry_shader_passthrough{}; diff --git a/src/shader_recompiler/shader_info.h b/src/shader_recompiler/shader_info.h index b8d760a30e..6729b338b5 100644 --- a/src/shader_recompiler/shader_info.h +++ b/src/shader_recompiler/shader_info.h @@ -312,6 +312,7 @@ struct Info { bool uses_atomic_s32_max{}; bool uses_int64_bit_atomics{}; bool uses_global_memory{}; + bool uses_global_pointers{}; bool uses_atomic_image_u32{}; bool uses_shadow_lod{}; bool uses_rescaling_uniform{}; diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 087d7ac1f8..5ab5a6f4f3 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -123,6 +123,8 @@ void BufferCache

::TickFrame() { if (total_used_memory >= minimum_memory || heap_pressure) { RunGarbageCollector(); } + std::erase_if(pointer_ranges, + [this](const PointerRange& range) { return range.frame + 2 < frame_tick; }); ++frame_tick; delayed_destruction_ring.Tick(); @@ -1144,6 +1146,7 @@ void BufferCache

::BindHostGraphicsStorageBuffers(size_t stage) { if (is_written) { MarkWrittenBuffer(binding.buffer_id, binding.device_addr, size); + RecordPointerRange(binding); } if constexpr (NEEDS_BIND_STORAGE_INDEX) { @@ -1284,6 +1287,7 @@ void BufferCache

::BindHostComputeStorageBuffers() { if (is_written) { MarkWrittenBuffer(binding.buffer_id, binding.device_addr, size); + RecordPointerRange(binding); } if constexpr (NEEDS_BIND_STORAGE_INDEX) { @@ -1341,6 +1345,7 @@ void BufferCache

::DoUpdateGraphicsBuffers(bool is_indexed) { if (current_draw_indirect) { UpdateDrawIndirect(); } + UpdatePointerRanges(); }); } @@ -1351,6 +1356,7 @@ void BufferCache

::DoUpdateComputeBuffers() { UpdateComputeUniformBuffers(); UpdateComputeStorageBuffers(); UpdateComputeTextureBuffers(); + UpdatePointerRanges(); }); } @@ -1496,6 +1502,72 @@ void BufferCache

::UpdateStorageBuffers(size_t stage) { }); } +template +void BufferCache

::UpdatePointerRanges() { + if (!pointer_table_requested) { + return; + } + for (PointerRange& range : pointer_ranges) { + range.buffer_id = NULL_BUFFER_ID; + if (gpu_memory->GpuToCpuAddress(range.gpu_addr) == range.device_addr) { + range.buffer_id = FindBuffer(range.device_addr, range.size, false); + } + } +} + +template +void BufferCache

::RecordPointerRange(const Binding& binding) { + if (!record_pointer_ranges) { + return; + } + const auto it = std::ranges::find(pointer_ranges, binding.gpu_addr, &PointerRange::gpu_addr); + if (it != pointer_ranges.end()) { + it->device_addr = binding.device_addr; + it->size = (std::max)(it->size, binding.size); + it->frame = frame_tick; + return; + } + if (pointer_ranges.size() < MAX_POINTER_RANGES) { + pointer_ranges.push_back({binding.gpu_addr, binding.device_addr, binding.size, frame_tick, + NULL_BUFFER_ID}); + } +} + +template +void BufferCache

::RequestPointerTable(bool enable) noexcept { + pointer_table_requested = enable; + record_pointer_ranges |= enable; +} + +template +std::array BufferCache

::BindHostPointerTable(bool is_written) { + std::array table{}; + if constexpr (!IS_OPENGL) { + const size_t capacity = (std::max)(pointer_ranges.size(), size_t{1}); + const auto upload = runtime.UploadStagingBuffer(capacity * sizeof(std::array)); + u32 count = 0; + for (const PointerRange& range : pointer_ranges) { + if (range.buffer_id == NULL_BUFFER_ID) { + continue; + } + Buffer& buffer = slot_buffers[range.buffer_id]; + TouchBuffer(buffer, range.buffer_id); + SynchronizeBuffer(buffer, range.device_addr, range.size); + if (is_written) { + MarkWrittenBuffer(range.buffer_id, range.device_addr, range.size); + } + const u64 host_address = buffer.DeviceAddress() + buffer.Offset(range.device_addr); + const std::array entry{range.gpu_addr, range.size, host_address, 0}; + std::memcpy(upload.mapped_span.data() + count * sizeof(entry), entry.data(), + sizeof(entry)); + ++count; + } + const u64 address = upload.device_address + upload.offset; + table = {static_cast(address), static_cast(address >> 32), count}; + } + return table; +} + template void BufferCache

::UpdateTextureBuffers(size_t stage) { ForEachEnabledBit(channel_state->enabled_texture_buffers[stage], [&](u32 index) { diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index d1f9ff5f97..b7802d5f76 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -270,6 +270,10 @@ public: void BindHostComputeBuffers(); + void RequestPointerTable(bool enable) noexcept; + + [[nodiscard]] std::array BindHostPointerTable(bool is_written); + void SetUniformBuffersState(const std::array& mask, const UniformBufferSizes* sizes); @@ -431,6 +435,10 @@ private: void UpdateStorageBuffers(size_t stage); + void UpdatePointerRanges(); + + void RecordPointerRange(const Binding& binding); + void UpdateTextureBuffers(size_t stage); void UpdateTransformFeedbackBuffers(); @@ -563,6 +571,17 @@ private: std::vector graphics_segments; std::vector compute_segments; u64 frame_tick = 0; + struct PointerRange { + GPUVAddr gpu_addr; + DAddr device_addr; + u32 size; + u64 frame; + BufferId buffer_id; + }; + static constexpr size_t MAX_POINTER_RANGES = 256; + std::vector pointer_ranges; + bool record_pointer_ranges = false; + bool pointer_table_requested = false; u64 total_used_memory = 0; u64 device_local_memory = 0; u64 minimum_memory = 0; diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index 07de25f18f..3e4a4e40be 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h @@ -243,15 +243,13 @@ public: } vk::PipelineLayout CreatePipelineLayout(VkDescriptorSetLayout descriptor_set_layout) const { - using Shader::Backend::SPIRV::RenderAreaLayout; - using Shader::Backend::SPIRV::RescalingLayout; - const u32 size_offset = is_compute ? sizeof(RescalingLayout::down_factor) : 0u; + using Shader::Backend::SPIRV::GLOBAL_POINTER_LAYOUT_OFFSET; + using Shader::Backend::SPIRV::GlobalPointerLayout; const VkPushConstantRange range{ .stageFlags = static_cast( is_compute ? VK_SHADER_STAGE_COMPUTE_BIT : VK_SHADER_STAGE_ALL_GRAPHICS), .offset = 0, - .size = static_cast(sizeof(RescalingLayout)) - size_offset + - static_cast(sizeof(RenderAreaLayout)), + .size = GLOBAL_POINTER_LAYOUT_OFFSET + static_cast(sizeof(GlobalPointerLayout)), }; return device->GetLogical().CreatePipelineLayout({ .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index 840ff5897b..755c6611be 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp @@ -28,6 +28,7 @@ namespace Vulkan { using Shader::ImageBufferDescriptor; +using Shader::Backend::SPIRV::GLOBAL_POINTER_LAYOUT_OFFSET; using Shader::Backend::SPIRV::RESCALING_LAYOUT_WORDS_OFFSET; using Tegra::Texture::TexturePair; @@ -245,8 +246,14 @@ bool ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, std::ranges::for_each(info.texture_buffer_descriptors, add_buffer); std::ranges::for_each(info.image_buffer_descriptors, add_buffer); + const bool uses_pointers{info.uses_global_pointers && device.IsBufferDeviceAddressSupported()}; + buffer_cache.RequestPointerTable(uses_pointers); buffer_cache.UpdateComputeBuffers(); buffer_cache.BindHostComputeBuffers(); + std::array pointer_table{}; + if (uses_pointers) { + pointer_table = buffer_cache.BindHostPointerTable(info.stores_global_memory); + } RescalingPushConstant rescaling; const VideoCommon::SamplerId* samplers_it{samplers.data()}; @@ -288,7 +295,7 @@ bool ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, const bool is_rescaling = !info.texture_descriptors.empty() || !info.image_descriptors.empty(); scheduler.Record([this, descriptor_data, is_rescaling, descriptor_buffer_offset, - descriptor_buffer_chunk, bind_descriptor_buffer, + descriptor_buffer_chunk, bind_descriptor_buffer, uses_pointers, pointer_table, rescaling_data = rescaling.Data()](vk::CommandBuffer cmdbuf) { if (bind_descriptor_buffer) { const VkDescriptorBufferBindingInfoEXT binding_info{ @@ -299,6 +306,11 @@ bool ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, return; } cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline); + if (uses_pointers) { + cmdbuf.PushConstants(*pipeline_layout, VK_SHADER_STAGE_COMPUTE_BIT, + GLOBAL_POINTER_LAYOUT_OFFSET, sizeof(pointer_table), + pointer_table.data()); + } if (!descriptor_set_layout) { return; } diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 0a8a2af973..354bcfa06f 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -41,6 +41,7 @@ namespace { using boost::container::small_vector; using boost::container::static_vector; using Shader::ImageBufferDescriptor; +using Shader::Backend::SPIRV::GLOBAL_POINTER_LAYOUT_OFFSET; using Shader::Backend::SPIRV::RENDERAREA_LAYOUT_OFFSET; using Shader::Backend::SPIRV::RESCALING_LAYOUT_DOWN_FACTOR_OFFSET; using Shader::Backend::SPIRV::RESCALING_LAYOUT_WORDS_OFFSET; @@ -301,6 +302,9 @@ GraphicsPipeline::GraphicsPipeline( num_image_elements += Shader::NumDescriptors(info->texture_descriptors); num_image_elements += Shader::NumDescriptors(info->image_descriptors); num_descriptor_entries += NumDescriptorEntries(*info); + uses_global_pointers |= + info->uses_global_pointers && device.IsBufferDeviceAddressSupported(); + stores_global_pointers |= info->stores_global_memory; } fragment_has_color0_output = stage_infos[NUM_STAGES - 1].stores_frag_color[0]; @@ -536,6 +540,7 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { scheduler.RequestOutsideRenderPassOperationContext(); } + buffer_cache.RequestPointerTable(uses_global_pointers); buffer_cache.UpdateGraphicsBuffers(is_indexed); buffer_cache.BindHostGeometryBuffers(is_indexed); @@ -571,6 +576,9 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { if constexpr (Spec::enabled_stages[4]) { prepare_stage(4); } + if (uses_global_pointers) { + pointer_table = buffer_cache.BindHostPointerTable(stores_global_pointers); + } texture_cache.UpdateRenderTargets(false); texture_cache.CheckFeedbackLoop(std::span{views.data(), views.size()}); @@ -656,7 +664,8 @@ bool GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling, descriptor_buffer_offset, descriptor_buffer_chunk, bind_descriptor_buffer, rescaling_data = rescaling.Data(), is_rescaling, update_rescaling, uses_render_area = render_area.uses_render_area, - render_area_data = render_area.words](vk::CommandBuffer cmdbuf) { + render_area_data = render_area.words, + table = pointer_table](vk::CommandBuffer cmdbuf) { if (bind_descriptor_buffer) { const VkDescriptorBufferBindingInfoEXT binding_info{ descriptor_buffer_ring.BindingInfo(descriptor_buffer_chunk)}; @@ -683,6 +692,10 @@ bool GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling, RENDERAREA_LAYOUT_OFFSET, sizeof(render_area_data), &render_area_data); } + if (uses_global_pointers) { + cmdbuf.PushConstants(*pipeline_layout, VK_SHADER_STAGE_ALL_GRAPHICS, + GLOBAL_POINTER_LAYOUT_OFFSET, sizeof(table), table.data()); + } if (!descriptor_set_layout) { return; } diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 1371e8ee06..26c28d536e 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -168,6 +168,9 @@ private: size_t num_image_elements{}; u32 num_textures{}; bool fragment_has_color0_output{}; + bool uses_global_pointers{}; + bool stores_global_pointers{}; + std::array pointer_table{}; vk::DescriptorSetLayout descriptor_set_layout; DescriptorAllocator descriptor_allocator; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index dd55b576e8..3d0905d221 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -421,6 +421,7 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, .support_demote_to_helper_invocation = device.IsExtShaderDemoteToHelperInvocationSupported(), .support_int64_atomics = device.IsExtShaderAtomicInt64Supported(), + .support_buffer_device_address = device.IsBufferDeviceAddressSupported(), .support_shared_int64_atomics = device.IsSharedInt64AtomicsSupported(), .support_derivative_control = true, .support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(), From bdc890f647a27e50c21a2a9710e0d570c026ba52 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 29 Sep 2026 23:17:06 -0400 Subject: [PATCH 129/198] quick test to add pointer range management on buffer binding from indirect draws --- src/video_core/buffer_cache/buffer_cache.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 5ab5a6f4f3..39b79ed97e 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -123,8 +123,6 @@ void BufferCache

::TickFrame() { if (total_used_memory >= minimum_memory || heap_pressure) { RunGarbageCollector(); } - std::erase_if(pointer_ranges, - [this](const PointerRange& range) { return range.frame + 2 < frame_tick; }); ++frame_tick; delayed_destruction_ring.Tick(); @@ -958,6 +956,7 @@ void BufferCache

::BindHostDrawIndirectBuffers() { Buffer& buffer = slot_buffers[binding.buffer_id]; TouchBuffer(buffer, binding.buffer_id); SynchronizeBuffer(buffer, binding.device_addr, binding.size); + RecordPointerRange(binding); }; if (current_draw_indirect->include_count) { bind_buffer(channel_state->count_buffer_binding); @@ -1459,6 +1458,7 @@ void BufferCache

::UpdateDrawIndirect() { } binding = Binding{ .device_addr = *device_addr, + .gpu_addr = gpu_addr, .size = static_cast(size), .buffer_id = FindBuffer(*device_addr, static_cast(size), false), }; @@ -1517,7 +1517,7 @@ void BufferCache

::UpdatePointerRanges() { template void BufferCache

::RecordPointerRange(const Binding& binding) { - if (!record_pointer_ranges) { + if (!record_pointer_ranges || binding.size == 0) { return; } const auto it = std::ranges::find(pointer_ranges, binding.gpu_addr, &PointerRange::gpu_addr); @@ -1527,10 +1527,13 @@ void BufferCache

::RecordPointerRange(const Binding& binding) { it->frame = frame_tick; return; } + const PointerRange range{binding.gpu_addr, binding.device_addr, binding.size, frame_tick, + NULL_BUFFER_ID}; if (pointer_ranges.size() < MAX_POINTER_RANGES) { - pointer_ranges.push_back({binding.gpu_addr, binding.device_addr, binding.size, frame_tick, - NULL_BUFFER_ID}); + pointer_ranges.push_back(range); + return; } + *std::ranges::min_element(pointer_ranges, {}, &PointerRange::frame) = range; } template From 8040f06c8733148cec27126b629ad396e6e9b569 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 29 Sep 2026 23:54:21 -0400 Subject: [PATCH 130/198] Revert "quick test to add pointer range management on buffer binding from indirect draws" --- src/video_core/buffer_cache/buffer_cache.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 39b79ed97e..5ab5a6f4f3 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -123,6 +123,8 @@ void BufferCache

::TickFrame() { if (total_used_memory >= minimum_memory || heap_pressure) { RunGarbageCollector(); } + std::erase_if(pointer_ranges, + [this](const PointerRange& range) { return range.frame + 2 < frame_tick; }); ++frame_tick; delayed_destruction_ring.Tick(); @@ -956,7 +958,6 @@ void BufferCache

::BindHostDrawIndirectBuffers() { Buffer& buffer = slot_buffers[binding.buffer_id]; TouchBuffer(buffer, binding.buffer_id); SynchronizeBuffer(buffer, binding.device_addr, binding.size); - RecordPointerRange(binding); }; if (current_draw_indirect->include_count) { bind_buffer(channel_state->count_buffer_binding); @@ -1458,7 +1459,6 @@ void BufferCache

::UpdateDrawIndirect() { } binding = Binding{ .device_addr = *device_addr, - .gpu_addr = gpu_addr, .size = static_cast(size), .buffer_id = FindBuffer(*device_addr, static_cast(size), false), }; @@ -1517,7 +1517,7 @@ void BufferCache

::UpdatePointerRanges() { template void BufferCache

::RecordPointerRange(const Binding& binding) { - if (!record_pointer_ranges || binding.size == 0) { + if (!record_pointer_ranges) { return; } const auto it = std::ranges::find(pointer_ranges, binding.gpu_addr, &PointerRange::gpu_addr); @@ -1527,13 +1527,10 @@ void BufferCache

::RecordPointerRange(const Binding& binding) { it->frame = frame_tick; return; } - const PointerRange range{binding.gpu_addr, binding.device_addr, binding.size, frame_tick, - NULL_BUFFER_ID}; if (pointer_ranges.size() < MAX_POINTER_RANGES) { - pointer_ranges.push_back(range); - return; + pointer_ranges.push_back({binding.gpu_addr, binding.device_addr, binding.size, frame_tick, + NULL_BUFFER_ID}); } - *std::ranges::min_element(pointer_ranges, {}, &PointerRange::frame) = range; } template From 92cbcb8fe50e5ef734dfe84d1f1fd36cc383d68c Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 29 Sep 2026 23:54:39 -0400 Subject: [PATCH 131/198] Revert "God has forsaken me to BDA" --- .../backend/glasm/emit_glasm_memory.cpp | 8 +- .../backend/glsl/glsl_emit_context.cpp | 3 +- .../backend/spirv/emit_spirv.h | 5 - .../backend/spirv/spirv_emit_context.cpp | 181 ++++-------------- .../backend/spirv/spirv_emit_context.h | 2 - .../global_memory_to_storage_buffer_pass.cpp | 18 +- src/shader_recompiler/profile.h | 1 - src/shader_recompiler/shader_info.h | 1 - src/video_core/buffer_cache/buffer_cache.h | 72 ------- .../buffer_cache/buffer_cache_base.h | 19 -- .../renderer_vulkan/pipeline_helper.h | 8 +- .../renderer_vulkan/vk_compute_pipeline.cpp | 14 +- .../renderer_vulkan/vk_graphics_pipeline.cpp | 15 +- .../renderer_vulkan/vk_graphics_pipeline.h | 3 - .../renderer_vulkan/vk_pipeline_cache.cpp | 1 - 15 files changed, 51 insertions(+), 300 deletions(-) diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp index 905c8d2bb8..ee39ec2a47 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp @@ -41,17 +41,17 @@ void GlobalStorageOp(EmitContext& ctx, Register address, bool pointer_based, std } const u64 ssbo_align_mask{~(ctx.profile.min_ssbo_alignment - 1U)}; ctx.Add("LDC.U64 DC.x,c{}[{}];" // unaligned_ssbo_addr + "AND.U64 DC.x,DC.x,{};" // ssbo_addr = unaligned_ssbo_addr & ssbo_align_mask "LDC.U32 RC.x,c{}[{}];" // ssbo_size_u32 "CVT.U64.U32 DC.y,RC.x;" // ssbo_size = ssbo_size_u32 - "ADD.U64 DC.y,DC.y,DC.x;" // ssbo_end = unaligned_ssbo_addr + ssbo_size - "AND.U64 DC.x,DC.x,{};" // ssbo_addr = unaligned_ssbo_addr & ssbo_align_mask + "ADD.U64 DC.y,DC.y,DC.x;" // ssbo_end = ssbo_addr + ssbo_size "SGE.U64 RC.x,{}.x,DC.x;" // a = input_addr >= ssbo_addr ? -1 : 0 "SLT.U64 RC.y,{}.x,DC.y;" // b = input_addr < ssbo_end ? -1 : 0 "AND.U.CC RC.x,RC.x,RC.y;" // cond = a && b "IF NE.x;" // if cond "SUB.U64 DC.x,{}.x,DC.x;", // offset = input_addr - ssbo_addr - ssbo.cbuf_index, ssbo.cbuf_offset, ssbo.cbuf_index, ssbo.cbuf_offset + 8, - ssbo_align_mask, address, address, address); + ssbo.cbuf_index, ssbo.cbuf_offset, ssbo_align_mask, ssbo.cbuf_index, + ssbo.cbuf_offset + 8, address, address, address); if (pointer_based) { ctx.Add("PK64.U DC.y,c[{}];" // host_ssbo = cbuf "ADD.U64 DC.x,DC.x,DC.y;" // host_addr = host_ssbo + offset diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index 25887792d7..4f4d420bd7 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp @@ -618,8 +618,7 @@ std::string EmitContext::DefineGlobalMemoryFunctions() { const auto size_vec{fmt::format("uvec2({},{})", size_xy[0], size_xy[1])}; const auto comp_lhs{fmt::format("(addr>={})", ssbo_addr)}; - const auto comp_rhs{fmt::format("(addr<(packUint2x32(uvec2({},{}))+uint64_t({})))", - addr_xy[0], addr_xy[1], size_vec)}; + const auto comp_rhs{fmt::format("(addr<({}+uint64_t({})))", ssbo_addr, size_vec)}; const auto comparison{fmt::format("if({}&&{}){{", comp_lhs, comp_rhs)}; func += comparison; diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.h b/src/shader_recompiler/backend/spirv/emit_spirv.h index 53e4e7dbb9..c88f07c9ce 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv.h @@ -29,11 +29,6 @@ struct RescalingLayout { struct RenderAreaLayout { std::array render_area; }; -struct GlobalPointerLayout { - std::array table; - u32 count; -}; -constexpr u32 GLOBAL_POINTER_LAYOUT_OFFSET = 64; constexpr u32 RESCALING_LAYOUT_WORDS_OFFSET = offsetof(RescalingLayout, rescaling_textures); constexpr u32 RESCALING_LAYOUT_DOWN_FACTOR_OFFSET = offsetof(RescalingLayout, down_factor); constexpr u32 RENDERAREA_LAYOUT_OFFSET = offsetof(RenderAreaLayout, render_area); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index 6906f42d09..f174251625 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -486,9 +486,9 @@ EmitContext::EmitContext(const Profile& profile_, const RuntimeInfo& runtime_inf DefineTextures(program.info, texture_binding, bindings.texture_scaling_index); DefineImages(program.info, image_binding, bindings.image_scaling_index); DefineAttributeMemAccess(program.info); + DefineGlobalMemoryFunctions(program); DefineRescalingInput(program.info); DefineRenderArea(program.info); - DefineGlobalMemoryFunctions(program); } EmitContext::~EmitContext() = default; @@ -911,48 +911,12 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { if (!info.uses_global_memory || !profile.support_int64) { return; } - struct Access { - const StorageDefinitions* ssbo; - Id word; - Id address; - }; const Id zero{u32_zero_value}; const Id scope{Const(static_cast(spv::Scope::Device))}; const Id align_mask{Const(~(static_cast(profile.min_ssbo_alignment) - 1U))}; - Id physical_u32{}; - Id physical_u32x4{}; - if (uses_global_pointers) { - AddCapability(spv::Capability::PhysicalStorageBufferAddresses); - AddExtension("SPV_KHR_physical_storage_buffer"); - SetMemoryModel(spv::AddressingModel::PhysicalStorageBuffer64, spv::MemoryModel::GLSL450); - physical_u32 = TypePointer(spv::StorageClass::PhysicalStorageBuffer, U32[1]); - physical_u32x4 = TypePointer(spv::StorageClass::PhysicalStorageBuffer, U32[4]); - } - const auto word_pointer{[&](const Access& access, u32 element) { - if (access.ssbo) { - return OpAccessChain(storage_types.U32.element, access.ssbo->U32, zero, - OpIAdd(U32[1], access.word, Const(element))); - } - return OpConvertUToPtr(physical_u32, - OpIAdd(U64, access.address, Constant(U64, u64{element} * 4))); - }}; - const auto load_word{[&](const Access& access, u32 element) { - if (access.ssbo) { - return OpLoad(U32[1], word_pointer(access, element)); - } - return OpLoad(U32[1], word_pointer(access, element), spv::MemoryAccessMask::Aligned, 4U); - }}; - const auto store_word{[&](const Access& access, u32 element, Id value) { - if (access.ssbo) { - OpStore(word_pointer(access, element), value); - return; - } - OpStore(word_pointer(access, element), value, spv::MemoryAccessMask::Aligned, 4U); - }}; - const auto load_entry{[&](Id address) { - const Id entry{OpLoad(U32[4], OpConvertUToPtr(physical_u32x4, address), - spv::MemoryAccessMask::Aligned, 16U)}; - return std::pair{entry, OpBitcast(U64, OpVectorShuffle(U32[2], entry, entry, 0U, 1U))}; + const auto word_pointer{[&](Id ssbo, Id word, u32 element) { + return OpAccessChain(storage_types.U32.element, ssbo, zero, + OpIAdd(U32[1], word, Const(element))); }}; const auto cbuf_word{[&](u32 index, u32 offset) { if (profile.support_descriptor_aliasing) { @@ -974,19 +938,7 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { const Id addr{OpFunctionParameter(U64)}; const Id value{OpFunctionParameter(value_type)}; const bool returns_value{result_type.value != void_id.value}; - const auto finish{[&](Id result) { - if (returns_value) { - OpReturnValue(result); - } else { - OpReturn(); - } - }}; AddLabel(); - Id entry_index{}; - if (uses_global_pointers) { - entry_index = AddLocalVariable(TypePointer(spv::StorageClass::Function, U32[1]), - spv::StorageClass::Function, zero); - } const Id addr_words{OpBitcast(U32[2], addr)}; const Id addr_low{OpCompositeExtract(U32[1], addr_words, 0U)}; const Id addr_high{OpCompositeExtract(U32[1], addr_words, 1U)}; @@ -995,7 +947,8 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { if (!desc.is_global_fallback) { continue; } - const Id ssbo_low{cbuf_word(desc.cbuf_index, desc.cbuf_offset)}; + const Id ssbo_low{ + OpBitwiseAnd(U32[1], cbuf_word(desc.cbuf_index, desc.cbuf_offset), align_mask)}; const Id ssbo_high{cbuf_word(desc.cbuf_index, desc.cbuf_offset + 4)}; const Id ssbo_size{cbuf_word(desc.cbuf_index, desc.cbuf_offset + 8)}; const Id offset{OpISub(U32[1], addr_low, ssbo_low)}; @@ -1008,55 +961,15 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { OpSelectionMerge(else_label, spv::SelectionControlMask::MaskNone); OpBranchConditional(cond, then_label, else_label); AddLabel(then_label); - const Id aligned_offset{ - OpISub(U32[1], addr_low, OpBitwiseAnd(U32[1], ssbo_low, align_mask))}; - const Id word{OpShiftRightLogical(U32[1], aligned_offset, Const(2U))}; - finish(callback(Access{&ssbos[index], word, Id{}}, aligned_offset, value)); + const Id word{OpShiftRightLogical(U32[1], offset, Const(2U))}; + const Id result{callback(ssbos[index], word, offset, value)}; + if (returns_value) { + OpReturnValue(result); + } else { + OpReturn(); + } AddLabel(else_label); } - if (uses_global_pointers) { - const Id table_pointer{ - OpAccessChain(TypePointer(spv::StorageClass::PushConstant, U32[2]), - rescaling_push_constants, Const(global_pointer_member_index))}; - const Id count_pointer{ - OpAccessChain(TypePointer(spv::StorageClass::PushConstant, U32[1]), - rescaling_push_constants, Const(global_pointer_member_index + 1))}; - const Id table{OpBitcast(U64, OpLoad(U32[2], table_pointer))}; - const Id count{OpLoad(U32[1], count_pointer)}; - const Id header_label{OpLabel()}; - const Id body_label{OpLabel()}; - const Id hit_label{OpLabel()}; - const Id skip_label{OpLabel()}; - const Id continue_label{OpLabel()}; - const Id merge_label{OpLabel()}; - OpBranch(header_label); - AddLabel(header_label); - const Id entry{OpLoad(U32[1], entry_index)}; - const Id in_table{OpULessThan(U1, entry, count)}; - OpLoopMerge(merge_label, continue_label, spv::LoopControlMask::MaskNone); - OpBranchConditional(in_table, body_label, merge_label); - AddLabel(body_label); - const Id entry_address{OpIAdd( - U64, table, OpUConvert(U64, OpShiftLeftLogical(U32[1], entry, Const(5U))))}; - const auto [guest, guest_base]{load_entry(entry_address)}; - const Id guest_offset{OpISub(U64, addr, guest_base)}; - const Id guest_size{OpUConvert(U64, OpCompositeExtract(U32[1], guest, 2U))}; - const Id hit{OpULessThan(U1, guest_offset, guest_size)}; - OpSelectionMerge(skip_label, spv::SelectionControlMask::MaskNone); - OpBranchConditional(hit, hit_label, skip_label); - AddLabel(hit_label); - const Id host_base{ - load_entry(OpIAdd(U64, entry_address, Constant(U64, u64{16}))).second}; - const Id target{OpBitwiseAnd(U64, OpIAdd(U64, host_base, guest_offset), - Constant(U64, ~u64{3}))}; - finish(callback(Access{nullptr, Id{}, target}, addr_low, value)); - AddLabel(skip_label); - OpBranch(continue_label); - AddLabel(continue_label); - OpStore(entry_index, OpIAdd(U32[1], entry, Const(1U))); - OpBranch(header_label); - AddLabel(merge_label); - } if (returns_value) { OpReturnValue(ConstantNull(result_type)); } else { @@ -1074,13 +987,13 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { OpShiftRightLogical(U32[1], word, Const(2U))); }}; const auto load{[&](Id type, u32 count) { - return [&, type, count](const Access& access, Id, Id) { - if (count > 1 && access.ssbo && profile.support_descriptor_aliasing) { - return OpLoad(type, vector_pointer(*access.ssbo, access.word, count)); + return [&, type, count](const StorageDefinitions& ssbo, Id word, Id, Id) { + if (count > 1 && profile.support_descriptor_aliasing) { + return OpLoad(type, vector_pointer(ssbo, word, count)); } std::array words{}; for (u32 element = 0; element < count; ++element) { - words[element] = load_word(access, element); + words[element] = OpLoad(U32[1], word_pointer(ssbo.U32, word, element)); } if (count == 1) { return words[0]; @@ -1089,24 +1002,25 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { }; }}; const auto store{[&](u32 count) { - return [&, count](const Access& access, Id, Id value) { - if (count > 1 && access.ssbo && profile.support_descriptor_aliasing) { - OpStore(vector_pointer(*access.ssbo, access.word, count), value); + return [&, count](const StorageDefinitions& ssbo, Id word, Id, Id value) { + if (count > 1 && profile.support_descriptor_aliasing) { + OpStore(vector_pointer(ssbo, word, count), value); return Id{}; } if (count == 1) { - store_word(access, 0, value); + OpStore(word_pointer(ssbo.U32, word, 0), value); return Id{}; } for (u32 element = 0; element < count; ++element) { - store_word(access, element, OpCompositeExtract(U32[1], value, element)); + OpStore(word_pointer(ssbo.U32, word, element), + OpCompositeExtract(U32[1], value, element)); } return Id{}; }; }}; const auto extract{[&](bool is_signed, u32 count) { - return [&, is_signed, count](const Access& access, Id offset, Id) { - const Id loaded{load_word(access, 0)}; + return [&, is_signed, count](const StorageDefinitions& ssbo, Id word, Id offset, Id) { + const Id loaded{OpLoad(U32[1], word_pointer(ssbo.U32, word, 0))}; if (is_signed) { return OpBitFieldSExtract(U32[1], loaded, bits(offset, count), Const(count)); } @@ -1114,36 +1028,28 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { }; }}; const auto insert{[&](u32 count) { - return [&, count](const Access& access, Id offset, Id value) { - AtomicBitFieldInsert(word_pointer(access, 0), value, bits(offset, count), + return [&, count](const StorageDefinitions& ssbo, Id word, Id offset, Id value) { + AtomicBitFieldInsert(word_pointer(ssbo.U32, word, 0), value, bits(offset, count), Const(count)); return Id{}; }; }}; const auto atomic{[&](Id (Sirit::Module::*func)(Id, Id, Id, Id, Id)) { - return [&, func](const Access& access, Id, Id value) { - return (this->*func)(U32[1], word_pointer(access, 0), scope, zero, value); + return [&, func](const StorageDefinitions& ssbo, Id word, Id, Id value) { + return (this->*func)(U32[1], word_pointer(ssbo.U32, word, 0), scope, zero, value); }; }}; const auto cas{[&](Id type, Id helper) { - return [&, type, helper](const Access& access, Id, Id value) { - if (!access.ssbo) { - return ConstantNull(type); - } - return OpFunctionCall(type, helper, access.word, value, access.ssbo->U32); + return [&, type, helper](const StorageDefinitions& ssbo, Id word, Id, Id value) { + return OpFunctionCall(type, helper, word, value, ssbo.U32); }; }}; const auto packed{[&](bool is_half, Id helper) { - return [&, is_half, helper](const Access& access, Id, Id value) { - if (!access.ssbo) { - return ConstantNull(U32[1]); - } - const Id ssbo{access.ssbo->U32}; + return [&, is_half, helper](const StorageDefinitions& ssbo, Id word, Id, Id value) { if (is_half) { - return OpBitcast(U32[1], OpFunctionCall(F16[2], helper, access.word, value, ssbo)); + return OpBitcast(U32[1], OpFunctionCall(F16[2], helper, word, value, ssbo.U32)); } - return OpPackHalf2x16(U32[1], - OpFunctionCall(F32[2], helper, access.word, value, ssbo)); + return OpPackHalf2x16(U32[1], OpFunctionCall(F32[2], helper, word, value, ssbo.U32)); }; }}; for (const IR::Block* const block : program.post_order_blocks) { @@ -1253,9 +1159,7 @@ void EmitContext::DefineGlobalMemoryFunctions(const IR::Program& program) { } void EmitContext::DefineRescalingInput(const Info& info) { - uses_global_pointers = info.uses_global_pointers && profile.support_buffer_device_address && - profile.support_int64 && profile.unified_descriptor_binding; - if (!info.uses_rescaling_uniform && !uses_global_pointers) { + if (!info.uses_rescaling_uniform) { return; } if (profile.unified_descriptor_binding) { @@ -1266,7 +1170,7 @@ void EmitContext::DefineRescalingInput(const Info& info) { } void EmitContext::DefineRescalingInputPushConstant() { - boost::container::static_vector members{}; + boost::container::static_vector members{}; u32 member_index{0}; rescaling_textures_type = TypeArray(U32[1], Const(4u)); @@ -1283,11 +1187,6 @@ void EmitContext::DefineRescalingInputPushConstant() { members.push_back(F32[1]); rescaling_downfactor_member_index = member_index++; } - if (uses_global_pointers) { - members.push_back(U32[2]); - members.push_back(U32[1]); - global_pointer_member_index = member_index; - } const Id push_constant_struct{TypeStruct(std::span(members.data(), members.size()))}; Decorate(push_constant_struct, spv::Decoration::Block); Name(push_constant_struct, "ResolutionInfo"); @@ -1306,14 +1205,6 @@ void EmitContext::DefineRescalingInputPushConstant() { static_cast(offsetof(RescalingLayout, down_factor))); MemberName(push_constant_struct, rescaling_downfactor_member_index, "down_factor"); } - if (uses_global_pointers) { - MemberDecorate(push_constant_struct, global_pointer_member_index, spv::Decoration::Offset, - GLOBAL_POINTER_LAYOUT_OFFSET); - MemberDecorate(push_constant_struct, global_pointer_member_index + 1, - spv::Decoration::Offset, - GLOBAL_POINTER_LAYOUT_OFFSET + - static_cast(offsetof(GlobalPointerLayout, count))); - } const Id pointer_type{TypePointer(spv::StorageClass::PushConstant, push_constant_struct)}; rescaling_push_constants = AddGlobalVariable(pointer_type, spv::StorageClass::PushConstant); Name(rescaling_push_constants, "rescaling_push_constants"); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index 904686e2c7..68761e1f1a 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -307,8 +307,6 @@ public: u32 rescaling_textures_member_index{}; u32 rescaling_images_member_index{}; u32 rescaling_downfactor_member_index{}; - u32 global_pointer_member_index{}; - bool uses_global_pointers{}; u32 texture_rescaling_index{}; u32 image_rescaling_index{}; diff --git a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp index 339b6aabd1..bf40b0695b 100644 --- a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp +++ b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp @@ -56,7 +56,6 @@ struct StorageInfo { StorageBufferSet set; StorageInstVector to_replace; StorageWritesSet writes; - bool pointers{}; }; /// Returns true when the instruction is a global memory instruction @@ -336,8 +335,7 @@ std::optional TrackLowAddress(IR::Inst* inst) { } /// Tries to track the storage buffer address used by a global memory instruction -StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStores& local_stores, - bool& from_memory) { +StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStores& local_stores) { const auto pred{[bias](const IR::Inst* inst) -> std::optional { if (inst->GetOpcode() != IR::Opcode::GetCbufU32 && inst->GetOpcode() != IR::Opcode::GetCbufU32x2) { @@ -388,8 +386,6 @@ StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStor } switch (inst->GetOpcode()) { case IR::Opcode::LoadLocal: - from_memory |= - !inst->Arg(0).IsImmediate() || !local_stores.contains(inst->Arg(0).U32()); if (inst->Arg(0).IsImmediate()) { const auto [begin, end]{local_stores.equal_range(inst->Arg(0).U32())}; for (auto it = begin; it != end; ++it) { @@ -409,7 +405,6 @@ StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStor case IR::Opcode::GetCbufU32: case IR::Opcode::GetCbufF32: case IR::Opcode::GetCbufU32x2: - continue; case IR::Opcode::LoadSharedU8: case IR::Opcode::LoadSharedS8: case IR::Opcode::LoadSharedU16: @@ -417,13 +412,11 @@ StorageBufferSet Track(const IR::Value& value, const Bias* bias, const LocalStor case IR::Opcode::LoadSharedU32: case IR::Opcode::LoadSharedU64: case IR::Opcode::LoadSharedU128: - from_memory = true; continue; default: break; } if (IsGlobalMemory(*inst) || inst->MayHaveSideEffects()) { - from_memory = true; continue; } for (size_t arg = 0; arg < inst->NumArgs(); ++arg) { @@ -464,21 +457,18 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info, const std::optional low_addr_info{TrackLowAddress(&inst)}; if (!low_addr_info) { // Failed to track the low address, use NVN fallbacks - info.pointers = true; return; } // First try to find storage buffers in the NVN address const IR::U32 low_addr{low_addr_info->value}; - bool from_memory{}; - StorageBufferSet candidates{Track(low_addr, &nvn_bias, local_stores, from_memory)}; + StorageBufferSet candidates{Track(low_addr, &nvn_bias, local_stores)}; if (candidates.empty()) { // If it fails, track without a bias - candidates = Track(low_addr, nullptr, local_stores, from_memory); + candidates = Track(low_addr, nullptr, local_stores); } if (candidates.size() != 1) { // If that also fails, use NVN fallbacks LOG_WARNING(Shader, "Storage buffer failed to track, using global memory fallbacks"); - info.pointers |= from_memory; return; } const StorageBufferAddr storage_buffer{*candidates.begin()}; @@ -625,7 +615,6 @@ void GlobalMemoryToStorageBufferPass(IR::Program& program, const HostTranslateIn .is_written = info.writes.contains(storage_buffer), }); } - program.info.uses_global_pointers = info.pointers; for (const StorageInst& storage_inst : info.to_replace) { const StorageBufferAddr storage_buffer{storage_inst.storage_buffer}; const auto it{info.set.find(storage_inst.storage_buffer)}; @@ -639,7 +628,6 @@ void GlobalMemoryToStorageBufferPass(IR::Program& program, const HostTranslateIn } void JoinStorageInfo(Info& base, Info& source) { - base.uses_global_pointers |= source.uses_global_pointers; auto& descriptors = base.storage_buffers_descriptors; for (auto& desc : source.storage_buffers_descriptors) { auto it{std::ranges::find_if(descriptors, [&desc](const auto& existing) { diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index 3b5b159384..8e9c83f888 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h @@ -47,7 +47,6 @@ struct Profile { bool support_typeless_image_loads{}; bool support_demote_to_helper_invocation{}; bool support_int64_atomics{}; - bool support_buffer_device_address{}; bool support_shared_int64_atomics{}; bool support_derivative_control{}; bool support_geometry_shader_passthrough{}; diff --git a/src/shader_recompiler/shader_info.h b/src/shader_recompiler/shader_info.h index 6729b338b5..b8d760a30e 100644 --- a/src/shader_recompiler/shader_info.h +++ b/src/shader_recompiler/shader_info.h @@ -312,7 +312,6 @@ struct Info { bool uses_atomic_s32_max{}; bool uses_int64_bit_atomics{}; bool uses_global_memory{}; - bool uses_global_pointers{}; bool uses_atomic_image_u32{}; bool uses_shadow_lod{}; bool uses_rescaling_uniform{}; diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 5ab5a6f4f3..087d7ac1f8 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -123,8 +123,6 @@ void BufferCache

::TickFrame() { if (total_used_memory >= minimum_memory || heap_pressure) { RunGarbageCollector(); } - std::erase_if(pointer_ranges, - [this](const PointerRange& range) { return range.frame + 2 < frame_tick; }); ++frame_tick; delayed_destruction_ring.Tick(); @@ -1146,7 +1144,6 @@ void BufferCache

::BindHostGraphicsStorageBuffers(size_t stage) { if (is_written) { MarkWrittenBuffer(binding.buffer_id, binding.device_addr, size); - RecordPointerRange(binding); } if constexpr (NEEDS_BIND_STORAGE_INDEX) { @@ -1287,7 +1284,6 @@ void BufferCache

::BindHostComputeStorageBuffers() { if (is_written) { MarkWrittenBuffer(binding.buffer_id, binding.device_addr, size); - RecordPointerRange(binding); } if constexpr (NEEDS_BIND_STORAGE_INDEX) { @@ -1345,7 +1341,6 @@ void BufferCache

::DoUpdateGraphicsBuffers(bool is_indexed) { if (current_draw_indirect) { UpdateDrawIndirect(); } - UpdatePointerRanges(); }); } @@ -1356,7 +1351,6 @@ void BufferCache

::DoUpdateComputeBuffers() { UpdateComputeUniformBuffers(); UpdateComputeStorageBuffers(); UpdateComputeTextureBuffers(); - UpdatePointerRanges(); }); } @@ -1502,72 +1496,6 @@ void BufferCache

::UpdateStorageBuffers(size_t stage) { }); } -template -void BufferCache

::UpdatePointerRanges() { - if (!pointer_table_requested) { - return; - } - for (PointerRange& range : pointer_ranges) { - range.buffer_id = NULL_BUFFER_ID; - if (gpu_memory->GpuToCpuAddress(range.gpu_addr) == range.device_addr) { - range.buffer_id = FindBuffer(range.device_addr, range.size, false); - } - } -} - -template -void BufferCache

::RecordPointerRange(const Binding& binding) { - if (!record_pointer_ranges) { - return; - } - const auto it = std::ranges::find(pointer_ranges, binding.gpu_addr, &PointerRange::gpu_addr); - if (it != pointer_ranges.end()) { - it->device_addr = binding.device_addr; - it->size = (std::max)(it->size, binding.size); - it->frame = frame_tick; - return; - } - if (pointer_ranges.size() < MAX_POINTER_RANGES) { - pointer_ranges.push_back({binding.gpu_addr, binding.device_addr, binding.size, frame_tick, - NULL_BUFFER_ID}); - } -} - -template -void BufferCache

::RequestPointerTable(bool enable) noexcept { - pointer_table_requested = enable; - record_pointer_ranges |= enable; -} - -template -std::array BufferCache

::BindHostPointerTable(bool is_written) { - std::array table{}; - if constexpr (!IS_OPENGL) { - const size_t capacity = (std::max)(pointer_ranges.size(), size_t{1}); - const auto upload = runtime.UploadStagingBuffer(capacity * sizeof(std::array)); - u32 count = 0; - for (const PointerRange& range : pointer_ranges) { - if (range.buffer_id == NULL_BUFFER_ID) { - continue; - } - Buffer& buffer = slot_buffers[range.buffer_id]; - TouchBuffer(buffer, range.buffer_id); - SynchronizeBuffer(buffer, range.device_addr, range.size); - if (is_written) { - MarkWrittenBuffer(range.buffer_id, range.device_addr, range.size); - } - const u64 host_address = buffer.DeviceAddress() + buffer.Offset(range.device_addr); - const std::array entry{range.gpu_addr, range.size, host_address, 0}; - std::memcpy(upload.mapped_span.data() + count * sizeof(entry), entry.data(), - sizeof(entry)); - ++count; - } - const u64 address = upload.device_address + upload.offset; - table = {static_cast(address), static_cast(address >> 32), count}; - } - return table; -} - template void BufferCache

::UpdateTextureBuffers(size_t stage) { ForEachEnabledBit(channel_state->enabled_texture_buffers[stage], [&](u32 index) { diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index b7802d5f76..d1f9ff5f97 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -270,10 +270,6 @@ public: void BindHostComputeBuffers(); - void RequestPointerTable(bool enable) noexcept; - - [[nodiscard]] std::array BindHostPointerTable(bool is_written); - void SetUniformBuffersState(const std::array& mask, const UniformBufferSizes* sizes); @@ -435,10 +431,6 @@ private: void UpdateStorageBuffers(size_t stage); - void UpdatePointerRanges(); - - void RecordPointerRange(const Binding& binding); - void UpdateTextureBuffers(size_t stage); void UpdateTransformFeedbackBuffers(); @@ -571,17 +563,6 @@ private: std::vector graphics_segments; std::vector compute_segments; u64 frame_tick = 0; - struct PointerRange { - GPUVAddr gpu_addr; - DAddr device_addr; - u32 size; - u64 frame; - BufferId buffer_id; - }; - static constexpr size_t MAX_POINTER_RANGES = 256; - std::vector pointer_ranges; - bool record_pointer_ranges = false; - bool pointer_table_requested = false; u64 total_used_memory = 0; u64 device_local_memory = 0; u64 minimum_memory = 0; diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index 3e4a4e40be..07de25f18f 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h @@ -243,13 +243,15 @@ public: } vk::PipelineLayout CreatePipelineLayout(VkDescriptorSetLayout descriptor_set_layout) const { - using Shader::Backend::SPIRV::GLOBAL_POINTER_LAYOUT_OFFSET; - using Shader::Backend::SPIRV::GlobalPointerLayout; + using Shader::Backend::SPIRV::RenderAreaLayout; + using Shader::Backend::SPIRV::RescalingLayout; + const u32 size_offset = is_compute ? sizeof(RescalingLayout::down_factor) : 0u; const VkPushConstantRange range{ .stageFlags = static_cast( is_compute ? VK_SHADER_STAGE_COMPUTE_BIT : VK_SHADER_STAGE_ALL_GRAPHICS), .offset = 0, - .size = GLOBAL_POINTER_LAYOUT_OFFSET + static_cast(sizeof(GlobalPointerLayout)), + .size = static_cast(sizeof(RescalingLayout)) - size_offset + + static_cast(sizeof(RenderAreaLayout)), }; return device->GetLogical().CreatePipelineLayout({ .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index 755c6611be..840ff5897b 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp @@ -28,7 +28,6 @@ namespace Vulkan { using Shader::ImageBufferDescriptor; -using Shader::Backend::SPIRV::GLOBAL_POINTER_LAYOUT_OFFSET; using Shader::Backend::SPIRV::RESCALING_LAYOUT_WORDS_OFFSET; using Tegra::Texture::TexturePair; @@ -246,14 +245,8 @@ bool ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, std::ranges::for_each(info.texture_buffer_descriptors, add_buffer); std::ranges::for_each(info.image_buffer_descriptors, add_buffer); - const bool uses_pointers{info.uses_global_pointers && device.IsBufferDeviceAddressSupported()}; - buffer_cache.RequestPointerTable(uses_pointers); buffer_cache.UpdateComputeBuffers(); buffer_cache.BindHostComputeBuffers(); - std::array pointer_table{}; - if (uses_pointers) { - pointer_table = buffer_cache.BindHostPointerTable(info.stores_global_memory); - } RescalingPushConstant rescaling; const VideoCommon::SamplerId* samplers_it{samplers.data()}; @@ -295,7 +288,7 @@ bool ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, const bool is_rescaling = !info.texture_descriptors.empty() || !info.image_descriptors.empty(); scheduler.Record([this, descriptor_data, is_rescaling, descriptor_buffer_offset, - descriptor_buffer_chunk, bind_descriptor_buffer, uses_pointers, pointer_table, + descriptor_buffer_chunk, bind_descriptor_buffer, rescaling_data = rescaling.Data()](vk::CommandBuffer cmdbuf) { if (bind_descriptor_buffer) { const VkDescriptorBufferBindingInfoEXT binding_info{ @@ -306,11 +299,6 @@ bool ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, return; } cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline); - if (uses_pointers) { - cmdbuf.PushConstants(*pipeline_layout, VK_SHADER_STAGE_COMPUTE_BIT, - GLOBAL_POINTER_LAYOUT_OFFSET, sizeof(pointer_table), - pointer_table.data()); - } if (!descriptor_set_layout) { return; } diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 354bcfa06f..0a8a2af973 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -41,7 +41,6 @@ namespace { using boost::container::small_vector; using boost::container::static_vector; using Shader::ImageBufferDescriptor; -using Shader::Backend::SPIRV::GLOBAL_POINTER_LAYOUT_OFFSET; using Shader::Backend::SPIRV::RENDERAREA_LAYOUT_OFFSET; using Shader::Backend::SPIRV::RESCALING_LAYOUT_DOWN_FACTOR_OFFSET; using Shader::Backend::SPIRV::RESCALING_LAYOUT_WORDS_OFFSET; @@ -302,9 +301,6 @@ GraphicsPipeline::GraphicsPipeline( num_image_elements += Shader::NumDescriptors(info->texture_descriptors); num_image_elements += Shader::NumDescriptors(info->image_descriptors); num_descriptor_entries += NumDescriptorEntries(*info); - uses_global_pointers |= - info->uses_global_pointers && device.IsBufferDeviceAddressSupported(); - stores_global_pointers |= info->stores_global_memory; } fragment_has_color0_output = stage_infos[NUM_STAGES - 1].stores_frag_color[0]; @@ -540,7 +536,6 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { scheduler.RequestOutsideRenderPassOperationContext(); } - buffer_cache.RequestPointerTable(uses_global_pointers); buffer_cache.UpdateGraphicsBuffers(is_indexed); buffer_cache.BindHostGeometryBuffers(is_indexed); @@ -576,9 +571,6 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { if constexpr (Spec::enabled_stages[4]) { prepare_stage(4); } - if (uses_global_pointers) { - pointer_table = buffer_cache.BindHostPointerTable(stores_global_pointers); - } texture_cache.UpdateRenderTargets(false); texture_cache.CheckFeedbackLoop(std::span{views.data(), views.size()}); @@ -664,8 +656,7 @@ bool GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling, descriptor_buffer_offset, descriptor_buffer_chunk, bind_descriptor_buffer, rescaling_data = rescaling.Data(), is_rescaling, update_rescaling, uses_render_area = render_area.uses_render_area, - render_area_data = render_area.words, - table = pointer_table](vk::CommandBuffer cmdbuf) { + render_area_data = render_area.words](vk::CommandBuffer cmdbuf) { if (bind_descriptor_buffer) { const VkDescriptorBufferBindingInfoEXT binding_info{ descriptor_buffer_ring.BindingInfo(descriptor_buffer_chunk)}; @@ -692,10 +683,6 @@ bool GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling, RENDERAREA_LAYOUT_OFFSET, sizeof(render_area_data), &render_area_data); } - if (uses_global_pointers) { - cmdbuf.PushConstants(*pipeline_layout, VK_SHADER_STAGE_ALL_GRAPHICS, - GLOBAL_POINTER_LAYOUT_OFFSET, sizeof(table), table.data()); - } if (!descriptor_set_layout) { return; } diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 26c28d536e..1371e8ee06 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -168,9 +168,6 @@ private: size_t num_image_elements{}; u32 num_textures{}; bool fragment_has_color0_output{}; - bool uses_global_pointers{}; - bool stores_global_pointers{}; - std::array pointer_table{}; vk::DescriptorSetLayout descriptor_set_layout; DescriptorAllocator descriptor_allocator; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 3d0905d221..dd55b576e8 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -421,7 +421,6 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, .support_demote_to_helper_invocation = device.IsExtShaderDemoteToHelperInvocationSupported(), .support_int64_atomics = device.IsExtShaderAtomicInt64Supported(), - .support_buffer_device_address = device.IsBufferDeviceAddressSupported(), .support_shared_int64_atomics = device.IsSharedInt64AtomicsSupported(), .support_derivative_control = true, .support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(), From 63fc150635224c2335d2f70839b2b42562a50ece Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 00:22:27 -0400 Subject: [PATCH 132/198] Addresing some problems with TFB and DR --- src/video_core/renderer_vulkan/vk_query_cache.cpp | 10 +--------- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 13 ++++++++----- src/video_core/renderer_vulkan/vk_scheduler.cpp | 4 +++- src/video_core/vulkan_common/vulkan_device.cpp | 5 +++++ src/video_core/vulkan_common/vulkan_device.h | 6 ++++-- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index af8a0502b8..8b545b327d 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -930,16 +930,7 @@ private: }); return; } - static constexpr VkMemoryBarrier2 COUNTER_RESUME_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT, - .srcAccessMask = VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT, - .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT, - .dstAccessMask = VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT, - }; scheduler.Record([this, total = static_cast(buffers_count)](vk::CommandBuffer cmdbuf) { - cmdbuf.PipelineBarrier(COUNTER_RESUME_BARRIER); cmdbuf.BeginTransformFeedbackEXT(0, total, counter_buffers.data(), offsets.data()); }); } @@ -963,6 +954,7 @@ private: }); } else { LOG_DEBUG(Render_Vulkan, "EndTransformFeedbackEXT called with counters (buffers_count={})", buffers_count); + scheduler.MarkRenderPassWrites(); scheduler.Record([this, total = static_cast(buffers_count)](vk::CommandBuffer cmdbuf) { cmdbuf.EndTransformFeedbackEXT(0, total, counter_buffers.data(), offsets.data()); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 835aacf675..4bc513172e 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -390,12 +390,14 @@ void RasterizerVulkan::DrawTexture() { } UpdateDynamicStates(dynamic_vertex_input); - query_cache.NotifySegment(true); - query_cache.CounterEnable(VideoCommon::QueryType::ZPassPixelCount64, maxwell3d->regs.zpass_pixel_count_enable); const auto& draw_texture_state = maxwell3d->draw_manager.draw_texture_state; const auto& sampler = texture_cache.GetSampler(draw_texture_state.src_sampler, false); const auto& texture = texture_cache.GetImageView(draw_texture_state.src_texture); const auto* framebuffer = texture_cache.GetFramebuffer(); + scheduler.RequestRenderpass(framebuffer, 0, 0); + query_cache.NotifySegment(true); + query_cache.CounterEnable(VideoCommon::QueryType::ZPassPixelCount64, + maxwell3d->regs.zpass_pixel_count_enable); const bool src_rescaling = texture_cache.IsRescaling() && texture.IsRescaled(); const bool dst_rescaling = texture_cache.IsRescaling() && framebuffer->IsRescaled(); @@ -519,14 +521,15 @@ void RasterizerVulkan::Clear(u32 layer_count) { clear_rect.rect.extent.height >= render_area.height; const bool can_defer_clear = ENABLE_DEFERRED_CLEAR && (!regs.clear_control.use_scissor || clear_covers_render_area) && regs.clear_surface.layer == 0 && + layer_count >= framebuffer->Attachments().layers && !scheduler.IsRenderPassActive() && (!use_color || color_full_channels) && ds_deferrable; if (!can_defer_clear) { scheduler.RequestRenderpass(framebuffer); + query_cache.NotifySegment(true); + query_cache.CounterEnable(VideoCommon::QueryType::ZPassPixelCount64, + maxwell3d->regs.zpass_pixel_count_enable); } - - query_cache.NotifySegment(true); - query_cache.CounterEnable(VideoCommon::QueryType::ZPassPixelCount64, maxwell3d->regs.zpass_pixel_count_enable); UpdateViewportsState(regs); const u32 color_attachment = regs.clear_surface.RT; diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 36f0bef803..22debf0b28 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -71,7 +71,9 @@ Scheduler::Scheduler(const Device& device_, StateTracker& state_tracker_) upload_write_barrier.srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT; if (device.IsExtTransformFeedbackSupported()) { renderpass_write_barrier.srcStageMask |= VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT; - renderpass_write_barrier.srcAccessMask |= VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT; + renderpass_write_barrier.srcAccessMask |= + VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT | + VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT; } AcquireNewChunk(); diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 76bfe29fdf..bac558f4bb 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1212,6 +1212,11 @@ void Device::RemoveUnsuitableExtensions() { RemoveExtensionFeatureIfUnsuitable(extensions.color_write_enable, features.color_write_enable, VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME); + extensions.conditional_rendering = features.conditional_rendering.conditionalRendering; + RemoveExtensionFeatureIfUnsuitable(extensions.conditional_rendering, + features.conditional_rendering, + VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME); + // VK_EXT_custom_border_color if (extensions.custom_border_color) { extensions.custom_border_color = diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index e023e95fc2..91e92c6441 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -57,6 +57,7 @@ VK_DEFINE_HANDLE(VmaAllocator) #define FOR_EACH_VK_FEATURE_EXT(FEATURE) \ FEATURE(EXT, BorderColorSwizzle, BORDER_COLOR_SWIZZLE, border_color_swizzle) \ FEATURE(EXT, ColorWriteEnable, COLOR_WRITE_ENABLE, color_write_enable) \ + FEATURE(EXT, ConditionalRendering, CONDITIONAL_RENDERING, conditional_rendering) \ FEATURE(EXT, CustomBorderColor, CUSTOM_BORDER_COLOR, custom_border_color) \ FEATURE(EXT, DepthBiasControl, DEPTH_BIAS_CONTROL, depth_bias_control) \ FEATURE(EXT, DepthClipControl, DEPTH_CLIP_CONTROL, depth_clip_control) \ @@ -87,7 +88,6 @@ VK_DEFINE_HANDLE(VmaAllocator) // Define miscellaneous extensions which may be used by the implementation here. #define FOR_EACH_VK_EXTENSION(EXTENSION) \ EXTENSION(EXT, ASTC_DECODE_MODE, astc_decode_mode) \ - EXTENSION(EXT, CONDITIONAL_RENDERING, conditional_rendering) \ EXTENSION(EXT, CONSERVATIVE_RASTERIZATION, conservative_rasterization) \ EXTENSION(EXT, DEPTH_RANGE_UNRESTRICTED, depth_range_unrestricted) \ EXTENSION(EXT, MEMORY_BUDGET, memory_budget) \ @@ -903,7 +903,9 @@ FN_MAX_LIMIT_LIST access |= VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT; } if (IsExtTransformFeedbackSupported()) { - access |= VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT; + access |= VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT | + VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT | + VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT; } return access; } From 41d8da16123648774acde7135e9bc94b358cee1d Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 00:47:14 -0400 Subject: [PATCH 133/198] Remove deferred clears --- .../renderer_opengl/gl_texture_cache.h | 2 - src/video_core/renderer_vulkan/blit_image.cpp | 28 +++++ .../renderer_vulkan/vk_graphics_pipeline.cpp | 3 + .../renderer_vulkan/vk_query_cache.cpp | 4 + .../renderer_vulkan/vk_query_cache.h | 2 + .../renderer_vulkan/vk_rasterizer.cpp | 87 +++++++------ .../renderer_vulkan/vk_scheduler.cpp | 119 ++++++------------ src/video_core/renderer_vulkan/vk_scheduler.h | 28 +---- .../renderer_vulkan/vk_texture_cache.cpp | 4 - .../renderer_vulkan/vk_texture_cache.h | 2 - src/video_core/texture_cache/texture_cache.h | 2 - 11 files changed, 122 insertions(+), 159 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 7c7ee14580..19a1b79cf8 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -75,8 +75,6 @@ public: void Finish(); - void FlushDeferredClear() {} - StagingBufferMap UploadStagingBuffer(size_t size); StagingBufferMap DownloadStagingBuffer(size_t size, bool deferred = false); diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 7b0b784ac6..6821ae9550 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -476,6 +476,23 @@ void RecordShaderReadBarrier(Scheduler& scheduler, const ImageView& image_view) }); } +void DiscardCoveredAttachments(Scheduler& scheduler, const Framebuffer* framebuffer, + const Region2D& region, bool writes_stencil) { + const VkExtent2D area = framebuffer->RenderArea(); + if ((std::min)(region.start.x, region.end.x) > 0 || + (std::min)(region.start.y, region.end.y) > 0 || + (std::max)(region.start.x, region.end.x) < static_cast(area.width) || + (std::max)(region.start.y, region.end.y) < static_cast(area.height) || + framebuffer->Attachments().layers != 1) { + return; + } + u32 attachments = 1u | Scheduler::DEPTH_ATTACHMENT_BIT; + if (writes_stencil) { + attachments |= Scheduler::STENCIL_ATTACHMENT_BIT; + } + scheduler.OverrideLoadOps(framebuffer, attachments, VK_ATTACHMENT_LOAD_OP_DONT_CARE, {}); +} + [[nodiscard]] VkSampleCountFlagBits SampleCountFlag(u32 num_samples) { switch (num_samples) { case 2: @@ -661,6 +678,7 @@ void BlitImageHelper::BlitImpl(const Framebuffer* dst_framebuffer, } RecordShaderReadBarrier(scheduler, src_image_view); + DiscardCoveredAttachments(scheduler, dst_framebuffer, dst_region, blit_stencil); scheduler.RequestRenderpass(dst_framebuffer); scheduler.Record([this, dst_region, src_region, pipeline, layout, sampler, src_view, src_stencil_view, blit_stencil](vk::CommandBuffer cmdbuf) { @@ -1067,8 +1085,13 @@ void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_frameb const VkImageView src_view = src_image_view.Handle(Shader::TextureType::Color2D); const VkSampler sampler = *nearest_sampler; const VkExtent2D extent = GetConversionExtent(src_image_view); + const Region2D region{ + .start = {0, 0}, + .end = {static_cast(extent.width), static_cast(extent.height)}, + }; RecordShaderReadBarrier(scheduler, src_image_view); + DiscardCoveredAttachments(scheduler, dst_framebuffer, region, false); scheduler.RequestRenderpass(dst_framebuffer); scheduler.Record([pipeline, layout, sampler, src_view, extent, this](vk::CommandBuffer cmdbuf) { const VkOffset2D offset{ @@ -1112,8 +1135,13 @@ void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer const VkImageView src_stencil_view = src_image_view.StencilView(); const VkSampler sampler = *nearest_sampler; const VkExtent2D extent = GetConversionExtent(src_image_view); + const Region2D region{ + .start = {0, 0}, + .end = {static_cast(extent.width), static_cast(extent.height)}, + }; RecordShaderReadBarrier(scheduler, src_image_view); + DiscardCoveredAttachments(scheduler, dst_framebuffer, region, false); scheduler.RequestRenderpass(dst_framebuffer); scheduler.Record([pipeline, layout, sampler, src_depth_view, src_stencil_view, extent, this](vk::CommandBuffer cmdbuf) { diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 0a8a2af973..5f6f525d1d 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -143,6 +143,9 @@ struct AttachmentAccess { AttachmentAccess MakeAttachmentAccess(const Maxwell& regs) { AttachmentAccess access{}; + if (regs.rasterize_enable == 0) { + return access; + } for (size_t index = 0; index < Maxwell::NumRenderTargets; ++index) { size_t mask_index = index; if (regs.color_mask_common) { diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 8b545b327d..5a574e289a 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -1402,6 +1402,10 @@ void QueryCacheRuntime::ResumeHostConditionalRendering() { impl->is_hcr_running = true; } +bool QueryCacheRuntime::IsHostConditionalRenderingSet() const noexcept { + return impl->hcr_is_set; +} + void QueryCacheRuntime::HostConditionalRenderingCompareValueImpl(VideoCommon::LookupData object, bool is_equal) { { diff --git a/src/video_core/renderer_vulkan/vk_query_cache.h b/src/video_core/renderer_vulkan/vk_query_cache.h index bbb5234e11..f89038f8b7 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.h +++ b/src/video_core/renderer_vulkan/vk_query_cache.h @@ -48,6 +48,8 @@ public: void ResumeHostConditionalRendering(); + [[nodiscard]] bool IsHostConditionalRenderingSet() const noexcept; + bool HostConditionalRenderingCompareValue(VideoCommon::LookupData object_1, bool qc_dirty); bool HostConditionalRenderingCompareValues(VideoCommon::LookupData object_1, diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 4bc513172e..27332f8129 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -445,15 +445,10 @@ void RasterizerVulkan::Clear(u32 layer_count) { const Framebuffer* const framebuffer = texture_cache.GetFramebuffer(); const VkExtent2D render_area = framebuffer->RenderArea(); - constexpr bool ENABLE_DEFERRED_CLEAR = true; const bool color_full_channels = regs.clear_surface.R && regs.clear_surface.G && regs.clear_surface.B && regs.clear_surface.A; const bool stencil_partial = use_stencil && framebuffer->HasAspectStencilBit() && regs.stencil_front_mask != 0xFF && regs.stencil_front_mask != 0; - const bool ds_used = use_depth || use_stencil; - const bool ds_deferrable = - !ds_used || ((!framebuffer->HasAspectDepthBit() || use_depth) && - (!framebuffer->HasAspectStencilBit() || use_stencil) && !stencil_partial); u32 up_scale = 1; u32 down_shift = 0; if (texture_cache.IsRescaling()) { @@ -519,17 +514,16 @@ void RasterizerVulkan::Clear(u32 layer_count) { clear_rect.rect.offset.x == 0 && clear_rect.rect.offset.y == 0 && clear_rect.rect.extent.width >= render_area.width && clear_rect.rect.extent.height >= render_area.height; - const bool can_defer_clear = ENABLE_DEFERRED_CLEAR && (!regs.clear_control.use_scissor || clear_covers_render_area) && - regs.clear_surface.layer == 0 && - layer_count >= framebuffer->Attachments().layers && - !scheduler.IsRenderPassActive() && - (!use_color || color_full_channels) && ds_deferrable; - if (!can_defer_clear) { + const bool clear_on_load = (!regs.clear_control.use_scissor || clear_covers_render_area) && + regs.clear_surface.layer == 0 && + layer_count >= framebuffer->Attachments().layers && + !query_cache_runtime.IsHostConditionalRenderingSet(); + const auto request_renderpass = [&] { scheduler.RequestRenderpass(framebuffer); query_cache.NotifySegment(true); query_cache.CounterEnable(VideoCommon::QueryType::ZPassPixelCount64, maxwell3d->regs.zpass_pixel_count_enable); - } + }; UpdateViewportsState(regs); const u32 color_attachment = regs.clear_surface.RT; @@ -549,26 +543,26 @@ void RasterizerVulkan::Clear(u32 layer_count) { clear_value.color.int32[i] = s32(f32(s64(int_size - 1) << 1) * (regs.clear_color[i] - 0.5f)); } - if (color_full_channels) { - if (can_defer_clear) { - scheduler.DeferColorClear(framebuffer, color_attachment, clear_value); - } else { - scheduler.Record([color_attachment, clear_value, clear_rect](vk::CommandBuffer cmdbuf) { - const VkClearAttachment attachment{ - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .colorAttachment = color_attachment, - .clearValue = clear_value, - }; - cmdbuf.ClearAttachments(attachment, clear_rect); - }); - } - } else { + if (!color_full_channels) { u8 color_mask = u8(regs.clear_surface.R | regs.clear_surface.G << 1 | regs.clear_surface.B << 2 | regs.clear_surface.A << 3); Region2D dst_region = { Offset2D{.x = clear_rect.rect.offset.x, .y = clear_rect.rect.offset.y}, Offset2D{.x = clear_rect.rect.offset.x + s32(clear_rect.rect.extent.width), .y = clear_rect.rect.offset.y + s32(clear_rect.rect.extent.height)}}; + request_renderpass(); blit_image.ClearColor(framebuffer, color_mask, regs.clear_color, dst_region); + } else if (!clear_on_load || + !scheduler.OverrideLoadOps(framebuffer, 1u << color_attachment, + VK_ATTACHMENT_LOAD_OP_CLEAR, clear_value)) { + request_renderpass(); + scheduler.Record([color_attachment, clear_value, clear_rect](vk::CommandBuffer cmdbuf) { + const VkClearAttachment attachment{ + .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, + .colorAttachment = color_attachment, + .clearValue = clear_value, + }; + cmdbuf.ClearAttachments(attachment, clear_rect); + }); } } @@ -576,41 +570,46 @@ void RasterizerVulkan::Clear(u32 layer_count) { return; } VkImageAspectFlags aspect_flags = 0; + u32 ds_attachments = 0; if (use_depth && framebuffer->HasAspectDepthBit()) { aspect_flags |= VK_IMAGE_ASPECT_DEPTH_BIT; + ds_attachments |= Scheduler::DEPTH_ATTACHMENT_BIT; } if (use_stencil && framebuffer->HasAspectStencilBit()) { aspect_flags |= VK_IMAGE_ASPECT_STENCIL_BIT; + ds_attachments |= Scheduler::STENCIL_ATTACHMENT_BIT; } if (aspect_flags == 0) { return; } - if (use_stencil && framebuffer->HasAspectStencilBit() && regs.stencil_front_mask != 0xFF && - regs.stencil_front_mask != 0) { + if (stencil_partial) { Region2D dst_region = { Offset2D{.x = clear_rect.rect.offset.x, .y = clear_rect.rect.offset.y}, Offset2D{.x = clear_rect.rect.offset.x + s32(clear_rect.rect.extent.width), .y = clear_rect.rect.offset.y + s32(clear_rect.rect.extent.height)}}; + request_renderpass(); blit_image.ClearDepthStencil(framebuffer, use_depth, regs.clear_depth, u8(regs.stencil_front_mask), regs.clear_stencil, regs.stencil_front_func_mask, dst_region); - } else if (can_defer_clear) { - VkClearValue ds_value{}; - ds_value.depthStencil.depth = regs.clear_depth; - ds_value.depthStencil.stencil = regs.clear_stencil; - scheduler.DeferDepthStencilClear(framebuffer, ds_value); - } else { - scheduler.Record([clear_depth = regs.clear_depth, clear_stencil = regs.clear_stencil, - clear_rect, aspect_flags](vk::CommandBuffer cmdbuf) { - VkClearAttachment attachment; - attachment.aspectMask = aspect_flags; - attachment.colorAttachment = 0; - attachment.clearValue.depthStencil.depth = clear_depth; - attachment.clearValue.depthStencil.stencil = clear_stencil; - cmdbuf.ClearAttachments(attachment, clear_rect); - }); + return; } + VkClearValue ds_value{}; + ds_value.depthStencil.depth = regs.clear_depth; + ds_value.depthStencil.stencil = regs.clear_stencil; + if (clear_on_load && scheduler.OverrideLoadOps(framebuffer, ds_attachments, + VK_ATTACHMENT_LOAD_OP_CLEAR, ds_value)) { + return; + } + request_renderpass(); + scheduler.Record([ds_value, clear_rect, aspect_flags](vk::CommandBuffer cmdbuf) { + const VkClearAttachment attachment{ + .aspectMask = aspect_flags, + .colorAttachment = 0, + .clearValue = ds_value, + }; + cmdbuf.ClearAttachments(attachment, clear_rect); + }); } void RasterizerVulkan::DispatchCompute() { @@ -1014,7 +1013,7 @@ void RasterizerVulkan::FlushWork() { draw_counter = 0; return; } - if ((draw_counter & CHECK_MASK) == CHECK_MASK) { + if ((draw_counter & CHECK_MASK) == CHECK_MASK && !scheduler.IsRenderPassActive()) { scheduler.DispatchWork(); } } diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 22debf0b28..b23a6f0c88 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -120,11 +120,12 @@ void Scheduler::DispatchWork() { } } -void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, - const RenderingAttachments& attachments) { +void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer) { + const RenderingAttachments& attachments = framebuffer->Attachments(); PublishComputeWrites(); state.framebuffer_id = framebuffer->Id(); ++renderpass_serial; + renderpass_pristine = true; attachments_touched = 0; attachments_written = 0; @@ -149,91 +150,48 @@ void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, framebuffer->MarkResolveShadowsUpToDate(); } -void Scheduler::RealizeDeferredClear() { - if (deferred_clear.framebuffer == nullptr) { - return; - } - const DeferredClear dc = deferred_clear; - deferred_clear = {}; - - RenderingAttachments attachments = dc.framebuffer->Attachments(); - for (u32 slot = 0; slot < attachments.num_colors; ++slot) { - if ((dc.color_clear_mask & (1u << slot)) == 0) { - continue; - } - VkRenderingAttachmentInfo& attachment = attachments.colors[slot]; - attachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; - attachment.clearValue = dc.color_values[slot]; - if (dc.framebuffer->DiscardsMsaaColor()) { - attachment.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; - } - } - if (dc.depth_stencil) { - for (VkRenderingAttachmentInfo* const attachment : - {&attachments.depth, &attachments.stencil}) { - attachment->loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; - attachment->clearValue = dc.depth_stencil_value; - if (dc.framebuffer->DiscardsMsaaDepthStencil()) { - attachment->storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; - } - } - } - EndRenderPass(); - BeginRenderPassImpl(dc.framebuffer, attachments); - if (dc.depth_stencil) { - attachments_written |= DEPTH_ATTACHMENT_BIT | STENCIL_ATTACHMENT_BIT; - } -} - -bool Scheduler::DeferColorClear(const Framebuffer* framebuffer, u32 rt_slot, - const VkClearValue& value) { - if (IsRenderPassActive()) { - return false; - } - if (deferred_clear.framebuffer != nullptr && deferred_clear.framebuffer != framebuffer) { - RealizeDeferredClear(); - EndRenderPass(); - } - deferred_clear.framebuffer = framebuffer; - deferred_clear.color_clear_mask |= 1u << rt_slot; - deferred_clear.color_values[rt_slot] = value; - return true; -} - -bool Scheduler::DeferDepthStencilClear(const Framebuffer* framebuffer, const VkClearValue& value) { - if (IsRenderPassActive()) { - return false; - } - if (deferred_clear.framebuffer != nullptr && deferred_clear.framebuffer != framebuffer) { - RealizeDeferredClear(); - EndRenderPass(); - } - deferred_clear.framebuffer = framebuffer; - deferred_clear.depth_stencil = true; - deferred_clear.depth_stencil_value = value; - return true; -} - -void Scheduler::FlushDeferredClear() { - if (deferred_clear.framebuffer == nullptr) { - return; - } - RealizeDeferredClear(); - EndRenderPass(); -} - void Scheduler::RequestRenderpass(const Framebuffer* framebuffer, u32 touched, u32 written) { - if (deferred_clear.framebuffer == framebuffer) { - RealizeDeferredClear(); - } else if (framebuffer->Id() != state.framebuffer_id) { - // Ends any active pass and realizes a deferred clear + if (framebuffer->Id() != state.framebuffer_id) { EndRenderPass(); - BeginRenderPassImpl(framebuffer, framebuffer->Attachments()); + BeginRenderPassImpl(framebuffer); } + renderpass_pristine = false; attachments_touched |= touched; attachments_written |= written; } +bool Scheduler::OverrideLoadOps(const Framebuffer* framebuffer, u32 attachments, + VkAttachmentLoadOp load_op, const VkClearValue& value) { + if (framebuffer->Id() != state.framebuffer_id) { + EndRenderPass(); + BeginRenderPassImpl(framebuffer); + } + if (!renderpass_pristine || recorded_attachments == nullptr) { + return false; + } + const auto set_load_op = [&](VkRenderingAttachmentInfo& attachment, bool discards_msaa) { + attachment.loadOp = load_op; + attachment.clearValue = value; + if (discards_msaa && load_op == VK_ATTACHMENT_LOAD_OP_CLEAR) { + attachment.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; + } + }; + for (u32 slot = 0; slot < recorded_attachments->num_colors; ++slot) { + if ((attachments & (1u << slot)) != 0) { + set_load_op(recorded_attachments->colors[slot], framebuffer->DiscardsMsaaColor()); + } + } + if ((attachments & DEPTH_ATTACHMENT_BIT) != 0) { + set_load_op(recorded_attachments->depth, framebuffer->DiscardsMsaaDepthStencil()); + } + if ((attachments & STENCIL_ATTACHMENT_BIT) != 0) { + set_load_op(recorded_attachments->stencil, framebuffer->DiscardsMsaaDepthStencil()); + } + attachments_touched |= attachments; + attachments_written |= attachments; + return true; +} + void Scheduler::RequestOutsideRenderPassOperationContext() { EndRenderPass(); PublishComputeWrites(); @@ -457,7 +415,6 @@ void Scheduler::EndPendingOperations() { void Scheduler::EndRenderPass() { - RealizeDeferredClear(); if (state.framebuffer_id == 0) { return; } diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index a4bd593f40..21385549ee 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -66,14 +66,8 @@ public: void RequestRenderpass(const Framebuffer* framebuffer, u32 touched = ALL_ATTACHMENTS, u32 written = ALL_ATTACHMENTS); - /// Defers a full-attachment color clear so it becomes the next render pass. - bool DeferColorClear(const Framebuffer* framebuffer, u32 rt_slot, const VkClearValue& value); - - /// Defers a full depth/stencil clear so it becomes the next render pass. - bool DeferDepthStencilClear(const Framebuffer* framebuffer, const VkClearValue& value); - - /// Realizes any pending deferred clear before its framebuffer can be moved or freed. - void FlushDeferredClear(); + bool OverrideLoadOps(const Framebuffer* framebuffer, u32 attachments, + VkAttachmentLoadOp load_op, const VkClearValue& value); /// Requests the current execution context to be able to execute operations only allowed outside /// of a renderpass. @@ -302,20 +296,7 @@ private: bool descriptor_buffer_bound = false; }; - struct DeferredClear { - const Framebuffer* framebuffer = nullptr; - u32 color_clear_mask = 0; - std::array color_values{}; - bool depth_stencil = false; - VkClearValue depth_stencil_value{}; - }; - - /// Begins a render pass for the given framebuffer, optionally with clear values. - void BeginRenderPassImpl(const Framebuffer* framebuffer, - const RenderingAttachments& attachments); - - /// If a deferred clear is pending. - void RealizeDeferredClear(); + void BeginRenderPassImpl(const Framebuffer* framebuffer); void WorkerThread(std::stop_token stop_token); @@ -344,8 +325,6 @@ private: vk::CommandBuffer current_cmdbuf; vk::CommandBuffer current_upload_cmdbuf; - DeferredClear deferred_clear; - std::unique_ptr chunk; std::function on_submit; @@ -354,6 +333,7 @@ private: u64 renderpass_serial = 0; u64 wfi_serial = 0; bool renderpass_writes = false; + bool renderpass_pristine = false; bool compute_writes = false; u32 attachments_touched = 0; u32 attachments_written = 0; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 51aedac099..55b3b7e81d 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1884,10 +1884,6 @@ bool TextureCacheRuntime::CanReportMemoryUsage() const { return device.CanReportMemoryUsage(); } -void TextureCacheRuntime::FlushDeferredClear() { - scheduler.FlushDeferredClear(); -} - VkImage TextureCacheRuntime::AcquireMsaaScratchImage(const VkImageCreateInfo& image_ci) { const MsaaScratchKey key{ .format = image_ci.format, diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index c41583dcb4..adce1678f7 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -58,8 +58,6 @@ public: void TickFrame(); - void FlushDeferredClear(); - u64 GetDeviceLocalMemory() const; u64 GetDeviceMemoryUsage() const; diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index a38fbd4dbc..5c5ec5ace9 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -453,7 +453,6 @@ FramebufferId TextureCache

::GetFramebufferId(const RenderTargets& key) { return id ? &slot_image_views[id] : nullptr; }); ImageView* const depth_buffer = key.depth_buffer_id ? &slot_image_views[key.depth_buffer_id] : nullptr; - runtime.FlushDeferredClear(); framebuffer_id = slot_framebuffers.insert(runtime, color_buffers, depth_buffer, key); return framebuffer_id; } @@ -2236,7 +2235,6 @@ void TextureCache

::RemoveImageViewReferences(std::span rem template void TextureCache

::RemoveFramebuffers(std::span removed_views) { - runtime.FlushDeferredClear(); auto it = framebuffers.begin(); while (it != framebuffers.end()) { if (it->first.Contains(removed_views)) { From efba499fd3bf924f0516b66fbe09a1add1b60680 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 02:47:44 -0400 Subject: [PATCH 134/198] Remove some dependencies to framebuffer and renderpass --- .../renderer_vulkan/present/fsr.cpp | 48 ++---- src/video_core/renderer_vulkan/present/fsr.h | 5 - .../renderer_vulkan/present/fxaa.cpp | 38 +---- src/video_core/renderer_vulkan/present/fxaa.h | 5 - .../renderer_vulkan/present/post_process.cpp | 103 ++---------- .../renderer_vulkan/present/post_process.h | 4 +- .../renderer_vulkan/present/sgsr.cpp | 30 +--- src/video_core/renderer_vulkan/present/sgsr.h | 4 - .../renderer_vulkan/present/smaa.cpp | 68 +++----- src/video_core/renderer_vulkan/present/smaa.h | 3 - .../renderer_vulkan/present/util.cpp | 159 +++++------------- src/video_core/renderer_vulkan/present/util.h | 15 +- .../present/window_adapt_pass.cpp | 48 ++---- .../present/window_adapt_pass.h | 5 +- .../renderer_vulkan/renderer_vulkan.cpp | 3 - .../renderer_vulkan/vk_blit_screen.cpp | 42 +---- .../renderer_vulkan/vk_blit_screen.h | 6 - .../renderer_vulkan/vk_present_manager.cpp | 15 +- .../renderer_vulkan/vk_present_manager.h | 3 +- .../vulkan_common/vulkan_device.cpp | 3 +- src/video_core/vulkan_common/vulkan_device.h | 5 - .../vulkan_common/vulkan_wrapper.cpp | 34 ---- src/video_core/vulkan_common/vulkan_wrapper.h | 30 ---- 23 files changed, 138 insertions(+), 538 deletions(-) diff --git a/src/video_core/renderer_vulkan/present/fsr.cpp b/src/video_core/renderer_vulkan/present/fsr.cpp index 894fb144f0..a5833710b6 100644 --- a/src/video_core/renderer_vulkan/present/fsr.cpp +++ b/src/video_core/renderer_vulkan/present/fsr.cpp @@ -31,7 +31,6 @@ FSR::FSR(const Device& device, MemoryAllocator& memory_allocator, size_t image_c , m_extent{extent} { CreateImages(device); - CreateRenderPasses(device); CreateSampler(device); CreateShaders(device); CreateDescriptorPool(device); @@ -51,14 +50,6 @@ void FSR::CreateImages(const Device& device) { } } -void FSR::CreateRenderPasses(const Device& device) { - m_renderpass = CreateWrappedRenderPass(device, VK_FORMAT_R16G16B16A16_SFLOAT); - for (auto& images : m_dynamic_images) { - images.framebuffers[Easu] = CreateWrappedFramebuffer(device, m_renderpass, images.image_views[Easu], m_extent); - images.framebuffers[Rcas] = CreateWrappedFramebuffer(device, m_renderpass, images.image_views[Rcas], m_extent); - } -} - void FSR::CreateSampler(const Device& device) { m_sampler = CreateBilinearSampler(device); } @@ -112,9 +103,11 @@ void FSR::CreatePipelineLayouts(const Device& device) { } void FSR::CreatePipelines(const Device& device) { - m_easu_pipeline = CreateWrappedPipeline(device, m_renderpass, m_pipeline_layout, + m_easu_pipeline = CreateWrappedPipeline(device, VK_FORMAT_R16G16B16A16_SFLOAT, + m_pipeline_layout, std::tie(m_vert_shader, m_easu_shader)); - m_rcas_pipeline = CreateWrappedPipeline(device, m_renderpass, m_pipeline_layout, + m_rcas_pipeline = CreateWrappedPipeline(device, VK_FORMAT_R16G16B16A16_SFLOAT, + m_pipeline_layout, std::tie(m_vert_shader, m_rcas_shader)); } @@ -129,19 +122,6 @@ void FSR::UpdateDescriptorSets(const Device& device, VkImageView image_view, siz device.GetLogical().UpdateDescriptorSets(updates, {}); } -void FSR::UploadImages(const Device& device, Scheduler& scheduler) { - if (!m_images_ready) { - m_images_ready = true; - scheduler.Record([&](vk::CommandBuffer cmdbuf) { - for (auto& image : m_dynamic_images) { - ClearColorImage(cmdbuf, *image.images[Easu]); - ClearColorImage(cmdbuf, *image.images[Rcas]); - } - }); - scheduler.Finish(); - } -} - VkImageView FSR::Draw(const Device& device, Scheduler& scheduler, size_t image_index, VkImage source_image, VkImageView source_image_view, VkExtent2D input_image_extent, const Common::Rectangle& crop_rect) { @@ -151,12 +131,11 @@ VkImageView FSR::Draw(const Device& device, Scheduler& scheduler, size_t image_i VkImage rcas_image = *images.images[Rcas]; VkDescriptorSet easu_descriptor_set = images.descriptor_sets[Easu]; VkDescriptorSet rcas_descriptor_set = images.descriptor_sets[Rcas]; - VkFramebuffer easu_framebuffer = *images.framebuffers[Easu]; - VkFramebuffer rcas_framebuffer = *images.framebuffers[Rcas]; + VkImageView easu_view = *images.image_views[Easu]; + VkImageView rcas_view = *images.image_views[Rcas]; VkPipeline easu_pipeline = *m_easu_pipeline; VkPipeline rcas_pipeline = *m_rcas_pipeline; VkPipelineLayout pipeline_layout = *m_pipeline_layout; - VkRenderPass renderpass = *m_renderpass; VkExtent2D extent = m_extent; const f32 input_image_width = static_cast(input_image_extent.width); @@ -179,30 +158,31 @@ VkImageView FSR::Draw(const Device& device, Scheduler& scheduler, size_t image_i static_cast(Settings::values.fsr_sharpening_slider.GetValue()) / 100.0f; FsrRcasCon(rcas_con.data(), sharpening); - UploadImages(device, scheduler); UpdateDescriptorSets(device, source_image_view, image_index); scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([=](vk::CommandBuffer cmdbuf) { TransitionImageLayout(cmdbuf, source_image, VK_IMAGE_LAYOUT_GENERAL); - TransitionImageLayout(cmdbuf, easu_image, VK_IMAGE_LAYOUT_GENERAL); - BeginRenderPass(cmdbuf, renderpass, easu_framebuffer, extent); + TransitionImageLayout(cmdbuf, easu_image, VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_UNDEFINED); + BeginRendering(cmdbuf, easu_view, extent, VK_ATTACHMENT_LOAD_OP_DONT_CARE); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, easu_pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline_layout, 0, easu_descriptor_set, {}); cmdbuf.PushConstants(pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, easu_con); cmdbuf.Draw(3, 1, 0, 0); - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); TransitionImageLayout(cmdbuf, easu_image, VK_IMAGE_LAYOUT_GENERAL); - TransitionImageLayout(cmdbuf, rcas_image, VK_IMAGE_LAYOUT_GENERAL); - BeginRenderPass(cmdbuf, renderpass, rcas_framebuffer, extent); + TransitionImageLayout(cmdbuf, rcas_image, VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_UNDEFINED); + BeginRendering(cmdbuf, rcas_view, extent, VK_ATTACHMENT_LOAD_OP_DONT_CARE); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, rcas_pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline_layout, 0, rcas_descriptor_set, {}); cmdbuf.PushConstants(pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, rcas_con); cmdbuf.Draw(3, 1, 0, 0); - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); TransitionImageLayout(cmdbuf, rcas_image, VK_IMAGE_LAYOUT_GENERAL); }); diff --git a/src/video_core/renderer_vulkan/present/fsr.h b/src/video_core/renderer_vulkan/present/fsr.h index 7762480757..1cdab4a81e 100644 --- a/src/video_core/renderer_vulkan/present/fsr.h +++ b/src/video_core/renderer_vulkan/present/fsr.h @@ -24,7 +24,6 @@ public: private: void CreateImages(const Device& device); - void CreateRenderPasses(const Device& device); void CreateSampler(const Device& device); void CreateShaders(const Device& device); void CreateDescriptorPool(const Device& device); @@ -33,7 +32,6 @@ private: void CreatePipelineLayouts(const Device& device); void CreatePipelines(const Device& device); - void UploadImages(const Device& device, Scheduler& scheduler); void UpdateDescriptorSets(const Device& device, VkImageView image_view, size_t image_index); MemoryAllocator& m_memory_allocator; @@ -54,17 +52,14 @@ private: vk::ShaderModule m_rcas_shader; vk::Pipeline m_easu_pipeline; vk::Pipeline m_rcas_pipeline; - vk::RenderPass m_renderpass; vk::Sampler m_sampler; struct Images { vk::DescriptorSets descriptor_sets; std::array images; std::array image_views; - std::array framebuffers; }; std::vector m_dynamic_images; - bool m_images_ready{}; }; } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/fxaa.cpp b/src/video_core/renderer_vulkan/present/fxaa.cpp index 62f79d490c..8e7b964a5e 100644 --- a/src/video_core/renderer_vulkan/present/fxaa.cpp +++ b/src/video_core/renderer_vulkan/present/fxaa.cpp @@ -21,7 +21,6 @@ FXAA::FXAA(const Device& device, MemoryAllocator& allocator, size_t image_count, , m_image_count(u32(image_count)) { CreateImages(device, allocator); - CreateRenderPasses(device); CreateSampler(device); CreateShaders(device); CreateDescriptorPool(device); @@ -41,15 +40,6 @@ void FXAA::CreateImages(const Device& device, MemoryAllocator& allocator) { } } -void FXAA::CreateRenderPasses(const Device& device) { - m_renderpass = CreateWrappedRenderPass(device, VK_FORMAT_R16G16B16A16_SFLOAT); - - for (auto& image : m_dynamic_images) { - image.framebuffer = - CreateWrappedFramebuffer(device, m_renderpass, image.image_view, m_extent); - } -} - void FXAA::CreateSampler(const Device& device) { m_sampler = CreateWrappedSampler(device); } @@ -83,7 +73,7 @@ void FXAA::CreatePipelineLayouts(const Device& device) { } void FXAA::CreatePipelines(const Device& device) { - m_pipeline = CreateWrappedPipeline(device, m_renderpass, m_pipeline_layout, + m_pipeline = CreateWrappedPipeline(device, VK_FORMAT_R16G16B16A16_SFLOAT, m_pipeline_layout, std::tie(m_vertex_shader, m_fragment_shader)); } @@ -99,44 +89,28 @@ void FXAA::UpdateDescriptorSets(const Device& device, VkImageView image_view, si device.GetLogical().UpdateDescriptorSets(updates, {}); } -void FXAA::UploadImages(const Device& device, Scheduler& scheduler) { - if (m_images_ready) { - return; - } - - scheduler.Record([&](vk::CommandBuffer cmdbuf) { - for (auto& image : m_dynamic_images) { - ClearColorImage(cmdbuf, *image.image); - } - }); - scheduler.Finish(); - - m_images_ready = true; -} - void FXAA::Draw(const Device& device, Scheduler& scheduler, size_t image_index, VkImage* inout_image, VkImageView* inout_image_view) { const Image& image{m_dynamic_images[image_index]}; const VkImage input_image{*inout_image}; const VkImage output_image{*image.image}; + const VkImageView output_view{*image.image_view}; const VkDescriptorSet descriptor_set{image.descriptor_sets[0]}; - const VkFramebuffer framebuffer{*image.framebuffer}; - const VkRenderPass renderpass{*m_renderpass}; const VkPipeline pipeline{*m_pipeline}; const VkPipelineLayout layout{*m_pipeline_layout}; const VkExtent2D extent{m_extent}; - UploadImages(device, scheduler); UpdateDescriptorSets(device, *inout_image_view, image_index); scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([=](vk::CommandBuffer cmdbuf) { TransitionImageLayout(cmdbuf, input_image, VK_IMAGE_LAYOUT_GENERAL); - TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL); - BeginRenderPass(cmdbuf, renderpass, framebuffer, extent); + TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_UNDEFINED); + BeginRendering(cmdbuf, output_view, extent, VK_ATTACHMENT_LOAD_OP_DONT_CARE); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, {}); cmdbuf.Draw(3, 1, 0, 0); - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL); }); diff --git a/src/video_core/renderer_vulkan/present/fxaa.h b/src/video_core/renderer_vulkan/present/fxaa.h index 7eaf31f81c..8acd0bce36 100644 --- a/src/video_core/renderer_vulkan/present/fxaa.h +++ b/src/video_core/renderer_vulkan/present/fxaa.h @@ -25,7 +25,6 @@ public: private: void CreateImages(const Device& device, MemoryAllocator& allocator); - void CreateRenderPasses(const Device& device); void CreateSampler(const Device& device); void CreateShaders(const Device& device); void CreateDescriptorPool(const Device& device); @@ -34,11 +33,9 @@ private: void CreatePipelineLayouts(const Device& device); void CreatePipelines(const Device& device); void UpdateDescriptorSets(const Device& device, VkImageView image_view, size_t image_index); - void UploadImages(const Device& device, Scheduler& scheduler); struct Image { vk::DescriptorSets descriptor_sets{}; - vk::Framebuffer framebuffer{}; vk::Image image{}; vk::ImageView image_view{}; }; @@ -51,9 +48,7 @@ private: vk::DescriptorSetLayout m_descriptor_set_layout{}; vk::PipelineLayout m_pipeline_layout{}; vk::Pipeline m_pipeline{}; - vk::RenderPass m_renderpass{}; vk::Sampler m_sampler{}; - bool m_images_ready{}; }; } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/post_process.cpp b/src/video_core/renderer_vulkan/present/post_process.cpp index 2027f75828..7b5b81d7b5 100644 --- a/src/video_core/renderer_vulkan/present/post_process.cpp +++ b/src/video_core/renderer_vulkan/present/post_process.cpp @@ -126,68 +126,7 @@ VkPrimitiveTopology ToTopology(reshadefx::primitive_topology topology) { } } -vk::RenderPass CreateFxRenderPass(const Device& device, VkFormat format, bool clear) { - VkAttachmentLoadOp load_op = VK_ATTACHMENT_LOAD_OP_LOAD; - VkImageLayout initial_layout = VK_IMAGE_LAYOUT_GENERAL; - if (clear) { - load_op = VK_ATTACHMENT_LOAD_OP_CLEAR; - initial_layout = VK_IMAGE_LAYOUT_UNDEFINED; - } - - const VkAttachmentDescription2 attachment{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, - .pNext = nullptr, - .flags = 0, - .format = format, - .samples = VK_SAMPLE_COUNT_1_BIT, - .loadOp = load_op, - .storeOp = VK_ATTACHMENT_STORE_OP_STORE, - .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE, - .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, - .initialLayout = initial_layout, - .finalLayout = VK_IMAGE_LAYOUT_GENERAL, - }; - - static constexpr VkAttachmentReference2 reference{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - .pNext = nullptr, - .attachment = 0, - .layout = VK_IMAGE_LAYOUT_GENERAL, - .aspectMask = 0, - }; - - const VkSubpassDescription2 subpass{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, - .pNext = nullptr, - .flags = 0, - .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, - .viewMask = 0, - .inputAttachmentCount = 0, - .pInputAttachments = nullptr, - .colorAttachmentCount = 1, - .pColorAttachments = &reference, - .pResolveAttachments = nullptr, - .pDepthStencilAttachment = nullptr, - .preserveAttachmentCount = 0, - .pPreserveAttachments = nullptr, - }; - - return device.GetLogical().CreateRenderPass2(VkRenderPassCreateInfo2{ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, - .pNext = nullptr, - .flags = 0, - .attachmentCount = 1, - .pAttachments = &attachment, - .subpassCount = 1, - .pSubpasses = &subpass, - .dependencyCount = 0, - .pDependencies = nullptr, - .correlatedViewMaskCount = 0, - .pCorrelatedViewMasks = nullptr, - }); -} - -vk::Pipeline CreateFxPipeline(const Device& device, vk::RenderPass& renderpass, +vk::Pipeline CreateFxPipeline(const Device& device, VkFormat format, vk::PipelineLayout& layout, VkShaderModule vertex_shader, VkShaderModule fragment_shader, const reshadefx::pass& pass) { @@ -308,9 +247,10 @@ vk::Pipeline CreateFxPipeline(const Device& device, vk::RenderPass& renderpass, .pDynamicStates = dynamic_states.data(), }; + const VkPipelineRenderingCreateInfo rendering_ci = ColorRenderingInfo(format); return device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(stages.size()), .pStages = stages.data(), @@ -324,7 +264,7 @@ vk::Pipeline CreateFxPipeline(const Device& device, vk::RenderPass& renderpass, .pColorBlendState = &color_blend, .pDynamicState = &dynamic_state, .layout = *layout, - .renderPass = *renderpass, + .renderPass = VK_NULL_HANDLE, .subpass = 0, .basePipelineHandle = nullptr, .basePipelineIndex = 0, @@ -540,7 +480,9 @@ bool PostProcessChain::BuildEffects(const Device& device, MemoryAllocator& alloc for (const auto& pass : technique->passes) { Pass out; out.num_vertices = pass.num_vertices; - out.clear = pass.clear_render_targets != 0; + if (pass.clear_render_targets != 0) { + out.load_op = VK_ATTACHMENT_LOAD_OP_CLEAR; + } out.target_texture = NO_TEXTURE; out.extent = m_extent; @@ -606,23 +548,9 @@ bool PostProcessChain::BuildEffects(const Device& device, MemoryAllocator& alloc continue; } - out.renderpass = CreateFxRenderPass(device, target_format, out.clear); - out.pipeline = CreateFxPipeline(device, out.renderpass, out.pipeline_layout, + out.pipeline = CreateFxPipeline(device, target_format, out.pipeline_layout, *vertex_shader->second, *fragment_shader->second, pass); - if (out.writes_backbuffer) { - for (u32 image = 0; image < m_image_count; ++image) { - for (size_t slot = 0; slot < 2; ++slot) { - out.framebuffers.push_back(CreateWrappedFramebuffer( - device, out.renderpass, m_frames[image].views[slot], out.extent)); - } - } - } else { - out.framebuffers.push_back( - CreateWrappedFramebuffer(device, out.renderpass, - effect.textures[out.target_texture].view, out.extent)); - } - effect.passes.push_back(std::move(out)); } @@ -859,19 +787,20 @@ void PostProcessChain::Draw(const Device& device, Scheduler& scheduler, size_t i UpdateDescriptors(device, effect, pass, image_index, current_view); - VkFramebuffer framebuffer{}; VkImage target_image{}; + VkImageView target_view{}; if (pass.writes_backbuffer) { const u32 target_slot = (slot + 1) % 2; - framebuffer = *pass.framebuffers[image_index * 2 + target_slot]; target_image = *frame.images[target_slot]; + target_view = *frame.views[target_slot]; } else { - framebuffer = *pass.framebuffers[0]; - target_image = *effect.textures[pass.target_texture].image; + const Texture& texture = effect.textures[pass.target_texture]; + target_image = *texture.image; + target_view = *texture.view; } const VkImage source_image = current_image; - const VkRenderPass renderpass = *pass.renderpass; + const VkAttachmentLoadOp load_op = pass.load_op; const VkPipeline pipeline = *pass.pipeline; const VkPipelineLayout layout = *pass.pipeline_layout; const VkDescriptorSet uniform_set = effect.uniform_sets[image_index]; @@ -883,12 +812,12 @@ void PostProcessChain::Draw(const Device& device, Scheduler& scheduler, size_t i scheduler.Record([=](vk::CommandBuffer cmdbuf) { TransitionImageLayout(cmdbuf, source_image, VK_IMAGE_LAYOUT_GENERAL); TransitionImageLayout(cmdbuf, target_image, VK_IMAGE_LAYOUT_GENERAL); - BeginRenderPass(cmdbuf, renderpass, framebuffer, extent); + BeginRendering(cmdbuf, target_view, extent, load_op); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, std::array{uniform_set, sampler_set}, {}); cmdbuf.Draw(vertices, 1, 0, 0); - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); TransitionImageLayout(cmdbuf, target_image, VK_IMAGE_LAYOUT_GENERAL); }); diff --git a/src/video_core/renderer_vulkan/present/post_process.h b/src/video_core/renderer_vulkan/present/post_process.h index 9238ef0c39..cc65cfe172 100644 --- a/src/video_core/renderer_vulkan/present/post_process.h +++ b/src/video_core/renderer_vulkan/present/post_process.h @@ -77,17 +77,15 @@ private: }; struct Pass { - vk::RenderPass renderpass{}; vk::Pipeline pipeline{}; vk::DescriptorSetLayout sampler_layout{}; vk::PipelineLayout pipeline_layout{}; vk::DescriptorSets sampler_sets{}; std::vector sampler_bindings{}; - std::vector framebuffers{}; size_t target_texture{}; VkExtent2D extent{}; u32 num_vertices{3}; - bool clear{}; + VkAttachmentLoadOp load_op{VK_ATTACHMENT_LOAD_OP_LOAD}; bool writes_backbuffer{}; }; diff --git a/src/video_core/renderer_vulkan/present/sgsr.cpp b/src/video_core/renderer_vulkan/present/sgsr.cpp index fa37225e43..7a7446ce33 100644 --- a/src/video_core/renderer_vulkan/present/sgsr.cpp +++ b/src/video_core/renderer_vulkan/present/sgsr.cpp @@ -34,10 +34,6 @@ SGSR::SGSR(const Device& device, MemoryAllocator& memory_allocator, size_t image images.image_view = CreateWrappedImageView(device, images.image, VK_FORMAT_R16G16B16A16_SFLOAT); } - m_renderpass = CreateWrappedRenderPass(device, VK_FORMAT_R16G16B16A16_SFLOAT); - for (auto& images : m_dynamic_images) - images.framebuffer = CreateWrappedFramebuffer(device, m_renderpass, images.image_view, m_extent); - m_sampler = CreateBilinearSampler(device); m_vert_shader = BuildShader(device, SGSR1_SHADER_VERT_SPV); m_stage_shader = m_edge_dir @@ -66,7 +62,9 @@ SGSR::SGSR(const Device& device, MemoryAllocator& memory_allocator, size_t image .pPushConstantRanges = &range, }; m_pipeline_layout = device.GetLogical().CreatePipelineLayout(ci); - m_stage_pipeline = CreateWrappedPipeline(device, m_renderpass, m_pipeline_layout, std::tie(m_vert_shader, m_stage_shader)); + m_stage_pipeline = CreateWrappedPipeline(device, VK_FORMAT_R16G16B16A16_SFLOAT, + m_pipeline_layout, + std::tie(m_vert_shader, m_stage_shader)); } void SGSR::UpdateDescriptorSets(const Device& device, VkImageView image_view, size_t image_index) { @@ -78,26 +76,14 @@ void SGSR::UpdateDescriptorSets(const Device& device, VkImageView image_view, si device.GetLogical().UpdateDescriptorSets(updates, {}); } -void SGSR::UploadImages(const Device& device, Scheduler& scheduler) { - if (!m_images_ready) { - scheduler.Record([&](vk::CommandBuffer cmdbuf) { - for (auto& image : m_dynamic_images) - ClearColorImage(cmdbuf, *image.image); - }); - scheduler.Finish(); - m_images_ready = true; - } -} - VkImageView SGSR::Draw(const Device& device, Scheduler& scheduler, size_t image_index, VkImage source_image, VkImageView source_image_view, VkExtent2D input_image_extent, const Common::Rectangle& crop_rect) { Images& images = m_dynamic_images[image_index]; auto const output_image = *images.image; + auto const output_view = *images.image_view; auto const descriptor_set = images.descriptor_sets[0]; - auto const framebuffer = *images.framebuffer; auto const pipeline = *m_stage_pipeline; VkPipelineLayout layout = *m_pipeline_layout; - VkRenderPass renderpass = *m_renderpass; VkExtent2D extent = m_extent; const f32 input_image_width = f32(input_image_extent.width); @@ -125,19 +111,19 @@ VkImageView SGSR::Draw(const Device& device, Scheduler& scheduler, size_t image_ viewport_con[7] = std::bit_cast((std::min)(crop_rect.top, crop_rect.bottom)); viewport_con[8] = std::bit_cast(edge_sharpness); - UploadImages(device, scheduler); UpdateDescriptorSets(device, source_image_view, image_index); scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([=](vk::CommandBuffer cmdbuf) { TransitionImageLayout(cmdbuf, source_image, VK_IMAGE_LAYOUT_GENERAL); - TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL); - BeginRenderPass(cmdbuf, renderpass, framebuffer, extent); + TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_UNDEFINED); + BeginRendering(cmdbuf, output_view, extent, VK_ATTACHMENT_LOAD_OP_DONT_CARE); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, {}); cmdbuf.PushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, viewport_con); cmdbuf.Draw(3, 1, 0, 0); - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL); }); return *images.image_view; diff --git a/src/video_core/renderer_vulkan/present/sgsr.h b/src/video_core/renderer_vulkan/present/sgsr.h index 42ba00898f..d626bbe1ba 100644 --- a/src/video_core/renderer_vulkan/present/sgsr.h +++ b/src/video_core/renderer_vulkan/present/sgsr.h @@ -19,7 +19,6 @@ public: VkImageView Draw(const Device& device, Scheduler& scheduler, size_t image_index, VkImage source_image, VkImageView source_image_view, VkExtent2D input_image_extent, const Common::Rectangle& crop_rect); private: void Initialize(const Device& device); - void UploadImages(const Device& device, Scheduler& scheduler); void UpdateDescriptorSets(const Device& device, VkImageView image_view, size_t image_index); MemoryAllocator& m_memory_allocator; @@ -32,17 +31,14 @@ private: vk::ShaderModule m_vert_shader; vk::ShaderModule m_stage_shader; vk::Pipeline m_stage_pipeline; - vk::RenderPass m_renderpass; vk::Sampler m_sampler; struct Images { vk::DescriptorSets descriptor_sets; vk::Image image; vk::ImageView image_view; - vk::Framebuffer framebuffer; }; std::vector m_dynamic_images; - bool m_images_ready{}; bool m_edge_dir{}; }; diff --git a/src/video_core/renderer_vulkan/present/smaa.cpp b/src/video_core/renderer_vulkan/present/smaa.cpp index 28b0427fa0..0527adf73b 100644 --- a/src/video_core/renderer_vulkan/present/smaa.cpp +++ b/src/video_core/renderer_vulkan/present/smaa.cpp @@ -32,7 +32,6 @@ SMAA::SMAA(const Device& device, MemoryAllocator& allocator, size_t image_count, , m_image_count(u32(image_count)) { CreateImages(device); - CreateRenderPasses(device); CreateSampler(device); CreateShaders(device); CreateDescriptorPool(device); @@ -74,26 +73,6 @@ void SMAA::CreateImages(const Device& device) { } } -void SMAA::CreateRenderPasses(const Device& device) { - m_renderpasses[EdgeDetection] = CreateWrappedRenderPass(device, VK_FORMAT_R16G16_SFLOAT); - m_renderpasses[BlendingWeightCalculation] = - CreateWrappedRenderPass(device, VK_FORMAT_R16G16B16A16_SFLOAT); - m_renderpasses[NeighborhoodBlending] = - CreateWrappedRenderPass(device, VK_FORMAT_R16G16B16A16_SFLOAT); - - for (auto& images : m_dynamic_images) { - images.framebuffers[EdgeDetection] = CreateWrappedFramebuffer( - device, m_renderpasses[EdgeDetection], images.image_views[Edges], m_extent); - - images.framebuffers[BlendingWeightCalculation] = - CreateWrappedFramebuffer(device, m_renderpasses[BlendingWeightCalculation], - images.image_views[Blend], m_extent); - - images.framebuffers[NeighborhoodBlending] = CreateWrappedFramebuffer( - device, m_renderpasses[NeighborhoodBlending], images.image_views[Output], m_extent); - } -} - void SMAA::CreateSampler(const Device& device) { m_sampler = CreateWrappedSampler(device); } @@ -155,9 +134,14 @@ void SMAA::CreatePipelineLayouts(const Device& device) { } void SMAA::CreatePipelines(const Device& device) { + static constexpr std::array formats{ + VK_FORMAT_R16G16_SFLOAT, + VK_FORMAT_R16G16B16A16_SFLOAT, + VK_FORMAT_R16G16B16A16_SFLOAT, + }; for (size_t i = 0; i < MaxSMAAStage; i++) { m_pipelines[i] = - CreateWrappedPipeline(device, m_renderpasses[i], m_pipeline_layouts[i], + CreateWrappedPipeline(device, formats[i], m_pipeline_layouts[i], std::tie(m_vertex_shaders[i], m_fragment_shaders[i])); } } @@ -202,15 +186,6 @@ void SMAA::UploadImages(const Device& device, Scheduler& scheduler) { UploadImage(device, m_allocator, scheduler, m_static_images[Search], search_extent, VK_FORMAT_R8_UNORM, ARRAY_TO_SPAN(searchTexBytes)); - scheduler.Record([&](vk::CommandBuffer cmdbuf) { - for (auto& images : m_dynamic_images) { - for (size_t i = 0; i < MaxDynamicImage; i++) { - ClearColorImage(cmdbuf, *images.images[i]); - } - } - }); - scheduler.Finish(); - m_images_ready = true; } @@ -228,10 +203,9 @@ void SMAA::Draw(const Device& device, Scheduler& scheduler, size_t image_index, VkDescriptorSet neighborhood_blending_descriptor_set = images.descriptor_sets[NeighborhoodBlending]; - VkFramebuffer edge_detection_framebuffer = *images.framebuffers[EdgeDetection]; - VkFramebuffer blending_weight_calculation_framebuffer = - *images.framebuffers[BlendingWeightCalculation]; - VkFramebuffer neighborhood_blending_framebuffer = *images.framebuffers[NeighborhoodBlending]; + VkImageView edges_view = *images.image_views[Edges]; + VkImageView blend_view = *images.image_views[Blend]; + VkImageView output_view = *images.image_views[Output]; UploadImages(device, scheduler); UpdateDescriptorSets(device, *inout_image_view, image_index); @@ -239,38 +213,38 @@ void SMAA::Draw(const Device& device, Scheduler& scheduler, size_t image_index, scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([=, this](vk::CommandBuffer cmdbuf) { TransitionImageLayout(cmdbuf, input_image, VK_IMAGE_LAYOUT_GENERAL); - TransitionImageLayout(cmdbuf, edges_image, VK_IMAGE_LAYOUT_GENERAL); - BeginRenderPass(cmdbuf, *m_renderpasses[EdgeDetection], edge_detection_framebuffer, - m_extent); + TransitionImageLayout(cmdbuf, edges_image, VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_UNDEFINED); + BeginRendering(cmdbuf, edges_view, m_extent, VK_ATTACHMENT_LOAD_OP_CLEAR); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipelines[EdgeDetection]); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline_layouts[EdgeDetection], 0, edge_detection_descriptor_set, {}); cmdbuf.Draw(3, 1, 0, 0); - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); TransitionImageLayout(cmdbuf, edges_image, VK_IMAGE_LAYOUT_GENERAL); - TransitionImageLayout(cmdbuf, blend_image, VK_IMAGE_LAYOUT_GENERAL); - BeginRenderPass(cmdbuf, *m_renderpasses[BlendingWeightCalculation], - blending_weight_calculation_framebuffer, m_extent); + TransitionImageLayout(cmdbuf, blend_image, VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_UNDEFINED); + BeginRendering(cmdbuf, blend_view, m_extent, VK_ATTACHMENT_LOAD_OP_DONT_CARE); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipelines[BlendingWeightCalculation]); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline_layouts[BlendingWeightCalculation], 0, blending_weight_calculation_descriptor_set, {}); cmdbuf.Draw(3, 1, 0, 0); - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); TransitionImageLayout(cmdbuf, blend_image, VK_IMAGE_LAYOUT_GENERAL); - TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL); - BeginRenderPass(cmdbuf, *m_renderpasses[NeighborhoodBlending], - neighborhood_blending_framebuffer, m_extent); + TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_UNDEFINED); + BeginRendering(cmdbuf, output_view, m_extent, VK_ATTACHMENT_LOAD_OP_DONT_CARE); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipelines[NeighborhoodBlending]); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline_layouts[NeighborhoodBlending], 0, neighborhood_blending_descriptor_set, {}); cmdbuf.Draw(3, 1, 0, 0); - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL); }); diff --git a/src/video_core/renderer_vulkan/present/smaa.h b/src/video_core/renderer_vulkan/present/smaa.h index a547161395..54a820b7a9 100644 --- a/src/video_core/renderer_vulkan/present/smaa.h +++ b/src/video_core/renderer_vulkan/present/smaa.h @@ -47,7 +47,6 @@ private: }; void CreateImages(const Device& device); - void CreateRenderPasses(const Device& device); void CreateSampler(const Device& device); void CreateShaders(const Device& device); void CreateDescriptorPool(const Device& device); @@ -68,7 +67,6 @@ private: std::array m_vertex_shaders{}; std::array m_fragment_shaders{}; std::array m_pipelines{}; - std::array m_renderpasses{}; std::array m_static_images{}; std::array m_static_image_views{}; @@ -77,7 +75,6 @@ private: vk::DescriptorSets descriptor_sets{}; std::array images{}; std::array image_views{}; - std::array framebuffers{}; }; std::vector m_dynamic_images{}; bool m_images_ready{}; diff --git a/src/video_core/renderer_vulkan/present/util.cpp b/src/video_core/renderer_vulkan/present/util.cpp index 7c9e0aa76d..f04df4afd2 100644 --- a/src/video_core/renderer_vulkan/present/util.cpp +++ b/src/video_core/renderer_vulkan/present/util.cpp @@ -198,100 +198,6 @@ vk::ImageView CreateWrappedImageView(const Device& device, vk::Image& image, VkF }); } -vk::RenderPass CreateWrappedRenderPass(const Device& device, VkFormat format, - VkImageLayout initial_layout) { - const VkAttachmentDescription2 attachment{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, - .pNext = nullptr, - .flags = VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT, - .format = format, - .samples = VK_SAMPLE_COUNT_1_BIT, - .loadOp = initial_layout == VK_IMAGE_LAYOUT_UNDEFINED ? VK_ATTACHMENT_LOAD_OP_DONT_CARE - : VK_ATTACHMENT_LOAD_OP_LOAD, - .storeOp = VK_ATTACHMENT_STORE_OP_STORE, - .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD, - .stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE, - .initialLayout = initial_layout, - .finalLayout = VK_IMAGE_LAYOUT_GENERAL, - }; - - static constexpr VkAttachmentReference2 color_attachment_ref{ - .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - .pNext = nullptr, - .attachment = 0, - .layout = VK_IMAGE_LAYOUT_GENERAL, - .aspectMask = 0, - }; - - const VkSubpassDescription2 subpass_description{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, - .pNext = nullptr, - .flags = 0, - .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, - .viewMask = 0, - .inputAttachmentCount = 0, - .pInputAttachments = nullptr, - .colorAttachmentCount = 1, - .pColorAttachments = &color_attachment_ref, - .pResolveAttachments = nullptr, - .pDepthStencilAttachment = nullptr, - .preserveAttachmentCount = 0, - .pPreserveAttachments = nullptr, - }; - - static constexpr VkMemoryBarrier2 dependency_barrier{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, - .srcAccessMask = 0, - .dstStageMask = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, - .dstAccessMask = - VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, - }; - - static constexpr VkSubpassDependency2 dependency{ - .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, - .pNext = &dependency_barrier, - .srcSubpass = VK_SUBPASS_EXTERNAL, - .dstSubpass = 0, - .srcStageMask = 0, - .dstStageMask = 0, - .srcAccessMask = 0, - .dstAccessMask = 0, - .dependencyFlags = 0, - .viewOffset = 0, - }; - - return device.GetLogical().CreateRenderPass2(VkRenderPassCreateInfo2{ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, - .pNext = nullptr, - .flags = 0, - .attachmentCount = 1, - .pAttachments = &attachment, - .subpassCount = 1, - .pSubpasses = &subpass_description, - .dependencyCount = 1, - .pDependencies = &dependency, - .correlatedViewMaskCount = 0, - .pCorrelatedViewMasks = nullptr, - }); -} - -vk::Framebuffer CreateWrappedFramebuffer(const Device& device, vk::RenderPass& render_pass, - vk::ImageView& dest_image, VkExtent2D extent) { - return device.GetLogical().CreateFramebuffer(VkFramebufferCreateInfo{ - .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .renderPass = *render_pass, - .attachmentCount = 1, - .pAttachments = dest_image.address(), - .width = extent.width, - .height = extent.height, - .layers = 1, - }); -} - vk::Sampler CreateWrappedSampler(const Device& device, VkFilter filter) { return device.GetLogical().CreateSampler(VkSamplerCreateInfo{ .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, @@ -422,8 +328,20 @@ vk::PipelineLayout CreateWrappedPipelineLayout(const Device& device, }); } +VkPipelineRenderingCreateInfo ColorRenderingInfo(const VkFormat& format) { + return { + .sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO, + .pNext = nullptr, + .viewMask = 0, + .colorAttachmentCount = 1, + .pColorAttachmentFormats = &format, + .depthAttachmentFormat = VK_FORMAT_UNDEFINED, + .stencilAttachmentFormat = VK_FORMAT_UNDEFINED, + }; +} + static vk::Pipeline CreateWrappedPipelineImpl( - const Device& device, vk::RenderPass& renderpass, vk::PipelineLayout& layout, + const Device& device, VkFormat format, vk::PipelineLayout& layout, std::tuple shaders, VkPipelineColorBlendAttachmentState blending) { const std::array shader_stages{{ @@ -527,9 +445,10 @@ static vk::Pipeline CreateWrappedPipelineImpl( .pDynamicStates = dynamic_states.data(), }; + const VkPipelineRenderingCreateInfo rendering_ci = ColorRenderingInfo(format); return device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = nullptr, + .pNext = &rendering_ci, .flags = 0, .stageCount = static_cast(shader_stages.size()), .pStages = shader_stages.data(), @@ -543,14 +462,14 @@ static vk::Pipeline CreateWrappedPipelineImpl( .pColorBlendState = &color_blend_ci, .pDynamicState = &dynamic_state_ci, .layout = *layout, - .renderPass = *renderpass, + .renderPass = VK_NULL_HANDLE, .subpass = 0, .basePipelineHandle = 0, .basePipelineIndex = 0, }); } -vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderpass, +vk::Pipeline CreateWrappedPipeline(const Device& device, VkFormat format, vk::PipelineLayout& layout, std::tuple shaders) { constexpr VkPipelineColorBlendAttachmentState color_blend_attachment_disabled{ @@ -565,12 +484,12 @@ vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderp VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT, }; - return CreateWrappedPipelineImpl(device, renderpass, layout, shaders, + return CreateWrappedPipelineImpl(device, format, layout, shaders, color_blend_attachment_disabled); } vk::Pipeline CreateWrappedPremultipliedBlendingPipeline( - const Device& device, vk::RenderPass& renderpass, vk::PipelineLayout& layout, + const Device& device, VkFormat format, vk::PipelineLayout& layout, std::tuple shaders) { constexpr VkPipelineColorBlendAttachmentState color_blend_attachment_premultiplied{ .blendEnable = VK_TRUE, @@ -584,12 +503,12 @@ vk::Pipeline CreateWrappedPremultipliedBlendingPipeline( VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT, }; - return CreateWrappedPipelineImpl(device, renderpass, layout, shaders, + return CreateWrappedPipelineImpl(device, format, layout, shaders, color_blend_attachment_premultiplied); } vk::Pipeline CreateWrappedCoverageBlendingPipeline( - const Device& device, vk::RenderPass& renderpass, vk::PipelineLayout& layout, + const Device& device, VkFormat format, vk::PipelineLayout& layout, std::tuple shaders) { constexpr VkPipelineColorBlendAttachmentState color_blend_attachment_coverage{ .blendEnable = VK_TRUE, @@ -603,7 +522,7 @@ vk::Pipeline CreateWrappedCoverageBlendingPipeline( VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT, }; - return CreateWrappedPipelineImpl(device, renderpass, layout, shaders, + return CreateWrappedPipelineImpl(device, format, layout, shaders, color_blend_attachment_coverage); } @@ -725,21 +644,35 @@ void ClearColorImage(vk::CommandBuffer& cmdbuf, VkImage image) { cmdbuf.ClearColorImage(image, VK_IMAGE_LAYOUT_GENERAL, {}, subresources); } -void BeginRenderPass(vk::CommandBuffer& cmdbuf, VkRenderPass render_pass, VkFramebuffer framebuffer, - VkExtent2D extent) { - const VkRenderPassBeginInfo renderpass_bi{ - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, +void BeginRendering(vk::CommandBuffer& cmdbuf, VkImageView view, VkExtent2D extent, + VkAttachmentLoadOp load_op, const VkClearValue& clear_value) { + const VkRenderingAttachmentInfo attachment{ + .sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, .pNext = nullptr, - .renderPass = render_pass, - .framebuffer = framebuffer, + .imageView = view, + .imageLayout = VK_IMAGE_LAYOUT_GENERAL, + .resolveMode = VK_RESOLVE_MODE_NONE, + .resolveImageView = VK_NULL_HANDLE, + .resolveImageLayout = VK_IMAGE_LAYOUT_UNDEFINED, + .loadOp = load_op, + .storeOp = VK_ATTACHMENT_STORE_OP_STORE, + .clearValue = clear_value, + }; + cmdbuf.BeginRendering(VkRenderingInfo{ + .sType = VK_STRUCTURE_TYPE_RENDERING_INFO, + .pNext = nullptr, + .flags = 0, .renderArea{ .offset{}, .extent = extent, }, - .clearValueCount = 0, - .pClearValues = nullptr, - }; - cmdbuf.BeginRenderPass(renderpass_bi, VK_SUBPASS_CONTENTS_INLINE); + .layerCount = 1, + .viewMask = 0, + .colorAttachmentCount = 1, + .pColorAttachments = &attachment, + .pDepthAttachment = nullptr, + .pStencilAttachment = nullptr, + }); const VkViewport viewport{ .x = 0.0f, diff --git a/src/video_core/renderer_vulkan/present/util.h b/src/video_core/renderer_vulkan/present/util.h index ecc263286d..9eb862b0a8 100644 --- a/src/video_core/renderer_vulkan/present/util.h +++ b/src/video_core/renderer_vulkan/present/util.h @@ -27,10 +27,6 @@ void DownloadColorImage(vk::CommandBuffer& cmdbuf, VkImage image, VkBuffer buffe void ClearColorImage(vk::CommandBuffer& cmdbuf, VkImage image); vk::ImageView CreateWrappedImageView(const Device& device, vk::Image& image, VkFormat format); -vk::RenderPass CreateWrappedRenderPass(const Device& device, VkFormat format, - VkImageLayout initial_layout = VK_IMAGE_LAYOUT_GENERAL); -vk::Framebuffer CreateWrappedFramebuffer(const Device& device, vk::RenderPass& render_pass, - vk::ImageView& dest_image, VkExtent2D extent); vk::Sampler CreateWrappedSampler(const Device& device, VkFilter filter = VK_FILTER_LINEAR); vk::ShaderModule CreateWrappedShaderModule(const Device& device, std::span code); vk::DescriptorPool CreateWrappedDescriptorPool(const Device& device, size_t max_descriptors, @@ -47,16 +43,17 @@ vk::DescriptorSets CreateWrappedDescriptorSets(vk::DescriptorPool& pool, vk::Span layouts); vk::PipelineLayout CreateWrappedPipelineLayout(const Device& device, vk::DescriptorSetLayout& layout); -vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderpass, +[[nodiscard]] VkPipelineRenderingCreateInfo ColorRenderingInfo(const VkFormat& format); +vk::Pipeline CreateWrappedPipeline(const Device& device, VkFormat format, vk::PipelineLayout& layout, std::tuple shaders); vk::Pipeline CreateWrappedComputePipeline(const Device& device, vk::PipelineLayout& layout, VkShaderModule shader); vk::Pipeline CreateWrappedPremultipliedBlendingPipeline( - const Device& device, vk::RenderPass& renderpass, vk::PipelineLayout& layout, + const Device& device, VkFormat format, vk::PipelineLayout& layout, std::tuple shaders); vk::Pipeline CreateWrappedCoverageBlendingPipeline( - const Device& device, vk::RenderPass& renderpass, vk::PipelineLayout& layout, + const Device& device, VkFormat format, vk::PipelineLayout& layout, std::tuple shaders); VkWriteDescriptorSet CreateWriteDescriptorSet(std::vector& images, VkSampler sampler, VkImageView view, @@ -65,7 +62,7 @@ vk::Sampler CreateBilinearSampler(const Device& device); vk::Sampler CreateNearestNeighborSampler(const Device& device); vk::Sampler CreateCubicSampler(const Device& device, VkCubicFilterWeightsQCOM qcom_weights); -void BeginRenderPass(vk::CommandBuffer& cmdbuf, VkRenderPass render_pass, VkFramebuffer framebuffer, - VkExtent2D extent); +void BeginRendering(vk::CommandBuffer& cmdbuf, VkImageView view, VkExtent2D extent, + VkAttachmentLoadOp load_op, const VkClearValue& clear_value = {}); } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/window_adapt_pass.cpp b/src/video_core/renderer_vulkan/present/window_adapt_pass.cpp index 549b0660c1..c7718bc688 100644 --- a/src/video_core/renderer_vulkan/present/window_adapt_pass.cpp +++ b/src/video_core/renderer_vulkan/present/window_adapt_pass.cpp @@ -25,8 +25,7 @@ WindowAdaptPass::WindowAdaptPass(const Device& device, VkFormat frame_format, vk CreateDescriptorSetLayout(device); CreatePipelineLayout(device); CreateVertexShader(device); - CreateRenderPass(device, frame_format); - CreatePipelines(device); + CreatePipelines(device, frame_format); } WindowAdaptPass::~WindowAdaptPass() = default; @@ -36,8 +35,8 @@ void WindowAdaptPass::Draw(const Device& device, RasterizerVulkan& rasterizer, S std::span configs, const Layout::FramebufferLayout& layout, Frame* dst) { - const VkFramebuffer host_framebuffer{*dst->framebuffer}; - const VkRenderPass renderpass{*render_pass}; + const VkImage host_image{*dst->image}; + const VkImageView host_view{*dst->image_view}; const VkPipelineLayout graphics_pipeline_layout{*pipeline_layout}; const VkExtent2D render_area{ .width = dst->width, @@ -73,26 +72,13 @@ void WindowAdaptPass::Draw(const Device& device, RasterizerVulkan& rasterizer, S const f32 bg_red = Settings::values.bg_red.GetValue() / 255.0f; const f32 bg_green = Settings::values.bg_green.GetValue() / 255.0f; const f32 bg_blue = Settings::values.bg_blue.GetValue() / 255.0f; - const VkClearAttachment clear_attachment{ - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .colorAttachment = 0, - .clearValue = - { - .color = {.float32 = {bg_red, bg_green, bg_blue, 1.0f}}, - }, - }; - const VkClearRect clear_rect{ - .rect = - { - .offset = {0, 0}, - .extent = render_area, - }, - .baseArrayLayer = 0, - .layerCount = 1, + const VkClearValue clear_value{ + .color = {.float32 = {bg_red, bg_green, bg_blue, 1.0f}}, }; - BeginRenderPass(cmdbuf, renderpass, host_framebuffer, render_area); - cmdbuf.ClearAttachments({clear_attachment}, {clear_rect}); + TransitionImageLayout(cmdbuf, host_image, VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_UNDEFINED); + BeginRendering(cmdbuf, host_view, render_area, VK_ATTACHMENT_LOAD_OP_CLEAR, clear_value); for (size_t i = 0; i < layer_count; i++) { cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, graphics_pipelines[i]); @@ -103,7 +89,7 @@ void WindowAdaptPass::Draw(const Device& device, RasterizerVulkan& rasterizer, S cmdbuf.Draw(4, 1, 0, 0); } - cmdbuf.EndRenderPass(); + cmdbuf.EndRendering(); }); } @@ -111,10 +97,6 @@ VkDescriptorSetLayout WindowAdaptPass::GetDescriptorSetLayout() { return *descriptor_set_layout; } -VkRenderPass WindowAdaptPass::GetRenderPass() { - return *render_pass; -} - void WindowAdaptPass::CreateDescriptorSetLayout(const Device& device) { descriptor_set_layout = CreateWrappedDescriptorSetLayout(device, {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER}); @@ -142,17 +124,13 @@ void WindowAdaptPass::CreateVertexShader(const Device& device) { vertex_shader = BuildShader(device, VULKAN_PRESENT_VERT_SPV); } -void WindowAdaptPass::CreateRenderPass(const Device& device, VkFormat frame_format) { - render_pass = CreateWrappedRenderPass(device, frame_format, VK_IMAGE_LAYOUT_UNDEFINED); -} - -void WindowAdaptPass::CreatePipelines(const Device& device) { - opaque_pipeline = CreateWrappedPipeline(device, render_pass, pipeline_layout, +void WindowAdaptPass::CreatePipelines(const Device& device, VkFormat frame_format) { + opaque_pipeline = CreateWrappedPipeline(device, frame_format, pipeline_layout, std::tie(vertex_shader, fragment_shader)); premultiplied_pipeline = CreateWrappedPremultipliedBlendingPipeline( - device, render_pass, pipeline_layout, std::tie(vertex_shader, fragment_shader)); + device, frame_format, pipeline_layout, std::tie(vertex_shader, fragment_shader)); coverage_pipeline = CreateWrappedCoverageBlendingPipeline( - device, render_pass, pipeline_layout, std::tie(vertex_shader, fragment_shader)); + device, frame_format, pipeline_layout, std::tie(vertex_shader, fragment_shader)); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/window_adapt_pass.h b/src/video_core/renderer_vulkan/present/window_adapt_pass.h index 58d6fc01c0..4a9ec6934a 100644 --- a/src/video_core/renderer_vulkan/present/window_adapt_pass.h +++ b/src/video_core/renderer_vulkan/present/window_adapt_pass.h @@ -38,21 +38,18 @@ public: const Layout::FramebufferLayout& layout, Frame* dst); VkDescriptorSetLayout GetDescriptorSetLayout(); - VkRenderPass GetRenderPass(); private: void CreateDescriptorSetLayout(const Device& device); void CreatePipelineLayout(const Device& device); void CreateVertexShader(const Device& device); - void CreateRenderPass(const Device& device, VkFormat frame_format); - void CreatePipelines(const Device& device); + void CreatePipelines(const Device& device, VkFormat frame_format); vk::DescriptorSetLayout descriptor_set_layout; vk::PipelineLayout pipeline_layout; vk::Sampler sampler; vk::ShaderModule vertex_shader; vk::ShaderModule fragment_shader; - vk::RenderPass render_pass; vk::Pipeline opaque_pipeline; vk::Pipeline premultiplied_pipeline; vk::Pipeline coverage_pipeline; diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 27ca531186..12c9e3a14b 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -275,7 +275,6 @@ vk::Buffer RendererVulkan::RenderToBuffer(std::spanGetRenderPass(), true); + present_manager.RecreateFrame(frame, layout.width, layout.height, swapchain_view_format, true); } void BlitScreen::DrawToFrame(const Device& device, RasterizerVulkan& rasterizer, Frame* frame, @@ -133,13 +132,13 @@ void BlitScreen::DrawToFrame(const Device& device, RasterizerVulkan& rasterizer, if (presentation_recreate_required) { present_manager.RecreateFrame(frame, layout.width, layout.height, swapchain_view_format, - window_adapt->GetRenderPass(), storage_required); + storage_required); } image_index = 0; } else if (present_manager.NeedsStorage(frame, storage_required)) { present_manager.RecreateFrame(frame, layout.width, layout.height, swapchain_view_format, - window_adapt->GetRenderPass(), true); + true); } const VkExtent2D window_size{ @@ -162,39 +161,4 @@ void BlitScreen::DrawToFrame(const Device& device, RasterizerVulkan& rasterizer, } } -vk::Framebuffer BlitScreen::CreateFramebuffer(const Device& device, const Layout::FramebufferLayout& layout, - VkImageView image_view, - VkFormat current_view_format) { - bool format_updated = swapchain_view_format != current_view_format; - swapchain_view_format = current_view_format; - - if (!window_adapt || scaling_filter != filters.get_scaling_filter() || format_updated) { - WaitIdle(device); - SetWindowAdaptPass(device); - image_index = 0; - } - - const VkExtent2D extent{ - .width = layout.width, - .height = layout.height, - }; - - return CreateFramebuffer(device, image_view, extent, window_adapt->GetRenderPass()); -} - -vk::Framebuffer BlitScreen::CreateFramebuffer(const Device& device, const VkImageView& image_view, VkExtent2D extent, - VkRenderPass render_pass) { - return device.GetLogical().CreateFramebuffer(VkFramebufferCreateInfo{ - .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .renderPass = render_pass, - .attachmentCount = 1, - .pAttachments = &image_view, - .width = extent.width, - .height = extent.height, - .layers = 1, - }); -} - } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.h b/src/video_core/renderer_vulkan/vk_blit_screen.h index 56b429ae53..46d42d3a73 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.h +++ b/src/video_core/renderer_vulkan/vk_blit_screen.h @@ -62,15 +62,9 @@ public: void PrepareFrame(const Device& device, Frame* frame, const Layout::FramebufferLayout& layout); - [[nodiscard]] vk::Framebuffer CreateFramebuffer(const Device& device, const Layout::FramebufferLayout& layout, - VkImageView image_view, - VkFormat current_view_format); - private: void WaitIdle(const Device& device); void SetWindowAdaptPass(const Device& device); - vk::Framebuffer CreateFramebuffer(const Device& device, const VkImageView& image_view, VkExtent2D extent, - VkRenderPass render_pass); Tegra::MaxwellDeviceMemoryManager& device_memory; MemoryAllocator& memory_allocator; diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index 87eb109877..58b2f14670 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -209,7 +209,7 @@ bool PresentManager::NeedsStorage(const Frame* frame, bool required) const { } void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat image_view_format, - VkRenderPass rd, bool storage) { + bool storage) { auto& dld = device.GetLogical(); frame->width = width; @@ -295,19 +295,6 @@ void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat }, }); } - - const VkImageView image_view{*frame->image_view}; - frame->framebuffer = dld.CreateFramebuffer({ - .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .renderPass = rd, - .attachmentCount = 1, - .pAttachments = &image_view, - .width = width, - .height = height, - .layers = 1, - }); } void PresentManager::WaitPresent() { diff --git a/src/video_core/renderer_vulkan/vk_present_manager.h b/src/video_core/renderer_vulkan/vk_present_manager.h index ab2b76f10f..bde5bb1d5d 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.h +++ b/src/video_core/renderer_vulkan/vk_present_manager.h @@ -33,7 +33,6 @@ struct Frame { vk::Image image; vk::ImageView image_view; vk::ImageView storage_view; - vk::Framebuffer framebuffer; vk::CommandBuffer cmdbuf; vk::Semaphore render_ready; vk::Fence present_done; @@ -59,7 +58,7 @@ public: /// Recreates the present frame to match the provided parameters void RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat image_view_format, - VkRenderPass rd, bool storage); + bool storage); [[nodiscard]] bool NeedsStorage(const Frame* frame, bool required) const; diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index bac558f4bb..6ec6bc88e9 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1423,8 +1423,7 @@ void Device::RemoveUnsuitableExtensions() { extensions.synchronization2 = features.synchronization2.synchronization2; extensions.dynamic_rendering = features.dynamic_rendering.dynamicRendering; - if (!extensions.synchronization2 || !extensions.dynamic_rendering || - !IsKhrCreateRenderPass2Supported()) { + if (!extensions.synchronization2 || !extensions.dynamic_rendering) { throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 91e92c6441..7a8de7beb8 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -637,11 +637,6 @@ FN_MAX_LIMIT_LIST return extensions.shader_stencil_export; } - /// Returns true if the device supports VK_KHR_create_renderpass2. - bool IsKhrCreateRenderPass2Supported() const { - return extensions.create_renderpass2 || instance_version >= VK_API_VERSION_1_2; - } - /// Returns true if the device supports VK_KHR_depth_stencil_resolve. bool IsKhrDepthStencilResolveSupported() const { return extensions.depth_stencil_resolve || instance_version >= VK_API_VERSION_1_2; diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index c4d99d08f4..092914ca03 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -88,7 +88,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkBeginCommandBuffer); X(vkCmdBeginConditionalRenderingEXT); X(vkCmdBeginQuery); - X(vkCmdBeginRenderPass); X(vkCmdBeginRendering); X(vkCmdBeginTransformFeedbackEXT); X(vkCmdBindDescriptorSets); @@ -116,7 +115,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdDrawIndirectByteCountEXT); X(vkCmdEndConditionalRenderingEXT); X(vkCmdEndQuery); - X(vkCmdEndRenderPass); X(vkCmdEndRendering); X(vkCmdEndTransformFeedbackEXT); X(vkCmdFillBuffer); @@ -169,13 +167,11 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCreateDescriptorSetLayout); X(vkCreateDescriptorUpdateTemplate); X(vkCreateFence); - X(vkCreateFramebuffer); X(vkCreateGraphicsPipelines); X(vkCreateImageView); X(vkCreatePipelineCache); X(vkCreatePipelineLayout); X(vkCreateQueryPool); - X(vkCreateRenderPass2); X(vkCreateSampler); X(vkCreateSemaphore); X(vkCreateShaderModule); @@ -187,14 +183,12 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkDestroyDescriptorSetLayout); X(vkDestroyDescriptorUpdateTemplate); X(vkDestroyFence); - X(vkDestroyFramebuffer); X(vkDestroyImage); X(vkDestroyImageView); X(vkDestroyPipeline); X(vkDestroyPipelineCache); X(vkDestroyPipelineLayout); X(vkDestroyQueryPool); - X(vkDestroyRenderPass); X(vkDestroySampler); X(vkDestroySemaphore); X(vkDestroyShaderModule); @@ -265,10 +259,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { if (!dld.vkCmdEndRendering) { Proc(dld.vkCmdEndRendering, dld, "vkCmdEndRenderingKHR", device); } - - if (!dld.vkCreateRenderPass2) { - Proc(dld.vkCreateRenderPass2, dld, "vkCreateRenderPass2KHR", device); - } #undef X } @@ -363,10 +353,6 @@ void Destroy(VkDevice device, VkFence handle, const DeviceDispatch& dld) noexcep dld.vkDestroyFence(device, handle, nullptr); } -void Destroy(VkDevice device, VkFramebuffer handle, const DeviceDispatch& dld) noexcept { - dld.vkDestroyFramebuffer(device, handle, nullptr); -} - void Destroy(VkDevice device, VkImage handle, const DeviceDispatch& dld) noexcept { dld.vkDestroyImage(device, handle, nullptr); } @@ -391,10 +377,6 @@ void Destroy(VkDevice device, VkQueryPool handle, const DeviceDispatch& dld) noe dld.vkDestroyQueryPool(device, handle, nullptr); } -void Destroy(VkDevice device, VkRenderPass handle, const DeviceDispatch& dld) noexcept { - dld.vkDestroyRenderPass(device, handle, nullptr); -} - void Destroy(VkDevice device, VkSampler handle, const DeviceDispatch& dld) noexcept { dld.vkDestroySampler(device, handle, nullptr); } @@ -529,10 +511,6 @@ void Fence::SetObjectNameEXT(const char* name) const { SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_FENCE, name); } -void Framebuffer::SetObjectNameEXT(const char* name) const { - SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_FRAMEBUFFER, name); -} - DescriptorSets DescriptorPool::Allocate(const VkDescriptorSetAllocateInfo& ai) const { const std::size_t num = ai.descriptorSetCount; std::unique_ptr sets = std::make_unique(num); @@ -662,12 +640,6 @@ DescriptorPool Device::CreateDescriptorPool(const VkDescriptorPoolCreateInfo& ci return DescriptorPool(object, handle, *dld); } -RenderPass Device::CreateRenderPass2(const VkRenderPassCreateInfo2& ci) const { - VkRenderPass object; - Check(dld->vkCreateRenderPass2(handle, &ci, nullptr, &object)); - return RenderPass(object, handle, *dld); -} - DescriptorSetLayout Device::CreateDescriptorSetLayout( const VkDescriptorSetLayoutCreateInfo& ci) const { VkDescriptorSetLayout object; @@ -712,12 +684,6 @@ Sampler Device::CreateSampler(const VkSamplerCreateInfo& ci) const { return Sampler(object, handle, *dld); } -Framebuffer Device::CreateFramebuffer(const VkFramebufferCreateInfo& ci) const { - VkFramebuffer object; - Check(dld->vkCreateFramebuffer(handle, &ci, nullptr, &object)); - return Framebuffer(object, handle, *dld); -} - CommandPool Device::CreateCommandPool(const VkCommandPoolCreateInfo& ci) const { VkCommandPool object; Check(dld->vkCreateCommandPool(handle, &ci, nullptr, &object)); diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 2007658c35..26f8f2a0f5 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -237,7 +237,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkBeginCommandBuffer vkBeginCommandBuffer{}; PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT{}; PFN_vkCmdBeginQuery vkCmdBeginQuery{}; - PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass{}; PFN_vkCmdBeginRendering vkCmdBeginRendering{}; PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT{}; PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets{}; @@ -266,7 +265,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdDrawIndirectByteCountEXT vkCmdDrawIndirectByteCountEXT{}; PFN_vkCmdEndConditionalRenderingEXT vkCmdEndConditionalRenderingEXT{}; PFN_vkCmdEndQuery vkCmdEndQuery{}; - PFN_vkCmdEndRenderPass vkCmdEndRenderPass{}; PFN_vkCmdEndRendering vkCmdEndRendering{}; PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT{}; PFN_vkCmdFillBuffer vkCmdFillBuffer{}; @@ -318,13 +316,11 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout{}; PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate{}; PFN_vkCreateFence vkCreateFence{}; - PFN_vkCreateFramebuffer vkCreateFramebuffer{}; PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines{}; PFN_vkCreateImageView vkCreateImageView{}; PFN_vkCreatePipelineCache vkCreatePipelineCache{}; PFN_vkCreatePipelineLayout vkCreatePipelineLayout{}; PFN_vkCreateQueryPool vkCreateQueryPool{}; - PFN_vkCreateRenderPass2 vkCreateRenderPass2{}; PFN_vkCreateSampler vkCreateSampler{}; PFN_vkCreateSemaphore vkCreateSemaphore{}; PFN_vkCreateShaderModule vkCreateShaderModule{}; @@ -336,14 +332,12 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout{}; PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate{}; PFN_vkDestroyFence vkDestroyFence{}; - PFN_vkDestroyFramebuffer vkDestroyFramebuffer{}; PFN_vkDestroyImage vkDestroyImage{}; PFN_vkDestroyImageView vkDestroyImageView{}; PFN_vkDestroyPipeline vkDestroyPipeline{}; PFN_vkDestroyPipelineCache vkDestroyPipelineCache{}; PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout{}; PFN_vkDestroyQueryPool vkDestroyQueryPool{}; - PFN_vkDestroyRenderPass vkDestroyRenderPass{}; PFN_vkDestroySampler vkDestroySampler{}; PFN_vkDestroySemaphore vkDestroySemaphore{}; PFN_vkDestroyShaderModule vkDestroyShaderModule{}; @@ -396,14 +390,12 @@ void Destroy(VkDevice, VkDescriptorPool, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorSetLayout, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorUpdateTemplate, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkFence, const DeviceDispatch&) noexcept; -void Destroy(VkDevice, VkFramebuffer, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkImage, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkImageView, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkPipeline, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkPipelineCache, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkPipelineLayout, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkQueryPool, const DeviceDispatch&) noexcept; -void Destroy(VkDevice, VkRenderPass, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkSampler, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkSwapchainKHR, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkSemaphore, const DeviceDispatch&) noexcept; @@ -651,7 +643,6 @@ using DescriptorUpdateTemplate = Handle; using PipelineLayout = Handle; using QueryPool = Handle; -using RenderPass = Handle; using Sampler = Handle; using SurfaceKHR = Handle; @@ -905,14 +896,6 @@ public: } }; -class Framebuffer : public Handle { - using Handle::Handle; - -public: - /// Set object name. - void SetObjectNameEXT(const char* name) const; -}; - class DescriptorPool : public Handle { using Handle::Handle; @@ -1025,8 +1008,6 @@ public: [[nodiscard]] DescriptorPool CreateDescriptorPool(const VkDescriptorPoolCreateInfo& ci) const; - [[nodiscard]] RenderPass CreateRenderPass2(const VkRenderPassCreateInfo2& ci) const; - [[nodiscard]] DescriptorSetLayout CreateDescriptorSetLayout( const VkDescriptorSetLayoutCreateInfo& ci) const; @@ -1042,8 +1023,6 @@ public: [[nodiscard]] Sampler CreateSampler(const VkSamplerCreateInfo& ci) const; - [[nodiscard]] Framebuffer CreateFramebuffer(const VkFramebufferCreateInfo& ci) const; - [[nodiscard]] CommandPool CreateCommandPool(const VkCommandPoolCreateInfo& ci) const; [[nodiscard]] DescriptorUpdateTemplate CreateDescriptorUpdateTemplate( @@ -1187,15 +1166,6 @@ public: Check(dld->vkEndCommandBuffer(handle)); } - void BeginRenderPass(const VkRenderPassBeginInfo& renderpass_bi, - VkSubpassContents contents) const noexcept { - dld->vkCmdBeginRenderPass(handle, &renderpass_bi, contents); - } - - void EndRenderPass() const noexcept { - dld->vkCmdEndRenderPass(handle); - } - void BeginRendering(const VkRenderingInfo& rendering_info) const noexcept { dld->vkCmdBeginRendering(handle, &rendering_info); } From 4f5fc58b6e907fac95553ea0e81fa876ef943eeb Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 03:00:07 -0400 Subject: [PATCH 135/198] Use copy commands 2 --- .../renderer_vulkan/present/frame_gen.cpp | 6 +- .../renderer_vulkan/present/layer.cpp | 4 +- .../renderer_vulkan/present/util.cpp | 12 ++- .../renderer_vulkan/vk_buffer_cache.cpp | 12 ++- .../renderer_vulkan/vk_present_manager.cpp | 16 +-- .../renderer_vulkan/vk_query_cache.cpp | 22 +++-- .../renderer_vulkan/vk_texture_cache.cpp | 93 +++++++++--------- .../vulkan_common/vulkan_device.cpp | 4 +- src/video_core/vulkan_common/vulkan_device.h | 1 + .../vulkan_common/vulkan_wrapper.cpp | 31 +++--- src/video_core/vulkan_common/vulkan_wrapper.h | 98 ++++++++++++++----- 11 files changed, 193 insertions(+), 106 deletions(-) diff --git a/src/video_core/renderer_vulkan/present/frame_gen.cpp b/src/video_core/renderer_vulkan/present/frame_gen.cpp index d5916d6170..38981448de 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen.cpp @@ -140,8 +140,10 @@ VkImageMemoryBarrier2 MakeTransitionBarrier(VkImage image, VkPipelineStageFlags2 }; } -VkImageCopy MakeCopyRegion(VkExtent2D extent) { - return VkImageCopy{ +VkImageCopy2 MakeCopyRegion(VkExtent2D extent) { + return VkImageCopy2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_COPY_2, + .pNext = nullptr, .srcSubresource{ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .mipLevel = 0, diff --git a/src/video_core/renderer_vulkan/present/layer.cpp b/src/video_core/renderer_vulkan/present/layer.cpp index 562928b953..d0411df705 100644 --- a/src/video_core/renderer_vulkan/present/layer.cpp +++ b/src/video_core/renderer_vulkan/present/layer.cpp @@ -343,7 +343,9 @@ void Layer::UpdateRawImage(const Tegra::FramebufferConfig& framebuffer, size_t i buffer.Flush(); // Ensure host writes are visible before the GPU copy. } - const VkBufferImageCopy copy{ + const VkBufferImageCopy2 copy{ + .sType = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, + .pNext = nullptr, .bufferOffset = image_offset, .bufferRowLength = 0, .bufferImageHeight = 0, diff --git a/src/video_core/renderer_vulkan/present/util.cpp b/src/video_core/renderer_vulkan/present/util.cpp index f04df4afd2..63e8e5f5e8 100644 --- a/src/video_core/renderer_vulkan/present/util.cpp +++ b/src/video_core/renderer_vulkan/present/util.cpp @@ -89,7 +89,9 @@ void UploadImage(const Device& device, MemoryAllocator& allocator, Scheduler& sc std::ranges::copy(initial_contents, upload_buffer.Mapped().begin()); upload_buffer.Flush(); - const std::array regions{{{ + const VkBufferImageCopy2 region{ + .sType = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, + .pNext = nullptr, .bufferOffset = 0, .bufferRowLength = dimensions.width, .bufferImageHeight = dimensions.height, @@ -99,14 +101,14 @@ void UploadImage(const Device& device, MemoryAllocator& allocator, Scheduler& sc .layerCount = 1}, .imageOffset{}, .imageExtent{.width = dimensions.width, .height = dimensions.height, .depth = 1}, - }}}; + }; scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([&](vk::CommandBuffer cmdbuf) { TransitionImageLayout(cmdbuf, *image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_UNDEFINED); cmdbuf.CopyBufferToImage(*upload_buffer, *image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - regions); + region); TransitionImageLayout(cmdbuf, *image, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); }); @@ -163,7 +165,9 @@ void DownloadColorImage(vk::CommandBuffer& cmdbuf, VkImage image, VkBuffer buffe .dstStageMask = vk::PIPELINE_STAGE_HOST, .dstAccessMask = VK_ACCESS_2_HOST_READ_BIT, }; - const VkBufferImageCopy copy{ + const VkBufferImageCopy2 copy{ + .sType = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, + .pNext = nullptr, .bufferOffset = 0, .bufferRowLength = 0, .bufferImageHeight = 0, diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 7b9287d797..488fd639aa 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -36,8 +36,10 @@ struct VertexBindings { u32 count; }; -VkBufferCopy MakeBufferCopy(const VideoCommon::BufferCopy& copy) { - return VkBufferCopy{ +VkBufferCopy2 MakeBufferCopy(const VideoCommon::BufferCopy& copy) { + return VkBufferCopy2{ + .sType = VK_STRUCTURE_TYPE_BUFFER_COPY_2, + .pNext = nullptr, .srcOffset = copy.src_offset, .dstOffset = copy.dst_offset, .size = copy.size, @@ -234,7 +236,9 @@ public: scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([src_buffer = staging.buffer, src_offset = staging.offset, dst_buffer = *buffer, size_bytes](vk::CommandBuffer cmdbuf) { - const VkBufferCopy copy{ + const VkBufferCopy2 copy{ + .sType = VK_STRUCTURE_TYPE_BUFFER_COPY_2, + .pNext = nullptr, .srcOffset = src_offset, .dstOffset = 0, .size = size_bytes, @@ -500,7 +504,7 @@ void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, } // Measuring a popular game, this number never exceeds the specified size once data is warmed up - boost::container::small_vector vk_copies(copies.size()); + boost::container::small_vector vk_copies(copies.size()); std::ranges::transform(copies, vk_copies.begin(), MakeBufferCopy); if (src_buffer == staging_pool.StreamBuf() && can_reorder_upload) { scheduler.RecordWithUploadBuffer([src_buffer, dst_buffer, vk_copies]( diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index 58b2f14670..144a23b4b8 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -51,9 +51,11 @@ bool CanBlitToSwapchain(const vk::PhysicalDevice& physical_device, VkFormat form }; } -[[nodiscard]] VkImageBlit MakeImageBlit(s32 frame_width, s32 frame_height, s32 swapchain_width, - s32 swapchain_height) { - return VkImageBlit{ +[[nodiscard]] VkImageBlit2 MakeImageBlit(s32 frame_width, s32 frame_height, s32 swapchain_width, + s32 swapchain_height) { + return VkImageBlit2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_BLIT_2, + .pNext = nullptr, .srcSubresource = MakeImageSubresourceLayers(), .srcOffsets = { @@ -85,9 +87,11 @@ bool CanBlitToSwapchain(const vk::PhysicalDevice& physical_device, VkFormat form }; } -[[nodiscard]] VkImageCopy MakeImageCopy(u32 frame_width, u32 frame_height, u32 swapchain_width, - u32 swapchain_height) { - return VkImageCopy{ +[[nodiscard]] VkImageCopy2 MakeImageCopy(u32 frame_width, u32 frame_height, u32 swapchain_width, + u32 swapchain_height) { + return VkImageCopy2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_COPY_2, + .pNext = nullptr, .srcSubresource = MakeImageSubresourceLayers(), .srcOffset = { diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 5a574e289a..3fab3eb7fd 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -653,11 +653,13 @@ public: scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([this, dst_buffer = stagging_buffer.buffer, extra_offset, start, size](vk::CommandBuffer cmdbuf) { - std::array copy{VkBufferCopy{ + const VkBufferCopy2 copy{ + .sType = VK_STRUCTURE_TYPE_BUFFER_COPY_2, + .pNext = nullptr, .srcOffset = start * QUERY_SIZE, .dstOffset = extra_offset, .size = size * QUERY_SIZE, - }}; + }; cmdbuf.CopyBuffer(*buffer, dst_buffer, copy); }); } @@ -1040,11 +1042,13 @@ private: src_offset = offsets[slot_index], slot](vk::CommandBuffer cmdbuf) { cmdbuf.PipelineBarrier(READ_BARRIER); - std::array copy{VkBufferCopy{ + const VkBufferCopy2 copy{ + .sType = VK_STRUCTURE_TYPE_BUFFER_COPY_2, + .pNext = nullptr, .srcOffset = src_offset, .dstOffset = slot * TFBQueryBank::QUERY_SIZE, .size = TFBQueryBank::QUERY_SIZE, - }}; + }; cmdbuf.CopyBuffer(src_buffer, dst_buffer, copy); cmdbuf.PipelineBarrier(WRITE_BARRIER); }); @@ -1339,7 +1343,7 @@ struct QueryCacheRuntimeImpl { std::vector> little_cache; std::vector> buffers_to_upload_to; std::vector redirect_cache; - std::vector> copies_setup; + std::vector> copies_setup; // Host conditional rendering data std::optional conditional_resolve_pass; @@ -1657,7 +1661,9 @@ void QueryCacheRuntime::SyncValues(std::span values, VkBuffer ba size_t accumulated_size = 0; for (size_t i = 0; i < values.size(); i++) { size_t which_copy = impl->redirect_cache[i]; - impl->copies_setup[which_copy].emplace_back(VkBufferCopy{ + impl->copies_setup[which_copy].emplace_back(VkBufferCopy2{ + .sType = VK_STRUCTURE_TYPE_BUFFER_COPY_2, + .pNext = nullptr, .srcOffset = current_offset + accumulated_size, .dstOffset = impl->buffers_to_upload_to[which_copy].second + values[i].address - impl->little_cache[which_copy].first, @@ -1671,7 +1677,9 @@ void QueryCacheRuntime::SyncValues(std::span values, VkBuffer ba } else { for (size_t i = 0; i < values.size(); i++) { size_t which_copy = impl->redirect_cache[i]; - impl->copies_setup[which_copy].emplace_back(VkBufferCopy{ + impl->copies_setup[which_copy].emplace_back(VkBufferCopy2{ + .sType = VK_STRUCTURE_TYPE_BUFFER_COPY_2, + .pNext = nullptr, .srcOffset = values[i].offset, .dstOffset = impl->buffers_to_upload_to[which_copy].second + values[i].address - impl->little_cache[which_copy].first, diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 55b3b7e81d..a7c22db002 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -503,9 +503,11 @@ void SanitizeDepthStencilSwizzle(std::array& swizzle, }; } -[[nodiscard]] VkImageCopy MakeImageCopy(const VideoCommon::ImageCopy& copy, - VkImageAspectFlags aspect_mask) noexcept { - return VkImageCopy{ +[[nodiscard]] VkImageCopy2 MakeImageCopy(const VideoCommon::ImageCopy& copy, + VkImageAspectFlags aspect_mask) noexcept { + return VkImageCopy2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_COPY_2, + .pNext = nullptr, .srcSubresource = MakeImageSubresourceLayers(copy.src_subresource, aspect_mask), .srcOffset = MakeOffset3D(copy.src_offset), .dstSubresource = MakeImageSubresourceLayers(copy.dst_subresource, aspect_mask), @@ -514,9 +516,12 @@ void SanitizeDepthStencilSwizzle(std::array& swizzle, }; } -[[nodiscard]] VkBufferImageCopy MakeBufferImageCopy(const VideoCommon::ImageCopy& copy, bool is_src, - VkImageAspectFlags aspect_mask) noexcept { - return VkBufferImageCopy{ +[[nodiscard]] VkBufferImageCopy2 MakeBufferImageCopy(const VideoCommon::ImageCopy& copy, + bool is_src, + VkImageAspectFlags aspect_mask) noexcept { + return VkBufferImageCopy2{ + .sType = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, + .pNext = nullptr, .bufferOffset = 0, .bufferRowLength = 0, .bufferImageHeight = 0, @@ -527,25 +532,13 @@ void SanitizeDepthStencilSwizzle(std::array& swizzle, }; } -[[maybe_unused]] [[nodiscard]] boost::container::small_vector -TransformBufferCopies(std::span copies, size_t buffer_offset) { - boost::container::small_vector result(copies.size()); - std::ranges::transform( - copies, result.begin(), [buffer_offset](const VideoCommon::BufferCopy& copy) { - return VkBufferCopy{ - .srcOffset = static_cast(copy.src_offset + buffer_offset), - .dstOffset = static_cast(copy.dst_offset), - .size = static_cast(copy.size), - }; - }); - return result; -} - -[[nodiscard]] boost::container::small_vector TransformBufferImageCopies( +[[nodiscard]] boost::container::small_vector TransformBufferImageCopies( std::span copies, size_t buffer_offset, VkImageAspectFlags aspect_mask) { struct Maker { - VkBufferImageCopy operator()(const BufferImageCopy& copy) const { - return VkBufferImageCopy{ + VkBufferImageCopy2 operator()(const BufferImageCopy& copy) const { + return VkBufferImageCopy2{ + .sType = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, + .pNext = nullptr, .bufferOffset = copy.buffer_offset + buffer_offset, .bufferRowLength = copy.buffer_row_length, .bufferImageHeight = copy.buffer_image_height, @@ -574,14 +567,14 @@ TransformBufferCopies(std::span copies, size_t bu VkImageAspectFlags aspect_mask; }; if (aspect_mask == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { - boost::container::small_vector result(copies.size() * 2); + boost::container::small_vector result(copies.size() * 2); std::ranges::transform(copies, result.begin(), Maker{buffer_offset, VK_IMAGE_ASPECT_DEPTH_BIT}); std::ranges::transform(copies, result.begin() + copies.size(), Maker{buffer_offset, VK_IMAGE_ASPECT_STENCIL_BIT}); return result; } else { - boost::container::small_vector result(copies.size()); + boost::container::small_vector result(copies.size()); std::ranges::transform(copies, result.begin(), Maker{buffer_offset, aspect_mask}); return result; } @@ -688,7 +681,7 @@ struct RangedBarrierRange { }; void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage image, VkImageAspectFlags aspect_mask, bool is_initialized, - std::span copies) { + std::span copies) { // Compute exact mip/layer range being written to RangedBarrierRange range; for (const auto& region : copies) { @@ -732,10 +725,12 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im cmdbuf.PipelineBarrier(0, {}, {}, write_barrier); } -[[nodiscard]] VkImageBlit MakeImageBlit(const Region2D& dst_region, const Region2D& src_region, - const VkImageSubresourceLayers& dst_layers, - const VkImageSubresourceLayers& src_layers) { - return VkImageBlit{ +[[nodiscard]] VkImageBlit2 MakeImageBlit(const Region2D& dst_region, const Region2D& src_region, + const VkImageSubresourceLayers& dst_layers, + const VkImageSubresourceLayers& src_layers) { + return VkImageBlit2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_BLIT_2, + .pNext = nullptr, .srcSubresource = src_layers, .srcOffsets = { @@ -772,11 +767,13 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im dst_region.end.y - dst_region.start.y == src_region.end.y - src_region.start.y; } -[[nodiscard]] VkImageResolve MakeImageResolve(const Region2D& dst_region, - const Region2D& src_region, - const VkImageSubresourceLayers& dst_layers, - const VkImageSubresourceLayers& src_layers) { - return VkImageResolve{ +[[nodiscard]] VkImageResolve2 MakeImageResolve(const Region2D& dst_region, + const Region2D& src_region, + const VkImageSubresourceLayers& dst_layers, + const VkImageSubresourceLayers& src_layers) { + return VkImageResolve2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2, + .pNext = nullptr, .srcSubresource = src_layers, .srcOffset = { @@ -879,10 +876,12 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const .x = static_cast(up_scaling ? scaled_width : extent.width), .y = static_cast(up_scaling ? scaled_height : extent.height), }; - boost::container::small_vector regions; + boost::container::small_vector regions; regions.reserve(resources.levels); for (s32 level = 0; level < resources.levels; level++) { regions.push_back({ + .sType = VK_STRUCTURE_TYPE_IMAGE_BLIT_2, + .pNext = nullptr, .srcSubresource{ .aspectMask = aspect_mask, .mipLevel = static_cast(level), @@ -1237,8 +1236,8 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, if (ENABLE_MSAA_RESOLVE_CONSUME) { InvalidateResolveShadow(dst.Handle()); } - boost::container::small_vector vk_in_copies(copies.size()); - boost::container::small_vector vk_out_copies(copies.size()); + boost::container::small_vector vk_in_copies(copies.size()); + boost::container::small_vector vk_out_copies(copies.size()); const VkImageAspectFlags src_aspect_mask = src.AspectMask(); const VkImageAspectFlags dst_aspect_mask = dst.AspectMask(); @@ -1267,10 +1266,10 @@ void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, vk_in_copies, vk_out_copies](vk::CommandBuffer cmdbuf) { RangedBarrierRange dst_range; RangedBarrierRange src_range; - for (const VkBufferImageCopy& copy : vk_in_copies) { + for (const VkBufferImageCopy2& copy : vk_in_copies) { src_range.AddLayers(copy.imageSubresource); } - for (const VkBufferImageCopy& copy : vk_out_copies) { + for (const VkBufferImageCopy2& copy : vk_out_copies) { dst_range.AddLayers(copy.imageSubresource); } static constexpr VkMemoryBarrier2 READ_BARRIER{ @@ -1397,7 +1396,6 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst } }(); // Use shader-based depth/stencil blits if hardware doesn't support the format - // Note: MSAA resolves (MSAA->single) use vkCmdResolveImage which works fine if (!can_blit_depth_stencil) { UNIMPLEMENTED_IF(is_src_msaa || is_dst_msaa); blit_image_helper.BlitDepthStencil(dst_framebuffer, src, dst_region, src_region, @@ -1647,7 +1645,7 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, }; return ReinterpretImage(dst, src, std::span{&oneCopy, 1}); } - boost::container::small_vector vk_copies(copies.size()); + boost::container::small_vector vk_copies(copies.size()); const VkImageAspectFlags aspect_mask = dst.AspectMask(); ASSERT(aspect_mask == src.AspectMask()); @@ -1660,7 +1658,7 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, scheduler.Record([dst_image, src_image, aspect_mask, vk_copies](vk::CommandBuffer cmdbuf) { RangedBarrierRange dst_range; RangedBarrierRange src_range; - for (const VkImageCopy& copy : vk_copies) { + for (const VkImageCopy2& copy : vk_copies) { dst_range.AddLayers(copy.dstSubresource); src_range.AddLayers(copy.srcSubresource); } @@ -1749,7 +1747,9 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, const VkImageAspectFlags aspect_mask = shadow->aspect_mask; const VkImage shadow_image = *shadow->image; const VkImage dst_image = dst.Handle(); - const VkImageCopy region{ + const VkImageCopy2 region{ + .sType = VK_STRUCTURE_TYPE_IMAGE_COPY_2, + .pNext = nullptr, .srcSubresource{ .aspectMask = aspect_mask, .mipLevel = 0, @@ -2199,7 +2199,8 @@ void Image::DownloadMemory(std::span buffers_span, std::span o } boost::container::small_vector buffers_vector{}; - boost::container::small_vector, 8> + boost::container::small_vector< + boost::container::small_vector, 8> vk_copies; for (size_t index = 0; index < buffers_span.size(); index++) { buffers_vector.emplace_back(buffers_span[index]); @@ -2278,7 +2279,7 @@ void Image::DownloadMemory(std::span buffers_span, std::span o return; } else { boost::container::small_vector buffers_vector{}; - boost::container::small_vector, 8> + boost::container::small_vector, 8> vk_copies; for (size_t index = 0; index < buffers_span.size(); index++) { buffers_vector.emplace_back(buffers_span[index]); diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 6ec6bc88e9..6c52137e08 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1423,7 +1423,9 @@ void Device::RemoveUnsuitableExtensions() { extensions.synchronization2 = features.synchronization2.synchronization2; extensions.dynamic_rendering = features.dynamic_rendering.dynamicRendering; - if (!extensions.synchronization2 || !extensions.dynamic_rendering) { + const bool copy_commands2 = + extensions.copy_commands2 || instance_version >= VK_API_VERSION_1_3; + if (!extensions.synchronization2 || !extensions.dynamic_rendering || !copy_commands2) { throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 7a8de7beb8..460a3b702e 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -97,6 +97,7 @@ VK_DEFINE_HANDLE(VmaAllocator) EXTENSION(EXT, SHADER_VIEWPORT_INDEX_LAYER, shader_viewport_index_layer) \ EXTENSION(EXT, TOOLING_INFO, tooling_info) \ EXTENSION(EXT, VERTEX_ATTRIBUTE_DIVISOR, vertex_attribute_divisor) \ + EXTENSION(KHR, COPY_COMMANDS_2, copy_commands2) \ EXTENSION(KHR, CREATE_RENDERPASS_2, create_renderpass2) \ EXTENSION(KHR, DEPTH_STENCIL_RESOLVE, depth_stencil_resolve) \ EXTENSION(KHR, DRAW_INDIRECT_COUNT, draw_indirect_count) \ diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 092914ca03..9a901cd8fb 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -96,13 +96,13 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdBindPipeline); X(vkCmdBindTransformFeedbackBuffersEXT); X(vkCmdBindVertexBuffers); - X(vkCmdBlitImage); + X(vkCmdBlitImage2); X(vkCmdClearAttachments); X(vkCmdClearColorImage); - X(vkCmdCopyBuffer); - X(vkCmdCopyBufferToImage); - X(vkCmdCopyImage); - X(vkCmdCopyImageToBuffer); + X(vkCmdCopyBuffer2); + X(vkCmdCopyBufferToImage2); + X(vkCmdCopyImage2); + X(vkCmdCopyImageToBuffer2); X(vkCmdCopyQueryPoolResults); X(vkCmdDispatch); X(vkCmdDispatchIndirect); @@ -158,7 +158,7 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdSetColorBlendEnableEXT); X(vkCmdSetColorBlendEquationEXT); X(vkCmdResetQueryPool); - X(vkCmdResolveImage); + X(vkCmdResolveImage2); X(vkCreateBuffer); X(vkCreateBufferView); X(vkCreateCommandPool); @@ -253,12 +253,19 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { Proc(dld.vkQueueSubmit2, dld, "vkQueueSubmit2KHR", device); } - if (!dld.vkCmdBeginRendering) { - Proc(dld.vkCmdBeginRendering, dld, "vkCmdBeginRenderingKHR", device); - } - if (!dld.vkCmdEndRendering) { - Proc(dld.vkCmdEndRendering, dld, "vkCmdEndRenderingKHR", device); - } + const auto load_khr = [&](auto& function, const char* name) { + if (!function) { + Proc(function, dld, name, device); + } + }; + load_khr(dld.vkCmdBeginRendering, "vkCmdBeginRenderingKHR"); + load_khr(dld.vkCmdEndRendering, "vkCmdEndRenderingKHR"); + load_khr(dld.vkCmdBlitImage2, "vkCmdBlitImage2KHR"); + load_khr(dld.vkCmdCopyBuffer2, "vkCmdCopyBuffer2KHR"); + load_khr(dld.vkCmdCopyBufferToImage2, "vkCmdCopyBufferToImage2KHR"); + load_khr(dld.vkCmdCopyImage2, "vkCmdCopyImage2KHR"); + load_khr(dld.vkCmdCopyImageToBuffer2, "vkCmdCopyImageToBuffer2KHR"); + load_khr(dld.vkCmdResolveImage2, "vkCmdResolveImage2KHR"); #undef X } diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 26f8f2a0f5..d524a36b65 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -246,13 +246,13 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT{}; PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers{}; PFN_vkCmdBindVertexBuffers2EXT vkCmdBindVertexBuffers2EXT{}; - PFN_vkCmdBlitImage vkCmdBlitImage{}; + PFN_vkCmdBlitImage2 vkCmdBlitImage2{}; PFN_vkCmdClearAttachments vkCmdClearAttachments{}; PFN_vkCmdClearColorImage vkCmdClearColorImage{}; - PFN_vkCmdCopyBuffer vkCmdCopyBuffer{}; - PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage{}; - PFN_vkCmdCopyImage vkCmdCopyImage{}; - PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer{}; + PFN_vkCmdCopyBuffer2 vkCmdCopyBuffer2{}; + PFN_vkCmdCopyBufferToImage2 vkCmdCopyBufferToImage2{}; + PFN_vkCmdCopyImage2 vkCmdCopyImage2{}; + PFN_vkCmdCopyImageToBuffer2 vkCmdCopyImageToBuffer2{}; PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults{}; PFN_vkCmdDispatch vkCmdDispatch{}; PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect{}; @@ -272,7 +272,7 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdPushConstants vkCmdPushConstants{}; PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR{}; PFN_vkCmdResetQueryPool vkCmdResetQueryPool{}; - PFN_vkCmdResolveImage vkCmdResolveImage{}; + PFN_vkCmdResolveImage2 vkCmdResolveImage2{}; PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants{}; PFN_vkCmdSetCullModeEXT vkCmdSetCullModeEXT{}; PFN_vkCmdSetDepthBias vkCmdSetDepthBias{}; @@ -1274,16 +1274,35 @@ public: } void BlitImage(VkImage src_image, VkImageLayout src_layout, VkImage dst_image, - VkImageLayout dst_layout, Span regions, + VkImageLayout dst_layout, Span regions, VkFilter filter) const noexcept { - dld->vkCmdBlitImage(handle, src_image, src_layout, dst_image, dst_layout, regions.size(), - regions.data(), filter); + const VkBlitImageInfo2 info{ + .sType = VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2, + .pNext = nullptr, + .srcImage = src_image, + .srcImageLayout = src_layout, + .dstImage = dst_image, + .dstImageLayout = dst_layout, + .regionCount = regions.size(), + .pRegions = regions.data(), + .filter = filter, + }; + dld->vkCmdBlitImage2(handle, &info); } void ResolveImage(VkImage src_image, VkImageLayout src_layout, VkImage dst_image, - VkImageLayout dst_layout, Span regions) { - dld->vkCmdResolveImage(handle, src_image, src_layout, dst_image, dst_layout, regions.size(), - regions.data()); + VkImageLayout dst_layout, Span regions) const noexcept { + const VkResolveImageInfo2 info{ + .sType = VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2, + .pNext = nullptr, + .srcImage = src_image, + .srcImageLayout = src_layout, + .dstImage = dst_image, + .dstImageLayout = dst_layout, + .regionCount = regions.size(), + .pRegions = regions.data(), + }; + dld->vkCmdResolveImage2(handle, &info); } void Dispatch(u32 x, u32 y, u32 z) const noexcept { @@ -1353,26 +1372,59 @@ public: } void CopyBufferToImage(VkBuffer src_buffer, VkImage dst_image, VkImageLayout dst_image_layout, - Span regions) const noexcept { - dld->vkCmdCopyBufferToImage(handle, src_buffer, dst_image, dst_image_layout, regions.size(), - regions.data()); + Span regions) const noexcept { + const VkCopyBufferToImageInfo2 info{ + .sType = VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2, + .pNext = nullptr, + .srcBuffer = src_buffer, + .dstImage = dst_image, + .dstImageLayout = dst_image_layout, + .regionCount = regions.size(), + .pRegions = regions.data(), + }; + dld->vkCmdCopyBufferToImage2(handle, &info); } void CopyBuffer(VkBuffer src_buffer, VkBuffer dst_buffer, - Span regions) const noexcept { - dld->vkCmdCopyBuffer(handle, src_buffer, dst_buffer, regions.size(), regions.data()); + Span regions) const noexcept { + const VkCopyBufferInfo2 info{ + .sType = VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2, + .pNext = nullptr, + .srcBuffer = src_buffer, + .dstBuffer = dst_buffer, + .regionCount = regions.size(), + .pRegions = regions.data(), + }; + dld->vkCmdCopyBuffer2(handle, &info); } void CopyImage(VkImage src_image, VkImageLayout src_layout, VkImage dst_image, - VkImageLayout dst_layout, Span regions) const noexcept { - dld->vkCmdCopyImage(handle, src_image, src_layout, dst_image, dst_layout, regions.size(), - regions.data()); + VkImageLayout dst_layout, Span regions) const noexcept { + const VkCopyImageInfo2 info{ + .sType = VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2, + .pNext = nullptr, + .srcImage = src_image, + .srcImageLayout = src_layout, + .dstImage = dst_image, + .dstImageLayout = dst_layout, + .regionCount = regions.size(), + .pRegions = regions.data(), + }; + dld->vkCmdCopyImage2(handle, &info); } void CopyImageToBuffer(VkImage src_image, VkImageLayout src_layout, VkBuffer dst_buffer, - Span regions) const noexcept { - dld->vkCmdCopyImageToBuffer(handle, src_image, src_layout, dst_buffer, regions.size(), - regions.data()); + Span regions) const noexcept { + const VkCopyImageToBufferInfo2 info{ + .sType = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2, + .pNext = nullptr, + .srcImage = src_image, + .srcImageLayout = src_layout, + .dstBuffer = dst_buffer, + .regionCount = regions.size(), + .pRegions = regions.data(), + }; + dld->vkCmdCopyImageToBuffer2(handle, &info); } void CopyQueryPoolResults(VkQueryPool query_pool, u32 first_query, u32 query_count, From dd1c024efc1043784d55ec2316dabed588affa5a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 12:05:15 -0400 Subject: [PATCH 136/198] Some corrections towards HCR + Discard MSAA --- .../host_shaders/vulkan_color_clear.frag | 9 +- src/video_core/renderer_vulkan/blit_image.cpp | 247 ++++++++---------- src/video_core/renderer_vulkan/blit_image.h | 46 ++-- .../renderer_vulkan/vk_query_cache.cpp | 35 +-- .../renderer_vulkan/vk_rasterizer.cpp | 3 +- .../renderer_vulkan/vk_scheduler.cpp | 31 ++- src/video_core/renderer_vulkan/vk_scheduler.h | 3 + .../renderer_vulkan/vk_texture_cache.cpp | 10 +- .../renderer_vulkan/vk_texture_cache.h | 10 - 9 files changed, 185 insertions(+), 209 deletions(-) diff --git a/src/video_core/host_shaders/vulkan_color_clear.frag b/src/video_core/host_shaders/vulkan_color_clear.frag index 617bf01e17..d17ce12b1a 100644 --- a/src/video_core/host_shaders/vulkan_color_clear.frag +++ b/src/video_core/host_shaders/vulkan_color_clear.frag @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,8 +10,10 @@ layout (push_constant) uniform PushConstants { vec4 clear_color; }; -layout(location = 0) out vec4 color; +layout(location = 0) out vec4 colors[8]; void main() { - color = clear_color; + for (int index = 0; index < 8; ++index) { + colors[index] = clear_color; + } } diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 6821ae9550..92f2d0ea5c 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -279,6 +279,44 @@ constexpr VkPipelineDepthStencilStateCreateInfo PIPELINE_DEPTH_ONLY_STATE_CREATE .maxDepthBounds = 0.0f, }; +constexpr VkPipelineDepthStencilStateCreateInfo PIPELINE_DEPTH_STENCIL_STATE_DISABLED_CREATE_INFO{ + .sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, + .pNext = nullptr, + .flags = 0, + .depthTestEnable = VK_FALSE, + .depthWriteEnable = VK_FALSE, + .depthCompareOp = VK_COMPARE_OP_ALWAYS, + .depthBoundsTestEnable = VK_FALSE, + .stencilTestEnable = VK_FALSE, + .front = VkStencilOpState{}, + .back = VkStencilOpState{}, + .minDepthBounds = 0.0f, + .maxDepthBounds = 0.0f, +}; + +using BlendAttachments = std::array; + +[[nodiscard]] VkPipelineColorBlendStateCreateInfo MakeColorBlendState( + const BlendAttachments& attachments, const RenderingFormats& formats) { + return VkPipelineColorBlendStateCreateInfo{ + .sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, + .pNext = nullptr, + .flags = 0, + .logicOpEnable = VK_FALSE, + .logicOp = VK_LOGIC_OP_CLEAR, + .attachmentCount = formats.num_colors, + .pAttachments = attachments.data(), + .blendConstants = {0.0f, 0.0f, 0.0f, 0.0f}, + }; +} + +[[nodiscard]] VkPipelineMultisampleStateCreateInfo MakeMultisampleState( + VkSampleCountFlagBits samples) { + VkPipelineMultisampleStateCreateInfo multisample_ci = PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; + multisample_ci.rasterizationSamples = samples; + return multisample_ci; +} + template inline constexpr VkSamplerCreateInfo SAMPLER_CREATE_INFO{ .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, @@ -628,6 +666,8 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, const ImageV const BlitImagePipelineKey key{ .formats = dst_framebuffer->Formats(), .operation = operation, + .samples = dst_framebuffer->Samples(), + .target = 0, }; VkSampler sampler = *nearest_sampler; if (is_linear) { @@ -645,6 +685,8 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, VkImageView const BlitImagePipelineKey key{ .formats = dst_framebuffer->Formats(), .operation = Tegra::Engines::Fermi2D::Operation::SrcCopy, + .samples = dst_framebuffer->Samples(), + .target = 0, }; const VkPipelineLayout layout = *one_texture_pipeline_layout; const VkPipeline pipeline = FindOrEmplaceColorPipeline(key); @@ -763,6 +805,8 @@ void BlitImageHelper::BlitDepthStencil(const Framebuffer* dst_framebuffer, const BlitImagePipelineKey key{ .formats = dst_framebuffer->Formats(), .operation = operation, + .samples = dst_framebuffer->Samples(), + .target = 0, }; VkPipeline pipeline{}; VkImageView src_stencil_view = VK_NULL_HANDLE; @@ -778,26 +822,22 @@ void BlitImageHelper::BlitDepthStencil(const Framebuffer* dst_framebuffer, void BlitImageHelper::ConvertD32ToR32(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertDepthToColorPipeline(convert_d32_to_r32_pipeline, dst_framebuffer->Formats()); - Convert(*convert_d32_to_r32_pipeline, dst_framebuffer, src_image_view); + Convert(*convert_depth_to_float_frag, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertR32ToD32(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertColorToDepthPipeline(convert_r32_to_d32_pipeline, dst_framebuffer->Formats()); - Convert(*convert_r32_to_d32_pipeline, dst_framebuffer, src_image_view); + Convert(*convert_float_to_depth_frag, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertD16ToR16(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertDepthToColorPipeline(convert_d16_to_r16_pipeline, dst_framebuffer->Formats()); - Convert(*convert_d16_to_r16_pipeline, dst_framebuffer, src_image_view); + Convert(*convert_depth_to_float_frag, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertR16ToD16(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertColorToDepthPipeline(convert_r16_to_d16_pipeline, dst_framebuffer->Formats()); - Convert(*convert_r16_to_d16_pipeline, dst_framebuffer, src_image_view); + Convert(*convert_float_to_depth_frag, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer, @@ -807,45 +847,37 @@ void BlitImageHelper::ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer, LOG_WARNING(Render_Vulkan, "ConvertABGR8ToD24S8 requires shader_stencil_export, skipping"); return; } - ConvertPipelineDepthTargetEx(convert_abgr8_to_d24s8_pipeline, dst_framebuffer->Formats(), - convert_abgr8_to_d24s8_frag); - Convert(*convert_abgr8_to_d24s8_pipeline, dst_framebuffer, src_image_view); + Convert(*convert_abgr8_to_d24s8_frag, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertABGR8ToD32F(const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { - ConvertPipelineDepthTargetEx(convert_abgr8_to_d32f_pipeline, dst_framebuffer->Formats(), - convert_abgr8_to_d32f_frag); - Convert(*convert_abgr8_to_d32f_pipeline, dst_framebuffer, src_image_view); + Convert(*convert_abgr8_to_d32f_frag, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertD32FToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view) { - ConvertPipelineColorTargetEx(convert_d32f_to_abgr8_pipeline, dst_framebuffer->Formats(), - convert_d32f_to_abgr8_frag); - ConvertDepthStencil(*convert_d32f_to_abgr8_pipeline, dst_framebuffer, src_image_view); + ConvertDepthStencil(*convert_d32f_to_abgr8_frag, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertD24S8ToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view) { - ConvertPipelineColorTargetEx(convert_d24s8_to_abgr8_pipeline, dst_framebuffer->Formats(), - convert_d24s8_to_abgr8_frag); - ConvertDepthStencil(*convert_d24s8_to_abgr8_pipeline, dst_framebuffer, src_image_view); + ConvertDepthStencil(*convert_d24s8_to_abgr8_frag, dst_framebuffer, src_image_view); } void BlitImageHelper::ConvertS8D24ToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view) { - ConvertPipelineColorTargetEx(convert_s8d24_to_abgr8_pipeline, dst_framebuffer->Formats(), - convert_s8d24_to_abgr8_frag); - ConvertDepthStencil(*convert_s8d24_to_abgr8_pipeline, dst_framebuffer, src_image_view); + ConvertDepthStencil(*convert_s8d24_to_abgr8_frag, dst_framebuffer, src_image_view); } -void BlitImageHelper::ClearColor(const Framebuffer* dst_framebuffer, u8 color_mask, +void BlitImageHelper::ClearColor(const Framebuffer* dst_framebuffer, u32 target, u8 color_mask, const std::array& clear_color, const Region2D& dst_region) { const BlitImagePipelineKey key{ .formats = dst_framebuffer->Formats(), .operation = Tegra::Engines::Fermi2D::Operation::BlendPremult, + .samples = dst_framebuffer->Samples(), + .target = target, }; const VkPipeline pipeline = FindOrEmplaceClearColorPipeline(key); const VkPipelineLayout layout = *clear_color_pipeline_layout; @@ -873,6 +905,7 @@ void BlitImageHelper::ClearDepthStencil(const Framebuffer* dst_framebuffer, bool .stencil_mask = stencil_mask, .stencil_compare_mask = stencil_compare_mask, .stencil_ref = stencil_ref, + .samples = dst_framebuffer->Samples(), }; const VkPipeline pipeline = FindOrEmplaceClearStencilPipeline(key); const VkPipelineLayout layout = *clear_color_pipeline_layout; @@ -1079,9 +1112,11 @@ void BlitImageHelper::CopyMSAA(VkImage dst_image, VideoCore::Surface::PixelForma aspect_info, false); } -void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_framebuffer, +void BlitImageHelper::Convert(VkShaderModule module, const Framebuffer* dst_framebuffer, const ImageView& src_image_view) { const VkPipelineLayout layout = *one_texture_pipeline_layout; + const VkPipeline pipeline = + FindOrEmplaceConvertPipeline(dst_framebuffer->Formats(), module, layout); const VkImageView src_view = src_image_view.Handle(Shader::TextureType::Color2D); const VkSampler sampler = *nearest_sampler; const VkExtent2D extent = GetConversionExtent(src_image_view); @@ -1128,9 +1163,12 @@ void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_frameb scheduler.InvalidateState(); } -void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer* dst_framebuffer, +void BlitImageHelper::ConvertDepthStencil(VkShaderModule module, + const Framebuffer* dst_framebuffer, ImageView& src_image_view) { const VkPipelineLayout layout = *two_textures_pipeline_layout; + const VkPipeline pipeline = + FindOrEmplaceConvertPipeline(dst_framebuffer->Formats(), module, layout); const VkImageView src_depth_view = src_image_view.DepthView(); const VkImageView src_stencil_view = src_image_view.StencilView(); const VkSampler sampler = *nearest_sampler; @@ -1187,28 +1225,12 @@ VkPipeline BlitImageHelper::FindOrEmplaceColorPipeline(const BlitImagePipelineKe blit_color_keys.push_back(key); const std::array stages = MakeStages(*full_screen_vert, *blit_color_to_color_frag); - const VkPipelineColorBlendAttachmentState blend_attachment{ - .blendEnable = VK_FALSE, - .srcColorBlendFactor = VK_BLEND_FACTOR_ZERO, - .dstColorBlendFactor = VK_BLEND_FACTOR_ZERO, - .colorBlendOp = VK_BLEND_OP_ADD, - .srcAlphaBlendFactor = VK_BLEND_FACTOR_ZERO, - .dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO, - .alphaBlendOp = VK_BLEND_OP_ADD, - .colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | - VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT, - }; + BlendAttachments blend_attachments{}; + blend_attachments[key.target] = PIPELINE_COLOR_BLEND_ATTACHMENT_STATE; // TODO: programmable blending - const VkPipelineColorBlendStateCreateInfo color_blend_create_info{ - .sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .logicOpEnable = VK_FALSE, - .logicOp = VK_LOGIC_OP_CLEAR, - .attachmentCount = 1, - .pAttachments = &blend_attachment, - .blendConstants = {0.0f, 0.0f, 0.0f, 0.0f}, - }; + const VkPipelineColorBlendStateCreateInfo color_blend_create_info = + MakeColorBlendState(blend_attachments, key.formats); + const VkPipelineMultisampleStateCreateInfo multisample_ci = MakeMultisampleState(key.samples); const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); blit_color_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ @@ -1222,8 +1244,8 @@ VkPipeline BlitImageHelper::FindOrEmplaceColorPipeline(const BlitImagePipelineKe .pTessellationState = nullptr, .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, - .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, - .pDepthStencilState = nullptr, + .pMultisampleState = &multisample_ci, + .pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_DISABLED_CREATE_INFO, .pColorBlendState = &color_blend_create_info, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *one_texture_pipeline_layout, @@ -1241,6 +1263,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceDepthStencilPipeline(const BlitImagePip } blit_depth_stencil_keys.push_back(key); const std::array stages = MakeStages(*full_screen_vert, *blit_depth_stencil_frag); + const VkPipelineMultisampleStateCreateInfo multisample_ci = MakeMultisampleState(key.samples); const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); blit_depth_stencil_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ @@ -1254,7 +1277,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceDepthStencilPipeline(const BlitImagePip .pTessellationState = nullptr, .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, - .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, + .pMultisampleState = &multisample_ci, .pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, @@ -1284,16 +1307,11 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearColorPipeline(const BlitImagePipel .colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT, }; - const VkPipelineColorBlendStateCreateInfo color_blend_state_generic_create_info{ - .sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .logicOpEnable = VK_FALSE, - .logicOp = VK_LOGIC_OP_CLEAR, - .attachmentCount = 1, - .pAttachments = &color_blend_attachment_state, - .blendConstants = {0.0f, 0.0f, 0.0f, 0.0f}, - }; + BlendAttachments blend_attachments{}; + blend_attachments[key.target] = color_blend_attachment_state; + const VkPipelineColorBlendStateCreateInfo color_blend_create_info = + MakeColorBlendState(blend_attachments, key.formats); + const VkPipelineMultisampleStateCreateInfo multisample_ci = MakeMultisampleState(key.samples); const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); clear_color_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ @@ -1307,9 +1325,9 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearColorPipeline(const BlitImagePipel .pTessellationState = nullptr, .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, - .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, - .pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, - .pColorBlendState = &color_blend_state_generic_create_info, + .pMultisampleState = &multisample_ci, + .pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_DISABLED_CREATE_INFO, + .pColorBlendState = &color_blend_create_info, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *clear_color_pipeline_layout, .subpass = 0, @@ -1350,6 +1368,10 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearStencilPipeline( .minDepthBounds = 0.0f, .maxDepthBounds = 0.0f, }; + const BlendAttachments blend_attachments{}; + const VkPipelineColorBlendStateCreateInfo color_blend_create_info = + MakeColorBlendState(blend_attachments, key.formats); + const VkPipelineMultisampleStateCreateInfo multisample_ci = MakeMultisampleState(key.samples); const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); const VkPipelineRenderingCreateInfo rendering_ci = key.formats.CreateInfo(); clear_stencil_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ @@ -1363,9 +1385,9 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearStencilPipeline( .pTessellationState = nullptr, .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, - .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, + .pMultisampleState = &multisample_ci, .pDepthStencilState = &depth_stencil_ci, - .pColorBlendState = &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, + .pColorBlendState = &color_blend_create_info, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, .layout = *clear_color_pipeline_layout, .subpass = 0, @@ -1716,26 +1738,30 @@ VkPipeline BlitImageHelper::FindOrEmplaceMSAACopyDepthPipeline(const MSAACopyPip return *pipelines.back(); } -void BlitImageHelper::ConvertDepthToColorPipeline(vk::Pipeline& pipeline, - const RenderingFormats& formats) { - ConvertPipeline(pipeline, formats, false); -} - -void BlitImageHelper::ConvertColorToDepthPipeline(vk::Pipeline& pipeline, - const RenderingFormats& formats) { - ConvertPipeline(pipeline, formats, true); -} - -void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, const RenderingFormats& formats, - vk::ShaderModule& module, bool single_texture, - bool is_target_depth) { - if (pipeline) { - return; +VkPipeline BlitImageHelper::FindOrEmplaceConvertPipeline(const RenderingFormats& formats, + VkShaderModule module, + VkPipelineLayout layout) { + const ConvertPipelineKey key{ + .formats = formats, + .module = module, + }; + const auto it = std::ranges::find(convert_keys, key); + if (it != convert_keys.end()) { + return *convert_pipelines[std::distance(convert_keys.begin(), it)]; } - const std::array stages = MakeStages(*full_screen_vert, *module); - const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); + convert_keys.push_back(key); + const VkPipelineDepthStencilStateCreateInfo* depth_stencil_ci = nullptr; + const VkPipelineColorBlendStateCreateInfo* color_blend_ci = + &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO; + if (formats.num_colors == 0) { + depth_stencil_ci = &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO; + color_blend_ci = &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO; + } + const std::array stages = MakeStages(*full_screen_vert, module); + const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = + GetPipelineInputAssemblyStateCreateInfo(device); const VkPipelineRenderingCreateInfo rendering_ci = formats.CreateInfo(); - pipeline = device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ + convert_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, .pNext = &rendering_ci, .flags = 0, @@ -1747,60 +1773,15 @@ void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, const RenderingF .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, - .pDepthStencilState = is_target_depth ? &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO : nullptr, - .pColorBlendState = is_target_depth ? &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO - : &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, + .pDepthStencilState = depth_stencil_ci, + .pColorBlendState = color_blend_ci, .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, - .layout = single_texture ? *one_texture_pipeline_layout : *two_textures_pipeline_layout, + .layout = layout, .subpass = 0, .basePipelineHandle = VK_NULL_HANDLE, .basePipelineIndex = 0, - }); -} - -void BlitImageHelper::ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, - const RenderingFormats& formats, - vk::ShaderModule& module) { - ConvertPipelineEx(pipeline, formats, module, false, false); -} - -void BlitImageHelper::ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, - const RenderingFormats& formats, - vk::ShaderModule& module) { - ConvertPipelineEx(pipeline, formats, module, true, true); -} - -void BlitImageHelper::ConvertPipeline(vk::Pipeline& pipeline, const RenderingFormats& formats, - bool is_target_depth) { - if (pipeline) { - return; - } - VkShaderModule frag_shader = - is_target_depth ? *convert_float_to_depth_frag : *convert_depth_to_float_frag; - const std::array stages = MakeStages(*full_screen_vert, frag_shader); - const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); - const VkPipelineRenderingCreateInfo rendering_ci = formats.CreateInfo(); - pipeline = device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ - .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - .pNext = &rendering_ci, - .flags = 0, - .stageCount = static_cast(stages.size()), - .pStages = stages.data(), - .pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, - .pInputAssemblyState = &input_assembly_ci, - .pTessellationState = nullptr, - .pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, - .pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, - .pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, - .pDepthStencilState = is_target_depth ? &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO : nullptr, - .pColorBlendState = is_target_depth ? &PIPELINE_COLOR_BLEND_STATE_EMPTY_CREATE_INFO - : &PIPELINE_COLOR_BLEND_STATE_GENERIC_CREATE_INFO, - .pDynamicState = &PIPELINE_DYNAMIC_STATE_CREATE_INFO, - .layout = *one_texture_pipeline_layout, - .subpass = 0, - .basePipelineHandle = VK_NULL_HANDLE, - .basePipelineIndex = 0, - }); + })); + return *convert_pipelines.back(); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index d4038c8dae..bc1db246ff 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h @@ -33,6 +33,8 @@ struct BlitImagePipelineKey { RenderingFormats formats; Tegra::Engines::Fermi2D::Operation operation; + VkSampleCountFlagBits samples; + u32 target; }; struct BlitDepthStencilPipelineKey { @@ -43,6 +45,14 @@ struct BlitDepthStencilPipelineKey { u8 stencil_mask; u32 stencil_compare_mask; u32 stencil_ref; + VkSampleCountFlagBits samples; +}; + +struct ConvertPipelineKey { + constexpr auto operator<=>(const ConvertPipelineKey&) const noexcept = default; + + RenderingFormats formats; + VkShaderModule module; }; enum class MSAACopyFormatClass : u32 { @@ -117,7 +127,7 @@ public: void ConvertS8D24ToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view); - void ClearColor(const Framebuffer* dst_framebuffer, u8 color_mask, + void ClearColor(const Framebuffer* dst_framebuffer, u32 target, u8 color_mask, const std::array& clear_color, const Region2D& dst_region); void ClearDepthStencil(const Framebuffer* dst_framebuffer, bool depth_clear, f32 clear_depth, @@ -156,10 +166,10 @@ private: std::span copies, const MSAACopyAspectInfo& aspect_info, bool copy_stencil); - void Convert(VkPipeline pipeline, const Framebuffer* dst_framebuffer, + void Convert(VkShaderModule module, const Framebuffer* dst_framebuffer, const ImageView& src_image_view); - void ConvertDepthStencil(VkPipeline pipeline, const Framebuffer* dst_framebuffer, + void ConvertDepthStencil(VkShaderModule module, const Framebuffer* dst_framebuffer, ImageView& src_image_view); [[nodiscard]] VkPipeline FindOrEmplaceColorPipeline(const BlitImagePipelineKey& key); @@ -179,22 +189,9 @@ private: [[nodiscard]] VkPipeline FindOrEmplaceBlitDepthPipeline(const RenderingFormats& formats); [[nodiscard]] VkPipeline FindOrEmplaceResolveDepthStencilPipeline( const RenderingFormats& formats, bool resolve_stencil); - - void ConvertPipeline(vk::Pipeline& pipeline, const RenderingFormats& formats, - bool is_target_depth); - - void ConvertDepthToColorPipeline(vk::Pipeline& pipeline, const RenderingFormats& formats); - - void ConvertColorToDepthPipeline(vk::Pipeline& pipeline, const RenderingFormats& formats); - - void ConvertPipelineEx(vk::Pipeline& pipeline, const RenderingFormats& formats, - vk::ShaderModule& module, bool single_texture, bool is_target_depth); - - void ConvertPipelineColorTargetEx(vk::Pipeline& pipeline, const RenderingFormats& formats, - vk::ShaderModule& module); - - void ConvertPipelineDepthTargetEx(vk::Pipeline& pipeline, const RenderingFormats& formats, - vk::ShaderModule& module); + [[nodiscard]] VkPipeline FindOrEmplaceConvertPipeline(const RenderingFormats& formats, + VkShaderModule module, + VkPipelineLayout layout); const Device& device; Scheduler& scheduler; @@ -271,15 +268,8 @@ private: vk::ImageView dst_view; }; std::deque msaa_copy_resources; - vk::Pipeline convert_d32_to_r32_pipeline; - vk::Pipeline convert_r32_to_d32_pipeline; - vk::Pipeline convert_d16_to_r16_pipeline; - vk::Pipeline convert_r16_to_d16_pipeline; - vk::Pipeline convert_abgr8_to_d24s8_pipeline; - vk::Pipeline convert_abgr8_to_d32f_pipeline; - vk::Pipeline convert_d32f_to_abgr8_pipeline; - vk::Pipeline convert_d24s8_to_abgr8_pipeline; - vk::Pipeline convert_s8d24_to_abgr8_pipeline; + std::vector convert_keys; + std::vector convert_pipelines; }; } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 3fab3eb7fd..adf6d763ac 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -1421,24 +1421,19 @@ void QueryCacheRuntime::HostConditionalRenderingCompareValueImpl(VideoCommon::Lo impl->hcr_buffer = buffer->Handle(); impl->hcr_offset = offset; } - if (impl->hcr_is_set) { - if (impl->hcr_setup.buffer == impl->hcr_buffer && - impl->hcr_setup.offset == impl->hcr_offset) { - return; - } + VkConditionalRenderingFlagsEXT flags = 0; + if (is_equal) { + flags = VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT; } - bool was_running = impl->is_hcr_running; - if (was_running) { - PauseHostConditionalRendering(); + if (impl->hcr_is_set && impl->hcr_setup.buffer == impl->hcr_buffer && + impl->hcr_setup.offset == impl->hcr_offset && impl->hcr_setup.flags == flags) { + return; } + PauseHostConditionalRendering(); impl->hcr_setup.buffer = impl->hcr_buffer; impl->hcr_setup.offset = impl->hcr_offset; - impl->hcr_setup.flags = is_equal ? VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT : 0; + impl->hcr_setup.flags = flags; impl->hcr_is_set = true; - impl->is_hcr_running = false; - if (was_running) { - ResumeHostConditionalRendering(); - } } void QueryCacheRuntime::HostConditionalRenderingCompareBCImpl(DAddr address, bool is_equal, @@ -1455,20 +1450,16 @@ void QueryCacheRuntime::HostConditionalRenderingCompareBCImpl(DAddr address, boo to_resolve = buffer->Handle(); to_resolve_offset = static_cast(offset); } - bool was_running = impl->is_hcr_running; - if (was_running) { - PauseHostConditionalRendering(); - } + PauseHostConditionalRendering(); impl->conditional_resolve_pass->Resolve(*impl->hcr_resolve_buffer, to_resolve, to_resolve_offset, compare_to_zero); impl->hcr_setup.buffer = *impl->hcr_resolve_buffer; impl->hcr_setup.offset = 0; - impl->hcr_setup.flags = is_equal ? 0 : VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT; - impl->hcr_is_set = true; - impl->is_hcr_running = false; - if (was_running) { - ResumeHostConditionalRendering(); + impl->hcr_setup.flags = 0; + if (!is_equal) { + impl->hcr_setup.flags = VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT; } + impl->hcr_is_set = true; } bool QueryCacheRuntime::HostConditionalRenderingCompareValue(VideoCommon::LookupData object_1, diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 27332f8129..18d715f058 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -550,7 +550,8 @@ void RasterizerVulkan::Clear(u32 layer_count) { Offset2D{.x = clear_rect.rect.offset.x + s32(clear_rect.rect.extent.width), .y = clear_rect.rect.offset.y + s32(clear_rect.rect.extent.height)}}; request_renderpass(); - blit_image.ClearColor(framebuffer, color_mask, regs.clear_color, dst_region); + blit_image.ClearColor(framebuffer, color_attachment, color_mask, regs.clear_color, + dst_region); } else if (!clear_on_load || !scheduler.OverrideLoadOps(framebuffer, 1u << color_attachment, VK_ATTACHMENT_LOAD_OP_CLEAR, clear_value)) { diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index b23a6f0c88..4c63d0b890 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -4,8 +4,10 @@ // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include #include +#include #include #include @@ -116,6 +118,7 @@ void Scheduler::DispatchWork() { } event_cv.notify_all(); recorded_attachments = nullptr; + ended_attachments = nullptr; AcquireNewChunk(); } } @@ -169,29 +172,41 @@ bool Scheduler::OverrideLoadOps(const Framebuffer* framebuffer, u32 attachments, if (!renderpass_pristine || recorded_attachments == nullptr) { return false; } - const auto set_load_op = [&](VkRenderingAttachmentInfo& attachment, bool discards_msaa) { + const auto set_load_op = [&](VkRenderingAttachmentInfo& attachment) { attachment.loadOp = load_op; attachment.clearValue = value; - if (discards_msaa && load_op == VK_ATTACHMENT_LOAD_OP_CLEAR) { - attachment.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; - } }; for (u32 slot = 0; slot < recorded_attachments->num_colors; ++slot) { if ((attachments & (1u << slot)) != 0) { - set_load_op(recorded_attachments->colors[slot], framebuffer->DiscardsMsaaColor()); + set_load_op(recorded_attachments->colors[slot]); } } if ((attachments & DEPTH_ATTACHMENT_BIT) != 0) { - set_load_op(recorded_attachments->depth, framebuffer->DiscardsMsaaDepthStencil()); + set_load_op(recorded_attachments->depth); } if ((attachments & STENCIL_ATTACHMENT_BIT) != 0) { - set_load_op(recorded_attachments->stencil, framebuffer->DiscardsMsaaDepthStencil()); + set_load_op(recorded_attachments->stencil); } attachments_touched |= attachments; attachments_written |= attachments; return true; } +void Scheduler::DiscardResolvedAttachments(VkImageView resolve_view) { + if (ended_attachments == nullptr) { + return; + } + const auto discard = [resolve_view](VkRenderingAttachmentInfo& attachment) { + if (attachment.resolveImageView == resolve_view) { + attachment.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; + } + }; + std::ranges::for_each(std::span(ended_attachments->colors).first(ended_attachments->num_colors), + discard); + discard(ended_attachments->depth); + discard(ended_attachments->stencil); +} + void Scheduler::RequestOutsideRenderPassOperationContext() { EndRenderPass(); PublishComputeWrites(); @@ -420,8 +435,8 @@ void Scheduler::EndRenderPass() } if (recorded_attachments != nullptr) { RelaxAttachmentOps(*recorded_attachments); - recorded_attachments = nullptr; } + ended_attachments = std::exchange(recorded_attachments, nullptr); query_cache->CounterClose(VideoCommon::QueryType::StreamingByteCount); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index 21385549ee..e6917998ea 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -69,6 +69,8 @@ public: bool OverrideLoadOps(const Framebuffer* framebuffer, u32 attachments, VkAttachmentLoadOp load_op, const VkClearValue& value); + void DiscardResolvedAttachments(VkImageView resolve_view); + /// Requests the current execution context to be able to execute operations only allowed outside /// of a renderpass. void RequestOutsideRenderPassOperationContext(); @@ -338,6 +340,7 @@ private: u32 attachments_touched = 0; u32 attachments_written = 0; RenderingAttachments* recorded_attachments = nullptr; + RenderingAttachments* ended_attachments = nullptr; VkMemoryBarrier2 renderpass_write_barrier{}; VkMemoryBarrier2 compute_write_barrier{}; VkMemoryBarrier2 upload_write_barrier{}; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index a7c22db002..330c414b4e 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1838,6 +1838,11 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, region); cmdbuf.PipelineBarrier(0, {}, {}, post_barriers); }); + const bool is_color = aspect_mask == VK_IMAGE_ASPECT_COLOR_BIT; + if ((is_color && ENABLE_MSAA_COLOR_DISCARD) || + (!is_color && ENABLE_MSAA_DEPTH_STENCIL_DISCARD)) { + scheduler.DiscardResolvedAttachments(*shadow->view); + } return; } } @@ -3076,11 +3081,6 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime, samples != VK_SAMPLE_COUNT_1_BIT && depth_image != VK_NULL_HANDLE && runtime.device.IsTiler() && SupportsDepthStencilResolve(runtime.device, depth_format); - discard_msaa_color = - ENABLE_MSAA_RESOLVE_CONSUME && ENABLE_MSAA_COLOR_DISCARD && do_resolve_color; - discard_msaa_depth_stencil = ENABLE_MSAA_RESOLVE_CONSUME && - ENABLE_MSAA_DEPTH_STENCIL_DISCARD && do_resolve_depth_stencil; - runtime_ptr = &runtime; id = ++runtime.framebuffer_serial; render_area.width = (std::min)(render_area.width, width); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index adce1678f7..67f31f1156 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -250,14 +250,6 @@ public: return is_rescaled; } - [[nodiscard]] bool DiscardsMsaaColor() const noexcept { - return discard_msaa_color; - } - - [[nodiscard]] bool DiscardsMsaaDepthStencil() const noexcept { - return discard_msaa_depth_stencil; - } - /// Records that a render pass has begun, so its resolve attachments will hold valid contents /// once it ends. void MarkResolveShadowsUpToDate() const; @@ -278,8 +270,6 @@ private: std::array resolve_shadow_images{}; u32 num_resolve_shadows = 0; TextureCacheRuntime* runtime_ptr{nullptr}; - bool discard_msaa_color{}; - bool discard_msaa_depth_stencil{}; }; class Image : public VideoCommon::ImageBase { From bad10039ae124cf729228f14376fa2af20a1720b Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 13:03:09 -0400 Subject: [PATCH 137/198] Address some corrections towards MSAA discard/enable removal --- src/video_core/renderer_vulkan/blit_image.cpp | 11 +- .../renderer_vulkan/vk_graphics_pipeline.cpp | 12 +- .../renderer_vulkan/vk_query_cache.cpp | 17 +- .../renderer_vulkan/vk_scheduler.cpp | 233 +++++++++++------ src/video_core/renderer_vulkan/vk_scheduler.h | 13 + .../renderer_vulkan/vk_texture_cache.cpp | 242 ++++++++++-------- .../renderer_vulkan/vk_texture_cache.h | 2 + 7 files changed, 334 insertions(+), 196 deletions(-) diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 92f2d0ea5c..7c91f53f32 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -690,9 +690,7 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, VkImageView }; const VkPipelineLayout layout = *one_texture_pipeline_layout; const VkPipeline pipeline = FindOrEmplaceColorPipeline(key); - const auto attachments = - std::span(dst_framebuffer->Images()).first(dst_framebuffer->NumImages()); - if (std::ranges::find(attachments, src_image) != attachments.end()) { + if (scheduler.IsRenderPassImage(src_image)) { scheduler.RequestOutsideRenderPassOperationContext(); } scheduler.RequestRenderpass(dst_framebuffer); @@ -958,9 +956,14 @@ void BlitImageHelper::CopyMSAAImpl(const RenderingFormats& formats, VkPipeline p .extent = dst_extent, }; const VkImageView dst_view_handle = *dst_view; - const RenderingAttachments attachments = + RenderingAttachments attachments = MakeRenderingAttachments(formats, std::span(&dst_view_handle, formats.num_colors), dst_view_handle, render_area, 1); + attachments.colors[0].loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; + attachments.depth.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; + if (copy_stencil) { + attachments.stencil.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; + } const MSAACopyPushConstants push_constants{ .dst_offset = {dst_offset.x, dst_offset.y}, .src_offset = {copy.src_offset.x, copy.src_offset.y}, diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 5f6f525d1d..577c7fb3f6 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -575,8 +575,16 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { prepare_stage(4); } texture_cache.UpdateRenderTargets(false); - texture_cache.CheckFeedbackLoop(std::span{views.data(), - views.size()}); + const std::span view_span{views.data(), views.size()}; + texture_cache.CheckFeedbackLoop(view_span); + const auto samples_render_pass_image = [&](const VideoCommon::ImageViewInOut& view) { + return view.id && + scheduler.IsRenderPassImage(texture_cache.GetImageView(view.id).ImageHandle()); + }; + if (scheduler.CanAliasRenderPass(texture_cache.GetFramebuffer()) && + std::ranges::any_of(view_span, samples_render_pass_image)) { + scheduler.RequestOutsideRenderPassOperationContext(); + } if (IsBuilt() && !pipeline) { return false; } diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index adf6d763ac..598bbd3633 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -37,6 +37,12 @@ using Tegra::Engines::Maxwell3D; using VideoCommon::QueryType; namespace { +bool LacksQueryWriteBack(const Device& device) { + const VkDriverId driver_id = device.GetDriverID(); + return driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY || + driver_id == VK_DRIVER_ID_ARM_PROPRIETARY || driver_id == VK_DRIVER_ID_MESA_TURNIP; +} + class SamplesQueryBank : public VideoCommon::BankBase { public: static constexpr size_t BANK_SIZE = 256; @@ -235,9 +241,7 @@ public: return; } PauseCounter(); - const auto driver_id = device.GetDriverID(); - if (driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY || - driver_id == VK_DRIVER_ID_ARM_PROPRIETARY || driver_id == VK_DRIVER_ID_MESA_TURNIP) { + if (LacksQueryWriteBack(device)) { pending_sync.clear(); sync_values_stash.clear(); return; @@ -1467,6 +1471,10 @@ bool QueryCacheRuntime::HostConditionalRenderingCompareValue(VideoCommon::Lookup if (!impl->device.IsExtConditionalRendering()) { return false; } + if (LacksQueryWriteBack(impl->device)) { + EndHostConditionalRendering(); + return true; + } HostConditionalRenderingCompareBCImpl(object_1.address, true, true); return true; } @@ -1516,7 +1524,8 @@ bool QueryCacheRuntime::HostConditionalRenderingCompareValues(VideoCommon::Looku auto driver_id = impl->device.GetDriverID(); const bool is_gpu_high = Settings::IsGPULevelHigh(); - if ((!is_gpu_high && driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) || driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY || driver_id == VK_DRIVER_ID_ARM_PROPRIETARY || driver_id == VK_DRIVER_ID_MESA_TURNIP) { + if ((!is_gpu_high && driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) || + LacksQueryWriteBack(impl->device)) { EndHostConditionalRendering(); return true; } diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 4c63d0b890..cde7da2bcb 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -30,6 +30,8 @@ namespace Vulkan { namespace { +constexpr size_t DEPTH_VIEW = 8; + struct BeginRenderingCommand { void operator()(vk::CommandBuffer cmdbuf, vk::CommandBuffer) const { BeginRendering(cmdbuf, attachments); @@ -37,6 +39,24 @@ struct BeginRenderingCommand { RenderingAttachments attachments; }; + +VkImageView DepthStencilView(const RenderingAttachments& attachments) { + if (attachments.depth.imageView != VK_NULL_HANDLE) { + return attachments.depth.imageView; + } + return attachments.stencil.imageView; +} + +VkAccessFlags2 AttachmentWriteAccess(VkImageAspectFlags aspect_mask) { + if ((aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) != 0) { + return VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT; + } + if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) { + return VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + } + return VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; +} } // Anonymous namespace void Scheduler::CommandChunk::ExecuteAll(vk::CommandBuffer cmdbuf, @@ -129,6 +149,12 @@ void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer) { state.framebuffer_id = framebuffer->Id(); ++renderpass_serial; renderpass_pristine = true; + alias_framebuffer_id = 0; + std::ranges::transform(attachments.colors, renderpass_views.begin(), + &VkRenderingAttachmentInfo::imageView); + renderpass_views[DEPTH_VIEW] = DepthStencilView(attachments); + renderpass_extent = attachments.render_area.extent; + renderpass_layers = attachments.layers; attachments_touched = 0; attachments_written = 0; @@ -153,11 +179,49 @@ void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer) { framebuffer->MarkResolveShadowsUpToDate(); } -void Scheduler::RequestRenderpass(const Framebuffer* framebuffer, u32 touched, u32 written) { - if (framebuffer->Id() != state.framebuffer_id) { - EndRenderPass(); - BeginRenderPassImpl(framebuffer); +void Scheduler::BindFramebuffer(const Framebuffer* framebuffer) { + if (framebuffer->Id() == state.framebuffer_id) { + return; } + if (CanAliasRenderPass(framebuffer)) { + alias_framebuffer_id = framebuffer->Id(); + return; + } + EndRenderPass(); + BeginRenderPassImpl(framebuffer); +} + +bool Scheduler::CanAliasRenderPass(const Framebuffer* framebuffer) const { + const u64 id = framebuffer->Id(); + if (id == alias_framebuffer_id) { + return true; + } + if (id == state.framebuffer_id || state.framebuffer_id == 0 || + !device.IsExtDynamicRenderingUnusedAttachmentsSupported()) { + return false; + } + const RenderingAttachments& attachments = framebuffer->Attachments(); + if (attachments.layers != renderpass_layers || + attachments.render_area.extent.width != renderpass_extent.width || + attachments.render_area.extent.height != renderpass_extent.height) { + return false; + } + for (u32 slot = 0; slot < attachments.num_colors; ++slot) { + if (attachments.colors[slot].imageView != renderpass_views[slot]) { + return false; + } + } + const VkImageView depth_stencil = DepthStencilView(attachments); + return depth_stencil == VK_NULL_HANDLE || depth_stencil == renderpass_views[DEPTH_VIEW]; +} + +bool Scheduler::IsRenderPassImage(VkImage image) const { + const auto images = std::span(renderpass_images).first(num_renderpass_images); + return std::ranges::find(images, image) != images.end(); +} + +void Scheduler::RequestRenderpass(const Framebuffer* framebuffer, u32 touched, u32 written) { + BindFramebuffer(framebuffer); renderpass_pristine = false; attachments_touched |= touched; attachments_written |= written; @@ -165,10 +229,7 @@ void Scheduler::RequestRenderpass(const Framebuffer* framebuffer, u32 touched, u bool Scheduler::OverrideLoadOps(const Framebuffer* framebuffer, u32 attachments, VkAttachmentLoadOp load_op, const VkClearValue& value) { - if (framebuffer->Id() != state.framebuffer_id) { - EndRenderPass(); - BeginRenderPassImpl(framebuffer); - } + BindFramebuffer(framebuffer); if (!renderpass_pristine || recorded_attachments == nullptr) { return false; } @@ -252,6 +313,36 @@ void Scheduler::RelaxAttachmentOps(RenderingAttachments& attachments) const { } } +u32 Scheduler::RefineImageAccesses(const RenderingAttachments& attachments, + std::array& accesses) const { + const auto stores = [](const VkRenderingAttachmentInfo& attachment) { + return attachment.imageView != VK_NULL_HANDLE && + attachment.storeOp != VK_ATTACHMENT_STORE_OP_NONE; + }; + u32 unused_images = 0; + u32 image = 0; + const auto refine = [&](bool used, bool stored) { + if (!used) { + unused_images |= 1u << image; + } + if (!stored) { + accesses[image] = 0; + } + ++image; + }; + for (u32 slot = 0; slot < attachments.num_colors; ++slot) { + if (renderpass_views[slot] != VK_NULL_HANDLE) { + const VkRenderingAttachmentInfo& color = attachments.colors[slot]; + refine(color.imageView != VK_NULL_HANDLE, stores(color)); + } + } + if (renderpass_views[DEPTH_VIEW] != VK_NULL_HANDLE) { + refine(DepthStencilView(attachments) != VK_NULL_HANDLE, + stores(attachments.depth) || stores(attachments.stencil)); + } + return unused_images; +} + void Scheduler::PublishComputeWrites() { if (!std::exchange(compute_writes, false)) { return; @@ -428,78 +519,68 @@ void Scheduler::EndPendingOperations() { EndRenderPass(); } -void Scheduler::EndRenderPass() - { - if (state.framebuffer_id == 0) { - return; - } - if (recorded_attachments != nullptr) { - RelaxAttachmentOps(*recorded_attachments); - } - ended_attachments = std::exchange(recorded_attachments, nullptr); +void Scheduler::EndRenderPass() { + if (state.framebuffer_id == 0) { + return; + } + std::array accesses{}; + for (u32 index = 0; index < num_renderpass_images; ++index) { + accesses[index] = AttachmentWriteAccess(renderpass_image_ranges[index].aspectMask); + } + u32 unused_images = 0; + if (recorded_attachments != nullptr) { + RelaxAttachmentOps(*recorded_attachments); + unused_images = RefineImageAccesses(*recorded_attachments, accesses); + } + ended_attachments = std::exchange(recorded_attachments, nullptr); - query_cache->CounterClose(VideoCommon::QueryType::StreamingByteCount); + query_cache->CounterClose(VideoCommon::QueryType::StreamingByteCount); - // Log render pass end - if (GPU::Logging::IsActive() && - Settings::values.gpu_log_vulkan_calls.GetValue()) { - GPU::Logging::GPULogger::GetInstance().LogRenderPassEnd(); - } - - query_cache->CounterEnable(VideoCommon::QueryType::ZPassPixelCount64, false); - query_cache->NotifySegment(false); - - Record([num_images = num_renderpass_images, - images = renderpass_images, - ranges = renderpass_image_ranges, - write_barrier = &renderpass_write_barrier, - num_memory_barriers = - static_cast(std::exchange(renderpass_writes, false))]( - vk::CommandBuffer cmdbuf) { - std::array barriers; - for (size_t i = 0; i < num_images; ++i) { - const VkImageSubresourceRange& range = ranges[i]; - const bool is_color = (range.aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) != 0; - const bool is_depth_stencil = (range.aspectMask - & (VK_IMAGE_ASPECT_DEPTH_BIT - | VK_IMAGE_ASPECT_STENCIL_BIT)) !=0; - - VkAccessFlags2 src_access = 0; - - if (is_color) - src_access |= VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT; - else if (is_depth_stencil) - src_access |= VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - else - src_access |= VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT - | VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - - barriers[i] = VkImageMemoryBarrier2{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT - | VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT - | VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, - .srcAccessMask = src_access, - .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, - .dstAccessMask = vk::ACCESS_IMAGE_USERS, - .oldLayout = VK_IMAGE_LAYOUT_GENERAL, - .newLayout = VK_IMAGE_LAYOUT_GENERAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = images[i], - .subresourceRange = range, - }; - } - cmdbuf.EndRendering(); - cmdbuf.PipelineBarrier(0, vk::Span(write_barrier, num_memory_barriers), {}, - vk::Span(barriers.data(), num_images)); - }); - - state.framebuffer_id = 0; - num_renderpass_images = 0; + // Log render pass end + if (GPU::Logging::IsActive() && Settings::values.gpu_log_vulkan_calls.GetValue()) { + GPU::Logging::GPULogger::GetInstance().LogRenderPassEnd(); } + query_cache->CounterEnable(VideoCommon::QueryType::ZPassPixelCount64, false); + query_cache->NotifySegment(false); + + Record([num_images = num_renderpass_images, images = renderpass_images, + ranges = renderpass_image_ranges, accesses, unused_images, + write_barrier = &renderpass_write_barrier, + num_memory_barriers = static_cast(std::exchange(renderpass_writes, false))]( + vk::CommandBuffer cmdbuf) { + std::array barriers; + size_t num_barriers = 0; + for (size_t i = 0; i < num_images; ++i) { + if (((unused_images >> i) & 1) != 0) { + continue; + } + barriers[num_barriers++] = VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = vk::PIPELINE_STAGE_ATTACHMENTS, + .srcAccessMask = accesses[i], + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, + .oldLayout = VK_IMAGE_LAYOUT_GENERAL, + .newLayout = VK_IMAGE_LAYOUT_GENERAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = images[i], + .subresourceRange = ranges[i], + }; + } + cmdbuf.EndRendering(); + if (num_barriers + num_memory_barriers != 0) { + cmdbuf.PipelineBarrier(0, vk::Span(write_barrier, num_memory_barriers), {}, + vk::Span(barriers.data(), num_barriers)); + } + }); + + state.framebuffer_id = 0; + alias_framebuffer_id = 0; + num_renderpass_images = 0; +} void Scheduler::AcquireNewChunk() { std::scoped_lock rl{reserve_mutex}; diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index e6917998ea..ef04062b49 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -71,6 +71,10 @@ public: void DiscardResolvedAttachments(VkImageView resolve_view); + bool CanAliasRenderPass(const Framebuffer* framebuffer) const; + + bool IsRenderPassImage(VkImage image) const; + /// Requests the current execution context to be able to execute operations only allowed outside /// of a renderpass. void RequestOutsideRenderPassOperationContext(); @@ -300,6 +304,8 @@ private: void BeginRenderPassImpl(const Framebuffer* framebuffer); + void BindFramebuffer(const Framebuffer* framebuffer); + void WorkerThread(std::stop_token stop_token); void AllocateWorkerCommandBuffer(); @@ -314,6 +320,9 @@ private: void RelaxAttachmentOps(RenderingAttachments& attachments) const; + u32 RefineImageAccesses(const RenderingAttachments& attachments, + std::array& accesses) const; + void AcquireNewChunk(); const Device& device; @@ -333,6 +342,7 @@ private: State state; u64 renderpass_serial = 0; + u64 alias_framebuffer_id = 0; u64 wfi_serial = 0; bool renderpass_writes = false; bool renderpass_pristine = false; @@ -347,6 +357,9 @@ private: u32 num_renderpass_images = 0; std::array renderpass_images{}; std::array renderpass_image_ranges{}; + std::array renderpass_views{}; + VkExtent2D renderpass_extent{}; + u32 renderpass_layers = 0; std::queue> work_queue; std::vector> chunk_reserve; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 330c414b4e..e73d6c1598 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1373,7 +1373,24 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst return; } ASSERT(src.format == dst.format); - if (is_src_msaa && !is_dst_msaa && + const bool is_resolve = is_src_msaa && !is_dst_msaa; + if (ENABLE_MSAA_RESOLVE_CONSUME && is_resolve && HaveSameExtent(dst_region, src_region)) { + const VkImageResolve2 resolve = MakeImageResolve( + dst_region, src_region, MakeSubresourceLayers(&dst), MakeSubresourceLayers(&src)); + const VkImageCopy2 region{ + .sType = VK_STRUCTURE_TYPE_IMAGE_COPY_2, + .pNext = nullptr, + .srcSubresource = resolve.srcSubresource, + .srcOffset = resolve.srcOffset, + .dstSubresource = resolve.dstSubresource, + .dstOffset = resolve.dstOffset, + .extent = resolve.extent, + }; + if (CopyResolveShadow(src.ImageHandle(), dst.ImageHandle(), region)) { + return; + } + } + if (is_resolve && (aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) { if ((aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) == 0) { UNIMPLEMENTED_MSG("Stencil-only MSAA resolve is not supported"); @@ -1416,7 +1433,6 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst return; } - const bool is_resolve = is_src_msaa && !is_dst_msaa; if (is_resolve && !HaveSameExtent(dst_region, src_region)) { blit_image_helper.BlitColorMSAA(dst_framebuffer, src, dst_region, src_region); return; @@ -1729,120 +1745,126 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, }); } +bool TextureCacheRuntime::CopyResolveShadow(VkImage msaa_image, VkImage dst_image, + const VkImageCopy2& region) { + const ResolveShadow* const shadow = GetValidResolveShadow(msaa_image); + if (shadow == nullptr || shadow->aspect_mask != region.srcSubresource.aspectMask || + region.srcSubresource.mipLevel != 0 || region.srcOffset.x < 0 || region.srcOffset.y < 0 || + static_cast(region.srcOffset.x) + region.extent.width > shadow->extent.width || + static_cast(region.srcOffset.y) + region.extent.height > shadow->extent.height || + region.srcSubresource.baseArrayLayer + region.srcSubresource.layerCount > + shadow->layers) { + return false; + } + const VkImageAspectFlags aspect_mask = shadow->aspect_mask; + const VkImage shadow_image = *shadow->image; + scheduler.RequestOutsideRenderPassOperationContext(); + scheduler.Record([shadow_image, dst_image, region, aspect_mask](vk::CommandBuffer cmdbuf) { + const std::array pre_barriers{ + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, + .oldLayout = VK_IMAGE_LAYOUT_GENERAL, + .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = shadow_image, + .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, + VK_REMAINING_ARRAY_LAYERS}, + }, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .srcAccessMask = vk::ACCESS_IMAGE_WRITES, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .oldLayout = VK_IMAGE_LAYOUT_GENERAL, + .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = dst_image, + .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, + VK_REMAINING_ARRAY_LAYERS}, + }, + }; + const std::array post_barriers{ + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = 0, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, + .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + .newLayout = VK_IMAGE_LAYOUT_GENERAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = shadow_image, + .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, + VK_REMAINING_ARRAY_LAYERS}, + }, + VkImageMemoryBarrier2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, + .dstAccessMask = vk::ACCESS_IMAGE_USERS, + .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + .newLayout = VK_IMAGE_LAYOUT_GENERAL, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .image = dst_image, + .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, + VK_REMAINING_ARRAY_LAYERS}, + }, + }; + cmdbuf.PipelineBarrier(0, {}, {}, pre_barriers); + cmdbuf.CopyImage(shadow_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst_image, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, region); + cmdbuf.PipelineBarrier(0, {}, {}, post_barriers); + }); + const bool is_color = aspect_mask == VK_IMAGE_ASPECT_COLOR_BIT; + if ((is_color && ENABLE_MSAA_COLOR_DISCARD) || + (!is_color && ENABLE_MSAA_DEPTH_STENCIL_DISCARD)) { + scheduler.DiscardResolvedAttachments(*shadow->view); + } + return true; +} + void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, std::span copies) { const bool msaa_to_non_msaa = src.info.num_samples > 1 && dst.info.num_samples == 1; const u32 num_samples = msaa_to_non_msaa ? src.info.num_samples : dst.info.num_samples; if (ENABLE_MSAA_RESOLVE_CONSUME && msaa_to_non_msaa && copies.size() == 1 && - src.info.format == dst.info.format) { + src.info.format == dst.info.format && copies.front().src_offset.x == 0 && + copies.front().src_offset.y == 0) { const VideoCommon::ImageCopy& copy = copies.front(); - const ResolveShadow* const shadow = GetValidResolveShadow(src.Handle()); - if (shadow != nullptr && shadow->aspect_mask == dst.AspectMask() && - copy.src_offset.x == 0 && copy.src_offset.y == 0 && - copy.src_subresource.base_level == 0 && - static_cast(copy.extent.width) <= shadow->extent.width && - static_cast(copy.extent.height) <= shadow->extent.height && - static_cast(copy.src_subresource.base_layer + copy.src_subresource.num_layers) <= - shadow->layers) { - const VkImageAspectFlags aspect_mask = shadow->aspect_mask; - const VkImage shadow_image = *shadow->image; - const VkImage dst_image = dst.Handle(); - const VkImageCopy2 region{ - .sType = VK_STRUCTURE_TYPE_IMAGE_COPY_2, - .pNext = nullptr, - .srcSubresource{ - .aspectMask = aspect_mask, - .mipLevel = 0, - .baseArrayLayer = static_cast(copy.src_subresource.base_layer), - .layerCount = static_cast(copy.src_subresource.num_layers), - }, - .srcOffset = {0, 0, 0}, - .dstSubresource{ - .aspectMask = aspect_mask, - .mipLevel = static_cast(copy.dst_subresource.base_level), - .baseArrayLayer = static_cast(copy.dst_subresource.base_layer), - .layerCount = static_cast(copy.dst_subresource.num_layers), - }, - .dstOffset = {copy.dst_offset.x, copy.dst_offset.y, copy.dst_offset.z}, - .extent = {copy.extent.width, copy.extent.height, 1}, - }; - scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([shadow_image, dst_image, region, - aspect_mask](vk::CommandBuffer cmdbuf) { - const std::array pre_barriers{ - VkImageMemoryBarrier2{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, - .srcAccessMask = vk::ACCESS_IMAGE_WRITES, - .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, - .oldLayout = VK_IMAGE_LAYOUT_GENERAL, - .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = shadow_image, - .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, - VK_REMAINING_ARRAY_LAYERS}, - }, - VkImageMemoryBarrier2{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, - .srcAccessMask = vk::ACCESS_IMAGE_WRITES, - .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .oldLayout = VK_IMAGE_LAYOUT_GENERAL, - .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = dst_image, - .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, - VK_REMAINING_ARRAY_LAYERS}, - }, - }; - const std::array post_barriers{ - VkImageMemoryBarrier2{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = 0, - .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, - .dstAccessMask = vk::ACCESS_IMAGE_USERS, - .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - .newLayout = VK_IMAGE_LAYOUT_GENERAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = shadow_image, - .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, - VK_REMAINING_ARRAY_LAYERS}, - }, - VkImageMemoryBarrier2{ - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, - .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, - .dstStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, - .dstAccessMask = vk::ACCESS_IMAGE_USERS, - .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - .newLayout = VK_IMAGE_LAYOUT_GENERAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = dst_image, - .subresourceRange{aspect_mask, 0, VK_REMAINING_MIP_LEVELS, 0, - VK_REMAINING_ARRAY_LAYERS}, - }, - }; - cmdbuf.PipelineBarrier(0, {}, {}, pre_barriers); - cmdbuf.CopyImage(shadow_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst_image, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, region); - cmdbuf.PipelineBarrier(0, {}, {}, post_barriers); - }); - const bool is_color = aspect_mask == VK_IMAGE_ASPECT_COLOR_BIT; - if ((is_color && ENABLE_MSAA_COLOR_DISCARD) || - (!is_color && ENABLE_MSAA_DEPTH_STENCIL_DISCARD)) { - scheduler.DiscardResolvedAttachments(*shadow->view); - } + const VkImageCopy2 region{ + .sType = VK_STRUCTURE_TYPE_IMAGE_COPY_2, + .pNext = nullptr, + .srcSubresource{ + .aspectMask = dst.AspectMask(), + .mipLevel = static_cast(copy.src_subresource.base_level), + .baseArrayLayer = static_cast(copy.src_subresource.base_layer), + .layerCount = static_cast(copy.src_subresource.num_layers), + }, + .srcOffset = {0, 0, 0}, + .dstSubresource{ + .aspectMask = dst.AspectMask(), + .mipLevel = static_cast(copy.dst_subresource.base_level), + .baseArrayLayer = static_cast(copy.dst_subresource.base_layer), + .layerCount = static_cast(copy.dst_subresource.num_layers), + }, + .dstOffset = {copy.dst_offset.x, copy.dst_offset.y, copy.dst_offset.z}, + .extent = {copy.extent.width, copy.extent.height, 1}, + }; + if (CopyResolveShadow(src.Handle(), dst.Handle(), region)) { return; } } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 67f31f1156..ea8ecc4df6 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -130,6 +130,8 @@ public: void EraseResolveShadow(VkImage msaa_image); + bool CopyResolveShadow(VkImage msaa_image, VkImage dst_image, const VkImageCopy2& region); + std::span ViewFormats(PixelFormat format) { return view_formats[static_cast(format)]; } From 5714c3e4776dcae16fa4169f03c987ab924fff10 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 14:14:57 -0400 Subject: [PATCH 138/198] Experiments with polishing LSFG impl --- CMakeLists.txt | 4 +- .../app/src/main/res/values/strings.xml | 2 +- src/qt_common/config/shared_translation.cpp | 19 +++ .../renderer_vulkan/present/frame_gen.cpp | 149 ++++++++---------- .../renderer_vulkan/present/frame_gen.h | 11 +- .../renderer_vulkan/present/layer.cpp | 72 +++++++-- .../renderer_vulkan/present/layer.h | 23 ++- .../renderer_vulkan/present/lsfg_chain.cpp | 8 +- .../renderer_vulkan/present/lsfg_chain.h | 6 +- .../renderer_vulkan/present/lsfg_common.cpp | 2 +- .../renderer_vulkan/present/lsfg_common.h | 1 - .../renderer_vulkan/present/lsfg_generate.cpp | 33 ++-- .../renderer_vulkan/present/lsfg_generate.h | 12 +- .../renderer_vulkan/present/lsfg_shaders.cpp | 2 +- .../present/window_adapt_pass.cpp | 73 +++++---- .../present/window_adapt_pass.h | 12 ++ .../renderer_vulkan/renderer_vulkan.cpp | 36 ++--- .../renderer_vulkan/vk_blit_screen.cpp | 43 +++-- .../renderer_vulkan/vk_blit_screen.h | 13 ++ .../renderer_vulkan/vk_present_manager.cpp | 77 ++------- .../renderer_vulkan/vk_present_manager.h | 10 +- .../vulkan_common/vulkan_device.cpp | 9 +- src/video_core/vulkan_common/vulkan_device.h | 5 + src/yuzu/configuration/configure_graphics.cpp | 128 +++++++++++++++ src/yuzu/configuration/configure_graphics.h | 13 ++ src/yuzu/configuration/shared_widget.cpp | 14 +- 26 files changed, 495 insertions(+), 282 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f647204a4b..91a77b717b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,8 +82,8 @@ cmake_dependent_option(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSV option(ENABLE_DEBUG_TOOLS "Enable debugging tools (maxwell disassembler, SPIRV translator, etc)" OFF) option(ENABLE_WERROR "Enable -Werror diagnostics" ON) -# Lossless Scaling frame generation. Only Android. -cmake_dependent_option(ENABLE_LSFG "Enable Lossless Scaling frame generation" ON "ANDROID" OFF) +# Lossless Scaling frame generation. +option(ENABLE_LSFG "Enable Lossless Scaling frame generation" ON) option(ENABLE_RESHADE "Enable ReShade FX post-processing effects" ON) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 2238a9ec4c..3453e22190 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -346,7 +346,7 @@ Match motion estimation to the game Estimate motion at the resolution the game actually renders instead of the upscaled output. Costs nothing in accuracy, since upscaling adds no motion detail. Motion estimation resolution - Resolution of the optical flow pass, as a fraction of the output. Lowering it is the cheapest way to reclaim performance. + Resolution of the optical flow pass, as a fraction of the game\'s render resolution. Lowering it is the cheapest way to reclaim performance. Frame generation unavailable This GPU driver lacks the Vulkan memory model or half precision (float16) support that the Lossless Scaling shaders require. Optional. Provide your own Lossless.dll to enable frame generation later diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 1f6792f86c..2c459855e8 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -154,6 +154,25 @@ std::unique_ptr InitializeTranslations(QObject* parent) { INSERT(Settings, post_shader_preset, QString(), QString()); INSERT(Settings, post_shader_enabled, tr("Enable post-processing effects"), tr("Applies post-processing effects to the final image.")); + INSERT(Settings, frame_gen, tr("Frame generation (Lossless Scaling)"), + tr("Generates intermediate frames with the Lossless Scaling frame generation " + "shaders.\nRequires your own legal copy of Lossless.dll and forces VSync (FIFO).")); + INSERT(Settings, frame_gen_multiplier, tr("Frame generation multiplier:"), + tr("How many frames are shown for each frame the game renders.\nOnly used when the " + "target frame rate is 0.")); + INSERT(Settings, frame_gen_target_rate, tr("Frame generation target rate:"), + tr("Pick the rate your display can actually show. The multiplier then rises or falls " + "on its own to hold it.\n0 uses the fixed multiplier.")); + INSERT(Settings, frame_gen_flow_scale_auto, tr("Match motion estimation to the game"), + tr("Estimate motion at the resolution the game actually renders instead of the " + "upscaled output.")); + INSERT(Settings, frame_gen_flow_scale, tr("Motion estimation resolution:"), + tr("Resolution of the optical flow pass, as a fraction of the game's render " + "resolution.\nLowering it is the cheapest way to reclaim performance.")); + INSERT(Settings, frame_gen_queue_target, tr("Frame generation queue target:"), + tr("How many finished frames may wait ahead of the display.\nLarger queues absorb GPU " + "spikes at the cost of input latency.")); + INSERT(Settings, frame_gen_dump_flow, QString(), QString()); INSERT(Settings, fullscreen_mode, tr("Fullscreen Mode:"), tr("The method used to render the window in fullscreen.\nBorderless offers the best " "compatibility with the on-screen keyboard that some games request for " diff --git a/src/video_core/renderer_vulkan/present/frame_gen.cpp b/src/video_core/renderer_vulkan/present/frame_gen.cpp index 38981448de..21bd0d06b8 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen.cpp @@ -11,7 +11,6 @@ #include "common/settings.h" #include "video_core/renderer_vulkan/present/frame_gen.h" #include "video_core/renderer_vulkan/present/util.h" -#include "video_core/renderer_vulkan/vk_present_manager.h" #include "video_core/renderer_vulkan/vk_scheduler.h" #include "video_core/vulkan_common/vulkan_device.h" @@ -23,25 +22,11 @@ constexpr size_t COLOR_CHANNELS = 4; constexpr u64 LSFG_REQUIRED_FRAMES = 2; constexpr u32 LSFG_RECURRENCE_FRAMES = 2; -[[nodiscard]] f32 ManualFlowScale() { - return static_cast(Settings::values.frame_gen_flow_scale.GetValue()) / 100.0f; -} - -[[nodiscard]] f32 ConfiguredFlowScale(VkExtent2D guest_extent, VkExtent2D presented_extent) { - if (!Settings::values.frame_gen_flow_scale_auto.GetValue()) { - return ManualFlowScale(); - } - if (guest_extent.width == 0 || presented_extent.width == 0) { +[[nodiscard]] f32 ConfiguredFlowScale() { + if (Settings::values.frame_gen_flow_scale_auto.GetValue()) { return 1.0f; } - - const f32 rendered_width = static_cast(guest_extent.width) * - Settings::values.resolution_info.up_factor; - const f32 ratio = rendered_width / static_cast(presented_extent.width); - - constexpr f32 FLOW_SCALE_STEPS = 20.0f; - const f32 stepped = std::ceil(ratio * FLOW_SCALE_STEPS) / FLOW_SCALE_STEPS; - return std::clamp(stepped, 0.25f, 1.0f); + return static_cast(Settings::values.frame_gen_flow_scale.GetValue()) / 100.0f; } bool IsBlueFirst(VkFormat format) { @@ -140,55 +125,52 @@ VkImageMemoryBarrier2 MakeTransitionBarrier(VkImage image, VkPipelineStageFlags2 }; } -VkImageCopy2 MakeCopyRegion(VkExtent2D extent) { - return VkImageCopy2{ - .sType = VK_STRUCTURE_TYPE_IMAGE_COPY_2, +VkImageBlit2 MakeBlitRegion(VkExtent2D extent) { + const VkImageSubresourceLayers layers{ + .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, + .mipLevel = 0, + .baseArrayLayer = 0, + .layerCount = 1, + }; + const VkOffset3D end{ + .x = static_cast(extent.width), + .y = static_cast(extent.height), + .z = 1, + }; + return VkImageBlit2{ + .sType = VK_STRUCTURE_TYPE_IMAGE_BLIT_2, .pNext = nullptr, - .srcSubresource{ - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .mipLevel = 0, - .baseArrayLayer = 0, - .layerCount = 1, - }, - .srcOffset = {}, - .dstSubresource{ - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .mipLevel = 0, - .baseArrayLayer = 0, - .layerCount = 1, - }, - .dstOffset = {}, - .extent = {.width = extent.width, .height = extent.height, .depth = 1}, + .srcSubresource = layers, + .srcOffsets = {VkOffset3D{}, end}, + .dstSubresource = layers, + .dstOffsets = {VkOffset3D{}, end}, }; } -void CopyPresentedFrame(vk::CommandBuffer cmdbuf, VkImage source, LsfgImage& destination, - VkExtent2D extent) { - const auto make_barrier = MakeTransitionBarrier; - - static constexpr VkPipelineStageFlags2 present_stage = - VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT; - +void CopySourceFrame(vk::CommandBuffer cmdbuf, VkImage source, LsfgImage& destination, + VkExtent2D extent) { const std::array before{ - make_barrier(source, present_stage, VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, - VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, - VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL), - make_barrier(destination.Handle(), present_stage, VK_ACCESS_2_SHADER_READ_BIT, - VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_WRITE_BIT, - destination.Layout(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL), + MakeTransitionBarrier(source, vk::PIPELINE_STAGE_IMAGE_USERS, vk::ACCESS_IMAGE_WRITES, + VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, + VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL), + MakeTransitionBarrier(destination.Handle(), VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + VK_ACCESS_2_NONE, VK_PIPELINE_STAGE_2_TRANSFER_BIT, + VK_ACCESS_2_TRANSFER_WRITE_BIT, destination.Layout(), + VK_IMAGE_LAYOUT_GENERAL), }; cmdbuf.PipelineBarrier(0, {}, {}, before); - cmdbuf.CopyImage(source, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, destination.Handle(), - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, MakeCopyRegion(extent)); + cmdbuf.BlitImage(source, VK_IMAGE_LAYOUT_GENERAL, destination.Handle(), + VK_IMAGE_LAYOUT_GENERAL, MakeBlitRegion(extent), VK_FILTER_NEAREST); const std::array after{ - make_barrier(source, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, - present_stage, VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL), - make_barrier(destination.Handle(), VK_PIPELINE_STAGE_2_TRANSFER_BIT, - VK_ACCESS_2_TRANSFER_WRITE_BIT, present_stage, VK_ACCESS_2_SHADER_READ_BIT, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL), + MakeTransitionBarrier(source, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_NONE, + vk::PIPELINE_STAGE_IMAGE_USERS, VK_ACCESS_2_NONE, + VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL), + MakeTransitionBarrier(destination.Handle(), VK_PIPELINE_STAGE_2_TRANSFER_BIT, + VK_ACCESS_2_TRANSFER_WRITE_BIT, + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_READ_BIT, + VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL), }; cmdbuf.PipelineBarrier(0, {}, {}, after); @@ -202,8 +184,7 @@ FrameGen::FrameGen(MemoryAllocator& memory_allocator_, Scheduler& scheduler_) FrameGen::~FrameGen() = default; -void FrameGen::Process(const Device& device, Frame* frame, VkFormat format, - VkExtent2D guest_extent) { +void FrameGen::Process(const Device& device, VkImage source, VkExtent2D extent) { generated = false; if (!shaders) { @@ -214,6 +195,7 @@ void FrameGen::Process(const Device& device, Frame* frame, VkFormat format, if (chain) { scheduler.Finish(); chain.reset(); + outputs = {}; } warm_streak = 0; return; @@ -224,19 +206,15 @@ void FrameGen::Process(const Device& device, Frame* frame, VkFormat format, return; } - if (!frame->storage_view) { + if (source == VK_NULL_HANDLE) { warm_streak = 0; return; } - peak_guest_extent.width = std::max(peak_guest_extent.width, guest_extent.width); - peak_guest_extent.height = std::max(peak_guest_extent.height, guest_extent.height); - - const VkExtent2D extent{.width = frame->width, .height = frame->height}; - const f32 flow_scale = ConfiguredFlowScale(peak_guest_extent, extent); + const f32 flow_scale = ConfiguredFlowScale(); if (!chain || built_extent.width != extent.width || built_extent.height != extent.height || - built_format != format || built_flow_scale != flow_scale) { - Rebuild(device, extent, format, flow_scale); + built_flow_scale != flow_scale) { + Rebuild(device, extent, flow_scale); } const u64 count = frame_count++; @@ -247,14 +225,13 @@ void FrameGen::Process(const Device& device, Frame* frame, VkFormat format, warm_streak = warm ? warm_streak + 1 : 0; generated = warm && warm_streak >= LSFG_RECURRENCE_FRAMES && plan.generations > 0; - scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([this, source = *frame->image, extent, count, - dispatch = warm](vk::CommandBuffer cmdbuf) { - CopyPresentedFrame(cmdbuf, source, chain->Input(count), extent); - if (dispatch) { + if (warm) { + scheduler.RequestOutsideRenderPassOperationContext(); + scheduler.Record([this, source, extent, count](vk::CommandBuffer cmdbuf) { + CopySourceFrame(cmdbuf, source, chain->Input(count), extent); chain->DispatchShared(cmdbuf, count); - } - }); + }); + } const bool dump_requested = generated && Settings::values.frame_gen_dump_flow.GetValue(); if (!dump_requested) { @@ -278,30 +255,30 @@ size_t FrameGen::GeneratedFrameCount() const { return generated ? last_generations : 0; } -void FrameGen::GenerateInto(const Device& device, Frame* destination, size_t generation) { - chain->SetTarget(device, last_generations, generation, destination->index, - *destination->storage_view); - - const VkExtent2D extent{.width = destination->width, .height = destination->height}; +const LsfgImage& FrameGen::Generate(const Device& device, size_t generation) { + LsfgImage& output = outputs[generation]; + chain->SetTarget(device, last_generations, generation, output.View()); scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([this, count = last_count, generation_count = last_generations, generation, - target = destination->index, image = *destination->image, - extent](vk::CommandBuffer cmdbuf) { - chain->DispatchGeneration(cmdbuf, count, generation_count, generation, target, image, - extent); + image = output.Handle(), extent = built_extent](vk::CommandBuffer cmdbuf) { + chain->DispatchGeneration(cmdbuf, count, generation_count, generation, image, extent); }); + return output; } -void FrameGen::Rebuild(const Device& device, VkExtent2D extent, VkFormat format, f32 flow_scale) { +void FrameGen::Rebuild(const Device& device, VkExtent2D extent, f32 flow_scale) { scheduler.Finish(); chain.reset(); built_flow_scale = flow_scale; - chain.emplace(device, memory_allocator, *shaders, extent, format, built_flow_scale); + chain.emplace(device, memory_allocator, *shaders, extent, LSFG_DEFAULT_FORMAT, + built_flow_scale); + for (LsfgImage& output : outputs) { + output = LsfgImage(device, memory_allocator, extent, LSFG_DEFAULT_FORMAT); + } built_extent = extent; - built_format = format; frame_count = 0; warm_streak = 0; generated = false; diff --git a/src/video_core/renderer_vulkan/present/frame_gen.h b/src/video_core/renderer_vulkan/present/frame_gen.h index 19c6d04289..cf82fee004 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.h +++ b/src/video_core/renderer_vulkan/present/frame_gen.h @@ -3,6 +3,7 @@ #pragma once +#include #include #include "common/common_types.h" @@ -15,23 +16,22 @@ namespace Vulkan { class Device; class Scheduler; -struct Frame; class FrameGen { public: explicit FrameGen(MemoryAllocator& memory_allocator, Scheduler& scheduler); ~FrameGen(); - void Process(const Device& device, Frame* frame, VkFormat format, VkExtent2D guest_extent); + void Process(const Device& device, VkImage source, VkExtent2D extent); [[nodiscard]] size_t WantedGenerations(size_t capacity); [[nodiscard]] size_t GeneratedFrameCount() const; - void GenerateInto(const Device& device, Frame* destination, size_t generation); + [[nodiscard]] const LsfgImage& Generate(const Device& device, size_t generation); private: - void Rebuild(const Device& device, VkExtent2D extent, VkFormat format, f32 flow_scale); + void Rebuild(const Device& device, VkExtent2D extent, f32 flow_scale); void DumpDebugImages(u64 count); MemoryAllocator& memory_allocator; @@ -39,11 +39,10 @@ private: std::optional shaders; std::optional chain; + std::array outputs; FrameGenPacer pacer; FrameGenPlan plan{}; - VkExtent2D peak_guest_extent{}; VkExtent2D built_extent{}; - VkFormat built_format{VK_FORMAT_UNDEFINED}; f32 built_flow_scale{}; u64 frame_count{}; u64 last_count{}; diff --git a/src/video_core/renderer_vulkan/present/layer.cpp b/src/video_core/renderer_vulkan/present/layer.cpp index d0411df705..2ce6a5f845 100644 --- a/src/video_core/renderer_vulkan/present/layer.cpp +++ b/src/video_core/renderer_vulkan/present/layer.cpp @@ -60,25 +60,34 @@ VkFormat GetFormat(const Tegra::FramebufferConfig& framebuffer) { } // Anonymous namespace -Layer::Layer(const Device& device, MemoryAllocator& memory_allocator_, Scheduler& scheduler_, Tegra::MaxwellDeviceMemoryManager& device_memory_, size_t image_count_, VkExtent2D output_size, VkDescriptorSetLayout layout, const PresentFilters& filters_) +Layer::Layer(const Device& device, MemoryAllocator& memory_allocator_, Scheduler& scheduler_, + Tegra::MaxwellDeviceMemoryManager& device_memory_, size_t image_count_, + size_t generation_count_, VkExtent2D output_size, VkDescriptorSetLayout layout, + const PresentFilters& filters_) : memory_allocator(memory_allocator_) , scheduler(scheduler_) , device_memory(device_memory_) , filters(filters_) , image_count(image_count_) + , generation_count(generation_count_) + , generation_ticks(generation_count_) { CreateDescriptorPool(device); CreateDescriptorSets(device, layout); + const size_t slot_count = image_count + generation_count; if (filters.get_scaling_filter() == Settings::ScalingFilter::Fsr) { - sr_filter.emplace(device, memory_allocator, image_count, output_size); + sr_filter.emplace(device, memory_allocator, slot_count, output_size); } else if (filters.get_scaling_filter() == Settings::ScalingFilter::Sgsr) { - sr_filter.emplace(device, memory_allocator, image_count, output_size, false); + sr_filter.emplace(device, memory_allocator, slot_count, output_size, false); } else if (filters.get_scaling_filter() == Settings::ScalingFilter::SgsrEdge) { - sr_filter.emplace(device, memory_allocator, image_count, output_size, true); + sr_filter.emplace(device, memory_allocator, slot_count, output_size, true); } } Layer::~Layer() { + for (const u64 tick : generation_ticks) { + scheduler.Wait(tick); + } ReleaseRawImages(); } @@ -115,24 +124,36 @@ void Layer::ConfigureDraw(const Device& device, PresentPushConstants* out_push_c VkImage source_image = texture_info ? texture_info->image : *raw_images[image_index]; VkImageView source_image_view = texture_info ? texture_info->image_view : *raw_image_views[image_index]; + const VkExtent2D render_extent{ + .width = scaled_width, + .height = scaled_height, + }; + const VkExtent2D processed_extent{ + .width = Settings::values.resolution_info.ScaleUp(raw_width), + .height = Settings::values.resolution_info.ScaleUp(raw_height), + }; + VkExtent2D source_extent = render_extent; if (auto* fxaa = std::get_if(&anti_alias)) { fxaa->Draw(device, scheduler, image_index, &source_image, &source_image_view); + source_extent = processed_extent; } else if (auto* smaa = std::get_if(&anti_alias)) { smaa->Draw(device, scheduler, image_index, &source_image, &source_image_view); + source_extent = processed_extent; } #ifdef HAS_RESHADE if (post_process.has_value()) { post_process->Draw(device, scheduler, image_index, &source_image, &source_image_view); + source_extent = processed_extent; } #endif auto crop_rect = Tegra::NormalizeCrop(framebuffer, texture_width, texture_height); - const VkExtent2D render_extent{ - .width = scaled_width, - .height = scaled_height, - }; + generation_source = source_image; + generation_extent = source_extent; + generation_render_extent = render_extent; + generation_crop = crop_rect; if (auto* fsr = std::get_if(&sr_filter)) { source_image_view = fsr->Draw(device, scheduler, image_index, source_image, source_image_view, render_extent, crop_rect); @@ -149,12 +170,43 @@ void Layer::ConfigureDraw(const Device& device, PresentPushConstants* out_push_c *out_descriptor_set = descriptor_sets[image_index]; } +void Layer::ConfigureGenerated(const Device& device, PresentPushConstants* out_push_constants, + VkDescriptorSet* out_descriptor_set, VkSampler sampler, + size_t generation, VkImage image, VkImageView view, + const Layout::FramebufferLayout& layout) { + const size_t slot = image_count + generation; + generation_ticks[generation] = scheduler.CurrentTick(); + + VkImageView source_image_view = view; + Common::Rectangle crop_rect = generation_crop; + if (auto* fsr = std::get_if(&sr_filter)) { + source_image_view = + fsr->Draw(device, scheduler, slot, image, view, generation_render_extent, crop_rect); + crop_rect = {0, 0, 1, 1}; + } else if (auto* sgsr = std::get_if(&sr_filter)) { + source_image_view = + sgsr->Draw(device, scheduler, slot, image, view, generation_render_extent, crop_rect); + crop_rect = {0, 0, 1, 1}; + } + + SetMatrixData(device, *out_push_constants, layout); + SetVertexData(device, *out_push_constants, layout, crop_rect); + + UpdateDescriptorSet(device, source_image_view, sampler, slot); + *out_descriptor_set = descriptor_sets[slot]; +} + +bool Layer::IsGenerationFree(size_t generation) const { + return generation < generation_count && scheduler.IsFree(generation_ticks[generation]); +} + void Layer::CreateDescriptorPool(const Device& device) { - descriptor_pool = CreateWrappedDescriptorPool(device, image_count, image_count); + const size_t slot_count = image_count + generation_count; + descriptor_pool = CreateWrappedDescriptorPool(device, slot_count, slot_count); } void Layer::CreateDescriptorSets(const Device& device, VkDescriptorSetLayout layout) { - const std::vector layouts(image_count, layout); + const std::vector layouts(image_count + generation_count, layout); descriptor_sets = CreateWrappedDescriptorSets(descriptor_pool, layouts); } diff --git a/src/video_core/renderer_vulkan/present/layer.h b/src/video_core/renderer_vulkan/present/layer.h index f290ba5bb4..47b23d2596 100644 --- a/src/video_core/renderer_vulkan/present/layer.h +++ b/src/video_core/renderer_vulkan/present/layer.h @@ -51,7 +51,7 @@ class Layer final { public: explicit Layer(const Device& device, MemoryAllocator& memory_allocator, Scheduler& scheduler, Tegra::MaxwellDeviceMemoryManager& device_memory, size_t image_count, - VkExtent2D output_size, VkDescriptorSetLayout layout, + size_t generation_count, VkExtent2D output_size, VkDescriptorSetLayout layout, const PresentFilters& filters); ~Layer(); @@ -61,6 +61,21 @@ public: const Tegra::FramebufferConfig& framebuffer, const Layout::FramebufferLayout& layout); + void ConfigureGenerated(const Device& device, PresentPushConstants* out_push_constants, + VkDescriptorSet* out_descriptor_set, VkSampler sampler, + size_t generation, VkImage image, VkImageView view, + const Layout::FramebufferLayout& layout); + + [[nodiscard]] bool IsGenerationFree(size_t generation) const; + + [[nodiscard]] VkImage GenerationSource() const { + return generation_source; + } + + [[nodiscard]] VkExtent2D GenerationExtent() const { + return generation_extent; + } + private: void CreateDescriptorPool(const Device& device); void CreateDescriptorSets(const Device& device, VkDescriptorSetLayout layout); @@ -88,6 +103,7 @@ private: Tegra::MaxwellDeviceMemoryManager& device_memory; const PresentFilters& filters; const size_t image_count{}; + const size_t generation_count{}; vk::DescriptorPool descriptor_pool{}; vk::DescriptorSets descriptor_sets{}; @@ -108,6 +124,11 @@ private: VkExtent2D post_process_extent{}; #endif std::vector resource_ticks{}; + std::vector generation_ticks{}; + VkImage generation_source{}; + VkExtent2D generation_extent{}; + VkExtent2D generation_render_extent{}; + Common::Rectangle generation_crop{}; }; } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/lsfg_chain.cpp b/src/video_core/renderer_vulkan/present/lsfg_chain.cpp index 972b13a1c4..e52b2fa5fc 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_chain.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_chain.cpp @@ -15,7 +15,7 @@ namespace Vulkan { namespace { constexpr u32 FIXED_DESCRIPTOR_SETS = 64; -constexpr u32 DESCRIPTOR_SETS_PER_SLOT = 112; +constexpr u32 DESCRIPTOR_SETS_PER_SLOT = 100; constexpr size_t FIRST_DELTA_LEVEL = 4; } // Anonymous namespace @@ -88,8 +88,8 @@ void LsfgChain::DispatchShared(vk::CommandBuffer cmdbuf, u64 frame_count) { } void LsfgChain::DispatchGeneration(vk::CommandBuffer cmdbuf, u64 frame_count, - size_t generation_count, size_t generation, u32 target, - VkImage image, VkExtent2D extent) { + size_t generation_count, size_t generation, VkImage image, + VkExtent2D extent) { const size_t slot = LsfgGenerationSlot(generation_count, generation); for (size_t i = 0; i < LSFG_MIP_LEVELS; ++i) { gamma[i].Dispatch(cmdbuf, frame_count, slot); @@ -97,7 +97,7 @@ void LsfgChain::DispatchGeneration(vk::CommandBuffer cmdbuf, u64 frame_count, delta[i - FIRST_DELTA_LEVEL].Dispatch(cmdbuf, frame_count, slot); } } - generate.Dispatch(cmdbuf, frame_count, slot, target, image, extent); + generate.Dispatch(cmdbuf, frame_count, slot, image, extent); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/lsfg_chain.h b/src/video_core/renderer_vulkan/present/lsfg_chain.h index c8879f74a9..4561d3a092 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_chain.h +++ b/src/video_core/renderer_vulkan/present/lsfg_chain.h @@ -35,11 +35,11 @@ public: void DispatchShared(vk::CommandBuffer cmdbuf, u64 frame_count); void DispatchGeneration(vk::CommandBuffer cmdbuf, u64 frame_count, size_t generation_count, - size_t generation, u32 target, VkImage image, VkExtent2D extent); + size_t generation, VkImage image, VkExtent2D extent); - void SetTarget(const Device& device, size_t generation_count, size_t generation, u32 target, + void SetTarget(const Device& device, size_t generation_count, size_t generation, VkImageView view) { - generate.SetTarget(device, LsfgGenerationSlot(generation_count, generation), target, view); + generate.SetTarget(device, LsfgGenerationSlot(generation_count, generation), view); } [[nodiscard]] LsfgImage& Input(u64 frame_count) { diff --git a/src/video_core/renderer_vulkan/present/lsfg_common.cpp b/src/video_core/renderer_vulkan/present/lsfg_common.cpp index e05c7a8b02..68ef254633 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_common.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_common.cpp @@ -127,7 +127,7 @@ LsfgBarriers& LsfgBarriers::DiscardToWrite(VkImage image) { barriers.push_back(VkImageMemoryBarrier2{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + .srcStageMask = vk::PIPELINE_STAGE_IMAGE_USERS, .srcAccessMask = VK_ACCESS_2_NONE, .dstStageMask = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, .dstAccessMask = VK_ACCESS_2_SHADER_WRITE_BIT, diff --git a/src/video_core/renderer_vulkan/present/lsfg_common.h b/src/video_core/renderer_vulkan/present/lsfg_common.h index 33547b1346..68e4d16f57 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_common.h +++ b/src/video_core/renderer_vulkan/present/lsfg_common.h @@ -27,7 +27,6 @@ constexpr VkFormat LSFG_FLOW_FORMAT = VK_FORMAT_R8_UNORM; constexpr VkFormat LSFG_MOTION_FORMAT = VK_FORMAT_R16G16B16A16_SFLOAT; constexpr size_t LSFG_HISTORY_SLOTS = 3; -constexpr size_t LSFG_MAX_TARGETS = 7; constexpr size_t LSFG_MAX_GENERATIONS = 3; constexpr size_t LSFG_GENERATION_SLOTS = LSFG_MAX_GENERATIONS * (LSFG_MAX_GENERATIONS + 1) / 2; diff --git a/src/video_core/renderer_vulkan/present/lsfg_generate.cpp b/src/video_core/renderer_vulkan/present/lsfg_generate.cpp index 2aa470bdb0..f26c27c92c 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_generate.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_generate.cpp @@ -66,25 +66,21 @@ LsfgGenerate::LsfgGenerate(const Device& device, const LsfgShaders& shaders, edge_sampler = resources.GetSampler(VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, VK_COMPARE_OP_ALWAYS, false); - const std::vector layouts( - LSFG_GENERATION_SLOTS * LSFG_MAX_TARGETS * 2, pass.SetLayout()); + const std::vector layouts(LSFG_GENERATION_SLOTS * 2, pass.SetLayout()); owned_sets = CreateWrappedDescriptorSets(descriptor_pool, layouts); size_t next = 0; for (size_t slot = 0; slot < LSFG_GENERATION_SLOTS; ++slot) { - Generation& target = generations[slot]; - target.buffer = resources.GetBuffer(LsfgSlotTimestamp(slot)); - - for (auto& entry : target.targets) { - for (auto& set : entry.descriptor_sets) { - set = owned_sets[next++]; - } + Generation& entry = generations[slot]; + entry.buffer = resources.GetBuffer(LsfgSlotTimestamp(slot)); + for (auto& set : entry.descriptor_sets) { + set = owned_sets[next++]; } } } -void LsfgGenerate::SetTarget(const Device& device, size_t slot, u32 target, VkImageView view) { - Target& entry = generations[slot].targets[target]; +void LsfgGenerate::SetTarget(const Device& device, size_t slot, VkImageView view) { + Generation& entry = generations[slot]; if (entry.view == view) { return; } @@ -92,7 +88,7 @@ void LsfgGenerate::SetTarget(const Device& device, size_t slot, u32 target, VkIm for (size_t i = 0; i < entry.descriptor_sets.size(); ++i) { LsfgDescriptorWriter(entry.descriptor_sets[i]) - .AddUniformBuffer(generations[slot].buffer, LsfgResources::BufferSize()) + .AddUniformBuffer(entry.buffer, LsfgResources::BufferSize()) .AddSampler(sampler) .AddSampler(edge_sampler) .AddSampledImage((*frames)[1 - i]) @@ -105,9 +101,9 @@ void LsfgGenerate::SetTarget(const Device& device, size_t slot, u32 target, VkIm } } -void LsfgGenerate::Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot, u32 target, +void LsfgGenerate::Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot, VkImage image, VkExtent2D extent) { - const Target& entry = generations[slot].targets[target]; + const Generation& entry = generations[slot]; LsfgBarriers(cmdbuf) .WriteToReadAll(*frames) @@ -120,11 +116,10 @@ void LsfgGenerate::Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t sl pass.Bind(cmdbuf, entry.descriptor_sets[frame_count % entry.descriptor_sets.size()]); cmdbuf.Dispatch(GroupCount(extent.width), GroupCount(extent.height), 1); - const std::array after{MakeTargetBarrier( - image, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_WRITE_BIT, - VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_2_TRANSFER_BIT, - VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_TRANSFER_READ_BIT, - VK_IMAGE_LAYOUT_GENERAL)}; + const std::array after{MakeTargetBarrier(image, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + VK_ACCESS_2_SHADER_WRITE_BIT, + vk::PIPELINE_STAGE_IMAGE_USERS, + vk::ACCESS_IMAGE_USERS, VK_IMAGE_LAYOUT_GENERAL)}; cmdbuf.PipelineBarrier(0, {}, {}, after); } diff --git a/src/video_core/renderer_vulkan/present/lsfg_generate.h b/src/video_core/renderer_vulkan/present/lsfg_generate.h index 75cbd8d2e4..fedad97bdd 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_generate.h +++ b/src/video_core/renderer_vulkan/present/lsfg_generate.h @@ -23,19 +23,15 @@ public: vk::DescriptorPool& descriptor_pool, LsfgImagePair& frames, LsfgImage& motion, LsfgImage& detail1, LsfgImage& detail2); - void SetTarget(const Device& device, size_t slot, u32 target, VkImageView view); + void SetTarget(const Device& device, size_t slot, VkImageView view); - void Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot, u32 target, - VkImage image, VkExtent2D extent); + void Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot, VkImage image, + VkExtent2D extent); private: - struct Target { + struct Generation { std::array descriptor_sets{}; VkImageView view{}; - }; - - struct Generation { - std::array targets{}; VkBuffer buffer{}; }; diff --git a/src/video_core/renderer_vulkan/present/lsfg_shaders.cpp b/src/video_core/renderer_vulkan/present/lsfg_shaders.cpp index 51c7e4c106..9aebbc3cd9 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_shaders.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_shaders.cpp @@ -10,7 +10,7 @@ namespace Vulkan { LsfgShaders::LsfgShaders(const Device& device) { if (!device.IsVulkanMemoryModelSupported() || !device.HasNullDescriptor() || - !device.IsFloat16Supported()) { + !device.IsNativeFloat16Enabled()) { return; } diff --git a/src/video_core/renderer_vulkan/present/window_adapt_pass.cpp b/src/video_core/renderer_vulkan/present/window_adapt_pass.cpp index c7718bc688..9cd99206c7 100644 --- a/src/video_core/renderer_vulkan/present/window_adapt_pass.cpp +++ b/src/video_core/renderer_vulkan/present/window_adapt_pass.cpp @@ -34,7 +34,47 @@ void WindowAdaptPass::Draw(const Device& device, RasterizerVulkan& rasterizer, S std::list& layers, std::span configs, const Layout::FramebufferLayout& layout, Frame* dst) { + const size_t layer_count = configs.size(); + layer_push_constants.resize(layer_count); + layer_descriptor_sets.resize(layer_count); + layer_pipelines.resize(layer_count); + auto layer_it = layers.begin(); + for (size_t i = 0; i < layer_count; i++) { + switch (configs[i].blending) { + case Tegra::BlendMode::Opaque: + default: + layer_pipelines[i] = *opaque_pipeline; + break; + case Tegra::BlendMode::Premultiplied: + layer_pipelines[i] = *premultiplied_pipeline; + break; + case Tegra::BlendMode::Coverage: + layer_pipelines[i] = *coverage_pipeline; + break; + } + + layer_it->ConfigureDraw(device, &layer_push_constants[i], &layer_descriptor_sets[i], + rasterizer, *sampler, image_index, configs[i], layout); + layer_it++; + } + + Record(scheduler, dst, layer_push_constants, layer_descriptor_sets); +} + +void WindowAdaptPass::DrawGenerated(const Device& device, Scheduler& scheduler, Layer& layer, + size_t generation, VkImage image, VkImageView view, + const Layout::FramebufferLayout& layout, Frame* dst) { + std::vector push_constants = layer_push_constants; + std::vector descriptor_sets = layer_descriptor_sets; + layer.ConfigureGenerated(device, &push_constants.front(), &descriptor_sets.front(), *sampler, + generation, image, view, layout); + Record(scheduler, dst, std::move(push_constants), std::move(descriptor_sets)); +} + +void WindowAdaptPass::Record(Scheduler& scheduler, Frame* dst, + std::vector push_constants, + std::vector descriptor_sets) const { const VkImage host_image{*dst->image}; const VkImageView host_view{*dst->image_view}; const VkPipelineLayout graphics_pipeline_layout{*pipeline_layout}; @@ -42,33 +82,10 @@ void WindowAdaptPass::Draw(const Device& device, RasterizerVulkan& rasterizer, S .width = dst->width, .height = dst->height, }; - - const size_t layer_count = configs.size(); - std::vector push_constants(layer_count); - std::vector descriptor_sets(layer_count); - std::vector graphics_pipelines(layer_count); - - auto layer_it = layers.begin(); - for (size_t i = 0; i < layer_count; i++) { - switch (configs[i].blending) { - case Tegra::BlendMode::Opaque: - default: - graphics_pipelines[i] = *opaque_pipeline; - break; - case Tegra::BlendMode::Premultiplied: - graphics_pipelines[i] = *premultiplied_pipeline; - break; - case Tegra::BlendMode::Coverage: - graphics_pipelines[i] = *coverage_pipeline; - break; - } - - layer_it->ConfigureDraw(device, &push_constants[i], &descriptor_sets[i], rasterizer, *sampler, - image_index, configs[i], layout); - layer_it++; - } - - scheduler.Record([=](vk::CommandBuffer cmdbuf) { + scheduler.Record([host_image, host_view, graphics_pipeline_layout, render_area, + graphics_pipelines = layer_pipelines, + push_constants = std::move(push_constants), + descriptor_sets = std::move(descriptor_sets)](vk::CommandBuffer cmdbuf) { const f32 bg_red = Settings::values.bg_red.GetValue() / 255.0f; const f32 bg_green = Settings::values.bg_green.GetValue() / 255.0f; const f32 bg_blue = Settings::values.bg_blue.GetValue() / 255.0f; @@ -80,7 +97,7 @@ void WindowAdaptPass::Draw(const Device& device, RasterizerVulkan& rasterizer, S VK_IMAGE_LAYOUT_UNDEFINED); BeginRendering(cmdbuf, host_view, render_area, VK_ATTACHMENT_LOAD_OP_CLEAR, clear_value); - for (size_t i = 0; i < layer_count; i++) { + for (size_t i = 0; i < graphics_pipelines.size(); i++) { cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, graphics_pipelines[i]); cmdbuf.PushConstants(graphics_pipeline_layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants[i]); diff --git a/src/video_core/renderer_vulkan/present/window_adapt_pass.h b/src/video_core/renderer_vulkan/present/window_adapt_pass.h index 4a9ec6934a..d33cacaee9 100644 --- a/src/video_core/renderer_vulkan/present/window_adapt_pass.h +++ b/src/video_core/renderer_vulkan/present/window_adapt_pass.h @@ -7,8 +7,10 @@ #pragma once #include +#include #include "common/math_util.h" +#include "video_core/renderer_vulkan/present/present_push_constants.h" #include "video_core/vulkan_common/vulkan_wrapper.h" namespace Layout { @@ -37,9 +39,16 @@ public: std::list& layers, std::span configs, const Layout::FramebufferLayout& layout, Frame* dst); + void DrawGenerated(const Device& device, Scheduler& scheduler, Layer& layer, size_t generation, + VkImage image, VkImageView view, const Layout::FramebufferLayout& layout, + Frame* dst); + VkDescriptorSetLayout GetDescriptorSetLayout(); private: + void Record(Scheduler& scheduler, Frame* dst, std::vector push_constants, + std::vector descriptor_sets) const; + void CreateDescriptorSetLayout(const Device& device); void CreatePipelineLayout(const Device& device); void CreateVertexShader(const Device& device); @@ -53,6 +62,9 @@ private: vk::Pipeline opaque_pipeline; vk::Pipeline premultiplied_pipeline; vk::Pipeline coverage_pipeline; + std::vector layer_pipelines; + std::vector layer_push_constants; + std::vector layer_descriptor_sets; }; } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 12c9e3a14b..759ae3db32 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -52,23 +52,6 @@ constexpr VkExtent2D CaptureImageSize{ .height = VideoCore::Capture::LinearHeight, }; -#ifdef HAS_LSFG -[[nodiscard]] VkExtent2D GuestExtent(std::span framebuffers) { - if (framebuffers.empty()) { - return VkExtent2D{}; - } - - const auto& framebuffer = framebuffers.front(); - if (framebuffer.crop_rect.IsEmpty()) { - return VkExtent2D{.width = framebuffer.width, .height = framebuffer.height}; - } - return VkExtent2D{ - .width = static_cast(framebuffer.crop_rect.GetWidth()), - .height = static_cast(framebuffer.crop_rect.GetHeight()), - }; -} -#endif - constexpr VkExtent3D CaptureImageExtent{ .width = VideoCore::Capture::LinearWidth, .height = VideoCore::Capture::LinearHeight, @@ -224,14 +207,23 @@ void RendererVulkan::Composite(std::span framebu #ifdef HAS_LSFG void(frame_gen.WantedGenerations(present_manager.MaxExtraFrames())); - frame_gen.Process(device, frame, present_manager.SwapchainImageFormat(), - GuestExtent(framebuffers)); + const FrameGenSource source = blit_swapchain.GenerationSource(); + frame_gen.Process(device, source.image, source.extent); + const Layout::FramebufferLayout layout = render_window.GetFramebufferLayout(); const size_t generated_frames = frame_gen.GeneratedFrameCount(); for (size_t generation = 0; generation < generated_frames; ++generation) { - Frame* generated = present_manager.GetRenderFrame(); - blit_swapchain.PrepareFrame(device, generated, render_window.GetFramebufferLayout()); - frame_gen.GenerateInto(device, generated, generation); + if (!blit_swapchain.IsGenerationFree(generation)) { + break; + } + Frame* const generated = present_manager.TryGetRenderFrame(); + if (generated == nullptr) { + break; + } + blit_swapchain.PrepareFrame(device, generated, layout); + const LsfgImage& output = frame_gen.Generate(device, generation); + blit_swapchain.DrawGenerated(device, generated, layout, generation, output.Handle(), + output.View()); scheduler.Flush(*generated->render_ready); present_manager.Present(generated); } diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp index 1ca8bf7938..19b9a64344 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp +++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp @@ -92,13 +92,33 @@ void BlitScreen::PrepareFrame(const Device& device, Frame* frame, return; } - if (frame->width != layout.width || frame->height != layout.height) { - WaitIdle(device); - } else if (!present_manager.NeedsStorage(frame, true)) { + if (frame->width == layout.width && frame->height == layout.height) { return; } - present_manager.RecreateFrame(frame, layout.width, layout.height, swapchain_view_format, true); + WaitIdle(device); + present_manager.RecreateFrame(frame, layout.width, layout.height, swapchain_view_format); +} + +FrameGenSource BlitScreen::GenerationSource() const { + if (layers.empty()) { + return {}; + } + return FrameGenSource{ + .image = layers.front().GenerationSource(), + .extent = layers.front().GenerationExtent(), + }; +} + +bool BlitScreen::IsGenerationFree(size_t generation) const { + return !layers.empty() && layers.front().IsGenerationFree(generation); +} + +void BlitScreen::DrawGenerated(const Device& device, Frame* frame, + const Layout::FramebufferLayout& layout, size_t generation, + VkImage image, VkImageView view) { + window_adapt->DrawGenerated(device, scheduler, layers.front(), generation, image, view, layout, + frame); } void BlitScreen::DrawToFrame(const Device& device, RasterizerVulkan& rasterizer, Frame* frame, @@ -125,20 +145,16 @@ void BlitScreen::DrawToFrame(const Device& device, RasterizerVulkan& rasterizer, swapchain_view_format = current_swapchain_view_format; } - const bool storage_required = Settings::values.frame_gen.GetValue(); if (resource_update_required) { WaitIdle(device); SetWindowAdaptPass(device); if (presentation_recreate_required) { - present_manager.RecreateFrame(frame, layout.width, layout.height, swapchain_view_format, - storage_required); + present_manager.RecreateFrame(frame, layout.width, layout.height, + swapchain_view_format); } image_index = 0; - } else if (present_manager.NeedsStorage(frame, storage_required)) { - present_manager.RecreateFrame(frame, layout.width, layout.height, swapchain_view_format, - true); } const VkExtent2D window_size{ @@ -146,11 +162,14 @@ void BlitScreen::DrawToFrame(const Device& device, RasterizerVulkan& rasterizer, .height = layout.screen.GetHeight(), }; - if (layers.size() != framebuffers.size()) { + const size_t generations = Settings::FrameGenMaxGenerations(); + if (layers.size() != framebuffers.size() || generation_count != generations) { layers.clear(); + generation_count = generations; for (size_t i = 0; i < framebuffers.size(); ++i) { layers.emplace_back(device, memory_allocator, scheduler, device_memory, image_count, - window_size, window_adapt->GetDescriptorSetLayout(), filters); + generation_count, window_size, + window_adapt->GetDescriptorSetLayout(), filters); } } diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.h b/src/video_core/renderer_vulkan/vk_blit_screen.h index 46d42d3a73..4f1a7c78d5 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.h +++ b/src/video_core/renderer_vulkan/vk_blit_screen.h @@ -48,6 +48,11 @@ struct FramebufferTextureInfo { u32 scaled_height{}; }; +struct FrameGenSource { + VkImage image{}; + VkExtent2D extent{}; +}; + class BlitScreen { public: explicit BlitScreen(Tegra::MaxwellDeviceMemoryManager& device_memory, const Device& device, @@ -62,6 +67,13 @@ public: void PrepareFrame(const Device& device, Frame* frame, const Layout::FramebufferLayout& layout); + [[nodiscard]] FrameGenSource GenerationSource() const; + + [[nodiscard]] bool IsGenerationFree(size_t generation) const; + + void DrawGenerated(const Device& device, Frame* frame, const Layout::FramebufferLayout& layout, + size_t generation, VkImage image, VkImageView view); + private: void WaitIdle(const Device& device); void SetWindowAdaptPass(const Device& device); @@ -73,6 +85,7 @@ private: const PresentFilters& filters; std::size_t image_count{}; std::size_t image_index{}; + std::size_t generation_count{}; VkFormat swapchain_view_format{}; Settings::ScalingFilter scaling_filter{}; diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index 144a23b4b8..ec26f4dc9a 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -7,9 +7,6 @@ #include "common/settings.h" #include "common/thread.h" #include "core/frontend/emu_window.h" -#ifdef HAS_LSFG -#include "video_core/renderer_vulkan/present/lsfg_common.h" -#endif #include "video_core/renderer_vulkan/vk_present_manager.h" #include "video_core/renderer_vulkan/vk_scheduler.h" #include "video_core/renderer_vulkan/vk_swapchain.h" @@ -24,18 +21,6 @@ namespace { constexpr size_t MAX_FRAMES_IN_FLIGHT = 7; constexpr u32 MAX_PRESENT_ATTEMPTS = 3; -#ifdef HAS_LSFG -static_assert(MAX_FRAMES_IN_FLIGHT <= LSFG_MAX_TARGETS); -#endif - -bool CanStoreToFrame(const vk::PhysicalDevice& physical_device, VkFormat format) { -#ifdef HAS_LSFG - const VkFormatProperties props{physical_device.GetFormatProperties(format)}; - return (props.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) != 0; -#else - return false; -#endif -} bool CanBlitToSwapchain(const vk::PhysicalDevice& physical_device, VkFormat format) { const VkFormatProperties props{physical_device.GetFormatProperties(format)}; @@ -132,7 +117,6 @@ PresentManager::PresentManager(const vk::Instance& instance_, , swapchain{swapchain_} , surface{surface_} , blit_supported{CanBlitToSwapchain(device.GetPhysical(), swapchain.GetImageViewFormat())} - , storage_supported{CanStoreToFrame(device.GetPhysical(), swapchain.GetImageFormat())} , use_present_thread{Settings::values.async_presentation.GetValue()} { SetImageCount(); @@ -162,7 +146,6 @@ PresentManager::PresentManager(const vk::Instance& instance_, .pNext = nullptr, .flags = VK_FENCE_CREATE_SIGNALED_BIT, }); - frame.storage_capable = storage_supported; free_queue.push_back(&frame); } @@ -190,6 +173,17 @@ Frame* PresentManager::GetRenderFrame() { return frame; } +Frame* PresentManager::TryGetRenderFrame() { + std::scoped_lock lock{free_mutex}; + if (free_queue.empty() || free_queue.front()->present_done.GetStatus() != VK_SUCCESS) { + return nullptr; + } + Frame* const frame = free_queue.front(); + free_queue.pop_front(); + frame->present_done.Reset(); + return frame; +} + void PresentManager::Present(Frame* frame) { if (use_present_thread) { scheduler.Record([this, frame](vk::CommandBuffer) { @@ -208,23 +202,13 @@ size_t PresentManager::MaxExtraFrames() const { return image_count - 1; } -bool PresentManager::NeedsStorage(const Frame* frame, bool required) const { - return required && frame->storage_capable && !frame->storage_view; -} - -void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat image_view_format, - bool storage) { +void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, + VkFormat image_view_format) { auto& dld = device.GetLogical(); frame->width = width; frame->height = height; - const bool with_storage = storage && frame->storage_capable; - VkImageUsageFlags storage_usage = 0; - if (with_storage) { - storage_usage = VK_IMAGE_USAGE_STORAGE_BIT; - } - frame->image = memory_allocator.CreateImage({ .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, .pNext = nullptr, @@ -242,7 +226,7 @@ void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat .samples = VK_SAMPLE_COUNT_1_BIT, .tiling = VK_IMAGE_TILING_OPTIMAL, .usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | storage_usage, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, .sharingMode = VK_SHARING_MODE_EXCLUSIVE, .queueFamilyIndexCount = 0, .pQueueFamilyIndices = nullptr, @@ -272,33 +256,6 @@ void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat .layerCount = 1, }, }); - - frame->storage_view = vk::ImageView{}; - if (with_storage) { - frame->storage_view = dld.CreateImageView({ - .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - .image = *frame->image, - .viewType = VK_IMAGE_VIEW_TYPE_2D, - .format = swapchain.GetImageFormat(), - .components = - { - .r = VK_COMPONENT_SWIZZLE_IDENTITY, - .g = VK_COMPONENT_SWIZZLE_IDENTITY, - .b = VK_COMPONENT_SWIZZLE_IDENTITY, - .a = VK_COMPONENT_SWIZZLE_IDENTITY, - }, - .subresourceRange = - { - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .baseMipLevel = 0, - .levelCount = 1, - .baseArrayLayer = 0, - .layerCount = 1, - }, - }); - } } void PresentManager::WaitPresent() { @@ -358,9 +315,9 @@ void PresentManager::SetImageCount() { #ifdef HAS_LSFG const size_t generations = Settings::FrameGenMaxGenerations(); const size_t queued_composites = Settings::values.frame_gen_queue_target.GetValue() + 1; - image_count = - std::clamp((generations + 1) * queued_composites, swapchain.GetImageCount(), - MAX_FRAMES_IN_FLIGHT); + const size_t baseline = swapchain.GetImageCount() + generations; + image_count = std::min(std::max((generations + 1) * queued_composites, baseline), + MAX_FRAMES_IN_FLIGHT); #else image_count = std::min(swapchain.GetImageCount(), MAX_FRAMES_IN_FLIGHT); #endif diff --git a/src/video_core/renderer_vulkan/vk_present_manager.h b/src/video_core/renderer_vulkan/vk_present_manager.h index bde5bb1d5d..a59d18f420 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.h +++ b/src/video_core/renderer_vulkan/vk_present_manager.h @@ -32,11 +32,9 @@ struct Frame { u32 index; vk::Image image; vk::ImageView image_view; - vk::ImageView storage_view; vk::CommandBuffer cmdbuf; vk::Semaphore render_ready; vk::Fence present_done; - bool storage_capable{}; }; class PresentManager { @@ -53,14 +51,13 @@ public: /// Returns the last used presentation frame Frame* GetRenderFrame(); + [[nodiscard]] Frame* TryGetRenderFrame(); + /// Pushes a frame for presentation void Present(Frame* frame); /// Recreates the present frame to match the provided parameters - void RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat image_view_format, - bool storage); - - [[nodiscard]] bool NeedsStorage(const Frame* frame, bool required) const; + void RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat image_view_format); /// Waits for the present thread to finish presenting all queued frames. void WaitPresent(); @@ -103,7 +100,6 @@ private: std::mutex free_mutex; std::jthread present_thread; bool blit_supported; - bool storage_supported; bool use_present_thread; std::atomic image_count{}; std::atomic swapchain_image_count{}; diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 6c52137e08..58218a91fb 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -564,7 +564,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR const auto arch = GetNvidiaArch(); if (arch >= NvidiaArchitecture::Arch_AmpereOrNewer) { LOG_WARNING(Render_Vulkan, "Ampere and newer have broken float16 math"); - features.shader_float16_int8.shaderFloat16 = false; + has_broken_float16_math = true; } // Use hardware depth/stencil blits instead when available @@ -596,13 +596,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR "AMD GCN4 and earlier have broken VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); has_broken_cube_compatibility = true; } - - // AMD drivers (2026+) have broken float16 math on DKCR - if (features.shader_float16_int8.shaderFloat16) { - LOG_WARNING(Render_Vulkan, - "AMD drivers (2026+) have broken float16 math"); - features.shader_float16_int8.shaderFloat16 = false; - } } if (extensions.sampler_filter_minmax && is_amd) { diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 460a3b702e..88504926c8 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -434,6 +434,10 @@ FN_MAX_LIMIT_LIST /// Returns true if the device supports float16 natively. bool IsFloat16Supported() const { + return features.shader_float16_int8.shaderFloat16 && !has_broken_float16_math; + } + + bool IsNativeFloat16Enabled() const { return features.shader_float16_int8.shaderFloat16; } @@ -1196,6 +1200,7 @@ private: bool is_integrated{}; ///< Is GPU an iGPU. bool has_broken_compute{}; ///< Compute shaders can cause crashes bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit + bool has_broken_float16_math{}; bool has_broken_descriptor_aliasing{}; ///< Miscompiles descriptors aliased on one binding bool has_broken_parallel_compiling{}; ///< Has broken parallel shader compiling. bool has_renderdoc{}; ///< Has RenderDoc attached diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 641f65d82a..4d89a53be0 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -41,6 +41,37 @@ #include "yuzu/configuration/configure_post_processing.h" #endif +#ifdef HAS_LSFG +#include +#include +#include +#include +#include +#include +#include "common/string_util.h" +#include "video_core/frame_gen/lossless_dll.h" + +namespace { + +QString LosslessSearchDirectory() { + const QString suffix = QStringLiteral("/steamapps/common/Lossless Scaling"); + const std::array roots{ + QDir::homePath() + QStringLiteral("/.local/share/Steam"), + QDir::homePath() + QStringLiteral("/.steam/steam"), + QDir::homePath() + QStringLiteral("/.var/app/com.valvesoftware.Steam/.local/share/Steam"), + QStringLiteral("C:/Program Files (x86)/Steam"), + }; + for (const QString& root : roots) { + if (QDir(root + suffix).exists()) { + return root + suffix; + } + } + return QDir::homePath(); +} + +} // Anonymous namespace +#endif + ConfigureGraphics::ConfigureGraphics( const Core::System& system_, std::vector& records_, const std::function& expose_compute_option_, @@ -322,11 +353,27 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) { hold_graphics.emplace(setting->Id(), widget); #endif +#ifdef HAS_LSFG + } else if (setting->Id() == Settings::values.frame_gen.Id()) { + SetupFrameGen(widget); + hold_graphics.emplace(setting->Id(), widget); + } else if (setting->PairedSetting() == &Settings::values.frame_gen) { + frame_gen_widgets.push_back(widget); + hold_graphics.emplace(setting->Id(), widget); +#endif } else { hold_graphics.emplace(setting->Id(), widget); } } +#ifdef HAS_LSFG + if (frame_gen_checkbox != nullptr) { + for (QWidget* frame_gen_widget : frame_gen_widgets) { + frame_gen_widget->setVisible(frame_gen_checkbox->isChecked()); + } + } +#endif + for (const auto& [id, widget] : hold_graphics) { graphics_layout.addWidget(widget); } @@ -511,3 +558,84 @@ Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const { return Settings::RendererBackend::OpenGL_GLSL; return selected_backend; } + +#ifdef HAS_LSFG +void ConfigureGraphics::SetupFrameGen(ConfigurationShared::Widget* widget) { + frame_gen_checkbox = widget->checkbox; + lossless_button = new QPushButton(widget); + lossless_button->setEnabled(!system.IsPoweredOn()); + UpdateLosslessButton(); + + connect(lossless_button, &QAbstractButton::clicked, this, [this] { InstallLosslessDll(); }); + connect(frame_gen_checkbox, &QCheckBox::toggled, this, [this](bool checked) { + for (QWidget* frame_gen_widget : frame_gen_widgets) { + frame_gen_widget->setVisible(checked); + } + }); + + QBoxLayout* row = qobject_cast(widget->layout()); + row->insertWidget(1, lossless_button); +} + +void ConfigureGraphics::UpdateLosslessButton() { + using VideoCore::FrameGen::LosslessStatus; + if (VideoCore::FrameGen::GetInstalledLosslessStatus() == LosslessStatus::Ok) { + lossless_button->setText(tr("Replace Lossless.dll...")); + } else { + lossless_button->setText(tr("Install Lossless.dll...")); + } +} + +void ConfigureGraphics::InstallLosslessDll() { + using VideoCore::FrameGen::LosslessStatus; + const auto status_text = [this](LosslessStatus status) { + switch (status) { + case LosslessStatus::NotPortableExecutable: + return tr("The selected file is not a Windows library. Select Lossless.dll from your " + "Lossless Scaling installation."); + case LosslessStatus::MissingShaders: + return tr("This copy of Lossless.dll does not contain the frame generation shaders. " + "Update Lossless Scaling and try again."); + case LosslessStatus::TranslationFailed: + return tr("The frame generation shaders could not be translated. This version of " + "Lossless Scaling is not supported yet."); + case LosslessStatus::CacheUnusable: + return tr("The translated shaders could not be written to storage. Check that there " + "is free space available."); + default: + return tr("The selected file could not be read."); + } + }; + + const QString file = + QFileDialog::getOpenFileName(this, tr("Select Lossless.dll"), LosslessSearchDirectory(), + tr("Lossless Scaling library (Lossless.dll)")); + if (file.isEmpty()) { + return; + } + + const std::filesystem::path source{Common::U16StringFromBuffer(file.utf16(), file.size())}; + LosslessStatus status = VideoCore::FrameGen::ValidateLosslessDll(source); + if (status == LosslessStatus::Ok) { + const std::filesystem::path target = VideoCore::FrameGen::GetLosslessDllPath(); + std::error_code error; + std::filesystem::create_directories(target.parent_path(), error); + std::filesystem::copy_file(source, target, + std::filesystem::copy_options::overwrite_existing, error); + if (error) { + QMessageBox::warning(this, tr("Could not install Lossless.dll"), + tr("The selected file could not be copied.")); + return; + } + status = VideoCore::FrameGen::BuildShaderCache(); + } + + UpdateLosslessButton(); + if (status == LosslessStatus::Ok) { + QMessageBox::information(this, tr("Lossless Scaling"), + tr("Lossless.dll installed successfully.")); + return; + } + QMessageBox::warning(this, tr("Could not install Lossless.dll"), status_text(status)); +} +#endif diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index 9002af437b..95fe1995cb 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h @@ -22,6 +22,7 @@ #include "qt_common/util/vk.h" #include "yuzu/configuration/configuration_shared.h" +class QCheckBox; class QPushButton; class QEvent; class QObject; @@ -42,6 +43,7 @@ class ConfigureGraphics; namespace ConfigurationShared { class Builder; +class Widget; } class ConfigureGraphics : public ConfigurationShared::Tab { @@ -83,6 +85,12 @@ private: int FindIndex(u32 enumeration, int value) const; +#ifdef HAS_LSFG + void SetupFrameGen(ConfigurationShared::Widget* widget); + void InstallLosslessDll(); + void UpdateLosslessButton(); +#endif + std::unique_ptr ui; QColor bg_color; @@ -110,4 +118,9 @@ private: QWidget* api_widget; QComboBox* aspect_ratio_combobox; QComboBox* resolution_combobox; +#ifdef HAS_LSFG + QCheckBox* frame_gen_checkbox{}; + QPushButton* lossless_button{}; + std::vector frame_gen_widgets; +#endif }; diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp index 0f59ee23a6..5dd6094b96 100644 --- a/src/yuzu/configuration/shared_widget.cpp +++ b/src/yuzu/configuration/shared_widget.cpp @@ -511,7 +511,12 @@ void Widget::SetupComponent(const QString& label, std::function& load_fu layout->setContentsMargins(0, 0, 0, 0); if (other_setting == nullptr) { - other_setting = setting.PairedSetting(); + Settings::BasicSetting* const paired = setting.PairedSetting(); + const bool paired_standalone = paired != nullptr && translations.contains(paired->Id()) && + !translations.at(paired->Id()).first.isEmpty(); + if (!paired_standalone) { + other_setting = paired; + } } const bool require_checkbox = other_setting != nullptr && other_setting->TypeId() == "bool"; @@ -774,7 +779,12 @@ Builder::~Builder() = default; static bool IsAndroidOnly(const Settings::BasicSetting& setting) { const std::string& label = setting.GetLabel(); - return label.starts_with("frame_gen") || label == "emulate_bgr565"; +#ifndef HAS_LSFG + if (label.starts_with("frame_gen")) { + return true; + } +#endif + return label == "emulate_bgr565"; } Widget* Builder::BuildWidget(Settings::BasicSetting* setting, From 940568bb339491c8f665d052324e5b687401e224 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 15:06:43 -0400 Subject: [PATCH 139/198] fix lsfg build desktop + adjustments --- src/video_core/frame_gen/lossless_dll.cpp | 2 +- .../renderer_vulkan/present/frame_gen.cpp | 134 +++++++++++------- .../renderer_vulkan/present/frame_gen.h | 14 +- .../present/frame_gen_pacer.cpp | 18 +-- .../renderer_vulkan/present/layer.cpp | 2 +- .../renderer_vulkan/present/layer.h | 4 +- .../renderer_vulkan/present/lsfg_chain.cpp | 2 +- .../renderer_vulkan/present/lsfg_common.cpp | 5 +- .../renderer_vulkan/present/lsfg_mipmaps.cpp | 6 +- .../renderer_vulkan/renderer_vulkan.cpp | 2 +- .../renderer_vulkan/vk_blit_screen.cpp | 2 +- .../renderer_vulkan/vk_blit_screen.h | 2 +- .../renderer_vulkan/vk_present_manager.cpp | 4 +- src/yuzu/configuration/configure_graphics.cpp | 2 +- 14 files changed, 123 insertions(+), 76 deletions(-) diff --git a/src/video_core/frame_gen/lossless_dll.cpp b/src/video_core/frame_gen/lossless_dll.cpp index 6be1e5530f..32c36f195e 100644 --- a/src/video_core/frame_gen/lossless_dll.cpp +++ b/src/video_core/frame_gen/lossless_dll.cpp @@ -157,7 +157,7 @@ private: [[nodiscard]] std::optional RvaToFileOffset(std::span sections, u32 rva) { for (const Section& section : sections) { - const u32 span = std::max(section.virtual_size, section.raw_size); + const u32 span = (std::max)(section.virtual_size, section.raw_size); if (span == 0 || rva < section.virtual_address) { continue; } diff --git a/src/video_core/renderer_vulkan/present/frame_gen.cpp b/src/video_core/renderer_vulkan/present/frame_gen.cpp index 21bd0d06b8..3ea8941ba9 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen.cpp @@ -9,9 +9,12 @@ #include "common/fs/fs.h" #include "common/fs/path_util.h" #include "common/settings.h" +#include "video_core/host_shaders/vulkan_fidelityfx_fsr_vert_spv.h" +#include "video_core/host_shaders/vulkan_present_frag_spv.h" #include "video_core/renderer_vulkan/present/frame_gen.h" #include "video_core/renderer_vulkan/present/util.h" #include "video_core/renderer_vulkan/vk_scheduler.h" +#include "video_core/renderer_vulkan/vk_shader_util.h" #include "video_core/vulkan_common/vulkan_device.h" namespace Vulkan { @@ -24,7 +27,7 @@ constexpr u32 LSFG_RECURRENCE_FRAMES = 2; [[nodiscard]] f32 ConfiguredFlowScale() { if (Settings::values.frame_gen_flow_scale_auto.GetValue()) { - return 1.0f; + return std::clamp(1.0f / Settings::values.resolution_info.up_factor, 0.25f, 1.0f); } return static_cast(Settings::values.frame_gen_flow_scale.GetValue()) / 100.0f; } @@ -65,7 +68,7 @@ void WritePortablePixmap(const std::filesystem::path& path, const std::string& m void WriteGrayscalePgm(const std::filesystem::path& path, VkExtent2D extent, std::span pixels) { const size_t expected = static_cast(extent.width) * extent.height; - WritePortablePixmap(path, "P5", extent, pixels.subspan(0, std::min(expected, pixels.size()))); + WritePortablePixmap(path, "P5", extent, pixels.subspan(0, (std::min)(expected, pixels.size()))); } void WriteRaw(const std::filesystem::path& path, std::span pixels) { @@ -125,58 +128,65 @@ VkImageMemoryBarrier2 MakeTransitionBarrier(VkImage image, VkPipelineStageFlags2 }; } -VkImageBlit2 MakeBlitRegion(VkExtent2D extent) { - const VkImageSubresourceLayers layers{ - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .mipLevel = 0, - .baseArrayLayer = 0, - .layerCount = 1, - }; - const VkOffset3D end{ - .x = static_cast(extent.width), - .y = static_cast(extent.height), - .z = 1, - }; - return VkImageBlit2{ - .sType = VK_STRUCTURE_TYPE_IMAGE_BLIT_2, - .pNext = nullptr, - .srcSubresource = layers, - .srcOffsets = {VkOffset3D{}, end}, - .dstSubresource = layers, - .dstOffsets = {VkOffset3D{}, end}, - }; -} +void DrawSourceFrame(vk::CommandBuffer cmdbuf, VkPipeline pipeline, VkPipelineLayout layout, + VkDescriptorSet set, LsfgImage& destination, VkExtent2D extent) { + const VkImageMemoryBarrier2 before = MakeTransitionBarrier( + destination.Handle(), VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_NONE, + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, + destination.Layout(), VK_IMAGE_LAYOUT_GENERAL); + cmdbuf.PipelineBarrier(before); -void CopySourceFrame(vk::CommandBuffer cmdbuf, VkImage source, LsfgImage& destination, - VkExtent2D extent) { - const std::array before{ - MakeTransitionBarrier(source, vk::PIPELINE_STAGE_IMAGE_USERS, vk::ACCESS_IMAGE_WRITES, - VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, - VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL), - MakeTransitionBarrier(destination.Handle(), VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - VK_ACCESS_2_NONE, VK_PIPELINE_STAGE_2_TRANSFER_BIT, - VK_ACCESS_2_TRANSFER_WRITE_BIT, destination.Layout(), - VK_IMAGE_LAYOUT_GENERAL), + const VkViewport viewport{ + .x = 0.0f, + .y = 0.0f, + .width = static_cast(extent.width), + .height = static_cast(extent.height), + .minDepth = 0.0f, + .maxDepth = 1.0f, }; - cmdbuf.PipelineBarrier(0, {}, {}, before); - - cmdbuf.BlitImage(source, VK_IMAGE_LAYOUT_GENERAL, destination.Handle(), - VK_IMAGE_LAYOUT_GENERAL, MakeBlitRegion(extent), VK_FILTER_NEAREST); - - const std::array after{ - MakeTransitionBarrier(source, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_NONE, - vk::PIPELINE_STAGE_IMAGE_USERS, VK_ACCESS_2_NONE, - VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL), - MakeTransitionBarrier(destination.Handle(), VK_PIPELINE_STAGE_2_TRANSFER_BIT, - VK_ACCESS_2_TRANSFER_WRITE_BIT, - VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_READ_BIT, - VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL), + const VkRect2D scissor{ + .offset = {0, 0}, + .extent = extent, }; - cmdbuf.PipelineBarrier(0, {}, {}, after); + BeginRendering(cmdbuf, destination.View(), extent, VK_ATTACHMENT_LOAD_OP_DONT_CARE); + cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); + cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, set, {}); + cmdbuf.SetViewport(0, viewport); + cmdbuf.SetScissor(0, scissor); + cmdbuf.Draw(3, 1, 0, 0); + cmdbuf.EndRendering(); + + const VkImageMemoryBarrier2 after = MakeTransitionBarrier( + destination.Handle(), VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, + VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, + VK_ACCESS_2_SHADER_READ_BIT, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL); + cmdbuf.PipelineBarrier(after); destination.SetLayout(VK_IMAGE_LAYOUT_GENERAL); } +void UpdateSourceSet(const Device& device, VkDescriptorSet set, VkSampler sampler, + VkImageView view) { + const VkDescriptorImageInfo image_info{ + .sampler = sampler, + .imageView = view, + .imageLayout = VK_IMAGE_LAYOUT_GENERAL, + }; + const VkWriteDescriptorSet write{ + .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, + .pNext = nullptr, + .dstSet = set, + .dstBinding = 0, + .dstArrayElement = 0, + .descriptorCount = 1, + .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + .pImageInfo = &image_info, + .pBufferInfo = nullptr, + .pTexelBufferView = nullptr, + }; + device.GetLogical().UpdateDescriptorSets(std::array{write}, {}); +} + } // Anonymous namespace FrameGen::FrameGen(MemoryAllocator& memory_allocator_, Scheduler& scheduler_) @@ -184,11 +194,12 @@ FrameGen::FrameGen(MemoryAllocator& memory_allocator_, Scheduler& scheduler_) FrameGen::~FrameGen() = default; -void FrameGen::Process(const Device& device, VkImage source, VkExtent2D extent) { +void FrameGen::Process(const Device& device, VkImageView source, VkExtent2D extent) { generated = false; if (!shaders) { shaders.emplace(device); + CreateInputPass(device); } if (unavailable || !Settings::values.frame_gen.GetValue()) { @@ -221,14 +232,20 @@ void FrameGen::Process(const Device& device, VkImage source, VkExtent2D extent) last_count = count; last_generations = plan.generations; - const bool warm = plan.warm && count + 1 >= LSFG_REQUIRED_FRAMES; + const size_t input_slot = count % INPUT_SLOTS; + const bool warm = plan.warm && count + 1 >= LSFG_REQUIRED_FRAMES && + scheduler.IsFree(input_ticks[input_slot]); warm_streak = warm ? warm_streak + 1 : 0; generated = warm && warm_streak >= LSFG_RECURRENCE_FRAMES && plan.generations > 0; if (warm) { + const VkDescriptorSet set = input_sets[input_slot]; + input_ticks[input_slot] = scheduler.CurrentTick(); + UpdateSourceSet(device, set, *input_sampler, source); scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([this, source, extent, count](vk::CommandBuffer cmdbuf) { - CopySourceFrame(cmdbuf, source, chain->Input(count), extent); + scheduler.Record([this, set, extent, count](vk::CommandBuffer cmdbuf) { + DrawSourceFrame(cmdbuf, *input_pipeline, *input_layout, set, chain->Input(count), + extent); chain->DispatchShared(cmdbuf, count); }); } @@ -267,6 +284,21 @@ const LsfgImage& FrameGen::Generate(const Device& device, size_t generation) { return output; } +void FrameGen::CreateInputPass(const Device& device) { + input_set_layout = + CreateWrappedDescriptorSetLayout(device, {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER}); + input_layout = CreateWrappedPipelineLayout(device, input_set_layout); + input_pool = CreateWrappedDescriptorPool(device, INPUT_SLOTS, INPUT_SLOTS); + std::array layouts; + layouts.fill(*input_set_layout); + input_sets = CreateWrappedDescriptorSets(input_pool, layouts); + input_vertex_shader = BuildShader(device, VULKAN_FIDELITYFX_FSR_VERT_SPV); + input_fragment_shader = BuildShader(device, VULKAN_PRESENT_FRAG_SPV); + input_pipeline = CreateWrappedPipeline(device, LSFG_DEFAULT_FORMAT, input_layout, + std::tie(input_vertex_shader, input_fragment_shader)); + input_sampler = CreateNearestNeighborSampler(device); +} + void FrameGen::Rebuild(const Device& device, VkExtent2D extent, f32 flow_scale) { scheduler.Finish(); chain.reset(); diff --git a/src/video_core/renderer_vulkan/present/frame_gen.h b/src/video_core/renderer_vulkan/present/frame_gen.h index cf82fee004..6993ffcb20 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.h +++ b/src/video_core/renderer_vulkan/present/frame_gen.h @@ -22,7 +22,7 @@ public: explicit FrameGen(MemoryAllocator& memory_allocator, Scheduler& scheduler); ~FrameGen(); - void Process(const Device& device, VkImage source, VkExtent2D extent); + void Process(const Device& device, VkImageView source, VkExtent2D extent); [[nodiscard]] size_t WantedGenerations(size_t capacity); @@ -31,6 +31,9 @@ public: [[nodiscard]] const LsfgImage& Generate(const Device& device, size_t generation); private: + static constexpr size_t INPUT_SLOTS = 4; + + void CreateInputPass(const Device& device); void Rebuild(const Device& device, VkExtent2D extent, f32 flow_scale); void DumpDebugImages(u64 count); @@ -40,6 +43,15 @@ private: std::optional shaders; std::optional chain; std::array outputs; + vk::DescriptorSetLayout input_set_layout; + vk::PipelineLayout input_layout; + vk::DescriptorPool input_pool; + vk::DescriptorSets input_sets; + vk::ShaderModule input_vertex_shader; + vk::ShaderModule input_fragment_shader; + vk::Pipeline input_pipeline; + vk::Sampler input_sampler; + std::array input_ticks{}; FrameGenPacer pacer; FrameGenPlan plan{}; VkExtent2D built_extent{}; diff --git a/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp b/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp index 78a8c83b5a..80aca5ebe0 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp @@ -47,7 +47,7 @@ constexpr auto PROBE_STEP_DELAY = std::chrono::milliseconds(250); } // Anonymous namespace FrameGenPlan FrameGenPacer::Plan(size_t capacity) { - const size_t ceiling = std::min(capacity, Settings::FrameGenMaxGenerations()); + const size_t ceiling = (std::min)(capacity, Settings::FrameGenMaxGenerations()); if (ceiling == 0) { Reset(); return {}; @@ -74,7 +74,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { if (smoothed_interval > 0.0f) { f32 burst_threshold = BURST_CADENCE_RATIO / smoothed_interval; if (target_rate > 0.0f) { - burst_threshold = std::max(burst_threshold, target_rate * BURST_TARGET_RATIO); + burst_threshold = (std::max)(burst_threshold, target_rate * BURST_TARGET_RATIO); } if (1.0f / interval_seconds > burst_threshold) { DeferEvaluations(interval); @@ -109,7 +109,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { } if (target_rate == 0.0f) { - limit = std::min(Settings::FrameGenGenerations(), ceiling); + limit = (std::min)(Settings::FrameGenGenerations(), ceiling); output_credit = 0.0f; issued_generations = limit; return {.generations = limit, .warm = limit > 0}; @@ -117,7 +117,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { UpdateLimit(now, 1.0f / smoothed_interval, target_rate, ceiling); - const size_t allowed = std::min(limit, ceiling); + const size_t allowed = (std::min)(limit, ceiling); const f32 desired_outputs = smoothed_interval * target_rate; if (allowed == 0 || desired_outputs <= 1.0f) { output_credit = 0.0f; @@ -127,7 +127,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { output_credit += desired_outputs; const size_t outputs = std::max(1, static_cast(std::floor(output_credit + CREDIT_EPSILON))); - const size_t generations = std::min(outputs - 1, allowed); + const size_t generations = (std::min)(outputs - 1, allowed); output_credit -= static_cast(generations + 1); if (output_credit < 0.0f) { @@ -142,7 +142,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { void FrameGenPacer::UpdateLimit(Clock::time_point now, f32 base_rate, f32 target_rate, size_t ceiling) { - limit = std::min(limit, ceiling); + limit = (std::min)(limit, ceiling); if (probe_until) { if (now < *probe_until) { @@ -152,9 +152,9 @@ void FrameGenPacer::UpdateLimit(Clock::time_point now, f32 base_rate, f32 target output_credit = 0.0f; const f32 previous_output = - std::min(target_rate, probe_base_rate * static_cast(probe_previous_limit + 1)); + (std::min)(target_rate, probe_base_rate * static_cast(probe_previous_limit + 1)); const f32 current_output = - std::min(target_rate, base_rate * static_cast(limit + 1)); + (std::min)(target_rate, base_rate * static_cast(limit + 1)); const bool throughput_regressed = current_output < previous_output * PROBE_THROUGHPUT_TOLERANCE; @@ -166,7 +166,7 @@ void FrameGenPacer::UpdateLimit(Clock::time_point now, f32 base_rate, f32 target if (throughput_regressed || collapsed_for_marginal_gain || emulation_slowed) { limit = probe_previous_limit; - probe_failures = std::min(probe_failures + 1, MAX_PROBE_FAILURES); + probe_failures = (std::min)(probe_failures + 1, MAX_PROBE_FAILURES); next_probe = now + ProbeBackoff(probe_failures); deficit_since.reset(); return; diff --git a/src/video_core/renderer_vulkan/present/layer.cpp b/src/video_core/renderer_vulkan/present/layer.cpp index 2ce6a5f845..f7152a31eb 100644 --- a/src/video_core/renderer_vulkan/present/layer.cpp +++ b/src/video_core/renderer_vulkan/present/layer.cpp @@ -150,7 +150,7 @@ void Layer::ConfigureDraw(const Device& device, PresentPushConstants* out_push_c #endif auto crop_rect = Tegra::NormalizeCrop(framebuffer, texture_width, texture_height); - generation_source = source_image; + generation_source = source_image_view; generation_extent = source_extent; generation_render_extent = render_extent; generation_crop = crop_rect; diff --git a/src/video_core/renderer_vulkan/present/layer.h b/src/video_core/renderer_vulkan/present/layer.h index 47b23d2596..422eca6d2f 100644 --- a/src/video_core/renderer_vulkan/present/layer.h +++ b/src/video_core/renderer_vulkan/present/layer.h @@ -68,7 +68,7 @@ public: [[nodiscard]] bool IsGenerationFree(size_t generation) const; - [[nodiscard]] VkImage GenerationSource() const { + [[nodiscard]] VkImageView GenerationSource() const { return generation_source; } @@ -125,7 +125,7 @@ private: #endif std::vector resource_ticks{}; std::vector generation_ticks{}; - VkImage generation_source{}; + VkImageView generation_source{}; VkExtent2D generation_extent{}; VkExtent2D generation_render_extent{}; Common::Rectangle generation_crop{}; diff --git a/src/video_core/renderer_vulkan/present/lsfg_chain.cpp b/src/video_core/renderer_vulkan/present/lsfg_chain.cpp index e52b2fa5fc..c9fce12758 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_chain.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_chain.cpp @@ -47,7 +47,7 @@ LsfgChain::LsfgChain(const Device& device, MemoryAllocator& memory_allocator, const size_t level = LSFG_MIP_LEVELS - 1 - i; gamma[i] = LsfgGamma(device, memory_allocator, shaders, resources, descriptor_pool, alpha[level].Outputs(), - beta.Output(std::min(level, LSFG_BETA_OUTPUTS - 1)), + beta.Output((std::min)(level, LSFG_BETA_OUTPUTS - 1)), i == 0 ? nullptr : &gamma[i - 1].Output()); if (i < FIRST_DELTA_LEVEL) { diff --git a/src/video_core/renderer_vulkan/present/lsfg_common.cpp b/src/video_core/renderer_vulkan/present/lsfg_common.cpp index 68ef254633..0e34f782e7 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_common.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_common.cpp @@ -44,7 +44,8 @@ vk::Image CreateChainImage(MemoryAllocator& memory_allocator, VkExtent2D extent, .samples = VK_SAMPLE_COUNT_1_BIT, .tiling = VK_IMAGE_TILING_OPTIMAL, .usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | - VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, + VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, .sharingMode = VK_SHARING_MODE_EXCLUSIVE, .queueFamilyIndexCount = 0, .pQueueFamilyIndices = nullptr, @@ -95,7 +96,7 @@ VkImageMemoryBarrier2 MakeBarrier(const LsfgImage& image, VkAccessFlags2 src_acc LsfgImage::LsfgImage(const Device& device, MemoryAllocator& memory_allocator, VkExtent2D extent_, VkFormat format_) - : extent{std::max(1u, extent_.width), std::max(1u, extent_.height)}, format{format_} { + : extent{(std::max)(1u, extent_.width), (std::max)(1u, extent_.height)}, format{format_} { image = CreateChainImage(memory_allocator, extent, format); view = CreateWrappedImageView(device, image, format); } diff --git a/src/video_core/renderer_vulkan/present/lsfg_mipmaps.cpp b/src/video_core/renderer_vulkan/present/lsfg_mipmaps.cpp index 3f31f58d68..c5cd1c7c86 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_mipmaps.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_mipmaps.cpp @@ -40,8 +40,10 @@ LsfgMipmaps::LsfgMipmaps(const Device& device, MemoryAllocator& memory_allocator const VkExtent2D input_extent = (*frames)[0].Extent(); flow_extent = VkExtent2D{ - .width = std::max(1u, static_cast(static_cast(input_extent.width) * flow_scale)), - .height = std::max(1u, static_cast(static_cast(input_extent.height) * flow_scale)), + .width = (std::max)(1u, + static_cast(static_cast(input_extent.width) * flow_scale)), + .height = (std::max)(1u, + static_cast(static_cast(input_extent.height) * flow_scale)), }; for (size_t i = 0; i < LSFG_MIP_LEVELS; ++i) { diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 759ae3db32..d425844189 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -208,7 +208,7 @@ void RendererVulkan::Composite(std::span framebu void(frame_gen.WantedGenerations(present_manager.MaxExtraFrames())); const FrameGenSource source = blit_swapchain.GenerationSource(); - frame_gen.Process(device, source.image, source.extent); + frame_gen.Process(device, source.view, source.extent); const Layout::FramebufferLayout layout = render_window.GetFramebufferLayout(); const size_t generated_frames = frame_gen.GeneratedFrameCount(); diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp index 19b9a64344..1654717a36 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp +++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp @@ -105,7 +105,7 @@ FrameGenSource BlitScreen::GenerationSource() const { return {}; } return FrameGenSource{ - .image = layers.front().GenerationSource(), + .view = layers.front().GenerationSource(), .extent = layers.front().GenerationExtent(), }; } diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.h b/src/video_core/renderer_vulkan/vk_blit_screen.h index 4f1a7c78d5..c6cac52321 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.h +++ b/src/video_core/renderer_vulkan/vk_blit_screen.h @@ -49,7 +49,7 @@ struct FramebufferTextureInfo { }; struct FrameGenSource { - VkImage image{}; + VkImageView view{}; VkExtent2D extent{}; }; diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index ec26f4dc9a..5a96fd7847 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -175,7 +175,7 @@ Frame* PresentManager::GetRenderFrame() { Frame* PresentManager::TryGetRenderFrame() { std::scoped_lock lock{free_mutex}; - if (free_queue.empty() || free_queue.front()->present_done.GetStatus() != VK_SUCCESS) { + if (free_queue.size() < 2 || free_queue.front()->present_done.GetStatus() != VK_SUCCESS) { return nullptr; } Frame* const frame = free_queue.front(); @@ -316,7 +316,7 @@ void PresentManager::SetImageCount() { const size_t generations = Settings::FrameGenMaxGenerations(); const size_t queued_composites = Settings::values.frame_gen_queue_target.GetValue() + 1; const size_t baseline = swapchain.GetImageCount() + generations; - image_count = std::min(std::max((generations + 1) * queued_composites, baseline), + image_count = std::min((std::max)((generations + 1) * queued_composites, baseline), MAX_FRAMES_IN_FLIGHT); #else image_count = std::min(swapchain.GetImageCount(), MAX_FRAMES_IN_FLIGHT); diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 4d89a53be0..826c900fc3 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -55,7 +55,7 @@ namespace { QString LosslessSearchDirectory() { const QString suffix = QStringLiteral("/steamapps/common/Lossless Scaling"); - const std::array roots{ + const std::array roots{ QDir::homePath() + QStringLiteral("/.local/share/Steam"), QDir::homePath() + QStringLiteral("/.steam/steam"), QDir::homePath() + QStringLiteral("/.var/app/com.valvesoftware.Steam/.local/share/Steam"), From 8e2d26c272681d6cafe6d5e703dafdc8200c7b65 Mon Sep 17 00:00:00 2001 From: xbzk Date: Wed, 30 Sep 2026 22:13:37 +0200 Subject: [PATCH 140/198] [video_core] buffer cache readback for nce invalidations (#4490) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This is a follow up of 4473, a fix for the next Ender Magnolia known crash, the shackled beast's vaper crash, but specific for NCE. Imma try to be short: NCE invalidation was dooming whole guest pages when it shouldn't. If the GPU buffer cache owns some bytes on a page, invalidating first discards their ownership, and the retrying CPU can then observe stale data. On Android, this was corrupting some indirect draw packets and causing huge invalid index count reach staging memory allocation. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4490 Reviewed-by: CamilleLaVey Reviewed-by: lizzie --- src/core/memory.cpp | 2 +- src/video_core/gpu.cpp | 16 +++++++++++++--- src/video_core/gpu.h | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 837016de1d..eabc6dfccb 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -757,7 +757,7 @@ struct Memory::Impl { }; auto& gpu = system.GPU(); gpu_device_memory->ApplyOpOnPointer( - p, scratch_buffers[core], [&](DAddr address) { gpu.InvalidateRegion(address, size); }); + p, scratch_buffers[core], [&](DAddr address) { gpu.InvalidateRegion(address, size, true); }); } Core::System& system; diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 9901cf4262..6aa7f9abd8 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -226,7 +226,17 @@ struct GPU::Impl { } /// Notify rasterizer that any caches of the specified region should be invalidated - void InvalidateRegion(DAddr addr, u64 size) { + void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) { + VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer(); + if (preserve_gpu_writes && rasterizer->MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) { + const u64 fence = RequestSyncOperation([rasterizer, addr, size] { + rasterizer->FlushRegion(addr, size, VideoCommon::CacheType::BufferCache); + rasterizer->OnCacheInvalidation(addr, size); + }); + gpu_thread.TickGPU(is_async); + WaitForSyncOperation(fence); + return; + } gpu_thread.InvalidateRegion(addr, size); } @@ -518,8 +528,8 @@ void GPU::FlushRegion(DAddr addr, u64 size) { impl->FlushRegion(addr, size); } -void GPU::InvalidateRegion(DAddr addr, u64 size) { - impl->InvalidateRegion(addr, size); +void GPU::InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) { + impl->InvalidateRegion(addr, size, preserve_gpu_writes); } bool GPU::OnCPUWrite(DAddr addr, u64 size) { diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 75956ea199..974d214e10 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h @@ -248,7 +248,7 @@ public: void FlushRegion(DAddr addr, u64 size); /// Notify rasterizer that any caches of the specified region should be invalidated - void InvalidateRegion(DAddr addr, u64 size); + void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes = false); /// Notify rasterizer that CPU is trying to write this area. It returns true if the area is /// sensible, false otherwise, addr and size must be a valid combination From 148a7b24cd11db68628173b5bc4c654d56a5d0e9 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 17:27:43 -0400 Subject: [PATCH 141/198] Another intent to fix build --- src/yuzu/configuration/configure_graphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 826c900fc3..15b24c5a1b 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -588,7 +588,7 @@ void ConfigureGraphics::UpdateLosslessButton() { void ConfigureGraphics::InstallLosslessDll() { using VideoCore::FrameGen::LosslessStatus; - const auto status_text = [this](LosslessStatus status) { + const auto status_text = [](LosslessStatus status) { switch (status) { case LosslessStatus::NotPortableExecutable: return tr("The selected file is not a Windows library. Select Lossless.dll from your " From 51584f5a6372de9e5bfa4c9dbba3a1da1ad9c7f9 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 17:54:48 -0400 Subject: [PATCH 142/198] 1st phase of framepacer rework --- .../features/settings/model/IntSetting.kt | 1 - src/common/settings.h | 10 ----- src/common/settings_enums.h | 1 - src/qt_common/config/shared_translation.cpp | 11 ----- .../renderer_vulkan/present/frame_gen.cpp | 5 +++ .../renderer_vulkan/present/frame_gen.h | 2 + .../present/frame_gen_pacer.cpp | 4 +- .../renderer_vulkan/present/frame_gen_pacer.h | 1 + .../renderer_vulkan/renderer_vulkan.cpp | 9 +++- .../renderer_vulkan/vk_present_manager.cpp | 25 ++++++++--- .../renderer_vulkan/vk_present_manager.h | 5 ++- src/video_core/renderer_vulkan/vk_scheduler.h | 43 +++---------------- .../renderer_vulkan/vk_swapchain.cpp | 34 +-------------- 13 files changed, 47 insertions(+), 104 deletions(-) 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 7f1b49a94a..e8087cef5b 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 @@ -32,7 +32,6 @@ enum class IntSetting(override val key: String) : AbstractIntSetting { RENDERER_DYNA_STATE("dyna_state"), DMA_ACCURACY("dma_accuracy"), GPU_FENCE_BEHAVIOR("gpu_fence_behavior"), - FRAME_PACING_MODE("frame_pacing_mode"), AUDIO_OUTPUT_ENGINE("output_engine"), MAX_ANISOTROPY("max_anisotropy"), THEME("theme"), diff --git a/src/common/settings.h b/src/common/settings.h index 4ca2368064..e564a11cb5 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -552,16 +552,6 @@ struct Values { "accelerate_astc", Category::RendererAdvanced}; - SwitchableSetting frame_pacing_mode{linkage, - FramePacingMode::Target_Auto, - FramePacingMode::Target_Auto, - FramePacingMode::Target_120, - "frame_pacing_mode", - Category::RendererAdvanced, - Specialization::Default, - true, - true}; - SwitchableSetting sync_memory_operations{linkage, false, "sync_memory_operations", diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index 73568e257c..60e2b55742 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h @@ -130,7 +130,6 @@ ENUM(TimeZone, Auto, Default, Cet, Cst6Cdt, Cuba, Eet, Egypt, Eire, Est, Est5Edt Roc, Rok, Singapore, Turkey, Uct, Universal, Utc, WSu, Wet, Zulu); ENUM(AnisotropyMode, Automatic, Default, X2, X4, X8, X16); ENUM(AstcDecodeMode, Cpu, Gpu, CpuAsynchronous); -ENUM(FramePacingMode, Target_Auto, Target_30, Target_60, Target_90, Target_120); ENUM(VSyncMode, Immediate, Mailbox, Fifo, FifoRelaxed); ENUM(VramUsageMode, Conservative, Aggressive); ENUM(RendererBackend, OpenGL_GLSL, Vulkan, Null, OpenGL_GLASM, OpenGL_SPIRV); diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 2c459855e8..0bb2e0d52b 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -198,9 +198,6 @@ std::unique_ptr InitializeTranslations(QObject* parent) { "GPU: Use the GPU's compute shaders to decode ASTC textures (recommended).\n" "CPU Asynchronously: Use the CPU to decode ASTC textures on demand. Eliminates" "ASTC decoding\nstuttering but may present artifacts.")); - INSERT(Settings, frame_pacing_mode, tr("Frame Pacing Mode (Vulkan only)"), - tr("Controls how the emulator manages frame pacing to reduce stuttering and make the " - "frame rate smoother and more consistent.")); INSERT(Settings, vram_usage_mode, tr("VRAM Usage Mode:"), tr("Selects whether the emulator should prefer to conserve memory or make maximum usage " "of available video memory for performance.\nAggressive mode may impact performance " @@ -393,14 +390,6 @@ std::unique_ptr ComboboxEnumeration(QObject* parent) { PAIR(AstcDecodeMode, Gpu, tr("GPU")), PAIR(AstcDecodeMode, CpuAsynchronous, tr("CPU Asynchronous")), }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(FramePacingMode, Target_Auto, tr("Auto")), - PAIR(FramePacingMode, Target_30, tr("30 FPS")), - PAIR(FramePacingMode, Target_60, tr("60 FPS")), - PAIR(FramePacingMode, Target_90, tr("90 FPS")), - PAIR(FramePacingMode, Target_120, tr("120 FPS")), - }}); translations->insert({Settings::EnumMetadata::Index(), { PAIR(VramUsageMode, Conservative, tr("Conservative")), diff --git a/src/video_core/renderer_vulkan/present/frame_gen.cpp b/src/video_core/renderer_vulkan/present/frame_gen.cpp index 3ea8941ba9..dc57ad8428 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen.cpp @@ -272,6 +272,11 @@ size_t FrameGen::GeneratedFrameCount() const { return generated ? last_generations : 0; } +std::chrono::nanoseconds FrameGen::PaceStep() const { + const f32 step = plan.interval / static_cast(last_generations + 1); + return std::chrono::duration_cast(std::chrono::duration(step)); +} + const LsfgImage& FrameGen::Generate(const Device& device, size_t generation) { LsfgImage& output = outputs[generation]; chain->SetTarget(device, last_generations, generation, output.View()); diff --git a/src/video_core/renderer_vulkan/present/frame_gen.h b/src/video_core/renderer_vulkan/present/frame_gen.h index 6993ffcb20..6b03db3f25 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.h +++ b/src/video_core/renderer_vulkan/present/frame_gen.h @@ -28,6 +28,8 @@ public: [[nodiscard]] size_t GeneratedFrameCount() const; + [[nodiscard]] std::chrono::nanoseconds PaceStep() const; + [[nodiscard]] const LsfgImage& Generate(const Device& device, size_t generation); private: diff --git a/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp b/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp index 80aca5ebe0..195a81be19 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp @@ -112,7 +112,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { limit = (std::min)(Settings::FrameGenGenerations(), ceiling); output_credit = 0.0f; issued_generations = limit; - return {.generations = limit, .warm = limit > 0}; + return {.generations = limit, .warm = limit > 0, .interval = smoothed_interval}; } UpdateLimit(now, 1.0f / smoothed_interval, target_rate, ceiling); @@ -137,7 +137,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { } issued_generations = generations; - return {.generations = generations, .warm = true}; + return {.generations = generations, .warm = true, .interval = smoothed_interval}; } void FrameGenPacer::UpdateLimit(Clock::time_point now, f32 base_rate, f32 target_rate, diff --git a/src/video_core/renderer_vulkan/present/frame_gen_pacer.h b/src/video_core/renderer_vulkan/present/frame_gen_pacer.h index 7f4b23920c..8c513af71c 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen_pacer.h +++ b/src/video_core/renderer_vulkan/present/frame_gen_pacer.h @@ -13,6 +13,7 @@ namespace Vulkan { struct FrameGenPlan { size_t generations{}; bool warm{}; + f32 interval{}; }; class FrameGenPacer { diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index d425844189..f963ef4aef 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -204,6 +204,8 @@ void RendererVulkan::Composite(std::span framebu present_manager.SwapchainImageCount(), swapchain.GetImageViewFormat()); + u32 pace_index = 0; + std::chrono::nanoseconds pace_step{}; #ifdef HAS_LSFG void(frame_gen.WantedGenerations(present_manager.MaxExtraFrames())); @@ -212,6 +214,7 @@ void RendererVulkan::Composite(std::span framebu const Layout::FramebufferLayout layout = render_window.GetFramebufferLayout(); const size_t generated_frames = frame_gen.GeneratedFrameCount(); + const std::chrono::nanoseconds generated_step = frame_gen.PaceStep(); for (size_t generation = 0; generation < generated_frames; ++generation) { if (!blit_swapchain.IsGenerationFree(generation)) { break; @@ -225,13 +228,15 @@ void RendererVulkan::Composite(std::span framebu blit_swapchain.DrawGenerated(device, generated, layout, generation, output.Handle(), output.View()); scheduler.Flush(*generated->render_ready); - present_manager.Present(generated); + present_manager.Present(generated, static_cast(generation), generated_step); + pace_index = static_cast(generated_frames); + pace_step = generated_step; } #endif scheduler.Flush(*frame->render_ready); - present_manager.Present(frame); + present_manager.Present(frame, pace_index, pace_step); #ifdef HAS_LSFG scheduler.DispatchWork(); #endif diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index 5a96fd7847..52d497e446 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -117,7 +117,8 @@ PresentManager::PresentManager(const vk::Instance& instance_, , swapchain{swapchain_} , surface{surface_} , blit_supported{CanBlitToSwapchain(device.GetPhysical(), swapchain.GetImageViewFormat())} - , use_present_thread{Settings::values.async_presentation.GetValue()} + , use_present_thread{Settings::values.async_presentation.GetValue() || + Settings::values.frame_gen.GetValue()} { SetImageCount(); @@ -184,7 +185,9 @@ Frame* PresentManager::TryGetRenderFrame() { return frame; } -void PresentManager::Present(Frame* frame) { +void PresentManager::Present(Frame* frame, u32 pace_index, std::chrono::nanoseconds pace_step) { + frame->pace_index = pace_index; + frame->pace_step = pace_step; if (use_present_thread) { scheduler.Record([this, frame](vk::CommandBuffer) { std::unique_lock lock{queue_mutex}; @@ -279,21 +282,33 @@ void PresentManager::PresentThread(std::stop_token token) { Common::SetCurrentThreadName("VulkanPresent"); Common::SetCurrentThreadPriority(Common::ThreadPriority::High); Common::SetCurrentThreadToPerformanceCores(); + std::chrono::steady_clock::time_point pace_anchor{}; while (!token.stop_requested()) { std::unique_lock lock{queue_mutex}; // Wait for presentation frames frame_cv.wait(lock, token, [this] { return !present_queue.empty(); }); + if (!present_queue.empty() && present_queue.front()->pace_index != 0) { + const Frame* const held = present_queue.front(); + const auto next_anchor = [this] { + return std::any_of(present_queue.begin() + 1, present_queue.end(), + [](const Frame* next) { return next->pace_index == 0; }); + }; + void(frame_cv.wait_until(lock, token, + pace_anchor + held->pace_step * held->pace_index, + next_anchor)); + } if (!token.stop_requested()) { // Take the frame and notify anyone waiting Frame* frame = present_queue.front(); present_queue.pop_front(); frame_cv.notify_one(); - // By exchanging the lock ownership we take the swapchain lock - // before the queue lock goes out of scope. This way the swapchain - // lock in WaitPresent is guaranteed to occur after here. void(std::exchange(lock, std::unique_lock{swapchain_mutex})); CopyToSwapchain(frame); + if (frame->pace_index == 0 && frame->pace_step.count() != 0) { + frame->present_done.Wait(static_cast(frame->pace_step.count())); + pace_anchor = std::chrono::steady_clock::now(); + } // Free the frame for reuse std::scoped_lock fl{free_mutex}; diff --git a/src/video_core/renderer_vulkan/vk_present_manager.h b/src/video_core/renderer_vulkan/vk_present_manager.h index a59d18f420..7e1a47bb45 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.h +++ b/src/video_core/renderer_vulkan/vk_present_manager.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include #include @@ -35,6 +36,8 @@ struct Frame { vk::CommandBuffer cmdbuf; vk::Semaphore render_ready; vk::Fence present_done; + std::chrono::nanoseconds pace_step{}; + u32 pace_index{}; }; class PresentManager { @@ -54,7 +57,7 @@ public: [[nodiscard]] Frame* TryGetRenderFrame(); /// Pushes a frame for presentation - void Present(Frame* frame); + void Present(Frame* frame, u32 pace_index, std::chrono::nanoseconds pace_step); /// Recreates the present frame to match the provided parameters void RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat image_view_format); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index ef04062b49..a0bdeedccc 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -161,39 +161,12 @@ public: return master_semaphore->IsFree(tick); } - /// Waits for the given GPU tick, optionally pacing frames. - void Wait(u64 tick, double target_fps = 0.0) { - if (tick > 0) { - if (tick >= master_semaphore->CurrentTick()) { - Flush(); - } - master_semaphore->Wait(tick); - } - if (Settings::values.use_speed_limit.GetValue() && target_fps > 0.0) { - auto now = std::chrono::steady_clock::now(); - if (last_target_fps != target_fps) { - frame_interval = std::chrono::duration_cast(std::chrono::duration(1.0 / target_fps)); - max_frame_count = static_cast(0.1 * target_fps); - last_target_fps = target_fps; - frame_counter = 0; - start_time = now; - } - frame_counter++; - auto target_time = start_time + frame_interval * frame_counter; - if (target_time >= now) { - constexpr auto spin_tail = std::chrono::milliseconds(1); - auto sleep_time = target_time - now; - if (sleep_time > spin_tail * 2) { - std::this_thread::sleep_for(sleep_time - spin_tail); - } - while (std::chrono::steady_clock::now() < target_time) { - std::this_thread::yield(); - } - } else if (frame_counter > max_frame_count) { - frame_counter = 0; - start_time = now; - } + /// Waits for the given tick to trigger on the GPU. + void Wait(u64 tick) { + if (tick >= master_semaphore->CurrentTick()) { + Flush(); } + master_semaphore->Wait(tick); } /// Returns the master timeline semaphore. @@ -368,12 +341,6 @@ private: std::mutex queue_mutex; std::condition_variable_any event_cv; std::jthread worker_thread; - - std::chrono::steady_clock::duration frame_interval{}; - std::chrono::steady_clock::time_point start_time{}; - double last_target_fps{}; - u64 max_frame_count{}; - u64 frame_counter{}; }; } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index fea5398557..328bb28897 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp @@ -9,10 +9,6 @@ #include #include -#ifdef __ANDROID__ -#include -#endif - #include "common/logging.h" #include "common/settings.h" #include "common/settings_enums.h" @@ -179,35 +175,7 @@ bool Swapchain::AcquireNextImage() { break; } - const auto wait_with_frame_pacing = [this] { - switch (Settings::values.frame_pacing_mode.GetValue()) { - case Settings::FramePacingMode::Target_Auto: - scheduler.Wait(resource_ticks[image_index]); - break; - case Settings::FramePacingMode::Target_30: - scheduler.Wait(resource_ticks[image_index], 30.0); - break; - case Settings::FramePacingMode::Target_60: - scheduler.Wait(resource_ticks[image_index], 60.0); - break; - case Settings::FramePacingMode::Target_90: - scheduler.Wait(resource_ticks[image_index], 90.0); - break; - case Settings::FramePacingMode::Target_120: - scheduler.Wait(resource_ticks[image_index], 120.0); - break; - } - }; - -#ifdef __ANDROID__ - if (android_get_device_api_level() >= 30) { - scheduler.Wait(resource_ticks[image_index]); - } else { - wait_with_frame_pacing(); - } -#else - wait_with_frame_pacing(); -#endif + scheduler.Wait(resource_ticks[image_index]); resource_ticks[image_index] = scheduler.CurrentTick(); From 2a7e9b53b12711f679238ee738a2ce57cc42c8ed Mon Sep 17 00:00:00 2001 From: xbzk Date: Thu, 1 Oct 2026 00:28:18 +0200 Subject: [PATCH 143/198] [android,ui] fixed shader cache clearing when changing drivers (#4496) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Trivial bug pending on backlog, where changing drivers was not clearing up sharder cache as expected. The driver flow (broken) was deleting externalFilesDir/shader/, while the visible cache-size control (working) DirectoryInitialization.userDirectory/cache/shader/. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4496 Reviewed-by: CamilleLaVey Reviewed-by: lizzie --- .../main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt index 41f03c2488..fe53a99e3e 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt @@ -23,6 +23,7 @@ import org.yuzu.yuzu_emu.model.Driver.Companion.toDriver import org.yuzu.yuzu_emu.utils.GpuDriverHelper import org.yuzu.yuzu_emu.NativeLibrary import org.yuzu.yuzu_emu.utils.GpuDriverMetadata +import org.yuzu.yuzu_emu.utils.DirectoryInitialization import org.yuzu.yuzu_emu.utils.NativeConfig import java.io.File @@ -146,11 +147,11 @@ class DriverViewModel : ViewModel() { private fun wipeGameShaders(game: Game) { viewModelScope.launch { withContext(Dispatchers.IO) { - val externalFilesDir = YuzuApplication.appContext.getExternalFilesDir(null) + val userDirectory = DirectoryInitialization.userDirectory ?: return@withContext val shaderDir = File( - externalFilesDir.absolutePath + - "/shader/" + game.settingsName.lowercase() + userDirectory + + "/cache/shader/" + game.settingsName.lowercase() ) if (shaderDir.exists()) { shaderDir.deleteRecursively() From e4f74863d2ef5789ac6e8bbb449ba32ce717c9be Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 20:58:40 -0400 Subject: [PATCH 144/198] Overlap barriers on window adapt filter + lsfg dedup --- .../renderer_vulkan/present/frame_gen.cpp | 15 +- .../renderer_vulkan/present/frame_gen.h | 3 +- .../renderer_vulkan/present/fsr.cpp | 35 ++--- src/video_core/renderer_vulkan/present/fsr.h | 9 +- .../renderer_vulkan/present/fxaa.cpp | 28 ++-- src/video_core/renderer_vulkan/present/fxaa.h | 9 +- .../renderer_vulkan/present/lsfg_chain.cpp | 42 +++++- .../renderer_vulkan/present/lsfg_delta.cpp | 138 ++++++++---------- .../renderer_vulkan/present/lsfg_delta.h | 4 +- .../renderer_vulkan/present/lsfg_gamma.cpp | 78 +++++----- .../renderer_vulkan/present/lsfg_gamma.h | 4 +- .../renderer_vulkan/present/sgsr.cpp | 24 ++- src/video_core/renderer_vulkan/present/sgsr.h | 9 +- .../renderer_vulkan/present/smaa.cpp | 74 +++++----- src/video_core/renderer_vulkan/present/smaa.h | 9 +- 15 files changed, 233 insertions(+), 248 deletions(-) diff --git a/src/video_core/renderer_vulkan/present/frame_gen.cpp b/src/video_core/renderer_vulkan/present/frame_gen.cpp index dc57ad8428..186562a6e7 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include +#include #include #include @@ -223,14 +224,15 @@ void FrameGen::Process(const Device& device, VkImageView source, VkExtent2D exte } const f32 flow_scale = ConfiguredFlowScale(); + const size_t generations = Settings::FrameGenMaxGenerations(); if (!chain || built_extent.width != extent.width || built_extent.height != extent.height || - built_flow_scale != flow_scale) { - Rebuild(device, extent, flow_scale); + built_flow_scale != flow_scale || built_generations != generations) { + Rebuild(device, extent, flow_scale, generations); } const u64 count = frame_count++; last_count = count; - last_generations = plan.generations; + last_generations = (std::min)(plan.generations, built_generations); const size_t input_slot = count % INPUT_SLOTS; const bool warm = plan.warm && count + 1 >= LSFG_REQUIRED_FRAMES && @@ -304,7 +306,8 @@ void FrameGen::CreateInputPass(const Device& device) { input_sampler = CreateNearestNeighborSampler(device); } -void FrameGen::Rebuild(const Device& device, VkExtent2D extent, f32 flow_scale) { +void FrameGen::Rebuild(const Device& device, VkExtent2D extent, f32 flow_scale, + size_t generations) { scheduler.Finish(); chain.reset(); @@ -312,10 +315,12 @@ void FrameGen::Rebuild(const Device& device, VkExtent2D extent, f32 flow_scale) chain.emplace(device, memory_allocator, *shaders, extent, LSFG_DEFAULT_FORMAT, built_flow_scale); - for (LsfgImage& output : outputs) { + outputs = {}; + for (LsfgImage& output : std::span{outputs}.first(generations)) { output = LsfgImage(device, memory_allocator, extent, LSFG_DEFAULT_FORMAT); } built_extent = extent; + built_generations = generations; frame_count = 0; warm_streak = 0; generated = false; diff --git a/src/video_core/renderer_vulkan/present/frame_gen.h b/src/video_core/renderer_vulkan/present/frame_gen.h index 6b03db3f25..51cc142277 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.h +++ b/src/video_core/renderer_vulkan/present/frame_gen.h @@ -36,7 +36,7 @@ private: static constexpr size_t INPUT_SLOTS = 4; void CreateInputPass(const Device& device); - void Rebuild(const Device& device, VkExtent2D extent, f32 flow_scale); + void Rebuild(const Device& device, VkExtent2D extent, f32 flow_scale, size_t generations); void DumpDebugImages(u64 count); MemoryAllocator& memory_allocator; @@ -58,6 +58,7 @@ private: FrameGenPlan plan{}; VkExtent2D built_extent{}; f32 built_flow_scale{}; + size_t built_generations{}; u64 frame_count{}; u64 last_count{}; size_t last_generations{}; diff --git a/src/video_core/renderer_vulkan/present/fsr.cpp b/src/video_core/renderer_vulkan/present/fsr.cpp index a5833710b6..bb3138e7e6 100644 --- a/src/video_core/renderer_vulkan/present/fsr.cpp +++ b/src/video_core/renderer_vulkan/present/fsr.cpp @@ -41,12 +41,9 @@ FSR::FSR(const Device& device, MemoryAllocator& memory_allocator, size_t image_c } void FSR::CreateImages(const Device& device) { - m_dynamic_images.resize(m_image_count); - for (auto& images : m_dynamic_images) { - images.images[Easu] = CreateWrappedImage(m_memory_allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); - images.images[Rcas] = CreateWrappedImage(m_memory_allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); - images.image_views[Easu] = CreateWrappedImageView(device, images.images[Easu], VK_FORMAT_R16G16B16A16_SFLOAT); - images.image_views[Rcas] = CreateWrappedImageView(device, images.images[Rcas], VK_FORMAT_R16G16B16A16_SFLOAT); + for (size_t stage = 0; stage < MaxFsrStage; ++stage) { + m_images[stage] = CreateWrappedImage(m_memory_allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); + m_image_views[stage] = CreateWrappedImageView(device, m_images[stage], VK_FORMAT_R16G16B16A16_SFLOAT); } } @@ -79,8 +76,8 @@ void FSR::CreateDescriptorSetLayout(const Device& device) { void FSR::CreateDescriptorSets(const Device& device) { std::vector layouts(MaxFsrStage, *m_descriptor_set_layout); - for (auto& images : m_dynamic_images) - images.descriptor_sets = CreateWrappedDescriptorSets(m_descriptor_pool, layouts); + for (size_t i = 0; i < m_image_count; ++i) + m_descriptor_sets.push_back(CreateWrappedDescriptorSets(m_descriptor_pool, layouts)); } void FSR::CreatePipelineLayouts(const Device& device) { @@ -112,12 +109,12 @@ void FSR::CreatePipelines(const Device& device) { } void FSR::UpdateDescriptorSets(const Device& device, VkImageView image_view, size_t image_index) { - Images& images = m_dynamic_images[image_index]; + const vk::DescriptorSets& descriptor_sets = m_descriptor_sets[image_index]; std::vector image_infos; image_infos.reserve(2); std::vector updates{ - CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, images.descriptor_sets[Easu], 0), - CreateWriteDescriptorSet(image_infos, *m_sampler, *images.image_views[Easu], images.descriptor_sets[Rcas], 0) + CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, descriptor_sets[Easu], 0), + CreateWriteDescriptorSet(image_infos, *m_sampler, *m_image_views[Easu], descriptor_sets[Rcas], 0) }; device.GetLogical().UpdateDescriptorSets(updates, {}); } @@ -125,14 +122,14 @@ void FSR::UpdateDescriptorSets(const Device& device, VkImageView image_view, siz VkImageView FSR::Draw(const Device& device, Scheduler& scheduler, size_t image_index, VkImage source_image, VkImageView source_image_view, VkExtent2D input_image_extent, const Common::Rectangle& crop_rect) { - Images& images = m_dynamic_images[image_index]; + const vk::DescriptorSets& descriptor_sets = m_descriptor_sets[image_index]; - VkImage easu_image = *images.images[Easu]; - VkImage rcas_image = *images.images[Rcas]; - VkDescriptorSet easu_descriptor_set = images.descriptor_sets[Easu]; - VkDescriptorSet rcas_descriptor_set = images.descriptor_sets[Rcas]; - VkImageView easu_view = *images.image_views[Easu]; - VkImageView rcas_view = *images.image_views[Rcas]; + VkImage easu_image = *m_images[Easu]; + VkImage rcas_image = *m_images[Rcas]; + VkDescriptorSet easu_descriptor_set = descriptor_sets[Easu]; + VkDescriptorSet rcas_descriptor_set = descriptor_sets[Rcas]; + VkImageView easu_view = *m_image_views[Easu]; + VkImageView rcas_view = *m_image_views[Rcas]; VkPipeline easu_pipeline = *m_easu_pipeline; VkPipeline rcas_pipeline = *m_rcas_pipeline; VkPipelineLayout pipeline_layout = *m_pipeline_layout; @@ -187,7 +184,7 @@ VkImageView FSR::Draw(const Device& device, Scheduler& scheduler, size_t image_i TransitionImageLayout(cmdbuf, rcas_image, VK_IMAGE_LAYOUT_GENERAL); }); - return *images.image_views[Rcas]; + return rcas_view; } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/fsr.h b/src/video_core/renderer_vulkan/present/fsr.h index 1cdab4a81e..373a985339 100644 --- a/src/video_core/renderer_vulkan/present/fsr.h +++ b/src/video_core/renderer_vulkan/present/fsr.h @@ -54,12 +54,9 @@ private: vk::Pipeline m_rcas_pipeline; vk::Sampler m_sampler; - struct Images { - vk::DescriptorSets descriptor_sets; - std::array images; - std::array image_views; - }; - std::vector m_dynamic_images; + std::array m_images; + std::array m_image_views; + std::vector m_descriptor_sets; }; } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/fxaa.cpp b/src/video_core/renderer_vulkan/present/fxaa.cpp index 8e7b964a5e..6eb07b004f 100644 --- a/src/video_core/renderer_vulkan/present/fxaa.cpp +++ b/src/video_core/renderer_vulkan/present/fxaa.cpp @@ -33,11 +33,8 @@ FXAA::FXAA(const Device& device, MemoryAllocator& allocator, size_t image_count, FXAA::~FXAA() = default; void FXAA::CreateImages(const Device& device, MemoryAllocator& allocator) { - for (u32 i = 0; i < m_image_count; i++) { - Image& image = m_dynamic_images.emplace_back(); - image.image = CreateWrappedImage(allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); - image.image_view = CreateWrappedImageView(device, image.image, VK_FORMAT_R16G16B16A16_SFLOAT); - } + m_image = CreateWrappedImage(allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); + m_image_view = CreateWrappedImageView(device, m_image, VK_FORMAT_R16G16B16A16_SFLOAT); } void FXAA::CreateSampler(const Device& device) { @@ -63,8 +60,8 @@ void FXAA::CreateDescriptorSetLayouts(const Device& device) { void FXAA::CreateDescriptorSets(const Device& device) { VkDescriptorSetLayout layout = *m_descriptor_set_layout; - for (auto& images : m_dynamic_images) { - images.descriptor_sets = CreateWrappedDescriptorSets(m_descriptor_pool, {layout}); + for (u32 i = 0; i < m_image_count; i++) { + m_descriptor_sets.push_back(CreateWrappedDescriptorSets(m_descriptor_pool, {layout})); } } @@ -78,23 +75,22 @@ void FXAA::CreatePipelines(const Device& device) { } void FXAA::UpdateDescriptorSets(const Device& device, VkImageView image_view, size_t image_index) { - Image& image = m_dynamic_images[image_index]; + const VkDescriptorSet descriptor_set = m_descriptor_sets[image_index][0]; std::vector image_infos; std::vector updates; image_infos.reserve(2); - updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, image.descriptor_sets[0], 0)); - updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, image.descriptor_sets[0], 1)); + updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, descriptor_set, 0)); + updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, descriptor_set, 1)); device.GetLogical().UpdateDescriptorSets(updates, {}); } void FXAA::Draw(const Device& device, Scheduler& scheduler, size_t image_index, VkImage* inout_image, VkImageView* inout_image_view) { - const Image& image{m_dynamic_images[image_index]}; const VkImage input_image{*inout_image}; - const VkImage output_image{*image.image}; - const VkImageView output_view{*image.image_view}; - const VkDescriptorSet descriptor_set{image.descriptor_sets[0]}; + const VkImage output_image{*m_image}; + const VkImageView output_view{*m_image_view}; + const VkDescriptorSet descriptor_set{m_descriptor_sets[image_index][0]}; const VkPipeline pipeline{*m_pipeline}; const VkPipelineLayout layout{*m_pipeline_layout}; const VkExtent2D extent{m_extent}; @@ -114,8 +110,8 @@ void FXAA::Draw(const Device& device, Scheduler& scheduler, size_t image_index, TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL); }); - *inout_image = *image.image; - *inout_image_view = *image.image_view; + *inout_image = output_image; + *inout_image_view = output_view; } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/fxaa.h b/src/video_core/renderer_vulkan/present/fxaa.h index 8acd0bce36..7f5599db16 100644 --- a/src/video_core/renderer_vulkan/present/fxaa.h +++ b/src/video_core/renderer_vulkan/present/fxaa.h @@ -34,12 +34,9 @@ private: void CreatePipelines(const Device& device); void UpdateDescriptorSets(const Device& device, VkImageView image_view, size_t image_index); - struct Image { - vk::DescriptorSets descriptor_sets{}; - vk::Image image{}; - vk::ImageView image_view{}; - }; - std::vector m_dynamic_images{}; + vk::Image m_image{}; + vk::ImageView m_image_view{}; + std::vector m_descriptor_sets{}; const VkExtent2D m_extent; const u32 m_image_count; vk::ShaderModule m_vertex_shader{}; diff --git a/src/video_core/renderer_vulkan/present/lsfg_chain.cpp b/src/video_core/renderer_vulkan/present/lsfg_chain.cpp index c9fce12758..a7ecfc5d71 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_chain.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_chain.cpp @@ -18,6 +18,34 @@ constexpr u32 FIXED_DESCRIPTOR_SETS = 64; constexpr u32 DESCRIPTOR_SETS_PER_SLOT = 100; constexpr size_t FIRST_DELTA_LEVEL = 4; +[[nodiscard]] constexpr size_t DeltaStartWave(size_t index) { + if (index == 0) { + return 0; + } + return (FIRST_DELTA_LEVEL + index) * LSFG_GAMMA_STAGES; +} + +constexpr size_t GENERATION_WAVES = + DeltaStartWave(LSFG_DELTA_INSTANCES - 1) + LSFG_DELTA_STAGES; + +template +void ForEachWaveStage(std::array& gamma, + std::array& delta, size_t wave, + Func&& func) { + for (size_t i = 0; i < gamma.size(); ++i) { + const size_t start = i * LSFG_GAMMA_STAGES; + if (wave >= start && wave - start < LSFG_GAMMA_STAGES) { + func(gamma[i], wave - start); + } + } + for (size_t i = 0; i < delta.size(); ++i) { + const size_t start = DeltaStartWave(i); + if (wave >= start && wave - start < LSFG_DELTA_STAGES) { + func(delta[i], wave - start); + } + } +} + } // Anonymous namespace LsfgChain::LsfgChain(const Device& device, MemoryAllocator& memory_allocator, @@ -91,11 +119,15 @@ void LsfgChain::DispatchGeneration(vk::CommandBuffer cmdbuf, u64 frame_count, size_t generation_count, size_t generation, VkImage image, VkExtent2D extent) { const size_t slot = LsfgGenerationSlot(generation_count, generation); - for (size_t i = 0; i < LSFG_MIP_LEVELS; ++i) { - gamma[i].Dispatch(cmdbuf, frame_count, slot); - if (i >= FIRST_DELTA_LEVEL) { - delta[i - FIRST_DELTA_LEVEL].Dispatch(cmdbuf, frame_count, slot); - } + for (size_t wave = 0; wave < GENERATION_WAVES; ++wave) { + LsfgBarriers barriers(cmdbuf); + ForEachWaveStage(gamma, delta, wave, [&barriers, frame_count](auto& pass, size_t stage) { + pass.PushBarriers(barriers, frame_count, stage); + }); + barriers.Build(); + ForEachWaveStage(gamma, delta, wave, [cmdbuf, frame_count, slot](auto& pass, size_t stage) { + pass.DispatchStage(cmdbuf, frame_count, slot, stage); + }); } generate.Dispatch(cmdbuf, frame_count, slot, image, extent); } diff --git a/src/video_core/renderer_vulkan/present/lsfg_delta.cpp b/src/video_core/renderer_vulkan/present/lsfg_delta.cpp index dc6eec383f..9ced1f5a47 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_delta.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_delta.cpp @@ -196,88 +196,68 @@ LsfgDelta::LsfgDelta(const Device& device, MemoryAllocator& memory_allocator, } } -void LsfgDelta::Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot) { +void LsfgDelta::PushBarriers(LsfgBarriers& barriers, u64 frame_count, size_t stage) { + auto& history = (*inputs)[frame_count % LSFG_HISTORY_SLOTS]; + auto& previous_history = (*inputs)[(frame_count + 2) % LSFG_HISTORY_SLOTS]; + switch (stage) { + case 0: + barriers.WriteToReadAll(previous_history) + .WriteToReadAll(history) + .WriteToRead(previous_gamma) + .ReadToWriteAll(temp1); + break; + case 1: + case 3: + barriers.WriteToReadAll(temp1).ReadToWriteAll(temp2); + break; + case 2: + barriers.WriteToReadAll(temp2).ReadToWriteAll(temp1); + break; + case 4: + barriers.WriteToReadAll(temp2) + .WriteToRead(previous_gamma) + .WriteToRead(*flow_input) + .ReadToWrite(out_image1); + break; + case 5: + barriers.WriteToReadAll(previous_history) + .WriteToReadAll(history) + .WriteToRead(previous_gamma) + .WriteToRead(previous1) + .ReadToWriteAll(temp2); + break; + case 6: + case 8: + barriers.WriteToReadAll(temp2).ReadToWrite(temp1[0]).ReadToWrite(temp1[1]); + break; + case 7: + barriers.WriteToRead(temp1[0]).WriteToRead(temp1[1]).ReadToWriteAll(temp2); + break; + default: + barriers.WriteToRead(temp1[0]) + .WriteToRead(temp1[1]) + .WriteToRead(previous2) + .ReadToWrite(out_image2); + break; + } +} + +void LsfgDelta::DispatchStage(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot, + size_t stage) const { const Generation& pass = generations[slot]; + const size_t history = frame_count % LSFG_HISTORY_SLOTS; + VkDescriptorSet set = pass.first_descriptor_sets[history]; + if (stage == 5) { + set = pass.sixth_descriptor_sets[history]; + } else if (stage > 5) { + set = pass.descriptor_sets[stage - 2]; + } else if (stage != 0) { + set = pass.descriptor_sets[stage - 1]; + } + passes[stage].Bind(cmdbuf, set); const VkExtent2D extent = temp1[0].Extent(); - const u32 groups_x = GroupCount(extent.width); - const u32 groups_y = GroupCount(extent.height); - - const size_t history = frame_count % LSFG_HISTORY_SLOTS; - const size_t previous_history = (frame_count + 2) % LSFG_HISTORY_SLOTS; - - LsfgBarriers(cmdbuf) - .WriteToReadAll((*inputs)[previous_history]) - .WriteToReadAll((*inputs)[history]) - .WriteToRead(previous_gamma) - .ReadToWriteAll(temp1) - .Build(); - passes[0].Bind(cmdbuf, pass.first_descriptor_sets[history]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf).WriteToReadAll(temp1).ReadToWriteAll(temp2).Build(); - passes[1].Bind(cmdbuf, pass.descriptor_sets[0]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf).WriteToReadAll(temp2).ReadToWriteAll(temp1).Build(); - passes[2].Bind(cmdbuf, pass.descriptor_sets[1]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf).WriteToReadAll(temp1).ReadToWriteAll(temp2).Build(); - passes[3].Bind(cmdbuf, pass.descriptor_sets[2]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf) - .WriteToReadAll(temp2) - .WriteToRead(previous_gamma) - .WriteToRead(*flow_input) - .ReadToWrite(out_image1) - .Build(); - passes[4].Bind(cmdbuf, pass.descriptor_sets[3]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf) - .WriteToReadAll((*inputs)[previous_history]) - .WriteToReadAll((*inputs)[history]) - .WriteToRead(previous_gamma) - .WriteToRead(previous1) - .ReadToWriteAll(temp2) - .Build(); - passes[5].Bind(cmdbuf, pass.sixth_descriptor_sets[history]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf) - .WriteToReadAll(temp2) - .ReadToWrite(temp1[0]) - .ReadToWrite(temp1[1]) - .Build(); - passes[6].Bind(cmdbuf, pass.descriptor_sets[4]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf) - .WriteToRead(temp1[0]) - .WriteToRead(temp1[1]) - .ReadToWriteAll(temp2) - .Build(); - passes[7].Bind(cmdbuf, pass.descriptor_sets[5]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf) - .WriteToReadAll(temp2) - .ReadToWrite(temp1[0]) - .ReadToWrite(temp1[1]) - .Build(); - passes[8].Bind(cmdbuf, pass.descriptor_sets[6]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf) - .WriteToRead(temp1[0]) - .WriteToRead(temp1[1]) - .WriteToRead(previous2) - .ReadToWrite(out_image2) - .Build(); - passes[9].Bind(cmdbuf, pass.descriptor_sets[7]); - cmdbuf.Dispatch(groups_x, groups_y, 1); + cmdbuf.Dispatch(GroupCount(extent.width), GroupCount(extent.height), 1); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/lsfg_delta.h b/src/video_core/renderer_vulkan/present/lsfg_delta.h index 1bbcfe6745..a3beda0b77 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_delta.h +++ b/src/video_core/renderer_vulkan/present/lsfg_delta.h @@ -27,7 +27,9 @@ public: LsfgImageHistory& inputs, LsfgImage& flow_input, LsfgImage* previous_gamma, LsfgImage* previous1, LsfgImage* previous2); - void Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot); + void PushBarriers(LsfgBarriers& barriers, u64 frame_count, size_t stage); + + void DispatchStage(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot, size_t stage) const; [[nodiscard]] LsfgImage& Output1() { return out_image1; diff --git a/src/video_core/renderer_vulkan/present/lsfg_gamma.cpp b/src/video_core/renderer_vulkan/present/lsfg_gamma.cpp index 067d124b6f..fff0b57d0e 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_gamma.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_gamma.cpp @@ -133,53 +133,43 @@ LsfgGamma::LsfgGamma(const Device& device, MemoryAllocator& memory_allocator, } } -void LsfgGamma::Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot) { +void LsfgGamma::PushBarriers(LsfgBarriers& barriers, u64 frame_count, size_t stage) { + switch (stage) { + case 0: + barriers.WriteToReadAll((*inputs)[(frame_count + 2) % LSFG_HISTORY_SLOTS]) + .WriteToReadAll((*inputs)[frame_count % LSFG_HISTORY_SLOTS]) + .WriteToRead(previous) + .ReadToWriteAll(temp1); + break; + case 1: + barriers.WriteToReadAll(temp1).ReadToWriteAll(temp2); + break; + case 2: + barriers.WriteToReadAll(temp2).ReadToWrite(temp1[0]).ReadToWrite(temp1[1]); + break; + case 3: + barriers.WriteToRead(temp1[0]).WriteToRead(temp1[1]).ReadToWriteAll(temp2); + break; + default: + barriers.WriteToReadAll(temp2) + .WriteToRead(previous) + .WriteToRead(*flow_input) + .ReadToWrite(out_image); + break; + } +} + +void LsfgGamma::DispatchStage(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot, + size_t stage) const { const Generation& pass = generations[slot]; + VkDescriptorSet set = pass.first_descriptor_sets[frame_count % LSFG_HISTORY_SLOTS]; + if (stage != 0) { + set = pass.descriptor_sets[stage - 1]; + } + passes[stage].Bind(cmdbuf, set); const VkExtent2D extent = temp1[0].Extent(); - const u32 groups_x = GroupCount(extent.width); - const u32 groups_y = GroupCount(extent.height); - - const size_t history = frame_count % LSFG_HISTORY_SLOTS; - const size_t previous_history = (frame_count + 2) % LSFG_HISTORY_SLOTS; - - LsfgBarriers(cmdbuf) - .WriteToReadAll((*inputs)[previous_history]) - .WriteToReadAll((*inputs)[history]) - .WriteToRead(previous) - .ReadToWriteAll(temp1) - .Build(); - passes[0].Bind(cmdbuf, pass.first_descriptor_sets[history]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf).WriteToReadAll(temp1).ReadToWriteAll(temp2).Build(); - passes[1].Bind(cmdbuf, pass.descriptor_sets[0]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf) - .WriteToReadAll(temp2) - .ReadToWrite(temp1[0]) - .ReadToWrite(temp1[1]) - .Build(); - passes[2].Bind(cmdbuf, pass.descriptor_sets[1]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf) - .WriteToRead(temp1[0]) - .WriteToRead(temp1[1]) - .ReadToWriteAll(temp2) - .Build(); - passes[3].Bind(cmdbuf, pass.descriptor_sets[2]); - cmdbuf.Dispatch(groups_x, groups_y, 1); - - LsfgBarriers(cmdbuf) - .WriteToReadAll(temp2) - .WriteToRead(previous) - .WriteToRead(*flow_input) - .ReadToWrite(out_image) - .Build(); - passes[4].Bind(cmdbuf, pass.descriptor_sets[3]); - cmdbuf.Dispatch(groups_x, groups_y, 1); + cmdbuf.Dispatch(GroupCount(extent.width), GroupCount(extent.height), 1); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/lsfg_gamma.h b/src/video_core/renderer_vulkan/present/lsfg_gamma.h index 848c380bfe..cda230d449 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_gamma.h +++ b/src/video_core/renderer_vulkan/present/lsfg_gamma.h @@ -26,7 +26,9 @@ public: LsfgResources& resources, vk::DescriptorPool& descriptor_pool, LsfgImageHistory& inputs, LsfgImage& flow_input, LsfgImage* previous); - void Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot); + void PushBarriers(LsfgBarriers& barriers, u64 frame_count, size_t stage); + + void DispatchStage(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot, size_t stage) const; [[nodiscard]] LsfgImage& Output() { return out_image; diff --git a/src/video_core/renderer_vulkan/present/sgsr.cpp b/src/video_core/renderer_vulkan/present/sgsr.cpp index 7a7446ce33..1787b43e80 100644 --- a/src/video_core/renderer_vulkan/present/sgsr.cpp +++ b/src/video_core/renderer_vulkan/present/sgsr.cpp @@ -27,12 +27,8 @@ SGSR::SGSR(const Device& device, MemoryAllocator& memory_allocator, size_t image , m_extent{extent} , m_edge_dir{edge_dir} { - // Not finished yet initializing at ctor time? - m_dynamic_images.resize(m_image_count); - for (auto& images : m_dynamic_images) { - images.image = CreateWrappedImage(m_memory_allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); - images.image_view = CreateWrappedImageView(device, images.image, VK_FORMAT_R16G16B16A16_SFLOAT); - } + m_image = CreateWrappedImage(m_memory_allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); + m_image_view = CreateWrappedImageView(device, m_image, VK_FORMAT_R16G16B16A16_SFLOAT); m_sampler = CreateBilinearSampler(device); m_vert_shader = BuildShader(device, SGSR1_SHADER_VERT_SPV); @@ -44,8 +40,8 @@ SGSR::SGSR(const Device& device, MemoryAllocator& memory_allocator, size_t image m_descriptor_set_layout = CreateWrappedDescriptorSetLayout(device, {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER}); VkDescriptorSetLayout layout = *m_descriptor_set_layout; - for (auto& images : m_dynamic_images) - images.descriptor_sets = CreateWrappedDescriptorSets(m_descriptor_pool, layout); + for (size_t i = 0; i < m_image_count; ++i) + m_descriptor_sets.push_back(CreateWrappedDescriptorSets(m_descriptor_pool, layout)); const VkPushConstantRange range{ .stageFlags = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, @@ -68,19 +64,17 @@ SGSR::SGSR(const Device& device, MemoryAllocator& memory_allocator, size_t image } void SGSR::UpdateDescriptorSets(const Device& device, VkImageView image_view, size_t image_index) { - Images& images = m_dynamic_images[image_index]; std::vector image_infos; std::vector updates; image_infos.reserve(1); - updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, images.descriptor_sets[0], 0)); + updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, m_descriptor_sets[image_index][0], 0)); device.GetLogical().UpdateDescriptorSets(updates, {}); } VkImageView SGSR::Draw(const Device& device, Scheduler& scheduler, size_t image_index, VkImage source_image, VkImageView source_image_view, VkExtent2D input_image_extent, const Common::Rectangle& crop_rect) { - Images& images = m_dynamic_images[image_index]; - auto const output_image = *images.image; - auto const output_view = *images.image_view; - auto const descriptor_set = images.descriptor_sets[0]; + auto const output_image = *m_image; + auto const output_view = *m_image_view; + auto const descriptor_set = m_descriptor_sets[image_index][0]; auto const pipeline = *m_stage_pipeline; VkPipelineLayout layout = *m_pipeline_layout; @@ -126,7 +120,7 @@ VkImageView SGSR::Draw(const Device& device, Scheduler& scheduler, size_t image_ cmdbuf.EndRendering(); TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL); }); - return *images.image_view; + return output_view; } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/sgsr.h b/src/video_core/renderer_vulkan/present/sgsr.h index d626bbe1ba..52a645b09f 100644 --- a/src/video_core/renderer_vulkan/present/sgsr.h +++ b/src/video_core/renderer_vulkan/present/sgsr.h @@ -33,12 +33,9 @@ private: vk::Pipeline m_stage_pipeline; vk::Sampler m_sampler; - struct Images { - vk::DescriptorSets descriptor_sets; - vk::Image image; - vk::ImageView image_view; - }; - std::vector m_dynamic_images; + vk::Image m_image; + vk::ImageView m_image_view; + std::vector m_descriptor_sets; bool m_edge_dir{}; }; diff --git a/src/video_core/renderer_vulkan/present/smaa.cpp b/src/video_core/renderer_vulkan/present/smaa.cpp index 0527adf73b..e4258d4b5c 100644 --- a/src/video_core/renderer_vulkan/present/smaa.cpp +++ b/src/video_core/renderer_vulkan/present/smaa.cpp @@ -55,22 +55,18 @@ void SMAA::CreateImages(const Device& device) { m_static_image_views[Search] = CreateWrappedImageView(device, m_static_images[Search], VK_FORMAT_R8_UNORM); - for (u32 i = 0; i < m_image_count; i++) { - Images& images = m_dynamic_images.emplace_back(); + m_dynamic_images[Blend] = + CreateWrappedImage(m_allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); + m_dynamic_images[Edges] = CreateWrappedImage(m_allocator, m_extent, VK_FORMAT_R16G16_SFLOAT); + m_dynamic_images[Output] = + CreateWrappedImage(m_allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); - images.images[Blend] = - CreateWrappedImage(m_allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); - images.images[Edges] = CreateWrappedImage(m_allocator, m_extent, VK_FORMAT_R16G16_SFLOAT); - images.images[Output] = - CreateWrappedImage(m_allocator, m_extent, VK_FORMAT_R16G16B16A16_SFLOAT); - - images.image_views[Blend] = - CreateWrappedImageView(device, images.images[Blend], VK_FORMAT_R16G16B16A16_SFLOAT); - images.image_views[Edges] = - CreateWrappedImageView(device, images.images[Edges], VK_FORMAT_R16G16_SFLOAT); - images.image_views[Output] = - CreateWrappedImageView(device, images.images[Output], VK_FORMAT_R16G16B16A16_SFLOAT); - } + m_dynamic_image_views[Blend] = + CreateWrappedImageView(device, m_dynamic_images[Blend], VK_FORMAT_R16G16B16A16_SFLOAT); + m_dynamic_image_views[Edges] = + CreateWrappedImageView(device, m_dynamic_images[Edges], VK_FORMAT_R16G16_SFLOAT); + m_dynamic_image_views[Output] = + CreateWrappedImageView(device, m_dynamic_images[Output], VK_FORMAT_R16G16B16A16_SFLOAT); } void SMAA::CreateSampler(const Device& device) { @@ -122,8 +118,8 @@ void SMAA::CreateDescriptorSets(const Device& device) { std::ranges::transform(m_descriptor_set_layouts, layouts.begin(), [](auto& layout) { return *layout; }); - for (auto& images : m_dynamic_images) { - images.descriptor_sets = CreateWrappedDescriptorSets(m_descriptor_pool, layouts); + for (u32 i = 0; i < m_image_count; i++) { + m_descriptor_sets.push_back(CreateWrappedDescriptorSets(m_descriptor_pool, layouts)); } } @@ -147,28 +143,30 @@ void SMAA::CreatePipelines(const Device& device) { } void SMAA::UpdateDescriptorSets(const Device& device, VkImageView image_view, size_t image_index) { - Images& images = m_dynamic_images[image_index]; + const vk::DescriptorSets& descriptor_sets = m_descriptor_sets[image_index]; std::vector image_infos; std::vector updates; image_infos.reserve(6); updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, - images.descriptor_sets[EdgeDetection], 0)); + descriptor_sets[EdgeDetection], 0)); - updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, *images.image_views[Edges], - images.descriptor_sets[BlendingWeightCalculation], + updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, + *m_dynamic_image_views[Edges], + descriptor_sets[BlendingWeightCalculation], 0)); updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, *m_static_image_views[Area], - images.descriptor_sets[BlendingWeightCalculation], + descriptor_sets[BlendingWeightCalculation], 1)); updates.push_back( CreateWriteDescriptorSet(image_infos, *m_sampler, *m_static_image_views[Search], - images.descriptor_sets[BlendingWeightCalculation], 2)); + descriptor_sets[BlendingWeightCalculation], 2)); updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, image_view, - images.descriptor_sets[NeighborhoodBlending], 0)); - updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, *images.image_views[Blend], - images.descriptor_sets[NeighborhoodBlending], 1)); + descriptor_sets[NeighborhoodBlending], 0)); + updates.push_back(CreateWriteDescriptorSet(image_infos, *m_sampler, + *m_dynamic_image_views[Blend], + descriptor_sets[NeighborhoodBlending], 1)); device.GetLogical().UpdateDescriptorSets(updates, {}); } @@ -190,22 +188,22 @@ void SMAA::UploadImages(const Device& device, Scheduler& scheduler) { } void SMAA::Draw(const Device& device, Scheduler& scheduler, size_t image_index, VkImage* inout_image, VkImageView* inout_image_view) { - Images& images = m_dynamic_images[image_index]; + const vk::DescriptorSets& descriptor_sets = m_descriptor_sets[image_index]; VkImage input_image = *inout_image; - VkImage output_image = *images.images[Output]; - VkImage edges_image = *images.images[Edges]; - VkImage blend_image = *images.images[Blend]; + VkImage output_image = *m_dynamic_images[Output]; + VkImage edges_image = *m_dynamic_images[Edges]; + VkImage blend_image = *m_dynamic_images[Blend]; - VkDescriptorSet edge_detection_descriptor_set = images.descriptor_sets[EdgeDetection]; + VkDescriptorSet edge_detection_descriptor_set = descriptor_sets[EdgeDetection]; VkDescriptorSet blending_weight_calculation_descriptor_set = - images.descriptor_sets[BlendingWeightCalculation]; + descriptor_sets[BlendingWeightCalculation]; VkDescriptorSet neighborhood_blending_descriptor_set = - images.descriptor_sets[NeighborhoodBlending]; + descriptor_sets[NeighborhoodBlending]; - VkImageView edges_view = *images.image_views[Edges]; - VkImageView blend_view = *images.image_views[Blend]; - VkImageView output_view = *images.image_views[Output]; + VkImageView edges_view = *m_dynamic_image_views[Edges]; + VkImageView blend_view = *m_dynamic_image_views[Blend]; + VkImageView output_view = *m_dynamic_image_views[Output]; UploadImages(device, scheduler); UpdateDescriptorSets(device, *inout_image_view, image_index); @@ -248,8 +246,8 @@ void SMAA::Draw(const Device& device, Scheduler& scheduler, size_t image_index, TransitionImageLayout(cmdbuf, output_image, VK_IMAGE_LAYOUT_GENERAL); }); - *inout_image = *images.images[Output]; - *inout_image_view = *images.image_views[Output]; + *inout_image = *m_dynamic_images[Output]; + *inout_image_view = *m_dynamic_image_views[Output]; } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/present/smaa.h b/src/video_core/renderer_vulkan/present/smaa.h index 54a820b7a9..f9c87c9c6a 100644 --- a/src/video_core/renderer_vulkan/present/smaa.h +++ b/src/video_core/renderer_vulkan/present/smaa.h @@ -71,12 +71,9 @@ private: std::array m_static_images{}; std::array m_static_image_views{}; - struct Images { - vk::DescriptorSets descriptor_sets{}; - std::array images{}; - std::array image_views{}; - }; - std::vector m_dynamic_images{}; + std::array m_dynamic_images{}; + std::array m_dynamic_image_views{}; + std::vector m_descriptor_sets{}; bool m_images_ready{}; vk::Sampler m_sampler{}; From 963119e7cc3851007252c9981e4fae3e88b7687f Mon Sep 17 00:00:00 2001 From: John Date: Thu, 1 Oct 2026 03:34:57 +0200 Subject: [PATCH 145/198] [ffmpeg]Gamescope / Gamemode NVDEC Emulation - GPU Decoding Patches (#4501) Switch to ffmpeg with liz's gamescope patches. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4501 Reviewed-by: CamilleLaVey Reviewed-by: lizzie --- cpmfile.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpmfile.json b/cpmfile.json index 616235f27a..9cac812b7a 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -79,7 +79,7 @@ "name": "ffmpeg", "package": "FFmpeg", "repo": "crueter-ci/FFmpeg", - "version": "9.0.1-1788120736-bf1b838f2a" + "version": "9.0.2-1790726865-946fcce07b" }, "fmt": { "hash": "f0da82c545b01692e9fd30fdfb613dbb8dd9716983dcd0ff19ac2a8d36f74beb5540ef38072fdecc1e34191b3682a8542ecbf3a61ef287dbba0a2679d4e023f2", From 451b8eb80c4e02b22a1df7ff8550678077597a2d Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 30 Sep 2026 23:09:44 -0400 Subject: [PATCH 146/198] Some adjustments to EDS --- .../renderer_vulkan/vk_buffer_cache.cpp | 20 ++- .../renderer_vulkan/vk_graphics_pipeline.cpp | 5 + .../renderer_vulkan/vk_graphics_pipeline.h | 4 + .../renderer_vulkan/vk_rasterizer.cpp | 130 ++++++++---------- .../renderer_vulkan/vk_rasterizer.h | 15 +- .../vulkan_common/vulkan_device.cpp | 3 + src/video_core/vulkan_common/vulkan_device.h | 2 +- 7 files changed, 98 insertions(+), 81 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 488fd639aa..77e33d1354 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -649,11 +649,17 @@ void BufferCacheRuntime::BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset return; } if (device.IsExtExtendedDynamicStateSupported()) { - scheduler.Record([index, buffer, offset, size, stride](vk::CommandBuffer cmdbuf) { + const bool dynamic_stride = !device.IsExtVertexInputDynamicStateSupported(); + scheduler.Record([index, buffer, offset, size, stride, + dynamic_stride](vk::CommandBuffer cmdbuf) { const VkDeviceSize vk_offset = buffer != VK_NULL_HANDLE ? offset : 0; const VkDeviceSize vk_size = buffer != VK_NULL_HANDLE ? size : VK_WHOLE_SIZE; const VkDeviceSize vk_stride = stride; - cmdbuf.BindVertexBuffers2EXT(index, 1, &buffer, &vk_offset, &vk_size, &vk_stride); + const VkDeviceSize* strides = nullptr; + if (dynamic_stride) { + strides = &vk_stride; + } + cmdbuf.BindVertexBuffers2EXT(index, 1, &buffer, &vk_offset, &vk_size, strides); }); } else { if (!device.HasNullDescriptor() && buffer == VK_NULL_HANDLE) { @@ -688,10 +694,14 @@ void BufferCacheRuntime::RecordVertexBuffers(const VideoCommon::HostBindings& infos); bool HasDynamicVertexInput() const noexcept { return key.state.dynamic_vertex_input; } + u32 VertexAttributeMask() const noexcept { + return vertex_attribute_mask; + } bool SupportsAlphaToCoverage() const noexcept { return fragment_has_color0_output; } @@ -168,6 +171,7 @@ private: size_t num_image_elements{}; u32 num_textures{}; bool fragment_has_color0_output{}; + u32 vertex_attribute_mask{}; vk::DescriptorSetLayout descriptor_set_layout; DescriptorAllocator descriptor_allocator; diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 18d715f058..30ae972dfc 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -264,7 +264,7 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, bool skip_empty, Func&& draw if (!pipeline->Configure(is_indexed)) return; - UpdateDynamicStates(pipeline->HasDynamicVertexInput()); + UpdateDynamicStates(*pipeline); query_cache.NotifySegment(true); HandleTransformFeedback(); @@ -383,13 +383,6 @@ void RasterizerVulkan::DrawTexture() { texture_cache.SynchronizeDescriptors(false); texture_cache.UpdateRenderTargets(false); - bool dynamic_vertex_input = false; - if (device.IsExtVertexInputDynamicStateSupported()) { - GraphicsPipeline* const gp = pipeline_cache.CurrentGraphicsPipeline(); - dynamic_vertex_input = gp && gp->HasDynamicVertexInput(); - } - UpdateDynamicStates(dynamic_vertex_input); - const auto& draw_texture_state = maxwell3d->draw_manager.draw_texture_state; const auto& sampler = texture_cache.GetSampler(draw_texture_state.src_sampler, false); const auto& texture = texture_cache.GetImageView(draw_texture_state.src_texture); @@ -1078,7 +1071,7 @@ bool AccelerateDMA::BufferToImage(const Tegra::DMA::ImageCopy& copy_info, return DmaBufferImageCopy(copy_info, buffer_operand, image_operand); } -void RasterizerVulkan::UpdateDynamicStates(bool dynamic_vertex_input) { +void RasterizerVulkan::UpdateDynamicStates(const GraphicsPipeline& pipeline) { auto& regs = maxwell3d->regs; auto& flags = maxwell3d->dirty.flags; const auto topology = maxwell3d->draw_manager.draw_state.topology; @@ -1126,27 +1119,13 @@ void RasterizerVulkan::UpdateDynamicStates(bool dynamic_vertex_input) { } if (device.IsExtExtendedDynamicState3EnablesSupported()) { - using namespace Tegra::Engines; - // AMD Workaround: LogicOp incompatible with float render targets - if (device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_OPEN_SOURCE || - device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_PROPRIETARY) { - const auto has_float = std::any_of( - regs.vertex_attrib_format.begin(), regs.vertex_attrib_format.end(), - [](const auto& attrib) { - return attrib.type == Maxwell3D::Regs::VertexAttribute::Type::Float; - } - ); - if (regs.logic_op.enable) { - regs.logic_op.enable = static_cast(!has_float); - } - } UpdateLogicOpEnable(regs); UpdateDepthClampEnable(regs); UpdateLineRasterizationMode(regs); UpdateLineStippleEnable(regs); UpdateConservativeRasterizationMode(regs); - UpdateAlphaToCoverageEnable(regs); - UpdateAlphaToOneEnable(regs); + UpdateAlphaToCoverageEnable(regs, pipeline); + UpdateAlphaToOneEnable(regs, pipeline); } if (device.IsExtExtendedDynamicState3BlendingSupported()) { @@ -1155,8 +1134,8 @@ void RasterizerVulkan::UpdateDynamicStates(bool dynamic_vertex_input) { UpdateColorWriteEnable(regs); } - if (dynamic_vertex_input) { - UpdateVertexInput(regs); + if (pipeline.HasDynamicVertexInput()) { + UpdateVertexInput(regs, pipeline.VertexAttributeMask()); } } @@ -1690,36 +1669,33 @@ void RasterizerVulkan::UpdateDepthClampEnable(Tegra::Engines::Maxwell3D::Regs& r [is_enabled](vk::CommandBuffer cmdbuf) { cmdbuf.SetDepthClampEnableEXT(is_enabled); }); } -void RasterizerVulkan::UpdateAlphaToCoverageEnable(Tegra::Engines::Maxwell3D::Regs& regs) { - if (!state_tracker.TouchAlphaToCoverageEnable()) { - return; - } +void RasterizerVulkan::UpdateAlphaToCoverageEnable(Tegra::Engines::Maxwell3D::Regs& regs, + const GraphicsPipeline& pipeline) { if (!device.SupportsDynamicState3AlphaToCoverageEnable()) { return; } - GraphicsPipeline* const pipeline = pipeline_cache.CurrentGraphicsPipeline(); - const bool enable = pipeline != nullptr && pipeline->SupportsAlphaToCoverage() && - regs.anti_alias_alpha_control.alpha_to_coverage != 0; + const bool enable = + pipeline.SupportsAlphaToCoverage() && regs.anti_alias_alpha_control.alpha_to_coverage != 0; + if (!state_tracker.TouchAlphaToCoverageEnable() && enable == alpha_to_coverage_enabled) { + return; + } + alpha_to_coverage_enabled = enable; scheduler.Record([enable](vk::CommandBuffer cmdbuf) { cmdbuf.SetAlphaToCoverageEnableEXT(enable ? VK_TRUE : VK_FALSE); }); } -void RasterizerVulkan::UpdateAlphaToOneEnable(Tegra::Engines::Maxwell3D::Regs& regs) { - if (!state_tracker.TouchAlphaToOneEnable()) { - return; - } +void RasterizerVulkan::UpdateAlphaToOneEnable(Tegra::Engines::Maxwell3D::Regs& regs, + const GraphicsPipeline& pipeline) { if (!device.SupportsDynamicState3AlphaToOneEnable()) { - static std::once_flag warn_alpha_to_one; - std::call_once(warn_alpha_to_one, [] { - LOG_WARNING(Render_Vulkan, - "Alpha-to-one is not supported on this device; forcing it disabled"); - }); return; } - GraphicsPipeline* const pipeline = pipeline_cache.CurrentGraphicsPipeline(); - const bool enable = pipeline != nullptr && pipeline->SupportsAlphaToOne() && - regs.anti_alias_alpha_control.alpha_to_one != 0; + const bool enable = + pipeline.SupportsAlphaToOne() && regs.anti_alias_alpha_control.alpha_to_one != 0; + if (!state_tracker.TouchAlphaToOneEnable() && enable == alpha_to_one_enabled) { + return; + } + alpha_to_one_enabled = enable; scheduler.Record([enable](vk::CommandBuffer cmdbuf) { cmdbuf.SetAlphaToOneEnableEXT(enable ? VK_TRUE : VK_FALSE); }); @@ -1793,7 +1769,17 @@ void RasterizerVulkan::UpdateLogicOp(Tegra::Engines::Maxwell3D::Regs& regs) { } void RasterizerVulkan::UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs) { - if (!state_tracker.TouchBlending()) { + u8 integer_targets = 0; + for (size_t index = 0; index < Maxwell::NumRenderTargets; index++) { + const auto format = regs.rt[index].format; + if (format != Tegra::RenderTargetFormat::NONE && + IsPixelFormatInteger(VideoCore::Surface::PixelFormatFromRenderTargetFormat(format))) { + integer_targets |= static_cast(1u << index); + } + } + const bool targets_changed = + std::exchange(blend_integer_targets, integer_targets) != integer_targets; + if (!state_tracker.TouchBlending() && !targets_changed) { return; } @@ -1820,17 +1806,12 @@ void RasterizerVulkan::UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs) { }); } - if (state_tracker.TouchBlendEnable()) { + if (state_tracker.TouchBlendEnable() || targets_changed) { std::array setup_enables{}; for (size_t index = 0; index < Maxwell::NumRenderTargets; index++) { - bool is_integer = false; - if (regs.rt[index].format != Tegra::RenderTargetFormat::NONE) { - const auto format = - VideoCore::Surface::PixelFormatFromRenderTargetFormat(regs.rt[index].format); - is_integer = IsPixelFormatInteger(format); - } + const bool is_integer = ((integer_targets >> index) & 1) != 0; setup_enables[index] = - (!is_integer && regs.blend.enable[index] != 0) ? VK_TRUE : VK_FALSE; + static_cast(!is_integer && regs.blend.enable[index] != 0); } scheduler.Record([setup_enables](vk::CommandBuffer cmdbuf) { cmdbuf.SetColorBlendEnableEXT(0, setup_enables); @@ -1903,18 +1884,9 @@ void RasterizerVulkan::UpdateStencilTestEnable(Tegra::Engines::Maxwell3D::Regs& }); } -void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs) { +void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs, + u32 attribute_mask) { auto& dirty{maxwell3d->dirty.flags}; - const bool vertex_input_dirty = dirty[Dirty::VertexInput]; - const bool vertex_buffers_dirty = dirty[VideoCommon::Dirty::VertexBuffers]; - if (!vertex_input_dirty && !vertex_buffers_dirty) { - return; - } - dirty[Dirty::VertexInput] = false; - - boost::container::static_vector bindings; - boost::container::static_vector attributes; - const u32 max_attributes = static_cast(std::min(Maxwell::NumVertexAttributes, device.GetMaxVertexInputAttributes())); @@ -1922,11 +1894,25 @@ void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs) static_cast(std::min(Maxwell::NumVertexArrays, device.GetMaxVertexInputBindings())); + bool changed = dirty[Dirty::VertexInput] || vertex_input_attributes != attribute_mask; + dirty[Dirty::VertexInput] = false; + vertex_input_attributes = attribute_mask; + for (u32 binding = 0; binding < max_bindings; ++binding) { + const u32 stride = regs.vertex_streams[binding].stride; + changed |= vertex_input_strides[binding] != stride; + vertex_input_strides[binding] = stride; + } + if (!changed) { + return; + } + + boost::container::static_vector bindings; + boost::container::static_vector attributes; for (u32 index = 0; index < max_attributes; ++index) { const Maxwell::VertexAttribute attribute{regs.vertex_attrib_format[index]}; const u32 binding{attribute.buffer}; - if (attribute.constant || binding >= max_bindings) { + if (((attribute_mask >> index) & 1) == 0 || attribute.constant || binding >= max_bindings) { continue; } attributes.push_back({ @@ -1941,17 +1927,19 @@ void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs) for (u32 binding = 0; binding < max_bindings; ++binding) { const auto& input_binding{regs.vertex_streams[binding]}; - const bool is_instanced{regs.vertex_stream_instances.IsInstancingEnabled(binding)}; + VkVertexInputRate input_rate = VK_VERTEX_INPUT_RATE_VERTEX; u32 divisor = 1; - if (is_instanced) { + if (regs.vertex_stream_instances.IsInstancingEnabled(binding) && + input_binding.frequency != 0) { + input_rate = VK_VERTEX_INPUT_RATE_INSTANCE; divisor = (std::min)(input_binding.frequency, device.GetMaxVertexAttribDivisor()); } bindings.push_back({ .sType = VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT, .pNext = nullptr, .binding = binding, - .stride = input_binding.stride, - .inputRate = is_instanced ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX, + .stride = vertex_input_strides[binding], + .inputRate = input_rate, .divisor = divisor, }); } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index e1f14cdbf3..b05d12e2f1 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -158,7 +158,7 @@ private: void FlushWork(); - void UpdateDynamicStates(bool dynamic_vertex_input); + void UpdateDynamicStates(const GraphicsPipeline& pipeline); void HandleTransformFeedback(); @@ -183,8 +183,10 @@ private: void UpdateDepthBiasEnable(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateLogicOpEnable(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateDepthClampEnable(Tegra::Engines::Maxwell3D::Regs& regs); - void UpdateAlphaToCoverageEnable(Tegra::Engines::Maxwell3D::Regs& regs); - void UpdateAlphaToOneEnable(Tegra::Engines::Maxwell3D::Regs& regs); + void UpdateAlphaToCoverageEnable(Tegra::Engines::Maxwell3D::Regs& regs, + const GraphicsPipeline& pipeline); + void UpdateAlphaToOneEnable(Tegra::Engines::Maxwell3D::Regs& regs, + const GraphicsPipeline& pipeline); void UpdateFrontFace(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateStencilOp(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateStencilTestEnable(Tegra::Engines::Maxwell3D::Regs& regs); @@ -192,7 +194,7 @@ private: void UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs); void UpdateColorWriteEnable(Tegra::Engines::Maxwell3D::Regs& regs); - void UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs); + void UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs, u32 attribute_mask); Tegra::GPU& gpu; Tegra::MaxwellDeviceMemoryManager& device_memory; @@ -226,6 +228,11 @@ private: u32 draw_counter = 0; Tegra::DepthFormat depth_bias_zeta_format{}; + std::array vertex_input_strides{}; + u32 vertex_input_attributes{}; + u8 blend_integer_targets{}; + bool alpha_to_coverage_enabled{}; + bool alpha_to_one_enabled{}; }; } // namespace Vulkan diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 58218a91fb..b3969fd77d 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1127,6 +1127,9 @@ bool Device::GetSuitability(bool requires_swapchain) { properties.properties = properties2.properties; max_vertex_attrib_divisor = (std::max)(1U, properties.vertex_attribute_divisor.maxVertexAttribDivisor); + if (!features.vertex_attribute_divisor.vertexAttributeInstanceRateDivisor) { + max_vertex_attrib_divisor = 1; + } // Unload extensions if feature support is insufficient. RemoveUnsuitableExtensions(); diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 88504926c8..fa230fa0f4 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -76,6 +76,7 @@ VK_DEFINE_HANDLE(VmaAllocator) FEATURE(EXT, Robustness2, ROBUSTNESS_2, robustness2) \ FEATURE(EXT, TexelBufferAlignment, TEXEL_BUFFER_ALIGNMENT, texel_buffer_alignment) \ FEATURE(EXT, TransformFeedback, TRANSFORM_FEEDBACK, transform_feedback) \ + FEATURE(EXT, VertexAttributeDivisor, VERTEX_ATTRIBUTE_DIVISOR, vertex_attribute_divisor) \ FEATURE(EXT, VertexInputDynamicState, VERTEX_INPUT_DYNAMIC_STATE, vertex_input_dynamic_state) \ FEATURE(KHR, Maintenance5, MAINTENANCE_5, maintenance5) \ FEATURE(KHR, PipelineExecutableProperties, PIPELINE_EXECUTABLE_PROPERTIES, \ @@ -96,7 +97,6 @@ VK_DEFINE_HANDLE(VmaAllocator) EXTENSION(EXT, SHADER_STENCIL_EXPORT, shader_stencil_export) \ EXTENSION(EXT, SHADER_VIEWPORT_INDEX_LAYER, shader_viewport_index_layer) \ EXTENSION(EXT, TOOLING_INFO, tooling_info) \ - EXTENSION(EXT, VERTEX_ATTRIBUTE_DIVISOR, vertex_attribute_divisor) \ EXTENSION(KHR, COPY_COMMANDS_2, copy_commands2) \ EXTENSION(KHR, CREATE_RENDERPASS_2, create_renderpass2) \ EXTENSION(KHR, DEPTH_STENCIL_RESOLVE, depth_stencil_resolve) \ From 0a88e761eb8a3c04f548f5724b80c0777be34868 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 00:19:46 -0400 Subject: [PATCH 147/198] Port UMA part 1 --- src/video_core/buffer_cache/buffer_cache.h | 14 +++++++++ .../renderer_vulkan/vk_buffer_cache.cpp | 31 +++++++++++++++++-- .../renderer_vulkan/vk_buffer_cache.h | 19 ++++++++++++ .../vulkan_common/vulkan_device.cpp | 9 ++++++ src/video_core/vulkan_common/vulkan_device.h | 5 +++ 5 files changed, 75 insertions(+), 3 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 087d7ac1f8..734ec5e0f3 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1876,6 +1876,20 @@ void BufferCache

::MappedUploadMemory([[maybe_unused]] Buffer& buffer, [[maybe_unused]] u64 total_size_bytes, [[maybe_unused]] std::span copies) { if constexpr (USE_MEMORY_MAPS) { + if constexpr (requires { runtime.DirectUploadSpan(buffer, copies); }) { + const std::span direct = runtime.DirectUploadSpan(buffer, copies); + if (!direct.empty()) { + for (const BufferCopy& copy : copies) { + const DAddr device_addr = buffer.CpuAddr() + copy.dst_offset; + if (Settings::values.enable_gpu_buffer_readback.GetValue()) { + DownloadBufferMemory(buffer, device_addr, copy.size); + } + device_memory.ReadBlockUnsafe(device_addr, direct.data() + copy.dst_offset, + copy.size); + } + return; + } + } auto upload_staging = runtime.UploadStagingBuffer(total_size_bytes); const std::span staging_pointer = upload_staging.mapped_span; for (BufferCopy& copy : copies) { diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 77e33d1354..f35ee502ce 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -97,10 +97,14 @@ vk::Buffer CreateBuffer(const Device& device, const MemoryAllocator& memory_allo .queueFamilyIndexCount = 0, .pQueueFamilyIndices = nullptr, }; - if (sparse_alignment > 1) { - return memory_allocator.CreateBuffer(buffer_ci, MemoryUsage::DeviceLocal, sparse_alignment); + MemoryUsage usage = MemoryUsage::DeviceLocal; + if (device.IsUMA()) { + usage = MemoryUsage::Stream; } - return memory_allocator.CreateBuffer(buffer_ci, MemoryUsage::DeviceLocal); + if (sparse_alignment > 1) { + return memory_allocator.CreateBuffer(buffer_ci, usage, sparse_alignment); + } + return memory_allocator.CreateBuffer(buffer_ci, usage); } } // Anonymous namespace @@ -138,6 +142,17 @@ void Buffer::MarkUsage(u64 offset, u64 size) noexcept { last_usage_tick = scheduler->CurrentTick(); } +void Buffer::MarkUpload() noexcept { + last_upload_tick = scheduler->CurrentTick(); +} + +std::span Buffer::CoherentMapping() noexcept { + if (!buffer.IsHostCoherent()) { + return {}; + } + return buffer.Mapped(); +} + VkBufferView Buffer::View(u32 offset, u32 size, VideoCore::Surface::PixelFormat format) { if (!device) { // Null buffer supported, return a null descriptor @@ -496,6 +511,16 @@ bool BufferCacheRuntime::CanReorderUpload(const Buffer& buffer, return can_use_upload_cmdbuf; } +std::span BufferCacheRuntime::DirectUploadSpan( + Buffer& buffer, std::span copies) { + const std::span mapping = buffer.CoherentMapping(); + if (mapping.empty() || !scheduler.IsFree(buffer.LastUploadTick()) || + !CanReorderUpload(buffer, copies)) { + return {}; + } + return mapping; +} + void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, std::span copies, bool barrier, bool can_reorder_upload) { diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index 2f40cc2ac1..d96bd3783a 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -69,6 +69,14 @@ public: return last_usage_tick; } + void MarkUpload() noexcept; + + [[nodiscard]] u64 LastUploadTick() const noexcept { + return last_upload_tick; + } + + [[nodiscard]] std::span CoherentMapping() noexcept; + operator VkBuffer() const noexcept { return *buffer; } @@ -88,6 +96,7 @@ private: VideoCommon::UsageTracker tracker; VkDeviceAddress device_address{}; u64 last_usage_tick{}; + u64 last_upload_tick{}; bool is_null{}; bool sparse_compatible{}; }; @@ -140,6 +149,9 @@ public: bool CanReorderUpload(const Buffer& buffer, std::span copies); + [[nodiscard]] std::span DirectUploadSpan(Buffer& buffer, + std::span copies); + void FreeDeferredStagingBuffer(StagingBufferRef& ref); void PreCopyBarrier(); @@ -148,6 +160,13 @@ public: std::span copies, bool barrier, bool can_reorder_upload = false); + void CopyBuffer(Buffer& dst_buffer, VkBuffer src_buffer, + std::span copies, bool barrier, + bool can_reorder_upload = false) { + dst_buffer.MarkUpload(); + CopyBuffer(dst_buffer.Handle(), src_buffer, copies, barrier, can_reorder_upload); + } + void PostCopyBarrier(); void ClearBuffer(VkBuffer dest_buffer, u32 offset, size_t size, u32 value); diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index b3969fd77d..e9075a62b5 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -487,6 +487,15 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR properties.subgroup_size_control.maxSubgroupSize > GuestWarpSize; is_integrated = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; + const VkPhysicalDeviceMemoryProperties memory_properties = + physical.GetMemoryProperties().memoryProperties; + is_uma = std::all_of(memory_properties.memoryTypes, + memory_properties.memoryTypes + memory_properties.memoryTypeCount, + [](const VkMemoryType& type) { + return (type.propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) == + 0 || + (type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0; + }); supports_d24_depth = IsFormatSupported(VK_FORMAT_D24_UNORM_S8_UINT, diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index fa230fa0f4..b562c210e5 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -984,6 +984,10 @@ FN_MAX_LIMIT_LIST return must_emulate_scaled_formats; } + bool IsUMA() const { + return is_uma; + } + bool HasNullDescriptor() const { return features.robustness2.nullDescriptor; } @@ -1198,6 +1202,7 @@ private: bool is_blit_depth32_stencil8_supported{}; ///< Support for blitting from and to D32S8. bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. bool is_integrated{}; ///< Is GPU an iGPU. + bool is_uma{}; bool has_broken_compute{}; ///< Compute shaders can cause crashes bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit bool has_broken_float16_math{}; From 9cc9a1fc3550e4ed56f22e77be8931da9f2b9858 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 01:09:01 -0400 Subject: [PATCH 148/198] Port UMA part 2 --- .../renderer_vulkan/vk_texture_cache.cpp | 76 +++++++++++++++++-- .../renderer_vulkan/vk_texture_cache.h | 9 +++ src/video_core/texture_cache/texture_cache.h | 12 +++ .../vulkan_common/vulkan_device.cpp | 22 +++--- src/video_core/vulkan_common/vulkan_device.h | 5 ++ .../vulkan_common/vulkan_wrapper.cpp | 2 + src/video_core/vulkan_common/vulkan_wrapper.h | 10 +++ 7 files changed, 120 insertions(+), 16 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index e73d6c1598..332dec09c0 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -283,11 +283,13 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { [[nodiscard]] vk::Image MakeImage(const Device& device, const MemoryAllocator& allocator, const ImageInfo& info, std::span view_formats, - std::optional format_override = {}) { + std::optional format_override = {}, + VkImageUsageFlags host_usage = 0) { if (info.type == ImageType::Buffer) { return vk::Image{}; } VkImageCreateInfo image_ci = MakeImageCreateInfo(device, info, format_override); + image_ci.usage |= host_usage; const VkImageFormatListCreateInfo image_format_list = { .sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO, .pNext = nullptr, @@ -1042,6 +1044,17 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched pitch_unswizzle_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue); } + for (size_t index = 0; index < VideoCore::Surface::MaxPixelFormat; index++) { + const auto format = static_cast(index); + if (!device.IsHostImageCopySupported() || DefaultBlockWidth(format) == 1) { + continue; + } + const VkFormat vk_format = + MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format).format; + host_copy_formats[index] = + (device.GetPhysical().GetFormatProperties3(vk_format).optimalTilingFeatures & + VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT) != 0; + } if (!device.IsKhrImageFormatListSupported()) { return; } @@ -1968,10 +1981,7 @@ void TextureCacheRuntime::TickFrame() { Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu_addr_, VAddr cpu_addr_) : VideoCommon::ImageBase(info_, gpu_addr_, cpu_addr_), scheduler{&runtime_.scheduler}, - runtime{&runtime_}, - original_image(MakeImage(runtime_.device, runtime_.memory_allocator, info, - runtime->ViewFormats(info.format))), - aspect_mask(ImageAspectMask(info.format)) { + runtime{&runtime_}, aspect_mask(ImageAspectMask(info.format)) { if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { switch (Settings::values.accelerate_astc.GetValue()) { case Settings::AstcDecodeMode::Gpu: @@ -1997,6 +2007,13 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu WillUseAcceleratedUnswizzle(runtime->device, info)) { flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; } + VkImageUsageFlags host_usage{}; + if (False(flags & VideoCommon::ImageFlagBits::Converted) && + runtime->host_copy_formats[static_cast(info.format)]) { + host_usage = VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT; + } + original_image = MakeImage(runtime->device, runtime->memory_allocator, info, + runtime->ViewFormats(info.format), {}, host_usage); if (runtime->device.HasDebuggingToolAttached()) { original_image.SetObjectNameEXT(VideoCommon::Name(*this).c_str()); } @@ -2130,6 +2147,33 @@ void Image::UploadMemory(const StagingBufferRef& map, std::span memory, + std::span copies) { + const auto vk_copies = TransformBufferImageCopies(copies, 0, aspect_mask); + boost::container::small_vector regions; + for (const VkBufferImageCopy2& copy : vk_copies) { + regions.push_back(VkMemoryToImageCopyEXT{ + .sType = VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXT, + .pNext = nullptr, + .pHostPointer = memory.data() + copy.bufferOffset, + .memoryRowLength = copy.bufferRowLength, + .memoryImageHeight = copy.bufferImageHeight, + .imageSubresource = copy.imageSubresource, + .imageOffset = copy.imageOffset, + .imageExtent = copy.imageExtent, + }); + } + runtime->device.GetLogical().CopyMemoryToImageEXT(VkCopyMemoryToImageInfoEXT{ + .sType = VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXT, + .pNext = nullptr, + .flags = 0, + .dstImage = *original_image, + .dstImageLayout = VK_IMAGE_LAYOUT_GENERAL, + .regionCount = static_cast(regions.size()), + .pRegions = regions.data(), + }); +} + void Image::DownloadMemory(VkBuffer buffer, size_t offset, std::span copies) { std::array buffer_handles{ @@ -3177,9 +3221,27 @@ void TextureCacheRuntime::AccelerateImageUpload( } void TextureCacheRuntime::TransitionImageLayout(Image& image) { - if (!image.ExchangeInitialization()) { - RecordInitialLayout(scheduler, image.Handle(), image.AspectMask()); + if (image.ExchangeInitialization()) { + return; } + if (!image.CanUploadHostMemory()) { + RecordInitialLayout(scheduler, image.Handle(), image.AspectMask()); + return; + } + device.GetLogical().TransitionImageLayoutEXT(VkHostImageLayoutTransitionInfoEXT{ + .sType = VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO_EXT, + .pNext = nullptr, + .image = image.Handle(), + .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, + .newLayout = VK_IMAGE_LAYOUT_GENERAL, + .subresourceRange{ + .aspectMask = image.AspectMask(), + .baseMipLevel = 0, + .levelCount = VK_REMAINING_MIP_LEVELS, + .baseArrayLayer = 0, + .layerCount = VK_REMAINING_ARRAY_LAYERS, + }, + }); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index ea8ecc4df6..ee0295d66a 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -6,6 +6,7 @@ #pragma once +#include #include #include "video_core/texture_cache/texture_cache_base.h" @@ -154,6 +155,7 @@ public: std::optional pitch_unswizzle_pass; const Settings::ResolutionScalingInfo& resolution; std::array, VideoCore::Surface::MaxPixelFormat> view_formats; + std::bitset host_copy_formats; static constexpr size_t indexing_slots = 8 * sizeof(size_t); std::array buffers{}; @@ -294,6 +296,13 @@ public: void UploadMemory(const StagingBufferRef& map, std::span copies); + void UploadHostMemory(std::span memory, + std::span copies); + + [[nodiscard]] bool CanUploadHostMemory() const noexcept { + return (original_image.UsageFlags() & VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT) != 0; + } + void DownloadMemory(VkBuffer buffer, size_t offset, std::span copies); diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 5c5ec5ace9..c199b5953c 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1033,6 +1033,18 @@ void TextureCache

::RefreshContents(Image& image, ImageId image_id) { QueueAsyncDecode(image, image_id); return; } + if constexpr (requires { image.UploadHostMemory(unswizzle_data_buffer, {}); }) { + if (True(image.flags & ImageFlagBits::ReorderableUpload) && image.CanUploadHostMemory()) { + Tegra::Memory::GpuGuestMemory + swizzle_data(*gpu_memory, image.gpu_addr, image.guest_size_bytes, + &swizzle_data_buffer); + unswizzle_data_buffer.resize_destructive(image.unswizzled_size_bytes); + const auto copies = FixSmallVectorADL(UnswizzleImage( + *gpu_memory, image.gpu_addr, image.info, swizzle_data, unswizzle_data_buffer)); + image.UploadHostMemory(unswizzle_data_buffer, copies); + return; + } + } auto staging = runtime.UploadStagingBuffer(MapSizeBytes(image)); UploadImageContents(image, staging); diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index e9075a62b5..cd5e5a8412 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -433,6 +433,13 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR const vk::InstanceDispatch& dld_) : instance{instance_}, dld{dld_}, physical{physical_}, format_properties(GetFormatProperties(physical)) { + const VkPhysicalDeviceMemoryProperties memory_properties = + physical.GetMemoryProperties().memoryProperties; + is_uma = std::all_of(memory_properties.memoryTypes, + memory_properties.memoryTypes + memory_properties.memoryTypeCount, + [](const VkMemoryType& type) { + return (type.propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0; + }); // Get suitability and device properties. const bool is_suitable = GetSuitability(surface != VkSurfaceKHR{}); @@ -487,15 +494,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR properties.subgroup_size_control.maxSubgroupSize > GuestWarpSize; is_integrated = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; - const VkPhysicalDeviceMemoryProperties memory_properties = - physical.GetMemoryProperties().memoryProperties; - is_uma = std::all_of(memory_properties.memoryTypes, - memory_properties.memoryTypes + memory_properties.memoryTypeCount, - [](const VkMemoryType& type) { - return (type.propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) == - 0 || - (type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0; - }); supports_d24_depth = IsFormatSupported(VK_FORMAT_D24_UNORM_S8_UINT, @@ -1425,6 +1423,12 @@ void Device::RemoveUnsuitableExtensions() { RemoveExtensionFeatureIfUnsuitable(extensions.maintenance5, features.maintenance5, VK_KHR_MAINTENANCE_5_EXTENSION_NAME); + if (!is_uma || instance_version < VK_API_VERSION_1_3 || + !features.host_image_copy.hostImageCopy) { + RemoveExtensionFeature(extensions.host_image_copy, features.host_image_copy, + VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME); + } + extensions.synchronization2 = features.synchronization2.synchronization2; extensions.dynamic_rendering = features.dynamic_rendering.dynamicRendering; diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index b562c210e5..63a2e5b7fa 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -68,6 +68,7 @@ VK_DEFINE_HANDLE(VmaAllocator) FEATURE(EXT, ExtendedDynamicState2, EXTENDED_DYNAMIC_STATE_2, extended_dynamic_state2) \ FEATURE(EXT, ExtendedDynamicState3, EXTENDED_DYNAMIC_STATE_3, extended_dynamic_state3) \ FEATURE(EXT, 4444Formats, 4444_FORMATS, format_a4b4g4r4) \ + FEATURE(EXT, HostImageCopy, HOST_IMAGE_COPY, host_image_copy) \ FEATURE(EXT, IndexTypeUint8, INDEX_TYPE_UINT8, index_type_uint8) \ FEATURE(EXT, LineRasterization, LINE_RASTERIZATION, line_rasterization) \ FEATURE(EXT, PrimitiveTopologyListRestart, PRIMITIVE_TOPOLOGY_LIST_RESTART, \ @@ -988,6 +989,10 @@ FN_MAX_LIMIT_LIST return is_uma; } + bool IsHostImageCopySupported() const { + return extensions.host_image_copy; + } + bool HasNullDescriptor() const { return features.robustness2.nullDescriptor; } diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 9a901cd8fb..01a65f95f5 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -206,6 +206,8 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkGetPipelineExecutablePropertiesKHR); X(vkGetPipelineExecutableStatisticsKHR); X(vkGetSemaphoreCounterValue); + X(vkCopyMemoryToImageEXT); + X(vkTransitionImageLayoutEXT); X(vkQueueBindSparse); X(vkQueueSubmit2); X(vkResetFences); diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index d524a36b65..c896a22bad 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -355,6 +355,8 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR{}; PFN_vkGetQueryPoolResults vkGetQueryPoolResults{}; PFN_vkGetSemaphoreCounterValue vkGetSemaphoreCounterValue{}; + PFN_vkCopyMemoryToImageEXT vkCopyMemoryToImageEXT{}; + PFN_vkTransitionImageLayoutEXT vkTransitionImageLayoutEXT{}; PFN_vkQueueBindSparse vkQueueBindSparse{}; PFN_vkQueueSubmit2 vkQueueSubmit2{}; PFN_vkResetFences vkResetFences{}; @@ -1092,6 +1094,14 @@ public: dld->vkResetQueryPool(handle, query_pool, first, count); } + void CopyMemoryToImageEXT(const VkCopyMemoryToImageInfoEXT& info) const { + Check(dld->vkCopyMemoryToImageEXT(handle, &info)); + } + + void TransitionImageLayoutEXT(const VkHostImageLayoutTransitionInfoEXT& info) const { + Check(dld->vkTransitionImageLayoutEXT(handle, 1, &info)); + } + VkResult GetQueryResults(VkQueryPool query_pool, u32 first, u32 count, std::size_t data_size, void* data, VkDeviceSize stride, VkQueryResultFlags flags) const noexcept { From d3550c45718609dc563d8b58adfc0d846feefd03 Mon Sep 17 00:00:00 2001 From: lizzie Date: Thu, 1 Oct 2026 07:39:44 +0200 Subject: [PATCH 149/198] [qt] Filter collates accents (Unicode NFD) (#4380) Now "POKEMON" and "pokemon" are the same, and search's no longer case sensitive. Maybe we could transliterate? But that would require icu which is a bit overkill. Main point is to be able to search "Pokemon" (accent on 'e') without actually typing the accent https://unicode.org/reports/tr15/ Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4380 Reviewed-by: MaranBr Reviewed-by: CamilleLaVey --- src/yuzu/game/common.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/yuzu/game/common.h b/src/yuzu/game/common.h index 03505d6313..063733e8d8 100644 --- a/src/yuzu/game/common.h +++ b/src/yuzu/game/common.h @@ -12,25 +12,29 @@ namespace Yuzu { inline bool ContainsAllWords(const QString& haystack, const QString& userinput) { const QStringList userinput_split = userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts); - return std::all_of(userinput_split.begin(), userinput_split.end(), - [&haystack](const QString& s) { return haystack.contains(s); }); + return std::all_of(userinput_split.begin(), userinput_split.end(), [&haystack](const QString& s) { + return haystack.contains(s); + }); } inline bool FilterMatches(const QString& filter, const QStandardItem* item) { if (filter.isEmpty()) return true; + auto const sluggify = [](const QString& s) { + QString o(s.normalized(QString::NormalizationForm_D).toLower()); + return o.replace(QRegularExpression(QStringLiteral("[^a-z\\s]")), QStringLiteral("")); + }; + + const auto norm_filter = sluggify(filter); const auto program_id = item->data(GameListItemPath::ProgramIdRole).toULongLong(); - - const QString file_path = item->data(GameListItemPath::FullPathRole).toString().toLower(); - const QString file_title = item->data(GameListItemPath::TitleRole).toString().toLower(); + const QString file_path = sluggify(item->data(GameListItemPath::FullPathRole).toString()); + const QString file_title = sluggify(item->data(GameListItemPath::TitleRole).toString()); const QString file_program_id = QStringLiteral("%1").arg(program_id, 16, 16, QLatin1Char{'0'}); - - const QString file_name = - file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) + QLatin1Char{' '} + file_title; - - return Yuzu::ContainsAllWords(file_name, filter) || - (file_program_id.size() == 16 && file_program_id.contains(filter)); + const QString file_name = sluggify(file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) + QLatin1Char{' '} + file_title); + return (ContainsAllWords(file_name, norm_filter) + || ContainsAllWords(file_title, norm_filter)) + || (file_program_id.size() == 16 && file_program_id.contains(norm_filter)); } } // namespace Yuzu From df36685c9bc8b4ec8d990aba8ee0314eda8e0d2c Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 02:01:24 -0400 Subject: [PATCH 150/198] Port UMA part 3 --- src/video_core/buffer_cache/buffer_cache.h | 17 +++++++++++++++-- .../renderer_vulkan/vk_buffer_cache.cpp | 8 ++++++++ .../renderer_vulkan/vk_buffer_cache.h | 2 ++ src/video_core/renderer_vulkan/vk_scheduler.cpp | 12 ++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 734ec5e0f3..00d632744b 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -327,6 +327,7 @@ std::pair BufferCache

::ObtainCPUBuffer( default: break; } + buffer.MarkUsage(buffer.Offset(device_addr), size); switch (post_op) { case ObtainBufferOperation::MarkAsWritten: @@ -394,8 +395,9 @@ void BufferCache

::CommitDrawWrites() { } const u64 pass = runtime.RenderPassSerial(); for (const DrawWrite& write : draw_writes) { - slot_buffers[write.buffer_id].MarkDrawWrite(pass, draw_wfi, write.device_addr, - write.size, write.feedback); + Buffer& buffer = slot_buffers[write.buffer_id]; + buffer.setWriteTick(runtime.CurrentTick()); + buffer.MarkDrawWrite(pass, draw_wfi, write.device_addr, write.size, write.feedback); } runtime.MarkRenderPassWrites(); } @@ -956,6 +958,7 @@ void BufferCache

::BindHostDrawIndirectBuffers() { Buffer& buffer = slot_buffers[binding.buffer_id]; TouchBuffer(buffer, binding.buffer_id); SynchronizeBuffer(buffer, binding.device_addr, binding.size); + buffer.MarkUsage(buffer.Offset(binding.device_addr), binding.size); }; if (current_draw_indirect->include_count) { bind_buffer(channel_state->count_buffer_binding); @@ -1989,6 +1992,16 @@ void BufferCache

::DownloadBufferMemory(Buffer& buffer, DAddr device_addr, u64 } if constexpr (USE_MEMORY_MAPS) { + if constexpr (requires { runtime.DirectDownloadSpan(buffer); }) { + const std::span direct = runtime.DirectDownloadSpan(buffer); + if (!direct.empty()) { + for (const BufferCopy& copy : copies) { + device_memory.WriteBlockUnsafe(buffer.CpuAddr() + copy.src_offset, + direct.data() + copy.src_offset, copy.size); + } + return; + } + } auto download_staging = runtime.DownloadStagingBuffer(total_size_bytes); const u8* const mapped_memory = download_staging.mapped_span.data(); const std::span copies_span(copies.data(), copies.data() + copies.size()); diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index f35ee502ce..20db32b52a 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -511,6 +511,14 @@ bool BufferCacheRuntime::CanReorderUpload(const Buffer& buffer, return can_use_upload_cmdbuf; } +std::span BufferCacheRuntime::DirectDownloadSpan(Buffer& buffer) { + const std::span mapping = buffer.CoherentMapping(); + if (!mapping.empty()) { + scheduler.Wait((std::max)(buffer.getWriteTick(), buffer.LastUploadTick())); + } + return mapping; +} + std::span BufferCacheRuntime::DirectUploadSpan( Buffer& buffer, std::span copies) { const std::span mapping = buffer.CoherentMapping(); diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index d96bd3783a..c963990385 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -149,6 +149,8 @@ public: bool CanReorderUpload(const Buffer& buffer, std::span copies); + [[nodiscard]] std::span DirectDownloadSpan(Buffer& buffer); + [[nodiscard]] std::span DirectUploadSpan(Buffer& buffer, std::span copies); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index cde7da2bcb..91aac1a51d 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -32,6 +32,15 @@ namespace Vulkan { namespace { constexpr size_t DEPTH_VIEW = 8; +constexpr VkMemoryBarrier2 HOST_READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_HOST_BIT, + .dstAccessMask = VK_ACCESS_2_HOST_READ_BIT, +}; + struct BeginRenderingCommand { void operator()(vk::CommandBuffer cmdbuf, vk::CommandBuffer) const { BeginRendering(cmdbuf, attachments); @@ -477,6 +486,9 @@ u64 Scheduler::SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_se this](vk::CommandBuffer cmdbuf, vk::CommandBuffer upload_cmdbuf) { upload_cmdbuf.PipelineBarrier(upload_write_barrier); upload_cmdbuf.End(); + if (device.IsUMA()) { + cmdbuf.PipelineBarrier(HOST_READ_BARRIER); + } cmdbuf.End(); if (on_submit) { From 488dcefec551cb83eb393bba474c5fe6aa75e937 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 02:49:53 -0400 Subject: [PATCH 151/198] Port UMA part 4 --- src/video_core/buffer_cache/buffer_cache.h | 34 ++++++++++++---------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 00d632744b..9efac6a5bf 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -804,16 +804,18 @@ void BufferCache

::BindHostIndexBuffer() { const auto& draw_state = maxwell3d->draw_manager.draw_state; if (draw_state.inline_index_draw_indexes.empty()) { SynchronizeBuffer(buffer, channel_state->index_buffer.device_addr, size); + } else if constexpr (USE_MEMORY_MAPS_FOR_UPLOADS) { + const auto upload_staging = runtime.UploadStagingBuffer(size); + std::memcpy(upload_staging.mapped_span.data(), + draw_state.inline_index_draw_indexes.data(), size); + runtime.BindIndexBuffer(draw_state.topology, draw_state.index_buffer.format, + draw_state.index_buffer.first, draw_state.index_buffer.count, + upload_staging.buffer, static_cast(upload_staging.offset), + size); + return; } else { buffer.MarkContentModified(); - if constexpr (USE_MEMORY_MAPS_FOR_UPLOADS) { - auto upload_staging = runtime.UploadStagingBuffer(size); - std::array copies{{BufferCopy{.src_offset = upload_staging.offset, .dst_offset = 0, .size = size}}}; - std::memcpy(upload_staging.mapped_span.data(), draw_state.inline_index_draw_indexes.data(), size); - runtime.CopyBuffer(buffer, upload_staging.buffer, copies, true); - } else { - buffer.ImmediateUpload(0, draw_state.inline_index_draw_indexes); - } + buffer.ImmediateUpload(0, draw_state.inline_index_draw_indexes); } if constexpr (HAS_FULL_INDEX_AND_PRIMITIVE_SUPPORT) { const u32 new_offset = offset + draw_state.index_buffer.first * u32(draw_state.index_buffer.FormatSizeInBytes()); @@ -1370,13 +1372,15 @@ void BufferCache

::UpdateIndexBuffer() { flags[Dirty::IndexBuffer] = false; if (!draw_state.inline_index_draw_indexes.empty()) [[unlikely]] { auto inline_index_size = static_cast(draw_state.inline_index_draw_indexes.size()); - u32 buffer_size = Common::AlignUp(inline_index_size, CACHING_PAGESIZE); - if (inline_buffer_id == NULL_BUFFER_ID) [[unlikely]] { - inline_buffer_id = CreateBuffer(0, buffer_size, false); - } - if (slot_buffers[inline_buffer_id].SizeBytes() < buffer_size) [[unlikely]] { - DeleteBuffer(inline_buffer_id, true); - inline_buffer_id = CreateBuffer(0, buffer_size, false); + if constexpr (!USE_MEMORY_MAPS_FOR_UPLOADS) { + const u32 buffer_size = Common::AlignUp(inline_index_size, CACHING_PAGESIZE); + if (inline_buffer_id == NULL_BUFFER_ID) [[unlikely]] { + inline_buffer_id = CreateBuffer(0, buffer_size, false); + } + if (slot_buffers[inline_buffer_id].SizeBytes() < buffer_size) [[unlikely]] { + DeleteBuffer(inline_buffer_id, true); + inline_buffer_id = CreateBuffer(0, buffer_size, false); + } } channel_state->index_buffer = Binding{ .device_addr = 0, From 1b764efad9960a877f2a56ed9f47327652c09765 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 12:23:20 -0400 Subject: [PATCH 152/198] Port UMA part 4.1 --- src/video_core/buffer_cache/buffer_cache.h | 15 ++++++ .../renderer_vulkan/vk_buffer_cache.cpp | 51 +++++++++++++++++++ .../renderer_vulkan/vk_buffer_cache.h | 3 ++ 3 files changed, 69 insertions(+) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 9efac6a5bf..8f7ca3fe3c 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -802,6 +802,21 @@ void BufferCache

::BindHostIndexBuffer() { const u32 offset = buffer.Offset(channel_state->index_buffer.device_addr); const u32 size = channel_state->index_buffer.size; const auto& draw_state = maxwell3d->draw_manager.draw_state; + if constexpr (!HAS_FULL_INDEX_AND_PRIMITIVE_SUPPORT) { + if (draw_state.topology == Maxwell::PrimitiveTopology::Quads || + draw_state.topology == Maxwell::PrimitiveTopology::QuadStrip) { + const DAddr device_addr = channel_state->index_buffer.device_addr; + std::span indices = draw_state.inline_index_draw_indexes; + if (indices.empty() && !IsRegionGpuModified(device_addr, size)) { + indices = ImmediateBufferWithData(device_addr, size); + } + if (runtime.BindQuadIndices(draw_state.topology, draw_state.index_buffer.format, + draw_state.index_buffer.first, + draw_state.index_buffer.count, indices)) { + return; + } + } + } if (draw_state.inline_index_draw_indexes.empty()) { SynchronizeBuffer(buffer, channel_state->index_buffer.device_addr, size); } else if constexpr (USE_MEMORY_MAPS_FOR_UPLOADS) { diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 20db32b52a..0547e7ed71 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -677,6 +677,57 @@ void BufferCacheRuntime::BindQuadIndexBuffer(PrimitiveTopology topology, u32 fir } } +bool BufferCacheRuntime::BindQuadIndices(PrimitiveTopology topology, IndexFormat index_format, + u32 base_vertex, u32 num_indices, + std::span indices) { + const size_t index_size = size_t{1} << static_cast(index_format); + if (indices.size() < num_indices * index_size) { + return false; + } + u32 quads = num_indices / 4; + u32 stride = 4; + std::array swizzle{0, 1, 2, 0, 2, 3}; + if (topology == PrimitiveTopology::QuadStrip) { + quads = 0; + if (num_indices >= 2) { + quads = (num_indices - 2) / 2; + } + stride = 2; + swizzle = {0, 3, 1, 0, 2, 3}; + } + const size_t size = (std::max)(quads, 1U) * sizeof(swizzle); + const StagingBufferRef staging = staging_pool.Request(size, MemoryUsage::Upload); + const auto convert = [&](auto index_type) { + u8* output = staging.mapped_span.data(); + for (u32 quad = 0; quad < quads; ++quad) { + std::array triangles; + for (size_t vertex = 0; vertex < triangles.size(); ++vertex) { + decltype(index_type) index; + std::memcpy(&index, + indices.data() + (quad * stride + swizzle[vertex]) * sizeof(index), + sizeof(index)); + triangles[vertex] = index + base_vertex; + } + std::memcpy(output, triangles.data(), sizeof(triangles)); + output += sizeof(triangles); + } + }; + switch (index_format) { + case IndexFormat::UnsignedByte: + convert(u8{}); + break; + case IndexFormat::UnsignedShort: + convert(u16{}); + break; + case IndexFormat::UnsignedInt: + convert(u32{}); + break; + } + BindIndexBuffer(PrimitiveTopology::Triangles, IndexFormat::UnsignedInt, 0, 0, staging.buffer, + static_cast(staging.offset), static_cast(size)); + return true; +} + void BufferCacheRuntime::BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset, u32 size, u32 stride) { if (index >= device.GetMaxVertexInputBindings()) { return; diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index c963990385..fa6829e623 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -178,6 +178,9 @@ public: void BindQuadIndexBuffer(PrimitiveTopology topology, u32 first, u32 count); + bool BindQuadIndices(PrimitiveTopology topology, IndexFormat index_format, u32 base_vertex, + u32 num_indices, std::span indices); + void BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset, u32 size, u32 stride); void BindVertexBuffers(VideoCommon::HostBindings& bindings); From fb174abf04cde3fa91e48764137f5289e190dd07 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 14:07:31 -0400 Subject: [PATCH 153/198] Port UMA part 5.1 --- .../features/settings/model/BooleanSetting.kt | 1 + .../settings/model/view/SettingsItem.kt | 7 + .../settings/ui/SettingsFragmentPresenter.kt | 1 + .../app/src/main/res/values/strings.xml | 2 + src/common/heap_tracker.cpp | 50 ++- src/common/heap_tracker.h | 6 + src/common/host_memory.cpp | 347 +++++++++++++++++- src/common/host_memory.h | 17 +- src/common/memory_detect.cpp | 64 ++++ src/common/memory_detect.h | 7 + src/common/settings.h | 3 + src/core/core.cpp | 5 +- src/core/device_memory.cpp | 17 +- src/core/device_memory_manager.h | 9 + src/core/device_memory_manager.inc | 1 + src/video_core/CMakeLists.txt | 2 + .../renderer_vulkan/vk_compute_pass.cpp | 87 +++-- .../renderer_vulkan/vk_compute_pass.h | 8 +- .../renderer_vulkan/vk_guest_memory.cpp | 176 +++++++++ .../renderer_vulkan/vk_guest_memory.h | 53 +++ .../renderer_vulkan/vk_rasterizer.cpp | 3 + .../renderer_vulkan/vk_texture_cache.cpp | 28 +- .../renderer_vulkan/vk_texture_cache.h | 11 + src/video_core/texture_cache/texture_cache.h | 18 + .../vulkan_common/vulkan_device.cpp | 9 + src/video_core/vulkan_common/vulkan_device.h | 5 + .../vulkan_common/vulkan_wrapper.cpp | 55 +++ src/video_core/vulkan_common/vulkan_wrapper.h | 22 ++ 28 files changed, 939 insertions(+), 75 deletions(-) create mode 100644 src/video_core/renderer_vulkan/vk_guest_memory.cpp create mode 100644 src/video_core/renderer_vulkan/vk_guest_memory.h 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 4b3648d4e3..2f1212ee21 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 @@ -31,6 +31,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { ENABLE_BUFFER_HISTORY("enable_buffer_history"), USE_OPTIMIZED_VERTEX_BUFFERS("use_optimized_vertex_buffers"), ENABLE_GPU_BUFFER_READBACK("enable_gpu_buffer_readback"), + USE_UNIFIED_MEMORY("use_unified_memory"), SYNC_MEMORY_OPERATIONS("sync_memory_operations"), BUFFER_REORDER_DISABLE("disable_buffer_reorder"), RENDERER_DEBUG("debug"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index d04ce0567f..7ce309d764 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -874,6 +874,13 @@ abstract class SettingsItem( descriptionId = R.string.enable_gpu_buffer_readback_description ) ) + put( + SwitchSetting( + BooleanSetting.USE_UNIFIED_MEMORY, + titleId = R.string.use_unified_memory, + descriptionId = R.string.use_unified_memory_description + ) + ) put( SwitchSetting( BooleanSetting.USE_OPTIMIZED_VERTEX_BUFFERS, 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 060d0dae3b..74c7fc41cf 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 @@ -551,6 +551,7 @@ class SettingsFragmentPresenter( add(BooleanSetting.RENDERER_BARRIER_FEEDBACK_LOOPS.key) add(BooleanSetting.ENABLE_BUFFER_HISTORY.key) add(BooleanSetting.ENABLE_GPU_BUFFER_READBACK.key) + add(BooleanSetting.USE_UNIFIED_MEMORY.key) add(BooleanSetting.USE_OPTIMIZED_VERTEX_BUFFERS.key) add(HeaderSetting(R.string.hacks)) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 3453e22190..b24cbceb18 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -587,6 +587,8 @@ Enable buffer history Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Enable GPU Buffer Readback + Unified Memory + Backs part of the emulated memory with GPU-shared buffers so textures are unswizzled directly from it, skipping a CPU copy. Needs 12 GB of RAM or more and a GPU with I/O coherency; it turns itself off otherwise. Takes effect on the next game launch. Preserves GPU-modified buffer data by reading it back before uploads. Some games require this to render certain effects properly. May cause issues if the hardware cannot handle the additional workload. Optimized Vertex Buffers Enables optimized vertex buffer binding for improved performance. Requires Mesa 26.0+ Turnip drivers/ QCOM drivers. Will crash on older Turnip drivers (25.3 and below). diff --git a/src/common/heap_tracker.cpp b/src/common/heap_tracker.cpp index b72abb16d8..1fa1514da7 100644 --- a/src/common/heap_tracker.cpp +++ b/src/common/heap_tracker.cpp @@ -4,34 +4,17 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include #include "common/heap_tracker.h" #include "common/logging.h" +#include "common/memory_detect.h" #include "common/assert.h" namespace Common { -namespace { - -s64 GetMaxPermissibleResidentMapCount() { - // Default value. - s64 value = 65530; - - // Try to read how many mappings we can make. - std::ifstream s("/proc/sys/vm/max_map_count"); - s >> value; - - // Print, for debug. - LOG_INFO(HW_Memory, "Current maximum map count: {}", value); - - // Allow 20000 maps for other code and to account for split inaccuracy. - return std::max(value - 20000, 0); -} - -} // namespace - HeapTracker::HeapTracker(Common::HostMemory& buffer) - : m_buffer(buffer), m_max_resident_map_count(GetMaxPermissibleResidentMapCount()) {} + : m_buffer(buffer), + m_has_hardware_buffer_backing(!buffer.BackingHardwareBuffers().empty()), + m_max_resident_map_count(static_cast(GetPermissibleMapCount())) {} HeapTracker::~HeapTracker() = default; void HeapTracker::Map(size_t virtual_offset, size_t host_offset, size_t length, @@ -85,7 +68,8 @@ void HeapTracker::Unmap(size_t virtual_offset, size_t size, bool is_separate_hea // If resident, erase from resident map. if (item->is_resident) { - ASSERT(--m_resident_map_count >= 0); + m_resident_map_count -= this->HostMapCount(item->paddr, item->size); + ASSERT(m_resident_map_count >= 0); m_resident_mappings.erase(m_resident_mappings.iterator_to(*item)); } @@ -191,7 +175,7 @@ bool HeapTracker::DeferredMapSeparateHeap(size_t virtual_offset) { // This map is now resident. it->is_resident = true; - m_resident_map_count++; + m_resident_map_count += this->HostMapCount(it->paddr, it->size); m_resident_mappings.insert(*it); } @@ -213,17 +197,17 @@ void HeapTracker::RebuildSeparateHeapAddressSpace() { // Despite being worse in theory, this has proven to be better in practice than more // regularly dumping a smaller amount, because it significantly reduces average case // lock contention. - std::size_t const desired_count = (std::min)(m_resident_map_count, m_max_resident_map_count) / 2; - std::size_t const evict_count = m_resident_map_count - desired_count; + s64 const desired_count = (std::min)(m_resident_map_count, m_max_resident_map_count) / 2; auto it = m_resident_mappings.begin(); - for (size_t i = 0; i < evict_count && it != m_resident_mappings.end(); i++) { + while (m_resident_map_count > desired_count && it != m_resident_mappings.end()) { // Unmark and unmap. it->is_resident = false; m_buffer.Unmap(it->vaddr, it->size, false); // Advance. - ASSERT(--m_resident_map_count >= 0); + m_resident_map_count -= this->HostMapCount(it->paddr, it->size); + ASSERT(m_resident_map_count >= 0); it = m_resident_mappings.erase(it); } } @@ -245,6 +229,7 @@ void HeapTracker::SplitHeapMapLocked(VAddr offset) { // Cache the original values. auto* const left = std::addressof(*it); const size_t orig_size = left->size; + const s64 orig_host_map_count = this->HostMapCount(left->paddr, orig_size); // Adjust the left map. const size_t left_size = offset - left->vaddr; @@ -266,11 +251,20 @@ void HeapTracker::SplitHeapMapLocked(VAddr offset) { // If resident, also insert into resident map. if (right->is_resident) { - m_resident_map_count++; + m_resident_map_count += this->HostMapCount(left->paddr, left->size) + + this->HostMapCount(right->paddr, right->size) - + orig_host_map_count; m_resident_mappings.insert(*right); } } +s64 HeapTracker::HostMapCount(PAddr paddr, size_t size) const { + if (!m_has_hardware_buffer_backing) { + return static_cast(size != 0); + } + return static_cast(m_buffer.BackingMapCount(paddr, size)); +} + HeapTracker::AddrTree::iterator HeapTracker::GetNearestHeapMapLocked(VAddr offset) { const SeparateHeapMap key{ .vaddr = offset, diff --git a/src/common/heap_tracker.h b/src/common/heap_tracker.h index ee5b0bf43a..8be66a1d4d 100644 --- a/src/common/heap_tracker.h +++ b/src/common/heap_tracker.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -82,10 +85,13 @@ private: AddrTree::iterator GetNearestHeapMapLocked(VAddr offset); + s64 HostMapCount(PAddr paddr, size_t size) const; + void RebuildSeparateHeapAddressSpace(); private: Common::HostMemory& m_buffer; + const bool m_has_hardware_buffer_backing; const s64 m_max_resident_map_count; std::shared_mutex m_rebuild_lock{}; diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index dd0780a283..65e73eb5a2 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -53,12 +53,42 @@ #include #include +#include #include "common/alignment.h" #include "common/assert.h" #include "common/free_region_manager.h" #include "common/host_memory.h" #include "common/logging.h" +#include "common/memory_detect.h" +#include "common/settings.h" + +#ifdef __ANDROID__ +#include +#include + +namespace { + +struct NativeHandle { + int version; + int numFds; + int numInts; + int data[1]; +}; + +using PFN_AHardwareBuffer_getNativeHandle = const NativeHandle* (*)(const AHardwareBuffer*); + +PFN_AHardwareBuffer_getNativeHandle ResolveGetNativeHandle() { + void* const lib = dlopen("libnativewindow.so", RTLD_NOW); + if (lib == nullptr) { + return nullptr; + } + return reinterpret_cast( + dlsym(lib, "AHardwareBuffer_getNativeHandle")); +} + +} +#endif #if defined(__ANDROID__) && __ANDROID_API__ < 30 #include @@ -122,7 +152,7 @@ static void GetFuncAddress(Common::DynamicLibrary& dll, const char* name, T& pfn class HostMemory::Impl { public: - explicit Impl(size_t backing_size_, size_t virtual_size_) + explicit Impl(size_t backing_size_, size_t virtual_size_, size_t) : backing_size{backing_size_} , virtual_size{virtual_size_} , process{GetCurrentProcess()} @@ -500,9 +530,10 @@ static int shm_open_anon(int flags, mode_t mode) { class HostMemory::Impl { public: - explicit Impl(size_t backing_size_, size_t virtual_size_) + explicit Impl(size_t backing_size_, size_t virtual_size_, size_t preferred_offset_) : backing_size{backing_size_} , virtual_size{virtual_size_} + , preferred_offset{preferred_offset_} {} bool Init() { @@ -542,10 +573,15 @@ public: LOG_WARNING(Common_Memory, "Using private mappings instead of shared ones"); backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)); if (fd > 0) { - fd = -1; close(fd); } + fd = -1; } else { +#ifdef __ANDROID__ + if (InitAhbBacking()) { + return InitVirtual(); + } +#endif backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); } if (backing_base == MAP_FAILED) { @@ -553,7 +589,10 @@ public: return false; } - // Virtual memory initialization + return InitVirtual(); + } + + bool InitVirtual() { virtual_base = virtual_map_base = static_cast(ChooseVirtualBase(virtual_size)); if (virtual_base == MAP_FAILED) { LOG_CRITICAL(HW_Memory, "mmap failed: {}", strerror(errno)); @@ -566,6 +605,240 @@ public: return true; } +#ifdef __ANDROID__ + static AHardwareBuffer_Desc MakeBlobDesc(size_t len) { + return AHardwareBuffer_Desc{ + .width = static_cast(len), + .height = 1, + .layers = 1, + .format = AHARDWAREBUFFER_FORMAT_BLOB, + .usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN | + AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN | + AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER, + .stride = 0, + .rfu0 = 0, + .rfu1 = 0, + }; + } + + static bool ProbeAhbBacking(PFN_AHardwareBuffer_getNativeHandle get_native_handle) { + const AHardwareBuffer_Desc desc = MakeBlobDesc(PageAlignment * 2); + AHardwareBuffer* buffer{}; + if (AHardwareBuffer_allocate(&desc, &buffer) != 0 || buffer == nullptr) { + return false; + } + const NativeHandle* const handle = get_native_handle(buffer); + if (handle == nullptr || handle->numFds < 1) { + AHardwareBuffer_release(buffer); + return false; + } + const int probe_fd = handle->data[0]; + bool ok = true; + const auto try_map = [&](int prot, off_t offset) { + if (!ok) { + return; + } + void* const ptr = mmap(nullptr, PageAlignment, prot, MAP_SHARED, probe_fd, offset); + if (ptr == MAP_FAILED) { + ok = false; + return; + } + munmap(ptr, PageAlignment); + }; + try_map(PROT_READ | PROT_WRITE, 0); + try_map(PROT_READ | PROT_WRITE, static_cast(PageAlignment)); +#ifdef ARCHITECTURE_arm64 + try_map(PROT_READ | PROT_EXEC, 0); +#endif + AHardwareBuffer_release(buffer); + return ok; + } + + size_t ComputeAhbBudget(size_t window_size) const { + const u64 total_physical = Common::GetMemInfo().TotalPhysicalMemory; + constexpr u64 BaselineFootprint = 6ULL << 30; + if (total_physical <= BaselineFootprint) { + return 0; + } + const u64 permissible_maps = Common::GetPermissibleMapCount(); + if (permissible_maps == 0) { + return 0; + } + u64 budget = (total_physical - BaselineFootprint) / 2; + constexpr u64 MapSlotsPerWindow = 64; + const u64 affordable_windows = permissible_maps / MapSlotsPerWindow; + budget = (std::min)(budget, affordable_windows * window_size); + const u64 available = Common::GetAvailablePhysicalMemory(); + if (available != 0) { + budget = (std::min)(budget, available / 2); + } + budget = (std::min)(budget, static_cast(backing_size)); + budget = Common::AlignDown(budget, window_size); + constexpr u64 MinimumBudget = 256ULL << 20; + if (budget < MinimumBudget) { + return 0; + } + return static_cast(budget); + } + + bool InitAhbBacking() { + if (!Settings::values.use_unified_memory.GetValue()) { + return false; + } + static const PFN_AHardwareBuffer_getNativeHandle get_native_handle = + ResolveGetNativeHandle(); + if (get_native_handle == nullptr) { + return false; + } + constexpr size_t window_size = 256ULL << 20; + const size_t budget = ComputeAhbBudget(window_size); + if (budget == 0) { + return false; + } + if (!ProbeAhbBacking(get_native_handle)) { + return false; + } + const size_t aligned_backing = Common::AlignDown(backing_size, window_size); + const size_t max_windows = (std::min)(budget, aligned_backing) / window_size; + + std::vector buffers; + std::vector buffer_fds; + const auto cleanup = [&] { + for (AHardwareBuffer* buffer : buffers) { + AHardwareBuffer_release(buffer); + } + buffers.clear(); + buffer_fds.clear(); + }; + for (size_t i = 0; i < max_windows; ++i) { + const AHardwareBuffer_Desc desc = MakeBlobDesc(window_size); + AHardwareBuffer* buffer{}; + if (AHardwareBuffer_allocate(&desc, &buffer) != 0 || buffer == nullptr) { + break; + } + const NativeHandle* const handle = get_native_handle(buffer); + if (handle == nullptr || handle->numFds < 1) { + AHardwareBuffer_release(buffer); + break; + } + const int buffer_fd = handle->data[0]; + const off_t buffer_len = lseek(buffer_fd, 0, SEEK_END); + if (buffer_len < static_cast(window_size)) { + AHardwareBuffer_release(buffer); + break; + } + buffers.push_back(buffer); + buffer_fds.push_back(buffer_fd); + } + const size_t num_windows = buffers.size(); + if (num_windows == 0) { + return false; + } + const size_t region_size = num_windows * window_size; + const size_t region_base = Common::AlignDown( + (std::min)(preferred_offset, aligned_backing - region_size), window_size); + u8* const base = static_cast(mmap(nullptr, backing_size, PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0)); + if (base == MAP_FAILED) { + cleanup(); + return false; + } + const auto map_over_reservation = [&](size_t offset, size_t len, int map_fd, + off_t map_offset) { + if (len == 0) { + return true; + } + if (mmap(base + offset, len, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, map_fd, + map_offset) == MAP_FAILED) { + munmap(base, backing_size); + cleanup(); + return false; + } + return true; + }; + if (!map_over_reservation(0, region_base, fd, 0)) { + return false; + } + for (size_t i = 0; i < num_windows; ++i) { + if (!map_over_reservation(region_base + i * window_size, window_size, buffer_fds[i], + 0)) { + return false; + } + } + const size_t tail_offset = region_base + region_size; + if (!map_over_reservation(tail_offset, backing_size - tail_offset, fd, + static_cast(tail_offset))) { + return false; + } + backing_base = base; + ahb_windows = std::move(buffers); + ahb_fds = std::move(buffer_fds); + ahb_window_size = window_size; + ahb_base = region_base; + ahb_bytes = region_size; + return true; + } + + void MapBackingRange(size_t virtual_offset, size_t host_offset, size_t length, int prot_flags) { + while (length > 0) { + int map_fd = fd; + off_t map_offset = static_cast(host_offset); + size_t chunk = length; + if (host_offset < ahb_base) { + chunk = (std::min)(chunk, ahb_base - host_offset); + } else if (host_offset < ahb_base + ahb_bytes) { + const size_t relative = host_offset - ahb_base; + const size_t window = relative / ahb_window_size; + const size_t local = relative % ahb_window_size; + map_fd = ahb_fds[window]; + map_offset = static_cast(local); + chunk = (std::min)(chunk, ahb_window_size - local); + } + void* const ret = mmap(virtual_base + virtual_offset, chunk, prot_flags, + MAP_SHARED | MAP_FIXED, map_fd, map_offset); + ASSERT_MSG(ret != MAP_FAILED, "mmap: {}", strerror(errno)); + virtual_offset += chunk; + host_offset += chunk; + length -= chunk; + } + } + + size_t BackingMapCount(size_t host_offset, size_t length) const noexcept { + if (length == 0) { + return 0; + } + if (ahb_bytes == 0) { + return 1; + } + size_t count = 0; + while (length > 0) { + size_t chunk = length; + if (host_offset < ahb_base) { + chunk = (std::min)(chunk, ahb_base - host_offset); + } else if (host_offset < ahb_base + ahb_bytes) { + const size_t local = (host_offset - ahb_base) % ahb_window_size; + chunk = (std::min)(chunk, ahb_window_size - local); + } + host_offset += chunk; + length -= chunk; + ++count; + } + return count; + } + + std::span AhbWindows() const noexcept { + return ahb_windows; + } + + size_t AhbWindowSize() const noexcept { + return ahb_window_size; + } + + size_t AhbBase() const noexcept { + return ahb_base; + } +#endif + ~Impl() { Release(); } @@ -586,6 +859,12 @@ public: #ifdef ARCHITECTURE_arm64 if (True(perms & MemoryPermission::Execute)) prot_flags |= PROT_EXEC; +#endif +#ifdef __ANDROID__ + if (ahb_bytes != 0) { + MapBackingRange(virtual_offset, host_offset, length, prot_flags); + return; + } #endif int flags = (fd >= 0 ? MAP_SHARED : MAP_PRIVATE) | MAP_FIXED; void* ret = mmap(virtual_base + virtual_offset, length, prot_flags, flags, fd, host_offset); @@ -633,6 +912,7 @@ public: const size_t backing_size; ///< Size of the backing memory in bytes const size_t virtual_size; ///< Size of the virtual address placeholder in bytes + const size_t preferred_offset; u8* backing_base{reinterpret_cast(MAP_FAILED)}; u8* virtual_base{reinterpret_cast(MAP_FAILED)}; @@ -655,6 +935,15 @@ private: int ret = close(fd); ASSERT_MSG(ret == 0, "close failed: {}", strerror(errno)); } + +#ifdef __ANDROID__ + for (AHardwareBuffer* buffer : ahb_windows) { + AHardwareBuffer_release(buffer); + } + ahb_windows.clear(); + ahb_fds.clear(); + ahb_bytes = 0; +#endif } void AdjustMap(size_t* virtual_offset, size_t* length) { @@ -680,11 +969,19 @@ private: int fd{-1}; // memfd file descriptor, -1 is the error value of memfd_create FreeRegionManager free_manager{}; + +#ifdef __ANDROID__ + std::vector ahb_windows; + std::vector ahb_fds; + size_t ahb_window_size{}; + size_t ahb_base{}; + size_t ahb_bytes{}; +#endif }; #endif // ^^^ POSIX ^^^ -HostMemory::HostMemory(size_t backing_size_, size_t virtual_size_) +HostMemory::HostMemory(size_t backing_size_, size_t virtual_size_, size_t preferred_offset_) : backing_size(backing_size_) , virtual_size(virtual_size_) { @@ -696,7 +993,9 @@ HostMemory::HostMemory(size_t backing_size_, size_t virtual_size_) #else // Try to allocate a fastmem arena. // The implementation will fail with std::bad_alloc on errors. - impl = std::make_unique(AlignUp(backing_size, PageAlignment), AlignUp(virtual_size, PageAlignment) + HugePageSize); + impl = std::make_unique(AlignUp(backing_size, PageAlignment), + AlignUp(virtual_size, PageAlignment) + HugePageSize, + preferred_offset_); if (impl->Init()) { backing_base = impl->backing_base; virtual_base = impl->virtual_base; @@ -766,6 +1065,42 @@ void HostMemory::ClearBackingRegion(size_t physical_offset, size_t length, u32 f std::memset(backing_base + physical_offset, fill_value, length); } +std::span HostMemory::BackingHardwareBuffers() const noexcept { +#ifdef __ANDROID__ + if (impl) { + return impl->AhbWindows(); + } +#endif + return {}; +} + +size_t HostMemory::BackingMapCount(size_t host_offset, size_t length) const noexcept { +#ifdef __ANDROID__ + if (impl) { + return impl->BackingMapCount(host_offset, length); + } +#endif + return static_cast(length != 0); +} + +size_t HostMemory::BackingHardwareBufferWindowSize() const noexcept { +#ifdef __ANDROID__ + if (impl) { + return impl->AhbWindowSize(); + } +#endif + return 0; +} + +size_t HostMemory::BackingHardwareBufferBase() const noexcept { +#ifdef __ANDROID__ + if (impl) { + return impl->AhbBase(); + } +#endif + return 0; +} + void HostMemory::EnableDirectMappedAddress() { #if !(defined(__OPENORBIS__) || defined(__managarm__)) if (impl) { diff --git a/src/common/host_memory.h b/src/common/host_memory.h index 24f4670732..3299680580 100644 --- a/src/common/host_memory.h +++ b/src/common/host_memory.h @@ -8,10 +8,13 @@ #include #include +#include #include "common/common_funcs.h" #include "common/common_types.h" #include "common/virtual_buffer.h" +struct AHardwareBuffer; + namespace Common { enum class MemoryPermission : u32 { @@ -28,7 +31,7 @@ DECLARE_ENUM_FLAG_OPERATORS(MemoryPermission) */ class HostMemory { public: - explicit HostMemory(size_t backing_size_, size_t virtual_size_); + explicit HostMemory(size_t backing_size_, size_t virtual_size_, size_t preferred_offset_ = 0); ~HostMemory(); /** @@ -62,6 +65,18 @@ public: return backing_base; } + [[nodiscard]] size_t BackingSize() const noexcept { + return backing_size; + } + + [[nodiscard]] size_t BackingMapCount(size_t host_offset, size_t length) const noexcept; + + [[nodiscard]] std::span BackingHardwareBuffers() const noexcept; + + [[nodiscard]] size_t BackingHardwareBufferWindowSize() const noexcept; + + [[nodiscard]] size_t BackingHardwareBufferBase() const noexcept; + [[nodiscard]] u8* VirtualBasePointer() noexcept { return virtual_base; } diff --git a/src/common/memory_detect.cpp b/src/common/memory_detect.cpp index 86a3abcc6d..ae303a4f1a 100644 --- a/src/common/memory_detect.cpp +++ b/src/common/memory_detect.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -17,6 +20,10 @@ #endif #endif +#include +#include +#include + #include "common/memory_detect.h" namespace Common { @@ -69,4 +76,61 @@ const MemoryInfo& GetMemInfo() { return mem_info; } +u64 GetPermissibleMapCount() { + constexpr u64 DefaultMapCount = 65530; + constexpr u64 ReservedMaps = 20000; + u64 count = DefaultMapCount; +#ifdef __linux__ + if (std::FILE* const file = std::fopen("/proc/sys/vm/max_map_count", "re")) { + char line[32]; + if (std::fgets(line, sizeof(line), file) != nullptr) { + const u64 parsed = std::strtoull(line, nullptr, 10); + if (parsed != 0) { + count = parsed; + } + } + std::fclose(file); + } +#endif + if (count <= ReservedMaps) { + return 0; + } + return count - ReservedMaps; +} + +u64 GetAvailablePhysicalMemory() { +#ifdef _WIN32 + MEMORYSTATUSEX memorystatus; + memorystatus.dwLength = sizeof(memorystatus); + if (GlobalMemoryStatusEx(&memorystatus) == 0) { + return 0; + } + return memorystatus.ullAvailPhys; +#elif defined(__linux__) + static constexpr char AvailableKey[] = "MemAvailable:"; + if (std::FILE* const file = std::fopen("/proc/meminfo", "re")) { + char line[256]; + u64 available = 0; + while (std::fgets(line, sizeof(line), file) != nullptr) { + if (std::strncmp(line, AvailableKey, sizeof(AvailableKey) - 1) != 0) { + continue; + } + available = std::strtoull(line + sizeof(AvailableKey) - 1, nullptr, 10) * 1024; + break; + } + std::fclose(file); + if (available != 0) { + return available; + } + } + struct sysinfo meminfo; + if (sysinfo(&meminfo) != 0) { + return 0; + } + return static_cast(meminfo.freeram) * static_cast(meminfo.mem_unit); +#else + return 0; +#endif +} + } // namespace Common diff --git a/src/common/memory_detect.h b/src/common/memory_detect.h index c8f239aed3..367e3f754d 100644 --- a/src/common/memory_detect.h +++ b/src/common/memory_detect.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -18,4 +21,8 @@ struct MemoryInfo { */ [[nodiscard]] const MemoryInfo& GetMemInfo(); +[[nodiscard]] u64 GetPermissibleMapCount(); + +[[nodiscard]] u64 GetAvailablePhysicalMemory(); + } // namespace Common diff --git a/src/common/settings.h b/src/common/settings.h index e564a11cb5..a924007205 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -654,6 +654,9 @@ struct Values { SwitchableSetting use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders", Category::RendererHacks}; + SwitchableSetting use_unified_memory{linkage, false, "use_unified_memory", + Category::RendererHacks}; + SwitchableSetting dyna_state{linkage, #if defined(__ANDROID__) ExtendedDynamicState::Disabled, diff --git a/src/core/core.cpp b/src/core/core.cpp index 046ee53346..10d1c336c4 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -120,6 +120,7 @@ struct System::Impl { is_multicore = Settings::values.use_multi_core.GetValue(); extended_memory_layout = Settings::values.memory_layout_mode.GetValue() != Settings::MemoryLayout::Memory_4Gb; + unified_memory = Settings::values.use_unified_memory.GetValue(); core_timing.SetMulticore(is_multicore); core_timing.Initialize([&system]() { system.RegisterHostThread(); }); @@ -147,7 +148,8 @@ struct System::Impl { !device_memory.has_value() || is_multicore != Settings::values.use_multi_core.GetValue() || extended_memory_layout != (Settings::values.memory_layout_mode.GetValue() != - Settings::MemoryLayout::Memory_4Gb); + Settings::MemoryLayout::Memory_4Gb) || + unified_memory != Settings::values.use_unified_memory.GetValue(); if (!must_reinitialize) { return; @@ -535,6 +537,7 @@ struct System::Impl { std::atomic_bool is_powered_on{}; bool is_multicore : 1 = false; bool extended_memory_layout : 1 = false; + bool unified_memory : 1 = false; bool exit_locked : 1 = false; bool exit_requested : 1 = false; diff --git a/src/core/device_memory.cpp b/src/core/device_memory.cpp index 1aea56a991..8d56f86be9 100644 --- a/src/core/device_memory.cpp +++ b/src/core/device_memory.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -12,9 +15,21 @@ constexpr size_t VirtualReserveSize = 1ULL << 38; constexpr size_t VirtualReserveSize = 1ULL << 39; #endif +namespace { +size_t ApplicationPoolOffset() { + using Init = Kernel::Board::Nintendo::Nx::KSystemControl::Init; + const size_t dram_size = Init::GetIntendedMemorySize(); + const size_t application_pool_size = Init::GetApplicationPoolSize(); + if (dram_size <= application_pool_size) { + return 0; + } + return dram_size - application_pool_size; +} +} + DeviceMemory::DeviceMemory() : buffer{Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize(), - VirtualReserveSize} {} + VirtualReserveSize, ApplicationPoolOffset()} {} DeviceMemory::~DeviceMemory() = default; diff --git a/src/core/device_memory_manager.h b/src/core/device_memory_manager.h index 3d97fdcc5c..72c8b7787f 100644 --- a/src/core/device_memory_manager.h +++ b/src/core/device_memory_manager.h @@ -20,6 +20,10 @@ #include "common/scratch_buffer.h" #include "common/virtual_buffer.h" +namespace Common { +class HostMemory; +} + namespace Core { constexpr size_t DEVICE_PAGEBITS = 12ULL; @@ -126,6 +130,10 @@ public: // New batch API to update multiple ranges with a single lock acquisition. void UpdatePagesCachedBatch(std::span> ranges, s32 delta); + const Common::HostMemory& GetHostMemory() const noexcept { + return host_memory; + } + private: struct TranslationEntry { DAddr guest_page{}; @@ -171,6 +179,7 @@ private: std::unique_ptr> impl; const uintptr_t physical_base; + const Common::HostMemory& host_memory; DeviceInterface* device_inter; struct TrackedEntry { diff --git a/src/core/device_memory_manager.inc b/src/core/device_memory_manager.inc index 9866f3a4f7..8f3ed53285 100644 --- a/src/core/device_memory_manager.inc +++ b/src/core/device_memory_manager.inc @@ -171,6 +171,7 @@ struct DeviceMemoryManagerAllocator { template DeviceMemoryManager::DeviceMemoryManager(const DeviceMemory& device_memory_) : physical_base{uintptr_t(device_memory_.buffer.BackingBasePointer())} + , host_memory{device_memory_.buffer} , device_inter{nullptr} , compressed_device_addr(1ULL << ((Settings::values.memory_layout_mode.GetValue() == Settings::MemoryLayout::Memory_4Gb ? physical_min_bits : physical_max_bits) - Memory::YUZU_PAGEBITS)) , tracked_entries(device_as_size >> Memory::YUZU_PAGEBITS) diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 82f0b68863..96facedf79 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -168,6 +168,8 @@ add_library(video_core STATIC renderer_vulkan/vk_fence_manager.h renderer_vulkan/vk_graphics_pipeline.cpp renderer_vulkan/vk_graphics_pipeline.h + renderer_vulkan/vk_guest_memory.cpp + renderer_vulkan/vk_guest_memory.h renderer_vulkan/vk_multi_range_buffer.cpp renderer_vulkan/vk_multi_range_buffer.h renderer_vulkan/vk_master_semaphore.cpp diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 2fcba26ce4..6bee2407b7 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -591,8 +591,21 @@ void QueriesPrefixScanPass::Run(VkBuffer accumulation_buffer, VkBuffer dst_buffe namespace { -void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, VkImage vk_image, - VkImageAspectFlags aspect_mask, bool is_initialized) { +template +void RecordUnswizzle(Scheduler& scheduler, bool reorder, Func&& func) { + if (reorder) { + scheduler.RecordWithUploadBuffer( + [func = std::forward(func)](vk::CommandBuffer, vk::CommandBuffer upload_cmdbuf) { + func(upload_cmdbuf); + }); + return; + } + scheduler.Record(std::forward(func)); +} + +void RecordUnswizzleBeginBarrier(Scheduler& scheduler, bool reorder, VkPipeline vk_pipeline, + VkImage vk_image, VkImageAspectFlags aspect_mask, + bool is_initialized) { VkAccessFlags2 src_access = VK_ACCESS_2_NONE; VkImageLayout old_layout = VK_IMAGE_LAYOUT_UNDEFINED; VkPipelineStageFlags2 src_stage = VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT; @@ -601,8 +614,8 @@ void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, V old_layout = VK_IMAGE_LAYOUT_GENERAL; src_stage = vk::PIPELINE_STAGE_IMAGE_USERS; } - scheduler.Record([vk_pipeline, vk_image, aspect_mask, src_access, old_layout, - src_stage](vk::CommandBuffer cmdbuf) { + RecordUnswizzle(scheduler, reorder, [vk_pipeline, vk_image, aspect_mask, src_access, + old_layout, src_stage](vk::CommandBuffer cmdbuf) { const VkImageMemoryBarrier2 image_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, @@ -628,9 +641,9 @@ void RecordUnswizzleBeginBarrier(Scheduler& scheduler, VkPipeline vk_pipeline, V }); } -void RecordUnswizzleEndBarrier(Scheduler& scheduler, VkImage vk_image, +void RecordUnswizzleEndBarrier(Scheduler& scheduler, bool reorder, VkImage vk_image, VkImageAspectFlags aspect_mask) { - scheduler.Record([vk_image, aspect_mask](vk::CommandBuffer cmdbuf) { + RecordUnswizzle(scheduler, reorder, [vk_image, aspect_mask](vk::CommandBuffer cmdbuf) { const VkImageMemoryBarrier2 image_barrier{ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, .pNext = nullptr, @@ -672,16 +685,19 @@ ASTCDecoderPass::ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, ASTCDecoderPass::~ASTCDecoderPass() = default; void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, - std::span swizzles) { + std::span swizzles, + bool reorder) { using namespace VideoCommon::Accelerated; const std::array block_dims{ VideoCore::Surface::DefaultBlockWidth(image.info.format), VideoCore::Surface::DefaultBlockHeight(image.info.format), }; - scheduler.RequestOutsideRenderPassOperationContext(); + if (!reorder) { + scheduler.RequestOutsideRenderPassOperationContext(); + } const VkImageAspectFlags aspect_mask = image.AspectMask(); const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, image.ExchangeInitialization()); for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { const size_t input_offset = swizzle.buffer_offset + map.offset; @@ -700,8 +716,9 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, ASSERT(params.origin == (std::array{0, 0, 0})); ASSERT(params.destination == (std::array{0, 0, 0})); ASSERT(params.bytes_per_block_log2 == 4); - scheduler.Record([this, num_dispatches_x, num_dispatches_y, num_dispatches_z, block_dims, - params, descriptor_data](vk::CommandBuffer cmdbuf) { + RecordUnswizzle(scheduler, reorder, + [this, num_dispatches_x, num_dispatches_y, num_dispatches_z, block_dims, + params, descriptor_data](vk::CommandBuffer cmdbuf) { const AstcPushConstants uniforms{ .blocks_dims = block_dims, .layer_stride = params.layer_stride, @@ -717,7 +734,7 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); }); } - RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); + RecordUnswizzleEndBarrier(scheduler, reorder, vk_image, aspect_mask); } BlockLinearUnswizzleImage2DPass::BlockLinearUnswizzleImage2DPass( @@ -736,12 +753,14 @@ BlockLinearUnswizzleImage2DPass::~BlockLinearUnswizzleImage2DPass() = default; void BlockLinearUnswizzleImage2DPass::Unswizzle( Image& image, const StagingBufferRef& map, - std::span swizzles) { + std::span swizzles, bool reorder) { using namespace VideoCommon::Accelerated; - scheduler.RequestOutsideRenderPassOperationContext(); + if (!reorder) { + scheduler.RequestOutsideRenderPassOperationContext(); + } const VkImageAspectFlags aspect_mask = image.AspectMask(); const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, image.ExchangeInitialization()); for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { const size_t input_offset = swizzle.buffer_offset + map.offset; @@ -756,8 +775,9 @@ void BlockLinearUnswizzleImage2DPass::Unswizzle( const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; const auto params = MakeBlockLinearSwizzle2DParams(swizzle, image.info); - scheduler.Record([this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, - descriptor_data](vk::CommandBuffer cmdbuf) { + RecordUnswizzle(scheduler, reorder, + [this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, + descriptor_data](vk::CommandBuffer cmdbuf) { const VkDescriptorSet set = descriptor_allocator.Commit(); device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); @@ -765,7 +785,7 @@ void BlockLinearUnswizzleImage2DPass::Unswizzle( cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); }); } - RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); + RecordUnswizzleEndBarrier(scheduler, reorder, vk_image, aspect_mask); } BlockLinearUnswizzleImage3DPass::BlockLinearUnswizzleImage3DPass( @@ -783,12 +803,14 @@ BlockLinearUnswizzleImage3DPass::~BlockLinearUnswizzleImage3DPass() = default; void BlockLinearUnswizzleImage3DPass::Unswizzle( Image& image, const StagingBufferRef& map, - std::span swizzles) { + std::span swizzles, bool reorder) { using namespace VideoCommon::Accelerated; - scheduler.RequestOutsideRenderPassOperationContext(); + if (!reorder) { + scheduler.RequestOutsideRenderPassOperationContext(); + } const VkImageAspectFlags aspect_mask = image.AspectMask(); const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, image.ExchangeInitialization()); for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { const size_t input_offset = swizzle.buffer_offset + map.offset; @@ -815,8 +837,9 @@ void BlockLinearUnswizzleImage3DPass::Unswizzle( .block_depth = p.block_depth, .block_depth_mask = p.block_depth_mask, }; - scheduler.Record([this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, - descriptor_data](vk::CommandBuffer cmdbuf) { + RecordUnswizzle(scheduler, reorder, + [this, num_dispatches_x, num_dispatches_y, num_dispatches_z, params, + descriptor_data](vk::CommandBuffer cmdbuf) { const VkDescriptorSet set = descriptor_allocator.Commit(); device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); @@ -824,7 +847,7 @@ void BlockLinearUnswizzleImage3DPass::Unswizzle( cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, num_dispatches_z); }); } - RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); + RecordUnswizzleEndBarrier(scheduler, reorder, vk_image, aspect_mask); } PitchUnswizzlePass::PitchUnswizzlePass(const Device& device_, Scheduler& scheduler_, @@ -841,13 +864,16 @@ PitchUnswizzlePass::PitchUnswizzlePass(const Device& device_, Scheduler& schedul PitchUnswizzlePass::~PitchUnswizzlePass() = default; void PitchUnswizzlePass::Unswizzle(Image& image, const StagingBufferRef& map, - std::span swizzles) { + std::span swizzles, + bool reorder) { const u32 bytes_per_block = VideoCore::Surface::BytesPerBlock(image.info.format); ASSERT(std::has_single_bit(bytes_per_block)); - scheduler.RequestOutsideRenderPassOperationContext(); + if (!reorder) { + scheduler.RequestOutsideRenderPassOperationContext(); + } const VkImageAspectFlags aspect_mask = image.AspectMask(); const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, *pipeline, vk_image, aspect_mask, + RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, image.ExchangeInitialization()); for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { const size_t input_offset = swizzle.buffer_offset + map.offset; @@ -866,8 +892,9 @@ void PitchUnswizzlePass::Unswizzle(Image& image, const StagingBufferRef& map, .bytes_per_block_log2 = static_cast(std::countr_zero(bytes_per_block)), .pitch = image.info.pitch, }; - scheduler.Record([this, num_dispatches_x, num_dispatches_y, params, - descriptor_data](vk::CommandBuffer cmdbuf) { + RecordUnswizzle(scheduler, reorder, + [this, num_dispatches_x, num_dispatches_y, params, + descriptor_data](vk::CommandBuffer cmdbuf) { const VkDescriptorSet set = descriptor_allocator.Commit(); device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_COMPUTE, *layout, 0, set, {}); @@ -875,7 +902,7 @@ void PitchUnswizzlePass::Unswizzle(Image& image, const StagingBufferRef& map, cmdbuf.Dispatch(num_dispatches_x, num_dispatches_y, 1); }); } - RecordUnswizzleEndBarrier(scheduler, vk_image, aspect_mask); + RecordUnswizzleEndBarrier(scheduler, reorder, vk_image, aspect_mask); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index f871648647..7517b65aee 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h @@ -144,7 +144,7 @@ public: ~ASTCDecoderPass(); void Assemble(Image& image, const StagingBufferRef& map, - std::span swizzles); + std::span swizzles, bool reorder); private: Scheduler& scheduler; @@ -162,7 +162,7 @@ public: ~PitchUnswizzlePass(); void Unswizzle(Image& image, const StagingBufferRef& map, - std::span swizzles); + std::span swizzles, bool reorder); private: Scheduler& scheduler; @@ -179,7 +179,7 @@ public: ~BlockLinearUnswizzleImage3DPass(); void Unswizzle(Image& image, const StagingBufferRef& map, - std::span swizzles); + std::span swizzles, bool reorder); private: Scheduler& scheduler; @@ -196,7 +196,7 @@ public: ~BlockLinearUnswizzleImage2DPass(); void Unswizzle(Image& image, const StagingBufferRef& map, - std::span swizzles); + std::span swizzles, bool reorder); private: Scheduler& scheduler; diff --git a/src/video_core/renderer_vulkan/vk_guest_memory.cpp b/src/video_core/renderer_vulkan/vk_guest_memory.cpp new file mode 100644 index 0000000000..7d0d28852d --- /dev/null +++ b/src/video_core/renderer_vulkan/vk_guest_memory.cpp @@ -0,0 +1,176 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include +#include +#include +#include +#include + +#include "common/host_memory.h" +#include "video_core/renderer_vulkan/vk_guest_memory.h" +#include "video_core/renderer_vulkan/vk_scheduler.h" +#include "video_core/vulkan_common/vulkan_device.h" +#include "video_core/vulkan_common/vulkan_memory_allocator.h" + +namespace Vulkan { +namespace { +constexpr size_t PROBE_WORDS = 1024; +constexpr size_t PROBE_SIZE = PROBE_WORDS * sizeof(u32); +constexpr u32 PROBE_CPU_STRIDE = 0x9E3779B9U; +constexpr u32 PROBE_GPU_VALUE = 0x5AC3E10FU; +} + +GuestMemory::GuestMemory(const Device& device, MemoryAllocator& memory_allocator, + Scheduler& scheduler, const Common::HostMemory& host_memory) { + Import(device, host_memory); + if (!windows.empty() && !IsCoherent(memory_allocator, scheduler)) { + windows.clear(); + } +} + +std::optional GuestMemory::Find(const u8* pointer, size_t size) const { + if (windows.empty() || pointer < base) { + return std::nullopt; + } + const size_t offset = static_cast(pointer - base); + const size_t index = offset / window_size; + const size_t local_offset = offset % window_size; + if (index >= windows.size() || window_size - local_offset < size) { + return std::nullopt; + } + return Range{*windows[index].buffer, local_offset}; +} + +void GuestMemory::Import([[maybe_unused]] const Device& device, + [[maybe_unused]] const Common::HostMemory& host_memory) { +#ifdef __ANDROID__ + const std::span hardware_buffers = + host_memory.BackingHardwareBuffers(); + window_size = host_memory.BackingHardwareBufferWindowSize(); + if (hardware_buffers.empty() || window_size == 0 || !device.IsAhbImportSupported()) { + return; + } + base = const_cast(host_memory.BackingBasePointer()) + + host_memory.BackingHardwareBufferBase(); + const vk::Device& logical = device.GetLogical(); + try { + for (AHardwareBuffer* const hardware_buffer : hardware_buffers) { + const VkAndroidHardwareBufferPropertiesANDROID properties = + logical.GetAndroidHardwareBufferProperties(hardware_buffer); + const VkExternalMemoryBufferCreateInfo external_info{ + .sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO, + .pNext = nullptr, + .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID, + }; + Window& window = windows.emplace_back(); + window.buffer = logical.CreateExternalBuffer(VkBufferCreateInfo{ + .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, + .pNext = &external_info, + .flags = 0, + .size = window_size, + .usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT, + .sharingMode = VK_SHARING_MODE_EXCLUSIVE, + .queueFamilyIndexCount = 0, + .pQueueFamilyIndices = nullptr, + }); + const u32 type_bits = + logical.GetBufferMemoryRequirements(*window.buffer).memoryTypeBits & + properties.memoryTypeBits; + if (type_bits == 0) { + windows.clear(); + return; + } + const VkImportAndroidHardwareBufferInfoANDROID import_info{ + .sType = VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID, + .pNext = nullptr, + .buffer = hardware_buffer, + }; + const VkMemoryDedicatedAllocateInfo dedicated_info{ + .sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, + .pNext = &import_info, + .image = VK_NULL_HANDLE, + .buffer = *window.buffer, + }; + window.memory = logical.AllocateMemory(VkMemoryAllocateInfo{ + .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + .pNext = &dedicated_info, + .allocationSize = properties.allocationSize, + .memoryTypeIndex = static_cast(std::countr_zero(type_bits)), + }); + logical.BindBufferMemory(*window.buffer, *window.memory, 0); + } + } catch (const vk::Exception&) { + windows.clear(); + } +#endif +} + +bool GuestMemory::IsCoherent(MemoryAllocator& memory_allocator, Scheduler& scheduler) const { + const VkDeviceSize probe_offset = window_size - PROBE_SIZE; + u8* const probe = base + (windows.size() - 1) * window_size + probe_offset; + std::array saved; + std::memcpy(saved.data(), probe, PROBE_SIZE); + std::array pattern; + for (size_t index = 0; index < PROBE_WORDS; ++index) { + pattern[index] = static_cast(index + 1) * PROBE_CPU_STRIDE; + } + std::memcpy(probe, pattern.data(), PROBE_SIZE); + + vk::Buffer readback = memory_allocator.CreateBuffer( + VkBufferCreateInfo{ + .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, + .pNext = nullptr, + .flags = 0, + .size = PROBE_SIZE, + .usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT, + .sharingMode = VK_SHARING_MODE_EXCLUSIVE, + .queueFamilyIndexCount = 0, + .pQueueFamilyIndices = nullptr, + }, + MemoryUsage::Download); + scheduler.RequestOutsideRenderPassOperationContext(); + scheduler.Record([src = *windows.back().buffer, dst = *readback, + probe_offset](vk::CommandBuffer cmdbuf) { + static constexpr VkMemoryBarrier2 READ_BEFORE_WRITE{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_READ_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .dstAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + }; + static constexpr VkMemoryBarrier2 WRITE_TO_HOST{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT, + .srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_HOST_BIT, + .dstAccessMask = VK_ACCESS_2_HOST_READ_BIT, + }; + const VkBufferCopy2 copy{ + .sType = VK_STRUCTURE_TYPE_BUFFER_COPY_2, + .pNext = nullptr, + .srcOffset = probe_offset, + .dstOffset = 0, + .size = PROBE_SIZE, + }; + cmdbuf.CopyBuffer(src, dst, copy); + cmdbuf.PipelineBarrier(READ_BEFORE_WRITE); + cmdbuf.FillBuffer(src, probe_offset, PROBE_SIZE, PROBE_GPU_VALUE); + cmdbuf.PipelineBarrier(WRITE_TO_HOST); + }); + scheduler.Finish(); + + const bool gpu_sees_cpu = + std::memcmp(readback.Mapped().data(), pattern.data(), PROBE_SIZE) == 0; + std::array written; + std::memcpy(written.data(), probe, PROBE_SIZE); + const bool cpu_sees_gpu = + std::ranges::all_of(written, [](u32 word) { return word == PROBE_GPU_VALUE; }); + std::memcpy(probe, saved.data(), PROBE_SIZE); + return gpu_sees_cpu && cpu_sees_gpu; +} + +} diff --git a/src/video_core/renderer_vulkan/vk_guest_memory.h b/src/video_core/renderer_vulkan/vk_guest_memory.h new file mode 100644 index 0000000000..10128392e4 --- /dev/null +++ b/src/video_core/renderer_vulkan/vk_guest_memory.h @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include +#include + +#include "common/common_types.h" +#include "video_core/vulkan_common/vulkan_wrapper.h" + +namespace Common { +class HostMemory; +} + +namespace Vulkan { + +class Device; +class MemoryAllocator; +class Scheduler; + +class GuestMemory { +public: + struct Range { + VkBuffer buffer; + VkDeviceSize offset; + }; + + explicit GuestMemory(const Device& device, MemoryAllocator& memory_allocator, + Scheduler& scheduler, const Common::HostMemory& host_memory); + + [[nodiscard]] std::optional Find(const u8* pointer, size_t size) const; + + [[nodiscard]] bool Empty() const noexcept { + return windows.empty(); + } + +private: + struct Window { + vk::DeviceMemory memory; + vk::ExternalBuffer buffer; + }; + + void Import(const Device& device, const Common::HostMemory& host_memory); + + [[nodiscard]] bool IsCoherent(MemoryAllocator& memory_allocator, Scheduler& scheduler) const; + + std::vector windows; + u8* base{}; + size_t window_size{}; +}; + +} diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 30ae972dfc..6bd608c9ea 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -227,6 +227,9 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra accelerate_dma(buffer_cache, texture_cache, scheduler), fence_manager(*this, gpu, texture_cache, buffer_cache, query_cache, device, scheduler) { scheduler.SetQueryCache(query_cache); + if (Settings::values.use_unified_memory.GetValue()) { + texture_cache_runtime.ImportGuestMemory(device_memory.GetHostMemory()); + } } RasterizerVulkan::~RasterizerVulkan() { diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 332dec09c0..55837ba8c0 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -3206,20 +3206,40 @@ void TextureCacheRuntime::AccelerateImageUpload( if (is_rescaled) { image.ScaleDown(true); } + const bool reorder = !is_rescaled && True(image.flags & ImageFlagBits::ReorderableUpload); if (IsPixelFormatASTC(image.info.format)) { - astc_decoder_pass->Assemble(image, map, swizzles); + astc_decoder_pass->Assemble(image, map, swizzles, reorder); } else if (image.info.type == ImageType::e3D) { - bl_unswizzle_3d_pass->Unswizzle(image, map, swizzles); + bl_unswizzle_3d_pass->Unswizzle(image, map, swizzles, reorder); } else if (image.info.type == ImageType::Linear) { - pitch_unswizzle_pass->Unswizzle(image, map, swizzles); + pitch_unswizzle_pass->Unswizzle(image, map, swizzles, reorder); } else { - bl_unswizzle_2d_pass->Unswizzle(image, map, swizzles); + bl_unswizzle_2d_pass->Unswizzle(image, map, swizzles, reorder); } if (is_rescaled) { image.ScaleUp(); } } +void TextureCacheRuntime::ImportGuestMemory(const Common::HostMemory& host_memory) { + guest_memory.emplace(device, memory_allocator, scheduler, host_memory); + if (guest_memory->Empty()) { + guest_memory.reset(); + } +} + +std::optional TextureCacheRuntime::GuestMemorySource(const u8* pointer, + size_t size) const { + if (pointer == nullptr) { + return std::nullopt; + } + const std::optional range = guest_memory->Find(pointer, size); + if (!range || range->offset % device.GetStorageBufferAlignment() != 0) { + return std::nullopt; + } + return StagingBufferRef{.buffer = range->buffer, .offset = range->offset}; +} + void TextureCacheRuntime::TransitionImageLayout(Image& image) { if (image.ExchangeInitialization()) { return; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index ee0295d66a..37b476a489 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -13,6 +13,7 @@ #include "shader_recompiler/shader_info.h" #include "video_core/renderer_vulkan/vk_compute_pass.h" +#include "video_core/renderer_vulkan/vk_guest_memory.h" #include "video_core/renderer_vulkan/vk_render_pass_cache.h" #include "video_core/renderer_vulkan/vk_staging_buffer_pool.h" #include "video_core/texture_cache/image_view_base.h" @@ -93,6 +94,15 @@ public: void AccelerateImageUpload(Image&, const StagingBufferRef&, std::span); + void ImportGuestMemory(const Common::HostMemory& host_memory); + + [[nodiscard]] bool HasGuestMemory() const noexcept { + return guest_memory.has_value(); + } + + [[nodiscard]] std::optional GuestMemorySource(const u8* pointer, + size_t size) const; + void InsertUploadMemoryBarrier() {} void TransitionImageLayout(Image& image); @@ -153,6 +163,7 @@ public: std::optional bl_unswizzle_2d_pass; std::optional bl_unswizzle_3d_pass; std::optional pitch_unswizzle_pass; + std::optional guest_memory; const Settings::ResolutionScalingInfo& resolution; std::array, VideoCore::Surface::MaxPixelFormat> view_formats; std::bitset host_copy_formats; diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index c199b5953c..5975ae13a7 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1033,6 +1033,24 @@ void TextureCache

::RefreshContents(Image& image, ImageId image_id) { QueueAsyncDecode(image, image_id); return; } + if constexpr (requires { runtime.GuestMemorySource(nullptr, size_t{}); }) { + if (True(image.flags & ImageFlagBits::AcceleratedUpload) && runtime.HasGuestMemory() && + gpu_memory->IsContinuousRange(image.gpu_addr, image.guest_size_bytes)) { + const std::optional device_addr = gpu_memory->GpuToCpuAddress(image.gpu_addr); + if (device_addr) { + const auto source = runtime.GuestMemorySource( + device_memory.GetSpan(*device_addr, image.guest_size_bytes), + image.guest_size_bytes); + if (source) { + gpu_memory->FlushRegion(image.gpu_addr, image.guest_size_bytes, + VideoCommon::CacheType::NoTextureCache); + runtime.AccelerateImageUpload( + image, *source, FixSmallVectorADL(FullUploadSwizzles(image.info))); + return; + } + } + } + } if constexpr (requires { image.UploadHostMemory(unswizzle_data_buffer, {}); }) { if (True(image.flags & ImageFlagBits::ReorderableUpload) && image.CanUploadHostMemory()) { Tegra::Memory::GpuGuestMemory diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index cd5e5a8412..12d7cfbba8 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -934,6 +934,15 @@ bool Device::GetSuitability(bool requires_swapchain) { FOR_EACH_VK_FEATURE_EXT(FEATURE_EXTENSION); FOR_EACH_VK_EXTENSION(EXTENSION); +#ifdef __ANDROID__ + if (supported_extensions.contains( + VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME) && + supported_extensions.contains(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME)) { + loaded_extensions.insert(VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME); + loaded_extensions.insert(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME); + has_ahb_import = true; + } +#endif extensions.depth_stencil_resolve = extensions.depth_stencil_resolve && diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 63a2e5b7fa..ab96421c3a 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -993,6 +993,10 @@ FN_MAX_LIMIT_LIST return extensions.host_image_copy; } + bool IsAhbImportSupported() const { + return has_ahb_import; + } + bool HasNullDescriptor() const { return features.robustness2.nullDescriptor; } @@ -1208,6 +1212,7 @@ private: bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. bool is_integrated{}; ///< Is GPU an iGPU. bool is_uma{}; + bool has_ahb_import{}; bool has_broken_compute{}; ///< Compute shaders can cause crashes bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit bool has_broken_float16_math{}; diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 01a65f95f5..1d728e9113 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -85,6 +85,12 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkAcquireNextImageKHR); X(vkAllocateCommandBuffers); X(vkAllocateDescriptorSets); + X(vkAllocateMemory); + X(vkBindBufferMemory); + X(vkFreeMemory); +#ifdef __ANDROID__ + X(vkGetAndroidHardwareBufferPropertiesANDROID); +#endif X(vkBeginCommandBuffer); X(vkCmdBeginConditionalRenderingEXT); X(vkCmdBeginQuery); @@ -337,6 +343,10 @@ void Destroy(VkDevice device, VkBuffer handle, const DeviceDispatch& dld) noexce dld.vkDestroyBuffer(device, handle, nullptr); } +void Destroy(VkDevice device, VkDeviceMemory handle, const DeviceDispatch& dld) noexcept { + dld.vkFreeMemory(device, handle, nullptr); +} + void Destroy(VkDevice device, VkBufferView handle, const DeviceDispatch& dld) noexcept { dld.vkDestroyBufferView(device, handle, nullptr); } @@ -616,6 +626,51 @@ BufferView Device::CreateBufferView(const VkBufferViewCreateInfo& ci) const { return BufferView(object, handle, *dld); } +ExternalBuffer Device::CreateExternalBuffer(const VkBufferCreateInfo& ci) const { + VkBuffer object; + Check(dld->vkCreateBuffer(handle, &ci, nullptr, &object)); + return ExternalBuffer(object, handle, *dld); +} + +DeviceMemory Device::AllocateMemory(const VkMemoryAllocateInfo& ai) const { + VkDeviceMemory object; + Check(dld->vkAllocateMemory(handle, &ai, nullptr, &object)); + return DeviceMemory(object, handle, *dld); +} + +void Device::BindBufferMemory(VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize offset) const { + Check(dld->vkBindBufferMemory(handle, buffer, memory, offset)); +} + +VkMemoryRequirements Device::GetBufferMemoryRequirements(VkBuffer buffer) const noexcept { + const VkBufferMemoryRequirementsInfo2 info{ + .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, + .pNext = nullptr, + .buffer = buffer, + }; + VkMemoryRequirements2 requirements{ + .sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, + .pNext = nullptr, + .memoryRequirements = {}, + }; + dld->vkGetBufferMemoryRequirements2(handle, &info, &requirements); + return requirements.memoryRequirements; +} + +#ifdef __ANDROID__ +VkAndroidHardwareBufferPropertiesANDROID Device::GetAndroidHardwareBufferProperties( + const AHardwareBuffer* buffer) const { + VkAndroidHardwareBufferPropertiesANDROID properties{ + .sType = VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, + .pNext = nullptr, + .allocationSize = 0, + .memoryTypeBits = 0, + }; + Check(dld->vkGetAndroidHardwareBufferPropertiesANDROID(handle, buffer, &properties)); + return properties; +} +#endif + ImageView Device::CreateImageView(const VkImageViewCreateInfo& ci) const { VkImageView object; Check(dld->vkCreateImageView(handle, &ci, nullptr, &object)); diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index c896a22bad..e0bb7585ac 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -234,6 +234,12 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR{}; PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers{}; PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets{}; + PFN_vkAllocateMemory vkAllocateMemory{}; + PFN_vkBindBufferMemory vkBindBufferMemory{}; + PFN_vkFreeMemory vkFreeMemory{}; +#ifdef __ANDROID__ + PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID{}; +#endif PFN_vkBeginCommandBuffer vkBeginCommandBuffer{}; PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT{}; PFN_vkCmdBeginQuery vkCmdBeginQuery{}; @@ -387,6 +393,7 @@ void Destroy(VkDevice, const InstanceDispatch&) noexcept; void Destroy(VkDevice, VkBuffer, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkBufferView, const DeviceDispatch&) noexcept; +void Destroy(VkDevice, VkDeviceMemory, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkCommandPool, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorPool, const DeviceDispatch&) noexcept; void Destroy(VkDevice, VkDescriptorSetLayout, const DeviceDispatch&) noexcept; @@ -646,6 +653,8 @@ using Pipeline = Handle; using PipelineLayout = Handle; using QueryPool = Handle; using Sampler = Handle; +using DeviceMemory = Handle; +using ExternalBuffer = Handle; using SurfaceKHR = Handle; using DescriptorSets = PoolAllocations; @@ -1000,6 +1009,19 @@ public: [[nodiscard]] BufferView CreateBufferView(const VkBufferViewCreateInfo& ci) const; + [[nodiscard]] ExternalBuffer CreateExternalBuffer(const VkBufferCreateInfo& ci) const; + + [[nodiscard]] DeviceMemory AllocateMemory(const VkMemoryAllocateInfo& ai) const; + + void BindBufferMemory(VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize offset) const; + + [[nodiscard]] VkMemoryRequirements GetBufferMemoryRequirements(VkBuffer buffer) const noexcept; + +#ifdef __ANDROID__ + [[nodiscard]] VkAndroidHardwareBufferPropertiesANDROID GetAndroidHardwareBufferProperties( + const AHardwareBuffer* buffer) const; +#endif + [[nodiscard]] ImageView CreateImageView(const VkImageViewCreateInfo& ci) const; [[nodiscard]] Semaphore CreateSemaphore() const; From 73cac64037e8c56591c648e7bd68f25db6908762 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 16:26:33 -0400 Subject: [PATCH 154/198] Port UMA part 5.2 --- src/common/heap_tracker.cpp | 50 +-- src/common/heap_tracker.h | 6 - src/common/host_memory.cpp | 347 +----------------- src/common/host_memory.h | 17 +- src/common/memory_detect.cpp | 64 ---- src/common/memory_detect.h | 7 - src/core/core.cpp | 5 +- src/core/device_memory.cpp | 17 +- .../renderer_vulkan/vk_guest_memory.cpp | 75 +--- .../renderer_vulkan/vk_guest_memory.h | 2 - .../vulkan_common/vulkan_device.cpp | 9 - src/video_core/vulkan_common/vulkan_device.h | 5 - .../vulkan_common/vulkan_wrapper.cpp | 17 - src/video_core/vulkan_common/vulkan_wrapper.h | 8 - 14 files changed, 40 insertions(+), 589 deletions(-) diff --git a/src/common/heap_tracker.cpp b/src/common/heap_tracker.cpp index 1fa1514da7..b72abb16d8 100644 --- a/src/common/heap_tracker.cpp +++ b/src/common/heap_tracker.cpp @@ -4,17 +4,34 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include "common/heap_tracker.h" #include "common/logging.h" -#include "common/memory_detect.h" #include "common/assert.h" namespace Common { +namespace { + +s64 GetMaxPermissibleResidentMapCount() { + // Default value. + s64 value = 65530; + + // Try to read how many mappings we can make. + std::ifstream s("/proc/sys/vm/max_map_count"); + s >> value; + + // Print, for debug. + LOG_INFO(HW_Memory, "Current maximum map count: {}", value); + + // Allow 20000 maps for other code and to account for split inaccuracy. + return std::max(value - 20000, 0); +} + +} // namespace + HeapTracker::HeapTracker(Common::HostMemory& buffer) - : m_buffer(buffer), - m_has_hardware_buffer_backing(!buffer.BackingHardwareBuffers().empty()), - m_max_resident_map_count(static_cast(GetPermissibleMapCount())) {} + : m_buffer(buffer), m_max_resident_map_count(GetMaxPermissibleResidentMapCount()) {} HeapTracker::~HeapTracker() = default; void HeapTracker::Map(size_t virtual_offset, size_t host_offset, size_t length, @@ -68,8 +85,7 @@ void HeapTracker::Unmap(size_t virtual_offset, size_t size, bool is_separate_hea // If resident, erase from resident map. if (item->is_resident) { - m_resident_map_count -= this->HostMapCount(item->paddr, item->size); - ASSERT(m_resident_map_count >= 0); + ASSERT(--m_resident_map_count >= 0); m_resident_mappings.erase(m_resident_mappings.iterator_to(*item)); } @@ -175,7 +191,7 @@ bool HeapTracker::DeferredMapSeparateHeap(size_t virtual_offset) { // This map is now resident. it->is_resident = true; - m_resident_map_count += this->HostMapCount(it->paddr, it->size); + m_resident_map_count++; m_resident_mappings.insert(*it); } @@ -197,17 +213,17 @@ void HeapTracker::RebuildSeparateHeapAddressSpace() { // Despite being worse in theory, this has proven to be better in practice than more // regularly dumping a smaller amount, because it significantly reduces average case // lock contention. - s64 const desired_count = (std::min)(m_resident_map_count, m_max_resident_map_count) / 2; + std::size_t const desired_count = (std::min)(m_resident_map_count, m_max_resident_map_count) / 2; + std::size_t const evict_count = m_resident_map_count - desired_count; auto it = m_resident_mappings.begin(); - while (m_resident_map_count > desired_count && it != m_resident_mappings.end()) { + for (size_t i = 0; i < evict_count && it != m_resident_mappings.end(); i++) { // Unmark and unmap. it->is_resident = false; m_buffer.Unmap(it->vaddr, it->size, false); // Advance. - m_resident_map_count -= this->HostMapCount(it->paddr, it->size); - ASSERT(m_resident_map_count >= 0); + ASSERT(--m_resident_map_count >= 0); it = m_resident_mappings.erase(it); } } @@ -229,7 +245,6 @@ void HeapTracker::SplitHeapMapLocked(VAddr offset) { // Cache the original values. auto* const left = std::addressof(*it); const size_t orig_size = left->size; - const s64 orig_host_map_count = this->HostMapCount(left->paddr, orig_size); // Adjust the left map. const size_t left_size = offset - left->vaddr; @@ -251,20 +266,11 @@ void HeapTracker::SplitHeapMapLocked(VAddr offset) { // If resident, also insert into resident map. if (right->is_resident) { - m_resident_map_count += this->HostMapCount(left->paddr, left->size) + - this->HostMapCount(right->paddr, right->size) - - orig_host_map_count; + m_resident_map_count++; m_resident_mappings.insert(*right); } } -s64 HeapTracker::HostMapCount(PAddr paddr, size_t size) const { - if (!m_has_hardware_buffer_backing) { - return static_cast(size != 0); - } - return static_cast(m_buffer.BackingMapCount(paddr, size)); -} - HeapTracker::AddrTree::iterator HeapTracker::GetNearestHeapMapLocked(VAddr offset) { const SeparateHeapMap key{ .vaddr = offset, diff --git a/src/common/heap_tracker.h b/src/common/heap_tracker.h index 8be66a1d4d..ee5b0bf43a 100644 --- a/src/common/heap_tracker.h +++ b/src/common/heap_tracker.h @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -85,13 +82,10 @@ private: AddrTree::iterator GetNearestHeapMapLocked(VAddr offset); - s64 HostMapCount(PAddr paddr, size_t size) const; - void RebuildSeparateHeapAddressSpace(); private: Common::HostMemory& m_buffer; - const bool m_has_hardware_buffer_backing; const s64 m_max_resident_map_count; std::shared_mutex m_rebuild_lock{}; diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 65e73eb5a2..dd0780a283 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -53,42 +53,12 @@ #include #include -#include #include "common/alignment.h" #include "common/assert.h" #include "common/free_region_manager.h" #include "common/host_memory.h" #include "common/logging.h" -#include "common/memory_detect.h" -#include "common/settings.h" - -#ifdef __ANDROID__ -#include -#include - -namespace { - -struct NativeHandle { - int version; - int numFds; - int numInts; - int data[1]; -}; - -using PFN_AHardwareBuffer_getNativeHandle = const NativeHandle* (*)(const AHardwareBuffer*); - -PFN_AHardwareBuffer_getNativeHandle ResolveGetNativeHandle() { - void* const lib = dlopen("libnativewindow.so", RTLD_NOW); - if (lib == nullptr) { - return nullptr; - } - return reinterpret_cast( - dlsym(lib, "AHardwareBuffer_getNativeHandle")); -} - -} -#endif #if defined(__ANDROID__) && __ANDROID_API__ < 30 #include @@ -152,7 +122,7 @@ static void GetFuncAddress(Common::DynamicLibrary& dll, const char* name, T& pfn class HostMemory::Impl { public: - explicit Impl(size_t backing_size_, size_t virtual_size_, size_t) + explicit Impl(size_t backing_size_, size_t virtual_size_) : backing_size{backing_size_} , virtual_size{virtual_size_} , process{GetCurrentProcess()} @@ -530,10 +500,9 @@ static int shm_open_anon(int flags, mode_t mode) { class HostMemory::Impl { public: - explicit Impl(size_t backing_size_, size_t virtual_size_, size_t preferred_offset_) + explicit Impl(size_t backing_size_, size_t virtual_size_) : backing_size{backing_size_} , virtual_size{virtual_size_} - , preferred_offset{preferred_offset_} {} bool Init() { @@ -573,15 +542,10 @@ public: LOG_WARNING(Common_Memory, "Using private mappings instead of shared ones"); backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)); if (fd > 0) { + fd = -1; close(fd); } - fd = -1; } else { -#ifdef __ANDROID__ - if (InitAhbBacking()) { - return InitVirtual(); - } -#endif backing_base = static_cast(mmap(nullptr, backing_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); } if (backing_base == MAP_FAILED) { @@ -589,10 +553,7 @@ public: return false; } - return InitVirtual(); - } - - bool InitVirtual() { + // Virtual memory initialization virtual_base = virtual_map_base = static_cast(ChooseVirtualBase(virtual_size)); if (virtual_base == MAP_FAILED) { LOG_CRITICAL(HW_Memory, "mmap failed: {}", strerror(errno)); @@ -605,240 +566,6 @@ public: return true; } -#ifdef __ANDROID__ - static AHardwareBuffer_Desc MakeBlobDesc(size_t len) { - return AHardwareBuffer_Desc{ - .width = static_cast(len), - .height = 1, - .layers = 1, - .format = AHARDWAREBUFFER_FORMAT_BLOB, - .usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN | - AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN | - AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER, - .stride = 0, - .rfu0 = 0, - .rfu1 = 0, - }; - } - - static bool ProbeAhbBacking(PFN_AHardwareBuffer_getNativeHandle get_native_handle) { - const AHardwareBuffer_Desc desc = MakeBlobDesc(PageAlignment * 2); - AHardwareBuffer* buffer{}; - if (AHardwareBuffer_allocate(&desc, &buffer) != 0 || buffer == nullptr) { - return false; - } - const NativeHandle* const handle = get_native_handle(buffer); - if (handle == nullptr || handle->numFds < 1) { - AHardwareBuffer_release(buffer); - return false; - } - const int probe_fd = handle->data[0]; - bool ok = true; - const auto try_map = [&](int prot, off_t offset) { - if (!ok) { - return; - } - void* const ptr = mmap(nullptr, PageAlignment, prot, MAP_SHARED, probe_fd, offset); - if (ptr == MAP_FAILED) { - ok = false; - return; - } - munmap(ptr, PageAlignment); - }; - try_map(PROT_READ | PROT_WRITE, 0); - try_map(PROT_READ | PROT_WRITE, static_cast(PageAlignment)); -#ifdef ARCHITECTURE_arm64 - try_map(PROT_READ | PROT_EXEC, 0); -#endif - AHardwareBuffer_release(buffer); - return ok; - } - - size_t ComputeAhbBudget(size_t window_size) const { - const u64 total_physical = Common::GetMemInfo().TotalPhysicalMemory; - constexpr u64 BaselineFootprint = 6ULL << 30; - if (total_physical <= BaselineFootprint) { - return 0; - } - const u64 permissible_maps = Common::GetPermissibleMapCount(); - if (permissible_maps == 0) { - return 0; - } - u64 budget = (total_physical - BaselineFootprint) / 2; - constexpr u64 MapSlotsPerWindow = 64; - const u64 affordable_windows = permissible_maps / MapSlotsPerWindow; - budget = (std::min)(budget, affordable_windows * window_size); - const u64 available = Common::GetAvailablePhysicalMemory(); - if (available != 0) { - budget = (std::min)(budget, available / 2); - } - budget = (std::min)(budget, static_cast(backing_size)); - budget = Common::AlignDown(budget, window_size); - constexpr u64 MinimumBudget = 256ULL << 20; - if (budget < MinimumBudget) { - return 0; - } - return static_cast(budget); - } - - bool InitAhbBacking() { - if (!Settings::values.use_unified_memory.GetValue()) { - return false; - } - static const PFN_AHardwareBuffer_getNativeHandle get_native_handle = - ResolveGetNativeHandle(); - if (get_native_handle == nullptr) { - return false; - } - constexpr size_t window_size = 256ULL << 20; - const size_t budget = ComputeAhbBudget(window_size); - if (budget == 0) { - return false; - } - if (!ProbeAhbBacking(get_native_handle)) { - return false; - } - const size_t aligned_backing = Common::AlignDown(backing_size, window_size); - const size_t max_windows = (std::min)(budget, aligned_backing) / window_size; - - std::vector buffers; - std::vector buffer_fds; - const auto cleanup = [&] { - for (AHardwareBuffer* buffer : buffers) { - AHardwareBuffer_release(buffer); - } - buffers.clear(); - buffer_fds.clear(); - }; - for (size_t i = 0; i < max_windows; ++i) { - const AHardwareBuffer_Desc desc = MakeBlobDesc(window_size); - AHardwareBuffer* buffer{}; - if (AHardwareBuffer_allocate(&desc, &buffer) != 0 || buffer == nullptr) { - break; - } - const NativeHandle* const handle = get_native_handle(buffer); - if (handle == nullptr || handle->numFds < 1) { - AHardwareBuffer_release(buffer); - break; - } - const int buffer_fd = handle->data[0]; - const off_t buffer_len = lseek(buffer_fd, 0, SEEK_END); - if (buffer_len < static_cast(window_size)) { - AHardwareBuffer_release(buffer); - break; - } - buffers.push_back(buffer); - buffer_fds.push_back(buffer_fd); - } - const size_t num_windows = buffers.size(); - if (num_windows == 0) { - return false; - } - const size_t region_size = num_windows * window_size; - const size_t region_base = Common::AlignDown( - (std::min)(preferred_offset, aligned_backing - region_size), window_size); - u8* const base = static_cast(mmap(nullptr, backing_size, PROT_NONE, - MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0)); - if (base == MAP_FAILED) { - cleanup(); - return false; - } - const auto map_over_reservation = [&](size_t offset, size_t len, int map_fd, - off_t map_offset) { - if (len == 0) { - return true; - } - if (mmap(base + offset, len, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, map_fd, - map_offset) == MAP_FAILED) { - munmap(base, backing_size); - cleanup(); - return false; - } - return true; - }; - if (!map_over_reservation(0, region_base, fd, 0)) { - return false; - } - for (size_t i = 0; i < num_windows; ++i) { - if (!map_over_reservation(region_base + i * window_size, window_size, buffer_fds[i], - 0)) { - return false; - } - } - const size_t tail_offset = region_base + region_size; - if (!map_over_reservation(tail_offset, backing_size - tail_offset, fd, - static_cast(tail_offset))) { - return false; - } - backing_base = base; - ahb_windows = std::move(buffers); - ahb_fds = std::move(buffer_fds); - ahb_window_size = window_size; - ahb_base = region_base; - ahb_bytes = region_size; - return true; - } - - void MapBackingRange(size_t virtual_offset, size_t host_offset, size_t length, int prot_flags) { - while (length > 0) { - int map_fd = fd; - off_t map_offset = static_cast(host_offset); - size_t chunk = length; - if (host_offset < ahb_base) { - chunk = (std::min)(chunk, ahb_base - host_offset); - } else if (host_offset < ahb_base + ahb_bytes) { - const size_t relative = host_offset - ahb_base; - const size_t window = relative / ahb_window_size; - const size_t local = relative % ahb_window_size; - map_fd = ahb_fds[window]; - map_offset = static_cast(local); - chunk = (std::min)(chunk, ahb_window_size - local); - } - void* const ret = mmap(virtual_base + virtual_offset, chunk, prot_flags, - MAP_SHARED | MAP_FIXED, map_fd, map_offset); - ASSERT_MSG(ret != MAP_FAILED, "mmap: {}", strerror(errno)); - virtual_offset += chunk; - host_offset += chunk; - length -= chunk; - } - } - - size_t BackingMapCount(size_t host_offset, size_t length) const noexcept { - if (length == 0) { - return 0; - } - if (ahb_bytes == 0) { - return 1; - } - size_t count = 0; - while (length > 0) { - size_t chunk = length; - if (host_offset < ahb_base) { - chunk = (std::min)(chunk, ahb_base - host_offset); - } else if (host_offset < ahb_base + ahb_bytes) { - const size_t local = (host_offset - ahb_base) % ahb_window_size; - chunk = (std::min)(chunk, ahb_window_size - local); - } - host_offset += chunk; - length -= chunk; - ++count; - } - return count; - } - - std::span AhbWindows() const noexcept { - return ahb_windows; - } - - size_t AhbWindowSize() const noexcept { - return ahb_window_size; - } - - size_t AhbBase() const noexcept { - return ahb_base; - } -#endif - ~Impl() { Release(); } @@ -859,12 +586,6 @@ public: #ifdef ARCHITECTURE_arm64 if (True(perms & MemoryPermission::Execute)) prot_flags |= PROT_EXEC; -#endif -#ifdef __ANDROID__ - if (ahb_bytes != 0) { - MapBackingRange(virtual_offset, host_offset, length, prot_flags); - return; - } #endif int flags = (fd >= 0 ? MAP_SHARED : MAP_PRIVATE) | MAP_FIXED; void* ret = mmap(virtual_base + virtual_offset, length, prot_flags, flags, fd, host_offset); @@ -912,7 +633,6 @@ public: const size_t backing_size; ///< Size of the backing memory in bytes const size_t virtual_size; ///< Size of the virtual address placeholder in bytes - const size_t preferred_offset; u8* backing_base{reinterpret_cast(MAP_FAILED)}; u8* virtual_base{reinterpret_cast(MAP_FAILED)}; @@ -935,15 +655,6 @@ private: int ret = close(fd); ASSERT_MSG(ret == 0, "close failed: {}", strerror(errno)); } - -#ifdef __ANDROID__ - for (AHardwareBuffer* buffer : ahb_windows) { - AHardwareBuffer_release(buffer); - } - ahb_windows.clear(); - ahb_fds.clear(); - ahb_bytes = 0; -#endif } void AdjustMap(size_t* virtual_offset, size_t* length) { @@ -969,19 +680,11 @@ private: int fd{-1}; // memfd file descriptor, -1 is the error value of memfd_create FreeRegionManager free_manager{}; - -#ifdef __ANDROID__ - std::vector ahb_windows; - std::vector ahb_fds; - size_t ahb_window_size{}; - size_t ahb_base{}; - size_t ahb_bytes{}; -#endif }; #endif // ^^^ POSIX ^^^ -HostMemory::HostMemory(size_t backing_size_, size_t virtual_size_, size_t preferred_offset_) +HostMemory::HostMemory(size_t backing_size_, size_t virtual_size_) : backing_size(backing_size_) , virtual_size(virtual_size_) { @@ -993,9 +696,7 @@ HostMemory::HostMemory(size_t backing_size_, size_t virtual_size_, size_t prefer #else // Try to allocate a fastmem arena. // The implementation will fail with std::bad_alloc on errors. - impl = std::make_unique(AlignUp(backing_size, PageAlignment), - AlignUp(virtual_size, PageAlignment) + HugePageSize, - preferred_offset_); + impl = std::make_unique(AlignUp(backing_size, PageAlignment), AlignUp(virtual_size, PageAlignment) + HugePageSize); if (impl->Init()) { backing_base = impl->backing_base; virtual_base = impl->virtual_base; @@ -1065,42 +766,6 @@ void HostMemory::ClearBackingRegion(size_t physical_offset, size_t length, u32 f std::memset(backing_base + physical_offset, fill_value, length); } -std::span HostMemory::BackingHardwareBuffers() const noexcept { -#ifdef __ANDROID__ - if (impl) { - return impl->AhbWindows(); - } -#endif - return {}; -} - -size_t HostMemory::BackingMapCount(size_t host_offset, size_t length) const noexcept { -#ifdef __ANDROID__ - if (impl) { - return impl->BackingMapCount(host_offset, length); - } -#endif - return static_cast(length != 0); -} - -size_t HostMemory::BackingHardwareBufferWindowSize() const noexcept { -#ifdef __ANDROID__ - if (impl) { - return impl->AhbWindowSize(); - } -#endif - return 0; -} - -size_t HostMemory::BackingHardwareBufferBase() const noexcept { -#ifdef __ANDROID__ - if (impl) { - return impl->AhbBase(); - } -#endif - return 0; -} - void HostMemory::EnableDirectMappedAddress() { #if !(defined(__OPENORBIS__) || defined(__managarm__)) if (impl) { diff --git a/src/common/host_memory.h b/src/common/host_memory.h index 3299680580..24f4670732 100644 --- a/src/common/host_memory.h +++ b/src/common/host_memory.h @@ -8,13 +8,10 @@ #include #include -#include #include "common/common_funcs.h" #include "common/common_types.h" #include "common/virtual_buffer.h" -struct AHardwareBuffer; - namespace Common { enum class MemoryPermission : u32 { @@ -31,7 +28,7 @@ DECLARE_ENUM_FLAG_OPERATORS(MemoryPermission) */ class HostMemory { public: - explicit HostMemory(size_t backing_size_, size_t virtual_size_, size_t preferred_offset_ = 0); + explicit HostMemory(size_t backing_size_, size_t virtual_size_); ~HostMemory(); /** @@ -65,18 +62,6 @@ public: return backing_base; } - [[nodiscard]] size_t BackingSize() const noexcept { - return backing_size; - } - - [[nodiscard]] size_t BackingMapCount(size_t host_offset, size_t length) const noexcept; - - [[nodiscard]] std::span BackingHardwareBuffers() const noexcept; - - [[nodiscard]] size_t BackingHardwareBufferWindowSize() const noexcept; - - [[nodiscard]] size_t BackingHardwareBufferBase() const noexcept; - [[nodiscard]] u8* VirtualBasePointer() noexcept { return virtual_base; } diff --git a/src/common/memory_detect.cpp b/src/common/memory_detect.cpp index ae303a4f1a..86a3abcc6d 100644 --- a/src/common/memory_detect.cpp +++ b/src/common/memory_detect.cpp @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -20,10 +17,6 @@ #endif #endif -#include -#include -#include - #include "common/memory_detect.h" namespace Common { @@ -76,61 +69,4 @@ const MemoryInfo& GetMemInfo() { return mem_info; } -u64 GetPermissibleMapCount() { - constexpr u64 DefaultMapCount = 65530; - constexpr u64 ReservedMaps = 20000; - u64 count = DefaultMapCount; -#ifdef __linux__ - if (std::FILE* const file = std::fopen("/proc/sys/vm/max_map_count", "re")) { - char line[32]; - if (std::fgets(line, sizeof(line), file) != nullptr) { - const u64 parsed = std::strtoull(line, nullptr, 10); - if (parsed != 0) { - count = parsed; - } - } - std::fclose(file); - } -#endif - if (count <= ReservedMaps) { - return 0; - } - return count - ReservedMaps; -} - -u64 GetAvailablePhysicalMemory() { -#ifdef _WIN32 - MEMORYSTATUSEX memorystatus; - memorystatus.dwLength = sizeof(memorystatus); - if (GlobalMemoryStatusEx(&memorystatus) == 0) { - return 0; - } - return memorystatus.ullAvailPhys; -#elif defined(__linux__) - static constexpr char AvailableKey[] = "MemAvailable:"; - if (std::FILE* const file = std::fopen("/proc/meminfo", "re")) { - char line[256]; - u64 available = 0; - while (std::fgets(line, sizeof(line), file) != nullptr) { - if (std::strncmp(line, AvailableKey, sizeof(AvailableKey) - 1) != 0) { - continue; - } - available = std::strtoull(line + sizeof(AvailableKey) - 1, nullptr, 10) * 1024; - break; - } - std::fclose(file); - if (available != 0) { - return available; - } - } - struct sysinfo meminfo; - if (sysinfo(&meminfo) != 0) { - return 0; - } - return static_cast(meminfo.freeram) * static_cast(meminfo.mem_unit); -#else - return 0; -#endif -} - } // namespace Common diff --git a/src/common/memory_detect.h b/src/common/memory_detect.h index 367e3f754d..c8f239aed3 100644 --- a/src/common/memory_detect.h +++ b/src/common/memory_detect.h @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -21,8 +18,4 @@ struct MemoryInfo { */ [[nodiscard]] const MemoryInfo& GetMemInfo(); -[[nodiscard]] u64 GetPermissibleMapCount(); - -[[nodiscard]] u64 GetAvailablePhysicalMemory(); - } // namespace Common diff --git a/src/core/core.cpp b/src/core/core.cpp index 10d1c336c4..046ee53346 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -120,7 +120,6 @@ struct System::Impl { is_multicore = Settings::values.use_multi_core.GetValue(); extended_memory_layout = Settings::values.memory_layout_mode.GetValue() != Settings::MemoryLayout::Memory_4Gb; - unified_memory = Settings::values.use_unified_memory.GetValue(); core_timing.SetMulticore(is_multicore); core_timing.Initialize([&system]() { system.RegisterHostThread(); }); @@ -148,8 +147,7 @@ struct System::Impl { !device_memory.has_value() || is_multicore != Settings::values.use_multi_core.GetValue() || extended_memory_layout != (Settings::values.memory_layout_mode.GetValue() != - Settings::MemoryLayout::Memory_4Gb) || - unified_memory != Settings::values.use_unified_memory.GetValue(); + Settings::MemoryLayout::Memory_4Gb); if (!must_reinitialize) { return; @@ -537,7 +535,6 @@ struct System::Impl { std::atomic_bool is_powered_on{}; bool is_multicore : 1 = false; bool extended_memory_layout : 1 = false; - bool unified_memory : 1 = false; bool exit_locked : 1 = false; bool exit_requested : 1 = false; diff --git a/src/core/device_memory.cpp b/src/core/device_memory.cpp index 8d56f86be9..1aea56a991 100644 --- a/src/core/device_memory.cpp +++ b/src/core/device_memory.cpp @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,21 +12,9 @@ constexpr size_t VirtualReserveSize = 1ULL << 38; constexpr size_t VirtualReserveSize = 1ULL << 39; #endif -namespace { -size_t ApplicationPoolOffset() { - using Init = Kernel::Board::Nintendo::Nx::KSystemControl::Init; - const size_t dram_size = Init::GetIntendedMemorySize(); - const size_t application_pool_size = Init::GetApplicationPoolSize(); - if (dram_size <= application_pool_size) { - return 0; - } - return dram_size - application_pool_size; -} -} - DeviceMemory::DeviceMemory() : buffer{Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize(), - VirtualReserveSize, ApplicationPoolOffset()} {} + VirtualReserveSize} {} DeviceMemory::~DeviceMemory() = default; diff --git a/src/video_core/renderer_vulkan/vk_guest_memory.cpp b/src/video_core/renderer_vulkan/vk_guest_memory.cpp index 7d0d28852d..9b2fd20694 100644 --- a/src/video_core/renderer_vulkan/vk_guest_memory.cpp +++ b/src/video_core/renderer_vulkan/vk_guest_memory.cpp @@ -3,14 +3,10 @@ #include #include -#include #include -#include -#include "common/host_memory.h" #include "video_core/renderer_vulkan/vk_guest_memory.h" #include "video_core/renderer_vulkan/vk_scheduler.h" -#include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_memory_allocator.h" namespace Vulkan { @@ -21,9 +17,9 @@ constexpr u32 PROBE_CPU_STRIDE = 0x9E3779B9U; constexpr u32 PROBE_GPU_VALUE = 0x5AC3E10FU; } -GuestMemory::GuestMemory(const Device& device, MemoryAllocator& memory_allocator, - Scheduler& scheduler, const Common::HostMemory& host_memory) { - Import(device, host_memory); +GuestMemory::GuestMemory([[maybe_unused]] const Device& device, + MemoryAllocator& memory_allocator, Scheduler& scheduler, + [[maybe_unused]] const Common::HostMemory& host_memory) { if (!windows.empty() && !IsCoherent(memory_allocator, scheduler)) { windows.clear(); } @@ -42,71 +38,6 @@ std::optional GuestMemory::Find(const u8* pointer, size_t si return Range{*windows[index].buffer, local_offset}; } -void GuestMemory::Import([[maybe_unused]] const Device& device, - [[maybe_unused]] const Common::HostMemory& host_memory) { -#ifdef __ANDROID__ - const std::span hardware_buffers = - host_memory.BackingHardwareBuffers(); - window_size = host_memory.BackingHardwareBufferWindowSize(); - if (hardware_buffers.empty() || window_size == 0 || !device.IsAhbImportSupported()) { - return; - } - base = const_cast(host_memory.BackingBasePointer()) + - host_memory.BackingHardwareBufferBase(); - const vk::Device& logical = device.GetLogical(); - try { - for (AHardwareBuffer* const hardware_buffer : hardware_buffers) { - const VkAndroidHardwareBufferPropertiesANDROID properties = - logical.GetAndroidHardwareBufferProperties(hardware_buffer); - const VkExternalMemoryBufferCreateInfo external_info{ - .sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO, - .pNext = nullptr, - .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID, - }; - Window& window = windows.emplace_back(); - window.buffer = logical.CreateExternalBuffer(VkBufferCreateInfo{ - .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, - .pNext = &external_info, - .flags = 0, - .size = window_size, - .usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT, - .sharingMode = VK_SHARING_MODE_EXCLUSIVE, - .queueFamilyIndexCount = 0, - .pQueueFamilyIndices = nullptr, - }); - const u32 type_bits = - logical.GetBufferMemoryRequirements(*window.buffer).memoryTypeBits & - properties.memoryTypeBits; - if (type_bits == 0) { - windows.clear(); - return; - } - const VkImportAndroidHardwareBufferInfoANDROID import_info{ - .sType = VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID, - .pNext = nullptr, - .buffer = hardware_buffer, - }; - const VkMemoryDedicatedAllocateInfo dedicated_info{ - .sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, - .pNext = &import_info, - .image = VK_NULL_HANDLE, - .buffer = *window.buffer, - }; - window.memory = logical.AllocateMemory(VkMemoryAllocateInfo{ - .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, - .pNext = &dedicated_info, - .allocationSize = properties.allocationSize, - .memoryTypeIndex = static_cast(std::countr_zero(type_bits)), - }); - logical.BindBufferMemory(*window.buffer, *window.memory, 0); - } - } catch (const vk::Exception&) { - windows.clear(); - } -#endif -} - bool GuestMemory::IsCoherent(MemoryAllocator& memory_allocator, Scheduler& scheduler) const { const VkDeviceSize probe_offset = window_size - PROBE_SIZE; u8* const probe = base + (windows.size() - 1) * window_size + probe_offset; diff --git a/src/video_core/renderer_vulkan/vk_guest_memory.h b/src/video_core/renderer_vulkan/vk_guest_memory.h index 10128392e4..ae206109ad 100644 --- a/src/video_core/renderer_vulkan/vk_guest_memory.h +++ b/src/video_core/renderer_vulkan/vk_guest_memory.h @@ -41,8 +41,6 @@ private: vk::ExternalBuffer buffer; }; - void Import(const Device& device, const Common::HostMemory& host_memory); - [[nodiscard]] bool IsCoherent(MemoryAllocator& memory_allocator, Scheduler& scheduler) const; std::vector windows; diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 12d7cfbba8..cd5e5a8412 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -934,15 +934,6 @@ bool Device::GetSuitability(bool requires_swapchain) { FOR_EACH_VK_FEATURE_EXT(FEATURE_EXTENSION); FOR_EACH_VK_EXTENSION(EXTENSION); -#ifdef __ANDROID__ - if (supported_extensions.contains( - VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME) && - supported_extensions.contains(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME)) { - loaded_extensions.insert(VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME); - loaded_extensions.insert(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME); - has_ahb_import = true; - } -#endif extensions.depth_stencil_resolve = extensions.depth_stencil_resolve && diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index ab96421c3a..63a2e5b7fa 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -993,10 +993,6 @@ FN_MAX_LIMIT_LIST return extensions.host_image_copy; } - bool IsAhbImportSupported() const { - return has_ahb_import; - } - bool HasNullDescriptor() const { return features.robustness2.nullDescriptor; } @@ -1212,7 +1208,6 @@ private: bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. bool is_integrated{}; ///< Is GPU an iGPU. bool is_uma{}; - bool has_ahb_import{}; bool has_broken_compute{}; ///< Compute shaders can cause crashes bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit bool has_broken_float16_math{}; diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 1d728e9113..c6b3afa2c7 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -88,9 +88,6 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkAllocateMemory); X(vkBindBufferMemory); X(vkFreeMemory); -#ifdef __ANDROID__ - X(vkGetAndroidHardwareBufferPropertiesANDROID); -#endif X(vkBeginCommandBuffer); X(vkCmdBeginConditionalRenderingEXT); X(vkCmdBeginQuery); @@ -657,20 +654,6 @@ VkMemoryRequirements Device::GetBufferMemoryRequirements(VkBuffer buffer) const return requirements.memoryRequirements; } -#ifdef __ANDROID__ -VkAndroidHardwareBufferPropertiesANDROID Device::GetAndroidHardwareBufferProperties( - const AHardwareBuffer* buffer) const { - VkAndroidHardwareBufferPropertiesANDROID properties{ - .sType = VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, - .pNext = nullptr, - .allocationSize = 0, - .memoryTypeBits = 0, - }; - Check(dld->vkGetAndroidHardwareBufferPropertiesANDROID(handle, buffer, &properties)); - return properties; -} -#endif - ImageView Device::CreateImageView(const VkImageViewCreateInfo& ci) const { VkImageView object; Check(dld->vkCreateImageView(handle, &ci, nullptr, &object)); diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index e0bb7585ac..bd9bd1b5bd 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -237,9 +237,6 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkAllocateMemory vkAllocateMemory{}; PFN_vkBindBufferMemory vkBindBufferMemory{}; PFN_vkFreeMemory vkFreeMemory{}; -#ifdef __ANDROID__ - PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID{}; -#endif PFN_vkBeginCommandBuffer vkBeginCommandBuffer{}; PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT{}; PFN_vkCmdBeginQuery vkCmdBeginQuery{}; @@ -1017,11 +1014,6 @@ public: [[nodiscard]] VkMemoryRequirements GetBufferMemoryRequirements(VkBuffer buffer) const noexcept; -#ifdef __ANDROID__ - [[nodiscard]] VkAndroidHardwareBufferPropertiesANDROID GetAndroidHardwareBufferProperties( - const AHardwareBuffer* buffer) const; -#endif - [[nodiscard]] ImageView CreateImageView(const VkImageViewCreateInfo& ci) const; [[nodiscard]] Semaphore CreateSemaphore() const; From e11ea7f008a314296cb7b8b107ab091d55e0eee6 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 16:52:15 -0400 Subject: [PATCH 155/198] Port UMA part 5.3 (NCE EXT) --- .../yuzu_emu/features/settings/model/BooleanSetting.kt | 1 + .../yuzu_emu/features/settings/model/view/SettingsItem.kt | 7 +++++++ .../features/settings/ui/SettingsFragmentPresenter.kt | 1 + src/android/app/src/main/res/values/strings.xml | 2 ++ src/common/settings.h | 2 ++ src/core/file_sys/program_metadata.cpp | 4 ++++ src/core/file_sys/program_metadata.h | 4 ++++ src/core/loader/deconstructed_rom_directory.cpp | 6 ++++++ 8 files changed, 27 insertions(+) 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 2f1212ee21..4791e91023 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 @@ -20,6 +20,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { EMULATE_BGR565("emulate_bgr565"), RESCALE_HACK("rescale_hack"), CPUOPT_UNSAFE_HOST_MMU("cpuopt_unsafe_host_mmu"), + RELOCATE_36BIT_ADDRESS_SPACE("relocate_36bit_address_space"), USE_DOCKED_MODE("use_docked_mode"), USE_AUTO_STUB("use_auto_stub"), RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 7ce309d764..6fbb6006ca 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -846,6 +846,13 @@ abstract class SettingsItem( descriptionId = R.string.cpuopt_unsafe_host_mmu_description ) ) + put( + SwitchSetting( + BooleanSetting.RELOCATE_36BIT_ADDRESS_SPACE, + titleId = R.string.relocate_36bit_address_space, + descriptionId = R.string.relocate_36bit_address_space_description + ) + ) put( SwitchSetting( BooleanSetting.RENDERER_REACTIVE_FLUSHING, 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 74c7fc41cf..85bb1c3fab 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 @@ -1527,6 +1527,7 @@ class SettingsFragmentPresenter( add(HeaderSetting(R.string.cpu)) add(IntSetting.CPU_BACKEND.key) + add(BooleanSetting.RELOCATE_36BIT_ADDRESS_SPACE.key) add(IntSetting.CPU_ACCURACY.key) add(BooleanSetting.USE_AUTO_STUB.key) add(SettingsItem.FASTMEM_COMBINED) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index b24cbceb18..1cbe8b6216 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -105,6 +105,8 @@ Synchronize the core tick speed to the maximum speed percentage to improve performance without altering the game\'s actual speed. Enable Host MMU Emulation This optimization speeds up memory accesses by the guest program. Enabling it causes guest memory reads/writes to be done directly into memory and make use of Host\'s MMU. Disabling this forces all memory accesses to use Software MMU Emulation. + Run 36-bit games natively + Gives games built for the 36-bit address space the 39-bit layout so they can run with NCE instead of the JIT. Experimental: a game that relies on 36-bit addresses can crash. Debug knobs For development use only. 0 to 65535 diff --git a/src/common/settings.h b/src/common/settings.h index a924007205..5f316061f9 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -259,6 +259,8 @@ struct Values { Category::Cpu}; SwitchableSetting cpu_accuracy{linkage, CpuAccuracy::Auto, "cpu_accuracy", Category::Cpu}; + SwitchableSetting relocate_36bit_address_space{ + linkage, false, "relocate_36bit_address_space", Category::Cpu}; SwitchableSetting cpu_clock{linkage, CpuClock::Normal, "fast_cpu_time", diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp index 63ca9d3fe3..d84c24f286 100644 --- a/src/core/file_sys/program_metadata.cpp +++ b/src/core/file_sys/program_metadata.cpp @@ -147,6 +147,10 @@ ProgramAddressSpaceType ProgramMetadata::GetAddressSpaceType() const { return npdm_header.address_space_type; } +void ProgramMetadata::SetAddressSpaceType(ProgramAddressSpaceType address_space) { + npdm_header.address_space_type.Assign(address_space); +} + u8 ProgramMetadata::GetMainThreadPriority() const { return npdm_header.main_thread_priority; } diff --git a/src/core/file_sys/program_metadata.h b/src/core/file_sys/program_metadata.h index 115e6d6cd1..7f5853567e 100644 --- a/src/core/file_sys/program_metadata.h +++ b/src/core/file_sys/program_metadata.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -73,6 +76,7 @@ public: bool Is64BitProgram() const; ProgramAddressSpaceType GetAddressSpaceType() const; + void SetAddressSpaceType(ProgramAddressSpaceType address_space); u8 GetMainThreadPriority() const; u8 GetMainThreadCore() const; u32 GetMainThreadStackSize() const; diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index 5e2ec7e0b9..b04da7e84f 100644 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp @@ -182,6 +182,12 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect } metadata.Print(); + if (Settings::values.relocate_36bit_address_space.GetValue() && + Settings::values.cpu_backend.GetValue() == Settings::CpuBackend::Nce && + metadata.GetAddressSpaceType() == FileSys::ProgramAddressSpaceType::Is36Bit) { + metadata.SetAddressSpaceType(FileSys::ProgramAddressSpaceType::Is39Bit); + } + // Enable NCE only for applications with 39-bit address space. const bool is_39bit = metadata.GetAddressSpaceType() == FileSys::ProgramAddressSpaceType::Is39Bit; From f759409cc2c6128585e69b1ffc8397fe7ad866f5 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 19:30:50 -0400 Subject: [PATCH 156/198] Address turnip bug with depths --- .../host_shaders/convert_d24s8_to_abgr8.frag | 16 ++++++++-------- .../host_shaders/convert_s8d24_to_abgr8.frag | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/video_core/host_shaders/convert_d24s8_to_abgr8.frag b/src/video_core/host_shaders/convert_d24s8_to_abgr8.frag index b81a540561..12b4e85600 100644 --- a/src/video_core/host_shaders/convert_d24s8_to_abgr8.frag +++ b/src/video_core/host_shaders/convert_d24s8_to_abgr8.frag @@ -1,11 +1,11 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 -precision mediump int; -precision highp float; - layout(binding = 0) uniform sampler2D depth_tex; layout(binding = 1) uniform usampler2D stencil_tex; @@ -13,10 +13,10 @@ layout(location = 0) out vec4 color; void main() { ivec2 coord = ivec2(gl_FragCoord.xy); - highp uint depth_val = - uint(textureLod(depth_tex, coord, 0).r * (exp2(32.0) - 1.0)); - lowp uint stencil_val = textureLod(stencil_tex, coord, 0).r; - highp uvec4 components = - uvec4(stencil_val, (uvec3(depth_val) >> uvec3(24u, 16u, 8u)) & 0x000000FFu); + uint depth_val = + uint(roundEven(clamp(textureLod(depth_tex, coord, 0).r, 0.0, 1.0) * (exp2(24.0) - 1.0))); + uint stencil_val = textureLod(stencil_tex, coord, 0).r; + uvec4 components = + uvec4(stencil_val, (uvec3(depth_val) >> uvec3(16u, 8u, 0u)) & 0x000000FFu); color.abgr = vec4(components) / (exp2(8.0) - 1.0); } diff --git a/src/video_core/host_shaders/convert_s8d24_to_abgr8.frag b/src/video_core/host_shaders/convert_s8d24_to_abgr8.frag index 6a457981d1..b06768fe31 100644 --- a/src/video_core/host_shaders/convert_s8d24_to_abgr8.frag +++ b/src/video_core/host_shaders/convert_s8d24_to_abgr8.frag @@ -1,11 +1,11 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 -precision mediump int; -precision highp float; - layout(binding = 0) uniform sampler2D depth_tex; layout(binding = 1) uniform usampler2D stencil_tex; @@ -13,10 +13,10 @@ layout(location = 0) out vec4 color; void main() { ivec2 coord = ivec2(gl_FragCoord.xy); - highp uint depth_val = - uint(textureLod(depth_tex, coord, 0).r * (exp2(32.0) - 1.0)); - lowp uint stencil_val = textureLod(stencil_tex, coord, 0).r; - highp uvec4 components = - uvec4((uvec3(depth_val) >> uvec3(24u, 16u, 8u)) & 0x000000FFu, stencil_val); + uint depth_val = + uint(roundEven(clamp(textureLod(depth_tex, coord, 0).r, 0.0, 1.0) * (exp2(24.0) - 1.0))); + uint stencil_val = textureLod(stencil_tex, coord, 0).r; + uvec4 components = + uvec4((uvec3(depth_val) >> uvec3(16u, 8u, 0u)) & 0x000000FFu, stencil_val); color.rgba = vec4(components) / (exp2(8.0) - 1.0); } From d16735f5b618942136d6ab53466e3be0a382c30a Mon Sep 17 00:00:00 2001 From: MaranBr Date: Fri, 2 Oct 2026 02:24:58 +0200 Subject: [PATCH 157/198] [am] Properly handle None frontend applet (#4500) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Properly handle the `AppletId::None` case by returning a null frontend applet instead of falling back to the stub implementation. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4500 Reviewed-by: lizzie Reviewed-by: CamilleLaVey --- src/core/hle/service/am/frontend/applets.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/am/frontend/applets.cpp b/src/core/hle/service/am/frontend/applets.cpp index d622c7b7a7..c59e4b9c6b 100644 --- a/src/core/hle/service/am/frontend/applets.cpp +++ b/src/core/hle/service/am/frontend/applets.cpp @@ -250,9 +250,10 @@ std::shared_ptr FrontendAppletHolder::GetApplet(std::shared_ptr< return std::make_shared(system, applet, mode, *frontend.photo_viewer); case AppletId::NetConnect: return std::make_shared(system, applet, mode, *frontend.net_connect); + case AppletId::None: + return nullptr; default: - LOG_ERROR(Service_AM, "No backend implementation exists for applet_id={:02X} program_id={:016X}" - "Falling back to stub applet", static_cast(id), applet->program_id); + UNIMPLEMENTED_MSG("No frontend implementation exists for applet_id={:02X} program_id={:016X}! Using stub applet.", static_cast(id), applet->program_id); return std::make_shared(system, applet, id, mode); } } From 7db354a25a08af35e421d98bb64fe71ce415482b Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 20:27:22 -0400 Subject: [PATCH 158/198] Framerate display corrections --- .../src/main/jni/emu_window/emu_window.cpp | 26 ++---- .../app/src/main/jni/emu_window/emu_window.h | 6 +- src/core/frontend/emu_window.h | 4 +- src/video_core/buffer_cache/usage_tracker.h | 90 ++++++++----------- .../renderer_null/renderer_null.cpp | 5 +- .../renderer_opengl/renderer_opengl.cpp | 2 +- .../renderer_vulkan/renderer_vulkan.cpp | 6 +- .../renderer_vulkan/vk_buffer_cache.cpp | 39 +++++--- .../renderer_vulkan/vk_buffer_cache.h | 22 ++--- src/yuzu/bootmanager.cpp | 2 +- src/yuzu/bootmanager.h | 2 +- 11 files changed, 94 insertions(+), 110 deletions(-) diff --git a/src/android/app/src/main/jni/emu_window/emu_window.cpp b/src/android/app/src/main/jni/emu_window/emu_window.cpp index 8dfea40693..614fd2569c 100644 --- a/src/android/app/src/main/jni/emu_window/emu_window.cpp +++ b/src/android/app/src/main/jni/emu_window/emu_window.cpp @@ -64,8 +64,8 @@ void EmuWindow_Android::OnTouchReleased(int id) { EmulationSession::GetInstance().GetInputSubsystem().GetTouchScreen()->TouchReleased(id); } -void EmuWindow_Android::OnFrameDisplayed() { - UpdateObservedFrameRate(); +void EmuWindow_Android::OnFrameDisplayed(u32 presented_frames) { + UpdateObservedFrameRate(presented_frames); UpdateFrameRateHint(); if (!m_first_frame) { @@ -75,15 +75,16 @@ void EmuWindow_Android::OnFrameDisplayed() { } } -void EmuWindow_Android::UpdateObservedFrameRate() { +void EmuWindow_Android::UpdateObservedFrameRate(u32 presented_frames) { + m_presented_frames = static_cast((std::max)(presented_frames, 1u)); const auto now = Clock::now(); if (m_last_frame_display_time.time_since_epoch().count() != 0) { const auto frame_time = std::chrono::duration(now - m_last_frame_display_time); const float seconds = frame_time.count(); if (seconds > 0.0f) { - const float instantaneous_rate = 1.0f / seconds; + const float instantaneous_rate = m_presented_frames / seconds; if (std::isfinite(instantaneous_rate) && instantaneous_rate >= 1.0f && - instantaneous_rate <= 240.0f) { + instantaneous_rate <= 240.0f * m_presented_frames) { constexpr float SmoothingFactor = 0.15f; if (m_smoothed_present_rate <= 0.0f) { m_smoothed_present_rate = instantaneous_rate; @@ -124,18 +125,9 @@ float EmuWindow_Android::GetFrameTimeVerifiedHint() const { return QuantizeFrameRateHint(verified_rate); } -float EmuWindow_Android::GetPresentedFrameMultiplier() { - if (!Settings::values.frame_gen.GetValue()) { - return 1.0f; - } - return static_cast(std::clamp(Settings::values.frame_gen_multiplier.GetValue(), 2, 4)); -} - float EmuWindow_Android::GetFrameRateHint() const { - const float presented_multiplier = GetPresentedFrameMultiplier(); - const float observed_rate = - std::clamp(m_smoothed_present_rate * presented_multiplier, 0.0f, 240.0f); - const float frame_time_verified_hint = GetFrameTimeVerifiedHint() * presented_multiplier; + const float observed_rate = std::clamp(m_smoothed_present_rate, 0.0f, 240.0f); + const float frame_time_verified_hint = GetFrameTimeVerifiedHint() * m_presented_frames; if (m_last_frame_rate_hint > 0.0f && observed_rate > 0.0f) { const float tolerance = std::max(m_last_frame_rate_hint * 0.12f, 4.0f); @@ -159,7 +151,7 @@ float EmuWindow_Android::GetFrameRateHint() const { return frame_time_verified_hint; } - const float nominal_rate = 60.0f * presented_multiplier; + const float nominal_rate = 60.0f * m_presented_frames; if (!Settings::values.use_speed_limit.GetValue()) { return QuantizeFrameRateHint(nominal_rate); } diff --git a/src/android/app/src/main/jni/emu_window/emu_window.h b/src/android/app/src/main/jni/emu_window/emu_window.h index fca83b91fa..67883946c9 100644 --- a/src/android/app/src/main/jni/emu_window/emu_window.h +++ b/src/android/app/src/main/jni/emu_window/emu_window.h @@ -41,7 +41,7 @@ public: ~EmuWindow_Android() = default; void OnSurfaceChanged(ANativeWindow* surface); - void OnFrameDisplayed() override; + void OnFrameDisplayed(u32 presented_frames) override; void OnTouchPressed(int id, float x, float y); void OnTouchMoved(int id, float x, float y); @@ -58,10 +58,9 @@ private: using Clock = std::chrono::steady_clock; void UpdateFrameRateHint(); - void UpdateObservedFrameRate(); + void UpdateObservedFrameRate(u32 presented_frames); [[nodiscard]] float GetFrameRateHint() const; [[nodiscard]] float GetFrameTimeVerifiedHint() const; - [[nodiscard]] static float GetPresentedFrameMultiplier(); [[nodiscard]] static float QuantizeFrameRateHint(float frame_rate); float m_window_width{}; @@ -73,6 +72,7 @@ private: float m_last_frame_rate_hint = -1.0f; float m_pending_frame_rate_hint = -1.0f; float m_smoothed_present_rate = 0.0f; + float m_presented_frames = 1.0f; Clock::time_point m_last_frame_display_time{}; Clock::time_point m_pending_frame_rate_since{}; std::uint32_t m_pending_frame_rate_hint_votes = 0; diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h index ee7a7693b2..e495e8978f 100644 --- a/src/core/frontend/emu_window.h +++ b/src/core/frontend/emu_window.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: 2014 Citra Emulator Project @@ -74,7 +74,7 @@ public: }; /// Called from GPU thread when a frame is displayed. - virtual void OnFrameDisplayed() {} + virtual void OnFrameDisplayed([[maybe_unused]] u32 presented_frames) {} /** * Returns a GraphicsContext that the frontend provides to be used for rendering. diff --git a/src/video_core/buffer_cache/usage_tracker.h b/src/video_core/buffer_cache/usage_tracker.h index 6f84e463e3..563bcc0e3b 100644 --- a/src/video_core/buffer_cache/usage_tracker.h +++ b/src/video_core/buffer_cache/usage_tracker.h @@ -6,7 +6,9 @@ #pragma once -#include "common/alignment.h" +#include +#include + #include "common/common_types.h" namespace VideoCommon { @@ -15,74 +17,58 @@ class UsageTracker { // PAGE_SHIFT is a macro on FreeBSD static constexpr size_t BUFFER_BYTES_PER_BITSHIFT = 6; static constexpr size_t BUFFER_PAGE_SHIFT = 6 + BUFFER_BYTES_PER_BITSHIFT; - static constexpr size_t BUFFER_PAGE_BYTES = 1 << BUFFER_PAGE_SHIFT; + static constexpr u64 BUFFER_PAGE_BYTES = u64{1} << BUFFER_PAGE_SHIFT; + + struct Page { + u64 bits; + u64 tick; + }; + public: - explicit UsageTracker(size_t size) { - const size_t num_pages = (size >> BUFFER_PAGE_SHIFT) + 1; - pages.resize(num_pages, 0ULL); - } + explicit UsageTracker(size_t size) : pages((size >> BUFFER_PAGE_SHIFT) + 1) {} - void Reset() noexcept { - std::ranges::fill(pages, 0ULL); - } - - void Track(u64 offset, u64 size) noexcept { - const size_t page = offset >> BUFFER_PAGE_SHIFT; - const size_t page_end = (offset + size) >> BUFFER_PAGE_SHIFT; - if (page_end < page || page_end >= pages.size()) { + void Track(u64 offset, u64 size, u64 tick, u64 gpu_tick) noexcept { + const u64 end = offset + size; + if (size == 0 || ((end - 1) >> BUFFER_PAGE_SHIFT) >= pages.size()) { return; } - TrackPage(page, offset, size); - if (page == page_end) { - return; + for (u64 page = offset >> BUFFER_PAGE_SHIFT; page <= (end - 1) >> BUFFER_PAGE_SHIFT; + ++page) { + Page& entry = pages[page]; + if (entry.tick <= gpu_tick) { + entry.bits = 0; + } + entry.bits |= PageMask(page, offset, end); + entry.tick = (std::max)(entry.tick, tick); } - for (size_t i = page + 1; i < page_end; i++) { - pages[i] = ~u64{0}; - } - const size_t offset_end = offset + size; - const size_t offset_end_page_aligned = Common::AlignDown(offset_end, BUFFER_PAGE_BYTES); - TrackPage(page_end, offset_end_page_aligned, offset_end - offset_end_page_aligned); } - [[nodiscard]] bool IsUsed(u64 offset, u64 size) const noexcept { - const size_t page = offset >> BUFFER_PAGE_SHIFT; - const size_t page_end = (offset + size) >> BUFFER_PAGE_SHIFT; - if (page_end < page || page_end >= pages.size()) { + [[nodiscard]] bool IsUsed(u64 offset, u64 size, u64 gpu_tick) const noexcept { + const u64 end = offset + size; + if (size == 0 || ((end - 1) >> BUFFER_PAGE_SHIFT) >= pages.size()) { return false; } - if (IsPageUsed(page, offset, size)) { - return true; - } - for (size_t i = page + 1; i < page_end; i++) { - if (pages[i] != 0) { + for (u64 page = offset >> BUFFER_PAGE_SHIFT; page <= (end - 1) >> BUFFER_PAGE_SHIFT; + ++page) { + const Page& entry = pages[page]; + if (entry.tick > gpu_tick && (entry.bits & PageMask(page, offset, end)) != 0) { return true; } } - const size_t offset_end = offset + size; - const size_t offset_end_page_aligned = Common::AlignDown(offset_end, BUFFER_PAGE_BYTES); - return IsPageUsed(page_end, offset_end_page_aligned, offset_end - offset_end_page_aligned); + return false; } private: - void TrackPage(u64 page, u64 offset, u64 size) noexcept { - const size_t offset_in_page = offset % BUFFER_PAGE_BYTES; - const size_t first_bit = offset_in_page >> BUFFER_BYTES_PER_BITSHIFT; - const size_t num_bits = std::min(size, BUFFER_PAGE_BYTES) >> BUFFER_BYTES_PER_BITSHIFT; - const size_t mask = ~u64{0} >> (64 - num_bits); - pages[page] |= (~u64{0} & mask) << first_bit; + [[nodiscard]] static u64 PageMask(u64 page, u64 offset, u64 end) noexcept { + const u64 page_begin = page << BUFFER_PAGE_SHIFT; + const u64 first = + ((std::max)(offset, page_begin) - page_begin) >> BUFFER_BYTES_PER_BITSHIFT; + const u64 last = ((std::min)(end, page_begin + BUFFER_PAGE_BYTES) - 1 - page_begin) >> + BUFFER_BYTES_PER_BITSHIFT; + return (~u64{0} >> (63 - last)) & (~u64{0} << first); } - bool IsPageUsed(u64 page, u64 offset, u64 size) const noexcept { - const size_t offset_in_page = offset % BUFFER_PAGE_BYTES; - const size_t first_bit = offset_in_page >> BUFFER_BYTES_PER_BITSHIFT; - const size_t num_bits = std::min(size, BUFFER_PAGE_BYTES) >> BUFFER_BYTES_PER_BITSHIFT; - const size_t mask = ~u64{0} >> (64 - num_bits); - const size_t mask2 = (~u64{0} & mask) << first_bit; - return (pages[page] & mask2) != 0; - } - -private: - std::vector pages; + std::vector pages; }; } // namespace VideoCommon diff --git a/src/video_core/renderer_null/renderer_null.cpp b/src/video_core/renderer_null/renderer_null.cpp index e6147d66cc..434fc172e3 100644 --- a/src/video_core/renderer_null/renderer_null.cpp +++ b/src/video_core/renderer_null/renderer_null.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -20,7 +23,7 @@ void RendererNull::Composite(std::span framebuff } m_gpu.RendererFrameEndNotify(); - render_window.OnFrameDisplayed(); + render_window.OnFrameDisplayed(1); } std::vector RendererNull::GetAppletCaptureBuffer() { diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index f9ec32e652..caf15294b2 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -151,7 +151,7 @@ void RendererOpenGL::Composite(std::span framebu rasterizer.TickFrame(); context->SwapBuffers(); - render_window.OnFrameDisplayed(); + render_window.OnFrameDisplayed(1); } void RendererOpenGL::AddTelemetryFields() { diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index f963ef4aef..b207997b76 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -185,8 +185,9 @@ RendererVulkan::~RendererVulkan() { } void RendererVulkan::Composite(std::span framebuffers) { + u32 pace_index = 0; SCOPE_EXIT { - render_window.OnFrameDisplayed(); + render_window.OnFrameDisplayed(pace_index + 1); }; RenderAppletCaptureLayer(framebuffers); @@ -204,7 +205,6 @@ void RendererVulkan::Composite(std::span framebu present_manager.SwapchainImageCount(), swapchain.GetImageViewFormat()); - u32 pace_index = 0; std::chrono::nanoseconds pace_step{}; #ifdef HAS_LSFG void(frame_gen.WantedGenerations(present_manager.MaxExtraFrames())); @@ -229,7 +229,7 @@ void RendererVulkan::Composite(std::span framebu output.View()); scheduler.Flush(*generated->render_ready); present_manager.Present(generated, static_cast(generation), generated_step); - pace_index = static_cast(generated_frames); + pace_index = static_cast(generation + 1); pace_step = generated_step; } #endif diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 0547e7ed71..52c3ad8804 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -109,7 +109,8 @@ vk::Buffer CreateBuffer(const Device& device, const MemoryAllocator& memory_allo } // Anonymous namespace Buffer::Buffer(BufferCacheRuntime& runtime, VideoCommon::NullBufferParams null_params) - : VideoCommon::BufferBase(null_params), scheduler{&runtime.scheduler}, tracker{4096} { + : VideoCommon::BufferBase(null_params), scheduler{&runtime.scheduler}, tracker{4096}, + uploads{4096} { if (runtime.device.HasNullDescriptor()) { return; } @@ -127,7 +128,7 @@ Buffer::Buffer(BufferCacheRuntime& runtime, DAddr cpu_addr_, u64 size_bytes_, scheduler{&runtime.scheduler}, buffer{CreateBuffer(*device, runtime.memory_allocator, SizeBytes(), runtime.SparseAlignmentFor(sparse_compatible_))}, - tracker{SizeBytes()} { + tracker{SizeBytes()}, uploads{SizeBytes()} { sparse_compatible = sparse_compatible_; if (runtime.device.HasDebuggingToolAttached()) { buffer.SetObjectNameEXT(fmt::format("Buffer {:#x}", CpuAddr()).c_str()); @@ -137,13 +138,25 @@ Buffer::Buffer(BufferCacheRuntime& runtime, DAddr cpu_addr_, u64 size_bytes_, } } -void Buffer::MarkUsage(u64 offset, u64 size) noexcept { - tracker.Track(offset, size); - last_usage_tick = scheduler->CurrentTick(); +bool Buffer::IsRegionUsed(u64 offset, u64 size) const noexcept { + return tracker.IsUsed(offset, size, scheduler->GetMasterSemaphore().KnownGpuTick()); } -void Buffer::MarkUpload() noexcept { +bool Buffer::IsRegionUploading(u64 offset, u64 size) const noexcept { + return uploads.IsUsed(offset, size, scheduler->GetMasterSemaphore().KnownGpuTick()); +} + +void Buffer::MarkUsage(u64 offset, u64 size) noexcept { + tracker.Track(offset, size, scheduler->CurrentTick(), + scheduler->GetMasterSemaphore().KnownGpuTick()); +} + +void Buffer::MarkUpload(std::span copies) noexcept { last_upload_tick = scheduler->CurrentTick(); + const u64 gpu_tick = scheduler->GetMasterSemaphore().KnownGpuTick(); + for (const VideoCommon::BufferCopy& copy : copies) { + uploads.Track(copy.dst_offset, copy.size, last_upload_tick, gpu_tick); + } } std::span Buffer::CoherentMapping() noexcept { @@ -462,13 +475,8 @@ u32 BufferCacheRuntime::GetStorageBufferAlignment() const { return static_cast(device.GetStorageBufferAlignment()); } -void BufferCacheRuntime::TickFrame(Common::SlotVector& slot_buffers) noexcept { +void BufferCacheRuntime::TickFrame(Common::SlotVector&) noexcept { multi_range_buffers.DrainRetired(scheduler); - for (auto it = slot_buffers.begin(); it != slot_buffers.end(); it++) { - if (scheduler.IsFree(it->LastUsageTick())) { - it->ResetUsageTracking(); - } - } } u64 BufferCacheRuntime::CurrentTick() { @@ -522,8 +530,11 @@ std::span BufferCacheRuntime::DirectDownloadSpan(Buffer& buffer) { std::span BufferCacheRuntime::DirectUploadSpan( Buffer& buffer, std::span copies) { const std::span mapping = buffer.CoherentMapping(); - if (mapping.empty() || !scheduler.IsFree(buffer.LastUploadTick()) || - !CanReorderUpload(buffer, copies)) { + const bool uploading = + std::ranges::any_of(copies, [&buffer](const VideoCommon::BufferCopy& copy) { + return buffer.IsRegionUploading(copy.dst_offset, copy.size); + }); + if (mapping.empty() || uploading || !CanReorderUpload(buffer, copies)) { return {}; } return mapping; diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index fa6829e623..51f153a4d1 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -55,21 +55,13 @@ public: return buffer.Location(); } - [[nodiscard]] bool IsRegionUsed(u64 offset, u64 size) const noexcept { - return tracker.IsUsed(offset, size); - } + [[nodiscard]] bool IsRegionUsed(u64 offset, u64 size) const noexcept; + + [[nodiscard]] bool IsRegionUploading(u64 offset, u64 size) const noexcept; void MarkUsage(u64 offset, u64 size) noexcept; - void ResetUsageTracking() noexcept { - tracker.Reset(); - } - - [[nodiscard]] u64 LastUsageTick() const noexcept { - return last_usage_tick; - } - - void MarkUpload() noexcept; + void MarkUpload(std::span copies) noexcept; [[nodiscard]] u64 LastUploadTick() const noexcept { return last_upload_tick; @@ -94,8 +86,8 @@ private: vk::Buffer buffer; std::vector views; VideoCommon::UsageTracker tracker; + VideoCommon::UsageTracker uploads; VkDeviceAddress device_address{}; - u64 last_usage_tick{}; u64 last_upload_tick{}; bool is_null{}; bool sparse_compatible{}; @@ -117,7 +109,7 @@ public: ComputePassDescriptorQueue& compute_pass_descriptor_queue, DescriptorPool& descriptor_pool); - void TickFrame(Common::SlotVector& slot_buffers) noexcept; + void TickFrame(Common::SlotVector&) noexcept; u64 CurrentTick(); @@ -165,7 +157,7 @@ public: void CopyBuffer(Buffer& dst_buffer, VkBuffer src_buffer, std::span copies, bool barrier, bool can_reorder_upload = false) { - dst_buffer.MarkUpload(); + dst_buffer.MarkUpload(copies); CopyBuffer(dst_buffer.Handle(), src_buffer, copies, barrier, can_reorder_upload); } diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 308db3621b..7affda9c56 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -157,7 +157,7 @@ GRenderWindow::~GRenderWindow() { input_subsystem->Shutdown(); } -void GRenderWindow::OnFrameDisplayed() { +void GRenderWindow::OnFrameDisplayed([[maybe_unused]] u32 presented_frames) { input_subsystem->GetTas()->UpdateThread(); const InputCommon::TasInput::TasState new_tas_state = std::get<0>(input_subsystem->GetTas()->GetStatus()); diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index bb18bbb3bb..85218f4cb4 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h @@ -67,7 +67,7 @@ public: ~GRenderWindow() override; // EmuWindow implementation. - void OnFrameDisplayed() override; + void OnFrameDisplayed(u32 presented_frames) override; bool IsShown() const override; std::unique_ptr CreateSharedContext() const override; From 5c7520f572149adb136aeacb3da95a7c6f098ffa Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 20:56:23 -0400 Subject: [PATCH 159/198] Address some regressions with UMA --- src/core/hle/service/nvdrv/core/nvmap.cpp | 19 +++++--- .../service/nvdrv/devices/nvhost_as_gpu.cpp | 37 +++------------ .../hle/service/nvdrv/devices/nvhost_as_gpu.h | 2 - src/video_core/buffer_cache/usage_tracker.h | 45 +++++++++++++------ .../renderer_vulkan/vk_buffer_cache.cpp | 10 ++++- .../renderer_vulkan/vk_buffer_cache.h | 3 ++ 6 files changed, 62 insertions(+), 54 deletions(-) diff --git a/src/core/hle/service/nvdrv/core/nvmap.cpp b/src/core/hle/service/nvdrv/core/nvmap.cpp index e2bf49da62..b2cbfbd686 100644 --- a/src/core/hle/service/nvdrv/core/nvmap.cpp +++ b/src/core/hle/service/nvdrv/core/nvmap.cpp @@ -211,14 +211,19 @@ DAddr NvMap::PinHandle(NvMap::Handle::Id handle, bool low_area_pin) { while ((address = smmu.Allocate(aligned_up)) == 0) { // Free handles until the allocation succeeds std::scoped_lock queueLock(unmap_queue_lock); - if (auto freeHandleDesc{unmap_queue.front()}) { - // Handles in the unmap queue are guaranteed not to be pinned so don't bother - // checking if they are before unmapping - std::scoped_lock freeLock(freeHandleDesc->mutex); - if (handle_description->d_address) - UnmapHandle(*freeHandleDesc); - } else { + if (unmap_queue.empty()) { LOG_CRITICAL(Service_NVDRV, "Ran out of SMMU address space!"); + return 0; + } + // Handles in the unmap queue are guaranteed not to be pinned so don't bother + // checking if they are before unmapping + const std::shared_ptr freeHandleDesc = unmap_queue.front(); + std::scoped_lock freeLock(freeHandleDesc->mutex); + if (freeHandleDesc->d_address) { + UnmapHandle(*freeHandleDesc); + } else { + unmap_queue.pop_front(); + freeHandleDesc->unmap_queue_entry.reset(); } } diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp index 3c9e42f602..f486817c8d 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -233,9 +233,9 @@ NvResult nvhost_as_gpu::FreeSpace(IoctlFreeSpace& params) { if (allocation.page_size != params.page_size || allocation.size != (u64(params.pages) * params.page_size)) return NvResult::BadValue; - for (const auto mapping_offset : allocation.mappings) - if (!FreeMappingLocked(mapping_offset)) - return NvResult::BadValue; + for (const auto mapping_offset : allocation.mappings) { + void(FreeMappingLocked(mapping_offset)); + } // Unset sparse flag if required if (allocation.sparse) @@ -375,39 +375,16 @@ NvResult nvhost_as_gpu::MapBufferEx(IoctlMapBufferEx& params) { mapping_map.insert_or_assign(params.offset, Mapping(params.handle, device_address, params.offset, size, false, big_page, false)); } - map_buffer_offsets.insert(params.offset); - return NvResult::Success; } NvResult nvhost_as_gpu::UnmapBuffer(IoctlUnmapBuffer& params) { + LOG_DEBUG(Service_NVDRV, "called, offset={:#x}", params.offset); std::scoped_lock lock(mutex); - if (auto const offset_it = map_buffer_offsets.find(params.offset); offset_it != map_buffer_offsets.end()) { - LOG_DEBUG(Service_NVDRV, "called, offset={:#x}", params.offset); - if (!vm.initialised) { - return NvResult::BadValue; - } - - auto const it = mapping_map.find(params.offset); - auto const mapping = it->second; - if (!mapping.fixed) { - auto& allocator{mapping.big_page ? *vm.big_page_allocator : *vm.small_page_allocator}; - u32 page_size_bits{mapping.big_page ? vm.big_page_size_bits : VM::PAGE_SIZE_BITS}; - allocator.Free(u32(mapping.offset >> page_size_bits), u32(mapping.size >> page_size_bits)); - } - - // Sparse mappings shouldn't be fully unmapped, just returned to their sparse state - // Only FreeSpace can unmap them fully - if (mapping.sparse_alloc) { - gmmu->MapSparse(params.offset, mapping.size, mapping.big_page); - } else { - gmmu->Unmap(params.offset, mapping.size); - } - - nvmap.UnpinHandle(mapping.handle); - mapping_map.erase(params.offset); - map_buffer_offsets.erase(params.offset); + if (!vm.initialised) { + return NvResult::BadValue; } + void(FreeMappingLocked(params.offset)); return NvResult::Success; } diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h index b13b1c9efa..f66dcf0dc2 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h @@ -113,8 +113,6 @@ private: }; static_assert(sizeof(IoctlRemapEntry) == 20, "IoctlRemapEntry is incorrect size"); - ::Common::unordered_set map_buffer_offsets{}; - struct IoctlMapBufferEx { MappingFlags flags{}; // bit0: fixed_offset, bit2: cacheable u32_le kind{}; // -1 is default diff --git a/src/video_core/buffer_cache/usage_tracker.h b/src/video_core/buffer_cache/usage_tracker.h index 563bcc0e3b..1b3ab2f998 100644 --- a/src/video_core/buffer_cache/usage_tracker.h +++ b/src/video_core/buffer_cache/usage_tracker.h @@ -25,22 +25,22 @@ class UsageTracker { }; public: - explicit UsageTracker(size_t size) : pages((size >> BUFFER_PAGE_SHIFT) + 1) {} + explicit UsageTracker(size_t size) + : pages((size >> BUFFER_PAGE_SHIFT) + 1), full_ticks(pages.size()) {} void Track(u64 offset, u64 size, u64 tick, u64 gpu_tick) noexcept { const u64 end = offset + size; if (size == 0 || ((end - 1) >> BUFFER_PAGE_SHIFT) >= pages.size()) { return; } - for (u64 page = offset >> BUFFER_PAGE_SHIFT; page <= (end - 1) >> BUFFER_PAGE_SHIFT; - ++page) { - Page& entry = pages[page]; - if (entry.tick <= gpu_tick) { - entry.bits = 0; - } - entry.bits |= PageMask(page, offset, end); - entry.tick = (std::max)(entry.tick, tick); + const u64 first_page = offset >> BUFFER_PAGE_SHIFT; + const u64 last_page = (end - 1) >> BUFFER_PAGE_SHIFT; + TrackPage(first_page, PageMask(first_page, offset, end), tick, gpu_tick); + if (last_page == first_page) { + return; } + std::fill(full_ticks.begin() + first_page + 1, full_ticks.begin() + last_page, tick); + TrackPage(last_page, PageMask(last_page, offset, end), tick, gpu_tick); } [[nodiscard]] bool IsUsed(u64 offset, u64 size, u64 gpu_tick) const noexcept { @@ -48,10 +48,14 @@ public: if (size == 0 || ((end - 1) >> BUFFER_PAGE_SHIFT) >= pages.size()) { return false; } - for (u64 page = offset >> BUFFER_PAGE_SHIFT; page <= (end - 1) >> BUFFER_PAGE_SHIFT; - ++page) { - const Page& entry = pages[page]; - if (entry.tick > gpu_tick && (entry.bits & PageMask(page, offset, end)) != 0) { + const u64 first_page = offset >> BUFFER_PAGE_SHIFT; + const u64 last_page = (end - 1) >> BUFFER_PAGE_SHIFT; + if (IsPageUsed(first_page, PageMask(first_page, offset, end), gpu_tick) || + IsPageUsed(last_page, PageMask(last_page, offset, end), gpu_tick)) { + return true; + } + for (u64 page = first_page + 1; page < last_page; ++page) { + if (IsPageUsed(page, ~u64{0}, gpu_tick)) { return true; } } @@ -59,6 +63,20 @@ public: } private: + void TrackPage(u64 page, u64 mask, u64 tick, u64 gpu_tick) noexcept { + Page& entry = pages[page]; + if (entry.tick <= gpu_tick) { + entry.bits = 0; + } + entry.bits |= mask; + entry.tick = (std::max)(entry.tick, tick); + } + + [[nodiscard]] bool IsPageUsed(u64 page, u64 mask, u64 gpu_tick) const noexcept { + const Page& entry = pages[page]; + return full_ticks[page] > gpu_tick || (entry.tick > gpu_tick && (entry.bits & mask) != 0); + } + [[nodiscard]] static u64 PageMask(u64 page, u64 offset, u64 end) noexcept { const u64 page_begin = page << BUFFER_PAGE_SHIFT; const u64 first = @@ -69,6 +87,7 @@ private: } std::vector pages; + std::vector full_ticks; }; } // namespace VideoCommon diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 52c3ad8804..8d748393fd 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -147,8 +147,14 @@ bool Buffer::IsRegionUploading(u64 offset, u64 size) const noexcept { } void Buffer::MarkUsage(u64 offset, u64 size) noexcept { - tracker.Track(offset, size, scheduler->CurrentTick(), - scheduler->GetMasterSemaphore().KnownGpuTick()); + const u64 tick = scheduler->CurrentTick(); + if (tick == usage_tick && offset >= usage_begin && offset + size <= usage_end) { + return; + } + tracker.Track(offset, size, tick, scheduler->GetMasterSemaphore().KnownGpuTick()); + usage_tick = tick; + usage_begin = offset; + usage_end = offset + size; } void Buffer::MarkUpload(std::span copies) noexcept { diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index 51f153a4d1..f4c4c53906 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -88,6 +88,9 @@ private: VideoCommon::UsageTracker tracker; VideoCommon::UsageTracker uploads; VkDeviceAddress device_address{}; + u64 usage_tick{}; + u64 usage_begin{}; + u64 usage_end{}; u64 last_upload_tick{}; bool is_null{}; bool sparse_compatible{}; From 165a1d1da188d69d875479a4712432aa4cf39cb1 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 22:52:42 -0400 Subject: [PATCH 160/198] Experiments with gpu stalls per fence wait --- .../features/settings/model/BooleanSetting.kt | 1 + .../settings/model/view/SettingsItem.kt | 7 +++ .../settings/ui/SettingsFragmentPresenter.kt | 1 + .../app/src/main/res/values/strings.xml | 2 + src/common/settings.h | 2 + .../hle/service/nvdrv/devices/nvhost_ctrl.cpp | 10 +++- .../hle/service/nvdrv/devices/nvhost_gpu.cpp | 29 ++++----- src/core/hle/service/nvdrv/nvdrv.cpp | 59 +++++++++++-------- src/core/hle/service/nvdrv/nvdrv.h | 8 +-- src/qt_common/config/shared_translation.cpp | 4 ++ src/video_core/dma_pusher.cpp | 3 +- src/video_core/engines/maxwell_3d.cpp | 2 +- src/video_core/engines/puller.cpp | 17 +++++- src/video_core/engines/puller.h | 1 + src/video_core/fence_manager.h | 12 +++- src/video_core/rasterizer_interface.h | 5 +- .../renderer_null/null_rasterizer.cpp | 11 +++- .../renderer_null/null_rasterizer.h | 5 +- .../renderer_opengl/gl_rasterizer.cpp | 4 +- .../renderer_opengl/gl_rasterizer.h | 5 +- .../renderer_vulkan/vk_rasterizer.cpp | 4 +- .../renderer_vulkan/vk_rasterizer.h | 2 +- 22 files changed, 128 insertions(+), 66 deletions(-) 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 4791e91023..f6ad6b0145 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 @@ -34,6 +34,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { ENABLE_GPU_BUFFER_READBACK("enable_gpu_buffer_readback"), USE_UNIFIED_MEMORY("use_unified_memory"), SYNC_MEMORY_OPERATIONS("sync_memory_operations"), + STALL_ON_GPU_FENCE_WAIT("stall_on_gpu_fence_wait"), BUFFER_REORDER_DISABLE("disable_buffer_reorder"), RENDERER_DEBUG("debug"), RENDERER_PATCH_OLD_QCOM_DRIVERS("patch_old_qcom_drivers"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 6fbb6006ca..d4be5d0140 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -902,6 +902,13 @@ abstract class SettingsItem( descriptionId = R.string.sync_memory_operations_description ) ) + put( + SwitchSetting( + BooleanSetting.STALL_ON_GPU_FENCE_WAIT, + titleId = R.string.stall_on_gpu_fence_wait, + descriptionId = R.string.stall_on_gpu_fence_wait_description + ) + ) put( SwitchSetting( BooleanSetting.BUFFER_REORDER_DISABLE, 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 85bb1c3fab..369ba4178f 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 @@ -545,6 +545,7 @@ class SettingsFragmentPresenter( add(IntSetting.RENDERER_NVDEC_EMULATION.key) add(BooleanSetting.SYNC_MEMORY_OPERATIONS.key) + add(BooleanSetting.STALL_ON_GPU_FENCE_WAIT.key) add(BooleanSetting.RENDERER_USE_DISK_SHADER_CACHE.key) add(BooleanSetting.RENDERER_FORCE_MAX_CLOCK.key) add(BooleanSetting.RENDERER_REACTIVE_FLUSHING.key) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 1cbe8b6216..bd0716013c 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -575,6 +575,8 @@ Pick how ASTC-compressed textures are decoded for rendering: CPU (slow, safe), GPU (fast, recommended), or CPU Async (no stutters, may cause issues) Sync Memory Operations + Pause CPU on GPU fence timeouts + When a game keeps timing out while waiting for the GPU, pauses every CPU thread until the GPU catches up. Disabling it keeps the other threads running, which can reduce stutter but may break games that rely on it. Ensures data consistency between compute and memory operations. This option should fix issues in some games, but may also reduce performance in some cases. Unreal Engine 4 games often see the most significant changes thereof. Disk shader cache Reduces stuttering by locally storing and loading generated shaders. diff --git a/src/common/settings.h b/src/common/settings.h index 5f316061f9..59f3d448da 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -561,6 +561,8 @@ struct Values { Specialization::Default, true, true}; + SwitchableSetting stall_on_gpu_fence_wait{linkage, true, "stall_on_gpu_fence_wait", + Category::RendererAdvanced}; SwitchableSetting renderer_force_max_clock{linkage, false, "force_max_clock", Category::RendererAdvanced}; diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp index 6ef32b890f..7db706c5e7 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp @@ -13,6 +13,7 @@ #include "common/assert.h" #include "common/logging.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/core.h" #include "core/hle/kernel/k_event.h" #include "core/hle/service/nvdrv/core/container.h" @@ -147,9 +148,12 @@ NvResult nvhost_ctrl::IocCtrlEventWait(IocCtrlEventWaitParams& params, bool is_a const auto check_failing = [&]() { if (events[slot].fails > 2) { - { - auto lk = system.StallApplication(); - host1x_syncpoint_manager.WaitHost(fence_id, target_value); + std::unique_lock stall; + if (Settings::values.stall_on_gpu_fence_wait.GetValue()) { + stall = system.StallApplication(); + } + host1x_syncpoint_manager.WaitHost(fence_id, target_value); + if (stall.owns_lock()) { system.UnstallApplication(); } params.value.raw = target_value; diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 358679b831..193b28573e 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp @@ -312,19 +312,17 @@ static boost::container::small_vector BuildWaitComman static boost::container::small_vector BuildIncrementCommandList( NvFence fence) { - boost::container::small_vector result{ + const Tegra::CommandHeader increment = + BuildFenceAction(Tegra::Engines::Puller::FenceOperation::Increment, fence.id); + return { Tegra::BuildCommandHeader(Tegra::BufferMethods::SyncpointPayload, 1, Tegra::SubmissionMode::Increasing), - {}}; - - for (u32 count = 0; count < 2; ++count) { - result.push_back(Tegra::BuildCommandHeader(Tegra::BufferMethods::SyncpointOperation, 1, - Tegra::SubmissionMode::Increasing)); - result.push_back( - BuildFenceAction(Tegra::Engines::Puller::FenceOperation::Increment, fence.id)); - } - - return result; + {}, + Tegra::BuildCommandHeader(Tegra::BufferMethods::SyncpointOperation, 2, + Tegra::SubmissionMode::NonIncreasing), + increment, + increment, + }; } static boost::container::small_vector BuildIncrementWithWfiCommandList( @@ -370,17 +368,14 @@ NvResult nvhost_gpu::SubmitGPFIFOImpl(IoctlSubmitGpfifo& params, Tegra::CommandL u32 increment{(flags.fence_increment.Value() != 0 ? 2 : 0) + (flags.increment_value.Value() != 0 ? params.fence.value : 0)}; params.fence.value = syncpoint_manager.IncrementSyncpointMaxExt(channel_syncpoint, increment); - gpu.PushGPUEntries(bind_id, std::move(entries)); - if (flags.fence_increment.Value()) { if (flags.suppress_wfi.Value()) { - gpu.PushGPUEntries(bind_id, - Tegra::CommandList{BuildIncrementCommandList(params.fence)}); + entries.prefetch_command_list = BuildIncrementCommandList(params.fence); } else { - gpu.PushGPUEntries(bind_id, - Tegra::CommandList{BuildIncrementWithWfiCommandList(params.fence)}); + entries.prefetch_command_list = BuildIncrementWithWfiCommandList(params.fence); } } + gpu.PushGPUEntries(bind_id, std::move(entries)); flags.raw = 0; diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index b252a2efa5..dd82e76d9e 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp @@ -165,13 +165,22 @@ Module::Module(Core::System& system) Module::~Module() {} +std::shared_ptr Module::FindDevice(DeviceFD fd) const { + std::scoped_lock lock(open_files_mutex); + const auto itr = open_files.find(fd); + if (itr == open_files.end()) { + return nullptr; + } + return itr->second; +} + NvResult Module::VerifyFD(DeviceFD fd) const { if (fd < 0) { LOG_ERROR(Service_NVDRV, "Invalid DeviceFD={}!", fd); return NvResult::InvalidState; } - if (open_files.find(fd) == open_files.end()) { + if (!FindDevice(fd)) { LOG_ERROR(Service_NVDRV, "Could not find DeviceFD={}!", fd); return NvResult::NotImplemented; } @@ -187,8 +196,11 @@ DeviceFD Module::Open(const std::string& device_name, NvCore::SessionId session_ } const DeviceFD fd = next_fd++; - auto& builder = it->second; - auto device = builder(fd)->second; + std::shared_ptr device; + { + std::scoped_lock lock(open_files_mutex); + device = it->second(fd)->second; + } device->OnOpen(session_id, fd); @@ -202,14 +214,13 @@ NvResult Module::Ioctl1(DeviceFD fd, Ioctl command, std::span input, return NvResult::InvalidState; } - const auto itr = open_files.find(fd); - - if (itr == open_files.end()) { + const auto device = FindDevice(fd); + if (!device) { LOG_ERROR(Service_NVDRV, "Could not find DeviceFD={}!", fd); return NvResult::NotImplemented; } - return itr->second->Ioctl1(fd, command, input, output); + return device->Ioctl1(fd, command, input, output); } NvResult Module::Ioctl2(DeviceFD fd, Ioctl command, std::span input, @@ -219,14 +230,13 @@ NvResult Module::Ioctl2(DeviceFD fd, Ioctl command, std::span input, return NvResult::InvalidState; } - const auto itr = open_files.find(fd); - - if (itr == open_files.end()) { + const auto device = FindDevice(fd); + if (!device) { LOG_ERROR(Service_NVDRV, "Could not find DeviceFD={}!", fd); return NvResult::NotImplemented; } - return itr->second->Ioctl2(fd, command, input, inline_input, output); + return device->Ioctl2(fd, command, input, inline_input, output); } NvResult Module::Ioctl3(DeviceFD fd, Ioctl command, std::span input, std::span output, @@ -236,14 +246,13 @@ NvResult Module::Ioctl3(DeviceFD fd, Ioctl command, std::span input, s return NvResult::InvalidState; } - const auto itr = open_files.find(fd); - - if (itr == open_files.end()) { + const auto device = FindDevice(fd); + if (!device) { LOG_ERROR(Service_NVDRV, "Could not find DeviceFD={}!", fd); return NvResult::NotImplemented; } - return itr->second->Ioctl3(fd, command, input, output, inline_output); + return device->Ioctl3(fd, command, input, output, inline_output); } NvResult Module::Close(DeviceFD fd) { @@ -252,16 +261,17 @@ NvResult Module::Close(DeviceFD fd) { return NvResult::InvalidState; } - const auto itr = open_files.find(fd); - - if (itr == open_files.end()) { + const auto device = FindDevice(fd); + if (!device) { LOG_ERROR(Service_NVDRV, "Could not find DeviceFD={}!", fd); return NvResult::NotImplemented; } - itr->second->OnClose(fd); - - open_files.erase(itr); + { + std::scoped_lock lock(open_files_mutex); + open_files.erase(fd); + } + device->OnClose(fd); return NvResult::Success; } @@ -272,14 +282,13 @@ NvResult Module::QueryEvent(DeviceFD fd, u32 event_id, Kernel::KEvent*& event) { return NvResult::InvalidState; } - const auto itr = open_files.find(fd); - - if (itr == open_files.end()) { + const auto device = FindDevice(fd); + if (!device) { LOG_ERROR(Service_NVDRV, "Could not find DeviceFD={}!", fd); return NvResult::NotImplemented; } - event = itr->second->QueryEvent(event_id); + event = device->QueryEvent(event_id); if (!event) { return NvResult::BadParameter; } diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h index f503f108c3..4d8873c28f 100644 --- a/src/core/hle/service/nvdrv/nvdrv.h +++ b/src/core/hle/service/nvdrv/nvdrv.h @@ -65,10 +65,7 @@ public: /// Returns a pointer to one of the available devices, identified by its name. template std::shared_ptr GetDevice(DeviceFD fd) { - auto itr = open_files.find(fd); - if (itr == open_files.end()) - return nullptr; - return std::static_pointer_cast(itr->second); + return std::static_pointer_cast(FindDevice(fd)); } NvResult VerifyFD(DeviceFD fd) const; @@ -97,6 +94,8 @@ public: private: friend class EventInterface; + std::shared_ptr FindDevice(DeviceFD fd) const; + /// Manages syncpoints on the host NvCore::Container container; @@ -106,6 +105,7 @@ private: using FilesContainerType = ::Common::unordered_map>; /// Mapping of file descriptors to the devices they reference. FilesContainerType open_files; + mutable std::mutex open_files_mutex; KernelHelpers::ServiceContext service_context; diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 0bb2e0d52b..0562749073 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -222,6 +222,10 @@ std::unique_ptr InitializeTranslations(QObject* parent) { tr("Ensures data consistency between compute and memory operations.\nThis option fixes " "issues in games, but may degrade performance.\nUnreal Engine 4 games often see the " "most significant changes thereof.")); + INSERT(Settings, stall_on_gpu_fence_wait, tr("Pause CPU on GPU fence timeouts"), + tr("When a game keeps timing out while waiting for the GPU, pauses every CPU thread " + "until the GPU catches up.\nDisabling it keeps the other threads running, which can " + "reduce stutter but may break games that rely on it.")); INSERT(Settings, async_presentation, tr("Enable asynchronous presentation (Vulkan only)"), tr("Slightly improves performance by moving presentation to a separate CPU thread.")); INSERT( diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp index 2417659f09..1eb665ad79 100644 --- a/src/video_core/dma_pusher.cpp +++ b/src/video_core/dma_pusher.cpp @@ -56,7 +56,7 @@ bool DmaPusher::Step() { return true; } - if (prefetch_size > 0) { + if (command_list_size == 0) { ProcessCommands(command_list.prefetch_command_list); dma_pushbuffer.pop(); return true; @@ -89,6 +89,7 @@ bool DmaPusher::Step() { } if (++dma_pushbuffer_subindex >= command_list_size) { + ProcessCommands(command_list.prefetch_command_list); dma_pushbuffer.pop(); dma_pushbuffer_subindex = 0; } else { diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index e7da9d9138..4adab42e67 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -588,7 +588,7 @@ void Maxwell3D::ProcessCounterReset() { void Maxwell3D::ProcessSyncPoint() { const u32 sync_point = regs.sync_info.sync_point.Value(); [[maybe_unused]] const u32 cache_flush = regs.sync_info.clean_l2.Value(); - rasterizer->SignalSyncPoint(sync_point); + rasterizer->SignalSyncPoint(sync_point, 1); } void Maxwell3D::ProcessCBBind(size_t stage_index) { diff --git a/src/video_core/engines/puller.cpp b/src/video_core/engines/puller.cpp index 0b05d31718..38b5a3e785 100644 --- a/src/video_core/engines/puller.cpp +++ b/src/video_core/engines/puller.cpp @@ -4,6 +4,8 @@ // SPDX-FileCopyrightText: 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later +#include + #include "common/assert.h" #include "common/logging.h" #include "common/settings.h" @@ -71,7 +73,7 @@ void Puller::ProcessFenceActionMethod(DmaPusher& dma_pusher) { dma_pusher.rasterizer->ReleaseFences(); break; case Puller::FenceOperation::Increment: - dma_pusher.rasterizer->SignalSyncPoint(regs.fence_action.syncpoint_id); + dma_pusher.rasterizer->SignalSyncPoint(regs.fence_action.syncpoint_id, 1); break; default: UNIMPLEMENTED_MSG("Unimplemented operation {}", regs.fence_action.op.Value()); @@ -278,6 +280,9 @@ void Puller::CallMultiMethod(DmaPusher& dma_pusher, u32 method, u32 subchannel, ASSERT(subchannel < bound_engines.size()); if (ExecuteMethodOnEngine(dma_pusher, method)) { CallEngineMultiMethod(dma_pusher, method, subchannel, base_start, amount, methods_pending); + } else if (IsIncrementRun(method, base_start, amount)) { + regs.reg_array[method] = base_start[0]; + dma_pusher.rasterizer->SignalSyncPoint(regs.fence_action.syncpoint_id, amount); } else { for (u32 i = 0; i < amount; i++) { CallPullerMethod(dma_pusher, MethodCall{ @@ -290,6 +295,16 @@ void Puller::CallMultiMethod(DmaPusher& dma_pusher, u32 method, u32 subchannel, } } +bool Puller::IsIncrementRun(u32 method, const u32* base_start, u32 amount) const { + if (BufferMethods(method) != BufferMethods::SyncpointOperation || amount < 2) { + return false; + } + const FenceAction action{.raw = base_start[0]}; + return action.op == FenceOperation::Increment && + std::all_of(base_start, base_start + amount, + [first = base_start[0]](u32 argument) { return argument == first; }); +} + /// Determines where the method should be executed. [[nodiscard]] bool Puller::ExecuteMethodOnEngine(DmaPusher& dma_pusher, u32 method) { const auto buffer_method = BufferMethods(method); diff --git a/src/video_core/engines/puller.h b/src/video_core/engines/puller.h index e8994f5640..c1a1d86e2a 100644 --- a/src/video_core/engines/puller.h +++ b/src/video_core/engines/puller.h @@ -72,6 +72,7 @@ public: void CallMethod(DmaPusher& dma_pusher, const MethodCall& method_call); void CallMultiMethod(DmaPusher& dma_pusher, u32 method, u32 subchannel, const u32* base_start, u32 amount, u32 methods_pending); + [[nodiscard]] bool IsIncrementRun(u32 method, const u32* base_start, u32 amount) const; void BindRasterizer(DmaPusher& dma_pusher, VideoCore::RasterizerInterface* rasterizer); void CallPullerMethod(DmaPusher& dma_pusher, const MethodCall& method_call); void CallEngineMethod(DmaPusher& dma_pusher, const MethodCall& method_call); diff --git a/src/video_core/fence_manager.h b/src/video_core/fence_manager.h index 885c714025..b7d53ad583 100644 --- a/src/video_core/fence_manager.h +++ b/src/video_core/fence_manager.h @@ -101,9 +101,15 @@ public: rasterizer.InvalidateGPUCache(); } - void SignalSyncPoint(u32 value) { - syncpoint_manager.IncrementGuest(value); - std::function func([this, value] { syncpoint_manager.IncrementHost(value); }); + void SignalSyncPoint(u32 value, u32 count) { + for (u32 i = 0; i < count; ++i) { + syncpoint_manager.IncrementGuest(value); + } + std::function func([this, value, count] { + for (u32 i = 0; i < count; ++i) { + syncpoint_manager.IncrementHost(value); + } + }); SignalFence(std::move(func)); } diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h index 481efbf53b..d0e55da8b1 100644 --- a/src/video_core/rasterizer_interface.h +++ b/src/video_core/rasterizer_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -75,7 +78,7 @@ public: virtual void SyncOperation(std::function&& func) = 0; /// Signal a GPU based syncpoint as a fence - virtual void SignalSyncPoint(u32 value) = 0; + virtual void SignalSyncPoint(u32 value, u32 count) = 0; /// Signal a GPU based reference as point virtual void SignalReference() = 0; diff --git a/src/video_core/renderer_null/null_rasterizer.cpp b/src/video_core/renderer_null/null_rasterizer.cpp index a5cda0f389..d2fb89119c 100644 --- a/src/video_core/renderer_null/null_rasterizer.cpp +++ b/src/video_core/renderer_null/null_rasterizer.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -69,10 +72,12 @@ void RasterizerNull::SignalFence(std::function&& func) { void RasterizerNull::SyncOperation(std::function&& func) { func(); } -void RasterizerNull::SignalSyncPoint(u32 value) { +void RasterizerNull::SignalSyncPoint(u32 value, u32 count) { auto& syncpoint_manager = m_gpu.Host1x().GetSyncpointManager(); - syncpoint_manager.IncrementGuest(value); - syncpoint_manager.IncrementHost(value); + for (u32 i = 0; i < count; ++i) { + syncpoint_manager.IncrementGuest(value); + syncpoint_manager.IncrementHost(value); + } } void RasterizerNull::SignalReference() {} void RasterizerNull::ReleaseFences(bool) {} diff --git a/src/video_core/renderer_null/null_rasterizer.h b/src/video_core/renderer_null/null_rasterizer.h index c7f5849c75..c98da41f15 100644 --- a/src/video_core/renderer_null/null_rasterizer.h +++ b/src/video_core/renderer_null/null_rasterizer.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -61,7 +64,7 @@ public: void ModifyGPUMemory(size_t as_id, GPUVAddr addr, u64 size) override; void SignalFence(std::function&& func) override; void SyncOperation(std::function&& func) override; - void SignalSyncPoint(u32 value) override; + void SignalSyncPoint(u32 value, u32 count) override; void SignalReference() override; void ReleaseFences(bool force) override; void FlushAndInvalidateRegion( diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 1d77d28c46..35d47856eb 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -615,8 +615,8 @@ void RasterizerOpenGL::SyncOperation(std::function&& func) { fence_manager.SyncOperation(std::move(func)); } -void RasterizerOpenGL::SignalSyncPoint(u32 value) { - fence_manager.SignalSyncPoint(value); +void RasterizerOpenGL::SignalSyncPoint(u32 value, u32 count) { + fence_manager.SignalSyncPoint(value, count); } void RasterizerOpenGL::SignalReference() { diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 6eae51ff7d..338c5eb877 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: 2015 Citra Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -106,7 +109,7 @@ public: void ModifyGPUMemory(size_t as_id, GPUVAddr addr, u64 size) override; void SignalFence(std::function&& func) override; void SyncOperation(std::function&& func) override; - void SignalSyncPoint(u32 value) override; + void SignalSyncPoint(u32 value, u32 count) override; void SignalReference() override; void ReleaseFences(bool force = true) override; void FlushAndInvalidateRegion( diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 6bd608c9ea..805c9adf2c 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -862,8 +862,8 @@ void RasterizerVulkan::SyncOperation(std::function&& func) { fence_manager.SyncOperation(std::move(func)); } -void RasterizerVulkan::SignalSyncPoint(u32 value) { - fence_manager.SignalSyncPoint(value); +void RasterizerVulkan::SignalSyncPoint(u32 value, u32 count) { + fence_manager.SignalSyncPoint(value, count); } void RasterizerVulkan::SignalReference() { diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index b05d12e2f1..57d3aa5cf6 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -111,7 +111,7 @@ public: void ModifyGPUMemory(size_t as_id, GPUVAddr addr, u64 size) override; void SignalFence(std::function&& func) override; void SyncOperation(std::function&& func) override; - void SignalSyncPoint(u32 value) override; + void SignalSyncPoint(u32 value, u32 count) override; void SignalReference() override; void ReleaseFences(bool force = true) override; void FlushAndInvalidateRegion( From 9d620bba887964eb79f54075452f801d2295a1f3 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 1 Oct 2026 23:56:07 -0400 Subject: [PATCH 161/198] Address son sync issues --- .../renderer_vulkan/vk_buffer_cache.cpp | 20 +++++++++++++++++-- .../renderer_vulkan/vk_buffer_cache.h | 1 + .../renderer_vulkan/vk_rasterizer.cpp | 9 +++++---- .../renderer_vulkan/vk_rasterizer.h | 1 + .../renderer_vulkan/vk_scheduler.cpp | 13 +----------- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 8d748393fd..49926d01ad 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -26,6 +26,15 @@ namespace Vulkan { namespace { constexpr u32 COMPACT_VERTEX_BINDINGS = 8; +constexpr VkMemoryBarrier2 HOST_READ_BARRIER{ + .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, + .pNext = nullptr, + .srcStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, + .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, + .dstStageMask = VK_PIPELINE_STAGE_2_HOST_BIT, + .dstAccessMask = VK_ACCESS_2_HOST_READ_BIT, +}; + template struct VertexBindings { std::array buffers; @@ -527,9 +536,16 @@ bool BufferCacheRuntime::CanReorderUpload(const Buffer& buffer, std::span BufferCacheRuntime::DirectDownloadSpan(Buffer& buffer) { const std::span mapping = buffer.CoherentMapping(); - if (!mapping.empty()) { - scheduler.Wait((std::max)(buffer.getWriteTick(), buffer.LastUploadTick())); + if (mapping.empty()) { + return mapping; } + if ((std::max)(buffer.getWriteTick(), buffer.LastUploadTick()) > host_read_tick) { + scheduler.RequestOutsideRenderPassOperationContext(); + scheduler.Record( + [](vk::CommandBuffer cmdbuf) { cmdbuf.PipelineBarrier(HOST_READ_BARRIER); }); + host_read_tick = scheduler.CurrentTick(); + } + scheduler.Wait(host_read_tick); return mapping; } diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index f4c4c53906..3209019bdf 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -291,6 +291,7 @@ private: VkMemoryBarrier2 read_barrier; VkMemoryBarrier2 write_barrier; + u64 host_read_tick = 0; bool limit_dynamic_storage_buffers = false; u32 max_dynamic_storage_buffers = (std::numeric_limits::max)(); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 805c9adf2c..a7bf7aecfd 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -898,7 +898,9 @@ void RasterizerVulkan::TiledCacheBarrier() { } void RasterizerVulkan::FlushCommands() { - if (draw_counter == 0) { + if (draw_tick != scheduler.CurrentTick() || + (scheduler.IsRenderPassActive() && + !maxwell3d->dirty.flags[VideoCommon::Dirty::RenderTargets])) { return; } draw_counter = 0; @@ -1008,11 +1010,10 @@ void RasterizerVulkan::FlushWork() { maxwell3d->dirty.flags[VideoCommon::Dirty::RenderTargets])) { scheduler.Flush(); draw_counter = 0; - return; - } - if ((draw_counter & CHECK_MASK) == CHECK_MASK && !scheduler.IsRenderPassActive()) { + } else if ((draw_counter & CHECK_MASK) == CHECK_MASK && !scheduler.IsRenderPassActive()) { scheduler.DispatchWork(); } + draw_tick = scheduler.CurrentTick(); } AccelerateDMA::AccelerateDMA(BufferCache& buffer_cache_, TextureCache& texture_cache_, diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 57d3aa5cf6..1d54694f2c 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -227,6 +227,7 @@ private: boost::container::static_vector sampler_handles; u32 draw_counter = 0; + u64 draw_tick = 0; Tegra::DepthFormat depth_bias_zeta_format{}; std::array vertex_input_strides{}; u32 vertex_input_attributes{}; diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 91aac1a51d..1851f0b628 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -32,15 +32,6 @@ namespace Vulkan { namespace { constexpr size_t DEPTH_VIEW = 8; -constexpr VkMemoryBarrier2 HOST_READ_BARRIER{ - .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - .pNext = nullptr, - .srcStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, - .srcAccessMask = VK_ACCESS_2_MEMORY_WRITE_BIT, - .dstStageMask = VK_PIPELINE_STAGE_2_HOST_BIT, - .dstAccessMask = VK_ACCESS_2_HOST_READ_BIT, -}; - struct BeginRenderingCommand { void operator()(vk::CommandBuffer cmdbuf, vk::CommandBuffer) const { BeginRendering(cmdbuf, attachments); @@ -478,6 +469,7 @@ void Scheduler::AllocateWorkerCommandBuffer() { } u64 Scheduler::SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_semaphore) { + master_semaphore->Refresh(); EndPendingOperations(); InvalidateState(); @@ -486,9 +478,6 @@ u64 Scheduler::SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_se this](vk::CommandBuffer cmdbuf, vk::CommandBuffer upload_cmdbuf) { upload_cmdbuf.PipelineBarrier(upload_write_barrier); upload_cmdbuf.End(); - if (device.IsUMA()) { - cmdbuf.PipelineBarrier(HOST_READ_BARRIER); - } cmdbuf.End(); if (on_submit) { From b8478a570ba79890d7afdc000f63b5107773d0e9 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 2 Oct 2026 00:47:24 -0400 Subject: [PATCH 162/198] Experiments with TS on turnip --- src/video_core/vulkan_common/vulkan_device.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index cd5e5a8412..4a02299a33 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -879,9 +879,6 @@ bool Device::ShouldBoostClocks() const { } bool Device::HasTimelineSemaphore() const { - if (GetDriverID() == VK_DRIVER_ID_MESA_TURNIP) { - return false; - } return features.timeline_semaphore.timelineSemaphore; } From 0b7d216a099b8e25fcc2e5322675a1bd86565dfa Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 2 Oct 2026 01:41:19 -0400 Subject: [PATCH 163/198] Address some regressions with unswizzle changes + barriers reductions --- src/video_core/renderer_vulkan/vk_compute_pass.cpp | 12 ++++-------- src/video_core/texture_cache/texture_cache.h | 7 +++---- src/video_core/vulkan_common/vulkan_device.cpp | 3 +++ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 6bee2407b7..f1b0248233 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp @@ -697,8 +697,7 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, } const VkImageAspectFlags aspect_mask = image.AspectMask(); const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, - image.ExchangeInitialization()); + RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, !reorder); for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { const size_t input_offset = swizzle.buffer_offset + map.offset; const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 8U); @@ -760,8 +759,7 @@ void BlockLinearUnswizzleImage2DPass::Unswizzle( } const VkImageAspectFlags aspect_mask = image.AspectMask(); const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, - image.ExchangeInitialization()); + RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, !reorder); for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { const size_t input_offset = swizzle.buffer_offset + map.offset; const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 32U); @@ -810,8 +808,7 @@ void BlockLinearUnswizzleImage3DPass::Unswizzle( } const VkImageAspectFlags aspect_mask = image.AspectMask(); const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, - image.ExchangeInitialization()); + RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, !reorder); for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { const size_t input_offset = swizzle.buffer_offset + map.offset; const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 16U); @@ -873,8 +870,7 @@ void PitchUnswizzlePass::Unswizzle(Image& image, const StagingBufferRef& map, } const VkImageAspectFlags aspect_mask = image.AspectMask(); const VkImage vk_image = image.Handle(); - RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, - image.ExchangeInitialization()); + RecordUnswizzleBeginBarrier(scheduler, reorder, *pipeline, vk_image, aspect_mask, !reorder); for (const VideoCommon::SwizzleParameters& swizzle : swizzles) { const size_t input_offset = swizzle.buffer_offset + map.offset; const u32 num_dispatches_x = Common::DivCeil(swizzle.num_tiles.width, 32U); diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 5975ae13a7..2e26880868 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1029,6 +1029,8 @@ void TextureCache

::RefreshContents(Image& image, ImageId image_id) { runtime.TransitionImageLayout(image); return; } + gpu_memory->FlushRegion(image.gpu_addr, image.guest_size_bytes, + VideoCommon::CacheType::NoTextureCache); if (True(image.flags & ImageFlagBits::AsynchronousDecode)) { QueueAsyncDecode(image, image_id); return; @@ -1042,8 +1044,6 @@ void TextureCache

::RefreshContents(Image& image, ImageId image_id) { device_memory.GetSpan(*device_addr, image.guest_size_bytes), image.guest_size_bytes); if (source) { - gpu_memory->FlushRegion(image.gpu_addr, image.guest_size_bytes, - VideoCommon::CacheType::NoTextureCache); runtime.AccelerateImageUpload( image, *source, FixSmallVectorADL(FullUploadSwizzles(image.info))); return; @@ -1076,8 +1076,7 @@ void TextureCache

::UploadImageContents(Image& image, StagingBuffer& staging) const GPUVAddr gpu_addr = image.gpu_addr; if (True(image.flags & ImageFlagBits::AcceleratedUpload)) { - gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), image.guest_size_bytes, - VideoCommon::CacheType::NoTextureCache); + gpu_memory->ReadBlockUnsafe(gpu_addr, mapped_span.data(), image.guest_size_bytes); const auto uploads = FullUploadSwizzles(image.info); runtime.AccelerateImageUpload(image, staging, FixSmallVectorADL(uploads)); return; diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 4a02299a33..cd5e5a8412 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -879,6 +879,9 @@ bool Device::ShouldBoostClocks() const { } bool Device::HasTimelineSemaphore() const { + if (GetDriverID() == VK_DRIVER_ID_MESA_TURNIP) { + return false; + } return features.timeline_semaphore.timelineSemaphore; } From 013deb4f3f5574d868072ecae05c7476bdfe1a47 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 2 Oct 2026 03:59:24 -0400 Subject: [PATCH 164/198] Revert "Address turnip bug with depths" --- .../host_shaders/convert_d24s8_to_abgr8.frag | 16 ++++++++-------- .../host_shaders/convert_s8d24_to_abgr8.frag | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/video_core/host_shaders/convert_d24s8_to_abgr8.frag b/src/video_core/host_shaders/convert_d24s8_to_abgr8.frag index 12b4e85600..b81a540561 100644 --- a/src/video_core/host_shaders/convert_d24s8_to_abgr8.frag +++ b/src/video_core/host_shaders/convert_d24s8_to_abgr8.frag @@ -1,11 +1,11 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 +precision mediump int; +precision highp float; + layout(binding = 0) uniform sampler2D depth_tex; layout(binding = 1) uniform usampler2D stencil_tex; @@ -13,10 +13,10 @@ layout(location = 0) out vec4 color; void main() { ivec2 coord = ivec2(gl_FragCoord.xy); - uint depth_val = - uint(roundEven(clamp(textureLod(depth_tex, coord, 0).r, 0.0, 1.0) * (exp2(24.0) - 1.0))); - uint stencil_val = textureLod(stencil_tex, coord, 0).r; - uvec4 components = - uvec4(stencil_val, (uvec3(depth_val) >> uvec3(16u, 8u, 0u)) & 0x000000FFu); + highp uint depth_val = + uint(textureLod(depth_tex, coord, 0).r * (exp2(32.0) - 1.0)); + lowp uint stencil_val = textureLod(stencil_tex, coord, 0).r; + highp uvec4 components = + uvec4(stencil_val, (uvec3(depth_val) >> uvec3(24u, 16u, 8u)) & 0x000000FFu); color.abgr = vec4(components) / (exp2(8.0) - 1.0); } diff --git a/src/video_core/host_shaders/convert_s8d24_to_abgr8.frag b/src/video_core/host_shaders/convert_s8d24_to_abgr8.frag index b06768fe31..6a457981d1 100644 --- a/src/video_core/host_shaders/convert_s8d24_to_abgr8.frag +++ b/src/video_core/host_shaders/convert_s8d24_to_abgr8.frag @@ -1,11 +1,11 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 +precision mediump int; +precision highp float; + layout(binding = 0) uniform sampler2D depth_tex; layout(binding = 1) uniform usampler2D stencil_tex; @@ -13,10 +13,10 @@ layout(location = 0) out vec4 color; void main() { ivec2 coord = ivec2(gl_FragCoord.xy); - uint depth_val = - uint(roundEven(clamp(textureLod(depth_tex, coord, 0).r, 0.0, 1.0) * (exp2(24.0) - 1.0))); - uint stencil_val = textureLod(stencil_tex, coord, 0).r; - uvec4 components = - uvec4((uvec3(depth_val) >> uvec3(16u, 8u, 0u)) & 0x000000FFu, stencil_val); + highp uint depth_val = + uint(textureLod(depth_tex, coord, 0).r * (exp2(32.0) - 1.0)); + lowp uint stencil_val = textureLod(stencil_tex, coord, 0).r; + highp uvec4 components = + uvec4((uvec3(depth_val) >> uvec3(24u, 16u, 8u)) & 0x000000FFu, stencil_val); color.rgba = vec4(components) / (exp2(8.0) - 1.0); } From 48aeedd3b3c915b89aecfbda23c2462c0ed5746f Mon Sep 17 00:00:00 2001 From: Eden CI Date: Mon, 5 Oct 2026 21:18:09 +0200 Subject: [PATCH 165/198] [dist, android] Update translations from Transifex for Oct 05 (#4507) Automatic translation update for Oct 05 Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4507 --- dist/languages/ar.ts | 597 +++++++++--------- dist/languages/ca.ts | 424 ++++++------- dist/languages/cs.ts | 424 ++++++------- dist/languages/da.ts | 424 ++++++------- dist/languages/de.ts | 425 ++++++------- dist/languages/el.ts | 424 ++++++------- dist/languages/es.ts | 425 ++++++------- dist/languages/fi.ts | 436 +++++++------ dist/languages/fr.ts | 425 ++++++------- dist/languages/hu.ts | 424 ++++++------- dist/languages/id.ts | 424 ++++++------- dist/languages/it.ts | 425 ++++++------- dist/languages/ja_JP.ts | 424 ++++++------- dist/languages/ko_KR.ts | 425 ++++++------- dist/languages/nb.ts | 424 ++++++------- dist/languages/nl.ts | 424 ++++++------- dist/languages/pl.ts | 425 ++++++------- dist/languages/pt_BR.ts | 425 ++++++------- dist/languages/pt_PT.ts | 424 ++++++------- dist/languages/ru_RU.ts | 425 ++++++------- dist/languages/sv.ts | 431 +++++++------ dist/languages/tr_TR.ts | 424 ++++++------- dist/languages/uk.ts | 434 +++++++------ dist/languages/vi.ts | 424 ++++++------- dist/languages/vi_VN.ts | 424 ++++++------- dist/languages/zh_CN.ts | 425 ++++++------- dist/languages/zh_TW.ts | 424 ++++++------- .../app/src/main/res/values-ar/strings.xml | 30 +- .../src/main/res/values-zh-rTW/strings.xml | 287 +++++---- 29 files changed, 5854 insertions(+), 6122 deletions(-) diff --git a/dist/languages/ar.ts b/dist/languages/ar.ts index 9a735c85be..472f7ac609 100644 --- a/dist/languages/ar.ts +++ b/dist/languages/ar.ts @@ -303,12 +303,12 @@ This would ban both their forum username and their IP address. Enable Overlay Applet - تمكين التطبيق المصغر للطبقة + تفعيل التطبيق المصغر للطبقة Enables Horizon's built-in overlay applet. Press and hold the home button for 1 second to show it. - تمكين التطبيق الصغير المدمج في Horizon. اضغط مع الاستمرار على زر الشاشة الرئيسية لمدة 1 ثانية لإظهاره. + تفعيل التطبيق المصغر المدمج في هورايزون. اضغط مع الاستمرار على زر الشاشة الرئيسية لمدة 1 ثانية لإظهاره. @@ -413,7 +413,7 @@ Can help reduce stuttering at lower framerates. Accuracy: - :الدقة + :دقة المحاكاة @@ -451,7 +451,7 @@ Weaker CPUs may see reduced performance, and certain games may behave improperly Enable Host MMU Emulation (fastmem) - (fastmem) المضيف MMU تمكين محاكاة + (fastmem) المضيف MMU تفعيل محاكاة @@ -759,7 +759,7 @@ Unreal Engine 4 games often see the most significant changes thereof. Enable asynchronous presentation (Vulkan only) - (Vulkan فقط) تمكين العرض التقديمي غير المتزامن + (Vulkan فقط) تفعيل العرض التقديمي غير المتزامن @@ -919,7 +919,7 @@ This option can improve shader loading time significantly in cases where the Vul Enable Compute Pipelines (Intel Vulkan Only) - (Intel Vulkan فقط) تمكين خطوط أنابيب الحوسبة + (Intel Vulkan فقط) تفعيل خطوط أنابيب الحوسبة @@ -933,7 +933,7 @@ Compute pipelines are always enabled on all other drivers. Enable Reactive Flushing - تمكين التنظيف التفاعلي + تفعيل التنظيف التفاعلي @@ -963,7 +963,7 @@ Compute pipelines are always enabled on all other drivers. Enable buffer history - تمكين سجل التخزين المؤقت + تفعيل سجل التخزين المؤقت @@ -1154,7 +1154,7 @@ Setting to Handheld can help improve performance for low end systems. Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. يتجاوز المطالبات التي تطلب تأكيد إيقاف المحاكاة. -يؤدي تمكينه إلى تجاوز هذه المطالبات والخروج مباشرة من المحاكاة. +يؤدي تفعيله إلى تجاوز هذه المطالبات والخروج مباشرة من المحاكاة. @@ -1168,994 +1168,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - تعطيل تطبيق التحكم - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - يُعطّل استخدام أداة التحكم في البرامج المُحاكاة قسرًا. -عند محاولة أي برنامج فتح أداة التحكم، تُغلق فورًا. - - - Check for updates التحقق من توفر التحديثات - + Whether or not to check for updates upon startup. ما إذا كان يجب التحقق من التحديثات عند بدء التشغيل أم لا. - + Enable Gamemode - تمكين وضع اللعبة + تفعيل وضع اللعبة - + Force X11 as Graphics Backend كخلفية رسومات X11 فرض - + Custom frontend الواجهة الأمامية المخصصة - + Real applet تطبيق صغير حقيقي - + + + Disabled + معطل + + + Never أبداً - + On Load عند التحميل - + Always دائماً - + CPU وحدة المعالجة المركزية - + GPU وحدة معالجة الرسومات - + CPU Asynchronous وحدة المعالجة المركزية غير المتزامنة - + Uncompressed (Best quality) Uncompressed (أفضل جودة) - + BC1 (Low quality) BC1 (جودة منخفضة) - + BC3 (Medium quality) BC3 (جودة متوسطة) - - + + Auto تلقائي - + 30 FPS 30 إطارًا في الثانية - + 60 FPS 60 إطارًا في الثانية - + 90 FPS 90 إطارًا في الثانية - + 120 FPS 120 إطارًا في الثانية - + Conservative محافظ - + Aggressive عدواني - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null لا شيء - + Fast سريع - - - + + + Accurate دقه - - - + + + Default افتراضي - + Unsafe (fast) غير آمن (سريع) - + Safe (stable) آمن (مستقر) - + Immediate فوري - + Balanced متوازن - + Unsafe غير آمن - + Paranoid (disables most optimizations) - جنون العظمة (يعطل معظم التحسينات) + شديد الحذر (يعطل معظم التحسينات) - + Debugging تصحيح الأخطاء - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed نافذة بلا حدود - + Exclusive Fullscreen شاشة كاملة حصرية - + No Video Output لا يوجد إخراج فيديو - + CPU Video Decoding فك تشفير فيديو وحدة المعالجة المركزية - + GPU Video Decoding (Default) فك تشفير فيديو وحدة معالجة الرسومات (افتراضي) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [تجريبي] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [تجريبي] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [تجريبي] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [تجريبي] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [تجريبي] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution دقة فائقة للألعاب من سنابدراغون - + Snapdragon Game Super Resolution EdgeDir دقة فائقة للألعاب من سنابدراغون EdgeDir - + None لا شيء - + FXAA FXAA - + SMAA SMAA - + Default (16:9) (16:9) افتراضي - + Force 4:3 4:3 فرض - + Force 21:9 21:9 فرض - + Force 16:10 16:10 فرض - + Stretch to Window تمديد إلى النافذة - + Automatic تلقائي - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) اليابانية (日本語) - + American English الإنجليزية الأمريكية - + French (français) الفرنسية (français) - + German (Deutsch) الألمانية (Deutsch) - + Italian (italiano) الإيطالية (Italiano) - + Spanish (español) الإسبانية (español) - + Chinese الصينية - + Korean (한국어) الكورية (한국어) - + Dutch (Nederlands) الهولندية (Nederlands) - + Portuguese (português) البرتغالية (Português) - + Russian (Русский) الروسية (Русский) - + Taiwanese تايواني - + British English الإنجليزية البريطانية - + Canadian French الكندية الفرنسية - + Latin American Spanish أمريكا اللاتينية الإسبانية - + Simplified Chinese الصينية المبسطة - + Traditional Chinese (正體中文) الصينية التقليدية (正體中文) - + Brazilian Portuguese (português do Brasil) البرتغالية البرازيلية (português do Brasil) - + Polish (polska) البولندية (polska) - + Thai (แบบไทย) التايلاندية (แบบไทย) - - + + Japan اليابان - + USA الولايات المتحدة الأمريكية - + Europe أوروبا - + Australia أستراليا - + China الصين - + Korea كوريا - + Taiwan تايوان - + Auto (%1) Auto select time zone تلقائي (%1) - + Default (%1) Default time zone افتراضي (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba - كوبا + Cuba - + EET EET - + Egypt - مصر + Egypt - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT - توقيت غرينتش + GMT + + + + GMT+0 + GMT+0 + + + + GMT-0 + GMT-0 - GMT+0 - توقيت غرينتش +0 + GMT0 + GMT0 - GMT-0 - -0 توقيت غرينتش + Greenwich + Greenwich - GMT0 - 0 توقيت غرينتش + Hongkong + Hongkong - Greenwich - غرينتش - - - - Hongkong - هونغ كونغ - - - HST HST - + Iceland - أيسلندا + Iceland + + + + Iran + Iran + + + + Israel + Israel - Iran - إيران - - - - Israel - إسرائيل + Jamaica + Jamaica - Jamaica - جامايكا - - - Kwajalein Kwajalein - + Libya - ليبيا + Libya - + MET - توقيت وسط أوروبا + MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland - بولندا + Poland - + Portugal - البرتغال + Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore - سنغافورة + Singapore - + Turkey - تركيا + Turkey - + UCT UCT - + Universal - عالمي + Universal - + UTC UTC - + W-SU W-SU - + WET - توقيت غرب أوروبا + WET - + Zulu Zulu - + Mono أحادي - + Stereo مجسم - + Surround محيطي - + 4GB DRAM (Default) 4GB DRAM (افتراضي) - + 6GB DRAM (Unsafe) 6GB DRAM (غير آمنة) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (غير آمنة) - + 12GB DRAM (Unsafe) 12GB DRAM (غير آمنة) - + Docked الإرساء - + Handheld محمول - - + + Normal قياسي - - + + Boost تعزيز - - + + Overclock كسر السرعة - + Always ask (Default) اسأل دائمًا (افتراضي) - + Only if game specifies not to stop فقط إذا حددت اللعبة عدم التوقف - + Never ask لا تسأل أبدا - + Very Small (16 MB) صغير جدًا (16 ميغابايت) - + Small (32 MB) صغير (32 ميغابايت) - + Normal (128 MB) قياسي (128 ميغابايت) - + Large (256 MB) كبير (256 ميغابايت) - + Very Large (512 MB) كبير جدًا (512 ميغابايت) - + Very Low (4 MB) منخفض جدًا (4 ميغابايت) - + Low (8 MB) منخفض (8 ميغابايت) - + Normal (16 MB) قياسي (16 ميغابايت) - + Medium (32 MB) متوسط (32 ميغابايت) - + High (64 MB) عالي (64 ميغابايت) - + Very Low (32) منخفض جدًا (32) - + Low (64) منخفض (64) - + Normal (128) قياسي (128) - + Medium (256) متوسط (256) - + High (512) عالي (512) - - Disabled - معطل - - - + ExtendedDynamicState 1 الحالة الديناميكية الممتدة 1 - + ExtendedDynamicState 2 الحالة الديناميكية الممتدة 2 - + ExtendedDynamicState 3 الحالة الديناميكية الممتدة 3 - + Tree View عرض قائمة - + Grid View عرض شبكة @@ -2207,7 +2196,7 @@ When a program attempts to open the controller applet, it is immediately closed. Input device: - :جهاز الادخال + :جهاز الإدخال @@ -2293,7 +2282,7 @@ When a program attempts to open the controller applet, it is immediately closed. <html><head/><body><p><span style=" font-weight:600;">For debugging only.</span><br/>If you're not sure what these do, keep all of these enabled. <br/>These settings, when disabled, only take effect when CPU Debugging is enabled. </p></body></html> - <html><head/><body><p><span style=" font-weight:600;">للتصحيح فقط.</span><br/>إذا لم تكن متأكدًا من وظيفة هذه الخيارات، فاتركها جميعًا ممكّنة. <br/>عند تعطيل هذه الإعدادات، لا تصبح سارية المفعول إلا عند تمكين تصحيح أخطاء وحدة المعالجة المركزية. </p></body></html> + <html><head/><body><p><span style=" font-weight:600;">للتصحيح فقط.</span><br/>إذا لم تكن متأكدًا من وظيفة هذه الخيارات، فاتركها جميعًا ممكّنة. <br/>عند تعطيل هذه الإعدادات، لا تصبح سارية المفعول إلا عند تفعيل تصحيح أخطاء وحدة المعالجة المركزية. </p></body></html> @@ -2304,14 +2293,14 @@ When a program attempts to open the controller applet, it is immediately closed. <div style="white-space: nowrap">يعمل هذا التحسين على تسريع عمليات الوصول إلى الذاكرة بواسطة برنامج الضيف.</div> -<div style="white-space: nowrap">يؤدي تمكينه إلى تضمين الوصول إلى مؤشرات PageTable::pointers في الكود الصادر.</div> +<div style="white-space: nowrap">يؤدي تفعيله إلى تضمين الوصول إلى مؤشرات PageTable::pointers في الكود الصادر.</div> <div style="white-space: nowrap">يؤدي تعطيل هذا إلى إجبار جميع عمليات الوصول إلى الذاكرة على المرور عبر وظائف Memory::Read/Memory::Write.</div> Enable inline page tables - تمكين جداول الصفحات المضمنة + تفعيل جداول الصفحات المضمنة @@ -2339,7 +2328,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable return stack buffer - تمكين مخزن مؤقت لمكدس الإرجاع + تفعيل مخزن مؤقت لمكدس الإرجاع @@ -2353,7 +2342,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable fast dispatcher - تمكين المرسل السريع + تفعيل الموزع السريع @@ -2367,7 +2356,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable context elimination - تمكين حذف السياق + تفعيل حذف السياق @@ -2381,7 +2370,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable constant propagation - تمكين الانتشار الثابت + تفعيل الانتشار الثابت @@ -2395,7 +2384,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable miscellaneous optimizations - تمكين التحسينات المتنوعة + تفعيل التحسينات المتنوعة @@ -2404,14 +2393,14 @@ When a program attempts to open the controller applet, it is immediately closed. <div style="white-space: nowrap">When disabled, a misalignment is triggered on all misaligned accesses.</div> - <div style="white-space: nowrap">عند التمكين، لا يتم تشغيل عدم المحاذاة إلا عندما يتجاوز الوصول حدود الصفحة</div> + <div style="white-space: nowrap">عند التفعيل، لا يتم تشغيل عدم المحاذاة إلا عندما يتجاوز الوصول حدود الصفحة</div> <div style="white-space: nowrap">عند التعطيل، يتم تشغيل عدم المحاذاة على جميع عمليات الوصول غير المتوافقة</div> Enable misalignment check reduction - تمكين تقليل التحقق من المحاذاة غير الصحيحة + تفعيل تقليل التحقق من المحاذاة غير الصحيحة @@ -2422,14 +2411,14 @@ When a program attempts to open the controller applet, it is immediately closed. <div style="white-space: nowrap">يعمل هذا التحسين على تسريع عمليات الوصول إلى الذاكرة بواسطة برنامج الضيف.</div> -<div style="white-space: nowrap">يؤدي تمكينه إلى إجراء عمليات قراءة/كتابة ذاكرة الضيف مباشرة في الذاكرة والاستفادة من وحدة MMU الخاصة بالمضيف.</div> +<div style="white-space: nowrap">يؤدي تفعيله إلى إجراء عمليات قراءة/كتابة ذاكرة الضيف مباشرة في الذاكرة والاستفادة من وحدة MMU الخاصة بالمضيف.</div> <div style="white-space: nowrap">يؤدي تعطيل هذا إلى إجبار جميع عمليات الوصول إلى الذاكرة على استخدام محاكاة MMU البرمجية.</div> Enable Host MMU Emulation (general memory instructions) - المضيف (تعليمات الذاكرة العامة) MMU تمكين محاكاة + المضيف (تعليمات الذاكرة العامة) MMU تفعيل محاكاة @@ -2440,14 +2429,14 @@ When a program attempts to open the controller applet, it is immediately closed. <div style="white-space: nowrap">يعمل هذا التحسين على تسريع عمليات الوصول الحصري للذاكرة بواسطة برنامج الضيف.</div> -<div style="white-space: nowrap">يؤدي تمكينه إلى إجراء عمليات قراءة/كتابة للذاكرة الحصرية للضيوف مباشرة في الذاكرة والاستفادة من وحدة MMU الخاصة بالمضيف.</div> +<div style="white-space: nowrap">يؤدي تفعيله إلى إجراء عمليات قراءة/كتابة للذاكرة الحصرية للضيوف مباشرة في الذاكرة والاستفادة من وحدة MMU الخاصة بالمضيف.</div> <div style="white-space: nowrap">يؤدي تعطيل هذا إلى إجبار جميع عمليات الوصول الحصرية للذاكرة على استخدام محاكاة MMU البرمجية.</div> Enable Host MMU Emulation (exclusive memory instructions) - المضيف (تعليمات الذاكرة الحصرية) MMU تمكين محاكاة + المضيف (تعليمات الذاكرة الحصرية) MMU تفعيل محاكاة @@ -2457,13 +2446,13 @@ When a program attempts to open the controller applet, it is immediately closed. <div style="white-space: nowrap">يعمل هذا التحسين على تسريع عمليات الوصول الحصري للذاكرة بواسطة برنامج الضيف.</div> -<div style="white-space: nowrap">يؤدي تمكينه إلى تقليل التكلفة الإضافية لفشل fastmem في الوصول إلى الذاكرة الحصرية.</div> +<div style="white-space: nowrap">يؤدي تفعيله إلى تقليل التكلفة الإضافية لفشل fastmem في الوصول إلى الذاكرة الحصرية.</div> Enable recompilation of exclusive memory instructions - تمكين إعادة تجميع تعليمات الذاكرة الحصرية + تفعيل إعادة تجميع تعليمات الذاكرة الحصرية @@ -2473,13 +2462,13 @@ When a program attempts to open the controller applet, it is immediately closed. <div style="white-space: nowrap">يعمل هذا التحسين على تسريع عمليات الوصول إلى الذاكرة عن طريق السماح بنجاح الوصول إلى الذاكرة غير الصالحة.</div> - <div style="white-space: nowrap">يؤدي تمكينه إلى تقليل الحمل الزائد لجميع عمليات الوصول إلى الذاكرة وليس له أي تأثير على البرامج التي لا تصل إلى الذاكرة غير الصالحة.</div> + <div style="white-space: nowrap">يؤدي تفعيله إلى تقليل الحمل الزائد لجميع عمليات الوصول إلى الذاكرة وليس له أي تأثير على البرامج التي لا تصل إلى الذاكرة غير الصالحة.</div> Enable fallbacks for invalid memory accesses - تمكين الإجراءات الاحتياطية للوصول إلى الذاكرة غير الصالحة + تفعيل الإجراءات الاحتياطية للوصول إلى الذاكرة غير الصالحة @@ -2497,7 +2486,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable GDB Stub - GDB Stub تمكين + GDB Stub تفعيل @@ -2607,12 +2596,12 @@ When a program attempts to open the controller applet, it is immediately closed. When checked, it enables Nsight Aftermath crash dumps - Nsight Aftermath عند تحديد هذا الخيار، يتم تمكين عمليات تفريغ الأعطال الخاصة بـ + Nsight Aftermath عند تحديد هذا الخيار، يتم تفعيل عمليات تفريغ الأعطال الخاصة بـ Enable Nsight Aftermath - Nsight Aftermath تمكين + Nsight Aftermath تفعيل @@ -2627,7 +2616,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable Renderdoc Hotkey - Renderdoc تمكين مفتاح التشغيل السريع لـ + Renderdoc تفعيل مفتاح التشغيل السريع لـ @@ -2657,7 +2646,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable Graphics Debugging - تمكين تصحيح الرسومات + تفعيل تصحيح الرسومات @@ -2667,7 +2656,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable Shader Feedback - تمكين ملاحظات التظليل + تفعيل ملاحظات التظليل @@ -2712,12 +2701,12 @@ When a program attempts to open the controller applet, it is immediately closed. Enable All Controller Types - تمكين كافة أنواع اذرع التحكم + تفعيل كافة أنواع اذرع التحكم Enable Auto-Stub - تمكين الملحق تلقائي + تفعيل الملحق تلقائي @@ -2732,7 +2721,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable Debug Asserts - تمكين تأكيدات التصحيح + تفعيل تأكيدات التصحيح @@ -2742,7 +2731,7 @@ When a program attempts to open the controller applet, it is immediately closed. Battery Serial: - :رقم تسلسلي للبطارية + :الرقم التسلسلي للبطارية @@ -2777,7 +2766,7 @@ When a program attempts to open the controller applet, it is immediately closed. Enable this to output the latest generated audio command list to the console. Only affects games using the audio renderer. - قم بتمكين هذه الخيار لإخراج أحدث قائمة أوامر صوتية تم إنشاؤها إلى وحدة التحكم. يؤثر فقط على الألعاب التي تستخدم عارض الصوت. + قم بتفعيل هذه الخيار لإخراج أحدث قائمة أوامر صوتية تم إنشاؤها إلى وحدة التحكم. يؤثر فقط على الألعاب التي تستخدم عارض الصوت. @@ -2792,12 +2781,12 @@ When a program attempts to open the controller applet, it is immediately closed. Enable FS Access Log - FS تمكين سجل وصول + FS تفعيل سجل وصول Enable Verbose Reporting Services** - تمكين خدمات التقارير التفصيلية + تفعيل خدمات التقارير التفصيلية @@ -3770,12 +3759,12 @@ Would you like to delete the old save data? Enable XInput 8 player support (disables web applet) - (يعطل تطبيق الويب الصغير) XInput 8 تمكين دعم مشغل + (يعطل تطبيق الويب الصغير) XInput 8 تفعيل دعم مشغل Enable UDP controllers (not needed for motion) - (غير مطلوبة للحركة) UDP تمكين وحدات التحكم + (غير مطلوبة للحركة) UDP تفعيل وحدات التحكم @@ -4556,7 +4545,7 @@ To invert the axes, first move your joystick vertically, and then horizontally.< Enable mouse panning - تمكين تحريك الماوس + تفعيل تحريك الماوس @@ -4632,12 +4621,12 @@ Current values are %1% and %2% respectively. Emulated mouse is enabled. This is incompatible with mouse panning. - تم تمكين الماوس الذي تمت محاكاته. وهذا غير متوافق مع تحريك الماوس. + تم تفعيل الماوس الذي تمت محاكاته. وهذا غير متوافق مع تحريك الماوس. Emulated mouse is enabled - تم تمكين الماوس الذي تمت محاكاته + تم تفعيل الماوس الذي تمت محاكاته @@ -4670,7 +4659,7 @@ Current values are %1% and %2% respectively. Enable Airplane Mode - تمكين وضع الطيران + تفعيل وضع الطيران @@ -5197,7 +5186,7 @@ UUID: %2 Enable Ring Input - تمكين إدخال الحلقة + تفعيل إدخال الحلقة @@ -5245,12 +5234,12 @@ UUID: %2 Error enabling ring input - حدث خطأ أثناء تمكين إدخال الحلقة + حدث خطأ أثناء تفعيل إدخال الحلقة Direct Joycon driver is not enabled - لم يتم تمكين برنامج تشغيل جوي كون المباشر + لم يتم تفعيل برنامج تشغيل جوي كون المباشر @@ -5337,7 +5326,7 @@ UUID: %2 Enable TAS features - TAS تمكين ميزات + TAS تفعيل ميزات @@ -5758,7 +5747,7 @@ Drag points to change position, or double-click table cells to edit values. Enable Accurate Vibration - تمكين الاهتزاز الدقيق + تفعيل الاهتزاز الدقيق @@ -7079,7 +7068,7 @@ Debug Message: Enable Overlay Display Applet - تمكين التطبيق المصغر لعرض الطبقة + تفعيل التطبيق المصغر لعرض الطبقة @@ -8024,7 +8013,7 @@ Please, only use this feature to install updates and DLC. Game: %1 FPS - اللعبة: %1 إطاراً في الثانية + اللعبة: %1 إطار diff --git a/dist/languages/ca.ts b/dist/languages/ca.ts index 01653df505..82c2259280 100644 --- a/dist/languages/ca.ts +++ b/dist/languages/ca.ts @@ -1106,993 +1106,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Activa el mode joc - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + + + + Never Mai - + On Load - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservador - + Aggressive Agressiu - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Ensamblat d'ombrejadors, només NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, només AMD/Mesa) - + Null Nul - + Fast Ràpid - - - + + + Accurate Precís - - - + + + Default Valor predeterminat - + Unsafe (fast) Insegur (ràpid) - + Safe (stable) Segur (estable) - + Immediate - + Balanced Equilibrat - + Unsafe Insegur - + Paranoid (disables most optimizations) Paranoic (desactiva la majoria d'optimitzacions) - + Debugging Depuració - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Finestra sense vores - + Exclusive Fullscreen Pantalla completa exclusiva - + No Video Output Sense sortida de vídeo - + CPU Video Decoding Descodificació de vídeo a la CPU - + GPU Video Decoding (Default) Descodificació de vídeo a la GPU (Valor predeterminat) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Veí més proper - + Bilinear Bilineal - + Bicubic Bicúbic - + Gaussian Gaussià - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution Super resolució AMD FidelityFX - + Area Àrea - + MMPX MMPX - + Zero-Tangent Tangència zero - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Cap - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Valor predeterminat (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 - + Stretch to Window Estirar a la finestra - + Automatic Automàtic - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonès (日本語) - + American English Anglès americà - + French (français) Francès (français) - + German (Deutsch) Alemany (Deutsch) - + Italian (italiano) Italià (italiano) - + Spanish (español) Castellà (español) - + Chinese Xinès - + Korean (한국어) Coreà (한국어) - + Dutch (Nederlands) Holandès (Nederlands) - + Portuguese (português) Portuguès (português) - + Russian (Русский) Rus (Русский) - + Taiwanese Taiwanès - + British English Anglès britànic - + Canadian French Francès canadenc - + Latin American Spanish Espanyol llatinoamericà - + Simplified Chinese Xinès simplificat - + Traditional Chinese (正體中文) Xinès tradicional (正體中文) - + Brazilian Portuguese (português do Brasil) Portuguès brasiler (português do Brasil) - + Polish (polska) Polonès (polska) - + Thai (แบบไทย) Tailandès (แบบไทย) - - + + Japan Japó - + USA EUA - + Europe Europa - + Australia Austràlia - + China Xina - + Korea Corea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Per defecte (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland Islàndia - + Iran Iran - + Israel Isreal - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polònia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estèreo - + Surround Envoltant - + 4GB DRAM (Default) 4GB DRAM (Insegur) - + 6GB DRAM (Unsafe) 6GB DRAM (Insegur) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Insegur) - + 12GB DRAM (Unsafe) 12GB DRAM (Insegur) - + Docked Sobretaula - + Handheld Portàtil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop Tan sols si el joc especifica no parar - + Never ask No preguntar mai - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/cs.ts b/dist/languages/cs.ts index b4a990d3f4..c6644fa046 100644 --- a/dist/languages/cs.ts +++ b/dist/languages/cs.ts @@ -1106,993 +1106,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + + + + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Automatické - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Přesné - - - + + + Default Výchozí - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Nebezpečné - + Paranoid (disables most optimizations) Paranoidní (zakáže většinu optimizací) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Okno bez okrajů - + Exclusive Fullscreen Exkluzivní - + No Video Output - + CPU Video Decoding - + GPU Video Decoding (Default) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) - + 3X (2160p/3240p) - + 4X (2880p/4320p) - + 5X (3600p/5400p) - + 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor - + Bilinear Bilineární - + Bicubic - + Gaussian - + Lanczos - + ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Žádné - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Výchozí (16:9) - + Force 4:3 Vynutit 4:3 - + Force 21:9 Vynutit 21:9 - + Force 16:10 - + Stretch to Window Roztáhnout podle okna - + Automatic - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonština (日本語) - + American English - + French (français) Francouzština (français) - + German (Deutsch) Nemčina (Deutsch) - + Italian (italiano) Italština (Italiano) - + Spanish (español) Španělština (español) - + Chinese Čínština - + Korean (한국어) Korejština (한국어) - + Dutch (Nederlands) Holandština (Nederlands) - + Portuguese (português) Portugalština (português) - + Russian (Русский) Ruština (Русский) - + Taiwanese Tajwanština - + British English Britská Angličtina - + Canadian French Kanadská Francouzština - + Latin American Spanish Latinsko Americká Španělština - + Simplified Chinese Zjednodušená Čínština - + Traditional Chinese (正體中文) Tradiční Čínština (正體中文) - + Brazilian Portuguese (português do Brasil) Brazilská Portugalština (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonsko - + USA USA - + Europe Evropa - + Australia Austrálie - + China Čína - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egypt - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamajka - + Kwajalein Kwajalein - + Libya Lybie - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polsko - + Portugal Portugalsko - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turecko - + UCT UCT - + Universal Univerzální - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Zadokovaná - + Handheld Příruční - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Vždy se zeptat (Výchozí) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/da.ts b/dist/languages/da.ts index a1ad0d6597..ed0bbc27d1 100644 --- a/dist/languages/da.ts +++ b/dist/languages/da.ts @@ -1108,993 +1108,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + + + + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Automatisk - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Nøjagtig - - - + + + Default Standard - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Usikker - + Paranoid (disables most optimizations) Paranoid (deaktiverer de fleste optimeringer) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Uindrammet Vindue - + Exclusive Fullscreen Eksklusiv Fuld Skærm - + No Video Output Ingen Video-Output - + CPU Video Decoding CPU-Video Afkodning - + GPU Video Decoding (Default) GPU-Video Afkodning (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75X (540p/810p) [EKSPERIMENTEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor Nærmeste Nabo - + Bilinear Bilineær - + Bicubic Bikubisk - + Gaussian Gausisk - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tving 4:3 - + Force 21:9 Tving 21:9 - + Force 16:10 - + Stretch to Window Stræk til Vindue - + Automatic - + 2x - + 4x - + 8x - + 16x - + Japanese (日本語) Japansk (日本語) - + American English - + French (français) Fransk (français) - + German (Deutsch) Tysk (Deutsch) - + Italian (italiano) Italiensk (italiano) - + Spanish (español) Spansk (español) - + Chinese Kinesisk - + Korean (한국어) Koreansk (한국어) - + Dutch (Nederlands) Hollandsk (Nederlands) - + Portuguese (português) Portugisisk (português) - + Russian (Русский) Russisk (Русский) - + Taiwanese Taiwanesisk - + British English Britisk Engelsk - + Canadian French Candadisk Fransk - + Latin American Spanish Latinamerikansk Spansk - + Simplified Chinese Forenklet Kinesisk - + Traditional Chinese (正體中文) Traditionelt Kinesisk (正體中文) - + Brazilian Portuguese (português do Brasil) Braziliansk Portugisisk (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China Kina - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ægypten - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Tyrkiet - + UCT UCT - + Universal Universel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Dokket - + Handheld Håndholdt - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/de.ts b/dist/languages/de.ts index d6b1fdbcb5..d845754236 100644 --- a/dist/languages/de.ts +++ b/dist/languages/de.ts @@ -1170,994 +1170,983 @@ Wenn diese Option aktiviert ist, werden solche Abfragen umgangen und die Emulati - Disable controller applet - Controller-Applet deaktivieren - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Deaktiviert die Verwendung des Controller-Applets in emulierten Programmen zwangsweise. -Wenn ein Programm versucht, das Controller-Applet zu öffnen, wird es sofort geschlossen. - - - Check for updates Auf Aktualisierungen überprüfen - + Whether or not to check for updates upon startup. Ob nach Aktualisierungen während des Startens gesucht werden soll. - + Enable Gamemode Spielmodus aktivieren - + Force X11 as Graphics Backend X11 als Grafik-Backend erzwingen - + Custom frontend Benutzerdefiniertes Frontend - + Real applet Echtes Applet - + + + Disabled + Deaktiviert + + + Never Niemals - + On Load Beim Laden - + Always Immer - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Asynchron - + Uncompressed (Best quality) Unkomprimiert (Beste Qualität) - + BC1 (Low quality) BC1 (Niedrige Qualität) - + BC3 (Medium quality) BC3 (Mittlere Qualität) - - + + Auto Auto - + 30 FPS 30 BpS - + 60 FPS 60 BpS - + 90 FPS 90 BpS - + 120 FPS 120 BpS - + Conservative Konservativ - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembler-Shader, nur NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (experimentell, nur AMD/Mesa) - + Null Null - + Fast Schnell - - - + + + Accurate Akkurat - - - + + + Default Vorgabe - + Unsafe (fast) Unsicher (schnell) - + Safe (stable) Sicher (stabil) - + Immediate Direkt - + Balanced Ausgeglichen - + Unsafe Unsicher - + Paranoid (disables most optimizations) Paranoid (deaktiviert die meisten Optimierungen) - + Debugging Fehlerbehebung - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Rahmenloses Fenster - + Exclusive Fullscreen Exklusiver Vollbildmodus - + No Video Output Keine Videoausgabe - + CPU Video Decoding CPU Video Dekodierung - + GPU Video Decoding (Default) GPU Video Dekodierung (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5X (360p/540p) [EXPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75X (540p/810p) [EXPERIMENTELL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1,5X (1080p/1620p) [EXPERIMENTELL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest-Neighbor - + Bilinear Bilinear - + Bicubic Bikubisch - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super-Auflösung - + Area Bereich - + MMPX MMPX - + Zero-Tangent Nulltangente - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Spiel-Superauflösung - + Snapdragon Game Super Resolution EdgeDir Snapdragon Spiel-Superauflösung EdgeDir - + None Keiner - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Vorgabe (16:9) - + Force 4:3 4:3 erzwingen - + Force 21:9 21:9 erzwingen - + Force 16:10 16:10 erzwingen - + Stretch to Window Auf Fenster anpassen - + Automatic Automatisch - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japanisch (日本語) - + American English Amerikanisches Englisch - + French (français) Französisch (français) - + German (Deutsch) Deutsch (German) - + Italian (italiano) Italienisch (italiano) - + Spanish (español) Spanisch (español) - + Chinese Chinesisch - + Korean (한국어) Koreanisch (한국어) - + Dutch (Nederlands) Niederländisch (Nederlands) - + Portuguese (português) Portugiesisch (português) - + Russian (Русский) Russisch (Русский) - + Taiwanese Taiwanesisch - + British English Britisches Englisch - + Canadian French Kanadisches Französisch - + Latin American Spanish Lateinamerikanisches Spanisch - + Simplified Chinese Vereinfachtes Chinesisch - + Traditional Chinese (正體中文) Traditionelles Chinesisch (正體中文) - + Brazilian Portuguese (português do Brasil) Brasilianisches Portugiesisch (português do Brasil) - + Polish (polska) Polnisch (Polen) - + Thai (แบบไทย) Thailändisch (Thailändische Version) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China China - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Automatisch (%1) - + Default (%1) Default time zone Standard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Ägypten - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Türkei - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Vorgabe) - + 6GB DRAM (Unsafe) 6GB DRAM (Unsicher) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Unsicher) - + 12GB DRAM (Unsafe) 12GB DRAM (Unsicher) - + Docked Angedockt - + Handheld Handgerät - - + + Normal Normal - - + + Boost Beschleunigung - - + + Overclock Übertaktung - + Always ask (Default) Immer fragen (Vorgabe) - + Only if game specifies not to stop Nur wenn ein Spiel vorgibt, nicht zu stoppen - + Never ask Niemals fragen - + Very Small (16 MB) Sehr klein (16 MB) - + Small (32 MB) Klein (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Groß (256 MB) - + Very Large (512 MB) Sehr groß (512 MB) - + Very Low (4 MB) Sehr niedrig (4 MB) - + Low (8 MB) Niedrig (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Mittel (32 MB) - + High (64 MB) Hoch (64 MB) - + Very Low (32) Sehr niedrig (32) - + Low (64) Niedrig (64) - + Normal (128) Normal (128) - + Medium (256) Mittel (256) - + High (512) Hoch (512) - - Disabled - Deaktiviert - - - + ExtendedDynamicState 1 ErweiterterDynamischerZustand 1 - + ExtendedDynamicState 2 ErweiterterDynamischerZustand 2 - + ExtendedDynamicState 3 ErweiterterDynamischerZustand 3 - + Tree View Baumansicht - + Grid View Rasteransicht diff --git a/dist/languages/el.ts b/dist/languages/el.ts index a9a5dd9012..b269f194ea 100644 --- a/dist/languages/el.ts +++ b/dist/languages/el.ts @@ -1108,993 +1108,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + + + + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Αυτόματη - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Ακριβής - - - + + + Default Προεπιλεγμένο - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Επισφαλής - + Paranoid (disables most optimizations) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Παραθυροποιημένο Χωρίς Όρια - + Exclusive Fullscreen Αποκλειστική Πλήρης Οθόνη - + No Video Output Χωρίς Έξοδο Βίντεο - + CPU Video Decoding Αποκωδικοποίηση Βίντεο CPU - + GPU Video Decoding (Default) Αποκωδικοποίηση Βίντεο GPU (Προεπιλογή) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [ΠΕΙΡΑΜΑΤΙΚΟ] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor Πλησιέστερος Γείτονας - + Bilinear Διγραμμικό - + Bicubic Δικυβικό - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Κανένα - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Προεπιλογή (16:9) - + Force 4:3 Επιβολή 4:3 - + Force 21:9 Επιβολή 21:9 - + Force 16:10 Επιβολή 16:10 - + Stretch to Window Επέκταση στο Παράθυρο - + Automatic Αυτόματα - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Ιαπωνικά (日本語) - + American English - + French (français) Γαλλικά (Français) - + German (Deutsch) Γερμανικά (Deutsch) - + Italian (italiano) Ιταλικά (Italiano) - + Spanish (español) Ισπανικά (Español) - + Chinese Κινέζικα - + Korean (한국어) Κορεάτικα (한국어) - + Dutch (Nederlands) Ολλανδικά (Nederlands) - + Portuguese (português) Πορτογαλικά (Português) - + Russian (Русский) Ρώσικα (Русский) - + Taiwanese Ταϊβανέζικα - + British English Βρετανικά Αγγλικά - + Canadian French Καναδικά Γαλλικά - + Latin American Spanish Λατινοαμερικάνικα Ισπανικά - + Simplified Chinese Απλοποιημένα Κινέζικα - + Traditional Chinese (正體中文) Παραδοσιακά Κινέζικα (正體中文) - + Brazilian Portuguese (português do Brasil) Πορτογαλικά Βραζιλίας (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Ιαπωνία - + USA ΗΠΑ - + Europe Ευρώπη - + Australia Αυστραλία - + China Κίνα - + Korea Κορέα - + Taiwan Ταϊβάν - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Κούβα - + EET EET - + Egypt Αίγυπτος - + Eire - + EST EST - + EST5EDT EST5EDT - + GB - + GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Γκρήνουιτς - + Hongkong Χονγκ Κονγκ - + HST HST - + Iceland Ισλανδία - + Iran Ιράν - + Israel Ισραήλ - + Jamaica Ιαμαϊκή - + Kwajalein - + Libya Λιβύη - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Ναβάχο - + NZ - + NZ-CHAT - + Poland Πολωνία - + Portugal Πορτογαλία - + PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Σιγκαπούρη - + Turkey Τουρκία - + UCT UCT - + Universal Παγκόσμια - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu - + Mono Μονοφωνικό - + Stereo Στέρεοφωνικό - + Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/es.ts b/dist/languages/es.ts index 949145a741..c565dc17f2 100644 --- a/dist/languages/es.ts +++ b/dist/languages/es.ts @@ -1164,994 +1164,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Desactivar applet de mandos - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Desactiva forzosamente el uso del applet del controlador en programas emulados. -Cuando un programa intenta abrir el applet del controlador, se cierra inmediatamente. - - - Check for updates Buscar actualizaciones - + Whether or not to check for updates upon startup. Si se deben buscar actualizaciones al iniciar o no. - + Enable Gamemode Activar Modo Juego - + Force X11 as Graphics Backend Forzar X11 como motor gráfico - + Custom frontend Interfaz personalizada - + Real applet Applet real - + + + Disabled + Desactivado + + + Never Nunca - + On Load Al cargar - + Always Siempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU asíncrona - + Uncompressed (Best quality) Sin compresión (Mejor calidad) - + BC1 (Low quality) BC1 (Calidad baja) - + BC3 (Medium quality) BC3 (Calidad media) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservativo - + Aggressive Agresivo - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Ensamblado de sombreadores, solo NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, solo AMD/Mesa) - + Null Ninguno - + Fast Rápido - - - + + + Accurate Preciso - - - + + + Default Predeterminado - + Unsafe (fast) Inseguro (rápido) - + Safe (stable) Seguro (estable) - + Immediate Inmediato - + Balanced Balanceado - + Unsafe Impreciso - + Paranoid (disables most optimizations) Paranoico (Deshabilita la mayoría de optimizaciones) - + Debugging Depuración - + Dynarmic DynARMic - + NCE NCE - + Borderless Windowed Ventana sin bordes - + Exclusive Fullscreen Pantalla completa - + No Video Output Sin salida de vídeo - + CPU Video Decoding Decodificación de vídeo en la CPU - + GPU Video Decoding (Default) Decodificación de vídeo en GPU (Por defecto) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] x0,5 (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] x0,75 (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) x1 (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] x1,5 (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) x2 (1440p/2160p) - + 3X (2160p/3240p) x3 (2160p/3240p) - + 4X (2880p/4320p) x4 (2880p/4320p) - + 5X (3600p/5400p) x5 (3600p/5400p) - + 6X (4320p/6480p) x6 (4320p/6480p) - + 7X (5040p/7560p) x7 (5040p/7560p) - + 8X (5760p/8640p) x8 (5760p/8640p) - + Nearest Neighbor Vecino más próximo - + Bilinear Bilineal - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution Super Resolución AMD FidelityFX - + Area Área - + MMPX MMPX - + Zero-Tangent Tangente cero - + B-Spline Ranura B - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Super resolución de juego Snapdragon - + Snapdragon Game Super Resolution EdgeDir Filo direcorio de super resolución de juego Snapdragon - + None Ninguno - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Predeterminado (16:9) - + Force 4:3 Forzar 4:3 - + Force 21:9 Forzar 21:9 - + Force 16:10 Forzar 16:10 - + Stretch to Window Estirar a la ventana - + Automatic Automático - + 2x x2 - + 4x x4 - + 8x x8 - + 16x x16 - + Japanese (日本語) Japonés (日本語) - + American English Inglés estadounidense - + French (français) Francés (français) - + German (Deutsch) Alemán (deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Español - + Chinese Chino - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandés (nederlands) - + Portuguese (português) Portugués (português) - + Russian (Русский) Ruso (Русский) - + Taiwanese Taiwanés - + British English Inglés británico - + Canadian French Francés canadiense - + Latin American Spanish Español latinoamericano - + Simplified Chinese Chino simplificado - + Traditional Chinese (正體中文) Chino tradicional (正體中文) - + Brazilian Portuguese (português do Brasil) Portugués brasileño (português do Brasil) - + Polish (polska) Polaco (polska) - + Thai (แบบไทย) Tailandés (แบบไทย) - - + + Japan Japón - + USA EEUU - + Europe Europa - + Australia Australia - + China China - + Korea Corea - + Taiwan Taiwán - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Predeterminada (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipto - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Irán - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polonia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turquía - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulú - + Mono Mono - + Stereo Estéreo - + Surround Envolvente - + 4GB DRAM (Default) 4GB DRAM (Por defecto) - + 6GB DRAM (Unsafe) 6GB DRAM (Inseguro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Inseguro) - + 12GB DRAM (Unsafe) 12GB DRAM (Inseguro) - + Docked Sobremesa - + Handheld Portátil - - + + Normal Normal - - + + Boost Impulso - - + + Overclock Overclock - + Always ask (Default) Preguntar siempre (Por defecto) - + Only if game specifies not to stop Solo si el juego pide no ser cerrado - + Never ask Nunca preguntar - + Very Small (16 MB) Muy pequeño (16 MB) - + Small (32 MB) Pequeño (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Muy grande (512 MB) - + Very Low (4 MB) Muy bajo (4 MB) - + Low (8 MB) Bajo (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Medio (32 MB) - + High (64 MB) Alto (64 MB) - + Very Low (32) Muy bajo (32) - + Low (64) Bajo (64) - + Normal (128) Normal (128) - + Medium (256) Medio (256) - + High (512) Alto (512) - - Disabled - Desactivado - - - + ExtendedDynamicState 1 ModoDynamicoExtendido 1 - + ExtendedDynamicState 2 ModoDynamicoExtendido 2 - + ExtendedDynamicState 3 ModoDynamicoExtendido 3 - + Tree View Vista en árbol - + Grid View Vista en cuadrícula diff --git a/dist/languages/fi.ts b/dist/languages/fi.ts index 5918e93a67..2873cb1c05 100644 --- a/dist/languages/fi.ts +++ b/dist/languages/fi.ts @@ -1108,993 +1108,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + + + + Never - + On Load - + Always - + CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate - - - + + + Default - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe - + Paranoid (disables most optimizations) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed - + Exclusive Fullscreen - + No Video Output - + CPU Video Decoding - + GPU Video Decoding (Default) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) - + 3X (2160p/3240p) - + 4X (2880p/4320p) - + 5X (3600p/5400p) - + 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor - + Bilinear - + Bicubic - + Gaussian - + Lanczos - + ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None - + FXAA - + SMAA - + Default (16:9) - + Force 4:3 - + Force 21:9 - + Force 16:10 - + Stretch to Window - + Automatic - + 2x - + 4x - + 8x - + 16x - + Japanese (日本語) - + American English - + French (français) - + German (Deutsch) - + Italian (italiano) - + Spanish (español) - + Chinese - + Korean (한국어) - + Dutch (Nederlands) - + Portuguese (português) - + Russian (Русский) - + Taiwanese - + British English - + Canadian French - + Latin American Spanish - + Simplified Chinese - + Traditional Chinese (正體中文) - + Brazilian Portuguese (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan - + USA - + Europe - + Australia - + China - + Korea - + Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET - + CST6CDT - + Cuba - + EET - + Egypt - + Eire - + EST - + EST5EDT - + GB - + GB-Eire - + GMT - + GMT+0 - + GMT-0 - + GMT0 - + Greenwich - + Hongkong - + HST - + Iceland - + Iran - + Israel - + Jamaica - + Kwajalein - + Libya - + MET - + MST - + MST7MDT - + Navajo - + NZ - + NZ-CHAT - + Poland - + Portugal - + PRC - + PST8PDT - + ROC - + ROK - + Singapore - + Turkey - + UCT - + Universal - + UTC - + W-SU - + WET - + Zulu - + Mono - + Stereo - + Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked - + Handheld + + + + Normal + + + + + + Boost + + - Normal - - - - - - Boost - - - - - Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/fr.ts b/dist/languages/fr.ts index 70562e75f1..99f926752e 100644 --- a/dist/languages/fr.ts +++ b/dist/languages/fr.ts @@ -1157,994 +1157,983 @@ L’activer permet de contourner ces confirmations et de quitter directement l - Disable controller applet - Désactiver l'applet du contrôleur - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Désactive de force le menu de configuration des manettes dans les programmes émulés. -Lorsqu’un programme tente d’ouvrir ce menu, il est immédiatement fermé. - - - Check for updates Rechercher des mises à jours - + Whether or not to check for updates upon startup. Vérifier ou non les mises à jour au démarrage. - + Enable Gamemode Activer le mode jeu - + Force X11 as Graphics Backend Forcer X11 comme moteur graphique - + Custom frontend Interface personnalisée - + Real applet Applet réel - + + + Disabled + Désactivé + + + Never Jamais - + On Load Au chargement - + Always Toujours - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Asynchrone - + Uncompressed (Best quality) Non compressé (Meilleure qualité) - + BC1 (Low quality) BC1 (Basse qualité) - + BC3 (Medium quality) BC3 (Qualité moyenne) - - + + Auto Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Conservateur - + Aggressive Agressif - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Nul - + Fast Rapide - - - + + + Accurate Précis - - - + + + Default Par défaut - + Unsafe (fast) Insecure (rapide) - + Safe (stable) Sûr (stable) - + Immediate - + Balanced Moyen - + Unsafe Risqué - + Paranoid (disables most optimizations) Paranoïaque (désactive la plupart des optimisations) - + Debugging Débogage - + Dynarmic Dynamique - + NCE NCE - + Borderless Windowed Fenêtré sans bordure - + Exclusive Fullscreen Plein écran exclusif - + No Video Output Pas de sortie vidéo - + CPU Video Decoding Décodage Vidéo sur le CPU - + GPU Video Decoding (Default) Décodage Vidéo sur le GPU (par défaut) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPÉRIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPÉRIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1,25X (900p/1350p) [EXPÉRIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPÉRIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Plus proche voisin - + Bilinear Bilinéaire - + Bicubic Bicubique - + Gaussian Gaussien - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area (Par zone) - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Aucun - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Par défaut (16:9) - + Force 4:3 Forcer le 4:3 - + Force 21:9 Forcer le 21:9 - + Force 16:10 Forcer le 16:10 - + Stretch to Window Étirer à la fenêtre - + Automatic Automatique - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonais (日本語) - + American English Anglais Américain - + French (français) Français (français) - + German (Deutsch) Allemand (Deutsch) - + Italian (italiano) Italien (italiano) - + Spanish (español) Espagnol (español) - + Chinese Chinois - + Korean (한국어) Coréen (한국어) - + Dutch (Nederlands) Néerlandais (Nederlands) - + Portuguese (português) Portugais (português) - + Russian (Русский) Russe (Русский) - + Taiwanese Taïwanais - + British English Anglais Britannique - + Canadian French Français Canadien - + Latin American Spanish Espagnol d'Amérique Latine - + Simplified Chinese Chinois Simplifié - + Traditional Chinese (正體中文) Chinois Traditionnel (正體中文) - + Brazilian Portuguese (português do Brasil) Portugais Brésilien (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japon - + USA É.-U.A. - + Europe Europe - + Australia Australie - + China Chine - + Korea Corée - + Taiwan Taïwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Par défaut (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Égypte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland Islande - + Iran Iran - + Israel Israël - + Jamaica Jamaïque - + Kwajalein Kwajalein - + Libya Libye - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Pologne - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapour - + Turkey Turquie - + UCT UCT - + Universal Universel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stéréo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (Par défaut) - + 6GB DRAM (Unsafe) 6 GB DRAM (Risqué) - + 8GB DRAM 8GO DRAM - + 10GB DRAM (Unsafe) 10GO DRAM (Insecure) - + 12GB DRAM (Unsafe) 12GO DRAM (Insecure) - + Docked Mode TV - + Handheld Mode Portable - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Toujours demander (par défaut) - + Only if game specifies not to stop Uniquement si le jeu précise de ne pas s'arrêter - + Never ask Jamais demander - + Very Small (16 MB) Très petit (16Mo) - + Small (32 MB) Petit (32Mo) - + Normal (128 MB) Normal (128Mo) - + Large (256 MB) Large (256Mo) - + Very Large (512 MB) Très large (512Mo) - + Very Low (4 MB) Très faible (4 Mo) - + Low (8 MB) Faible (8 Mo) - + Normal (16 MB) Normal (16 Mo) - + Medium (32 MB) Moyen (32 Mo) - + High (64 MB) Élevé (64 Mo) - + Very Low (32) Très faible (32) - + Low (64) Faible (64) - + Normal (128) Normal (128) - + Medium (256) Moyen (256) - + High (512) Élevé (512) - - Disabled - Désactivé - - - + ExtendedDynamicState 1 État dynamique étendu 1 - + ExtendedDynamicState 2 État dynamique étendu 2 - + ExtendedDynamicState 3 État dynamique étendu 3 - + Tree View Vue en liste - + Grid View Vue en grille diff --git a/dist/languages/hu.ts b/dist/languages/hu.ts index 7e4617a12c..a519b354b3 100644 --- a/dist/languages/hu.ts +++ b/dist/languages/hu.ts @@ -1114,993 +1114,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Vezérlő applet letiltása - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Játékmód engedélyezése - + Force X11 as Graphics Backend - + Custom frontend Egyéni frontend - + Real applet Valódi applet - + + + Disabled + + + + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU aszinkron - + Uncompressed (Best quality) Tömörítetlen (legjobb minőség) - + BC1 (Low quality) BC1 (alacsony minőség) - + BC3 (Medium quality) BC3 (közepes minőség) - - + + Auto Automatikus - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Takarékos - + Aggressive Aggresszív - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Pontos - - - + + + Default Alapértelmezett - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Nem biztonságos - + Paranoid (disables most optimizations) Paranoid (a legtöbb optimalizálást letiltja) - + Debugging - + Dynarmic Dinamikus - + NCE NCE - + Borderless Windowed Szegély nélküli ablak - + Exclusive Fullscreen Exkluzív teljes képernyő - + No Video Output Nincs videokimenet - + CPU Video Decoding CPU videódekódolás - + GPU Video Decoding (Default) GPU videódekódolás (alapértelmezett) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [KÍSÉRLETI] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [KÍSÉRLETI] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [KÍSÉRLETI] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Legközelebbi szomszéd - + Bilinear Bilineáris - + Bicubic Bikubikus - + Gaussian Gauss-féle - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nincs - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Alapértelmezett (16:9) - + Force 4:3 4:3 kényszerítése - + Force 21:9 21:9 kényszerítése - + Force 16:10 16:10 kényszerítése - + Stretch to Window Ablakhoz nyújtás - + Automatic Automatikus - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japán (日本語) - + American English Amerikai angol - + French (français) Francia (français) - + German (Deutsch) Német (Deutsch) - + Italian (italiano) Olasz (italiano) - + Spanish (español) Spanyol (español) - + Chinese Kínai - + Korean (한국어) Koreai (한국어) - + Dutch (Nederlands) Holland (Nederlands) - + Portuguese (português) Portugál (português) - + Russian (Русский) Orosz (Русский) - + Taiwanese Tajvani - + British English Brit Angol - + Canadian French Kanadai francia - + Latin American Spanish Latin-amerikai spanyol - + Simplified Chinese Egyszerűsített kínai - + Traditional Chinese (正體中文) Hagyományos kínai (正體中文) - + Brazilian Portuguese (português do Brasil) Brazíliai portugál (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japán - + USA USA - + Europe Európa - + Australia Ausztrália - + China Kína - + Korea Korea - + Taiwan Tajvan - + Auto (%1) Auto select time zone Automatikus (%1) - + Default (%1) Default time zone Alapértelmezett (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Egyiptom - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Izland - + Iran Irán - + Israel Izrael - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navahó - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Lengyelország - + Portugal Portugália - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Szingapúr - + Turkey Törökország - + UCT UCT - + Universal Univerzális - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Sztereó - + Surround Térhangzás - + 4GB DRAM (Default) 4GB DRAM (Alapértelmezett) - + 6GB DRAM (Unsafe) 6GB DRAM (Nem biztonságos) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Dokkolt - + Handheld Kézi - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Mindig kérdezz rá (alapértelmezett) - + Only if game specifies not to stop Csak akkor, ha a játék kifejezetten kéri a folytatást. - + Never ask Soha ne kérdezz rá - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/id.ts b/dist/languages/id.ts index 160fa812be..ab0fe1d8b8 100644 --- a/dist/languages/id.ts +++ b/dist/languages/id.ts @@ -1126,993 +1126,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Nonaktifkan aplikasi pengontrol - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates Cek Pembaruan - + Whether or not to check for updates upon startup. - + Enable Gamemode Aktifkan Mode Permainan - + Force X11 as Graphics Backend - + Custom frontend Tampilan depan kustom - + Real applet Aplikasi nyata - + + + Disabled + + + + Never Tidak Pernah - + On Load - + Always Selalu - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU sinkron - + Uncompressed (Best quality) Tidak terkompresi (Kualitas Terbaik) - + BC1 (Low quality) BC1 (Kualitas rendah) - + BC3 (Medium quality) BC3 (Kualitas sedang) - - + + Auto Otomatis - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Konservatif - + Aggressive Agresif - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast Cepat - - - + + + Accurate Akurat - - - + + + Default Bawaan - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced Seimbang - + Unsafe Berbahaya - + Paranoid (disables most optimizations) Paranoid (menonaktifkan sebagian besar optimasi) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Layar Tanpa Batas - + Exclusive Fullscreen Layar Penuh Eksklusif - + No Video Output Tidak ada Keluaran Suara - + CPU Video Decoding Penguraian Video menggunakan CPU - + GPU Video Decoding (Default) Penguraian Video menggunakan GPU (Bawaan) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EKSPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EKSPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EKSPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Biliner - + Bicubic Bikubik - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Tak ada - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Bawaan (16:9) - + Force 4:3 Paksa 4:3 - + Force 21:9 Paksa 21:9 - + Force 16:10 Paksa 16:10 - + Stretch to Window Regangkan ke Layar - + Automatic Otomatis - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Jepang (日本語) - + American English Bahasa Inggris Amerika - + French (français) Prancis (français) - + German (Deutsch) Jerman (Deutsch) - + Italian (italiano) Italia (italiano) - + Spanish (español) Spanyol (español) - + Chinese Cina - + Korean (한국어) Korea (한국어) - + Dutch (Nederlands) Belanda (Nederlands) - + Portuguese (português) Portugis (português) - + Russian (Русский) Rusia (Русский) - + Taiwanese Taiwan - + British English Inggris Britania - + Canadian French Prancis Kanada - + Latin American Spanish Spanyol Amerika Latin - + Simplified Chinese Cina Sederhana - + Traditional Chinese (正體中文) Cina Tradisional (正體中文) - + Brazilian Portuguese (português do Brasil) Portugis Brazil (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Jepang - + USA USA - + Europe Eropa - + Australia Australia - + China Tiongkok - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Bawaan (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Mesir - + Eire Éire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Éire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Iran - + Israel Israel - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polandia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turki - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Bawaan) - + 6GB DRAM (Unsafe) 6GB DRAM (Tidak Aman) - + 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Tidak Aman) - + 12GB DRAM (Unsafe) 12GB DRAM (Tidak Aman) - + Docked Terpasang - + Handheld Jinjing - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Selalu tanyakan (Bawaan) - + Only if game specifies not to stop Hanya jika permainan menentukan untuk tidak berhenti - + Never ask Jangan pernah bertanya - + Very Small (16 MB) Sangat Kecil (16 MB) - + Small (32 MB) Kecil (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Sedang (256) - + High (512) Tinggi (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/it.ts b/dist/languages/it.ts index c0b01945ad..6315c384db 100644 --- a/dist/languages/it.ts +++ b/dist/languages/it.ts @@ -1158,994 +1158,983 @@ Abilitarla bypassa queste richieste e l'emulazione cesserà immediatamente. - Disable controller applet - Disabilita l'applet controller - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Disabilita forzatamente l'uso dell'applet del controller nei programmi emulati. -Quando un programma proverà ad aprire l'applet del controller, quest'ultimo verrà immediatamente chiuso. - - - Check for updates Controlla la presenza di aggiornamenti - + Whether or not to check for updates upon startup. Determina se controllare o meno la presenza di aggiornamenti all'avvio. - + Enable Gamemode Abilita Gamemode - + Force X11 as Graphics Backend Forza l'uso del back-end grafico X11 - + Custom frontend Frontend personalizzato - + Real applet Applet reale - + + + Disabled + Disabilitato + + + Never Mai - + On Load Al caricamento - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU (Asincrono) - + Uncompressed (Best quality) Nessuna compressione (qualità migliore) - + BC1 (Low quality) BC1 (qualità bassa) - + BC3 (Medium quality) BC3 (qualità media) - - + + Auto Automatico - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservativa - + Aggressive Aggressiva - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (shader assembly, solo NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (sperimentale, solo AMD/MESA) - + Null Nullo - + Fast Veloce - - - + + + Accurate Accurata - - - + + + Default Predefinito - + Unsafe (fast) Non sicuro (veloce) - + Safe (stable) Sicuro (stabile) - + Immediate - + Balanced Bilanciata - + Unsafe Non sicura - + Paranoid (disables most optimizations) Paranoica (disabilita la maggior parte delle ottimizzazioni) - + Debugging Debug - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Finestra senza bordi - + Exclusive Fullscreen Schermo intero esclusivo - + No Video Output Nessun output video - + CPU Video Decoding Decodifica video CPU - + GPU Video Decoding (Default) Decodifica video GPU (predefinita) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [SPERIMENTALE] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [SPERIMENTALE] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [SPERIMENTALE] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [SPERIMENTALE] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [SPERIMENTALE] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest neighbor - + Bilinear Bilineare - + Bicubic Bicubico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nessuna - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Predefinito (16:9) - + Force 4:3 Forza 4:3 - + Force 21:9 Forza 21:9 - + Force 16:10 Forza 16:10 - + Stretch to Window Allunga a finestra - + Automatic Automatico - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Giapponese (日本語) - + American English Inglese americano - + French (français) Francese (français) - + German (Deutsch) Tedesco (Deutsch) - + Italian (italiano) Italiano - + Spanish (español) Spagnolo (español) - + Chinese Cinese - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Olandese (Nederlands) - + Portuguese (português) Portoghese (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanese - + British English Inglese britannico - + Canadian French Francese canadese - + Latin American Spanish Spagnolo latino-americano - + Simplified Chinese Cinese semplificato - + Traditional Chinese (正體中文) Cinese tradizionale (正體中文) - + Brazilian Portuguese (português do Brasil) Portoghese brasiliano (português do Brasil) - + Polish (polska) Polacco (polska) - + Thai (แบบไทย) Thailandese (แบบไทย) - - + + Japan Giappone - + USA USA - + Europe Europa - + Australia Australia - + China Cina - + Korea Corea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Automatico (%1) - + Default (%1) Default time zone Predefinito (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egitto - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islanda - + Iran Iran - + Israel Israele - + Jamaica Giamaica - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polonia - + Portugal Portogallo - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turchia - + UCT UCT - + Universal Universale - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Predefinito) - + 6GB DRAM (Unsafe) 6GB DRAM (Non sicuro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Non sicuro) - + 12GB DRAM (Unsafe) 12GB DRAM (Non sicuro) - + Docked Dock - + Handheld Portatile - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Chiedi sempre (Predefinito) - + Only if game specifies not to stop Solo se il gioco richiede di non essere arrestato - + Never ask Non chiedere mai - + Very Small (16 MB) Molto piccola (16 MB) - + Small (32 MB) Piccola (32 MB) - + Normal (128 MB) Normale (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Molto grande (512 MB) - + Very Low (4 MB) Molto bassa (4 MB) - + Low (8 MB) Bassa (8 MB) - + Normal (16 MB) Normale (16 MB) - + Medium (32 MB) Media (32 MB) - + High (64 MB) Alta (64 MB) - + Very Low (32) Molto basso (32) - + Low (64) Basso (64) - + Normal (128) Normale (128) - + Medium (256) Medio (256) - + High (512) Alto (512) - - Disabled - Disabilitato - - - + ExtendedDynamicState 1 Stato dinamico esteso 1 - + ExtendedDynamicState 2 Stato dinamico esteso 2 - + ExtendedDynamicState 3 Stato dinamico esteso 3 - + Tree View Vista ad albero - + Grid View Vista a griglia diff --git a/dist/languages/ja_JP.ts b/dist/languages/ja_JP.ts index f16621c044..c7eb268ca0 100644 --- a/dist/languages/ja_JP.ts +++ b/dist/languages/ja_JP.ts @@ -1111,993 +1111,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - コントローラーアプレットの無効化 - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + 無効 + + + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 非同期 - + Uncompressed (Best quality) 圧縮しない (最高品質) - + BC1 (Low quality) BC1 (低品質) - + BC3 (Medium quality) BC3 (中品質) - - + + Auto 自動 - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (アセンブリシェーダー、NVIDIA のみ) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V(実験的、AMD/Mesaのみ) - + Null - + Fast - - - + + + Accurate 正確 - - - + + + Default デフォルト - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe 不安定 - + Paranoid (disables most optimizations) パラノイド (ほとんどの最適化を無効化) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed ボーダーレスウィンドウ - + Exclusive Fullscreen 排他的フルスクリーン - + No Video Output ビデオ出力しない - + CPU Video Decoding ビデオをCPUでデコード - + GPU Video Decoding (Default) ビデオをGPUでデコード (デフォルト) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [実験的] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [実験的] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [実験的] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area - + MMPX MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None なし - + FXAA FXAA - + SMAA SMAA - + Default (16:9) デフォルト (16:9) - + Force 4:3 強制 4:3 - + Force 21:9 強制 21:9 - + Force 16:10 強制 16:10 - + Stretch to Window ウィンドウに合わせる - + Automatic 自動 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日本語 - + American English アメリカ英語 - + French (français) フランス語 (français) - + German (Deutsch) ドイツ語 (Deutsch) - + Italian (italiano) イタリア語 (italiano) - + Spanish (español) スペイン語 (español) - + Chinese 中国語 - + Korean (한국어) 韓国語 (한국어) - + Dutch (Nederlands) オランダ語 (Nederlands) - + Portuguese (português) ポルトガル語 (português) - + Russian (Русский) ロシア語 (Русский) - + Taiwanese 台湾語 - + British English イギリス英語 - + Canadian French カナダフランス語 - + Latin American Spanish ラテンアメリカスペイン語 - + Simplified Chinese 簡体字中国語 - + Traditional Chinese (正體中文) 繁体字中国語 (正體中文) - + Brazilian Portuguese (português do Brasil) ブラジルポルトガル語 (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan 日本 - + USA アメリカ - + Europe ヨーロッパ - + Australia オーストラリア - + China 中国 - + Korea 韓国 - + Taiwan 台湾 - + Auto (%1) Auto select time zone 自動 (%1) - + Default (%1) Default time zone 既定 (%1) - + CET 中央ヨーロッパ時間 - + CST6CDT CST6CDT - + Cuba キューバ - + EET 東ヨーロッパ標準時 - + Egypt エジプト - + Eire アイルランド - + EST アメリカ東部標準時 - + EST5EDT EST5EDT - + GB GB - + GB-Eire イギリス-アイルランド - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich グリニッジ - + Hongkong 香港 - + HST ハワイ標準時 - + Iceland アイスランド - + Iran イラン - + Israel イスラエル - + Jamaica ジャマイカ - + Kwajalein クェゼリン - + Libya リビア - + MET 中東時間 - + MST MST - + MST7MDT MST7MDT - + Navajo ナバホ - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland ポーランド - + Portugal ポルトガル - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore シンガポール - + Turkey トルコ - + UCT UCT - + Universal ユニバーサル - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu ズールー - + Mono モノラル - + Stereo ステレオ - + Surround サラウンド - + 4GB DRAM (Default) 4GB DRAM (デフォルト) - + 6GB DRAM (Unsafe) 6GB DRAM (不安定) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld 携帯モード - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) 常に確認する (デフォルト) - + Only if game specifies not to stop ゲームが停止しないように指定しているときのみ - + Never ask 確認しない - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - 無効 - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/ko_KR.ts b/dist/languages/ko_KR.ts index 881fe138d3..a6d39cf213 100644 --- a/dist/languages/ko_KR.ts +++ b/dist/languages/ko_KR.ts @@ -1172,994 +1172,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - 컨트롤러 애플릿 비활성화 - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - 에뮬레이트된 프로그램에서 컨트롤러 애플릿 사용을 강제적으로 비활성화합니다. -프로그램이 컨트롤러 애플릿을 열려고 하면 즉시 닫힙니다. - - - Check for updates 업데이트 확인 - + Whether or not to check for updates upon startup. 시작 시 업데이트를 확인할지 여부. - + Enable Gamemode 게임 모드 활성화 - + Force X11 as Graphics Backend X11을 그래픽 백엔드로 강제 설정 - + Custom frontend 사용자 정의 프론트엔드 - + Real applet 실제 애플릿 - + + + Disabled + 비활성화됨 + + + Never 안 함 - + On Load 로드 시 - + Always 항상 - + CPU CPU - + GPU GPU - + CPU Asynchronous 비동기 CPU - + Uncompressed (Best quality) 비압축(최고 품질) - + BC1 (Low quality) BC1(저품질) - + BC3 (Medium quality) BC3(중간 품질) - - + + Auto 자동 - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative 소극적 - + Aggressive 적극적 - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM(어셈블리 셰이더, NVIDIA 전용) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V(실험적, AMD/Mesa 전용) - + Null Null - + Fast 고속 - - - + + + Accurate 정확 - - - + + + Default 기본값 - + Unsafe (fast) 불안전(빠름) - + Safe (stable) 안전(안정적) - + Immediate 즉시 - + Balanced 균형 - + Unsafe 불안전 - + Paranoid (disables most optimizations) 편집증적(대부분의 최적화를 비활성화함) - + Debugging 디버깅 - + Dynarmic 동적 - + NCE NCE - + Borderless Windowed 테두리 없는 창 - + Exclusive Fullscreen 독점 전체 화면 - + No Video Output 비디오 출력 없음 - + CPU Video Decoding CPU 비디오 디코딩 - + GPU Video Decoding (Default) GPU 비디오 디코딩(기본값) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [실험적] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [실험적] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [실험적] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [실험적] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [실험적] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 최단입점 - + Bilinear 쌍선형 - + Bicubic 쌍입방 - + Gaussian 가우시안 - + Lanczos 란초스 - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area 영역 - + MMPX MMPX - + Zero-Tangent 제로탄젠트 - + B-Spline B-스플라인 - + Mitchell 미첼 - + Spline-1 스플라인-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None 없음 - + FXAA FXAA - + SMAA SMAA - + Default (16:9) 기본(16:9) - + Force 4:3 강제 4:3 - + Force 21:9 강제 21:9 - + Force 16:10 강제 16:10 - + Stretch to Window 화면 늘리기 - + Automatic 자동 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 일본어(日本語) - + American English 미국식 영어 - + French (français) 프랑스어(français) - + German (Deutsch) 독일어(Deutsch) - + Italian (italiano) 이탈리아어(italiano) - + Spanish (español) 스페인어(español) - + Chinese 중국어 - + Korean (한국어) 한국어(Korean) - + Dutch (Nederlands) 네덜란드어(Nederlands) - + Portuguese (português) 포르투갈어(português) - + Russian (Русский) 러시아어(Русский) - + Taiwanese 대만어 - + British English 영국식 영어 - + Canadian French 캐나다 프랑스어 - + Latin American Spanish 라틴아메리카 스페인어 - + Simplified Chinese 중국어 간체 - + Traditional Chinese (正體中文) 중국어 번체(正體中文) - + Brazilian Portuguese (português do Brasil) 브라질 포르투갈어(português do Brasil) - + Polish (polska) 폴란드어(polska) - + Thai (แบบไทย) 태국어(แบบไทย) - - + + Japan 일본 - + USA 미국 - + Europe 유럽 - + Australia 호주 - + China 중국 - + Korea 대한민국 - + Taiwan 대만 - + Auto (%1) Auto select time zone 자동(%1) - + Default (%1) Default time zone 기본(%1) - + CET CET - + CST6CDT CST6CDT - + Cuba 쿠바 - + EET EET - + Egypt 이집트 - + Eire 아일랜드 - + EST EST - + EST5EDT EST5EDT - + GB 영국 - + GB-Eire 영국-아일랜드 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 그리니치 - + Hongkong 홍콩 - + HST HST - + Iceland 아이슬란드 - + Iran 이란 - + Israel 이스라엘 - + Jamaica 자메이카 - + Kwajalein 콰잘레인 - + Libya 리비아 - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo 나바호 - + NZ 뉴질랜드 - + NZ-CHAT 뉴질랜드-채텀 - + Poland 폴란드 - + Portugal 포르투갈 - + PRC 중국 - + PST8PDT PST8PDT - + ROC 대만 - + ROK 대한민국 - + Singapore 싱가포르 - + Turkey 터키 - + UCT UCT - + Universal 세계 - + UTC UTC - + W-SU 모스크바 - + WET WET - + Zulu Zulu - + Mono 모노 - + Stereo 스테레오 - + Surround 서라운드 - + 4GB DRAM (Default) 4GB DRAM(기본값) - + 6GB DRAM (Unsafe) 6GB DRAM(불안전) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM(불안전) - + 12GB DRAM (Unsafe) 12GB DRAM(불안전) - + Docked 독 모드 - + Handheld 휴대 모드 - - + + Normal 보통 - - + + Boost 부스트 - - + + Overclock 오버클럭 - + Always ask (Default) 항상 묻기(기본값) - + Only if game specifies not to stop 게임에서 멈추지 말라고 명시한 경우에만 - + Never ask 절대 묻지 않음 - + Very Small (16 MB) 아주 작은 크기(16 MB) - + Small (32 MB) 작은 크기(32 MB) - + Normal (128 MB) 보통 크기(128 MB) - + Large (256 MB) 큰 크기(256 MB) - + Very Large (512 MB) 아주 큰 크기(512 MB) - + Very Low (4 MB) 매우 낮은 크기(4 MB) - + Low (8 MB) 낮은 크기(8 MB) - + Normal (16 MB) 보통 크기(16 MB) - + Medium (32 MB) 중간 크기(32 MB) - + High (64 MB) 높은 크기(64 MB) - + Very Low (32) 매우 낮은 크기(32) - + Low (64) 낮은 크기(64) - + Normal (128) 보통 크기(128) - + Medium (256) 보통(256) - + High (512) 빠름(512) - - Disabled - 비활성화됨 - - - + ExtendedDynamicState 1 확장된 동적 상태 1 - + ExtendedDynamicState 2 확장된 동적 상태 2 - + ExtendedDynamicState 3 확장된 동적 상태 3 - + Tree View 트리 보기 - + Grid View 격자 보기 diff --git a/dist/languages/nb.ts b/dist/languages/nb.ts index 5d77604547..5e5edb0006 100644 --- a/dist/languages/nb.ts +++ b/dist/languages/nb.ts @@ -1108,993 +1108,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Deaktiver kontroller-appleten - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates Se etter oppdateringer - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + Skrudd av + + + Never Aldri - + On Load - + Always Alltid - + CPU CPU - + GPU Skjermkort - + CPU Asynchronous - + Uncompressed (Best quality) Ukomprimert (Best kvalitet) - + BC1 (Low quality) BC1 (Lav kvalitet) - + BC3 (Medium quality) BC3 (Middels kvalitet) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (eksperimentelt, kun AMD/Mesa) - + Null Null - + Fast Rask - - - + + + Accurate Nøyaktig - - - + + + Default Standard - + Unsafe (fast) Utrygg (raskt) - + Safe (stable) Trygg (stabil) - + Immediate - + Balanced Balansert - + Unsafe Utrygt - + Paranoid (disables most optimizations) Paranoid (deaktiverer de fleste optimaliseringer) - + Debugging - + Dynarmic - + NCE NCE - + Borderless Windowed Rammeløst vindu - + Exclusive Fullscreen Eksklusiv fullskjerm - + No Video Output Ingen videoutdata - + CPU Video Decoding CPU-videodekoding - + GPU Video Decoding (Default) GPU-videodekoding (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0,25× (180p/270p) [EKSPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5× (360p/540p) [EKSPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75× (540p/810p) [EKSPERIMENTELL] - + 1X (720p/1080p) 1× (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1,25× (900p/1350p) [EKSPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1,5× (1080p/1620p) [EKSPERIMENTELL] - + 2X (1440p/2160p) 2× (1440p/2160p) - + 3X (2160p/3240p) 3× (2160p/3240p) - + 4X (2880p/4320p) 4× (2880p/4320p) - + 5X (3600p/5400p) 5× (3600p/5400p) - + 6X (4320p/6480p) 6× (4320p/6480p) - + 7X (5040p/7560p) 7× (5040p/7560p) - + 8X (5760p/8640p) 8× (5760p/8640p) - + Nearest Neighbor Nærmeste nabo - + Bilinear Bilineær - + Bicubic Bikubisk - + Gaussian Gaussisk - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Område - + MMPX MMPX - + Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tving 4:3 - + Force 21:9 Tving 21:9 - + Force 16:10 Tving 16:10 - + Stretch to Window Strekk til vinduet - + Automatic Automatisk - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japansk (日本語) - + American English Amerikansk engelsk - + French (français) Fransk (français) - + German (Deutsch) Tysk (Deutsch) - + Italian (italiano) Italiensk (italiano) - + Spanish (español) Spansk (español) - + Chinese Kinesisk - + Korean (한국어) Koreansk (한국어) - + Dutch (Nederlands) Nederlandsk (Nederlands) - + Portuguese (português) Portugisisk (português) - + Russian (Русский) Russisk (Русский) - + Taiwanese Taiwansk - + British English Britisk engelsk - + Canadian French Kanadisk fransk - + Latin American Spanish Latinamerikansk spansk - + Simplified Chinese Forenklet kinesisk - + Traditional Chinese (正體中文) Tradisjonell kinesisk (正體中文) - + Brazilian Portuguese (português do Brasil) Brasiliansk portugisisk (português do Brasil) - + Polish (polska) Polsk (polska) - + Thai (แบบไทย) Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australia - + China Folkerepublikken Kina - + Korea Korea - + Taiwan Taiwan (Republikken Kina) - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standard (%1) - + CET Sentraleuropeisk tid - + CST6CDT CST6CDT - + Cuba Cuba - + EET Østeuropeisk tid - + Egypt Egypt - + Eire Republikken Irland - + EST EST - + EST5EDT EST5EDT - + GB Storbritannia - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC Folkerepublikken Kina - + PST8PDT PST8PDT - + ROC Taiwan (Republikken Kina) - + ROK Sør-Korea - + Singapore Singapore - + Turkey Tyrkia - + UCT UCT - + Universal Universalt - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (Standard) - + 6GB DRAM (Unsafe) 6 GB DRAM (Utrygt) - + 8GB DRAM 8 GB DRAM - + 10GB DRAM (Unsafe) 10 GB DRAM (Utrygt) - + 12GB DRAM (Unsafe) 12 GB DRAM (Utrygt) - + Docked I dokking - + Handheld Håndholdt - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Spør alltid (Standard) - + Only if game specifies not to stop - + Never ask Aldri spør - + Very Small (16 MB) Veldig liten (16 MB) - + Small (32 MB) Liten (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Stor (256 MB) - + Very Large (512 MB) Veldig stor (512 MB) - + Very Low (4 MB) Veldig lav (4 MB) - + Low (8 MB) Lav (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Middels (32 MB) - + High (64 MB) Høy (64 MB) - + Very Low (32) Svært lav (32) - + Low (64) Lav (64) - + Normal (128) Normal (128) - + Medium (256) Middels (256) - + High (512) Høy (512) - - Disabled - Skrudd av - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/nl.ts b/dist/languages/nl.ts index 02b1520724..296dd3ebca 100644 --- a/dist/languages/nl.ts +++ b/dist/languages/nl.ts @@ -1115,993 +1115,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Controller-applet uitschakelen - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + + + + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) BC1 (Lage Kwaliteit) - + BC3 (Medium quality) BC3 (Gemiddelde kwaliteit) - - + + Auto Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Accuraat - - - + + + Default Standaard - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Onveilig - + Paranoid (disables most optimizations) Paranoid (schakelt de meeste optimalisaties uit) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Randloos Venster - + Exclusive Fullscreen Exclusief Volledig Scherm - + No Video Output Geen Video-uitvoer - + CPU Video Decoding CPU Videodecodering - + GPU Video Decoding (Default) GPU Videodecodering (Standaard) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTEEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTEEL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Geen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standaart (16:9) - + Force 4:3 Forceer 4:3 - + Force 21:9 Forceer 21:9 - + Force 16:10 Forceer 16:10 - + Stretch to Window Uitrekken naar Venster - + Automatic Automatisch - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japans (日本語) - + American English Amerikaans-Engels - + French (français) Frans (Français) - + German (Deutsch) Duits (Deutsch) - + Italian (italiano) Italiaans (italiano) - + Spanish (español) Spaans (Español) - + Chinese Chinees - + Korean (한국어) Koreaans (한국어) - + Dutch (Nederlands) Nederlands (Nederlands) - + Portuguese (português) Portugees (português) - + Russian (Русский) Russisch (Русский) - + Taiwanese Taiwanese - + British English Brits-Engels - + Canadian French Canadees-Frans - + Latin American Spanish Latijns-Amerikaans Spaans - + Simplified Chinese Vereenvoudigd Chinees - + Traditional Chinese (正體中文) Traditioneel Chinees (正體中文) - + Brazilian Portuguese (português do Brasil) Braziliaans-Portugees (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australië - + China China - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standaard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egypte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Ijsland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libië - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turkije - + UCT UCT - + Universal Universeel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/pl.ts b/dist/languages/pl.ts index 8e76bb191e..4b94ca5e55 100644 --- a/dist/languages/pl.ts +++ b/dist/languages/pl.ts @@ -1156,994 +1156,983 @@ Włączenie powoduje pominięcie takich monitów i bezpośrednie wyjście z emul - Disable controller applet - Wyłącz aplet kontrolera - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Wymusza wyłączenie użycia apletu kontrolera w oprogramowaniu uruchamianym w emulacji. -Jeśli emulowane oprogramowanie próbuje otworzyć aplet kontrolera, jest on natychmiast zamykany. - - - Check for updates Sprawdź aktualizacje - + Whether or not to check for updates upon startup. Czy sprawdzać aktualizacje przy uruchomieniu. - + Enable Gamemode Włącz Tryb gry - + Force X11 as Graphics Backend Wymuś X11 jako backend grafiki - + Custom frontend Niestandardowy frontend - + Real applet Prawdziwy aplet - + + + Disabled + Wyłączone + + + Never Nigdy - + On Load Przy wczytywaniu - + Always Zawsze - + CPU CPU - + GPU GPU - + CPU Asynchronous Asynchroniczne CPU - + Uncompressed (Best quality) Brak (najlepsza jakość) - + BC1 (Low quality) BC1 (niska jakość) - + BC3 (Medium quality) BC3 (średnia jakość) - - + + Auto Automatyczny - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Konserwatywny - + Aggressive Agresywny - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast Szybkie - - - + + + Accurate Dokładny - - - + + + Default Domyślny - + Unsafe (fast) Niezalecane (szybkie) - + Safe (stable) Bezpieczne (stabilne) - + Immediate - + Balanced Zrównoważony - + Unsafe Niebezpieczny - + Paranoid (disables most optimizations) Paranoiczne (wyłącza większość optymalizacji) - + Debugging Debugowanie - + Dynarmic Dynamiczny - + NCE NCE - + Borderless Windowed W oknie (Bezramkowy) - + Exclusive Fullscreen Exclusive Fullscreen - + No Video Output Brak wyjścia wideo - + CPU Video Decoding Dekodowanie Wideo przez CPU - + GPU Video Decoding (Default) Dekodowanie Wideo przez GPU (Domyślne) - + 0.25X (180p/270p) [EXPERIMENTAL] 0,25x (180p/270p) [EKSPERYMENTALNE] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5x (360p/540p) [EKSPERYMENTALNE] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EKSPERYMENTALNE] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EKSPERYMENTALNE] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [Ekperymentalnie] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Najbliższy sąsiadujący - + Bilinear Bilinearny - + Bicubic Bikubiczny - + Gaussian Kulisty - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Obszar - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Żadna (wyłączony) - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Domyślne (16:9) - + Force 4:3 Wymuś 4:3 - + Force 21:9 Wymuś 21:9 - + Force 16:10 Wymuś 16:10 - + Stretch to Window Rozciągnij do Okna - + Automatic Automatyczne - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japoński (日本語) - + American English Angielski Amerykański - + French (français) Francuski (français) - + German (Deutsch) Niemiecki (Niemcy) - + Italian (italiano) Włoski (italiano) - + Spanish (español) Hiszpański (español) - + Chinese Chiński - + Korean (한국어) Koreański (한국어) - + Dutch (Nederlands) Duński (Holandia) - + Portuguese (português) Portugalski (português) - + Russian (Русский) Rosyjski (Русский) - + Taiwanese Tajwański - + British English Angielski Brytyjski - + Canadian French Fancuski (Kanada) - + Latin American Spanish Hiszpański (Latin American) - + Simplified Chinese Chiński (Uproszczony) - + Traditional Chinese (正體中文) Chiński tradycyjny (正體中文) - + Brazilian Portuguese (português do Brasil) Portugalski (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonia - + USA USA - + Europe Europa - + Australia Australia - + China Chiny - + Korea Korea - + Taiwan Tajwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Domyślne (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipt - + Eire Irlandia - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Iran - + Israel Izrael - + Jamaica Jamajka - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polska - + Portugal Portugalia - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turcja - + UCT UCT - + Universal Uniwersalny - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Domyślne) - + 6GB DRAM (Unsafe) 6GB DRAM (NIebezpieczne) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (NIebezpieczne) - + 12GB DRAM (Unsafe) 12GB DRAM (NIebezpieczne) - + Docked Zadokowany - + Handheld Przenośnie - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Zawsze pytaj (Domyślne) - + Only if game specifies not to stop Tylko jeśli gra określa, aby nie zatrzymywać - + Never ask Nie pytaj więcej - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Średnie (256) - + High (512) Wysokie (512) - - Disabled - Wyłączone - - - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/pt_BR.ts b/dist/languages/pt_BR.ts index a180d00364..cdc3af2593 100644 --- a/dist/languages/pt_BR.ts +++ b/dist/languages/pt_BR.ts @@ -1163,994 +1163,983 @@ Ao ativar, ignora esses avisos e encerra diretamente a emulação. - Disable controller applet - Desabilitar applet de controle - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Desativa forçadamente o uso do applet de controle em programas emulados. -Quando um programa tenta abrir o applet, ele é imediatamente fechado. - - - Check for updates Verificar atualizações - + Whether or not to check for updates upon startup. Define se deve verificar atualizações na inicialização. - + Enable Gamemode Habilitar Gamemode - + Force X11 as Graphics Backend Forçar X11 como backend gráfico - + Custom frontend Frontend customizado - + Real applet Applet real - + + + Disabled + Desativado + + + Never Nunca - + On Load Ao carregar - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Assíncrona - + Uncompressed (Best quality) Descompactado (Melhor Qualidade) - + BC1 (Low quality) BC1 (Baixa qualidade) - + BC3 (Medium quality) BC3 (Média qualidade) - - + + Auto Automático - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservador - + Aggressive Agressivo - + Vulkan Vulcano - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Shaders em Assembly, apenas NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, apenas AMD/Mesa) - + Null Nenhum - + Fast Rápido - - - + + + Accurate Preciso - - - + + + Default Padrão - + Unsafe (fast) Inseguro (rápido) - + Safe (stable) Seguro (estável) - + Immediate - + Balanced Balanceado - + Unsafe Inseguro - + Paranoid (disables most optimizations) Paranoia (desativa a maioria das otimizações) - + Debugging Depuração - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Janela sem bordas - + Exclusive Fullscreen Tela cheia exclusiva - + No Video Output Sem saída de vídeo - + CPU Video Decoding Decodificação de vídeo pela CPU - + GPU Video Decoding (Default) Decodificação de vídeo pela GPU (Padrão) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Vizinho mais próximo - + Bilinear Bilinear - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Área - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nenhum - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Padrão (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 Forçar 16:10 - + Stretch to Window Esticar à Janela - + Automatic Automático - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonês (日本語) - + American English Inglês Americano - + French (français) Francês (français) - + German (Deutsch) Alemão (Deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Espanhol (español) - + Chinese Chinês - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandês (Nederlands) - + Portuguese (português) Português (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanês - + British English Inglês Britânico - + Canadian French Francês Canadense - + Latin American Spanish Espanhol Latino-Americano - + Simplified Chinese Chinês Simplificado - + Traditional Chinese (正體中文) Chinês Tradicional (正 體 中文) - + Brazilian Portuguese (português do Brasil) Português do Brasil (Brazilian Portuguese) - + Polish (polska) Polonês (polska) - + Thai (แบบไทย) Tailandês (แบบไทย) - - + + Japan Japão - + USA EUA - + Europe Europa - + Australia Austrália - + China China - + Korea Coreia - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Padrão (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egito - + Eire Irlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islândia - + Iran Irã - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polônia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estéreo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Padrão) - + 6GB DRAM (Unsafe) 6GB DRAM (Não seguro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Inseguro) - + 12GB DRAM (Unsafe) 12GB DRAM (Inseguro) - + Docked Ancorado - + Handheld Portátil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Sempre perguntar (Padrão) - + Only if game specifies not to stop Somente se o jogo especificar para não parar - + Never ask Nunca perguntar - + Very Small (16 MB) Muito Pequeno (16 MB) - + Small (32 MB) Pequeno (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Muito Grande (512 MB) - + Very Low (4 MB) Muito Baixo (4 MB) - + Low (8 MB) Baixo (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Médio (32 MB) - + High (64 MB) Alto (64 MB) - + Very Low (32) Muito Baixo (32) - + Low (64) Baixo (64) - + Normal (128) Normal (128) - + Medium (256) Médio (256) - + High (512) Alto (512) - - Disabled - Desativado - - - + ExtendedDynamicState 1 Estado Dinâmico Estendido 1 - + ExtendedDynamicState 2 Estado Dinâmico Estendido 2 - + ExtendedDynamicState 3 Estado Dinâmico Estendido 3 - + Tree View Visualização em Árvore - + Grid View Visualização em Grade diff --git a/dist/languages/pt_PT.ts b/dist/languages/pt_PT.ts index ae1b0929d6..7084f01e62 100644 --- a/dist/languages/pt_PT.ts +++ b/dist/languages/pt_PT.ts @@ -1116,993 +1116,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Desabilitar miniaplicativo de controle - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Habilitar Gamemode - + Force X11 as Graphics Backend - + Custom frontend Frontend customizado - + Real applet Miniaplicativo real - + + + Disabled + + + + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Assíncrona - + Uncompressed (Best quality) Descompactado (Melhor Q - + BC1 (Low quality) BC1 (Baixa qualidade) - + BC3 (Medium quality) BC3 (Média qualidade) - - + + Auto Automático - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Conservador - + Aggressive Agressivo - + Vulkan Vulcano - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Nenhum (desativado) - + Fast - - - + + + Accurate Preciso - - - + + + Default Padrão - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Inseguro - + Paranoid (disables most optimizations) Paranoia (desativa a maioria das otimizações) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Janela sem bordas - + Exclusive Fullscreen Tela cheia exclusiva - + No Video Output Sem saída de vídeo - + CPU Video Decoding Decodificação de vídeo pela CPU - + GPU Video Decoding (Default) Decodificação de vídeo pela GPU (Padrão) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Vizinho mais próximo - + Bilinear Bilinear - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nenhum - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Padrão (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 Forçar 16:10 - + Stretch to Window Esticar à Janela - + Automatic Automático - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonês (日本語) - + American English Inglês Americano - + French (français) Francês (français) - + German (Deutsch) Alemão (Deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Espanhol (español) - + Chinese Chinês - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandês (Nederlands) - + Portuguese (português) Português (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanês - + British English Inglês Britânico - + Canadian French Francês Canadense - + Latin American Spanish Espanhol Latino-Americano - + Simplified Chinese Chinês Simplificado - + Traditional Chinese (正體中文) Chinês Tradicional (正 體 中文) - + Brazilian Portuguese (português do Brasil) Português do Brasil (Brazilian Portuguese) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japão - + USA EUA - + Europe Europa - + Australia Austrália - + China China - + Korea Coreia - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Padrão (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipto - + Eire Irlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islândia - + Iran Irão - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polónia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estéreo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Padrão) - + 6GB DRAM (Unsafe) 6GB DRAM (Não seguro) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Ancorado - + Handheld Portátil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Sempre perguntar (Padrão) - + Only if game specifies not to stop Somente se o jogo especificar para não parar - + Never ask Nunca perguntar - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/ru_RU.ts b/dist/languages/ru_RU.ts index c1276416b1..248209833e 100644 --- a/dist/languages/ru_RU.ts +++ b/dist/languages/ru_RU.ts @@ -1166,994 +1166,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Отключить апплет контроллера - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Принудительно отключает использование апплета контроллера в эмулируемых программах. -При попытке открыть апплет он сразу закрывается. - - - Check for updates Проверять обновления - + Whether or not to check for updates upon startup. Проверять обновления при запуске. - + Enable Gamemode Включить режим игры - + Force X11 as Graphics Backend Принудительно использовать X11 как графический бэкенд - + Custom frontend Собственный интерфейс эмулятора - + Real applet Приложение из прошивки - + + + Disabled + Отключено + + + Never Никогда - + On Load При загрузке - + Always Всегда - + CPU CPU - + GPU GPU - + CPU Asynchronous Асинхронный CPU - + Uncompressed (Best quality) Без сжатия (наилучшее качество) - + BC1 (Low quality) BC1 (низкое качество) - + BC3 (Medium quality) BC3 (среднее качество) - - + + Auto Авто - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Консервативный - + Aggressive Агрессивный - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (ассемблерные шейдеры, только для NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (экспериментальный, только для AMD/Mesa) - + Null Null - + Fast Производительность - - - + + + Accurate Точность - - - + + + Default По умолчанию - + Unsafe (fast) Небезопасно (быстро) - + Safe (stable) Безопасно (стабильно) - + Immediate Мгновенный - + Balanced Баланс - + Unsafe Небезопасно - + Paranoid (disables most optimizations) Параноик (отключает большинство оптимизаций) - + Debugging Отладка - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Безрамочный режим - + Exclusive Fullscreen Эксклюзивный полноэкранный - + No Video Output Отсутствие видеовыхода - + CPU Video Decoding Декодирование видео на CPU - + GPU Video Decoding (Default) Декодирование видео на GPU (По умолчанию) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [Экспериментально] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [Экспериментально] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [Экспериментально] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [ЭКПЕРИМЕНТАЛЬНО] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [Экспериментально] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Ближайший сосед (Nearest Neighbor) - + Bilinear Билинейный - + Bicubic Бикубический - + Gaussian По Гауссу - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX™️ Super Resolution - + Area Область (Area) - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Никакой - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Стандартное (16:9) - + Force 4:3 Принудительно 4:3 - + Force 21:9 Принудительно 21:9 - + Force 16:10 Принудительно 16:10 - + Stretch to Window Растянуть до окна - + Automatic Автоматически - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Японский (日本語) - + American English Американский английский - + French (français) Французский (français) - + German (Deutsch) Немецкий (Deutsch) - + Italian (italiano) Итальянский (italiano) - + Spanish (español) Испанский (español) - + Chinese Китайский - + Korean (한국어) Корейский (한국어) - + Dutch (Nederlands) Голландский (Nederlands) - + Portuguese (português) Португальский (português) - + Russian (Русский) Русский - + Taiwanese Тайваньский - + British English Британский английский - + Canadian French Канадский французский - + Latin American Spanish Латиноамериканский испанский - + Simplified Chinese Упрощённый китайский - + Traditional Chinese (正體中文) Традиционный китайский (正體中文) - + Brazilian Portuguese (português do Brasil) Бразильский португальский (português do Brasil) - + Polish (polska) Польский (polska) - + Thai (แบบไทย) Тайский (แบบไทย) - - + + Japan Япония - + USA США - + Europe Европа - + Australia Австралия - + China Китай - + Korea Корея - + Taiwan Тайвань - + Auto (%1) Auto select time zone Авто (%1) - + Default (%1) Default time zone По умолчанию (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Куба - + EET EET - + Egypt Египет - + Eire Эйре - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Эйре - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Гринвич - + Hongkong Гонконг - + HST HST - + Iceland Исландия - + Iran Иран - + Israel Израиль - + Jamaica Ямайка - + Kwajalein Кваджалейн - + Libya Ливия - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Навахо - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Польша - + Portugal Португалия - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Сингапур - + Turkey Турция - + UCT UCT - + Universal Универсальный - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Зулу - + Mono Моно - + Stereo Стерео - + Surround Объемный звук - + 4GB DRAM (Default) 4 ГБ ОЗУ (По умолчанию) - + 6GB DRAM (Unsafe) 6 ГБ ОЗУ (Небезопасно) - + 8GB DRAM 8 ГБ ОЗУ - + 10GB DRAM (Unsafe) 10 ГБ ОЗУ (Небезопасно) - + 12GB DRAM (Unsafe) 12 ГБ ОЗУ (Небезопасно) - + Docked В док-станции - + Handheld Портативный - - + + Normal Нормальная - - + + Boost Ускоренная - - + + Overclock Разгон - + Always ask (Default) Всегда спрашивать (По умолчанию) - + Only if game specifies not to stop Только если игра указывает не останавливать - + Never ask Никогда не спрашивать - + Very Small (16 MB) Очень маленький (16 МБ) - + Small (32 MB) Маленький (32 МБ) - + Normal (128 MB) Нормальный (128 МБ) - + Large (256 MB) Большой (256 МБ) - + Very Large (512 MB) Очень большой (512 МБ) - + Very Low (4 MB) Очень низкий (4 МБ) - + Low (8 MB) Низкий (8 МБ) - + Normal (16 MB) Нормальный (16 МБ) - + Medium (32 MB) Средний (32 МБ) - + High (64 MB) Высокий (64 МБ) - + Very Low (32) Очень низкий (32) - + Low (64) Низкий (64) - + Normal (128) Нормальный (128) - + Medium (256) Средний (256) - + High (512) Высокий (512) - - Disabled - Отключено - - - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View Древовидный - + Grid View Сетчатый diff --git a/dist/languages/sv.ts b/dist/languages/sv.ts index b5cfbaa063..8662c56414 100644 --- a/dist/languages/sv.ts +++ b/dist/languages/sv.ts @@ -835,7 +835,11 @@ Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. Accurate further improves compatibility at the cost of some performance. Default follows the GPU Mode setting. - + Styr synkroniseringsbeteendet för GPU-staket. +Omedelbar är det snabbaste alternativet, men kan orsaka vissa problem. +Balanserad ger bättre kompatibilitet och kan lösa problem i vissa spel. +Exakt förbättrar kompatibiliteten ytterligare, men på bekostnad av viss prestanda. +Standard följer inställningen för GPU-läge. @@ -1173,994 +1177,983 @@ Om du aktiverar den hoppar du över sådana uppmaningar och avslutar emuleringen - Disable controller applet - Inaktivera kontroller-appleten - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Inaktiverar med tvång användningen av kontrollerappletten i emulerade program. -När ett program försöker öppna kontrollerappletten stängs den omedelbart. - - - Check for updates Leta efter uppdateringar - + Whether or not to check for updates upon startup. Om uppdateringar ska sökas vid start eller inte. - + Enable Gamemode Aktivera Gamemode - + Force X11 as Graphics Backend Tvinga X11 som grafikbackend - + Custom frontend Anpassad frontend - + Real applet Verklig applet - + + + Disabled + Inaktiverad + + + Never Aldrig - + On Load Vid inläsning - + Always Alltid - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU asynkron - + Uncompressed (Best quality) Okomprimerad (bästa kvalitet) - + BC1 (Low quality) BC1 (låg kvalitet) - + BC3 (Medium quality) BC3 (medelhög kvalitet) - - + + Auto Auto - + 30 FPS 30 bilder/s - + 60 FPS 60 bilder/s - + 90 FPS 90 bilder/s - + 120 FPS 120 bilder/s - + Conservative Konservativ - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembly Shaders, endast NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimentell, endast AMD/Mesa) - + Null Null - + Fast Snabb - - - + + + Accurate Exakt - - - + + + Default Standard - + Unsafe (fast) Osäker (snabb) - + Safe (stable) Säker (stabil) - + Immediate Omedelbar - + Balanced Balanserad - + Unsafe Inte säker - + Paranoid (disables most optimizations) Paranoid (inaktiverar de flesta optimeringar) - + Debugging Felsökning - + Dynarmic Dynarmisk - + NCE NCE - + Borderless Windowed Ramlöst fönsterläge - + Exclusive Fullscreen Exklusiv helskärm - + No Video Output Ingen videoutgång - + CPU Video Decoding CPU-videoavkodning - + GPU Video Decoding (Default) GPU videoavkodning (standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTELL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTELL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Närmsta granne - + Bilinear Bilinjär - + Bicubic Bikubisk - + Gaussian Gaussisk - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Område - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tvinga 4:3 - + Force 21:9 Tvinga 21:9 - + Force 16:10 Tvinga 16:10 - + Stretch to Window Sträck ut till fönster - + Automatic Automatiskt - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japanska (日本語) - + American English Amerikansk engelska - + French (français) Franska (français) - + German (Deutsch) Tyska (Deutsch) - + Italian (italiano) Italienska (italiano) - + Spanish (español) Spanska (español) - + Chinese Kinesiska - + Korean (한국어) Koreanska (한국어) - + Dutch (Nederlands) Nederländska (Nederlands) - + Portuguese (português) Portugisiska (português) - + Russian (Русский) Ryska (Русский) - + Taiwanese Taiwanesiska - + British English Brittisk engelska - + Canadian French Kanadensisk franska - + Latin American Spanish Latinamerikansk spanska - + Simplified Chinese Förenklad kinesiska - + Traditional Chinese (正體中文) Traditionell kinesiska (正體中文) - + Brazilian Portuguese (português do Brasil) Brasiliansk portugisiska (português do Brasil) - + Polish (polska) Polska (polska) - + Thai (แบบไทย) Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China Kina - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Egypten - + Eire Irland - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irland - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turkiet - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET VÅT - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (standard) - + 6GB DRAM (Unsafe) 6 GB DRAM (osäker) - + 8GB DRAM 8 GB DRAM - + 10GB DRAM (Unsafe) 10 GB DRAM (osäker) - + 12GB DRAM (Unsafe) 12 GB DRAM (osäker) - + Docked Dockad - + Handheld Handhållen - - + + Normal Normal - - + + Boost Förstärk - - + + Overclock Överklocka - + Always ask (Default) Fråga alltid (standard) - + Only if game specifies not to stop Endast om spelet anger att det inte ska stoppas - + Never ask Fråga aldrig - + Very Small (16 MB) Mycket liten (16 MB) - + Small (32 MB) Liten (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Stor (256 MB) - + Very Large (512 MB) Mycket stor (512 MB) - + Very Low (4 MB) Mycket låg (4 MB) - + Low (8 MB) Låg (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Medium (32 MB) - + High (64 MB) Hög (64 MB) - + Very Low (32) Mycket låg (32) - + Low (64) Låg (64) - + Normal (128) Normal (128) - + Medium (256) Medium (256) - + High (512) Hög (512) - - Disabled - Inaktiverad - - - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View Trädvy - + Grid View Rutnätsvy diff --git a/dist/languages/tr_TR.ts b/dist/languages/tr_TR.ts index 7bb09e316e..95f0e25c31 100644 --- a/dist/languages/tr_TR.ts +++ b/dist/languages/tr_TR.ts @@ -1125,993 +1125,983 @@ Etkinleştirildiğinde, bu tür istekleri/istemleri atlar ve emülasyonu doğrud - Disable controller applet - Kontrolcü aplikasyonunu devre dışı bırak - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Emüle edilen programlarda kontrolcü aplikasyonunun kullanımını zorla devre dışı bırakır. Bir program kontrolcü aplikasyonunu açmaya çalıştığında, aplikasyon anında kapatılır. - - - Check for updates Güncellemeleri Kontrol Et - + Whether or not to check for updates upon startup. Başlangıçta güncellemelerin kontrol edilip edilmeyeceği. - + Enable Gamemode Oyun Modunu/Gamemode Etkinleştir - + Force X11 as Graphics Backend Grafik arka ucu olarak X11'i zorla - + Custom frontend Özel ön yüz - + Real applet Gerçek aplikasyon - + + + Disabled + Devre Dışı + + + Never Asla - + On Load Yüklemede - + Always Her zaman - + CPU CPU - + GPU GPU - + CPU Asynchronous Asenkron CPU - + Uncompressed (Best quality) Sıkıştırılmamış (En iyi kalite) - + BC1 (Low quality) BC1 (Düşük kalite) - + BC3 (Medium quality) BC3 (Orta kalite) - - + + Auto Otomatik - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Muhafazakar - + Aggressive Agresif - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Boş - + Fast Hızlı - - - + + + Accurate Doğru - - - + + + Default Varsayılan - + Unsafe (fast) Güvenli Değil (hızlı) - + Safe (stable) Güvenli (Stabil) - + Immediate - + Balanced Dengeli - + Unsafe Güvensiz - + Paranoid (disables most optimizations) Paranoya (çoğu optimizasyonu kapatır) - + Debugging Hata ayıklama - + Dynarmic Dinamik - + NCE NCE - + Borderless Windowed Kenarlıksız Tam Ekran - + Exclusive Fullscreen Ayrılmış Tam Ekran - + No Video Output Video Çıkışı Yok - + CPU Video Decoding CPU Video Decoding - + GPU Video Decoding (Default) GPU Video Decoding (Varsayılan) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [DENEYSEL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [DENEYSEL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [DENEYSEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [DENEYSEL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [DENEYSEL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor En Yakın Komşu Algoritması - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gausyen - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Süper Çözünürlük - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Yok - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Varsayılan (16:9) - + Force 4:3 4:3'e Zorla - + Force 21:9 21:9'a Zorla - + Force 16:10 16:10'a Zorla - + Stretch to Window Ekrana Sığdır - + Automatic Otomatik - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonca (日本語) - + American English Amerikan İngilizcesi - + French (français) Fransızca (français) - + German (Deutsch) Almanca (Deutsch) - + Italian (italiano) İtalyanca (italiano) - + Spanish (español) İspanyolca (español) - + Chinese Çince - + Korean (한국어) Korece (한국어) - + Dutch (Nederlands) Flemenkçe (Nederlands) - + Portuguese (português) Portekizce (português) - + Russian (Русский) Rusça (Русский) - + Taiwanese Tayvanca - + British English İngiliz İngilizcesi - + Canadian French Kanada Fransızcası - + Latin American Spanish Latin Amerika İspanyolcası - + Simplified Chinese Basitleştirilmiş Çince - + Traditional Chinese (正體中文) Geleneksel Çince (正體中文) - + Brazilian Portuguese (português do Brasil) Brezilya Portekizcesi (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonya - + USA ABD - + Europe Avrupa - + Australia Avustralya - + China Çin - + Korea Kore - + Taiwan Tayvan - + Auto (%1) Auto select time zone Otomatik (%1) - + Default (%1) Default time zone Varsayılan (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Küba - + EET EET - + Egypt Mısır - + Eire İrlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-İrlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 MT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland İzlanda - + Iran İran - + Israel İsrail - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navaho - + NZ Yeni Zelanda - + NZ-CHAT Chatham Adaları - + Poland Polonya - + Portugal Portekiz - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Türkiye - + UCT UCT - + Universal Evrensel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Varsayılan) - + 6GB DRAM (Unsafe) 6GB DRAM (Güvenli Değil) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Güvenli Değil) - + 12GB DRAM (Unsafe) 12GB DRAM (Güvenli Değil) - + Docked Dock Modu Aktif - + Handheld Taşınabilir - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Her zaman sor (Varsayılan) - + Only if game specifies not to stop Sadece oyun durdurulmamasını belirtirse - + Never ask Asla sorma - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Orta (256) - + High (512) Yüksek (512) - - Disabled - Devre Dışı - - - + ExtendedDynamicState 1 Genişletilmiş Dinamik Durum 1 - + ExtendedDynamicState 2 Genişletilmiş Dinamik Durum 2 - + ExtendedDynamicState 3 Genişletilmiş Dinamik Durum 3 - + Tree View - + Grid View diff --git a/dist/languages/uk.ts b/dist/languages/uk.ts index 4b7e94bfe9..2fdce360cc 100644 --- a/dist/languages/uk.ts +++ b/dist/languages/uk.ts @@ -429,13 +429,14 @@ Can help reduce stuttering at lower framerates. CPU Clocks - + Тактові частоти ЦП Raises the clock the emulated CPU reports, which removes some FPS limiters. Weaker CPUs may see reduced performance, and certain games may behave improperly. - + Збільшує тактову частоту, про яку повідомляє емульований ЦП, завдяки чому прибираються деякі обмеження частоти кадрів. +На слабших ЦП це може спричинити зменшення продуктивності, а деякі ігри можуть неправильно відтворюватися. @@ -595,12 +596,12 @@ FXAA може створювати стабільніше зображення Enable post-processing effects - + Увімкнути ефекти постобробки Applies post-processing effects to the final image. - + Застосовує ефекти постобробки до фінального зображення. @@ -1168,994 +1169,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Вимкнути аплет контролера - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - Примусово вимикає використання в емульованих програмах аплета контролера. -Якщо програма спробує відкрити аплет контролера, він одразу закриється. - - - Check for updates Перевіряти оновлення - + Whether or not to check for updates upon startup. Чи перевіряти оновлення при запуску. - + Enable Gamemode Увімкнути ігровий режим - + Force X11 as Graphics Backend Примусово використовувати X11 як графічний бекенд - + Custom frontend Користувацький фронтенд - + Real applet Справжній аплет - + + + Disabled + Вимкнено + + + Never Ніколи - + On Load При завантаженні - + Always Завжди - + CPU ЦП - + GPU ГП - + CPU Asynchronous Асинхронно ЦП - + Uncompressed (Best quality) Без стиснення (Найкраща якість) - + BC1 (Low quality) ВС1 (Низька якість) - + BC3 (Medium quality) ВС3 (Середня якість) - - + + Auto Автоматично - + 30 FPS 30 к/с - + 60 FPS 60 к/с - + 90 FPS 90 к/с - + 120 FPS 120 к/с - + Conservative Заощадження - + Aggressive Агресивно - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (асемблерні шейдери, лише NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (експериментально, лише AMD/Mesa) - + Null Нічого - + Fast Швидко - - - + + + Accurate Точно - - - + + + Default Стандартно - + Unsafe (fast) Небезпечно (швидко) - + Safe (stable) Безпечно (стабільно) - + Immediate - + Balanced Збалансовано - + Unsafe Небезпечно - + Paranoid (disables most optimizations) Параноїк (вимикає більшість оптимізацій) - + Debugging Зневадження - + Dynarmic Динамічно - + NCE NCE - + Borderless Windowed Безрамкове вікно - + Exclusive Fullscreen Ексклюзивний повноекранний - + No Video Output Виведення відео відсутнє - + CPU Video Decoding Декодування відео на ЦП - + GPU Video Decoding (Default) Декодування відео на ГП (стандатно) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [ЕКСПЕРИМЕНТАЛЬНО] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [ЕКСПЕРИМЕНТАЛЬНО] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [ЕКСПЕРИМЕНТАЛЬНО] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [ЕКСПЕРИМЕНТАЛЬНО] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [ЕКСПЕРИМЕНТАЛЬНО] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Найближчий сусід - + Bilinear Білінійний - + Bicubic Бікубічний - + Gaussian Ґаусса - + Lanczos Ланцоша - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Області - + MMPX MMPX - + Zero-Tangent Нульовий тангенс - + B-Spline B-Spline - + Mitchell Мітчелла - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Немає - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Стандартно (16:9) - + Force 4:3 Примусово 4:3 - + Force 21:9 Примусово 21:9 - + Force 16:10 Примусово 16:10 - + Stretch to Window Розтягнути до вікна - + Automatic Автоматично - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Японська (日本語) - + American English Американська англійська - + French (français) Французька (français) - + German (Deutsch) Німецька (Deutsch) - + Italian (italiano) Італійська (italiano) - + Spanish (español) Іспанська (español) - + Chinese Китайська - + Korean (한국어) Корейська (한국어) - + Dutch (Nederlands) Нідерландська (Nederlands) - + Portuguese (português) Португальська (português) - + Russian (Русский) Російська (Русский) - + Taiwanese Тайванська - + British English Британська англійська - + Canadian French Канадська французька - + Latin American Spanish Латиноамериканська іспанська - + Simplified Chinese Спрощена китайська - + Traditional Chinese (正體中文) Традиційна китайська (正體中文) - + Brazilian Portuguese (português do Brasil) Бразильська португальська (português do Brasil) - + Polish (polska) Польська (polska) - + Thai (แบบไทย) Тайська (แบบไทย) - - + + Japan Японія - + USA США - + Europe Європа - + Australia Австралія - + China Китай - + Korea Корея - + Taiwan Тайвань - + Auto (%1) Auto select time zone Автоматично (%1) - + Default (%1) Default time zone Стандартно (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Куба - + EET EET - + Egypt Єгипет - + Eire Ейре - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Гринвіч - + Hongkong Гонконг - + HST HST - + Iceland Ісландія - + Iran Іран - + Israel Ізраїль - + Jamaica Ямайка - + Kwajalein Кваджалейн - + Libya Лівія - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Навахо - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Польща - + Portugal Португалія - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Сінгапур - + Turkey Туреччина - + UCT UCT - + Universal Універсальний - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Зулу - + Mono Моно - + Stereo Стерео - + Surround Об’ємний - + 4GB DRAM (Default) 4GB DRAM (стандартно) - + 6GB DRAM (Unsafe) 6GB DRAM (небезпечно) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (небезпечно) - + 12GB DRAM (Unsafe) 12GB DRAM (небезпечно) - + Docked У докстанції - + Handheld Портативний - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Завжди запитувати (стандартно) - + Only if game specifies not to stop Лише якщо гра вказує не зупиняти - + Never ask Ніколи не запитувати - + Very Small (16 MB) Дуже малий (16 МБ) - + Small (32 MB) Малий (32 МБ) - + Normal (128 MB) Нормальний (128 МБ) - + Large (256 MB) Великий (256 МБ) - + Very Large (512 MB) Дуже великий (512 МБ) - + Very Low (4 MB) Дуже низький (4 МБ) - + Low (8 MB) Низький (8 МБ) - + Normal (16 MB) Нормальний (16 МБ) - + Medium (32 MB) Середній (32 МБ) - + High (64 MB) Високий (64 МБ) - + Very Low (32) Дуже низький (32) - + Low (64) Низький (64) - + Normal (128) Нормальний (128) - + Medium (256) Середньо (256) - + High (512) Високо (512) - - Disabled - Вимкнено - - - + ExtendedDynamicState 1 Розширений динамічний стан 1 - + ExtendedDynamicState 2 Розширений динамічний стан 2 - + ExtendedDynamicState 3 Розширений динамічний стан 3 - + Tree View Дерево вибору - + Grid View Таблиця diff --git a/dist/languages/vi.ts b/dist/languages/vi.ts index a2042eb499..f1257a08f5 100644 --- a/dist/languages/vi.ts +++ b/dist/languages/vi.ts @@ -1108,993 +1108,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Vô hiệu hoá applet tay cầm - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + + + + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) Không nén (Chất lượng tốt nhất) - + BC1 (Low quality) BC1 (Chất lượng thấp) - + BC3 (Medium quality) BC3 (Chất lượng trung bình) - - + + Auto Tự động - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Chính xác - - - + + + Default Mặc định - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Không an toàn - + Paranoid (disables most optimizations) Paranoid (vô hiệu hoá hầu hết sự tối ưu) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Cửa sổ không viền - + Exclusive Fullscreen Toàn màn hình - + No Video Output Không có đầu ra video - + CPU Video Decoding Giải mã video bằng CPU - + GPU Video Decoding (Default) Giải mã video bằng GPU (Mặc định) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [THỬ NGHIỆM] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [THỬ NGHIỆM] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Không có - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Mặc định (16:9) - + Force 4:3 Dùng 4:3 - + Force 21:9 Dùng 21:9 - + Force 16:10 Dùng 16:10 - + Stretch to Window Mở rộng đến cửa sổ - + Automatic Tự động - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Tiếng Nhật (日本語) - + American English Tiếng Anh Mỹ - + French (français) Tiếng Pháp (French) - + German (Deutsch) Tiếng Đức (Deutsch) - + Italian (italiano) Tiếng Ý (italiano) - + Spanish (español) Tiếng Tây Ban Nha (Español) - + Chinese Tiếng Trung - + Korean (한국어) Tiếng Hàn (한국어) - + Dutch (Nederlands) Tiếng Hà Lan (Nederlands) - + Portuguese (português) Tiếng Bồ Đào Nha (Portuguese) - + Russian (Русский) Tiếng Nga (Русский) - + Taiwanese Tiếng Đài Loan - + British English Tiếng Anh Anh - + Canadian French Tiếng Pháp Canada - + Latin American Spanish Tiếng Tây Ban Nha Mỹ Latinh - + Simplified Chinese Tiếng Trung giản thể - + Traditional Chinese (正體中文) Tiếng Trung phồn thể (正體中文) - + Brazilian Portuguese (português do Brasil) Tiếng Bồ Đào Nha Brasil (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Nhật Bản - + USA Hoa Kỳ - + Europe Châu Âu - + Australia Úc - + China Trung Quốc - + Korea Hàn Quốc - + Taiwan Đài Loan - + Auto (%1) Auto select time zone Tự động (%1) - + Default (%1) Default time zone Mặc định (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ai Cập - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hồng Kông - + HST HST - + Iceland Iceland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Ba Lan - + Portugal Bồ Đào Nha - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Thổ Nhĩ Kỳ - + UCT UCT - + Universal Quốc tế - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/vi_VN.ts b/dist/languages/vi_VN.ts index 6acff0c2da..64edf2850d 100644 --- a/dist/languages/vi_VN.ts +++ b/dist/languages/vi_VN.ts @@ -1108,993 +1108,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - Vô hiệu hoá applet tay cầm - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - + + + Disabled + + + + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) Không nén (Chất lượng tốt nhất) - + BC1 (Low quality) BC1 (Chất lượng thấp) - + BC3 (Medium quality) BC3 (Chất lượng trung bình) - - + + Auto Tự động - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Tuyệt đối - - - + + + Default Mặc định - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Tương đối - + Paranoid (disables most optimizations) Paranoid (vô hiệu hoá hầu hết sự tối ưu) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Cửa sổ không viền - + Exclusive Fullscreen Toàn màn hình - + No Video Output Không Video Đầu Ra - + CPU Video Decoding Giải mã video bằng CPU - + GPU Video Decoding (Default) Giải mã video bằng GPU (Mặc định) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [THỬ NGHIỆM] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [THỬ NGHIỆM] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian ScaleForce - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Trống - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Mặc định (16:9) - + Force 4:3 Dùng 4:3 - + Force 21:9 Dùng 21:9 - + Force 16:10 Dung 16:10 - + Stretch to Window Kéo dãn đến cửa sổ phần mềm - + Automatic Tự động - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Tiếng Nhật (日本語) - + American English Tiếng Anh Mỹ - + French (français) Tiếng Pháp (French) - + German (Deutsch) Tiếng Đức (Deutsch) - + Italian (italiano) Tiếng Ý (italiano) - + Spanish (español) Tiếng Tây Ban Nha (Spanish) - + Chinese Tiếng Trung - + Korean (한국어) Tiếng Hàn (한국어) - + Dutch (Nederlands) Tiếng Hà Lan (Dutch) - + Portuguese (português) Tiếng Bồ Đào Nha (Portuguese) - + Russian (Русский) Tiếng Nga (Русский) - + Taiwanese Tiếng Đài Loan - + British English Tiếng Anh UK (British English) - + Canadian French Tiếng Pháp Canada - + Latin American Spanish Tiếng Mỹ La-tinh - + Simplified Chinese Tiếng Trung giản thể - + Traditional Chinese (正體中文) Tiếng Trung phồn thể (正體中文) - + Brazilian Portuguese (português do Brasil) Tiếng Bồ Đào Nha của người Brazil (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Nhật Bản - + USA Hoa Kỳ - + Europe Châu Âu - + Australia Châu Úc - + China Trung Quốc - + Korea Hàn Quốc - + Taiwan Đài Loan - + Auto (%1) Auto select time zone Tự động (%1) - + Default (%1) Default time zone Mặc định (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ai Cập - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hồng Kông - + HST HST - + Iceland Iceland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Ba Lan - + Portugal Bồ Đào Nha - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Thổ Nhĩ Kỳ - + UCT UCT - + Universal Quốc tế - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Chế độ cắm TV - + Handheld Cầm tay - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/zh_CN.ts b/dist/languages/zh_CN.ts index 46c8fd8014..e6d5890370 100644 --- a/dist/languages/zh_CN.ts +++ b/dist/languages/zh_CN.ts @@ -1170,994 +1170,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - 禁用控制器小程序 - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - 强制禁止在模拟程序中使用控制器小程序。 - 当程序尝试打开控制器小程序时,它会立即被关闭。 - - - Check for updates 检查更新 - + Whether or not to check for updates upon startup. 在启动时是否检查更新。 - + Enable Gamemode 启用游戏模式 - + Force X11 as Graphics Backend 强制使用 X11 作为图形后端 - + Custom frontend 自定义前端 - + Real applet 真实的小程序 - + + + Disabled + 禁用 + + + Never 永不 - + On Load 加载时 - + Always 总是 - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 异步模拟 - + Uncompressed (Best quality) 不压缩 (最高质量) - + BC1 (Low quality) BC1 (低质量) - + BC3 (Medium quality) BC3 (中等质量) - - + + Auto 自动 - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative 保守模式 - + Aggressive 激进模式 - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (汇编着色器,仅限 NVIDIA 显卡) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (实验性,仅限 AMD/Mesa) - + Null 无 - + Fast 高速 - - - + + + Accurate 高精度 - - - + + + Default 系统默认 - + Unsafe (fast) 不安全(快速) - + Safe (stable) 安全(稳定) - + Immediate 即时 - + Balanced 平衡 - + Unsafe 低精度 - + Paranoid (disables most optimizations) 偏执模式 (禁用绝大多数优化项) - + Debugging 调试 - + Dynarmic 动态编译 - + NCE 本机代码执行 - + Borderless Windowed 无边框窗口 - + Exclusive Fullscreen 独占全屏 - + No Video Output 无视频输出 - + CPU Video Decoding CPU 视频解码 - + GPU Video Decoding (Default) GPU 视频解码 (默认) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [实验性] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [实验性] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [实验性] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [实验性] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [实验性] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 近邻取样 - + Bilinear 双线性过滤 - + Bicubic 双三线过滤 - + Gaussian 高斯模糊 - + Lanczos Lanczos - + ScaleForce 强制缩放 - + AMD FidelityFX Super Resolution AMD FidelityFX 超级分辨率 - + Area 区域 - + MMPX MMPX - + Zero-Tangent 零切线 - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution 骁龙游戏超级分辨率 - + Snapdragon Game Super Resolution EdgeDir 骁龙游戏超级分辨率 EdgeDir - + None 无 - + FXAA 快速近似抗锯齿 - + SMAA 子像素形态学抗锯齿 - + Default (16:9) 默认 (16:9) - + Force 4:3 强制 4:3 - + Force 21:9 强制 21:9 - + Force 16:10 强制 16:10 - + Stretch to Window 拉伸窗口 - + Automatic 自动 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日语 (日本語) - + American English 美式英语 - + French (français) 法语 (français) - + German (Deutsch) 德语 (Deutsch) - + Italian (italiano) 意大利语 (italiano) - + Spanish (español) 西班牙语 (español) - + Chinese 中文 - + Korean (한국어) 韩语 (한국어) - + Dutch (Nederlands) 荷兰语 (Nederlands) - + Portuguese (português) 葡萄牙语 (português) - + Russian (Русский) 俄语 (Русский) - + Taiwanese 台湾中文 - + British English 英式英语 - + Canadian French 加拿大法语 - + Latin American Spanish 拉美西班牙语 - + Simplified Chinese 简体中文 - + Traditional Chinese (正體中文) 繁体中文 (正體中文) - + Brazilian Portuguese (português do Brasil) 巴西-葡萄牙语 (português do Brasil) - + Polish (polska) 波兰语(波兰语) - + Thai (แบบไทย) 泰语 - - + + Japan 日本 - + USA 美国 - + Europe 欧洲 - + Australia 澳大利亚 - + China 中国 - + Korea 韩国 - + Taiwan 台湾地区 - + Auto (%1) Auto select time zone 自动 (%1) - + Default (%1) Default time zone 默认 (%1) - + CET 欧洲中部时间 - + CST6CDT 古巴标准时间&古巴夏令时 - + Cuba 古巴 - + EET 东欧时间 - + Egypt 埃及 - + Eire 爱尔兰 - + EST 东部标准时间 - + EST5EDT 东部标准时间&东部夏令时 - + GB 英国 - + GB-Eire 英国-爱尔兰时间 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 格林威治 - + Hongkong 香港 - + HST 美国夏威夷时间 - + Iceland 冰岛 - + Iran 伊朗 - + Israel 以色列 - + Jamaica 牙买加 - + Kwajalein 夸贾林环礁 - + Libya 利比亚 - + MET 中欧时间 - + MST 山区标准时间 (北美) - + MST7MDT 山区标准时间&山区夏令时 (北美) - + Navajo 纳瓦霍 - + NZ 新西兰时间 - + NZ-CHAT NZ-CHAT - + Poland 波兰 - + Portugal 葡萄牙 - + PRC 中国标准时间 - + PST8PDT 太平洋标准时间&太平洋夏令时 - + ROC 台湾时间 - + ROK 韩国时间 - + Singapore 新加坡 - + Turkey 土耳其 - + UCT UCT - + Universal 世界时间 - + UTC 协调世界时 - + W-SU 欧洲-莫斯科时间 - + WET 西欧时间 - + Zulu 祖鲁 - + Mono 单声道 - + Stereo 立体声 - + Surround 环绕声 - + 4GB DRAM (Default) 4GB DRAM (默认) - + 6GB DRAM (Unsafe) 6GB DRAM (不安全) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (不安全) - + 12GB DRAM (Unsafe) 12GB DRAM (不安全) - + Docked 主机模式 - + Handheld 掌机模式 - - + + Normal 正常 - - + + Boost 升频 - - + + Overclock 超频 - + Always ask (Default) 总是询问 (默认) - + Only if game specifies not to stop 仅当游戏不希望停止时 - + Never ask 从不询问 - + Very Small (16 MB) 很小 (16 MB) - + Small (32 MB) 较小 (32 MB) - + Normal (128 MB) 正常 (128 MB) - + Large (256 MB) 较大 (256 MB) - + Very Large (512 MB) 很大 (512 MB) - + Very Low (4 MB) 很低 (4 MB) - + Low (8 MB) 低 (8 MB) - + Normal (16 MB) 正常 (16 MB) - + Medium (32 MB) 中 (32 MB) - + High (64 MB) 高 (64 MB) - + Very Low (32) 很低 (32) - + Low (64) 低 (64) - + Normal (128) 正常 (128) - + Medium (256) 中(256) - + High (512) 高(512) - - Disabled - 禁用 - - - + ExtendedDynamicState 1 扩展动态状态 1 - + ExtendedDynamicState 2 扩展动态状态 2 - + ExtendedDynamicState 3 扩展动态状态 3 - + Tree View 树景视图 - + Grid View 网格视图 diff --git a/dist/languages/zh_TW.ts b/dist/languages/zh_TW.ts index 678757a328..499262847d 100644 --- a/dist/languages/zh_TW.ts +++ b/dist/languages/zh_TW.ts @@ -1135,993 +1135,983 @@ Enabling it bypasses such prompts and directly exits the emulation. - Disable controller applet - 禁用控制器程序 - - - - Forcibly disables the use of the controller applet in emulated programs. -When a program attempts to open the controller applet, it is immediately closed. - - - - Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode 启用游戏模式 - + Force X11 as Graphics Backend - + Custom frontend 自定义前端 - + Real applet 真实的小程序 - + + + Disabled + + + + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 异步模拟 - + Uncompressed (Best quality) 不壓縮 (最高品質) - + BC1 (Low quality) BC1 (低品質) - + BC3 (Medium quality) BC3 (中品質) - - + + Auto 自動 - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative 保守模式(节省 VRAM) - + Aggressive 激进模式 - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null 無 - + Fast - - - + + + Accurate 高精度 - - - + + + Default 預設 - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe 低精度 - + Paranoid (disables most optimizations) 偏执模式 (禁用绝大多数优化项) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed 無邊框視窗 - + Exclusive Fullscreen 全螢幕獨占 - + No Video Output 無視訊輸出 - + CPU Video Decoding CPU 視訊解碼 - + GPU Video Decoding (Default) GPU 視訊解碼(預設) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [实验性] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [實驗性] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [實驗性] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 最近鄰 - + Bilinear 雙線性 - + Bicubic 雙立方 - + Gaussian 高斯 - + Lanczos - + ScaleForce 強制縮放 - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None 無 - + FXAA FXAA - + SMAA SMAA - + Default (16:9) 預設 (16:9) - + Force 4:3 強制 4:3 - + Force 21:9 強制 21:9 - + Force 16:10 強制 16:10 - + Stretch to Window 延伸視窗 - + Automatic 自動 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日文 (日本語) - + American English 美式英语 - + French (français) 法文 (français) - + German (Deutsch) 德文 (Deutsch) - + Italian (italiano) 義大利文 (italiano) - + Spanish (español) 西班牙文 (español) - + Chinese 中文 - + Korean (한국어) 韓文 (한국어) - + Dutch (Nederlands) 荷蘭文 (Nederlands) - + Portuguese (português) 葡萄牙文 (português) - + Russian (Русский) 俄文 (Русский) - + Taiwanese 台灣中文 - + British English 英式英文 - + Canadian French 加拿大法文 - + Latin American Spanish 拉丁美洲西班牙文 - + Simplified Chinese 簡體中文 - + Traditional Chinese (正體中文) 正體中文 (正體中文) - + Brazilian Portuguese (português do Brasil) 巴西-葡萄牙語 (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan 日本 - + USA 美國 - + Europe 歐洲 - + Australia 澳洲 - + China 中國 - + Korea 南韓 - + Taiwan 台灣 - + Auto (%1) Auto select time zone 自動 (%1) - + Default (%1) Default time zone 預設 (%1) - + CET 中歐 - + CST6CDT CST6CDT - + Cuba 古巴 - + EET EET - + Egypt 埃及 - + Eire 愛爾蘭 - + EST 北美東部 - + EST5EDT EST5EDT - + GB GB - + GB-Eire 英國-愛爾蘭 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 格林威治 - + Hongkong 香港 - + HST 夏威夷 - + Iceland 冰島 - + Iran 伊朗 - + Israel 以色列 - + Jamaica 牙買加 - + Kwajalein 瓜加林環礁 - + Libya 利比亞 - + MET 中歐 - + MST 北美山區 - + MST7MDT MST7MDT - + Navajo 納瓦霍 - + NZ 紐西蘭 - + NZ-CHAT 紐西蘭-查塔姆群島 - + Poland 波蘭 - + Portugal 葡萄牙 - + PRC 中國 - + PST8PDT 太平洋 - + ROC 臺灣 - + ROK 韓國 - + Singapore 新加坡 - + Turkey 土耳其 - + UCT UCT - + Universal 世界 - + UTC UTC - + W-SU 莫斯科 - + WET 西歐 - + Zulu 協調世界時 - + Mono 單聲道 - + Stereo 立體聲 - + Surround 環繞音效 - + 4GB DRAM (Default) 4GB DRAM (默认) - + 6GB DRAM (Unsafe) 6GB DRAM (不安全) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked TV - + Handheld 掌機模式 - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) 总是询问 (默认) - + Only if game specifies not to stop 仅当游戏不希望停止时 - + Never ask 从不询问 - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - - Disabled - - - - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/src/android/app/src/main/res/values-ar/strings.xml b/src/android/app/src/main/res/values-ar/strings.xml index fe8e1e0555..1082a117ab 100644 --- a/src/android/app/src/main/res/values-ar/strings.xml +++ b/src/android/app/src/main/res/values-ar/strings.xml @@ -28,7 +28,7 @@ السلوك إخفاء الطبقة تلقائيًا إخفاء طبقة ذراع التحكم باللمس تلقائيًا بعد مرور الوقت المحدد من عدم النشاط. - تمكين إخفاء الطبقة تلقائيًا + تفعيل إخفاء الطبقة تلقائيًا إخفاء الطبقة عند إدخال ذراع التحكم إخفاء تلقائي لطبقة عناصر التحكم باللمس عند استخدام ذراع تحكم فعلية. تظهر الطبقة مرة أخرى عند فصل ذراع التحكم. عكس أزرار التأكيد/الرجوع في وحدة التحكم @@ -51,7 +51,7 @@ التخصيص الرؤية طبقة الأداء - تمكين طبقة إحصائيات الأداء + تفعيل طبقة إحصائيات الأداء ضبط المعلومات التي يتم عرضها في طبقة إحصائيات الأداء عرض معدل الإطارات عرض معدل الإطارات الحالي @@ -81,7 +81,7 @@ عرض طبقة معلومات الجهاز - تمكين طبقة الجهاز + تفعيل طبقة الجهاز طبقة الجهاز ضبط المعلومات التي يتم عرضها في طبقة الجهاز @@ -98,8 +98,8 @@ مزامنة سرعة النواة قم بمزامنة سرعة النواة مع النسبة المئوية للسرعة القصوى لتحسين الأداء دون تغيير السرعة الفعلية للعبة. - تمكين محاكاة MMU المضيف - يعمل هذا التحسين على تسريع وصول الذاكرة بواسطة البرنامج الضيف. يؤدي تمكينه إلى إجراء عمليات قراءة/كتابة ذاكرة الضيف مباشرة في الذاكرة والاستفادة من MMU المضيف. يؤدي تعطيل هذا إلى إجبار جميع عمليات الوصول إلى الذاكرة على استخدام محاكاة MMU البرمجية. + تفعيل محاكاة MMU المضيف + يعمل هذا التحسين على تسريع وصول الذاكرة بواسطة البرنامج الضيف. يؤدي تفعيله إلى إجراء عمليات قراءة/كتابة ذاكرة الضيف مباشرة في الذاكرة والاستفادة من MMU المضيف. يؤدي تعطيل هذا إلى إجبار جميع عمليات الوصول إلى الذاكرة على استخدام محاكاة MMU البرمجية. مقابض تصحيح الأخطاء للإستخدام في التطوير فقط. 0 إلى 65535 @@ -342,7 +342,7 @@ دقة مسار التدفق البصري، كجزء من الناتج. ويُعد خفض هذه القيمة أرخص طريقة لاستعادة الأداء. توليد الإطار غير متاح يفتقر برنامج تشغيل وحدة معالجة الرسومات هذا إلى نموذج ذاكرة Vulkan أو دعم الدقة النصفية (float16) التي تتطلبها برامج التظليل الخاصة بـ «Lossless Scaling». - اختياري. قم بتوفير ملف Lossless.dll الخاص بك لتمكين إنشاء الإطارات لاحقًا + اختياري. قم بتوفير ملف Lossless.dll الخاص بك لتفعيل إنشاء الإطارات لاحقًا تثبيت ملف Lossless.dll يتطلب إنشاء الإطارات أن تكون لديك نسخة قانونية خاصة بك من ملف Lossless.dll المأخوذ من برنامج Lossless Scaling اختر نسخة أخرى من ملف Lossless.dll @@ -350,7 +350,7 @@ مدعوم غير مدعوم (لا يتوفر نموذج ذاكرة Vulkan أو float16) Lossless Scaling - قم بتوفير نسختك الخاصة من ملف Lossless.dll لتمكين توليد الإطارات + قم بتوفير نسختك الخاصة من ملف Lossless.dll لتفعيل توليد الإطارات مثبت غير مثبت استبدل @@ -502,9 +502,9 @@ نسبة الحد الأقصى للسرعة يحدد النسبة المئوية للحد من سرعة المحاكاة. %100 هي السرعة الطبيعية. القيم الأعلى أو الأقل ستزيد أو تقلل من الحد الأقصى للسرعة. سرعة تيربو - عند تمكين وضع التيربو، سيتم تشغيل المحاكاة بهذه السرعة. + عند تفعيل وضع التيربو، سيتم تشغيل المحاكاة بهذه السرعة. سرعة بطيئة - عند تمكين الوضع البطيء، سيتم تشغيل المحاكاة بهذه السرعة. + عند تفعيل الوضع البطيء، سيتم تشغيل المحاكاة بهذه السرعة. خلفية وحدة المعالجة المركزية دقة وحدة المعالجة المركزية %1$s%2$s @@ -578,7 +578,7 @@ يمكن لهذه الحيلة أن تزيد من الأداء عن طريق نقل عملية العرض إلى خيط معالجة منفصل على حساب مشاكل الرسوميات. استخدم التنظيف التفاعلي يحسن دقة العرض في بعض الألعاب على حساب الأداء. - تمكين سجل التخزين المؤقت + تفعيل سجل التخزين المؤقت يُتيح هذا الخيار الوصول إلى حالات التخزين المؤقت السابقة. وقد يُحسّن جودة العرض وثبات الأداء في بعض الألعاب. مخازن الرؤوس المُحسّنة يُتيح ربطًا مُحسَّنًا لمخازن الرؤوس لتحسين الأداء. يتطلب برامج تشغيل Mesa 26.0+ Turnip/ برامج تشغيل QCOM. قد يتعطل على برامج تشغيل Turnip القديمة (25.3 وما دون). @@ -616,7 +616,7 @@ يتحكم هذا الخيار في عدد الميزات التي يمكن استخدامها في ExtendedDynamicState (EDS). كلما زادت القيمة، قلّ عدد عمليات تجميع خط الأنابيب بناءً على الحالة الديناميكية التي يدعمها برنامج التشغيل. معطل حالة ديناميكية لإدخال الرأس - يتيح تمكين هذه الميزة معالجة أكثر مرونة لمدخلات الرؤوس، مما قد يقلل من وقت تجميع خط الأنابيب في vertex/buffer. + يتيح تفعيل هذه الميزة معالجة أكثر مرونة لمدخلات الرؤوس، مما قد يقلل من وقت تجميع خط الأنابيب في vertex/buffer. تظليل العينة يسمح هذا الخيار بتنفيذ مُظلل الأجزاء لكل عينة في جزء متعدد العينات بدلاً من تنفيذه مرة واحدة لكل جزء. يُحسّن هذا من جودة الرسومات على حساب بعض الأداء. @@ -825,9 +825,9 @@ النظام وضع الإرساء، المنطقة، اللغة الرسومات - مستوى الدقة، الدقة، ذاكرة التخزين المؤقتة للتظليل + مستوى دقة المحاكاة، الدقة، ذاكرة التخزين المؤقتة للتظليل الإعدادات السريعة - تمكين الإعدادات السريعة + تفعيل الإعدادات السريعة السماح بالوصول إلى قائمة الإعدادات السريعة عن طريق التمرير و زر القائمة الصوت محرك الإخراج، مستوى الصوت @@ -1223,8 +1223,8 @@ وضع الطيران يمرر وضع الطيران إلى نظام تشغيل Switch - تمكين التطبيق الصغير للطبقة - تمكين التطبيق الصغير المدمج في Horizon. اضغط مع الاستمرار على زر الشاشة الرئيسية لمدة 1 ثانية لإظهاره. + تفعيل التطبيق الصغير للطبقة + تفعيل التطبيق الصغير المدمج في Horizon. اضغط مع الاستمرار على زر الشاشة الرئيسية لمدة 1 ثانية لإظهاره. إدارة ملف التعريف 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 index 044b7675de..55b126fd91 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -16,7 +16,7 @@ 範圍最大必須為%1$d 無效的範圍 - 使用個別設定中 + 使用個別遊戲設定中 顯示虛擬按鍵 @@ -67,7 +67,7 @@ 當著色器在編譯時顯示 顯示正在編譯的著色器數量 管線工作執行緒 - 設定用於建置 Vulkan 管線的 CPU 核心數量,設定的數值越大效能越好,但溫度也會上升更快 + 設定用於建置Vulkan管線的CPU核心數量,設定的數值越大效能越好,但溫度也會上升更快 疊加層位置 選擇疊加層在畫面上的顯示位置 左上 @@ -98,15 +98,15 @@ 同步核心速度 將核心速度與最大速度百分比同步,在不改變遊戲實際速度的情況下提高效能 - 啟用主機 MMU 模擬 - 此最佳化可加速客體程式的記憶體存取。啟用後,客體記憶體讀取/寫入將直接在記憶體中執行並利用主機的 MMU。停用此功能將強制所有記憶體存取使用軟體 MMU 模擬。 + 啟用主機MMU模擬 + 此最佳化可加速客體程式的記憶體存取。啟用後,客體記憶體讀取/寫入將直接在記憶體中執行並利用主機的MMU。停用此功能將強制所有記憶體存取使用軟體MMU模擬 偵錯開關 僅限開發用途 0到65535 NVDEC模擬 - 若在過場動畫中當機請切換成 CPU + 若在過場動畫中當機請切換成CPU 無 @@ -151,7 +151,7 @@ %1$s 離開 %1$s 被踢出 %1$s 被封鎖 - 位址已解封 + IP位址已解封 踢出成員 密碼 正在加入… @@ -173,7 +173,7 @@ 封鎖使用者 公開房間 未找到公開房間 - 需要輸入密碼 + 請輸入密碼 :%1$d/%2$d 遊戲 任意遊戲 @@ -189,7 +189,7 @@ 需要Web令牌,請前往進階設定 -> 系統 -> 網路 IP格式無效 必須介於4-20個字元之間,並且僅能使用英文字母、數字、句點、破折號、底線和空格(標點符號須為英文格式) - 使用者名稱無效,請在系統→網路中檢查設定 + 使用者名稱無效,請在系統 -> 網路中檢查設定 必須為48個字元,且僅包含小寫字母a-z 埠號需為1-65535 取消 @@ -201,16 +201,16 @@ 歡迎! - 瞭解如何設定 Eden 並開始模擬。 + 瞭解如何設定 Eden 並開始模擬 開始使用 金鑰 - 使用下方的按鈕安裝您的 prod.keys 檔案。 + 使用下方的按鈕安裝您的 prod.keys 檔案 韌體 使用下方的按鈕安裝您的firmware.zip檔案 遊戲資料夾 使用下方的按鈕選擇您的遊戲資料夾。 完成 - 您已準備就緒。\n盡情遊玩您的遊戲! + 您已準備就緒\n盡情遊玩您的遊戲! 下一步 上一步 新增遊戲 @@ -237,7 +237,7 @@ 更新安裝失敗:%1$s 搜尋 設定 - 找不到檔案,或者尚未選取遊戲目錄 + 找不到遊戲檔案,或者尚未選取遊戲目錄 管理遊戲資料夾 允許 Eden 尋找您的遊戲檔案 跳過選擇遊戲資料夾? @@ -287,9 +287,9 @@ 跳過 取消 安裝 Amiibo 金鑰 - 若要在遊戲中使用 Amiibo 得先安裝 + 需要先安裝才能在遊戲中使用Amiibo GPU驅動程式下載器 - GPU 驅動程式管理員 + GPU驅動程式管理員 安裝替代驅動程式以取得潛在的更佳效能或準確度 後製處理效果 在渲染完成後套用 ReShade FX 效果 @@ -299,7 +299,7 @@ 開啟清單 收起清單 移除效果 - 濾鏡已啟用。請在開啟遊戲前於 後製處理效果 中調整 + 濾鏡已啟用。請在開啟遊戲前於\"後製處理效果\"中調整 數值已變更,與原始濾鏡設定不同 濾鏡 新增濾鏡 @@ -312,93 +312,102 @@ 找不到設定檔。請將濾鏡效果的 .fx 檔案放置於此資料夾: 影格生成 調整此遊戲的影格生成設定 - 使用 Lossless Scaling 在已渲染的影格之間插入補間影格。啟用此功能時,會強制採用 FIFO 垂直同步 + 使用Lossless Scaling在已渲染的影格之間插入補間影格。啟用此功能時,會強制採用FIFO垂直同步 影格倍率 - 設定在每個已渲染的影格中要顯示的影格數。數值越高所需的 GPU 運算時間也會按比例增加。若要求的影格數超過裝置顯示器能呈現的數量將會降低模擬速度 + 設定在每個已渲染的影格中要顯示的影格數,數值越高所需的GPU運算時間也會按比例增加。若要求的影格數超過裝置顯示器能呈現的數量將會降低模擬速度 2x 3x 4x 目標影格率 - 選擇裝置顯示器能實際呈現的影格率。之後倍率器會自動升高或降低以維持影格率。如果某個調整導致遊戲本身運作變慢,則會自動復原該設定 + 選擇裝置顯示器能實際呈現的影格率,之後倍率器會自動升高或降低以維持影格率。如果某個調整導致遊戲本身運作變慢,則會自動復原該設定 使用固定倍率 60 FPS 90 FPS 120 FPS + 開啟 + 關閉 + 固定 + 自動 + 開啟或關閉影格生成後選擇影格倍率 + 選擇要生成的目標影格率,倍率器會自動調整 + 用來預測影格之間動態的解析度,較低的數值可以減少GPU運算時間 影格佇列目標 最多允許多少個已完成的影格在顯示器前等待,較大的佇列可以吸收 GPU 突發負載,但會增加輸入延遲 最低延遲(無緩衝) 平衡(1影格) 最流暢(2影格) 配合遊戲調整運動預測 - 以遊戲實際渲染的解析度而非升頻後的輸出進行運動預測。由於升頻後不會增加任何動態細節,因此不會影響準確度 + 以遊戲實際渲染的解析度而非升頻後的輸出進行運動預測,由於升頻後不會增加任何動態細節,因此不會影響準確度 運動預測解析度 - 光流處理的解析度,以輸出解析度的比例表示。降低此設定值是減少效能負載最有效的方法 + 光流處理的解析度,以輸出解析度的比例表示,降低此設定值是減少效能負載最有效的方法 無法使用影格生成 + 此GPU驅動程式缺少Lossless Scaling著色器所需的Vulkan記憶體模型或半精度浮點數(float16)支援 可選擇安裝自己擁有的 Lossless.dll 以在之後啟用影格生成功能 安裝 Lossless.dll 您需要擁有從合法管道獲得的 Lossless Scaling 並從該軟體的資料夾中取得 Lossless.dll 檔案才能使用影格生成功能 安裝不同的 Lossless.dll 檔案 影格生成 支援 + 不支援(無Vulkan記憶體模型或float16) Lossless Scaling - 安裝您擁有的 Lossless.dll 檔案以使用影格生成 + 安裝您擁有的Lossless.dll檔案以使用影格生成 已安裝 未安裝 - 替換 + 更換 刪除 - 刪除已安裝的 Lossless.dll 及預先編譯的著色器 - 影格生成功能會停止運作直到您重新安裝 Lossless.dll 。您的 Lossless.dll 原始檔並不會被 Eden 修改 + 刪除已安裝的Lossless.dll及預先編譯的著色器 + 影格生成功能會停止運作直到您重新安裝Lossless.dll,您的Lossless.dll原始檔不會被 Eden 修改 Lossless.dll 未安裝 前往 設定 -> Lossless Scaling 安裝以使用影格生成功能 請先關閉遊戲 - Lossless.dll 無法在遊戲執行時進行更換 + Lossless.dll無法在遊戲執行時進行更換 沒有東西可以刪除 - 尚未安裝 Lossless.dll + 尚未安裝Lossless.dll 準備影格生成著色器中... - 成功安裝 Lossless.dll - 無法安裝 Lossless.dll + 成功安裝Lossless.dll + 無法安裝Lossless.dll 無法複製選取的檔案 無法讀取選取的檔案 - 選取的檔案並不是 Windows 程式庫。請在 Lossless Scaling 的安裝位置(資料夾)中選擇 Lossless.dll - 這個 Lossless.dll 的副本並未包含影格生成著色器。請更新 Lossless Scaling 後再試一次 - 無法轉譯影格生成著色器。尚不支援此 Lossless Scaling 版本 - 轉譯的著色器無法寫入到儲存空間。請確認手機容量是否充足 + 選取的檔案並不是Windows程式庫。請在Lossless Scaling的安裝位置(資料夾)中選擇Lossless.dll + 這個Lossless.dll的副本並未包含影格生成著色器。請更新Lossless Scaling後重試 + 無法轉譯影格生成著色器,尚不支援此Lossless Scaling版本 + 轉譯的著色器無法寫入到儲存空間,請確認手機容量是否充足 進階設定 調整模擬器設定 最近遊玩 最近新增 - 開啟 Eden 資料夾 - 管理 Eden 的內部檔案 + 開啟Eden資料夾 + 管理Eden的內部檔案 自訂Eden的主題與介面 找不到檔案管理員 - 無法開啟 Eden 目錄 + 無法開啟Eden目錄 請使用檔案管理員的側邊面板手動定位到使用者資料夾 管理儲存資料 - 導入/導出遊戲的儲存資料\n壓縮檔必須為.zip格式\n壓縮檔中首個子資料夾名稱必須為遊戲 ID + 導入/導出遊戲的儲存資料\n壓縮檔必須為.zip格式\n壓縮檔中首個子資料夾名稱必須為遊戲ID 導入儲存資料 這將會以提供的檔案覆寫現有的該遊戲儲存資料,您確定要繼續嗎? 正在導入儲存資料… 正在導出儲存資料… 已成功導入 無效的儲存目錄結構 - 首個子資料夾名稱必須為遊戲 ID + 首個子資料夾名稱必須為遊戲ID 安裝韌體 - 韌體必須為 ZIP 壓縮檔,將會用於部分遊戲的啟動 + 韌體必須為ZIP壓縮檔,將會用於部分遊戲的啟動 正在安裝韌體 韌體安裝失敗 - 請確保韌體 nca 檔案位於 zip 壓縮檔的根目錄,然後再試一次。 + 請確保韌體nca檔案位於zip壓縮檔的根目錄後再試一次 韌體解除安裝失敗 分享偵錯記錄 - 分享 Eden 的記錄檔以便對相關問題進行偵錯 + 分享Eden的記錄檔以便對相關問題進行偵錯 找不到日誌檔案 - 分享 GPU 日誌 - 分享 Eden 的 GPU 日誌以對圖形問題進行偵錯 - 找不到 GPU 日誌檔案 + 分享GPU日誌 + 分享Eden的GPU日誌以對圖形問題進行偵錯 + 找不到GPU日誌檔案 安裝遊戲內容 - 安裝遊戲更新或 DLC + 安裝遊戲更新或DLC 正在安裝內容… - 安裝檔案至 NAND 時發生錯誤 - 請確保內容有效並且 prod.keys 檔案已安裝 + 安裝檔案至NAND時發生錯誤 + 請確保內容有效並且prod.keys檔案已安裝 為避免產生衝突,無法直接安裝遊戲本體 %1$d 安裝錯誤 遊戲內容已成功安裝 @@ -406,8 +415,8 @@ %1$d 覆寫成功 https://yuzu-mirror.github.io/help/quickstart/#dumping-installed-updates 您的裝置不支援自訂驅動程式 - 此裝置不支援注入自訂驅動程式。\n請以後再來查看是否已新增支援! - 管理 Eden 資料 + 此裝置不支援注入自訂驅動程式\n請以後再來查看是否已新增支援! + 管理Eden資料 安裝韌體、金鑰,導入/導出使用者資料及安裝其它項目! 遊戲資料夾 深度掃描 @@ -424,7 +433,7 @@ 驗證已安裝內容的完整性 檢查所有已安裝的內容是否有損壞 - 缺少 prod.keys + 缺少prod.keys 無法解密韌體和零售遊戲 https://yuzu-mirror.github.io/help/quickstart/#dumping-decryption-keys @@ -437,8 +446,8 @@ 金鑰安裝失敗 金鑰安裝成功 一個或多個金鑰安裝失敗 - 請確保金鑰檔案具有.keys副檔名後重試。 - 金鑰初始化失敗。請檢查您的轉儲工具是否為最新版本並重新轉儲金鑰。 + 請確保金鑰檔案具有.keys副檔名後重試 + 金鑰初始化失敗,請檢查您的轉儲工具是否為最新版本並重新轉儲金鑰 Qlaunch @@ -450,48 +459,48 @@ prod.keys檔案和韌體已安裝並重試]]> 相簿 使用系統相片檢視器查看儲存在使用者螢幕截圖資料夾中的影像 - Mii 編輯 - 使用系統編輯器來檢視並編輯 Mii + Mii編輯 + 使用系統編輯器來檢視並編輯Mii Cabinet - 編輯、刪除儲存在 amiibo 上的資料 - Cabinet 啟動器 + 編輯、刪除儲存在amiibo上的資料 + Cabinet啟動器 暱稱和擁有者設定 刪除遊戲資料 還原程式 格式化程式 - Gaia 不存在 + Gaia不存在 已複製到剪貼簿 - 一個開放原始碼的 Switch 模擬器 + 一個開放原始碼的Switch模擬器 參與者 - 這些人讓 Eden Android 版成為可能 - 這些專案使 Eden Android 版成為可能 + 這些人讓Eden Android版成為可能 + 這些專案使Eden Android版成為可能 組建版本 使用者資料 - 導入/導出所有應用程式資料。\n\n導入使用者資料時,現有的使用者資料將被取代!\n\n直接從 Citron 導入使用者資料可能會出現問題,建議手動導入所有所需資料。 + 導入/導出所有應用程式資料\n\n導入使用者資料時,現有的使用者資料將被取代!\n\n直接從 Citron 導入使用者資料可能會出現問題,建議手動導入所有所需資料 正在導出使用者資料… 正在導入使用者資料… - 無效的 Eden 備份 + 無效的Eden備份 使用者資料導出成功 使用者資料導入成功 導出已取消 - 請確保使用者資料夾位於 zip 壓縮檔的根目錄,並在 config/config.ini 路徑中包含組態檔案,並再試一次 + 請確保使用者資料夾位於zip壓縮檔的根目錄,並在 config/config.ini 路徑中包含組態檔案後重試 限制模擬速度 將模擬速度限制在標準速度的指定百分比 限制速度百分比 - 指定模擬速度的百分比。100% 為標準速度,更高或更低的值將會減少或增加速度限制 + 指定模擬速度的百分比,100%為標準速度,更高或更低的值將會減少或增加速度限制 加速模式 當開啟加速模式時,模擬器將以此速度執行 慢速模式 當慢速模式開啟時,模擬器將會以此速度執行 - CPU 後端 - CPU 準確度 + CPU後端 + CPU準確度 %1$s%2$s - Homebrew 參數 - 在啟動時傳遞給 Homebrew 的命令列參數(例如:-noglsl) + Homebrew參數 + 在啟動時傳遞給Homebrew的命令列參數(例如:-noglsl) 裝置名稱 @@ -499,26 +508,26 @@ 提高解析度,降低效能。停用後將會使用手提模式,會降低解析度並提高效能 模擬區域 模擬語言 - 選擇 RTC 日期 - 選擇 RTC 時間 - 自訂 RTC + 選擇RTC日期 + 選擇RTC時間 + 自訂RTC 允許您設定與您的目前系統時間相互獨立的自訂時間 - 設定自訂 RTC + 設定自訂RTC - CPU 時脈 - 提高模擬 CPU 回報的時脈,可以減少某些 FPS 限制。較弱的 CPU 可能會出現效能下降的情況,部分遊戲可能會出現異常 + CPU時脈 + 提高模擬CPU回報的時脈,可以減少某些FPS限制。較弱的CPU可能會出現效能下降的情況,部分遊戲可能會出現異常 自訂CPU時脈 - 自訂CPU時脈。更高的值可能提高效能,但也可能導致遊戲卡死。建議範圍為77-21000。 + 自訂CPU時脈,更高的值可能提高效能,但也可能導致遊戲卡死。建議範圍為77-21000 時脈 - 記憶體佈局 - (實驗性)更改模擬記憶體佈局。此設定不會提高效能,但可能有助於使用模組來提高解析度的遊戲的載入。不要在 RAM 為 8GB 或更少的手機上使用。若遊戲崩潰請將進階設定裡偵錯選項中的CPU後端改為 Dynarmic (JIT) + 記憶體布局 + (實驗性)更改模擬記憶體布局,此設定不會提高效能,但可能有助於使用模組來提高解析度的遊戲的載入。不要在RAM為8GB或更少的手機上使用。若遊戲崩潰請將進階設定裡偵錯選項中的CPU後端改為Dynarmic (JIT) 生成 網路令牌 - 用於建立公開大廳的網路令牌。由48個小寫字母a-z組成 + 用於建立公開大廳的網路令牌,由48個小寫字母a-z組成 網路使用者名稱 多人遊戲房間中顯示的使用者名稱。必須為4-20個字元,僅能使用英文字母、數字、句點、破折號、底線和空格(標點符號須為英文格式) 網路 @@ -527,19 +536,19 @@ 解析度 (手提/底座) 垂直同步 視窗自適應濾波器 - FSR/SGSR 銳化度 - 使用 FSR/SGSR 時圖片的銳化程度 + FSR/SGSR銳化度 + 使用FSR/SGSR時圖片的銳化程度 抗鋸齒 進階 - GPU 模式 - 設定 GPU 模擬的準確度。大多數遊戲在設定為快速時即可正常渲染,但有些需要渲染粒子的遊戲仍需設為準確來避免圖形錯誤 - DMA 準確度 - 控制 DMA 準確度。將準確度設為穩定可以修復某些遊戲中的問題,但在某些情況下也可能影響效能。如果不確定,請保留為預設 + GPU模式 + 設定GPU模擬的準確度,大多數遊戲在設定為快速時即可正常渲染,但有些需要渲染粒子的遊戲仍需設為準確來避免圖形錯誤 + DMA準確度 + 控制DMA準確度,將準確度設為穩定可以修復某些遊戲中的問題,但在某些情況下也可能影響效能。如果不確定,請保留為預設 GPU 同步柵欄模式 - 控制 GPU 同步柵欄模式。即時是速度最快的選項,但可能會導致一些問題。使用平衡可以提供更好的相容性並修復某些遊戲中的錯誤。準確則是在犧牲部分效能的情況下進一步提升相容性。嚴格是最慢的選項,但可以修復那些對同步要求更嚴格的遊戲中的問題。預設則會依照 GPU 準確度設定 + 控制 GPU 同步柵欄模式,即時是速度最快的選項,但可能會導致一些問題;使用平衡可以提供更好的相容性並修復某些遊戲中的錯誤;準確則是在犧牲部分效能的情況下進一步提升相容性;嚴格是最慢的選項,但可以修復那些對同步要求更嚴格的遊戲中的問題;預設則會依照 GPU 準確度設定 各向異性過濾 改善斜角檢視時的紋理品質 VRAM使用模式 @@ -548,53 +557,53 @@ 選擇ASTC壓縮紋理的解碼方式:CPU(慢速、穩定)、GPU(快速、推薦)或CPU非同步(無卡頓,可能導致問題) 同步記憶體操作 - 確保計算和記憶體操作之間的資料一致性。 此選項應能修復某些遊戲中的問題,但在某些情況下可能會降低效能。 使用Unreal Engine 4的遊戲似乎受影響最大 + 確保計算和記憶體操作之間的資料一致性,此選項應能修復某些遊戲中的問題,但在某些情況下可能會降低效能。使用Unreal Engine 4的遊戲似乎受影響最大 磁碟著色器快取 將產生的著色器快取儲存至硬碟以減少中斷 - 強制使用最大時脈 (僅限Adreno) - 強制 GPU 以可能的最大時脈執行 (熱溫限制仍會被套用) - GPU 非同步模擬 - 此修改可透過使用 GPU 非同步模擬來提升性能,不過可能會導致圖形問題且會提高在進行時序相關操作時當機的機率 + 強制使用最大時脈(僅限Adreno) + 強制GPU以可能的最大時脈運作(熱溫限制仍會被套用) + GPU非同步模擬 + 此修改可透過使用GPU非同步模擬來提升性能,不過可能會導致圖形問題且會提高在進行時序相關操作時當機的機率 非同步呈現 - 此修改可以透過將渲染移至單獨的 CPU 執行緒來提升性能,但可能會導致圖形問題 + 此修改可以透過將渲染移至單獨的CPU執行緒來提升性能,但可能會導致圖形問題 使用重新啟用排清 - 犧牲效能,以改善部分遊戲的轉譯準確度 + 犧牲效能以改善部分遊戲的轉譯準確度 啟用緩衝區歷史 - 允許存取先前的緩衝區狀態。此選項可能會改善部分遊戲的渲染品質與效能穩定性 + 允許存取先前的緩衝區狀態,此選項可能會改善部分遊戲的渲染品質與效能穩定性 最佳化頂點緩衝區 - 啟用最佳化的頂點緩衝區綁定。需要安裝 Mesa 26.0+ Turnip drivers/Qualcomm drivers。使用舊版 Turnip drivers 會導致當機 (25.3版和更低的版本) + 啟用最佳化的頂點緩衝區綁定,需要安裝 Mesa 26.0+ Turnip drivers/Qualcomm drivers。使用舊版 Turnip drivers 會導致當機(25.3版和更低的版本) 修改 - GPU 時脈 - 讓遊戲誤以為 GPU 工作能更快完成,避免遊戲為了配合 Switch 的時脈而降低解析度與渲染距離 + GPU時脈 + 讓遊戲誤以為GPU工作能更快完成,避免遊戲為了配合Switch的時脈而降低解析度與渲染距離 跳過CPU內部失效處理 在記憶體更新期間跳過某些CPU端快取的失效處理,減少CPU使用率並提高其性能。可能會導致某些遊戲出現故障或當機 修正光暈特效 - 在 薩爾達傳說:織夢島 和 薩爾達傳說:智慧的再現 中 減少光暈模糊的問題並移除 橫衝直撞:狂飆樂園重製版 中的光暈效果 (Adreno A6XX - A7XX/ Turnip)。警告:可能會在其它遊戲中導致圖形異常 - 模擬 BGR565 - 修正遊戲中出現的顏色反轉、圖形異常或陰影異常 + 在 \"薩爾達傳說:織夢島\" 和 \"薩爾達傳說:智慧的再現\" 中減少光暈模糊的問題並移除 \"橫衝直撞:狂飆樂園重製版\" 中的光暈效果(適用於Adreno A6XX - A7XX/ Turnip)。警告:可能會在其它遊戲中導致圖形異常 + 模擬BGR565 + 修正遊戲中出現的色彩反轉、圖形異常或陰影異常 啟用舊版重新縮放處理 透過快速重新縮放處理來啟用遊戲重新縮放設定階段的舊版處理方式 使用非同步著色器 - 使用非同步編譯著色器。這可能會減少卡頓,但也可能導致圖形錯誤。 - GPU Unswizzle 設定 - 設定基於 GPU 的 Unswizzling 參數或完全停用此功能。調整此設定以在性能與紋理載入品質中取得平衡 - 啟用 GPU Unswizzle + 使用非同步編譯著色器,這可能會減少卡頓,但也可能導致圖形錯誤 + GPU Unswizzle設定 + 設定基於GPU的Unswizzling參數或完全停用此功能,調整此設定以在性能與紋理載入品質中取得平衡 + 啟用GPU Unswizzle 停用 - GPU Unswizzle 最大紋理尺寸 - 設定 GPU 紋理 Unswizzling 的最大值 (MB)。雖然 GPU 處理中型和大型紋理的速度較快,但 CPU 處理非常小的紋理可能更有效率。整此設定以在 GPU 加速與 CPU 負載之間取得平衡 - GPU Unswizzle 流大小 - 設定每個影格處理大型紋理 Unswizzling 的資料上限。數值越高載入紋理的速度越快,但會增加畫面延遲;數值較低則能降低 GPU 負載,不過有可能導致至紋理載入不完全甚至突然出現 - GPU Unswizzle 塊大小 - 設定 3D 紋理每批次處理的深度切片數量。增加此數值可提升規格較佳 GPU 的處理效率,但在較低規格的硬體上可能導致卡頓或驅動程式逾時 + GPU Unswizzle最大紋理尺寸 + 設定 GPU 紋理 Unswizzling 的最大值(MB),雖然 GPU 處理中型和大型紋理的速度較快,但 CPU 處理非常小的紋理可能更有效率。調整此設定以在GPU加速與CPU負載之間取得平衡 + GPU Unswizzle Stream大小 + 設定每個影格處理大型紋理Unswizzling的資料上限,數值越高載入紋理的速度越快,但會增加畫面延遲;數值較低則能降低 GPU 負載,不過有可能導致至紋理載入不完全甚至突然出現 + GPU Unswizzle Chunk大小 + 設定 3D 紋理每批次處理的深度切片數量,增加此數值可提升規格較佳GPU的處理效率,但在較低規格的硬體上可能導致卡頓或驅動程式逾時 預設 擴充功能 擴展動態狀態 - 控制擴展動態狀態中可使用的功能數量。較高的數值可根據驅動程式支援的動態狀態減少管線編譯的次數。 + 控制擴展動態狀態中可使用的功能數量,較高的數值可根據驅動程式支援的動態狀態減少管線編譯的次數 停用 頂點輸入動態狀態 啟用此功能可提供更彈性的頂點輸入處理方式,並可能減少頂點/緩衝區的管線編譯時間 @@ -616,43 +625,43 @@ CPU 時脈 使用自動存根 - 自動補上缺少的服務和功能。可提高相容性但可能導致當機和穩定性問題。 + 自動補上缺少的服務和功能,可提高相容性但可能導致當機和穩定性問題 GPU API 圖形偵錯 - 將圖形 API 設為慢速偵錯模式 - BCn 區塊壓縮紋理修補 - 覆寫 Adreno GPU 的 BCn 紋理格式自動偵測。通常會根據 Android 版本自動偵測(會在API 28 以上自動啟用) + 將圖形API設為慢速偵錯模式 + BCn區塊壓縮紋理修補 + 覆寫Adreno GPU的BCn紋理格式自動偵測。通常會根據Android版本自動偵測(會在API 28以上的裝置自動啟用) Fastmem 日誌 按行寫入偵錯日誌 - 在每行寫入時重新整理偵錯日誌,讓程式在當機或閃退時更容易偵錯。 + 在寫入一行日誌就立刻更新偵錯記錄,讓程式在當機或閃退時更容易偵錯 啟用更詳細的日誌記錄 - 將日誌檔的最大檔案限制從 100MB 提高到 1GB + 將日誌檔的最大檔案限制從100MB提高到1GB 日誌過濾器 控制 Eden 日誌的紀錄類別。例如: *:Info Service.LM:Debug - GPU 日誌 + GPU日誌 記錄層級 - GPU 日誌的詳細層級 (越高日誌越詳細,不過會更容易過熱) - 記錄 Vulkan API 呼叫 - 在環形緩衝區中記錄所有 Vulkan API 呼叫 - 傾印 SPIR-V 著色器 - 將重新編譯後的 SPIR-V 二進位檔案 (.spv) 儲存至 Eden 資料夾裡的 dump 資料夾中。可使用 spirv-dis/spirv-cross/spirv-val 進行檢查 + GPU日誌的詳細層級(越高日誌越詳細,不過會更容易過熱) + 記錄Vulkan API呼叫 + 在環形緩衝區中記錄所有Vulkan API呼叫 + 傾印SPIR-V著色器 + 將重新編譯後的SPIR-V二進位檔案(.spv)儲存至Eden資料夾裡的dump資料夾中。可使用 spirv-dis/spirv-cross/spirv-val 進行檢查 傾印客體(Maxwell)著色器 - 將 Maxwell 客體著色器位元組碼檔案 (.ash) 儲存至 Eden 資料夾裡的 dump 資料夾中。可使用 nvdisasm 進行檢查 - 傾印 Maxwell 巨集 - 將 Maxwell 巨集程式檔案 (.macro) 儲存至 Eden 資料夾裡的 dump 資料夾中。可使用 envydis 進行檢查 - 追蹤 GPU 記憶體 - 監控 GPU 記憶體的分配和釋放 + 將Maxwell客體著色器位元組碼檔案(.ash)儲存至Eden資料夾裡的dump資料夾中。可使用 nvdisasm 進行檢查 + 傾印Maxwell巨集 + 將Maxwell巨集程式檔案(.macro)儲存至Eden資料夾裡的dump資料夾中。可使用 envydis 進行檢查 + 追蹤GPU記憶體 + 監控GPU記憶體的分配和釋放 驅動程式偵錯資料 擷取驅動程式的特定偵錯資料(例如 Turnip breadcrumbs) 環形緩衝區大小 - 追蹤的近期 Vulkan 呼叫數量(預設為 512 ) - 64 至 4096 個項目 + 追蹤的近期Vulkan呼叫數量(預設為512) + 64至4096個項目 一般 @@ -676,17 +685,17 @@ 左搖桿 控制搖桿 右搖桿 - C 搖桿 + C搖桿 按壓 靈敏度 無感帶 用按鈕、按鍵來模擬搖桿 修改按鈕模擬左/右搖桿的值,視遊戲不同而有所差異\n(模擬左搖桿時,若將此數值設為50,則按下按鈕時遊戲裡的人物可能只會走動而不是奔跑;模擬右搖桿時所使用的值則是會影響到轉視角的速度,數值越高代表使用的模擬值越大) 肩部按鍵 - 左 SL - 左 SR - 右 SL - 右 SR + 左SL + 左SR + 右SL + 右SR 無效 無 未知 @@ -701,12 +710,12 @@ 選擇一個控制器以嘗試自動配對按鈕、搖桿 嘗試為 %1$s 自動配對 控制器類型 - Pro 手把 + Pro手把 掌機模式 - 雙 Joycon 手把 - 左 Joycon 手把 - 右 Joycon 手把 - GameCube 手把 + 雙Joycon手把 + 左Joycon手把 + 右Joycon手把 + GameCube手把 方向反轉 反轉按鈕 切換按鍵 @@ -799,7 +808,7 @@ 推薦驅動程式: GPU型號 不支援的GPU - 您的GPU不支援驅動程式注入。不建議嘗試設定自訂驅動程式。 + 您的GPU不支援驅動程式注入,不建議嘗試設定自訂驅動程式 設定 From 10bcd2d849843b146a79c61a21df615e1bdcfcde Mon Sep 17 00:00:00 2001 From: xbzk Date: Mon, 5 Oct 2026 22:37:30 +0200 Subject: [PATCH 166/198] [settings] add PR4490 & PR4492 toggles (#4502) - [X] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [X] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [X] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- TEMPORARY! Pushed under Camille's instruction. Will be dropped as soon as they get optimized. Aimed to avoid reported perf impact from PRs 4490 and 4492 on 30-sep-2026 nightly, Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4502 Reviewed-by: MaranBr Reviewed-by: CamilleLaVey --- .../features/settings/model/BooleanSetting.kt | 2 + .../settings/model/view/SettingsItem.kt | 14 +++++++ .../settings/ui/SettingsFragmentPresenter.kt | 2 + .../app/src/main/res/values/strings.xml | 4 ++ src/common/settings.h | 4 ++ src/core/hle/service/ro/ro.cpp | 38 ++++++++++--------- src/qt_common/config/shared_translation.cpp | 8 ++++ src/video_core/gpu.cpp | 20 +++++----- 8 files changed, 65 insertions(+), 27 deletions(-) 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 97be7f1bd9..239d56837c 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 @@ -16,6 +16,8 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_USE_SPEED_LIMIT("use_speed_limit"), USE_CUSTOM_CPU_TICKS("use_custom_cpu_ticks"), SKIP_CPU_INNER_INVALIDATION("skip_cpu_inner_invalidation"), + NCE_INVALIDATION_GPU_READBACK("nce_invalidation_gpu_readback"), + NCE_RUNTIME_NRO_PATCH("nce_runtime_nro_patch"), FIX_BLOOM_EFFECTS("fix_bloom_effects"), EMULATE_BGR565("emulate_bgr565"), RESCALE_HACK("rescale_hack"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 366d3a8b3b..ef52b23053 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -866,6 +866,20 @@ abstract class SettingsItem( descriptionId = R.string.skip_cpu_inner_invalidation_description ) ) + put( + SwitchSetting( + BooleanSetting.NCE_INVALIDATION_GPU_READBACK, + titleId = R.string.nce_invalidation_gpu_readback, + descriptionId = R.string.nce_invalidation_gpu_readback_description + ) + ) + put( + SwitchSetting( + BooleanSetting.NCE_RUNTIME_NRO_PATCH, + titleId = R.string.nce_runtime_nro_patch, + descriptionId = R.string.nce_runtime_nro_patch_description + ) + ) put( SwitchSetting( BooleanSetting.FIX_BLOOM_EFFECTS, 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 e9f818d9bc..dccc8b859a 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 @@ -554,6 +554,8 @@ class SettingsFragmentPresenter( add(HeaderSetting(R.string.hacks)) add(BooleanSetting.SKIP_CPU_INNER_INVALIDATION.key) + add(BooleanSetting.NCE_INVALIDATION_GPU_READBACK.key) + add(BooleanSetting.NCE_RUNTIME_NRO_PATCH.key) add(BooleanSetting.FIX_BLOOM_EFFECTS.key) add(BooleanSetting.EMULATE_BGR565.key) add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 5a587be351..e48319f483 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -595,6 +595,10 @@ Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch\'s clocks. Skip CPU Inner Invalidation Skips certain CPU-side cache invalidations during memory updates, reducing CPU usage and improving it\'s performance. This may cause glitches or crashes on some games. + GPU Readback Before NCE Invalidation + Temporary. Fix Ender Magnolia (and other UE titles) crashes. May reduce performance. Improvement in progress. + Patch Runtime NROs for NCE + Temporary. Fix Biomutant boot. May impact performance. Improvement in progress. Fix Bloom Effects Reduces bloom blur in LA/EOW (Adreno A6XX - A7XX/ Turnip), removes bloom in Burnout. Warning: may cause graphical artifacts in other games. Emulate BGR565 diff --git a/src/common/settings.h b/src/common/settings.h index 5d66f49ebd..d4c445c27c 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -639,6 +639,10 @@ struct Values { Specialization::Default, true, true}; + SwitchableSetting nce_invalidation_gpu_readback{ + linkage, false, "nce_invalidation_gpu_readback", Category::RendererHacks}; + SwitchableSetting nce_runtime_nro_patch{ + linkage, false, "nce_runtime_nro_patch", Category::RendererHacks}; SwitchableSetting async_presentation{linkage, #ifdef __ANDROID__ false, diff --git a/src/core/hle/service/ro/ro.cpp b/src/core/hle/service/ro/ro.cpp index b847811fe5..167bf04c9a 100644 --- a/src/core/hle/service/ro/ro.cpp +++ b/src/core/hle/service/ro/ro.cpp @@ -426,28 +426,30 @@ public: std::addressof(ro_size), std::addressof(rw_size), nro_info->base_address, nro_size, bss_size)); #ifdef HAS_NCE - if (Settings::IsNceEnabled()) { - auto* process = context->GetProcess(); - auto& memory = process->GetMemory(); + if (Settings::values.nce_runtime_nro_patch.GetValue()) { + if (Settings::IsNceEnabled()) { + auto* process = context->GetProcess(); + auto& memory = process->GetMemory(); - std::vector image(total_size); - memory.ReadBlock(nro_info->base_address, image.data(), rx_size); + std::vector image(total_size); + memory.ReadBlock(nro_info->base_address, image.data(), rx_size); - Kernel::CodeSet::Segment code{.size = static_cast(rx_size)}; - Core::NCE::Patcher patch; - patch.PatchText(image, code); - patch.RelocateAndCopy(nro_info->base_address, code, image, nullptr); + Kernel::CodeSet::Segment code{.size = static_cast(rx_size)}; + Core::NCE::Patcher patch; + patch.PatchText(image, code); + patch.RelocateAndCopy(nro_info->base_address, code, image, nullptr); - const u64 patch_address = nro_info->base_address + total_size; - const size_t patch_size = patch.GetSectionSize(); - constexpr auto permission = Kernel::Svc::MemoryPermission::ReadExecute; + const u64 patch_address = nro_info->base_address + total_size; + const size_t patch_size = patch.GetSectionSize(); + constexpr auto permission = Kernel::Svc::MemoryPermission::ReadExecute; - auto* patch_memory = Kernel::KSharedMemory::Create(kernel); - R_TRY(patch_memory->Initialize(kernel, kernel.System().DeviceMemory(), process, permission, permission, patch_size)); - std::memcpy(patch_memory->GetPointer(), image.data() + total_size, patch_size); - R_TRY(process->AddSharedMemory(kernel, patch_memory, patch_address, patch_size)); - R_TRY(patch_memory->Map(*process, patch_address, patch_size, permission)); - memory.WriteBlock(nro_info->base_address, image.data(), rx_size); + auto* patch_memory = Kernel::KSharedMemory::Create(kernel); + R_TRY(patch_memory->Initialize(kernel, kernel.System().DeviceMemory(), process, permission, permission, patch_size)); + std::memcpy(patch_memory->GetPointer(), image.data() + total_size, patch_size); + R_TRY(process->AddSharedMemory(kernel, patch_memory, patch_address, patch_size)); + R_TRY(patch_memory->Map(*process, patch_address, patch_size, permission)); + memory.WriteBlock(nro_info->base_address, image.data(), rx_size); + } } #endif // Set NRO perms. diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 29fbd32de5..0fe2366dfc 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -194,6 +194,14 @@ std::unique_ptr InitializeTranslations(QObject* parent) { INSERT(Settings, skip_cpu_inner_invalidation, tr("Skip CPU Inner Invalidation"), tr("Skips certain cache invalidations during memory updates, reducing CPU usage and " "improving latency. This may cause soft-crashes.")); + INSERT(Settings, nce_invalidation_gpu_readback, + tr("GPU Readback Before NCE Invalidation"), + tr("Flushes GPU buffer data back to guest memory before NCE invalidates the whole " + "guest page, preserving it while the CPU store proceeds.")); + INSERT(Settings, nce_runtime_nro_patch, + tr("Patch Runtime NROs for NCE"), + tr("Applies NCE code patches to runtime-loaded NRO modules." + "This is required for some games to run correctly.")); INSERT(Settings, vsync_mode, tr("VSync Mode:"), tr("FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen " "refresh rate.\nFIFO Relaxed allows tearing as it recovers from a slow down.\n" diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 6aa7f9abd8..4e36d086e6 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -227,15 +227,17 @@ struct GPU::Impl { /// Notify rasterizer that any caches of the specified region should be invalidated void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) { - VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer(); - if (preserve_gpu_writes && rasterizer->MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) { - const u64 fence = RequestSyncOperation([rasterizer, addr, size] { - rasterizer->FlushRegion(addr, size, VideoCommon::CacheType::BufferCache); - rasterizer->OnCacheInvalidation(addr, size); - }); - gpu_thread.TickGPU(is_async); - WaitForSyncOperation(fence); - return; + if (Settings::values.nce_invalidation_gpu_readback.GetValue()) { + VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer(); + if (preserve_gpu_writes && rasterizer->MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) { + const u64 fence = RequestSyncOperation([rasterizer, addr, size] { + rasterizer->FlushRegion(addr, size, VideoCommon::CacheType::BufferCache); + rasterizer->OnCacheInvalidation(addr, size); + }); + gpu_thread.TickGPU(is_async); + WaitForSyncOperation(fence); + return; + } } gpu_thread.InvalidateRegion(addr, size); } From 9c18bd44e76cfa53afa770c22ac187f19a1f5f6c Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Mon, 5 Oct 2026 18:44:01 -0400 Subject: [PATCH 167/198] Fix licenses --- .../app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt | 2 +- .../app/src/main/java/org/yuzu/yuzu_emu/model/GameProperties.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 9ea2a9ee17..382f56f464 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 @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later package org.yuzu.yuzu_emu.adapters diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GameProperties.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GameProperties.kt index a186b91688..24073e2a92 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GameProperties.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GameProperties.kt @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: 2023 yuzu Emulator Project From 3cdd2ce141224079ce1dc8bfb4be7edc113aca02 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Thu, 8 Oct 2026 19:02:48 +0200 Subject: [PATCH 168/198] =?UTF-8?q?[android,=20renderer=5Fvulkan]=20=D0=A1?= =?UTF-8?q?hange=20default=20settings=20(#4509)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Airplane mode: On - needed to launch many games. Nvdec: CPU - fixes most issues in cutscenes. AudioEngine: Sdl3 (only Android) - "Auto" includes Cubeb on Android, but SDL3 works better. Async GPU: On - In most games, this provides a 30% boost in performance. Async presentation: On (Remove async presentation toggle from Android, It is no longer needed). Co-authored-by: CamilleLaVey Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4509 Reviewed-by: Maufeat Reviewed-by: lizzie --- .../features/settings/model/BooleanSetting.kt | 1 - .../settings/model/view/SettingsItem.kt | 7 ----- .../settings/ui/SettingsFragmentPresenter.kt | 1 - .../app/src/main/res/values-ar/strings.xml | 2 -- .../app/src/main/res/values-es/strings.xml | 2 -- .../app/src/main/res/values-ru/strings.xml | 2 -- .../app/src/main/res/values-uk/strings.xml | 2 -- .../src/main/res/values-zh-rCN/strings.xml | 2 -- .../src/main/res/values-zh-rTW/strings.xml | 10 +++---- .../app/src/main/res/values/strings.xml | 2 -- src/common/settings.h | 24 ++++++++--------- .../renderer_vulkan/renderer_vulkan.cpp | 6 +++-- .../renderer_vulkan/vk_present_manager.cpp | 26 ++++++++++++++++++- .../renderer_vulkan/vk_present_manager.h | 10 ++++++- 14 files changed, 54 insertions(+), 43 deletions(-) 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 239d56837c..2f2d3823f8 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 @@ -27,7 +27,6 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache"), RENDERER_FORCE_MAX_CLOCK("force_max_clock"), RENDERER_ASYNCHRONOUS_GPU_EMULATION("use_asynchronous_gpu_emulation"), - RENDERER_ASYNC_PRESENTATION("async_presentation"), RENDERER_ASYNCHRONOUS_SHADERS("use_asynchronous_shaders"), RENDERER_REACTIVE_FLUSHING("use_reactive_flushing"), ENABLE_BUFFER_HISTORY("enable_buffer_history"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index ef52b23053..8346339ee4 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -753,13 +753,6 @@ abstract class SettingsItem( descriptionId = R.string.renderer_asynchronous_gpu_emulation_description ) ) - put( - SwitchSetting( - BooleanSetting.RENDERER_ASYNC_PRESENTATION, - titleId = R.string.renderer_async_presentation, - descriptionId = R.string.renderer_async_presentation_description - ) - ) put( SingleChoiceSetting( IntSetting.DMA_ACCURACY, 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 dccc8b859a..74e1e90836 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 @@ -561,7 +561,6 @@ class SettingsFragmentPresenter( add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key) add(IntSetting.ANDROID_PIPELINE_WORKERS.key) add(BooleanSetting.RENDERER_ASYNCHRONOUS_GPU_EMULATION.key) - add(BooleanSetting.RENDERER_ASYNC_PRESENTATION.key) add(SettingsItem.GPU_UNSWIZZLE_COMBINED) add(HeaderSetting(R.string.extensions)) diff --git a/src/android/app/src/main/res/values-ar/strings.xml b/src/android/app/src/main/res/values-ar/strings.xml index 1082a117ab..5669aab8ba 100644 --- a/src/android/app/src/main/res/values-ar/strings.xml +++ b/src/android/app/src/main/res/values-ar/strings.xml @@ -574,8 +574,6 @@ يجبر وحدة معالجة الرسومات على العمل بأقصى سرعة ممكنة (سيظل يتم تطبيق القيود الحرارية). محاكاة غير متزامنة لوحدة معالجة الرسومات يمكن لهذه الحيلة أن تزيد الأداء عن طريق تشغيل محاكاة وحدة معالجة الرسومات بشكل غير متزامن على حساب مشاكل الرسومات وزيادة معدلات الأعطال بسبب العمليات المتعلقة بالتوقيت. - عرض غير متزامن - يمكن لهذه الحيلة أن تزيد من الأداء عن طريق نقل عملية العرض إلى خيط معالجة منفصل على حساب مشاكل الرسوميات. استخدم التنظيف التفاعلي يحسن دقة العرض في بعض الألعاب على حساب الأداء. تفعيل سجل التخزين المؤقت diff --git a/src/android/app/src/main/res/values-es/strings.xml b/src/android/app/src/main/res/values-es/strings.xml index 72f8d74203..05135b515e 100644 --- a/src/android/app/src/main/res/values-es/strings.xml +++ b/src/android/app/src/main/res/values-es/strings.xml @@ -518,8 +518,6 @@ Fuerza a la GPU a ejecutarse a la velocidad máxima de reloj posible (se seguirán aplicando restricciones térmicas). Emulación de GPU asíncrona Este hack puede aumentar el rendimiento ejecutando la emulación de la GPU de forma asíncrona, a costa de problemas gráficos y un aumento en la tasa de fallos debido a operaciones relacionadas con la sincronización. - Presentación asíncrona - Este hack puede aumentar el rendimiento al mover la presentación a un hilo independiente de la CPU a costa de problemas gráficos. Usar limpieza reactiva Mejora la precisión de renderizado en algunos juegos, pero reduce el rendimiento. Activar el historial del búfer diff --git a/src/android/app/src/main/res/values-ru/strings.xml b/src/android/app/src/main/res/values-ru/strings.xml index 912ce84caf..c291a9276b 100644 --- a/src/android/app/src/main/res/values-ru/strings.xml +++ b/src/android/app/src/main/res/values-ru/strings.xml @@ -563,8 +563,6 @@ Заставляет ГПУ работать на максимально возможных тактовых частотах (тепловые ограничения все равно будут применяться). Асинхронная эмуляция ГПУ Может повысить производительность за счёт асинхронного запуска эмуляции ГПУ, но ценой появления графических ошибок и увеличения частоты вылетов из-за операций, зависящих от синхронизации. - Асинхронная презентация - Может повысить производительность за счёт перемещения вывода кадров в отдельный поток ЦП, но ценой возникновения графических проблем. Реактивная очистка Повышение точности рендеринга в некоторых играх за счет снижения производительности. Включить историю буфера diff --git a/src/android/app/src/main/res/values-uk/strings.xml b/src/android/app/src/main/res/values-uk/strings.xml index 9923fc72c4..b49e320806 100644 --- a/src/android/app/src/main/res/values-uk/strings.xml +++ b/src/android/app/src/main/res/values-uk/strings.xml @@ -481,8 +481,6 @@ Змушує GPU працювати на максимальній тактовій частоті. Асинхронна емуляція ГП Це обхідне рішення може покращити продуктивність завдяки асинхронному виконанню емуляції ГП, але спричинить проблеми з графікою та збільшить частоту збоїв чутливих до таймінгів операцій. - Асинхронне подання - Це обхідне рішення може покращити продуктивність завдяки переміщенню подання на окремий потік ЦП, але спричинить проблеми з графікою. Реактивне очищення Покращує точність рендерингу в деяких іграх. Увімкнути історію буфера 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 index 19f5f0aae7..6ae0f102b2 100644 --- a/src/android/app/src/main/res/values-zh-rCN/strings.xml +++ b/src/android/app/src/main/res/values-zh-rCN/strings.xml @@ -564,8 +564,6 @@ 强制 GPU 以最大时钟运行 (温控依然生效)。 GPU 异步模拟 此技巧可通过异步运行 GPU 模拟来提升性能,但在执行与时序相关的操作时,可能带来图形显示问题以及增加崩溃概率。 - 异步呈现 - 此技巧通过将图形呈现移至独立的 CPU 线程来提升性能,但可能会带来图形显示问题。 启用反应性刷新 通过牺牲性能来提升某些游戏的渲染精度。 启用缓冲区历史 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 index 55b126fd91..9a30acd3ac 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -560,12 +560,10 @@ 確保計算和記憶體操作之間的資料一致性,此選項應能修復某些遊戲中的問題,但在某些情況下可能會降低效能。使用Unreal Engine 4的遊戲似乎受影響最大 磁碟著色器快取 將產生的著色器快取儲存至硬碟以減少中斷 - 強制使用最大時脈(僅限Adreno) - 強制GPU以可能的最大時脈運作(熱溫限制仍會被套用) - GPU非同步模擬 - 此修改可透過使用GPU非同步模擬來提升性能,不過可能會導致圖形問題且會提高在進行時序相關操作時當機的機率 - 非同步呈現 - 此修改可以透過將渲染移至單獨的CPU執行緒來提升性能,但可能會導致圖形問題 + 強制使用最大時脈 (僅限Adreno) + 強制 GPU 以可能的最大時脈執行 (熱溫限制仍會被套用) + GPU 非同步模擬 + 此修改可透過使用 GPU 非同步模擬來提升性能,不過可能會導致圖形問題且會提高在進行時序相關操作時當機的機率 使用重新啟用排清 犧牲效能以改善部分遊戲的轉譯準確度 啟用緩衝區歷史 diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index e48319f483..703a91fd02 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -580,8 +580,6 @@ Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied). GPU async emulation This hack can increase performance by running GPU emulation asynchronously at the cost of graphical issues and increased crash rates by timing-related operations. - Asynchronous presentation - This hack can increase performance by moving presentation to a separate CPU thread at the cost of graphical issues. Use reactive flushing Improves rendering accuracy in some games at the cost of performance. Enable buffer history diff --git a/src/common/settings.h b/src/common/settings.h index d4c445c27c..0eee48b55d 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -171,8 +171,13 @@ struct Values { SwitchableSetting enable_overlay{linkage, false, "enable_overlay", Category::LibraryApplet}; // Audio - SwitchableSetting sink_id{linkage, AudioEngine::Auto, "output_engine", - Category::Audio, Specialization::RuntimeList}; + SwitchableSetting sink_id{linkage, +#ifdef __ANDROID__ + AudioEngine::Sdl3, +#else + AudioEngine::Auto, +#endif + "output_engine", Category::Audio, Specialization::RuntimeList}; SwitchableSetting audio_output_device_id{ linkage, "auto", "output_device", Category::Audio, Specialization::RuntimeList}; SwitchableSetting audio_input_device_id{ @@ -472,13 +477,8 @@ struct Values { SwitchableSetting frame_gen_dump_flow{linkage, false, "frame_gen_dump_flow", Category::Renderer}; - SwitchableSetting use_asynchronous_gpu_emulation{linkage, -#ifdef __ANDROID__ - false, -#else - true, -#endif - "use_asynchronous_gpu_emulation", Category::Renderer}; + SwitchableSetting use_asynchronous_gpu_emulation{linkage, true, "use_asynchronous_gpu_emulation", + Category::Renderer}; // *nix platforms may have issues with the borderless windowed fullscreen mode. // Default to exclusive fullscreen on these platforms for now. SwitchableSetting fullscreen_mode{linkage, @@ -537,7 +537,7 @@ struct Values { "vram_usage_mode", Category::RendererAdvanced}; - SwitchableSetting nvdec_emulation{linkage, NvdecEmulation::Gpu, + SwitchableSetting nvdec_emulation{linkage, NvdecEmulation::Cpu, "nvdec_emulation", Category::RendererAdvanced}; SwitchableSetting max_anisotropy{linkage, @@ -645,7 +645,7 @@ struct Values { linkage, false, "nce_runtime_nro_patch", Category::RendererHacks}; SwitchableSetting async_presentation{linkage, #ifdef __ANDROID__ - false, + true, #else false, #endif @@ -936,7 +936,7 @@ struct Values { // Network Setting network_interface{linkage, std::string(), "network_interface", Category::Network}; - SwitchableSetting airplane_mode{linkage, false, "airplane_mode", Category::Network}; + SwitchableSetting airplane_mode{linkage, true, "airplane_mode", Category::Network}; // WebService Setting web_api_url{linkage, "api.ynet-fun.xyz", "web_api_url", diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 4fd4c0233b..27ca531186 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -217,13 +217,15 @@ void RendererVulkan::Composite(std::span framebu scheduler.RequestOutsideRenderPassOperationContext(); blit_swapchain.DrawToFrame(device, rasterizer, frame, framebuffers, - render_window.GetFramebufferLayout(), swapchain.GetImageCount(), + render_window.GetFramebufferLayout(), + present_manager.SwapchainImageCount(), swapchain.GetImageViewFormat()); #ifdef HAS_LSFG void(frame_gen.WantedGenerations(present_manager.MaxExtraFrames())); - frame_gen.Process(device, frame, swapchain.GetImageFormat(), GuestExtent(framebuffers)); + frame_gen.Process(device, frame, present_manager.SwapchainImageFormat(), + GuestExtent(framebuffers)); const size_t generated_frames = frame_gen.GeneratedFrameCount(); for (size_t generation = 0; generation < generated_frames; ++generation) { diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index d173a3ba5f..9298764546 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -23,6 +23,7 @@ namespace Vulkan { namespace { constexpr size_t MAX_FRAMES_IN_FLIGHT = 7; +constexpr u32 MAX_PRESENT_ATTEMPTS = 3; #ifdef HAS_LSFG static_assert(MAX_FRAMES_IN_FLIGHT <= LSFG_MAX_TARGETS); #endif @@ -372,12 +373,33 @@ void PresentManager::SetImageCount() { #else image_count = std::min(swapchain.GetImageCount(), MAX_FRAMES_IN_FLIGHT); #endif + swapchain_image_count = swapchain.GetImageCount(); + swapchain_image_format = swapchain.GetImageFormat(); +} + +void PresentManager::DiscardFrame(Frame* frame) { + static constexpr VkPipelineStageFlags wait_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + const VkSemaphore render_ready = *frame->render_ready; + const VkSubmitInfo submit_info{ + .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, + .pNext = nullptr, + .waitSemaphoreCount = 1U, + .pWaitSemaphores = &render_ready, + .pWaitDstStageMask = &wait_stage, + .commandBufferCount = 0U, + .pCommandBuffers = nullptr, + .signalSemaphoreCount = 0U, + .pSignalSemaphores = nullptr, + }; + + std::scoped_lock submit_lock{scheduler.submit_mutex}; + void(device.GetGraphicsQueue().Submit(submit_info, *frame->present_done)); } void PresentManager::CopyToSwapchain(Frame* frame) { bool requires_recreation = false; - while (true) { + for (u32 attempt = 0; attempt < MAX_PRESENT_ATTEMPTS; ++attempt) { try { // Recreate surface and swapchain if needed. if (requires_recreation) { @@ -397,6 +419,8 @@ void PresentManager::CopyToSwapchain(Frame* frame) { requires_recreation = true; } } + + DiscardFrame(frame); } void PresentManager::CopyToSwapchainImpl(Frame* frame) { diff --git a/src/video_core/renderer_vulkan/vk_present_manager.h b/src/video_core/renderer_vulkan/vk_present_manager.h index 4741c55e61..ab2b76f10f 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.h +++ b/src/video_core/renderer_vulkan/vk_present_manager.h @@ -6,6 +6,7 @@ #pragma once +#include #include #include #include @@ -68,6 +69,9 @@ public: /// How many additional frames can be queued without stalling the render thread [[nodiscard]] size_t MaxExtraFrames() const; + [[nodiscard]] std::size_t SwapchainImageCount() const { return swapchain_image_count; } + [[nodiscard]] VkFormat SwapchainImageFormat() const { return swapchain_image_format; } + private: void PresentThread(std::stop_token token); @@ -77,6 +81,8 @@ private: void RecreateSwapchain(Frame* frame); + void DiscardFrame(Frame* frame); + void SetImageCount(); private: @@ -100,7 +106,9 @@ private: bool blit_supported; bool storage_supported; bool use_present_thread; - std::size_t image_count{}; + std::atomic image_count{}; + std::atomic swapchain_image_count{}; + std::atomic swapchain_image_format{}; }; } // namespace Vulkan From 67bada77f8a43a90da2e94e89b8e7da73c256989 Mon Sep 17 00:00:00 2001 From: MaranBr Date: Thu, 8 Oct 2026 23:11:34 +0200 Subject: [PATCH 169/198] [video_core] Skip fragment shaders with known issues on non-NVIDIA drivers (#4503) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Skip fragment shaders using a pattern that is not supported by non-NVIDIA drivers. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4503 Reviewed-by: CamilleLaVey --- src/common/settings.h | 3 -- src/qt_common/config/shared_translation.cpp | 6 --- .../frontend/maxwell/translate_program.cpp | 2 +- src/shader_recompiler/ir_opt/passes.h | 4 ++ .../ir_opt/rescaling_pass.cpp | 17 +++----- .../ir_opt/vendor_workaround_pass.cpp | 43 +++++++++++++++++++ .../renderer_vulkan/vk_pipeline_cache.cpp | 6 +++ 7 files changed, 59 insertions(+), 22 deletions(-) diff --git a/src/common/settings.h b/src/common/settings.h index 0eee48b55d..2a4bf3e9e4 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -657,9 +657,6 @@ struct Values { SwitchableSetting emulate_bgr565{linkage, false, "emulate_bgr565", Category::RendererHacks}; - SwitchableSetting rescale_hack{linkage, false, "rescale_hack", - Category::RendererHacks}; - SwitchableSetting use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders", Category::RendererHacks}; diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 0fe2366dfc..964a4cdad4 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -279,12 +279,6 @@ std::unique_ptr InitializeTranslations(QObject* parent) { "quality and performance consistency in some games.")); INSERT(Settings, fix_bloom_effects, tr("Fix bloom effects"), tr("Removes bloom in Burnout.")); - INSERT(Settings, rescale_hack, tr("Enable Legacy Rescale Pass"), - tr("May fix rescale issues in some games by relying on behavior from the previous " - "implementation.\n" - "Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and " - "grey texture flicker on Nvidia GPUs in Luigis Mansion 3.")); - // Renderer (Extensions) INSERT(Settings, dyna_state, tr("Extended Dynamic State"), tr("Controls the number of features that can be used in Extended Dynamic State.\n" diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp index ebc5a825dd..1b2ec5502d 100644 --- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp @@ -301,7 +301,7 @@ IR::Program TranslateProgram(ObjectPool& inst_pool, ObjectPoolInstructions()) { + switch (inst.GetOpcode()) { + case IR::Opcode::ShuffleIndex: + case IR::Opcode::ShuffleUp: + case IR::Opcode::ShuffleDown: + case IR::Opcode::ShuffleButterfly: + break; + default: + continue; + } + const IR::Value shuffle_arg{inst.Arg(0)}; + if (shuffle_arg.IsImmediate()) { + continue; + } + const IR::Inst* bitcast{shuffle_arg.InstRecursive()}; + if (!bitcast || bitcast->GetOpcode() != IR::Opcode::BitCastU32F32) { + continue; + } + const IR::Value bitcast_arg{bitcast->Arg(0)}; + if (bitcast_arg.IsImmediate()) { + continue; + } + const IR::Inst* attribute{bitcast_arg.InstRecursive()}; + if (!attribute || attribute->GetOpcode() != IR::Opcode::GetAttribute) { + continue; + } + const IR::Attribute attr{attribute->Arg(0).Attribute()}; + if (attr == IR::Attribute::PositionX || attr == IR::Attribute::PositionY) { + return true; + } + } + } + return false; +} + } // namespace Shader::Optimization diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 642b9fa223..5e057dd4cf 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -23,6 +23,7 @@ #include "shader_recompiler/environment.h" #include "shader_recompiler/frontend/maxwell/control_flow.h" #include "shader_recompiler/frontend/maxwell/translate_program.h" +#include "shader_recompiler/ir_opt/passes.h" #include "shader_recompiler/program_header.h" #include "video_core/engines/kepler_compute.h" #include "video_core/engines/maxwell_3d.h" @@ -826,6 +827,11 @@ std::unique_ptr PipelineCache::CreateGraphicsPipeline( programs[index] = MergeDualVertexPrograms(program_va, program_vb, env); } + if (device.GetDriverID() != VK_DRIVER_ID_NVIDIA_PROPRIETARY && Shader::Optimization::HasBrokenPattern(programs[index])) { + LOG_WARNING(Render_Vulkan, "0x{:016x}: Skipping shader with known issues", key.unique_hashes[index]); + return nullptr; + } + if (Settings::values.dump_guest_shaders) { env.Dump(hash, key.unique_hashes[index]); } From c746982201a60958193f0678fff1f39417aaaf1e Mon Sep 17 00:00:00 2001 From: crueter Date: Sun, 11 Oct 2026 05:11:01 +0200 Subject: [PATCH 170/198] [*] fix clangarm64 compilation (#4521) seems like a lot less headers are pulling in vector Signed-off-by: crueter - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4521 Reviewed-by: lizzie --- src/core/hle/service/bcat/backend/backend.h | 3 +-- src/hid_core/resources/npad/npad_types.h | 4 +++- src/input_common/helpers/joycon_protocol/joycon_types.h | 2 ++ src/input_common/helpers/joycon_protocol/poller.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/hle/service/bcat/backend/backend.h b/src/core/hle/service/bcat/backend/backend.h index 8419399a62..645af9a386 100644 --- a/src/core/hle/service/bcat/backend/backend.h +++ b/src/core/hle/service/bcat/backend/backend.h @@ -6,12 +6,11 @@ #pragma once -#include #include #include +#include #include "common/common_types.h" -#include "core/file_sys/vfs/vfs_types.h" #include "core/hle/result.h" #include "core/hle/service/bcat/bcat_types.h" #include "core/hle/service/kernel_helpers.h" diff --git a/src/hid_core/resources/npad/npad_types.h b/src/hid_core/resources/npad/npad_types.h index 68b803c3d3..2f7ac2d4f7 100644 --- a/src/hid_core/resources/npad/npad_types.h +++ b/src/hid_core/resources/npad/npad_types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project @@ -6,6 +6,8 @@ #pragma once +#include + #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/input_common/helpers/joycon_protocol/joycon_types.h b/src/input_common/helpers/joycon_protocol/joycon_types.h index dd3bd4398c..8597d02701 100644 --- a/src/input_common/helpers/joycon_protocol/joycon_types.h +++ b/src/input_common/helpers/joycon_protocol/joycon_types.h @@ -13,6 +13,8 @@ #include #include +#include + #include #include "common/bit_field.h" diff --git a/src/input_common/helpers/joycon_protocol/poller.cpp b/src/input_common/helpers/joycon_protocol/poller.cpp index 2384981f50..07e599f89e 100644 --- a/src/input_common/helpers/joycon_protocol/poller.cpp +++ b/src/input_common/helpers/joycon_protocol/poller.cpp @@ -4,7 +4,7 @@ // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "common/logging.h" +#include #include "input_common/helpers/joycon_protocol/poller.h" namespace InputCommon::Joycon { From fecc1b4ee32bc06f736f2d138680ec948cf13ab1 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Sun, 11 Oct 2026 12:08:33 +0200 Subject: [PATCH 171/198] revert [vulkan] Masquerade VkInfo as PUBGMobile + UE #4320 (#4520) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- https://github.com/Balemuni/Balemunis-Aurora stopped fixing the black squares in TotK. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4520 Reviewed-by: lizzie Reviewed-by: Maufeat --- src/video_core/vulkan_common/vulkan_wrapper.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 5044881598..bb43fe399f 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -460,20 +460,8 @@ Instance Instance::Create(u32 version, Span layers, Span gloom + yellow line glitch appears -#ifdef __ANDROID__ - const VkApplicationInfo application_info{ - .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, - .pNext = nullptr, - .pApplicationName = "PUBGMobile", - .applicationVersion = VK_MAKE_VERSION(1, 7, 0), - .pEngineName = "UnrealEngine", - .engineVersion = VK_MAKE_VERSION(4, 23, 0), - .apiVersion = VK_API_VERSION_1_3, - }; -#else + // DO NOT TOUCH, breaks RNDA3!! + // Don't know why, but gloom + yellow line glitch appears const VkApplicationInfo application_info{ .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = nullptr, @@ -483,7 +471,6 @@ Instance Instance::Create(u32 version, Span layers, Span Date: Mon, 12 Oct 2026 01:09:10 +0200 Subject: [PATCH 172/198] [vk] Return the corrections made for buffer update logic #3690 (#4499) Credit: Pavel Fixes shadows in Metroid Prime Remastered Broken ![image](/attachments/7c49b843-0184-4835-b14e-d93a0948dd56) Fixed ![image](/attachments/2ba2eb43-fead-4fd4-9791-671aa518f282) Needs to be tested - Demon Slayer Vertex Explosions - Ender Magnolia Freezing - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Co-authored-by: PavelBARABANOV Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4499 Reviewed-by: Maufeat Reviewed-by: lizzie Reviewed-by: CamilleLaVey --- src/video_core/renderer_vulkan/vk_query_cache.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 2b5aa24053..f63c924e39 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -814,7 +814,7 @@ public: new_query->flags |= VideoCommon::QueryFlagBits::IsFinalValueSynced; return index; } - + scheduler.RequestOutsideRenderPassOperationContext(); CloseCounter(); auto [bank_slot, data_slot] = ProduceCounterBuffer(slot); @@ -952,8 +952,6 @@ private: } has_flushed_end_pending = false; - // Refresh buffer state before ending transform feedback to ensure counters_count is up-to-date. - UpdateBuffers(); if (buffers_count == 0) { LOG_DEBUG(Render_Vulkan, "EndTransformFeedbackEXT called with no counters (buffers_count=0)"); scheduler.Record([](vk::CommandBuffer cmdbuf) { From 9580e54f2f4787986abde4c7601177d0c5cd2792 Mon Sep 17 00:00:00 2001 From: Eden CI Date: Mon, 12 Oct 2026 19:23:00 +0200 Subject: [PATCH 173/198] [dist, android] Update translations from Transifex for Oct 12 (#4527) Automatic translation update for Oct 12 Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4527 --- dist/languages/ar.ts | 612 +++++++-------- dist/languages/ca.ts | 587 +++++++------- dist/languages/cs.ts | 587 +++++++------- dist/languages/da.ts | 587 +++++++------- dist/languages/de.ts | 588 +++++++------- dist/languages/el.ts | 587 +++++++------- dist/languages/es.ts | 588 +++++++------- dist/languages/fi.ts | 599 ++++++++------- dist/languages/fr.ts | 587 +++++++------- dist/languages/hu.ts | 587 +++++++------- dist/languages/id.ts | 587 +++++++------- dist/languages/it.ts | 587 +++++++------- dist/languages/ja_JP.ts | 587 +++++++------- dist/languages/ko_KR.ts | 588 +++++++------- dist/languages/nb.ts | 587 +++++++------- dist/languages/nl.ts | 587 +++++++------- dist/languages/pl.ts | 587 +++++++------- dist/languages/pt_BR.ts | 588 +++++++------- dist/languages/pt_PT.ts | 587 +++++++------- dist/languages/ru_RU.ts | 588 +++++++------- dist/languages/sv.ts | 726 +++++++++--------- dist/languages/tr_TR.ts | 587 +++++++------- dist/languages/uk.ts | 588 +++++++------- dist/languages/vi.ts | 587 +++++++------- dist/languages/vi_VN.ts | 587 +++++++------- dist/languages/zh_CN.ts | 588 +++++++------- dist/languages/zh_TW.ts | 587 +++++++------- .../app/src/main/res/values-ar/strings.xml | 6 +- .../src/main/res/values-zh-rTW/strings.xml | 428 ++++++----- 29 files changed, 8363 insertions(+), 8103 deletions(-) diff --git a/dist/languages/ar.ts b/dist/languages/ar.ts index 472f7ac609..73ab8a2039 100644 --- a/dist/languages/ar.ts +++ b/dist/languages/ar.ts @@ -727,12 +727,32 @@ Aggressive mode may impact performance of other applications such as recording s يتخطى بعض عمليات إبطال ذاكرة التخزين المؤقتة أثناء تحديثات الذاكرة، مما يقلل من استخدام وحدة المعالجة المركزية ويحسّن زمن الوصول. قد يؤدي هذا إلى أعطال مؤقتة. - + + GPU Readback Before NCE Invalidation + NCE إعادة قراءة وحدة معالجة الرسومات قبل إبطال صلاحية + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + يفرغ بيانات ذاكرة المعالج الرسومي المؤقتة ويعيدها إلى ذاكرة المحاكي قبل أن تلغي تقنية التشغيل المباشر عمل الصفحة بالكامل، مما يحافظ على البيانات أثناء استمرار المعالج المركزي في تخزينها + + + + Patch Runtime NROs for NCE + تعديل ملفات تشغيل اللعبة فوراً لتتوافق مع تقنية التشغيل المباشر + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + يعدل كود تشغيل اللعبة تلقائياً عند فتحها. هذا الإجراء ضروري لتشغيل بعض الألعاب بدون مشاكل. + + + VSync Mode: VSync وضع: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -743,12 +763,12 @@ Immediate (no synchronization) presents whatever is available and can exhibit te يُظهر الوضع الفوري (بدون مزامنة) كل ما هو متاح، وقد يُظهر تمزقًا. - + Sync Memory Operations مزامنة عمليات الذاكرة - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -757,44 +777,44 @@ Unreal Engine 4 games often see the most significant changes thereof. التغييرات الأكثر أهمية Unreal Engine 4 غالبًا ما تشهد ألعاب. - + Enable asynchronous presentation (Vulkan only) (Vulkan فقط) تفعيل العرض التقديمي غير المتزامن - + Slightly improves performance by moving presentation to a separate CPU thread. تحسين الأداء بشكل طفيف عن طريق نقل العرض التقديمي إلى مؤشر ترابط منفصل في وحدة المعالجة المركزية. - + Force maximum clocks (Vulkan only) (Vulkan فقط) فرض الحد الأقصى للساعات - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. يعمل في الخلفية أثناء انتظار أوامر الرسومات لمنع وحدة معالجة الرسومات من خفض سرعة الساعة. - + Anisotropic Filtering: :الترشيح متباين الخواص - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. يتحكم بجودة عرض الملمس بزوايا مائلة. من الآمن ضبطه على 16x على معظم وحدات معالجة الرسومات. - + GPU Mode: :وضع وحدة معالجة الرسومات - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -803,12 +823,12 @@ Particles tend to only render correctly with Accurate mode. لا تُعرض الجسيمات بشكل صحيح إلا في وضع «دقيق». - + DMA Accuracy: DMA دقة: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -817,12 +837,12 @@ Default follows the GPU Accuracy setting. يُتبع الإعداد الافتراضي إعداد «دقة وحدة معالجة الرسومات» - + GPU Fence Behavior: :سلوك حاجز وحدة معالجة الرسومات - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -835,44 +855,44 @@ Default follows the GPU Mode setting. يتبع الخيار افتراضي إعداد وضع وحدة معالجة الرسومات. - + Enable asynchronous shader compilation تفعيل تجميع التظليل غير المتزامن - + May reduce shader stutter. قد يقلل من تقطع التظليل. - + GPU Clocks سرعات وحدة معالجة الرسومات - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. يجعل اللعبة تعتقد أن عمل وحدة معالجة الرسومات ينتهي بشكل أسرع مما هو عليه في الواقع، لذلك تتوقف عن خفض الدقة ومسافة العرض لتتناسب مع سرعات جهاز Switch. - + GPU Unswizzle إلغاء ترتيب بيانات وحدة معالجة الرسومات - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. باستخدام حوسبة وحدة معالجة الرسومات BCn 3D يسرع فك تشفير نسيج. قم بتعطيله في حالة حدوث أعطال أو مشاكل في الرسومات. - + GPU Unswizzle Max Texture Size الحد الأقصى لحجم النسيج في وحدة معالجة الرسومات بعد إعادة ترتيب البيانات - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -881,48 +901,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size حجم تدفق إلغاء ترتيب بيانات وحدة معالجة الرسومات - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. يحدد الحد الأقصى لكمية بيانات النسيج (بالميغابايت) التي تتم معالجتها لكل إطار. يمكن أن تقلل القيم الأعلى من التقطع أثناء تحميل النسيج، ولكنها قد تؤثر على اتساق الإطارات. - + GPU Unswizzle Chunk Size حجم كتلة إلغاء ترتيب بيانات وحدة معالجة الرسومات - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. يُحدد هذا الخيار عدد شرائح العمق التي تتم معالجتها في عملية إرسال واحدة. زيادة هذا الخيار قد تُحسّن الإنتاجية على وحدات معالجة الرسومات المتطورة، ولكنها قد تُسبب أخطاء في إعادة تعيين وقت الاستجابة أو انقطاع الاتصال ببرنامج التشغيل على الأجهزة ذات المواصفات الأقل. - + Use Vulkan pipeline cache Vulkan استخدام ذاكرة التخزين المؤقتة لخط أنابيب - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. يُفعّل ذاكرة التخزين المؤقت لخطوط الأنابيب الخاصة ببائع وحدة معالجة الرسومات. بتخزين ملفات ذاكرة التخزين المؤقتة للخطوط الداخلية Vulkan يمكن أن يؤدي هذا الخيار إلى تحسين وقت تحميل التظليل بشكل كبير في الحالات التي لا يقوم فيها برنامج تشغيل. - + Enable Compute Pipelines (Intel Vulkan Only) (Intel Vulkan فقط) تفعيل خطوط أنابيب الحوسبة - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -931,192 +951,180 @@ Compute pipelines are always enabled on all other drivers. خطوط أنابيب الحوسبة مفعلة دائمًا على جميع برامج التشغيل الأخرى. - + Enable Reactive Flushing تفعيل التنظيف التفاعلي - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. يستخدم التنظيف التفاعلي بدلاً من التنظيف التنبئي، مما يسمح بمزامنة الذاكرة بشكل أكثر دقة. - + Sync to framerate of video playback المزامنة مع معدل الإطارات لتشغيل الفيديو - + Run the game at normal speed during video playback, even when the framerate is unlocked. قم بتشغيل اللعبة بالسرعة العادية أثناء تشغيل الفيديو، حتى عندما يكون معدل الإطارات مفتوحًا. - + Barrier feedback loops حلقات التغذية الراجعة للحواجز - + Improves rendering of transparency effects in specific games. يحسن عرض تأثيرات الشفافية في بعض الألعاب المحددة. - + Enable buffer history تفعيل سجل التخزين المؤقت - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. يُتيح هذا الخيار الوصول إلى حالات التخزين المؤقت السابقة. وقد يُحسّن جودة العرض وثبات الأداء في بعض الألعاب. - + Fix bloom effects إصلاح تأثيرات التوهج - + Removes bloom in Burnout. يزيل التوهج في وضع الاحتراق. - - Enable Legacy Rescale Pass - تفعيل ميزة إعادة التحجيم القديمة - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - قد يصلح مشاكل إعادة القياس في بعض الألعاب بالاعتماد على سلوك من التنفيذ السابق. -حل لسلوك قديم يصلح تشوهات الخطوط على بطاقات AMD وIntel الرسومية، ووميض النسيج الرمادي على بطاقات Nvidia الرسومية في لعبة Luigi's Mansion 3. - - - + Extended Dynamic State الحالة الديناميكية الموسعة - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. يتحكم في عدد الميزات التي يمكن استخدامها في الحالة الديناميكية الموسعة.تسمح الحالات الأعلى بمزيد من الميزات ويمكن أن تزيد من الأداء، ولكنها قد تسبب مشكلات رسومية إضافية. - + Vertex Input Dynamic State حالة ديناميكية لإدخال الرأس - + Enables vertex input dynamic state feature for better quality and performance. يتيح ميزة الحالة الديناميكية لإدخال الرأس لتحسين الجودة والأداء. - + Sample Shading تظليل العينة - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. يسمح لمظلل الأجزاء بالتنفيذ لكل عينة في جزء متعدد العينات بدلاً من مرة واحدة لكل جزء. يحسن جودة الرسومات على حساب الأداء. القيم الأعلى تحسن الجودة ولكنها تقلل من الأداء. - + RNG Seed مولد الأرقام العشوائية - + Controls the seed of the random number generator. Mainly used for speedrunning. يتحكم في بذرة مولد الأرقام العشوائية. يُستخدم بشكل رئيسي في سباقات السرعة. - + Device Name اسم الجهاز - + The name of the console. اسم وحدة التحكم. - + Homebrew Args Homebrew وسائط - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). (noglsl -مثل) عند التشغيل Homebrew سطر الأوامر الوسائط المُمررة إلى - + Custom RTC Date: :تاريخ التوقيت الحقيقي المخصص - + This option allows to change the clock of the console. Can be used to manipulate time in games. يتيح لك هذا الخيار تغيير ساعة وحدة التحكم. يمكن استخدامه للتحكم بالوقت في الألعاب. - + The number of seconds from the current unix time عدد الثواني من وقت يونكس الحالي - + Language: :اللغة - + This option can be overridden when region setting is auto-select يمكن تجاوز هذا الخيار عند تحديد إعداد المنطقة تلقائيًا - + Region: :المنطقة - + The region of the console. منطقة وحدة التحكم. - + Time Zone: :المنطقة الزمنية - + The time zone of the console. المنطقة الزمنية لوحدة التحكم. - + Sound Output Mode: :وضع إخراج الصوت - + Console Mode: :وضع وحدة التحكم - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1125,1026 +1133,1026 @@ Setting to Handheld can help improve performance for low end systems. يُمكن أن يُساعد الضبط على الوضع المحمول على تحسين أداء الأجهزة منخفضة المواصفات. - + Prompt for user profile on boot المطالبة بملف تعريف المستخدم عند التشغيل - + Useful if multiple people use the same PC. مفيد إذا كان هناك عدة أشخاص يستخدمون نفس الكمبيوتر. - + Pause when not in focus توقف عند عدم التركيز - + Pauses emulation when focusing on other windows. يوقف المحاكاة عند التركيز على نوافذ أخرى. - + Confirm before stopping emulation تأكيد قبل إيقاف المحاكاة - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. يتجاوز المطالبات التي تطلب تأكيد إيقاف المحاكاة. يؤدي تفعيله إلى تجاوز هذه المطالبات والخروج مباشرة من المحاكاة. - + Hide mouse on inactivity إخفاء الماوس عند عدم النشاط - + Hides the mouse after 2.5s of inactivity. يخفي الماوس بعد 2.5 ثانية من عدم النشاط. - + Check for updates التحقق من توفر التحديثات - + Whether or not to check for updates upon startup. ما إذا كان يجب التحقق من التحديثات عند بدء التشغيل أم لا. - + Enable Gamemode تفعيل وضع اللعبة - + Force X11 as Graphics Backend كخلفية رسومات X11 فرض - + Custom frontend الواجهة الأمامية المخصصة - + Real applet تطبيق صغير حقيقي - - + + Disabled معطل - + Never أبداً - + On Load عند التحميل - + Always دائماً - + CPU وحدة المعالجة المركزية - + GPU وحدة معالجة الرسومات - + CPU Asynchronous وحدة المعالجة المركزية غير المتزامنة - + Uncompressed (Best quality) Uncompressed (أفضل جودة) - + BC1 (Low quality) BC1 (جودة منخفضة) - + BC3 (Medium quality) BC3 (جودة متوسطة) - - + + Auto تلقائي - + 30 FPS 30 إطارًا في الثانية - + 60 FPS 60 إطارًا في الثانية - + 90 FPS 90 إطارًا في الثانية - + 120 FPS 120 إطارًا في الثانية - + Conservative محافظ - + Aggressive عدواني - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null لا شيء - + Fast سريع - - - + + + Accurate دقه - - - + + + Default افتراضي - + Unsafe (fast) غير آمن (سريع) - + Safe (stable) آمن (مستقر) - + Immediate فوري - + Balanced متوازن - + Unsafe غير آمن - + Paranoid (disables most optimizations) شديد الحذر (يعطل معظم التحسينات) - + Debugging تصحيح الأخطاء - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed نافذة بلا حدود - + Exclusive Fullscreen شاشة كاملة حصرية - + No Video Output لا يوجد إخراج فيديو - + CPU Video Decoding فك تشفير فيديو وحدة المعالجة المركزية - + GPU Video Decoding (Default) فك تشفير فيديو وحدة معالجة الرسومات (افتراضي) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [تجريبي] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [تجريبي] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [تجريبي] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [تجريبي] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [تجريبي] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution دقة فائقة للألعاب من سنابدراغون - + Snapdragon Game Super Resolution EdgeDir دقة فائقة للألعاب من سنابدراغون EdgeDir - + None لا شيء - + FXAA FXAA - + SMAA SMAA - + Default (16:9) (16:9) افتراضي - + Force 4:3 4:3 فرض - + Force 21:9 21:9 فرض - + Force 16:10 16:10 فرض - + Stretch to Window تمديد إلى النافذة - + Automatic تلقائي - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) اليابانية (日本語) - + American English الإنجليزية الأمريكية - + French (français) الفرنسية (français) - + German (Deutsch) الألمانية (Deutsch) - + Italian (italiano) الإيطالية (Italiano) - + Spanish (español) الإسبانية (español) - + Chinese الصينية - + Korean (한국어) الكورية (한국어) - + Dutch (Nederlands) الهولندية (Nederlands) - + Portuguese (português) البرتغالية (Português) - + Russian (Русский) الروسية (Русский) - + Taiwanese تايواني - + British English الإنجليزية البريطانية - + Canadian French الكندية الفرنسية - + Latin American Spanish أمريكا اللاتينية الإسبانية - + Simplified Chinese الصينية المبسطة - + Traditional Chinese (正體中文) الصينية التقليدية (正體中文) - + Brazilian Portuguese (português do Brasil) البرتغالية البرازيلية (português do Brasil) - + Polish (polska) البولندية (polska) - + Thai (แบบไทย) التايلاندية (แบบไทย) - - + + Japan اليابان - + USA الولايات المتحدة الأمريكية - + Europe أوروبا - + Australia أستراليا - + China الصين - + Korea كوريا - + Taiwan تايوان - + Auto (%1) Auto select time zone تلقائي (%1) - + Default (%1) Default time zone افتراضي (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egypt - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Iceland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Poland - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turkey - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono أحادي - + Stereo مجسم - + Surround محيطي - + 4GB DRAM (Default) 4GB DRAM (افتراضي) - + 6GB DRAM (Unsafe) 6GB DRAM (غير آمنة) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (غير آمنة) - + 12GB DRAM (Unsafe) 12GB DRAM (غير آمنة) - + Docked الإرساء - + Handheld محمول - - + + Normal قياسي - - + + Boost تعزيز - - + + Overclock كسر السرعة - + Always ask (Default) اسأل دائمًا (افتراضي) - + Only if game specifies not to stop فقط إذا حددت اللعبة عدم التوقف - + Never ask لا تسأل أبدا - + Very Small (16 MB) صغير جدًا (16 ميغابايت) - + Small (32 MB) صغير (32 ميغابايت) - + Normal (128 MB) قياسي (128 ميغابايت) - + Large (256 MB) كبير (256 ميغابايت) - + Very Large (512 MB) كبير جدًا (512 ميغابايت) - + Very Low (4 MB) منخفض جدًا (4 ميغابايت) - + Low (8 MB) منخفض (8 ميغابايت) - + Normal (16 MB) قياسي (16 ميغابايت) - + Medium (32 MB) متوسط (32 ميغابايت) - + High (64 MB) عالي (64 ميغابايت) - + Very Low (32) منخفض جدًا (32) - + Low (64) منخفض (64) - + Normal (128) قياسي (128) - + Medium (256) متوسط (256) - + High (512) عالي (512) - + ExtendedDynamicState 1 الحالة الديناميكية الممتدة 1 - + ExtendedDynamicState 2 الحالة الديناميكية الممتدة 2 - + ExtendedDynamicState 3 الحالة الديناميكية الممتدة 3 - + Tree View عرض قائمة - + Grid View عرض شبكة @@ -3732,7 +3740,7 @@ Would you like to delete the old save data? Ring Controller - وحدة تحكم الحلقة + ذراع تحكم الحلقة @@ -5096,7 +5104,7 @@ Once deleted, these can NOT be recovered. Are you 100% sure you want to delete t Unable to create directory %1 for storing user images. - غير قادر على إنشاء الدليل %1 لتخزين صور المستخدم. + تعذر إنشاء المجلد %1 لتخزين صور المستخدم. @@ -5149,7 +5157,7 @@ UUID: %2 Configure Ring Controller - إعدادات حلقة وحدة التحكم + إعدادات حلقة ذراع التحكم @@ -5249,12 +5257,12 @@ UUID: %2 The current mapped device doesn't support the ring controller - الجهاز المُعيَّن حاليًا لا يدعم وحدة التحكم بالحلقة + الجهاز المعين حاليا لا يدعم ذراع التحكم بالحلقة The current mapped device doesn't have a ring attached - الجهاز المُعَيَّن حاليًا ليس به حلقة مُرفقة + الجهاز المعين حاليا ليس به حلقة مرفقة @@ -5790,7 +5798,7 @@ Drag points to change position, or double-click table cells to edit values. Discord Presence - الحضور على ديسكورد + التواجد على ديسكورد @@ -5888,7 +5896,7 @@ Drag points to change position, or double-click table cells to edit values. Delete all data in this directory. THIS IS 100% IRREVERSABLE! - حذف جميع البيانات الموجودة في هذا الدليل. هذا الإجراء لا رجعة فيه بنسبة 100%! + حذف جميع البيانات الموجودة في هذا المجلد. هذه العملية لا رجعة فيها بنسبة 100%! @@ -7312,22 +7320,22 @@ Debug Message: Small (32x32) - صغير (32x32) + (32x32) صغير Standard (64x64) - قياسي (64x64) + (64x64) قياسي Large (128x128) - كبير (128x128) + (128x128) كبير Full Size (256x256) - حجم كامل (256x256) + (256x256) حجم كامل @@ -8313,7 +8321,7 @@ If you wish to clean up the files which were left in the old data location, you %1 -إذا كنت ترغب في تنظيف الملفات التي تركت في موقع البيانات القديم، يمكنك القيام بذلك عن طريق حذف الدليل التالي: +إذا كنت ترغب في إزالة الملفات التي بقيت في موقع البيانات القديم، فيمكنك القيام بذلك عن طريق حذف المجلد التالي: %1 diff --git a/dist/languages/ca.ts b/dist/languages/ca.ts index 82c2259280..534d4e4af1 100644 --- a/dist/languages/ca.ts +++ b/dist/languages/ca.ts @@ -694,12 +694,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Mode de sincronització vertical: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -707,79 +727,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: Filtrat anisotròpic: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: Mode de la GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Precisió DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -788,1301 +808,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Llavor de GNA - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Nom del dispositiu - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Idioma: - + This option can be overridden when region setting is auto-select - + Region: Regió: - + The region of the console. - + Time Zone: Zona horària: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: Mode de la consola - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Ocultar el cursor del ratolí en cas d'inactivitat - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Activa el mode joc - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled - + Never Mai - + On Load - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservador - + Aggressive Agressiu - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Ensamblat d'ombrejadors, només NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, només AMD/Mesa) - + Null Nul - + Fast Ràpid - - - + + + Accurate Precís - - - + + + Default Valor predeterminat - + Unsafe (fast) Insegur (ràpid) - + Safe (stable) Segur (estable) - + Immediate - + Balanced Equilibrat - + Unsafe Insegur - + Paranoid (disables most optimizations) Paranoic (desactiva la majoria d'optimitzacions) - + Debugging Depuració - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Finestra sense vores - + Exclusive Fullscreen Pantalla completa exclusiva - + No Video Output Sense sortida de vídeo - + CPU Video Decoding Descodificació de vídeo a la CPU - + GPU Video Decoding (Default) Descodificació de vídeo a la GPU (Valor predeterminat) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Veí més proper - + Bilinear Bilineal - + Bicubic Bicúbic - + Gaussian Gaussià - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution Super resolució AMD FidelityFX - + Area Àrea - + MMPX MMPX - + Zero-Tangent Tangència zero - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Cap - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Valor predeterminat (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 - + Stretch to Window Estirar a la finestra - + Automatic Automàtic - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonès (日本語) - + American English Anglès americà - + French (français) Francès (français) - + German (Deutsch) Alemany (Deutsch) - + Italian (italiano) Italià (italiano) - + Spanish (español) Castellà (español) - + Chinese Xinès - + Korean (한국어) Coreà (한국어) - + Dutch (Nederlands) Holandès (Nederlands) - + Portuguese (português) Portuguès (português) - + Russian (Русский) Rus (Русский) - + Taiwanese Taiwanès - + British English Anglès britànic - + Canadian French Francès canadenc - + Latin American Spanish Espanyol llatinoamericà - + Simplified Chinese Xinès simplificat - + Traditional Chinese (正體中文) Xinès tradicional (正體中文) - + Brazilian Portuguese (português do Brasil) Portuguès brasiler (português do Brasil) - + Polish (polska) Polonès (polska) - + Thai (แบบไทย) Tailandès (แบบไทย) - - + + Japan Japó - + USA EUA - + Europe Europa - + Australia Austràlia - + China Xina - + Korea Corea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Per defecte (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland Islàndia - + Iran Iran - + Israel Isreal - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polònia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estèreo - + Surround Envoltant - + 4GB DRAM (Default) 4GB DRAM (Insegur) - + 6GB DRAM (Unsafe) 6GB DRAM (Insegur) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Insegur) - + 12GB DRAM (Unsafe) 12GB DRAM (Insegur) - + Docked Sobretaula - + Handheld Portàtil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop Tan sols si el joc especifica no parar - + Never ask No preguntar mai - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/cs.ts b/dist/languages/cs.ts index c6644fa046..abbc0b4db0 100644 --- a/dist/languages/cs.ts +++ b/dist/languages/cs.ts @@ -694,12 +694,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -707,79 +727,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: Anizotropní filtrování: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -788,1301 +808,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Název Zařízení - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Jazyk: - + This option can be overridden when region setting is auto-select - + Region: Region: - + The region of the console. - + Time Zone: Časové Pásmo: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Potvrzení před zastavením emulace - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Skrýt myš při neaktivitě - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Automatické - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Přesné - - - + + + Default Výchozí - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Nebezpečné - + Paranoid (disables most optimizations) Paranoidní (zakáže většinu optimizací) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Okno bez okrajů - + Exclusive Fullscreen Exkluzivní - + No Video Output - + CPU Video Decoding - + GPU Video Decoding (Default) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) - + 3X (2160p/3240p) - + 4X (2880p/4320p) - + 5X (3600p/5400p) - + 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor - + Bilinear Bilineární - + Bicubic - + Gaussian - + Lanczos - + ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Žádné - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Výchozí (16:9) - + Force 4:3 Vynutit 4:3 - + Force 21:9 Vynutit 21:9 - + Force 16:10 - + Stretch to Window Roztáhnout podle okna - + Automatic - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonština (日本語) - + American English - + French (français) Francouzština (français) - + German (Deutsch) Nemčina (Deutsch) - + Italian (italiano) Italština (Italiano) - + Spanish (español) Španělština (español) - + Chinese Čínština - + Korean (한국어) Korejština (한국어) - + Dutch (Nederlands) Holandština (Nederlands) - + Portuguese (português) Portugalština (português) - + Russian (Русский) Ruština (Русский) - + Taiwanese Tajwanština - + British English Britská Angličtina - + Canadian French Kanadská Francouzština - + Latin American Spanish Latinsko Americká Španělština - + Simplified Chinese Zjednodušená Čínština - + Traditional Chinese (正體中文) Tradiční Čínština (正體中文) - + Brazilian Portuguese (português do Brasil) Brazilská Portugalština (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonsko - + USA USA - + Europe Evropa - + Australia Austrálie - + China Čína - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egypt - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamajka - + Kwajalein Kwajalein - + Libya Lybie - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polsko - + Portugal Portugalsko - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turecko - + UCT UCT - + Universal Univerzální - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Zadokovaná - + Handheld Příruční - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Vždy se zeptat (Výchozí) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/da.ts b/dist/languages/da.ts index ed0bbc27d1..4e34f94af9 100644 --- a/dist/languages/da.ts +++ b/dist/languages/da.ts @@ -696,12 +696,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -709,79 +729,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: Anisotropisk Filtrering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -790,1301 +810,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG-Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Region - + The region of the console. - + Time Zone: Tidszone - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Skjul mus ved inaktivitet - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Automatisk - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Nøjagtig - - - + + + Default Standard - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Usikker - + Paranoid (disables most optimizations) Paranoid (deaktiverer de fleste optimeringer) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Uindrammet Vindue - + Exclusive Fullscreen Eksklusiv Fuld Skærm - + No Video Output Ingen Video-Output - + CPU Video Decoding CPU-Video Afkodning - + GPU Video Decoding (Default) GPU-Video Afkodning (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75X (540p/810p) [EKSPERIMENTEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor Nærmeste Nabo - + Bilinear Bilineær - + Bicubic Bikubisk - + Gaussian Gausisk - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tving 4:3 - + Force 21:9 Tving 21:9 - + Force 16:10 - + Stretch to Window Stræk til Vindue - + Automatic - + 2x - + 4x - + 8x - + 16x - + Japanese (日本語) Japansk (日本語) - + American English - + French (français) Fransk (français) - + German (Deutsch) Tysk (Deutsch) - + Italian (italiano) Italiensk (italiano) - + Spanish (español) Spansk (español) - + Chinese Kinesisk - + Korean (한국어) Koreansk (한국어) - + Dutch (Nederlands) Hollandsk (Nederlands) - + Portuguese (português) Portugisisk (português) - + Russian (Русский) Russisk (Русский) - + Taiwanese Taiwanesisk - + British English Britisk Engelsk - + Canadian French Candadisk Fransk - + Latin American Spanish Latinamerikansk Spansk - + Simplified Chinese Forenklet Kinesisk - + Traditional Chinese (正體中文) Traditionelt Kinesisk (正體中文) - + Brazilian Portuguese (português do Brasil) Braziliansk Portugisisk (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China Kina - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ægypten - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Tyrkiet - + UCT UCT - + Universal Universel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Dokket - + Handheld Håndholdt - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/de.ts b/dist/languages/de.ts index d845754236..a911437c44 100644 --- a/dist/languages/de.ts +++ b/dist/languages/de.ts @@ -731,12 +731,32 @@ Der aggressive Modus kann die Leistung anderer Anwendungen, wie z. B. Aufnahmeso Überspringt bestimmte Cache-Invalidierungen auf CPU-Seite während Speicherupdates, reduziert die CPU-Auslastung und verbessert die Leistung. Dies verursacht vielleicht Abstürze. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: VSync-Modus: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -747,12 +767,12 @@ Postkasten kann eine geringere Latenz als FIFO aufweisen und verursacht kein Tea Sofort (ohne Synchronisation) zeigt alles an, was verfügbar ist, und kann Tearing verursachen. - + Sync Memory Operations Speicheroperationen synchronisieren - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -761,44 +781,44 @@ Diese Option behebt Probleme in Spielen, kann jedoch zu Leistungseinbußen führ Bei Spielen mit Unreal Engine 4 sind die Auswirkungen oft am deutlichsten spürbar. - + Enable asynchronous presentation (Vulkan only) Aktiviere asynchrone Präsentation (Nur Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Verbessert die Leistung geringfügig, indem die Darstellung auf einen separaten CPU-Thread verlagert wird. - + Force maximum clocks (Vulkan only) Erzwinge Maximale Taktrate (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Lässt im Hintergrund die GPU Aufgaben erledigen während diese auf Grafikbefehle wartet, damit diese nicht herunter taktet. - + Anisotropic Filtering: Anisotrope Filterung: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Steuert die Qualität der Texturwiedergabe bei schrägen Blickwinkeln. Bei den meisten Grafikkarten kann dieser Wert bedenkenlos auf 16x eingestellt werden. - + GPU Mode: GPU-Modus: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -807,12 +827,12 @@ Die meisten Spiele werden im Modus Schnell in Ordnung gerendert, für einige ist Partikel werden in der Regel nur im Modus Akkurat korrekt gerendert. - + DMA Accuracy: DMA-Genauigkeit: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -821,12 +841,12 @@ Unsicher ist schneller, während Sicher stabiler ist und in manchen Spielen Prob Standard folgt der GPU-Genauigkeit Einstellung. - + GPU Fence Behavior: GPU-Zaunobjekt-Verhalten: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -835,44 +855,44 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Aktiviere asynchrones Shader-Kompilieren - + May reduce shader stutter. Kann Shader-Ruckler reduzieren. - + GPU Clocks GPU-Takte - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. Führt dazu, dass das Spiel glaubt, die Arbeit der GPU würde früher fertig sein, als sie eigentlich ist. Dadurch hört das Spiel auf die Auflösung und Render-Distanz zu verringern um sich den Takten der Switch anzupassen. - + GPU Unswizzle GPU-Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Beschleunigt die Dekodierung von BCn-3D-Texturen mithilfe von GPU-Rechenleistung. Deaktiviere diese Option, falls Abstürze oder Grafikfehler auftreten. - + GPU Unswizzle Max Texture Size GPU-Unswizzle max. Texturgröße - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -881,48 +901,48 @@ Während die GPU für mittelgroße und große Texturen schneller ist, kann die C Passen Sie diesen Wert an, um das Gleichgewicht zwischen GPU-Beschleunigung und CPU-Overhead zu finden. - + GPU Unswizzle Stream Size GPU-Unswizzle-Streamgröße - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Legt die maximale Menge an Texturdaten (in MiB) fest, die pro Bild verarbeitet wird. Höhere Werte können Ruckeln beim Laden von Texturen verringern, können sich jedoch auf die Bildrate auswirken. - + GPU Unswizzle Chunk Size GPU-Unswizzle Chunk-Größe - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Legt die Anzahl der Tiefenschnitte fest, die in einem einzelnen Durchlauf verarbeitet werden. Eine Erhöhung dieses Werts kann den Durchsatz auf High-End-GPUs verbessern, bei schwächerer Hardware jedoch zu TDR- oder Treiber-Auszeiten führen. - + Use Vulkan pipeline cache Vulkan-Pipeline-Cache verwenden - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Aktiviert den herstellerspezifischen Pipeline-Cache der GPU. Diese Option kann die Ladezeit von Shadern erheblich verkürzen, wenn der Vulkan-Treiber die Pipeline-Cache-Dateien nicht intern speichert. - + Enable Compute Pipelines (Intel Vulkan Only) Aktiviere Compute-Pipelines (Nur Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -931,194 +951,182 @@ Diese Einstellung ist nur bei proprietären Intel-Treibern vorhanden und kann be Bei allen anderen Treibern sind die Rechen-Rohrleitungen immer aktiviert. - + Enable Reactive Flushing Aktiviere Reactives Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Benutzt Reactive-Flushing anstatt Predictive-Flushing, welches akkurateres Speicher-Synchronisieren erlaubt. - + Sync to framerate of video playback Synchronisiere mit Bildrate von Video-Wiedergaben - + Run the game at normal speed during video playback, even when the framerate is unlocked. Lasse das Spiel in der normalen Geschwindigkeit abspielen, trotz freigeschalteter Bildrate - + Barrier feedback loops Barrier-Feedback-Schleifen - + Improves rendering of transparency effects in specific games. Verbessert das Rendering von Transparenzeffekten in bestimmten Spielen. - + Enable buffer history Puffer-Verlauf aktivieren - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Ermöglicht den Zugriff auf frühere Pufferzustände. Diese Option kann in manchen Spielen die Darstellungsqualität und die Leistungsstabilität verbessern. - + Fix bloom effects Bloom-Effekte beheben - + Removes bloom in Burnout. Entfernt Bloom in Burnout. - - Enable Legacy Rescale Pass - „Legacy Rescale Pass“ aktivieren - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - Behebt möglicherweise Probleme mit der Skalierung in einigen Spielen, indem auf das Verhalten der vorherigen Implementierung zurückgegriffen wird. -Eine Umgehungslösung für das alte Verhalten, die Linienartefakte auf AMD- und Intel-GPUs sowie graues Texturflackern auf Nvidia-GPUs in „Luigi’s Mansion 3“ behebt. - - - + Extended Dynamic State Erweiterter dynamischer Zustand - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Legt die Anzahl der Funktionen fest, die im erweiterten dynamischen Modus verwendet werden können. Höhere Stufen ermöglichen mehr Funktionen und können die Leistung steigern, können jedoch zusätzliche grafische Probleme verursachen. - + Vertex Input Dynamic State Dynamischer Zustand der Scheitelpunkteingabe - + Enables vertex input dynamic state feature for better quality and performance. Aktiviert die Funktion für den dynamischen Status der Scheitelpunkteingabe, um eine bessere Qualität und Leistung zu erzielen. - + Sample Shading Probe-Schattierung - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Ermöglicht es dem Fragment-Shader, pro Abtastwert in einem mehrfach abgetasteten Fragment ausgeführt zu werden, anstatt nur einmal pro Fragment. Verbessert die Grafikqualität auf Kosten der Leistung. Höhere Werte verbessern die Qualität, beeinträchtigen jedoch die Leistung. - + RNG Seed Startwert für den Zufallszahlengenerator - + Controls the seed of the random number generator. Mainly used for speedrunning. Steuert den Startwert des Zufallszahlengenerators. Wird hauptsächlich für Schnelldurchläufe verwendet. - + Device Name Gerätename - + The name of the console. Der Name der Konsole. - + Homebrew Args Homebrew-Argumente - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Befehlszeilenargumente, die beim Start an Homebrew übergeben werden (z. B. -noglsl). - + Custom RTC Date: Benutzerdefinierte Echtzeituhrdatum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Diese Option erlaubt die Änderung der Uhr der Konsole. Kann benutzt werden um Zeit in Spielen zu manipulieren. - + The number of seconds from the current unix time Die Anzahl der Sekunden seit dem aktuellen Unix-Zeitstempel - + Language: Sprache: - + This option can be overridden when region setting is auto-select Diese Option kann überschrieben werden, wenn die Regionseinstellung auf „Automatische Auswahl“ steht - + Region: Region: - + The region of the console. Die Region der Konsole. - + Time Zone: Zeitzone: - + The time zone of the console. Die Zeitzone der Konsole. - + Sound Output Mode: Tonausgangsmodus: - + Console Mode: Konsolenmodus: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1127,1026 +1135,1026 @@ Je nach dieser Einstellung ändern sich bei Spielen die Auflösung, die Detailst Die Einstellung auf „Handgerät“ kann dazu beitragen, die Leistung auf Systemen mit geringerer Leistung zu verbessern. - + Prompt for user profile on boot Beim Systemstart nach dem Benutzerprofil fragen - + Useful if multiple people use the same PC. Nützlich, wenn mehrere Personen denselben PC nutzen. - + Pause when not in focus Pausieren, wenn nicht im Fokus - + Pauses emulation when focusing on other windows. Pausiert die Emulation, wenn der Fokus auf andere Fenster wechselt. - + Confirm before stopping emulation Vor dem Stoppen der Emulation bestätigen - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Überschreibt die Abfragen zur Bestätigung des Beendens der Emulation. Wenn diese Option aktiviert ist, werden solche Abfragen umgangen und die Emulation wird direkt beendet. - + Hide mouse on inactivity Mauszeiger verbergen - + Hides the mouse after 2.5s of inactivity. Verbirgt den Mauszeiger nach 2,5 Sekunden Inaktivität. - + Check for updates Auf Aktualisierungen überprüfen - + Whether or not to check for updates upon startup. Ob nach Aktualisierungen während des Startens gesucht werden soll. - + Enable Gamemode Spielmodus aktivieren - + Force X11 as Graphics Backend X11 als Grafik-Backend erzwingen - + Custom frontend Benutzerdefiniertes Frontend - + Real applet Echtes Applet - - + + Disabled Deaktiviert - + Never Niemals - + On Load Beim Laden - + Always Immer - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Asynchron - + Uncompressed (Best quality) Unkomprimiert (Beste Qualität) - + BC1 (Low quality) BC1 (Niedrige Qualität) - + BC3 (Medium quality) BC3 (Mittlere Qualität) - - + + Auto Auto - + 30 FPS 30 BpS - + 60 FPS 60 BpS - + 90 FPS 90 BpS - + 120 FPS 120 BpS - + Conservative Konservativ - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembler-Shader, nur NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (experimentell, nur AMD/Mesa) - + Null Null - + Fast Schnell - - - + + + Accurate Akkurat - - - + + + Default Vorgabe - + Unsafe (fast) Unsicher (schnell) - + Safe (stable) Sicher (stabil) - + Immediate Direkt - + Balanced Ausgeglichen - + Unsafe Unsicher - + Paranoid (disables most optimizations) Paranoid (deaktiviert die meisten Optimierungen) - + Debugging Fehlerbehebung - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Rahmenloses Fenster - + Exclusive Fullscreen Exklusiver Vollbildmodus - + No Video Output Keine Videoausgabe - + CPU Video Decoding CPU Video Dekodierung - + GPU Video Decoding (Default) GPU Video Dekodierung (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5X (360p/540p) [EXPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75X (540p/810p) [EXPERIMENTELL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1,5X (1080p/1620p) [EXPERIMENTELL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest-Neighbor - + Bilinear Bilinear - + Bicubic Bikubisch - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super-Auflösung - + Area Bereich - + MMPX MMPX - + Zero-Tangent Nulltangente - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Spiel-Superauflösung - + Snapdragon Game Super Resolution EdgeDir Snapdragon Spiel-Superauflösung EdgeDir - + None Keiner - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Vorgabe (16:9) - + Force 4:3 4:3 erzwingen - + Force 21:9 21:9 erzwingen - + Force 16:10 16:10 erzwingen - + Stretch to Window Auf Fenster anpassen - + Automatic Automatisch - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japanisch (日本語) - + American English Amerikanisches Englisch - + French (français) Französisch (français) - + German (Deutsch) Deutsch (German) - + Italian (italiano) Italienisch (italiano) - + Spanish (español) Spanisch (español) - + Chinese Chinesisch - + Korean (한국어) Koreanisch (한국어) - + Dutch (Nederlands) Niederländisch (Nederlands) - + Portuguese (português) Portugiesisch (português) - + Russian (Русский) Russisch (Русский) - + Taiwanese Taiwanesisch - + British English Britisches Englisch - + Canadian French Kanadisches Französisch - + Latin American Spanish Lateinamerikanisches Spanisch - + Simplified Chinese Vereinfachtes Chinesisch - + Traditional Chinese (正體中文) Traditionelles Chinesisch (正體中文) - + Brazilian Portuguese (português do Brasil) Brasilianisches Portugiesisch (português do Brasil) - + Polish (polska) Polnisch (Polen) - + Thai (แบบไทย) Thailändisch (Thailändische Version) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China China - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Automatisch (%1) - + Default (%1) Default time zone Standard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Ägypten - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Türkei - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Vorgabe) - + 6GB DRAM (Unsafe) 6GB DRAM (Unsicher) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Unsicher) - + 12GB DRAM (Unsafe) 12GB DRAM (Unsicher) - + Docked Angedockt - + Handheld Handgerät - - + + Normal Normal - - + + Boost Beschleunigung - - + + Overclock Übertaktung - + Always ask (Default) Immer fragen (Vorgabe) - + Only if game specifies not to stop Nur wenn ein Spiel vorgibt, nicht zu stoppen - + Never ask Niemals fragen - + Very Small (16 MB) Sehr klein (16 MB) - + Small (32 MB) Klein (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Groß (256 MB) - + Very Large (512 MB) Sehr groß (512 MB) - + Very Low (4 MB) Sehr niedrig (4 MB) - + Low (8 MB) Niedrig (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Mittel (32 MB) - + High (64 MB) Hoch (64 MB) - + Very Low (32) Sehr niedrig (32) - + Low (64) Niedrig (64) - + Normal (128) Normal (128) - + Medium (256) Mittel (256) - + High (512) Hoch (512) - + ExtendedDynamicState 1 ErweiterterDynamischerZustand 1 - + ExtendedDynamicState 2 ErweiterterDynamischerZustand 2 - + ExtendedDynamicState 3 ErweiterterDynamischerZustand 3 - + Tree View Baumansicht - + Grid View Rasteransicht diff --git a/dist/languages/el.ts b/dist/languages/el.ts index b269f194ea..b3ec9c6f5e 100644 --- a/dist/languages/el.ts +++ b/dist/languages/el.ts @@ -696,12 +696,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -709,79 +729,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: Ανισοτροπικό Φιλτράρισμα: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -790,1301 +810,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Περιφέρεια: - + The region of the console. - + Time Zone: Ζώνη Ώρας: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Απόκρυψη δρομέα ποντικιού στην αδράνεια - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto Αυτόματη - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate Ακριβής - - - + + + Default Προεπιλεγμένο - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Επισφαλής - + Paranoid (disables most optimizations) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Παραθυροποιημένο Χωρίς Όρια - + Exclusive Fullscreen Αποκλειστική Πλήρης Οθόνη - + No Video Output Χωρίς Έξοδο Βίντεο - + CPU Video Decoding Αποκωδικοποίηση Βίντεο CPU - + GPU Video Decoding (Default) Αποκωδικοποίηση Βίντεο GPU (Προεπιλογή) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [ΠΕΙΡΑΜΑΤΙΚΟ] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor Πλησιέστερος Γείτονας - + Bilinear Διγραμμικό - + Bicubic Δικυβικό - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Κανένα - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Προεπιλογή (16:9) - + Force 4:3 Επιβολή 4:3 - + Force 21:9 Επιβολή 21:9 - + Force 16:10 Επιβολή 16:10 - + Stretch to Window Επέκταση στο Παράθυρο - + Automatic Αυτόματα - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Ιαπωνικά (日本語) - + American English - + French (français) Γαλλικά (Français) - + German (Deutsch) Γερμανικά (Deutsch) - + Italian (italiano) Ιταλικά (Italiano) - + Spanish (español) Ισπανικά (Español) - + Chinese Κινέζικα - + Korean (한국어) Κορεάτικα (한국어) - + Dutch (Nederlands) Ολλανδικά (Nederlands) - + Portuguese (português) Πορτογαλικά (Português) - + Russian (Русский) Ρώσικα (Русский) - + Taiwanese Ταϊβανέζικα - + British English Βρετανικά Αγγλικά - + Canadian French Καναδικά Γαλλικά - + Latin American Spanish Λατινοαμερικάνικα Ισπανικά - + Simplified Chinese Απλοποιημένα Κινέζικα - + Traditional Chinese (正體中文) Παραδοσιακά Κινέζικα (正體中文) - + Brazilian Portuguese (português do Brasil) Πορτογαλικά Βραζιλίας (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Ιαπωνία - + USA ΗΠΑ - + Europe Ευρώπη - + Australia Αυστραλία - + China Κίνα - + Korea Κορέα - + Taiwan Ταϊβάν - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET CET - + CST6CDT CST6CDT - + Cuba Κούβα - + EET EET - + Egypt Αίγυπτος - + Eire - + EST EST - + EST5EDT EST5EDT - + GB - + GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Γκρήνουιτς - + Hongkong Χονγκ Κονγκ - + HST HST - + Iceland Ισλανδία - + Iran Ιράν - + Israel Ισραήλ - + Jamaica Ιαμαϊκή - + Kwajalein - + Libya Λιβύη - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Ναβάχο - + NZ - + NZ-CHAT - + Poland Πολωνία - + Portugal Πορτογαλία - + PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Σιγκαπούρη - + Turkey Τουρκία - + UCT UCT - + Universal Παγκόσμια - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu - + Mono Μονοφωνικό - + Stereo Στέρεοφωνικό - + Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/es.ts b/dist/languages/es.ts index c565dc17f2..8cda19bc6b 100644 --- a/dist/languages/es.ts +++ b/dist/languages/es.ts @@ -730,12 +730,32 @@ El modo agresivo puede afectar al rendimiento de otras aplicaciones, como a los Omite ciertas invalidaciones de caché durante las actualizaciones de memoria, reduciendo el uso de la CPU y mejorando la latencia. Esto puede causar bloqueos leves. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Modo VSync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -746,12 +766,12 @@ Mailbox ofrece menor latencia que FIFO y evita el tearing, aunque puede perder a Immediate (sin sincronización) muestra los fotogramas tan pronto están disponibles, pero puede generar desgarros de imagen. - + Sync Memory Operations Sincronizar operaciones de memoria - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -760,56 +780,56 @@ Esta opción arregla errores en los juegos, pero puede afectar negativamente al Los juegos con Unreal Engine 4 son con frecuencia los que muestran cambios significantes en esto. - + Enable asynchronous presentation (Vulkan only) Activar presentación asíncrona (solo Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Mejora el rendimiento ligeramente al usar un hilo de CPU adicional para la presentación. - + Force maximum clocks (Vulkan only) Forzar relojes al máximo (solo Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Ejecuta los procesos en segundo plano mientras se espera a las instrucciones gráficas para evitar que la GPU reduzca su velocidad de reloj. - + Anisotropic Filtering: Filtrado anisotrópico: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Controla la calidad del renderizado de texturas en ángulos oblicuos. Es seguro configurarlo en 16x en la mayoría de las GPU. - + GPU Mode: Modo de la GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Precisión de DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -818,12 +838,12 @@ Inseguro es más rápido, mientras que seguro es más estable y puede solucionar Predeterminado sigue el ajuste de la precisión de GPU. - + GPU Fence Behavior: Comportamiento de vallado de la GPU: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -832,44 +852,44 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Activa la compilación de shaders asincrónicos - + May reduce shader stutter. Puede reducir los tirones causados por la carga de sombreadores. - + GPU Clocks Relojes de GPU - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle Desentrelazado de la GPU - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Acelera la decodificación de texturas 3D BCn mediante computación de la GPU. Desactívela si experimenta problemas o fallos gráficos. - + GPU Unswizzle Max Texture Size Tamaño máximo de textura de desentrelazado de la GPU - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -878,46 +898,46 @@ Aunque la GPU es más rápida para texturas medianas y grandes, la CPU puede ser Ajuste este valor para encontrar el equilibrio entre la aceleración de la GPU y la sobrecarga de la CPU. - + GPU Unswizzle Stream Size Tamaño del flujo de desentrelazado de la GPU - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Establece la cantidad máxima de datos de textura (en MiB) procesados ​​por cada fotograma. Valores más altos pueden reducir la distorsión durante la carga de texturas, pero pueden afectar a la consistencia de los fotogramas. - + GPU Unswizzle Chunk Size Tamaño del trozo de desentrelazado de la GPU - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Determina la cantidad de cortes de profundidad procesados ​​en un solo envío. Aumentar este valor puede mejorar el rendimiento en una GPU de gama alta, pero puede causar tirones y problemas en los tiempos de respuesta en hardware más modesto. - + Use Vulkan pipeline cache Usar caché de canalización de Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Activa la caché de canalización específica del fabricante. Esta opción puede mejorar los tiempos de cargas de sombreadores en el caso de que el controlador de Vulkan no lo almacene internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Activar la canalizaciones de cómputo (solo Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -926,194 +946,182 @@ Este ajuste solo existe para los controladores propietarios de Intel y puede cau En los demás controladores, la canalización de cómputo siempre está activada. - + Enable Reactive Flushing Activar limpieza reactiva - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Usa limpieza de memoria reactiva en vez de predictiva, permitiendo una sincronización de memoria más precisa. - + Sync to framerate of video playback Sincronizar a fotogramas de reproducción de vídeo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Ejecuta el juego a velocidad normal durante la reproducción de vídeos, incluso cuando no hay límite de fotogramas. - + Barrier feedback loops Bucles de feedback de barrera - + Improves rendering of transparency effects in specific games. Mejora la renderización de los efectos de transparencia en ciertos juegos. - + Enable buffer history Activar el historial del búfer - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Habilita el acceso a estados de búfer anteriores. Esta opción puede mejorar la calidad de renderizado y la consistencia en el rendimiento de algunos juegos. - + Fix bloom effects Arreglar efectos de resplandor - + Removes bloom in Burnout. Elimina el resplandor en Burnout. - - Enable Legacy Rescale Pass - Activar el pase de reescalado heredado - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - Puede arreglar los problemas de reescalado en algunos juegos confiando en el comportamiento de la implementación anterior. -Solución alternativa de comportamiento heredado que corrige los artefactos de línea de la GPU AMD y el parpadeo de texturas gris de la GPU Nvidia en Luigis Mansion 3. - - - + Extended Dynamic State Estado dinámico extendido - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Controla el número de funciones que pueden ser usadas en el Estado Dinámico Extendido. Números más altos permiten úsar más funciones y pueden aumentar el rendimiento, pero tambén pueden causar errores gráficos. - + Vertex Input Dynamic State Estado dinámico de entrada de vértices - + Enables vertex input dynamic state feature for better quality and performance. Activa la función de estado dinámico de entrada de vértices para una mejor calidad y rendimiento. - + Sample Shading Sombreado de muestra - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permite que el sombreador de fragmentos se ejecute por muestra en un fragmento multimuestreado, en lugar de una sola vez por fragmento. Mejora la calidad de los gráficos a costa de rendimiento. Los valores más altos mejoran la calidad, pero reducen el rendimiento. - + RNG Seed Semilla de GNA - + Controls the seed of the random number generator. Mainly used for speedrunning. Controla la semilla del generador de números aleatorios. Usado principalmente para speedrunning. - + Device Name Nombre del dispositivo - + The name of the console. El nombre de la consola - + Homebrew Args Argumentos Homebrew - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Argumentos en la línea de comandos pasados al homebrew al ser lanzado (p.e. -noglsl). - + Custom RTC Date: Fecha Personalizada RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Esta opción permite cambiar el reloj de la consola. Puede ser usado para manipular el tiempo en juegos. - + The number of seconds from the current unix time Número de segundos de la hora actual de Unix - + Language: Idioma: - + This option can be overridden when region setting is auto-select Esta opción puede ser reemplazada cuando la configuración de región está en selección automática. - + Region: Región: - + The region of the console. La Región de la Consola. - + Time Zone: Zona horaria: - + The time zone of the console. La zona horaria de la consola. - + Sound Output Mode: Método de salida de sonido: - + Console Mode: Modo consola: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1122,1025 +1130,1025 @@ Los juegos cambiarán su resolución, detalles y compatibilidad con los mandos s Configurar el modo portátil puede mejorar el rendimiento en sistemas de gama baja. - + Prompt for user profile on boot Solicitud para perfil de usuario al arrancar - + Useful if multiple people use the same PC. Útil si múltiples personas usan la misma PC - + Pause when not in focus Pausar cuando la ventana no esté activa - + Pauses emulation when focusing on other windows. Pausa la emulación cuando otra ventana diferente está activa. - + Confirm before stopping emulation Confirmar detención - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Anula las solicitudes de confirmación para detener la emulación. Al habilitar esta opción, se omiten dichas solicitudes y se sale directamente de la emulación. - + Hide mouse on inactivity Ocultar el cursor por inactividad. - + Hides the mouse after 2.5s of inactivity. Oculta el mouse después de 2.5s de inactividad. - + Check for updates Buscar actualizaciones - + Whether or not to check for updates upon startup. Si se deben buscar actualizaciones al iniciar o no. - + Enable Gamemode Activar Modo Juego - + Force X11 as Graphics Backend Forzar X11 como motor gráfico - + Custom frontend Interfaz personalizada - + Real applet Applet real - - + + Disabled Desactivado - + Never Nunca - + On Load Al cargar - + Always Siempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU asíncrona - + Uncompressed (Best quality) Sin compresión (Mejor calidad) - + BC1 (Low quality) BC1 (Calidad baja) - + BC3 (Medium quality) BC3 (Calidad media) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservativo - + Aggressive Agresivo - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Ensamblado de sombreadores, solo NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, solo AMD/Mesa) - + Null Ninguno - + Fast Rápido - - - + + + Accurate Preciso - - - + + + Default Predeterminado - + Unsafe (fast) Inseguro (rápido) - + Safe (stable) Seguro (estable) - + Immediate Inmediato - + Balanced Balanceado - + Unsafe Impreciso - + Paranoid (disables most optimizations) Paranoico (Deshabilita la mayoría de optimizaciones) - + Debugging Depuración - + Dynarmic DynARMic - + NCE NCE - + Borderless Windowed Ventana sin bordes - + Exclusive Fullscreen Pantalla completa - + No Video Output Sin salida de vídeo - + CPU Video Decoding Decodificación de vídeo en la CPU - + GPU Video Decoding (Default) Decodificación de vídeo en GPU (Por defecto) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] x0,5 (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] x0,75 (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) x1 (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] x1,5 (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) x2 (1440p/2160p) - + 3X (2160p/3240p) x3 (2160p/3240p) - + 4X (2880p/4320p) x4 (2880p/4320p) - + 5X (3600p/5400p) x5 (3600p/5400p) - + 6X (4320p/6480p) x6 (4320p/6480p) - + 7X (5040p/7560p) x7 (5040p/7560p) - + 8X (5760p/8640p) x8 (5760p/8640p) - + Nearest Neighbor Vecino más próximo - + Bilinear Bilineal - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution Super Resolución AMD FidelityFX - + Area Área - + MMPX MMPX - + Zero-Tangent Tangente cero - + B-Spline Ranura B - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Super resolución de juego Snapdragon - + Snapdragon Game Super Resolution EdgeDir Filo direcorio de super resolución de juego Snapdragon - + None Ninguno - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Predeterminado (16:9) - + Force 4:3 Forzar 4:3 - + Force 21:9 Forzar 21:9 - + Force 16:10 Forzar 16:10 - + Stretch to Window Estirar a la ventana - + Automatic Automático - + 2x x2 - + 4x x4 - + 8x x8 - + 16x x16 - + Japanese (日本語) Japonés (日本語) - + American English Inglés estadounidense - + French (français) Francés (français) - + German (Deutsch) Alemán (deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Español - + Chinese Chino - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandés (nederlands) - + Portuguese (português) Portugués (português) - + Russian (Русский) Ruso (Русский) - + Taiwanese Taiwanés - + British English Inglés británico - + Canadian French Francés canadiense - + Latin American Spanish Español latinoamericano - + Simplified Chinese Chino simplificado - + Traditional Chinese (正體中文) Chino tradicional (正體中文) - + Brazilian Portuguese (português do Brasil) Portugués brasileño (português do Brasil) - + Polish (polska) Polaco (polska) - + Thai (แบบไทย) Tailandés (แบบไทย) - - + + Japan Japón - + USA EEUU - + Europe Europa - + Australia Australia - + China China - + Korea Corea - + Taiwan Taiwán - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Predeterminada (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipto - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Irán - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polonia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turquía - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulú - + Mono Mono - + Stereo Estéreo - + Surround Envolvente - + 4GB DRAM (Default) 4GB DRAM (Por defecto) - + 6GB DRAM (Unsafe) 6GB DRAM (Inseguro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Inseguro) - + 12GB DRAM (Unsafe) 12GB DRAM (Inseguro) - + Docked Sobremesa - + Handheld Portátil - - + + Normal Normal - - + + Boost Impulso - - + + Overclock Overclock - + Always ask (Default) Preguntar siempre (Por defecto) - + Only if game specifies not to stop Solo si el juego pide no ser cerrado - + Never ask Nunca preguntar - + Very Small (16 MB) Muy pequeño (16 MB) - + Small (32 MB) Pequeño (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Muy grande (512 MB) - + Very Low (4 MB) Muy bajo (4 MB) - + Low (8 MB) Bajo (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Medio (32 MB) - + High (64 MB) Alto (64 MB) - + Very Low (32) Muy bajo (32) - + Low (64) Bajo (64) - + Normal (128) Normal (128) - + Medium (256) Medio (256) - + High (512) Alto (512) - + ExtendedDynamicState 1 ModoDynamicoExtendido 1 - + ExtendedDynamicState 2 ModoDynamicoExtendido 2 - + ExtendedDynamicState 3 ModoDynamicoExtendido 3 - + Tree View Vista en árbol - + Grid View Vista en cuadrícula diff --git a/dist/languages/fi.ts b/dist/languages/fi.ts index 2873cb1c05..5b075f0b0e 100644 --- a/dist/languages/fi.ts +++ b/dist/languages/fi.ts @@ -696,12 +696,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -709,79 +729,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. - + Anisotropic Filtering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -790,1301 +810,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: - + The region of the console. - + Time Zone: - + The time zone of the console. - + Sound Output Mode: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled - + Never - + On Load - + Always - + CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) - + BC3 (Medium quality) - - + + Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null - + Fast - - - + + + Accurate - - - + + + Default - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe - + Paranoid (disables most optimizations) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed - + Exclusive Fullscreen - + No Video Output - + CPU Video Decoding - + GPU Video Decoding (Default) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) - + 3X (2160p/3240p) - + 4X (2880p/4320p) - + 5X (3600p/5400p) - + 6X (4320p/6480p) - + 7X (5040p/7560p) - + 8X (5760p/8640p) - + Nearest Neighbor - + Bilinear - + Bicubic - + Gaussian - + Lanczos - + ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None - + FXAA - + SMAA - + Default (16:9) - + Force 4:3 - + Force 21:9 - + Force 16:10 - + Stretch to Window - + Automatic - + 2x - + 4x - + 8x - + 16x - + Japanese (日本語) - + American English - + French (français) - + German (Deutsch) - + Italian (italiano) - + Spanish (español) - + Chinese - + Korean (한국어) - + Dutch (Nederlands) - + Portuguese (português) - + Russian (Русский) - + Taiwanese - + British English - + Canadian French - + Latin American Spanish - + Simplified Chinese - + Traditional Chinese (正體中文) - + Brazilian Portuguese (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan - + USA - + Europe - + Australia - + China - + Korea - + Taiwan - + Auto (%1) Auto select time zone - + Default (%1) Default time zone - + CET - + CST6CDT - + Cuba - + EET - + Egypt - + Eire - + EST - + EST5EDT - + GB - + GB-Eire - + GMT - + GMT+0 - + GMT-0 - + GMT0 - + Greenwich - + Hongkong - + HST - + Iceland - + Iran - + Israel - + Jamaica - + Kwajalein - + Libya - + MET - + MST - + MST7MDT - + Navajo - + NZ - + NZ-CHAT - + Poland - + Portugal - + PRC - + PST8PDT - + ROC - + ROK - + Singapore - + Turkey - + UCT - + Universal - + UTC - + W-SU - + WET - + Zulu - + Mono - + Stereo - + Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked - + Handheld - - - - Normal - - - - - - Boost - - + Normal + + + + + + Boost + + + + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/fr.ts b/dist/languages/fr.ts index 99f926752e..2f2ddd1481 100644 --- a/dist/languages/fr.ts +++ b/dist/languages/fr.ts @@ -729,12 +729,32 @@ Le mode agressif peut affecter les performances d’autres applications, comme l Ignore certaines invalidations de cache lors des mises à jour de la mémoire, réduisant l’utilisation du CPU et améliorant la latence. Cela peut provoquer des plantages légers. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Mode VSync : - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -745,12 +765,12 @@ Mailbox peut offrir une latence inférieure à FIFO et n’entraîne pas de déc Immediate (pas de synchronisation) affiche ce qui est disponible et peut provoquer du déchirement. - + Sync Memory Operations Synchroniser les opérations mémoire - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -759,68 +779,68 @@ Cette option corrige des problèmes dans les jeux, mais peut dégrader les perfo Les jeux Unreal Engine 4 sont souvent ceux qui bénéficient le plus de ce réglage. - + Enable asynchronous presentation (Vulkan only) Activer la présentation asynchrone (Vulkan uniquement) - + Slightly improves performance by moving presentation to a separate CPU thread. Améliore légèrement les performances en déplaçant la présentation vers un thread CPU séparé. - + Force maximum clocks (Vulkan only) Forcer la fréquence d'horloge maximale (Vulkan uniquement) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Les exécutions fonctionnent en arrière-plan en attendant les commandes graphiques pour empêcher le GPU de réduire sa vitesse de fréquence d'horloge. - + Anisotropic Filtering: Filtrage anisotropique : - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Contrôle la qualité du rendu des textures sous des angles obliques. Il est sûr de le régler à 16x sur la plupart des GPU. - + GPU Mode: Mode GPU : - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Précision du DMA : - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -829,89 +849,89 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Activer la compilation asynchrone des shaders - + May reduce shader stutter. Peut réduire les saccades dues aux shaders. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Utiliser le cache de pipeline Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Active le cache de pipeline spécifique au fournisseur de GPU. Cette option peut améliorer considérablement le temps de chargement des shaders dans les cas où le pilote Vulkan ne stocke pas les fichiers de cache de pipeline en interne. - + Enable Compute Pipelines (Intel Vulkan Only) Activer les pipelines de calcul (Vulkan sur Intel uniquement) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -920,95 +940,84 @@ Ce réglage n’existe que pour les pilotes propriétaires Intel et peut provoqu Les pipelines de calcul sont toujours activés sur tous les autres pilotes. - + Enable Reactive Flushing Activer le Vidage Réactif - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Utilise une purge réactive au lieu d'une purge prédictive, permettant une synchronisation de la mémoire plus précise. - + Sync to framerate of video playback Synchro la fréquence d'image de la relecture du vidéo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Éxécuter le jeu à une vitesse normale pendant la relecture du vidéo, même-ci la fréquence d'image est dévérouillée. - + Barrier feedback loops Boucles de rétroaction de barrière - + Improves rendering of transparency effects in specific games. Améliore le rendu des effets de transparence dans des jeux spécifiques. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State État dynamique étendu - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading Échantillonnage de shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permet au shader de fragments de s’exécuter pour chaque échantillon dans un fragment multi-échantillonné, au lieu d’une seule fois par fragment. @@ -1016,96 +1025,96 @@ Améliore la qualité graphique au prix de performances réduites. Des valeurs plus élevées améliorent la qualité mais dégradent les performances. - + RNG Seed Seed RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Contrôle la graine du générateur de nombres aléatoires. Principalement utilisé pour le speedrun. - + Device Name Nom de l'appareil - + The name of the console. Nom de la console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Date RTC personnalisée : - + This option allows to change the clock of the console. Can be used to manipulate time in games. Cette option permet de modifier l’horloge de la console. Peut être utilisée pour manipuler le temps dans les jeux. - + The number of seconds from the current unix time Nombre de secondes écoulées depuis le 1er janvier 1970. - + Language: Langue : - + This option can be overridden when region setting is auto-select Cette option peut être remplacée lorsque la région est sur auto. - + Region: Région : - + The region of the console. Région de la console. - + Time Zone: Fuseau horaire : - + The time zone of the console. Fuseau horaire de la console. - + Sound Output Mode: Mode de sortie sonore : - + Console Mode: Mode console : - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1114,1026 +1123,1026 @@ Les jeux adaptent leur résolution, leurs paramètres graphiques et les manettes Passer en mode Portable peut améliorer les performances sur les systèmes peu puissants. - + Prompt for user profile on boot Choisir l’utilisateur au démarrage. - + Useful if multiple people use the same PC. Utile si plusieurs personnes utilisent le même PC. - + Pause when not in focus Pause lorsque la fenêtre n’est pas active. - + Pauses emulation when focusing on other windows. Met l’émulation en pause dès que l’utilisateur change de fenêtre. - + Confirm before stopping emulation Confirmer avant d'arrêter l'émulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Ignore les demandes de confirmation pour arrêter l’émulation. L’activer permet de contourner ces confirmations et de quitter directement l’émulation. - + Hide mouse on inactivity Cacher la souris en cas d'inactivité - + Hides the mouse after 2.5s of inactivity. Cache le curseur après 2,5 secondes d’inactivité. - + Check for updates Rechercher des mises à jours - + Whether or not to check for updates upon startup. Vérifier ou non les mises à jour au démarrage. - + Enable Gamemode Activer le mode jeu - + Force X11 as Graphics Backend Forcer X11 comme moteur graphique - + Custom frontend Interface personnalisée - + Real applet Applet réel - - + + Disabled Désactivé - + Never Jamais - + On Load Au chargement - + Always Toujours - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Asynchrone - + Uncompressed (Best quality) Non compressé (Meilleure qualité) - + BC1 (Low quality) BC1 (Basse qualité) - + BC3 (Medium quality) BC3 (Qualité moyenne) - - + + Auto Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Conservateur - + Aggressive Agressif - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Nul - + Fast Rapide - - - + + + Accurate Précis - - - + + + Default Par défaut - + Unsafe (fast) Insecure (rapide) - + Safe (stable) Sûr (stable) - + Immediate - + Balanced Moyen - + Unsafe Risqué - + Paranoid (disables most optimizations) Paranoïaque (désactive la plupart des optimisations) - + Debugging Débogage - + Dynarmic Dynamique - + NCE NCE - + Borderless Windowed Fenêtré sans bordure - + Exclusive Fullscreen Plein écran exclusif - + No Video Output Pas de sortie vidéo - + CPU Video Decoding Décodage Vidéo sur le CPU - + GPU Video Decoding (Default) Décodage Vidéo sur le GPU (par défaut) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPÉRIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPÉRIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1,25X (900p/1350p) [EXPÉRIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPÉRIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Plus proche voisin - + Bilinear Bilinéaire - + Bicubic Bicubique - + Gaussian Gaussien - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area (Par zone) - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Aucun - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Par défaut (16:9) - + Force 4:3 Forcer le 4:3 - + Force 21:9 Forcer le 21:9 - + Force 16:10 Forcer le 16:10 - + Stretch to Window Étirer à la fenêtre - + Automatic Automatique - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonais (日本語) - + American English Anglais Américain - + French (français) Français (français) - + German (Deutsch) Allemand (Deutsch) - + Italian (italiano) Italien (italiano) - + Spanish (español) Espagnol (español) - + Chinese Chinois - + Korean (한국어) Coréen (한국어) - + Dutch (Nederlands) Néerlandais (Nederlands) - + Portuguese (português) Portugais (português) - + Russian (Русский) Russe (Русский) - + Taiwanese Taïwanais - + British English Anglais Britannique - + Canadian French Français Canadien - + Latin American Spanish Espagnol d'Amérique Latine - + Simplified Chinese Chinois Simplifié - + Traditional Chinese (正體中文) Chinois Traditionnel (正體中文) - + Brazilian Portuguese (português do Brasil) Portugais Brésilien (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japon - + USA É.-U.A. - + Europe Europe - + Australia Australie - + China Chine - + Korea Corée - + Taiwan Taïwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Par défaut (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Égypte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland Islande - + Iran Iran - + Israel Israël - + Jamaica Jamaïque - + Kwajalein Kwajalein - + Libya Libye - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Pologne - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapour - + Turkey Turquie - + UCT UCT - + Universal Universel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stéréo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (Par défaut) - + 6GB DRAM (Unsafe) 6 GB DRAM (Risqué) - + 8GB DRAM 8GO DRAM - + 10GB DRAM (Unsafe) 10GO DRAM (Insecure) - + 12GB DRAM (Unsafe) 12GO DRAM (Insecure) - + Docked Mode TV - + Handheld Mode Portable - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Toujours demander (par défaut) - + Only if game specifies not to stop Uniquement si le jeu précise de ne pas s'arrêter - + Never ask Jamais demander - + Very Small (16 MB) Très petit (16Mo) - + Small (32 MB) Petit (32Mo) - + Normal (128 MB) Normal (128Mo) - + Large (256 MB) Large (256Mo) - + Very Large (512 MB) Très large (512Mo) - + Very Low (4 MB) Très faible (4 Mo) - + Low (8 MB) Faible (8 Mo) - + Normal (16 MB) Normal (16 Mo) - + Medium (32 MB) Moyen (32 Mo) - + High (64 MB) Élevé (64 Mo) - + Very Low (32) Très faible (32) - + Low (64) Faible (64) - + Normal (128) Normal (128) - + Medium (256) Moyen (256) - + High (512) Élevé (512) - + ExtendedDynamicState 1 État dynamique étendu 1 - + ExtendedDynamicState 2 État dynamique étendu 2 - + ExtendedDynamicState 3 État dynamique étendu 3 - + Tree View Vue en liste - + Grid View Vue en grille diff --git a/dist/languages/hu.ts b/dist/languages/hu.ts index a519b354b3..29ba70527e 100644 --- a/dist/languages/hu.ts +++ b/dist/languages/hu.ts @@ -702,12 +702,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: VSync mód: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -715,79 +735,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Aszinkron prezentálás engedélyezése (csak Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Kicsit javítja a teljesítményt azáltal, hogy a megjelenítést külön CPU szálra helyezi át. - + Force maximum clocks (Vulkan only) Maximális órajelek kényszerítése (csak Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. A háttérben fut, miközben várja a grafikai parancsokat, hogy a GPU ne csökkentse az órajelét. - + Anisotropic Filtering: Anizotropikus szűrés: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -796,1301 +816,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Vulkan pipeline gyorsítótár használata. - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Reaktív ürítés használata - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Reaktív ürítést használ a prediktív ürítés helyett, ami pontosabb memóriaszinkronizálást tesz lehetővé. - + Sync to framerate of video playback Szinkronizálás a videolejátszás képkockasebességéhez - + Run the game at normal speed during video playback, even when the framerate is unlocked. A játék futtatása normál sebességgel videolejátszás közben, még akkor is, ha a képkockasebesség fel van oldva. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. Javítja az átlátszósági effektek megjelenítését bizonyos játékokban. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Eszköznév - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Egyéni RTC dátum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Nyelv: - + This option can be overridden when region setting is auto-select - + Region: Régió: - + The region of the console. - + Time Zone: Időzóna: - + The time zone of the console. - + Sound Output Mode: Hangkimeneti mód: - + Console Mode: Konzol mód: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Emuláció leállításának megerősítése - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Egér elrejtése inaktivitáskor - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Játékmód engedélyezése - + Force X11 as Graphics Backend - + Custom frontend Egyéni frontend - + Real applet Valódi applet - - + + Disabled - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU aszinkron - + Uncompressed (Best quality) Tömörítetlen (legjobb minőség) - + BC1 (Low quality) BC1 (alacsony minőség) - + BC3 (Medium quality) BC3 (közepes minőség) - - + + Auto Automatikus - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Takarékos - + Aggressive Aggresszív - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Pontos - - - + + + Default Alapértelmezett - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Nem biztonságos - + Paranoid (disables most optimizations) Paranoid (a legtöbb optimalizálást letiltja) - + Debugging - + Dynarmic Dinamikus - + NCE NCE - + Borderless Windowed Szegély nélküli ablak - + Exclusive Fullscreen Exkluzív teljes képernyő - + No Video Output Nincs videokimenet - + CPU Video Decoding CPU videódekódolás - + GPU Video Decoding (Default) GPU videódekódolás (alapértelmezett) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [KÍSÉRLETI] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [KÍSÉRLETI] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [KÍSÉRLETI] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Legközelebbi szomszéd - + Bilinear Bilineáris - + Bicubic Bikubikus - + Gaussian Gauss-féle - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nincs - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Alapértelmezett (16:9) - + Force 4:3 4:3 kényszerítése - + Force 21:9 21:9 kényszerítése - + Force 16:10 16:10 kényszerítése - + Stretch to Window Ablakhoz nyújtás - + Automatic Automatikus - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japán (日本語) - + American English Amerikai angol - + French (français) Francia (français) - + German (Deutsch) Német (Deutsch) - + Italian (italiano) Olasz (italiano) - + Spanish (español) Spanyol (español) - + Chinese Kínai - + Korean (한국어) Koreai (한국어) - + Dutch (Nederlands) Holland (Nederlands) - + Portuguese (português) Portugál (português) - + Russian (Русский) Orosz (Русский) - + Taiwanese Tajvani - + British English Brit Angol - + Canadian French Kanadai francia - + Latin American Spanish Latin-amerikai spanyol - + Simplified Chinese Egyszerűsített kínai - + Traditional Chinese (正體中文) Hagyományos kínai (正體中文) - + Brazilian Portuguese (português do Brasil) Brazíliai portugál (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japán - + USA USA - + Europe Európa - + Australia Ausztrália - + China Kína - + Korea Korea - + Taiwan Tajvan - + Auto (%1) Auto select time zone Automatikus (%1) - + Default (%1) Default time zone Alapértelmezett (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Egyiptom - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Izland - + Iran Irán - + Israel Izrael - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navahó - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Lengyelország - + Portugal Portugália - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Szingapúr - + Turkey Törökország - + UCT UCT - + Universal Univerzális - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Sztereó - + Surround Térhangzás - + 4GB DRAM (Default) 4GB DRAM (Alapértelmezett) - + 6GB DRAM (Unsafe) 6GB DRAM (Nem biztonságos) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Dokkolt - + Handheld Kézi - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Mindig kérdezz rá (alapértelmezett) - + Only if game specifies not to stop Csak akkor, ha a játék kifejezetten kéri a folytatást. - + Never ask Soha ne kérdezz rá - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/id.ts b/dist/languages/id.ts index ab0fe1d8b8..7792d12f35 100644 --- a/dist/languages/id.ts +++ b/dist/languages/id.ts @@ -713,12 +713,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Mode Sinkronisasi Vertikal - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -726,79 +746,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations Sinkronisasi Operasi Memori - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Aktifkan presentasi asinkron (hanya Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Meningkatkan kinerja sedikit dengan memindahkan presentasi ke thread CPU terpisah. - + Force maximum clocks (Vulkan only) Paksa jam maximum (Vulkan only) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Berjalan bekerja di latar belakang sambil menunggu perintah grafis untuk mencegah GPU agar tidak menurunkan kecepatan jamnya. - + Anisotropic Filtering: Anisotropic Filtering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: Mode GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Akurasi DMA - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -807,1302 +827,1291 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Gunakan kompilasi shader asinkron - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Gunakan pipeline cache Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Memungkinkan cache pipeline spesifik vendor GPU. Opsi ini dapat meningkatkan waktu pemuatan shader secara signifikan dalam kasus di mana driver Vulkan tidak menyimpan file cache pipeline secara internal. - + Enable Compute Pipelines (Intel Vulkan Only) Aktifkan Pipa Komputasi (Hanya Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Aktifkan Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Menggunakan pemadatan reaktif alih-alih pemadatan prediktif, memungkinkan sinkronisasi memori yang lebih akurat. - + Sync to framerate of video playback Sinkronkan dengan kecepatan pemutaran video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Jalankan permainan dengan kecepatan normal selama pemutaran video, bahkan ketika framerate tidak terkunci. - + Barrier feedback loops Loop umpan balik penghalang - + Improves rendering of transparency effects in specific games. Meningkatkan rendering efek transparansi dalam game tertentu. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects Perbaiki efek bloom - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading Pencahayaan Sampel - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Benih RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Nama Perangkat - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Tanggal RTC Kustom: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Bahasa - + This option can be overridden when region setting is auto-select - + Region: Wilayah: - + The region of the console. - + Time Zone: Zona Waktu: - + The time zone of the console. - + Sound Output Mode: Mode keluaran suara. - + Console Mode: Mode Konsol - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Konfirmasi sebelum menghentikan emulasi - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Sembunyikan mouse saat tidak aktif - + Hides the mouse after 2.5s of inactivity. - + Check for updates Cek Pembaruan - + Whether or not to check for updates upon startup. - + Enable Gamemode Aktifkan Mode Permainan - + Force X11 as Graphics Backend - + Custom frontend Tampilan depan kustom - + Real applet Aplikasi nyata - - + + Disabled - + Never Tidak Pernah - + On Load - + Always Selalu - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU sinkron - + Uncompressed (Best quality) Tidak terkompresi (Kualitas Terbaik) - + BC1 (Low quality) BC1 (Kualitas rendah) - + BC3 (Medium quality) BC3 (Kualitas sedang) - - + + Auto Otomatis - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Konservatif - + Aggressive Agresif - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast Cepat - - - + + + Accurate Akurat - - - + + + Default Bawaan - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced Seimbang - + Unsafe Berbahaya - + Paranoid (disables most optimizations) Paranoid (menonaktifkan sebagian besar optimasi) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Layar Tanpa Batas - + Exclusive Fullscreen Layar Penuh Eksklusif - + No Video Output Tidak ada Keluaran Suara - + CPU Video Decoding Penguraian Video menggunakan CPU - + GPU Video Decoding (Default) Penguraian Video menggunakan GPU (Bawaan) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EKSPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EKSPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EKSPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Biliner - + Bicubic Bikubik - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Tak ada - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Bawaan (16:9) - + Force 4:3 Paksa 4:3 - + Force 21:9 Paksa 21:9 - + Force 16:10 Paksa 16:10 - + Stretch to Window Regangkan ke Layar - + Automatic Otomatis - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Jepang (日本語) - + American English Bahasa Inggris Amerika - + French (français) Prancis (français) - + German (Deutsch) Jerman (Deutsch) - + Italian (italiano) Italia (italiano) - + Spanish (español) Spanyol (español) - + Chinese Cina - + Korean (한국어) Korea (한국어) - + Dutch (Nederlands) Belanda (Nederlands) - + Portuguese (português) Portugis (português) - + Russian (Русский) Rusia (Русский) - + Taiwanese Taiwan - + British English Inggris Britania - + Canadian French Prancis Kanada - + Latin American Spanish Spanyol Amerika Latin - + Simplified Chinese Cina Sederhana - + Traditional Chinese (正體中文) Cina Tradisional (正體中文) - + Brazilian Portuguese (português do Brasil) Portugis Brazil (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Jepang - + USA USA - + Europe Eropa - + Australia Australia - + China Tiongkok - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Bawaan (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Mesir - + Eire Éire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Éire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Iran - + Israel Israel - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polandia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turki - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Bawaan) - + 6GB DRAM (Unsafe) 6GB DRAM (Tidak Aman) - + 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Tidak Aman) - + 12GB DRAM (Unsafe) 12GB DRAM (Tidak Aman) - + Docked Terpasang - + Handheld Jinjing - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Selalu tanyakan (Bawaan) - + Only if game specifies not to stop Hanya jika permainan menentukan untuk tidak berhenti - + Never ask Jangan pernah bertanya - + Very Small (16 MB) Sangat Kecil (16 MB) - + Small (32 MB) Kecil (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Sedang (256) - + High (512) Tinggi (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/it.ts b/dist/languages/it.ts index 6315c384db..2cf9191129 100644 --- a/dist/languages/it.ts +++ b/dist/languages/it.ts @@ -730,12 +730,32 @@ La modalità aggressiva potrebbe impattare sulle prestazioni di altre applicazio Salta alcuni invalidamenti della cache durante gli aggiornamenti della memoria, riducendo l'uso della CPU e migliorando la latenza. Questo potrebbe causare soft-crash. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Modalità VSync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -746,12 +766,12 @@ Mailbox può avere una latenza minore di FIFO e non ha tearing ma potrebbe perde Immediate (no sincronizzazione) mostra tutto il disponibile, quindi anche tearing. - + Sync Memory Operations Sincronizza operazioni di memoria - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -760,68 +780,68 @@ Questa opzione dovrebbe risolvere problemi in alcuni giochi, ma potrebbe ridurre I giochi con Unreal Engine 4 sembrano essere i più colpiti. - + Enable asynchronous presentation (Vulkan only) Abilita la presentazione asincrona (solo Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Migliora di poco le prestazioni spostando la presentazione su un thread della CPU separato. - + Force maximum clocks (Vulkan only) Forza clock massimi (solo Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Esegue del lavoro in background durante l'attesa dei comandi grafici per evitare che la GPU diminuisca la sua velocità di clock. - + Anisotropic Filtering: Filtro anisotropico: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Controlla la qualità del rendering delle texture negli angoli obliqui. Si può utilizzare in modo sicuro al 16x su quasi tutte le GPU. - + GPU Mode: Modalità GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Precisione DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -830,89 +850,89 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Abilita la compilazione asincrona degli shader - + May reduce shader stutter. Può ridurre i fenomeni di stuttering (scatti) causati dagli shader. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Usa la cache delle pipeline di Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Abilita la cache delle pipeline specifica del produttore della GPU. Quest'opzione può ridurre di molto i tempi di caricamento degli shader nei casi in cui il driver Vulkan non memorizza la cache delle pipeline internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Abilita le compute pipeline (solo per Vulkan su Intel) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -921,192 +941,181 @@ Quest'impostazione esiste solo per i driver proprietari Intel e potrebbe fa Le compute pipelines sono sempre attivate su tutti gli altri drivers. - + Enable Reactive Flushing Abilita il flushing reattivo - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Utilizza il flushing reattivo invece di quello predittivo, al fine di ottenere una sincronizzazione della memoria più accurata. - + Sync to framerate of video playback Sincronizza il framerate a quello del video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Esegue il gioco a velocità normale durante le cutscene, anche quando il framerate è sbloccato. - + Barrier feedback loops Barrier feedback loops - + Improves rendering of transparency effects in specific games. Migliora il rendering degli effetti di trasparenza in alcuni giochi. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State Stato dinamico esteso - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Controlla il numero di funzionalità che possono essere usate con lo stato dinamico esteso. Gli stati più alti consentono più funzionalità e possono migliorare le prestazioni, ma possono causare ulteriori problemi grafici. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading Sample shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permette al fragment shader di eseguire per campione in un frammento multi-campione invece che una volta per frammento. Migliora la qualità grafica a scapito delle prestazioni. Alti valori migliorano la qualità ma peggiorano le prestazioni. - + RNG Seed Seed RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Controlla il seme del generatore di numeri casuali. Principalmente utilizzato per le speedrun. - + Device Name Nome del dispositivo - + The name of the console. Il nome della console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Data RTC personalizzata: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Quest'opzione permette di modificare l'orologio della console. Può essere usato per manipolare il tempo nei giochi. - + The number of seconds from the current unix time Il numero di secondi dal tempo Unix attuale - + Language: Lingua: - + This option can be overridden when region setting is auto-select Può essere rimpiazzato se il fuso orario della Regione è impostato su Auto - + Region: Regione: - + The region of the console. La regione della console. - + Time Zone: Fuso orario: - + The time zone of the console. Il fuso orario della console. - + Sound Output Mode: Modalità di output del suono: - + Console Mode: Modalità console: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1115,1026 +1124,1026 @@ I giochi ne terranno conto e modificheranno la risoluzione, i dettagli e i contr Impostare l'opzione su "Portatile" può aiutare a migliorare le prestazioni sui sistemi meno potenti. - + Prompt for user profile on boot Scegli il profilo utente all'avvio - + Useful if multiple people use the same PC. Utile se più persone utilizzano lo stesso PC. - + Pause when not in focus Metti in pausa quando la finestra non è in primo piano - + Pauses emulation when focusing on other windows. Mette in pausa l'emulazione quando altre finestre sono in primo piano. - + Confirm before stopping emulation Chiedi conferma prima di arrestare l'emulazione - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Sovrascrive le richieste di conferma per fermare l'emulazione. Abilitarla bypassa queste richieste e l'emulazione cesserà immediatamente. - + Hide mouse on inactivity Nascondi il puntatore del mouse se inattivo - + Hides the mouse after 2.5s of inactivity. Nasconde il mouse dopo 2,5 secondi di inattività. - + Check for updates Controlla la presenza di aggiornamenti - + Whether or not to check for updates upon startup. Determina se controllare o meno la presenza di aggiornamenti all'avvio. - + Enable Gamemode Abilita Gamemode - + Force X11 as Graphics Backend Forza l'uso del back-end grafico X11 - + Custom frontend Frontend personalizzato - + Real applet Applet reale - - + + Disabled Disabilitato - + Never Mai - + On Load Al caricamento - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU (Asincrono) - + Uncompressed (Best quality) Nessuna compressione (qualità migliore) - + BC1 (Low quality) BC1 (qualità bassa) - + BC3 (Medium quality) BC3 (qualità media) - - + + Auto Automatico - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservativa - + Aggressive Aggressiva - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (shader assembly, solo NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (sperimentale, solo AMD/MESA) - + Null Nullo - + Fast Veloce - - - + + + Accurate Accurata - - - + + + Default Predefinito - + Unsafe (fast) Non sicuro (veloce) - + Safe (stable) Sicuro (stabile) - + Immediate - + Balanced Bilanciata - + Unsafe Non sicura - + Paranoid (disables most optimizations) Paranoica (disabilita la maggior parte delle ottimizzazioni) - + Debugging Debug - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Finestra senza bordi - + Exclusive Fullscreen Schermo intero esclusivo - + No Video Output Nessun output video - + CPU Video Decoding Decodifica video CPU - + GPU Video Decoding (Default) Decodifica video GPU (predefinita) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [SPERIMENTALE] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [SPERIMENTALE] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [SPERIMENTALE] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [SPERIMENTALE] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [SPERIMENTALE] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest neighbor - + Bilinear Bilineare - + Bicubic Bicubico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nessuna - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Predefinito (16:9) - + Force 4:3 Forza 4:3 - + Force 21:9 Forza 21:9 - + Force 16:10 Forza 16:10 - + Stretch to Window Allunga a finestra - + Automatic Automatico - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Giapponese (日本語) - + American English Inglese americano - + French (français) Francese (français) - + German (Deutsch) Tedesco (Deutsch) - + Italian (italiano) Italiano - + Spanish (español) Spagnolo (español) - + Chinese Cinese - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Olandese (Nederlands) - + Portuguese (português) Portoghese (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanese - + British English Inglese britannico - + Canadian French Francese canadese - + Latin American Spanish Spagnolo latino-americano - + Simplified Chinese Cinese semplificato - + Traditional Chinese (正體中文) Cinese tradizionale (正體中文) - + Brazilian Portuguese (português do Brasil) Portoghese brasiliano (português do Brasil) - + Polish (polska) Polacco (polska) - + Thai (แบบไทย) Thailandese (แบบไทย) - - + + Japan Giappone - + USA USA - + Europe Europa - + Australia Australia - + China Cina - + Korea Corea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Automatico (%1) - + Default (%1) Default time zone Predefinito (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egitto - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islanda - + Iran Iran - + Israel Israele - + Jamaica Giamaica - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polonia - + Portugal Portogallo - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turchia - + UCT UCT - + Universal Universale - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Predefinito) - + 6GB DRAM (Unsafe) 6GB DRAM (Non sicuro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Non sicuro) - + 12GB DRAM (Unsafe) 12GB DRAM (Non sicuro) - + Docked Dock - + Handheld Portatile - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Chiedi sempre (Predefinito) - + Only if game specifies not to stop Solo se il gioco richiede di non essere arrestato - + Never ask Non chiedere mai - + Very Small (16 MB) Molto piccola (16 MB) - + Small (32 MB) Piccola (32 MB) - + Normal (128 MB) Normale (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Molto grande (512 MB) - + Very Low (4 MB) Molto bassa (4 MB) - + Low (8 MB) Bassa (8 MB) - + Normal (16 MB) Normale (16 MB) - + Medium (32 MB) Media (32 MB) - + High (64 MB) Alta (64 MB) - + Very Low (32) Molto basso (32) - + Low (64) Basso (64) - + Normal (128) Normale (128) - + Medium (256) Medio (256) - + High (512) Alto (512) - + ExtendedDynamicState 1 Stato dinamico esteso 1 - + ExtendedDynamicState 2 Stato dinamico esteso 2 - + ExtendedDynamicState 3 Stato dinamico esteso 3 - + Tree View Vista ad albero - + Grid View Vista a griglia diff --git a/dist/languages/ja_JP.ts b/dist/languages/ja_JP.ts index c7eb268ca0..2341618395 100644 --- a/dist/languages/ja_JP.ts +++ b/dist/languages/ja_JP.ts @@ -696,12 +696,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: 垂直同期: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -712,79 +732,79 @@ Mailbox は FIFO よりも遅延が小さくティアリングがありません Immediate (no synchronization) は表示可能なものをすべて表示し, ティアリング発生の可能性があります. - + Sync Memory Operations メモリ操作の同期 - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) 非同期プレゼンテーション (Vulkan のみ) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) 最大クロック強制 (Vulkan のみ) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. GPUのクロックスピードを下げないように、グラフィックコマンドを待っている間、バックグラウンドで作業を実行させます。 - + Anisotropic Filtering: 異方性フィルタリング: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: GPUモード: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: DMA精度: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -793,1301 +813,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Vulkan パイプラインキャッシュを使用 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) コンピュート・パイプラインの有効化(インテル Vulkan のみ) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback ビデオ再生のフレームレートに同期する - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. 特定のゲームにおける透明エフェクトのレンダリングを改善します。 - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed 乱数シード値の変更 - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name デバイス名 - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: 言語: - + This option can be overridden when region setting is auto-select - + Region: 地域: - + The region of the console. - + Time Zone: タイムゾーン: - + The time zone of the console. - + Sound Output Mode: 音声出力モード: - + Console Mode: コンソールモード: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation エミュレーションを停止する前に確認する - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity 非アクティブ時にマウスカーソルを隠す - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled 無効 - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 非同期 - + Uncompressed (Best quality) 圧縮しない (最高品質) - + BC1 (Low quality) BC1 (低品質) - + BC3 (Medium quality) BC3 (中品質) - - + + Auto 自動 - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (アセンブリシェーダー、NVIDIA のみ) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V(実験的、AMD/Mesaのみ) - + Null - + Fast - - - + + + Accurate 正確 - - - + + + Default デフォルト - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe 不安定 - + Paranoid (disables most optimizations) パラノイド (ほとんどの最適化を無効化) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed ボーダーレスウィンドウ - + Exclusive Fullscreen 排他的フルスクリーン - + No Video Output ビデオ出力しない - + CPU Video Decoding ビデオをCPUでデコード - + GPU Video Decoding (Default) ビデオをGPUでデコード (デフォルト) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [実験的] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [実験的] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [実験的] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area - + MMPX MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None なし - + FXAA FXAA - + SMAA SMAA - + Default (16:9) デフォルト (16:9) - + Force 4:3 強制 4:3 - + Force 21:9 強制 21:9 - + Force 16:10 強制 16:10 - + Stretch to Window ウィンドウに合わせる - + Automatic 自動 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日本語 - + American English アメリカ英語 - + French (français) フランス語 (français) - + German (Deutsch) ドイツ語 (Deutsch) - + Italian (italiano) イタリア語 (italiano) - + Spanish (español) スペイン語 (español) - + Chinese 中国語 - + Korean (한국어) 韓国語 (한국어) - + Dutch (Nederlands) オランダ語 (Nederlands) - + Portuguese (português) ポルトガル語 (português) - + Russian (Русский) ロシア語 (Русский) - + Taiwanese 台湾語 - + British English イギリス英語 - + Canadian French カナダフランス語 - + Latin American Spanish ラテンアメリカスペイン語 - + Simplified Chinese 簡体字中国語 - + Traditional Chinese (正體中文) 繁体字中国語 (正體中文) - + Brazilian Portuguese (português do Brasil) ブラジルポルトガル語 (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan 日本 - + USA アメリカ - + Europe ヨーロッパ - + Australia オーストラリア - + China 中国 - + Korea 韓国 - + Taiwan 台湾 - + Auto (%1) Auto select time zone 自動 (%1) - + Default (%1) Default time zone 既定 (%1) - + CET 中央ヨーロッパ時間 - + CST6CDT CST6CDT - + Cuba キューバ - + EET 東ヨーロッパ標準時 - + Egypt エジプト - + Eire アイルランド - + EST アメリカ東部標準時 - + EST5EDT EST5EDT - + GB GB - + GB-Eire イギリス-アイルランド - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich グリニッジ - + Hongkong 香港 - + HST ハワイ標準時 - + Iceland アイスランド - + Iran イラン - + Israel イスラエル - + Jamaica ジャマイカ - + Kwajalein クェゼリン - + Libya リビア - + MET 中東時間 - + MST MST - + MST7MDT MST7MDT - + Navajo ナバホ - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland ポーランド - + Portugal ポルトガル - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore シンガポール - + Turkey トルコ - + UCT UCT - + Universal ユニバーサル - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu ズールー - + Mono モノラル - + Stereo ステレオ - + Surround サラウンド - + 4GB DRAM (Default) 4GB DRAM (デフォルト) - + 6GB DRAM (Unsafe) 6GB DRAM (不安定) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld 携帯モード - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) 常に確認する (デフォルト) - + Only if game specifies not to stop ゲームが停止しないように指定しているときのみ - + Never ask 確認しない - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/ko_KR.ts b/dist/languages/ko_KR.ts index a6d39cf213..c78a853a20 100644 --- a/dist/languages/ko_KR.ts +++ b/dist/languages/ko_KR.ts @@ -733,12 +733,32 @@ Aggressive mode may impact performance of other applications such as recording s 메모리 업데이트 중 특정 캐시 무효화를 건너뛰어 CPU 사용량을 줄이고 지연 시간을 개선합니다. 하지만 이로 인해 소프트 크래시가 발생할 수 있습니다. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: 수직 동기화 모드: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -749,12 +769,12 @@ Mailbox는 FIFO보다 지연 시간이 짧고 화면 찢김 현상이 없지만 즉각적(동기화 없음)는 사용 가능한 모든 화면을 표시하며 화면 찢김 현상이 발생할 수 있습니다. - + Sync Memory Operations 메모리 작업 동기화 - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -763,44 +783,44 @@ Unreal Engine 4 games often see the most significant changes thereof. 대개 언리얼 엔진 4 게임에서 이러한 변경 사항이 가장 두드러지게 나타납니다. - + Enable asynchronous presentation (Vulkan only) 비동기 프레젠테이션 활성화(Vulkan 전용) - + Slightly improves performance by moving presentation to a separate CPU thread. 프레젠테이션을 별도의 CPU 스레드로 이동시켜 성능을 약간 향상시킵니다. - + Force maximum clocks (Vulkan only) 최대 클럭 강제 적용(Vulkan 전용) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. 그래픽 명령을 기다리는 동안 백그라운드에서 작업을 실행하여 GPU 클럭 속도가 저하되는 것을 방지합니다. - + Anisotropic Filtering: 비등방성 필터링: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. 비스듬한 각도에서의 텍스처 렌더링 품질을 제어합니다. 대부분의 GPU에서 16x로 설정해도 안전합니다. - + GPU Mode: GPU 모드: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -809,12 +829,12 @@ Particles tend to only render correctly with Accurate mode. 특히 조각들은 정확 모드에서만 제대로 렌더링되는 경향이 있습니다. - + DMA Accuracy: DMA 정확도: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -823,12 +843,12 @@ Default follows the GPU Accuracy setting. 기본값은 GPU 정확도 설정을 따릅니다. - + GPU Fence Behavior: GPU 펜스 동작: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -837,44 +857,44 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation 비동기 셰이더 컴파일 활성화 - + May reduce shader stutter. 셰이더 끊김 현상을 줄일 수 있습니다. - + GPU Clocks GPU 클럭 - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. 게임이 GPU 작업이 실제보다 더 빨리 완료된다고 착각하게 만들어, 스위치의 클럭 속도에 맞추기 위해 해상도와 렌더 거리를 낮추는 작업을 중단하게 합니다. - + GPU Unswizzle GPU 언스위즐 - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. GPU 컴퓨팅을 사용하여 BCn 3D 텍스처 디코딩을 가속화합니다. 충돌이나 그래픽 결함이 발생하는 경우 이 기능을 비활성화하세요. - + GPU Unswizzle Max Texture Size GPU 언스위즐 최대 텍스처 크기 - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -883,48 +903,48 @@ GPU는 중간 및 큰 크기의 텍스처에서 더 빠르지만, 매우 작은 이 값을 조정하여 GPU 가속과 CPU 오버헤드 간의 균형을 찾으세요. - + GPU Unswizzle Stream Size GPU 언스위즐 스트림 크기 - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. 프레임당 처리할 최대 텍스처 데이터 양(MiB 단위)을 설정합니다. 값이 높을수록 텍스처 로딩 중 끊김 현상을 줄일 수 있지만 프레임 일관성에 영향을 미칠 수 있습니다. - + GPU Unswizzle Chunk Size GPU 언스위즐 청크 크기 - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. 단일 디스패치에서 처리할 깊이 슬라이스 수를 결정합니다. 이 값을 높이면 고성능 GPU에서 처리량이 향상될 수 있지만, 성능이 낮은 하드웨어에서는 TDR 오류나 드라이버 시간 초과가 발생할 수 있습니다. - + Use Vulkan pipeline cache Vulkan 파이프라인 캐시 사용 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. GPU 제조사별 파이프라인 캐시를 활성화합니다. 이 옵션은 Vulkan 드라이버가 파이프라인 캐시 파일을 내부에 저장하지 않는 경우 셰이더 로딩 시간을 크게 향상시킬 수 있습니다. - + Enable Compute Pipelines (Intel Vulkan Only) 컴퓨트 파이프라인 활성화(인텔 Vulkan 전용) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -933,194 +953,182 @@ Compute pipelines are always enabled on all other drivers. 다른 모든 드라이버에서는 컴퓨트 파이프라인이 항상 활성화됩니다. - + Enable Reactive Flushing 반응형 플러싱 활성화 - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. 예측형 플러싱 대신 반응형 플러싱을 사용하여 보다 정확한 메모리 동기화를 가능하게 합니다. - + Sync to framerate of video playback 비디오 재생 프레임 속도에 동기화 - + Run the game at normal speed during video playback, even when the framerate is unlocked. 프레임률 제한이 해제된 경우에도 비디오 재생 중에는 게임을 정상 속도로 실행합니다. - + Barrier feedback loops 피드백 루프 차단 - + Improves rendering of transparency effects in specific games. 특정 게임에서 투명 효과 렌더링을 개선합니다. - + Enable buffer history 버퍼 기록 활성화 - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. 이전 버퍼 상태에 접근할 수 있도록 합니다. 이 옵션은 일부 게임에서 렌더링 품질과 성능 일관성을 향상시킬 수 있습니다. - + Fix bloom effects 블룸 효과 수정 - + Removes bloom in Burnout. Burnout에서의 블룸 현상을 제거합니다. - - Enable Legacy Rescale Pass - 기존 크기 조정 무시 활성화 - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - 이전 구현의 동작을 활용하여 일부 게임에서 발생하는 크기 조정 문제를 해결할 수 있습니다. -루이지 맨션 3에서 발생했던 AMD 및 인텔 GPU의 선 아티팩트 현상과 Nvidia GPU의 회색 텍스처 깜빡임 현상을 해결하는 기존 반응에 대한 예비 해결책입니다. - - - + Extended Dynamic State 확장된 동적 상태 - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. 확장된 동적 상태에서 사용할 수 있는 기능의 수를 제어합니다. 상태 수가 많을수록 더 많은 기능을 사용할 수 있고 성능이 향상될 수 있지만, 추가적인 그래픽 문제가 발생할 수 있습니다. - + Vertex Input Dynamic State 정점 입력 동적 상태 - + Enables vertex input dynamic state feature for better quality and performance. 정점 입력의 동적 상태 기능을 활성화하여 품질과 성능을 향상시킵니다. - + Sample Shading 샘플 셰이딩 - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. 조각 셰이더가 다중샘플 조각에서 한 번당 한 조각이 아닌 샘플별로 실행될 수 있도록 합니다. 성능 저하를 감수하고 그래픽 품질을 향상시킵니다. 값이 높을수록 품질은 향상되지만 성능은 저하됩니다. - + RNG Seed RNG 시드 - + Controls the seed of the random number generator. Mainly used for speedrunning. 난수 생성기의 시드 값을 제어합니다. 주로 스피드런에 사용됩니다. - + Device Name 장치 이름 - + The name of the console. 콘솔의 이름 - + Homebrew Args 홈브루 인수 - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). 홈브루 실행 시 전달되는 명령줄 인수(예: -noglsl). - + Custom RTC Date: 사용자 지정 RTC 날짜: - + This option allows to change the clock of the console. Can be used to manipulate time in games. 이 옵션을 사용하면 콘솔의 시간을 변경할 수 있습니다. 게임 내 시간을 조작하는 데 사용할 수 있습니다. - + The number of seconds from the current unix time 현재 unix 시간으로부터 경과한 초 수 - + Language: 언어: - + This option can be overridden when region setting is auto-select 이 옵션은 지역 설정이 자동 선택으로 되어 있을 경우 번복될 수 있습니다. - + Region: 지역: - + The region of the console. 콘솔의 지역 - + Time Zone: 시간대: - + The time zone of the console. 콘솔의 시간대 - + Sound Output Mode: 소리 출력 모드: - + Console Mode: 콘솔 모드: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1129,1026 +1137,1026 @@ Setting to Handheld can help improve performance for low end systems. 휴대 모드로 설정하면 저사양 시스템의 성능을 향상시키는 데 도움이 될 수 있습니다. - + Prompt for user profile on boot 부팅 시 유저 프로필 입력 요청 - + Useful if multiple people use the same PC. 여러 사람이 같은 PC를 사용할 때 유용합니다. - + Pause when not in focus 초점이 맞지 않을 때 일시 중지 - + Pauses emulation when focusing on other windows. 다른 창에 초점을 맞출 때 에뮬레이션을 일시 중지합니다. - + Confirm before stopping emulation 에뮬레이션을 중지하기 전에 확인 - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. 에뮬레이션 중지를 확인하는 메시지를 무시합니다. 이 옵션을 활성화하면 이러한 메시지를 건너뛰고 에뮬레이션을 바로 종료합니다. - + Hide mouse on inactivity 마우스 커서가 비활동 상태일 때 숨기기 - + Hides the mouse after 2.5s of inactivity. 마우스 커서가 2.5초 동안 활동이 없으면 숨깁니다. - + Check for updates 업데이트 확인 - + Whether or not to check for updates upon startup. 시작 시 업데이트를 확인할지 여부. - + Enable Gamemode 게임 모드 활성화 - + Force X11 as Graphics Backend X11을 그래픽 백엔드로 강제 설정 - + Custom frontend 사용자 정의 프론트엔드 - + Real applet 실제 애플릿 - - + + Disabled 비활성화됨 - + Never 안 함 - + On Load 로드 시 - + Always 항상 - + CPU CPU - + GPU GPU - + CPU Asynchronous 비동기 CPU - + Uncompressed (Best quality) 비압축(최고 품질) - + BC1 (Low quality) BC1(저품질) - + BC3 (Medium quality) BC3(중간 품질) - - + + Auto 자동 - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative 소극적 - + Aggressive 적극적 - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM(어셈블리 셰이더, NVIDIA 전용) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V(실험적, AMD/Mesa 전용) - + Null Null - + Fast 고속 - - - + + + Accurate 정확 - - - + + + Default 기본값 - + Unsafe (fast) 불안전(빠름) - + Safe (stable) 안전(안정적) - + Immediate 즉시 - + Balanced 균형 - + Unsafe 불안전 - + Paranoid (disables most optimizations) 편집증적(대부분의 최적화를 비활성화함) - + Debugging 디버깅 - + Dynarmic 동적 - + NCE NCE - + Borderless Windowed 테두리 없는 창 - + Exclusive Fullscreen 독점 전체 화면 - + No Video Output 비디오 출력 없음 - + CPU Video Decoding CPU 비디오 디코딩 - + GPU Video Decoding (Default) GPU 비디오 디코딩(기본값) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [실험적] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [실험적] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [실험적] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [실험적] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [실험적] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 최단입점 - + Bilinear 쌍선형 - + Bicubic 쌍입방 - + Gaussian 가우시안 - + Lanczos 란초스 - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area 영역 - + MMPX MMPX - + Zero-Tangent 제로탄젠트 - + B-Spline B-스플라인 - + Mitchell 미첼 - + Spline-1 스플라인-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None 없음 - + FXAA FXAA - + SMAA SMAA - + Default (16:9) 기본(16:9) - + Force 4:3 강제 4:3 - + Force 21:9 강제 21:9 - + Force 16:10 강제 16:10 - + Stretch to Window 화면 늘리기 - + Automatic 자동 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 일본어(日本語) - + American English 미국식 영어 - + French (français) 프랑스어(français) - + German (Deutsch) 독일어(Deutsch) - + Italian (italiano) 이탈리아어(italiano) - + Spanish (español) 스페인어(español) - + Chinese 중국어 - + Korean (한국어) 한국어(Korean) - + Dutch (Nederlands) 네덜란드어(Nederlands) - + Portuguese (português) 포르투갈어(português) - + Russian (Русский) 러시아어(Русский) - + Taiwanese 대만어 - + British English 영국식 영어 - + Canadian French 캐나다 프랑스어 - + Latin American Spanish 라틴아메리카 스페인어 - + Simplified Chinese 중국어 간체 - + Traditional Chinese (正體中文) 중국어 번체(正體中文) - + Brazilian Portuguese (português do Brasil) 브라질 포르투갈어(português do Brasil) - + Polish (polska) 폴란드어(polska) - + Thai (แบบไทย) 태국어(แบบไทย) - - + + Japan 일본 - + USA 미국 - + Europe 유럽 - + Australia 호주 - + China 중국 - + Korea 대한민국 - + Taiwan 대만 - + Auto (%1) Auto select time zone 자동(%1) - + Default (%1) Default time zone 기본(%1) - + CET CET - + CST6CDT CST6CDT - + Cuba 쿠바 - + EET EET - + Egypt 이집트 - + Eire 아일랜드 - + EST EST - + EST5EDT EST5EDT - + GB 영국 - + GB-Eire 영국-아일랜드 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 그리니치 - + Hongkong 홍콩 - + HST HST - + Iceland 아이슬란드 - + Iran 이란 - + Israel 이스라엘 - + Jamaica 자메이카 - + Kwajalein 콰잘레인 - + Libya 리비아 - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo 나바호 - + NZ 뉴질랜드 - + NZ-CHAT 뉴질랜드-채텀 - + Poland 폴란드 - + Portugal 포르투갈 - + PRC 중국 - + PST8PDT PST8PDT - + ROC 대만 - + ROK 대한민국 - + Singapore 싱가포르 - + Turkey 터키 - + UCT UCT - + Universal 세계 - + UTC UTC - + W-SU 모스크바 - + WET WET - + Zulu Zulu - + Mono 모노 - + Stereo 스테레오 - + Surround 서라운드 - + 4GB DRAM (Default) 4GB DRAM(기본값) - + 6GB DRAM (Unsafe) 6GB DRAM(불안전) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM(불안전) - + 12GB DRAM (Unsafe) 12GB DRAM(불안전) - + Docked 독 모드 - + Handheld 휴대 모드 - - + + Normal 보통 - - + + Boost 부스트 - - + + Overclock 오버클럭 - + Always ask (Default) 항상 묻기(기본값) - + Only if game specifies not to stop 게임에서 멈추지 말라고 명시한 경우에만 - + Never ask 절대 묻지 않음 - + Very Small (16 MB) 아주 작은 크기(16 MB) - + Small (32 MB) 작은 크기(32 MB) - + Normal (128 MB) 보통 크기(128 MB) - + Large (256 MB) 큰 크기(256 MB) - + Very Large (512 MB) 아주 큰 크기(512 MB) - + Very Low (4 MB) 매우 낮은 크기(4 MB) - + Low (8 MB) 낮은 크기(8 MB) - + Normal (16 MB) 보통 크기(16 MB) - + Medium (32 MB) 중간 크기(32 MB) - + High (64 MB) 높은 크기(64 MB) - + Very Low (32) 매우 낮은 크기(32) - + Low (64) 낮은 크기(64) - + Normal (128) 보통 크기(128) - + Medium (256) 보통(256) - + High (512) 빠름(512) - + ExtendedDynamicState 1 확장된 동적 상태 1 - + ExtendedDynamicState 2 확장된 동적 상태 2 - + ExtendedDynamicState 3 확장된 동적 상태 3 - + Tree View 트리 보기 - + Grid View 격자 보기 diff --git a/dist/languages/nb.ts b/dist/languages/nb.ts index 5e5edb0006..191099c395 100644 --- a/dist/languages/nb.ts +++ b/dist/languages/nb.ts @@ -696,12 +696,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: VSync-modus: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -709,79 +729,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Aktiver asynkron presentasjon (kun Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) Tving maksikal klokkehastighet (kun Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Kjører arbeid i bakgrunnen mens den venter på grafikkommandoer for å forhindre at GPU-en senker klokkehastigheten. - + Anisotropic Filtering: Anisotropisk filtrering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: GPU-modus: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: DMA-nøyaktighet: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -790,1301 +810,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Bruk Vulkan-rørledningsbuffer - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Aktiver Reaktiv Tømming - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback Synkroniser med bildefrekvensen for videoavspilling - + Run the game at normal speed during video playback, even when the framerate is unlocked. Kjør spillet i normal hastighet under videoavspilling, selv når bildefrekvensen er låst opp. - + Barrier feedback loops Tilbakekoblingssløyfer for barrierer - + Improves rendering of transparency effects in specific games. Forbedrer gjengivelsen av transparenseffekter i spesifikke spill. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG-frø - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Enhetsnavn - + The name of the console. Konsollens navn. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Selvvalgt RTC-dato: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Språk: - + This option can be overridden when region setting is auto-select - + Region: Region: - + The region of the console. Konsollens region. - + Time Zone: Tidssone: - + The time zone of the console. Konsollens tidssone. - + Sound Output Mode: Lydutdatamodus: - + Console Mode: Konsollmodus: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Bekreft før stopping av emulering - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Gjem mus under inaktivitet - + Hides the mouse after 2.5s of inactivity. - + Check for updates Se etter oppdateringer - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled Skrudd av - + Never Aldri - + On Load - + Always Alltid - + CPU CPU - + GPU Skjermkort - + CPU Asynchronous - + Uncompressed (Best quality) Ukomprimert (Best kvalitet) - + BC1 (Low quality) BC1 (Lav kvalitet) - + BC3 (Medium quality) BC3 (Middels kvalitet) - - + + Auto Auto - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (eksperimentelt, kun AMD/Mesa) - + Null Null - + Fast Rask - - - + + + Accurate Nøyaktig - - - + + + Default Standard - + Unsafe (fast) Utrygg (raskt) - + Safe (stable) Trygg (stabil) - + Immediate - + Balanced Balansert - + Unsafe Utrygt - + Paranoid (disables most optimizations) Paranoid (deaktiverer de fleste optimaliseringer) - + Debugging - + Dynarmic - + NCE NCE - + Borderless Windowed Rammeløst vindu - + Exclusive Fullscreen Eksklusiv fullskjerm - + No Video Output Ingen videoutdata - + CPU Video Decoding CPU-videodekoding - + GPU Video Decoding (Default) GPU-videodekoding (Standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0,25× (180p/270p) [EKSPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5× (360p/540p) [EKSPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0,75× (540p/810p) [EKSPERIMENTELL] - + 1X (720p/1080p) 1× (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1,25× (900p/1350p) [EKSPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1,5× (1080p/1620p) [EKSPERIMENTELL] - + 2X (1440p/2160p) 2× (1440p/2160p) - + 3X (2160p/3240p) 3× (2160p/3240p) - + 4X (2880p/4320p) 4× (2880p/4320p) - + 5X (3600p/5400p) 5× (3600p/5400p) - + 6X (4320p/6480p) 6× (4320p/6480p) - + 7X (5040p/7560p) 7× (5040p/7560p) - + 8X (5760p/8640p) 8× (5760p/8640p) - + Nearest Neighbor Nærmeste nabo - + Bilinear Bilineær - + Bicubic Bikubisk - + Gaussian Gaussisk - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Område - + MMPX MMPX - + Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tving 4:3 - + Force 21:9 Tving 21:9 - + Force 16:10 Tving 16:10 - + Stretch to Window Strekk til vinduet - + Automatic Automatisk - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japansk (日本語) - + American English Amerikansk engelsk - + French (français) Fransk (français) - + German (Deutsch) Tysk (Deutsch) - + Italian (italiano) Italiensk (italiano) - + Spanish (español) Spansk (español) - + Chinese Kinesisk - + Korean (한국어) Koreansk (한국어) - + Dutch (Nederlands) Nederlandsk (Nederlands) - + Portuguese (português) Portugisisk (português) - + Russian (Русский) Russisk (Русский) - + Taiwanese Taiwansk - + British English Britisk engelsk - + Canadian French Kanadisk fransk - + Latin American Spanish Latinamerikansk spansk - + Simplified Chinese Forenklet kinesisk - + Traditional Chinese (正體中文) Tradisjonell kinesisk (正體中文) - + Brazilian Portuguese (português do Brasil) Brasiliansk portugisisk (português do Brasil) - + Polish (polska) Polsk (polska) - + Thai (แบบไทย) Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australia - + China Folkerepublikken Kina - + Korea Korea - + Taiwan Taiwan (Republikken Kina) - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standard (%1) - + CET Sentraleuropeisk tid - + CST6CDT CST6CDT - + Cuba Cuba - + EET Østeuropeisk tid - + Egypt Egypt - + Eire Republikken Irland - + EST EST - + EST5EDT EST5EDT - + GB Storbritannia - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC Folkerepublikken Kina - + PST8PDT PST8PDT - + ROC Taiwan (Republikken Kina) - + ROK Sør-Korea - + Singapore Singapore - + Turkey Tyrkia - + UCT UCT - + Universal Universalt - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (Standard) - + 6GB DRAM (Unsafe) 6 GB DRAM (Utrygt) - + 8GB DRAM 8 GB DRAM - + 10GB DRAM (Unsafe) 10 GB DRAM (Utrygt) - + 12GB DRAM (Unsafe) 12 GB DRAM (Utrygt) - + Docked I dokking - + Handheld Håndholdt - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Spør alltid (Standard) - + Only if game specifies not to stop - + Never ask Aldri spør - + Very Small (16 MB) Veldig liten (16 MB) - + Small (32 MB) Liten (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Stor (256 MB) - + Very Large (512 MB) Veldig stor (512 MB) - + Very Low (4 MB) Veldig lav (4 MB) - + Low (8 MB) Lav (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Middels (32 MB) - + High (64 MB) Høy (64 MB) - + Very Low (32) Svært lav (32) - + Low (64) Lav (64) - + Normal (128) Normal (128) - + Medium (256) Middels (256) - + High (512) Høy (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/nl.ts b/dist/languages/nl.ts index 296dd3ebca..8e99ce56d4 100644 --- a/dist/languages/nl.ts +++ b/dist/languages/nl.ts @@ -703,12 +703,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: VSync-modus: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -716,79 +736,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Schakel asynchrone presentatie in (alleen Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) Forceer maximale klokken (alleen Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Werkt op de achtergrond terwijl er wordt gewacht op grafische opdrachten om te voorkomen dat de GPU zijn kloksnelheid verlaagt. - + Anisotropic Filtering: Anisotrope Filtering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -797,1301 +817,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Gebruik Vulkan-pijplijn-cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Schakel Reactive Flushing In - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback - + Run the game at normal speed during video playback, even when the framerate is unlocked. - + Barrier feedback loops - + Improves rendering of transparency effects in specific games. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed RNG Seed - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Apparaatnaam - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Aangepaste RTC Datum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Taal: - + This option can be overridden when region setting is auto-select - + Region: Regio: - + The region of the console. - + Time Zone: Tijdzone: - + The time zone of the console. - + Sound Output Mode: Geluidsuitvoermodus: - + Console Mode: Console Modus: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Bevestig voordat u de emulatie stopt - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Verberg muis wanneer inactief - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) - + BC1 (Low quality) BC1 (Lage Kwaliteit) - + BC3 (Medium quality) BC3 (Gemiddelde kwaliteit) - - + + Auto Auto - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Accuraat - - - + + + Default Standaard - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Onveilig - + Paranoid (disables most optimizations) Paranoid (schakelt de meeste optimalisaties uit) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Randloos Venster - + Exclusive Fullscreen Exclusief Volledig Scherm - + No Video Output Geen Video-uitvoer - + CPU Video Decoding CPU Videodecodering - + GPU Video Decoding (Default) GPU Videodecodering (Standaard) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTEEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTEEL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Geen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standaart (16:9) - + Force 4:3 Forceer 4:3 - + Force 21:9 Forceer 21:9 - + Force 16:10 Forceer 16:10 - + Stretch to Window Uitrekken naar Venster - + Automatic Automatisch - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japans (日本語) - + American English Amerikaans-Engels - + French (français) Frans (Français) - + German (Deutsch) Duits (Deutsch) - + Italian (italiano) Italiaans (italiano) - + Spanish (español) Spaans (Español) - + Chinese Chinees - + Korean (한국어) Koreaans (한국어) - + Dutch (Nederlands) Nederlands (Nederlands) - + Portuguese (português) Portugees (português) - + Russian (Русский) Russisch (Русский) - + Taiwanese Taiwanese - + British English Brits-Engels - + Canadian French Canadees-Frans - + Latin American Spanish Latijns-Amerikaans Spaans - + Simplified Chinese Vereenvoudigd Chinees - + Traditional Chinese (正體中文) Traditioneel Chinees (正體中文) - + Brazilian Portuguese (português do Brasil) Braziliaans-Portugees (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australië - + China China - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standaard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egypte - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Ijsland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libië - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turkije - + UCT UCT - + Universal Universeel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/pl.ts b/dist/languages/pl.ts index 4b94ca5e55..28a51ae4f8 100644 --- a/dist/languages/pl.ts +++ b/dist/languages/pl.ts @@ -729,12 +729,32 @@ Tryb agresywny może pogorszyć działanie innych aplikacji, np. oprogramowania Pomija niektóre unieważnienia pamięci podręcznej po stronie CPU podczas aktualizacji pamięci, zmniejszając użycie CPU i poprawiając jego wydajność. Może powodować błędy lub awarie w niektórych grach. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Tryb synchronizacji pionowej: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -745,12 +765,12 @@ Mailbox może mieć niższe opóźnienia niż FIFO i nie powoduje tearingu, ale Immediate (bez synchronizacji) wyświetla wszystko, co jest dostępne, i może powodować tearing. - + Sync Memory Operations Synchronizuj operacje pamięci - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -758,68 +778,68 @@ Unreal Engine 4 games often see the most significant changes thereof. Gry z Unreal Engine 4 mogą być najbardziej dotknięte. - + Enable asynchronous presentation (Vulkan only) Włącz asynchroniczną prezentację (tylko Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Nieznacznie poprawia wydajność, przenosząc prezentację na oddzielny wątek CPU. - + Force maximum clocks (Vulkan only) Wymuś maksymalne zegary (Tylko Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Uruchamia pracę w tle podczas oczekiwania na komendy graficzne aby GPU nie obniżało taktowania. - + Anisotropic Filtering: Filtrowanie anizotropowe: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Steruje jakością renderowania tekstur pod ostrymi kątami. Na większości GPU bezpieczną wartością jest 16x. - + GPU Mode: Tryb GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Dokładność DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -828,89 +848,89 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Włącz asynchroniczną kompilację shaderów - + May reduce shader stutter. Może zmniejszyć zacięcia spowodowane kompilacją shaderów. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Użyj pamięci podręcznej strumienia dla Vulkana - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Włącza specyficzną dla producenta GPU pamięć podręczną potoków. Ta opcja może znacząco skrócić czas ładowania shaderów w przypadkach, gdy sterownik Vulkan nie przechowuje wewnętrznie plików pamięci podręcznej potoków. - + Enable Compute Pipelines (Intel Vulkan Only) Włącz potoki obliczeniowe (tylko Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -919,192 +939,181 @@ To ustawienie istnieje wyłącznie dla sterowników Intela i może spowodować b Na wszystkich pozostałych sterownikach potoki obliczeniowe są zawsze włączone. - + Enable Reactive Flushing Włącz reaktywne opróżnianie buforów - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Używa opróżniania reaktywnego zamiast predykcyjnego, co umożliwia dokładniejsze synchronizowanie pamięci. - + Sync to framerate of video playback Synchronizuj do liczby klatek odtwarzanego wideo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Uruchamiaj grę z normalną prędkością podczas odtwarzania wideo, nawet przy odblokowanej liczbie klatek na sekundę. - + Barrier feedback loops Pętle sprzężenia zwrotnego barier - + Improves rendering of transparency effects in specific games. Poprawia renderowanie efektów przezroczystości w niektórych grach. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State Rozszerzony stan dynamiczny - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Kontroluje liczbę funkcji, które mogą być używane w Extended Dynamic State. Wyższe poziomy pozwalają na użycie większej liczby funkcji i mogą zwiększyć wydajność, ale mogą powodować dodatkowe problemy z grafiką. - + Vertex Input Dynamic State Dynamiczny stan wejścia wierzchołków - + Enables vertex input dynamic state feature for better quality and performance. Włącza funkcję dynamicznego stanu wejścia wierzchołków, poprawiając jakość i wydajność. - + Sample Shading Cieniowanie próbkowe - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Pozwala wykonywać shader fragmentów dla każdej próbki we fragmencie wielokrotnie próbkowanym zamiast raz dla każdego fragmentu. Poprawia jakość grafiki kosztem wydajności. Wyższe wartości poprawiają jakość, ale obniżają wydajność. - + RNG Seed Ziarno RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Ustala ziarno generatora liczb losowych. Głównie używane do speedrunów. - + Device Name Nazwa urządzenia - + The name of the console. The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Własna data RTC - + This option allows to change the clock of the console. Can be used to manipulate time in games. Ta opcja pozwala zmienić zegar konsoli. Może służyć do manipulowania czasem w grach. - + The number of seconds from the current unix time Liczba sekund od bieżącego czasu Unix - + Language: Język: - + This option can be overridden when region setting is auto-select Ta opcja może zostać nadpisana, gdy ustawienie regionu to automatyczny wybór. - + Region: Region: - + The region of the console. Region konsoli. - + Time Zone: Strefa czasowa: - + The time zone of the console. Strefa czasowa konsoli. - + Sound Output Mode: Tryb wyjścia dźwięku: - + Console Mode: Tryb konsoli - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1113,1026 +1122,1026 @@ W zależności od tego ustawienia gry zmienią swoją rozdzielczość, szczegó Ustawienie na Handheld może poprawić wydajność na słabszych komputerach. - + Prompt for user profile on boot Pytaj o profil użytkownika przy uruchomieniu. - + Useful if multiple people use the same PC. Przydatne, gdy z tego samego PC korzysta wiele osób. - + Pause when not in focus Wstrzymuj, gdy okno nie jest aktywne - + Pauses emulation when focusing on other windows. Wstrzymuje emulację po przełączeniu na inne okna. - + Confirm before stopping emulation Potwierdzaj przed zatrzymaniem emulacji - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Nadpisuje monity z prośbą o potwierdzenie zatrzymania emulacji. Włączenie powoduje pominięcie takich monitów i bezpośrednie wyjście z emulacji. - + Hide mouse on inactivity Ukryj mysz przy braku aktywności - + Hides the mouse after 2.5s of inactivity. Ukrywa kursor po 2,5 s bezczynności. - + Check for updates Sprawdź aktualizacje - + Whether or not to check for updates upon startup. Czy sprawdzać aktualizacje przy uruchomieniu. - + Enable Gamemode Włącz Tryb gry - + Force X11 as Graphics Backend Wymuś X11 jako backend grafiki - + Custom frontend Niestandardowy frontend - + Real applet Prawdziwy aplet - - + + Disabled Wyłączone - + Never Nigdy - + On Load Przy wczytywaniu - + Always Zawsze - + CPU CPU - + GPU GPU - + CPU Asynchronous Asynchroniczne CPU - + Uncompressed (Best quality) Brak (najlepsza jakość) - + BC1 (Low quality) BC1 (niska jakość) - + BC3 (Medium quality) BC3 (średnia jakość) - - + + Auto Automatyczny - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Konserwatywny - + Aggressive Agresywny - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast Szybkie - - - + + + Accurate Dokładny - - - + + + Default Domyślny - + Unsafe (fast) Niezalecane (szybkie) - + Safe (stable) Bezpieczne (stabilne) - + Immediate - + Balanced Zrównoważony - + Unsafe Niebezpieczny - + Paranoid (disables most optimizations) Paranoiczne (wyłącza większość optymalizacji) - + Debugging Debugowanie - + Dynarmic Dynamiczny - + NCE NCE - + Borderless Windowed W oknie (Bezramkowy) - + Exclusive Fullscreen Exclusive Fullscreen - + No Video Output Brak wyjścia wideo - + CPU Video Decoding Dekodowanie Wideo przez CPU - + GPU Video Decoding (Default) Dekodowanie Wideo przez GPU (Domyślne) - + 0.25X (180p/270p) [EXPERIMENTAL] 0,25x (180p/270p) [EKSPERYMENTALNE] - + 0.5X (360p/540p) [EXPERIMENTAL] 0,5x (360p/540p) [EKSPERYMENTALNE] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EKSPERYMENTALNE] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EKSPERYMENTALNE] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [Ekperymentalnie] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Najbliższy sąsiadujący - + Bilinear Bilinearny - + Bicubic Bikubiczny - + Gaussian Kulisty - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Obszar - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Żadna (wyłączony) - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Domyślne (16:9) - + Force 4:3 Wymuś 4:3 - + Force 21:9 Wymuś 21:9 - + Force 16:10 Wymuś 16:10 - + Stretch to Window Rozciągnij do Okna - + Automatic Automatyczne - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japoński (日本語) - + American English Angielski Amerykański - + French (français) Francuski (français) - + German (Deutsch) Niemiecki (Niemcy) - + Italian (italiano) Włoski (italiano) - + Spanish (español) Hiszpański (español) - + Chinese Chiński - + Korean (한국어) Koreański (한국어) - + Dutch (Nederlands) Duński (Holandia) - + Portuguese (português) Portugalski (português) - + Russian (Русский) Rosyjski (Русский) - + Taiwanese Tajwański - + British English Angielski Brytyjski - + Canadian French Fancuski (Kanada) - + Latin American Spanish Hiszpański (Latin American) - + Simplified Chinese Chiński (Uproszczony) - + Traditional Chinese (正體中文) Chiński tradycyjny (正體中文) - + Brazilian Portuguese (português do Brasil) Portugalski (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonia - + USA USA - + Europe Europa - + Australia Australia - + China Chiny - + Korea Korea - + Taiwan Tajwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Domyślne (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipt - + Eire Irlandia - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islandia - + Iran Iran - + Israel Izrael - + Jamaica Jamajka - + Kwajalein Kwajalein - + Libya Libia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polska - + Portugal Portugalia - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Turcja - + UCT UCT - + Universal Uniwersalny - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Domyślne) - + 6GB DRAM (Unsafe) 6GB DRAM (NIebezpieczne) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (NIebezpieczne) - + 12GB DRAM (Unsafe) 12GB DRAM (NIebezpieczne) - + Docked Zadokowany - + Handheld Przenośnie - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Zawsze pytaj (Domyślne) - + Only if game specifies not to stop Tylko jeśli gra określa, aby nie zatrzymywać - + Never ask Nie pytaj więcej - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Średnie (256) - + High (512) Wysokie (512) - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/pt_BR.ts b/dist/languages/pt_BR.ts index cdc3af2593..063a1bff4f 100644 --- a/dist/languages/pt_BR.ts +++ b/dist/languages/pt_BR.ts @@ -728,12 +728,32 @@ O modo agressivo pode impactar a performance de outros aplicativos, como softwar Ignora certas invalidações de cache durante atualizações de memória, reduzindo o uso da CPU e melhorando a latência. Isso pode causar travamentos leves. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Modo de Sincronização vertical: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -744,12 +764,12 @@ Mailbox pode ter menor latência que FIFO e não apresenta cortes, mas pode perd Immediate (sem sincronização) exibe o que estiver disponível e pode apresentar cortes. - + Sync Memory Operations Sincronizar operações de memória - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -758,68 +778,68 @@ Esta opção corrige problemas em diversos jogos, mas pode reduzir o desempenho. Jogos baseados na Unreal Engine 4 costumam apresentar as mudanças mais significativas. - + Enable asynchronous presentation (Vulkan only) Ativar apresentação assíncrona (Somente Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Melhora ligeiramente o desempenho ao mover a apresentação para uma thread de CPU separada. - + Force maximum clocks (Vulkan only) Forçar clock máximo (somente Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Executa trabalho em segundo plano aguardando pelos comandos gráficos para evitar a GPU de reduzir seu clock. - + Anisotropic Filtering: Filtro Anisotrópico: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Controla a qualidade da renderização de texturas em ângulos oblíquos. Seguro definir em 16x na maioria das GPUs. - + GPU Mode: Modo da GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: Precisão do DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -828,44 +848,44 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Ativar compilação assíncrona de shaders - + May reduce shader stutter. Pode reduzir travamentos de shaders. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Acelera a decodificação de texturas 3D BCn usando processamento da GPU. Desative se ocorrerem travamentos ou falhas gráficas. - + GPU Unswizzle Max Texture Size Tamanho Máximo de Textura para GPU Unswizzle - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -874,48 +894,48 @@ A GPU é mais rápida para texturas médias e grandes, mas a CPU pode ser mais e Ajuste para encontrar o equilíbrio entre aceleração da GPU e sobrecarga da CPU. - + GPU Unswizzle Stream Size Tamanho do Fluxo de GPU Unswizzle - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Define a quantidade máxima de dados de textura (em MiB) processados por quadro. Valores mais altos podem reduzir travamentos durante o carregamento de texturas, mas podem afetar a consistência dos quadros. - + GPU Unswizzle Chunk Size Tamanho do Bloco de GPU Unswizzle - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Determina o número de fatias de profundidade processadas em uma única execução. Aumentar esse valor pode melhorar o desempenho em GPUs avançadas, mas pode causar TDR ou tempo limite do driver em hardwares mais fracos. - + Use Vulkan pipeline cache Utilizar cache de pipeline do Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Habilita o cache de pipeline da fabricante da GPU. Esta opção pode melhorar o tempo de carregamento de shaders significantemente em casos onde o driver Vulkan não armazena o cache de pipeline internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Habilitar Pipeline de Computação (Somente Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -924,194 +944,182 @@ Esta configuração existe apenas para drivers proprietários da Intel e pode ca Pipelines de computação estão sempre habilitados em outros drivers. - + Enable Reactive Flushing Habilitar Flushing Reativo - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Usa flushing reativo ao invés de flushing preditivo, permitindo mais precisão na sincronização da memória. - + Sync to framerate of video playback Sincronizar com o framerate da reprodução de vídeo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Executa o jogo na velocidade normal durante a reprodução de vídeo, mesmo se o framerate estiver desbloqueado. - + Barrier feedback loops Ciclos de feedback de barreira - + Improves rendering of transparency effects in specific games. Melhora a renderização de efeitos de transparência em jogos específicos. - + Enable buffer history Ativar histórico de buffer - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Permite acesso a estados anteriores do buffer. Esta opção pode melhorar a qualidade de renderização e a consistência de desempenho em alguns jogos. - + Fix bloom effects Corrigir efeitos de bloom - + Removes bloom in Burnout. Remove o bloom no Burnout. - - Enable Legacy Rescale Pass - Ativar Passagem de Redimensionamento Legada - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - Pode corrigir problemas de redimensionamento em alguns jogos, baseando-se no comportamento da implementação anterior. -Solução legada que corrige artefatos de linha em GPUs AMD e Intel, e cintilação de texturas cinzas em GPUs Nvidia no Luigi's Mansion 3. - - - + Extended Dynamic State Estado Dinâmico Estendido - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Controla o número de recursos que podem ser usados no Estado Dinâmico Estendido. Estados mais altos permitem mais recursos e podem aumentar o desempenho, mas também podem causar problemas gráficos adicionais. - + Vertex Input Dynamic State Estado Dinâmico de Entrada de Vértices - + Enables vertex input dynamic state feature for better quality and performance. Ativa o recurso de estado dinâmico de entrada de vértices para melhor qualidade e desempenho. - + Sample Shading Sombreamento por Amostragem - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Permite que o shader de fragmento seja processado por cada amostra em fragmentos multiamostrados, em vez de uma única vez por fragmento. Melhora a qualidade gráfica ao custo de desempenho. Valores mais altos aumentam a qualidade, mas reduzem a performance. - + RNG Seed Semente de RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Controla a semente do gerador de números aleatórios. Usado principalmente em speedruns. - + Device Name Nome do Dispositivo - + The name of the console. O nome do console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Data personalizada do RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Esta opção permite alterar o relógio do console. Pode ser usada para manipular o tempo nos jogos. - + The number of seconds from the current unix time Número de segundos a partir do tempo Unix atual - + Language: Idioma: - + This option can be overridden when region setting is auto-select Esta opção pode ser substituída quando a configuração de região estiver em seleção automática - + Region: Região: - + The region of the console. A região do console. - + Time Zone: Fuso Horário: - + The time zone of the console. O fuso horário do console. - + Sound Output Mode: Modo de saída de som - + Console Mode: Modo Console: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1120,1026 +1128,1026 @@ Os jogos ajustarão resolução, detalhes e controladores suportados conforme es Definir como Portátil pode ajudar a melhorar o desempenho em sistemas mais fracos. - + Prompt for user profile on boot Solicitar perfil de usuário na inicialização - + Useful if multiple people use the same PC. Útil se várias pessoas usam o mesmo PC. - + Pause when not in focus Pausar quando não estiver em foco - + Pauses emulation when focusing on other windows. Pausa a emulação ao focar em outras janelas. - + Confirm before stopping emulation Confirmar antes de parar a emulação - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Substitui as confirmações ao parar a emulação. Ao ativar, ignora esses avisos e encerra diretamente a emulação. - + Hide mouse on inactivity Esconder rato quando inactivo. - + Hides the mouse after 2.5s of inactivity. Oculta o mouse após 2,5s de inatividade. - + Check for updates Verificar atualizações - + Whether or not to check for updates upon startup. Define se deve verificar atualizações na inicialização. - + Enable Gamemode Habilitar Gamemode - + Force X11 as Graphics Backend Forçar X11 como backend gráfico - + Custom frontend Frontend customizado - + Real applet Applet real - - + + Disabled Desativado - + Never Nunca - + On Load Ao carregar - + Always Sempre - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Assíncrona - + Uncompressed (Best quality) Descompactado (Melhor Qualidade) - + BC1 (Low quality) BC1 (Baixa qualidade) - + BC3 (Medium quality) BC3 (Média qualidade) - - + + Auto Automático - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Conservador - + Aggressive Agressivo - + Vulkan Vulcano - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Shaders em Assembly, apenas NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimental, apenas AMD/Mesa) - + Null Nenhum - + Fast Rápido - - - + + + Accurate Preciso - - - + + + Default Padrão - + Unsafe (fast) Inseguro (rápido) - + Safe (stable) Seguro (estável) - + Immediate - + Balanced Balanceado - + Unsafe Inseguro - + Paranoid (disables most optimizations) Paranoia (desativa a maioria das otimizações) - + Debugging Depuração - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Janela sem bordas - + Exclusive Fullscreen Tela cheia exclusiva - + No Video Output Sem saída de vídeo - + CPU Video Decoding Decodificação de vídeo pela CPU - + GPU Video Decoding (Default) Decodificação de vídeo pela GPU (Padrão) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Vizinho mais próximo - + Bilinear Bilinear - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Área - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nenhum - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Padrão (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 Forçar 16:10 - + Stretch to Window Esticar à Janela - + Automatic Automático - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonês (日本語) - + American English Inglês Americano - + French (français) Francês (français) - + German (Deutsch) Alemão (Deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Espanhol (español) - + Chinese Chinês - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandês (Nederlands) - + Portuguese (português) Português (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanês - + British English Inglês Britânico - + Canadian French Francês Canadense - + Latin American Spanish Espanhol Latino-Americano - + Simplified Chinese Chinês Simplificado - + Traditional Chinese (正體中文) Chinês Tradicional (正 體 中文) - + Brazilian Portuguese (português do Brasil) Português do Brasil (Brazilian Portuguese) - + Polish (polska) Polonês (polska) - + Thai (แบบไทย) Tailandês (แบบไทย) - - + + Japan Japão - + USA EUA - + Europe Europa - + Australia Austrália - + China China - + Korea Coreia - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Padrão (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egito - + Eire Irlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islândia - + Iran Irã - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polônia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estéreo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Padrão) - + 6GB DRAM (Unsafe) 6GB DRAM (Não seguro) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Inseguro) - + 12GB DRAM (Unsafe) 12GB DRAM (Inseguro) - + Docked Ancorado - + Handheld Portátil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Sempre perguntar (Padrão) - + Only if game specifies not to stop Somente se o jogo especificar para não parar - + Never ask Nunca perguntar - + Very Small (16 MB) Muito Pequeno (16 MB) - + Small (32 MB) Pequeno (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Grande (256 MB) - + Very Large (512 MB) Muito Grande (512 MB) - + Very Low (4 MB) Muito Baixo (4 MB) - + Low (8 MB) Baixo (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Médio (32 MB) - + High (64 MB) Alto (64 MB) - + Very Low (32) Muito Baixo (32) - + Low (64) Baixo (64) - + Normal (128) Normal (128) - + Medium (256) Médio (256) - + High (512) Alto (512) - + ExtendedDynamicState 1 Estado Dinâmico Estendido 1 - + ExtendedDynamicState 2 Estado Dinâmico Estendido 2 - + ExtendedDynamicState 3 Estado Dinâmico Estendido 3 - + Tree View Visualização em Árvore - + Grid View Visualização em Grade diff --git a/dist/languages/pt_PT.ts b/dist/languages/pt_PT.ts index 7084f01e62..eb9b0c12a4 100644 --- a/dist/languages/pt_PT.ts +++ b/dist/languages/pt_PT.ts @@ -703,12 +703,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Modo de Sincronização vertical: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -716,79 +736,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Ativar apresentação assíncrona (Somente Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Melhora ligeiramente o desempenho ao mover a apresentação para uma thread de CPU separada. - + Force maximum clocks (Vulkan only) Forçar clock máximo (somente Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Executa trabalho em segundo plano aguardando pelos comandos gráficos para evitar a GPU de reduzir seu clock. - + Anisotropic Filtering: Filtro Anisotrópico: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -797,1302 +817,1291 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Utilizar cache de pipeline do Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Habilita o cache de pipeline da fabricante da GPU. Esta opção pode melhorar o tempo de carregamento de shaders significantemente em casos onde o driver Vulkan não armazena o cache de pipeline internamente. - + Enable Compute Pipelines (Intel Vulkan Only) Habilitar Pipeline de Computação (Somente Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Habilitar Flushing Reativo - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Usa flushing reativo ao invés de flushing preditivo, permitindo mais precisão na sincronização da memória. - + Sync to framerate of video playback Sincronizar com o framerate da reprodução de vídeo - + Run the game at normal speed during video playback, even when the framerate is unlocked. Executa o jogo na velocidade normal durante a reprodução de vídeo, mesmo se o framerate estiver desbloqueado. - + Barrier feedback loops Ciclos de feedback de barreira - + Improves rendering of transparency effects in specific games. Melhora a renderização de efeitos de transparência em jogos específicos. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Semente de RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Nome do Dispositivo - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Data personalizada do RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: Idioma: - + This option can be overridden when region setting is auto-select - + Region: Região: - + The region of the console. - + Time Zone: Fuso Horário: - + The time zone of the console. - + Sound Output Mode: Modo de saída de som - + Console Mode: Modo Console: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation Confirmar antes de parar a emulação - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Esconder rato quando inactivo. - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode Habilitar Gamemode - + Force X11 as Graphics Backend - + Custom frontend Frontend customizado - + Real applet Miniaplicativo real - - + + Disabled - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU Assíncrona - + Uncompressed (Best quality) Descompactado (Melhor Q - + BC1 (Low quality) BC1 (Baixa qualidade) - + BC3 (Medium quality) BC3 (Média qualidade) - - + + Auto Automático - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Conservador - + Aggressive Agressivo - + Vulkan Vulcano - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Nenhum (desativado) - + Fast - - - + + + Accurate Preciso - - - + + + Default Padrão - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Inseguro - + Paranoid (disables most optimizations) Paranoia (desativa a maioria das otimizações) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Janela sem bordas - + Exclusive Fullscreen Tela cheia exclusiva - + No Video Output Sem saída de vídeo - + CPU Video Decoding Decodificação de vídeo pela CPU - + GPU Video Decoding (Default) Decodificação de vídeo pela GPU (Padrão) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTAL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTAL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Vizinho mais próximo - + Bilinear Bilinear - + Bicubic Bicúbico - + Gaussian Gaussiano - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Nenhum - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Padrão (16:9) - + Force 4:3 Forçar 4:3 - + Force 21:9 Forçar 21:9 - + Force 16:10 Forçar 16:10 - + Stretch to Window Esticar à Janela - + Automatic Automático - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonês (日本語) - + American English Inglês Americano - + French (français) Francês (français) - + German (Deutsch) Alemão (Deutsch) - + Italian (italiano) Italiano (italiano) - + Spanish (español) Espanhol (español) - + Chinese Chinês - + Korean (한국어) Coreano (한국어) - + Dutch (Nederlands) Holandês (Nederlands) - + Portuguese (português) Português (português) - + Russian (Русский) Russo (Русский) - + Taiwanese Taiwanês - + British English Inglês Britânico - + Canadian French Francês Canadense - + Latin American Spanish Espanhol Latino-Americano - + Simplified Chinese Chinês Simplificado - + Traditional Chinese (正體中文) Chinês Tradicional (正 體 中文) - + Brazilian Portuguese (português do Brasil) Português do Brasil (Brazilian Portuguese) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japão - + USA EUA - + Europe Europa - + Australia Austrália - + China China - + Korea Coreia - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Padrão (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Egipto - + Eire Irlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Islândia - + Iran Irão - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Líbia - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polónia - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapura - + Turkey Turquia - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Estéreo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Padrão) - + 6GB DRAM (Unsafe) 6GB DRAM (Não seguro) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Ancorado - + Handheld Portátil - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Sempre perguntar (Padrão) - + Only if game specifies not to stop Somente se o jogo especificar para não parar - + Never ask Nunca perguntar - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/ru_RU.ts b/dist/languages/ru_RU.ts index 248209833e..bb44335970 100644 --- a/dist/languages/ru_RU.ts +++ b/dist/languages/ru_RU.ts @@ -729,12 +729,32 @@ Aggressive mode may impact performance of other applications such as recording s Пропускает некоторые операции сброса кэша при обновлении памяти, снижая нагрузку на ЦП и уменьшая задержку. Может вызывать сбои в работе игр. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Режим VSync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -745,12 +765,12 @@ Mailbox может обеспечивать меньшую задержку, ч Immediate (без синхронизации) выводит все доступные кадры и может иметь разрывы. - + Sync Memory Operations Синхронизация операций памяти - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -759,56 +779,56 @@ Unreal Engine 4 games often see the most significant changes thereof. Игры на Unreal Engine 4 чаще всего демонстрируют заметные изменения. - + Enable asynchronous presentation (Vulkan only) Включить асинхронный вывод (только Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Немного повышает производительность, перенося вывод кадра в отдельный поток CPU. - + Force maximum clocks (Vulkan only) Принудительно зафиксировать максимальную тактовую частоту (только для Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Выполняет фоновые операции во время ожидания графических команд, предотвращая снижение тактовой частоты GPU. - + Anisotropic Filtering: Анизотропная фильтрация: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Управляет качеством отображения текстур под наклонными углами. На большинстве GPU безопасно использовать значение 16x. - + GPU Mode: Режим GPU: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. Управляет режимом эмуляции ГПУ. Большинство игр нормально отображаются в режиме Быстрый, но для некоторых требуется режим Точный. Частицы обычно корректно отображаются только в режиме Точный. - + DMA Accuracy: Точность DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -817,12 +837,12 @@ Default follows the GPU Accuracy setting. По умолчанию соответствует настройке точности ГПУ. - + GPU Fence Behavior: Поведение барьеров ГПУ: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -831,44 +851,44 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Включить асинхронную компиляцию шейдеров - + May reduce shader stutter. Может уменьшить фризы, вызванные компиляцией шейдеров. - + GPU Clocks Частоты GPU - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. Заставляет игру думать, что GPU завершает свою работу быстрее, чем на самом деле, чтобы она перестала подстраиваться под частоты Switch, понижать разрешение и дальность прорисовки. - + GPU Unswizzle GPU-десвиззлинг (GPU Unswizzle) - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Ускоряет декодирование 3D-текстур BCn с использованием вычислений GPU. Отключите при возникновении сбоев или графических артефактов. - + GPU Unswizzle Max Texture Size Максимальный размер текстур для GPU-десвиззлинга - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -877,48 +897,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size Размер потока GPU-десвиззлинга - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Задает максимальный объем данных текстур (в МиБ), обрабатываемый за кадр. Более высокие значения могут уменьшить подергивания при загрузке текстур, но это может повлиять на стабильность кадров. - + GPU Unswizzle Chunk Size Размер блока GPU-десвиззлинга - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Определяет количество слоев глубины, обрабатываемых за один вызов. Увеличение этого значения может повысить пропускную способность на производительных GPU, но на слабом оборудовании способно вызвать TDR или тайм-ауты драйвера. - + Use Vulkan pipeline cache Использовать кэш конвейеров Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Включает кэш конвейеров, зависящий от производителя GPU. Эта опция может значительно ускорить загрузку шейдеров в тех случаях, когда драйвер Vulkan не сохраняет такие файлы кэша внутри себя. - + Enable Compute Pipelines (Intel Vulkan Only) Включить вычислительные конвейеры (только для Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -927,194 +947,182 @@ Compute pipelines are always enabled on all other drivers. На остальных драйверах вычислительные конвейеры всегда включены. - + Enable Reactive Flushing Включить реактивный сброс - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Использует реактивный сброс (Reactive Flushing) вместо прогнозирующего, обеспечивая более точную синхронизацию памяти. - + Sync to framerate of video playback Синхронизировать с частотой кадров видео - + Run the game at normal speed during video playback, even when the framerate is unlocked. Поддерживать нормальную скорость игры во время воспроизведения видео, даже если частота кадров разблокирована. - + Barrier feedback loops Циклы обратной связи барьеров - + Improves rendering of transparency effects in specific games. Улучшает отрисовку эффектов прозрачности в некоторых играх. - + Enable buffer history Включить историю буфера - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Предоставляет доступ к предыдущим состояниям буфера. В некоторых играх может повысить качество рендеринга и стабильность производительности. - + Fix bloom effects Исправить эффекты bloom - + Removes bloom in Burnout. Удаляет эффект bloom в игре Burnout. - - Enable Legacy Rescale Pass - Включить устаревший режим масштабирования - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - Может исправить проблемы масштабирования в некоторых играх, используя поведение предыдущей реализации. -Это обходное решение устраняет артефакты линий на GPU AMD и Intel, а также мерцание серых текстур на GPU Nvidia в Luigis Mansion 3. - - - + Extended Dynamic State Расширенное динамическое состояние (Extended Dynamic State) - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Определяет количество функций, доступных в Extended Dynamic State. Более высокие значения позволяют использовать больше функций и иногда повышают производительность, но могут вызвать дополнительные графические проблемы. - + Vertex Input Dynamic State Динамическое состояние ввода вершин (Vertex Input Dynamic State) - + Enables vertex input dynamic state feature for better quality and performance. Включает функцию динамического состояния ввода вершин для улучшения качества и производительности. - + Sample Shading Множественное затенение (Sample Shading) - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Позволяет фрагментному шейдеру выполняться для каждого сэмпла в мультисемплированном фрагменте вместо одного раза. Повышает качество графики за счет снижения производительности. Более высокие значения повышают качество, но сильнее снижают производительность. - + RNG Seed Сид RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Задает начальное значение генератора случайных чисел. В основном используется для спидранов. - + Device Name Название устройства - + The name of the console. Имя консоли. - + Homebrew Args Аргументы Homebrew - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Аргументы командной строки при запуске homebrew (например, -noglsl). - + Custom RTC Date: Пользовательская RTC-дата: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Позволяет изменить системные часы консоли. Может использоваться для изменения времени в играх. - + The number of seconds from the current unix time Количество секунд от текущего UNIX-времени. - + Language: Язык: - + This option can be overridden when region setting is auto-select Эта настройка может быть переопределена при автоматическом выборе региона. - + Region: Регион: - + The region of the console. Регион консоли. - + Time Zone: Часовой пояс: - + The time zone of the console. Часовой пояс консоли. - + Sound Output Mode: Режим вывода звука: - + Console Mode: Консольный режим: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1123,1026 +1131,1026 @@ Setting to Handheld can help improve performance for low end systems. Установка в портативный режим может повысить производительность на слабых системах. - + Prompt for user profile on boot Запрашивать профиль пользователя при запуске игры - + Useful if multiple people use the same PC. Полезно, если одним ПК пользуются несколько человек. - + Pause when not in focus Приостанавливать, если окно не активно - + Pauses emulation when focusing on other windows. Приостанавливает эмуляцию при переключении на другие окна. - + Confirm before stopping emulation Запрашивать подтверждение перед остановкой эмуляции - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Убирает запросы на подтверждение остановки эмуляции. При включении этой настройки эмуляция завершается сразу, без подтверждения. - + Hide mouse on inactivity Скрывать курсор при бездействии - + Hides the mouse after 2.5s of inactivity. Скрывает курсор мыши после 2,5 секунд бездействия. - + Check for updates Проверять обновления - + Whether or not to check for updates upon startup. Проверять обновления при запуске. - + Enable Gamemode Включить режим игры - + Force X11 as Graphics Backend Принудительно использовать X11 как графический бэкенд - + Custom frontend Собственный интерфейс эмулятора - + Real applet Приложение из прошивки - - + + Disabled Отключено - + Never Никогда - + On Load При загрузке - + Always Всегда - + CPU CPU - + GPU GPU - + CPU Asynchronous Асинхронный CPU - + Uncompressed (Best quality) Без сжатия (наилучшее качество) - + BC1 (Low quality) BC1 (низкое качество) - + BC3 (Medium quality) BC3 (среднее качество) - - + + Auto Авто - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative Консервативный - + Aggressive Агрессивный - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (ассемблерные шейдеры, только для NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (экспериментальный, только для AMD/Mesa) - + Null Null - + Fast Производительность - - - + + + Accurate Точность - - - + + + Default По умолчанию - + Unsafe (fast) Небезопасно (быстро) - + Safe (stable) Безопасно (стабильно) - + Immediate Мгновенный - + Balanced Баланс - + Unsafe Небезопасно - + Paranoid (disables most optimizations) Параноик (отключает большинство оптимизаций) - + Debugging Отладка - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed Безрамочный режим - + Exclusive Fullscreen Эксклюзивный полноэкранный - + No Video Output Отсутствие видеовыхода - + CPU Video Decoding Декодирование видео на CPU - + GPU Video Decoding (Default) Декодирование видео на GPU (По умолчанию) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [Экспериментально] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [Экспериментально] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [Экспериментально] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [ЭКПЕРИМЕНТАЛЬНО] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [Экспериментально] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Ближайший сосед (Nearest Neighbor) - + Bilinear Билинейный - + Bicubic Бикубический - + Gaussian По Гауссу - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX™️ Super Resolution - + Area Область (Area) - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Никакой - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Стандартное (16:9) - + Force 4:3 Принудительно 4:3 - + Force 21:9 Принудительно 21:9 - + Force 16:10 Принудительно 16:10 - + Stretch to Window Растянуть до окна - + Automatic Автоматически - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Японский (日本語) - + American English Американский английский - + French (français) Французский (français) - + German (Deutsch) Немецкий (Deutsch) - + Italian (italiano) Итальянский (italiano) - + Spanish (español) Испанский (español) - + Chinese Китайский - + Korean (한국어) Корейский (한국어) - + Dutch (Nederlands) Голландский (Nederlands) - + Portuguese (português) Португальский (português) - + Russian (Русский) Русский - + Taiwanese Тайваньский - + British English Британский английский - + Canadian French Канадский французский - + Latin American Spanish Латиноамериканский испанский - + Simplified Chinese Упрощённый китайский - + Traditional Chinese (正體中文) Традиционный китайский (正體中文) - + Brazilian Portuguese (português do Brasil) Бразильский португальский (português do Brasil) - + Polish (polska) Польский (polska) - + Thai (แบบไทย) Тайский (แบบไทย) - - + + Japan Япония - + USA США - + Europe Европа - + Australia Австралия - + China Китай - + Korea Корея - + Taiwan Тайвань - + Auto (%1) Auto select time zone Авто (%1) - + Default (%1) Default time zone По умолчанию (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Куба - + EET EET - + Egypt Египет - + Eire Эйре - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Эйре - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Гринвич - + Hongkong Гонконг - + HST HST - + Iceland Исландия - + Iran Иран - + Israel Израиль - + Jamaica Ямайка - + Kwajalein Кваджалейн - + Libya Ливия - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Навахо - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Польша - + Portugal Португалия - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Сингапур - + Turkey Турция - + UCT UCT - + Universal Универсальный - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Зулу - + Mono Моно - + Stereo Стерео - + Surround Объемный звук - + 4GB DRAM (Default) 4 ГБ ОЗУ (По умолчанию) - + 6GB DRAM (Unsafe) 6 ГБ ОЗУ (Небезопасно) - + 8GB DRAM 8 ГБ ОЗУ - + 10GB DRAM (Unsafe) 10 ГБ ОЗУ (Небезопасно) - + 12GB DRAM (Unsafe) 12 ГБ ОЗУ (Небезопасно) - + Docked В док-станции - + Handheld Портативный - - + + Normal Нормальная - - + + Boost Ускоренная - - + + Overclock Разгон - + Always ask (Default) Всегда спрашивать (По умолчанию) - + Only if game specifies not to stop Только если игра указывает не останавливать - + Never ask Никогда не спрашивать - + Very Small (16 MB) Очень маленький (16 МБ) - + Small (32 MB) Маленький (32 МБ) - + Normal (128 MB) Нормальный (128 МБ) - + Large (256 MB) Большой (256 МБ) - + Very Large (512 MB) Очень большой (512 МБ) - + Very Low (4 MB) Очень низкий (4 МБ) - + Low (8 MB) Низкий (8 МБ) - + Normal (16 MB) Нормальный (16 МБ) - + Medium (32 MB) Средний (32 МБ) - + High (64 MB) Высокий (64 МБ) - + Very Low (32) Очень низкий (32) - + Low (64) Низкий (64) - + Normal (128) Нормальный (128) - + Medium (256) Средний (256) - + High (512) Высокий (512) - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View Древовидный - + Grid View Сетчатый diff --git a/dist/languages/sv.ts b/dist/languages/sv.ts index 8662c56414..818a84cbe1 100644 --- a/dist/languages/sv.ts +++ b/dist/languages/sv.ts @@ -51,7 +51,7 @@ li.checked::marker { content: "\2612"; } Communicating with the server... - Kommunicerar med servern... + Kommunicerar med servern… @@ -192,7 +192,7 @@ Detta skulle stänga av både deras forumanvändarnamn och deras IP-adress. Moderation... - Moderering... + Moderering… @@ -375,7 +375,7 @@ Påverkar inte prestanda/stabilitet men kan göra det möjligt att läsa in HD-t 200% for a 30 FPS game is 60 FPS, and for a 60 FPS game it will be 120 FPS. Disabling it means unlocking the framerate to the maximum your PC can reach. Kontrollerar spelets maximala renderingshastighet, men det är upp till varje spel om det körs snabbare eller inte. -200% för ett spel med 30 bilder/s är 60 bilder/s, och för ett spel med 60 bilder/s blir det 120 bilder/s. +200 % för ett spel med 30 bilder/s är 60 bilder/s och för ett spel med 60 bilder/s blir det 120 bilder/s. Att inaktivera det innebär att du låser upp bildfrekvensen till det maximala som din dator kan nå. @@ -436,7 +436,7 @@ Kan bidra till att minska hackande vid lägre bildfrekvenser. Raises the clock the emulated CPU reports, which removes some FPS limiters. Weaker CPUs may see reduced performance, and certain games may behave improperly. Höjer den klockfrekvens som den emulerade processorn rapporterar, vilket tar bort vissa FPS-begränsare. -Svagare processorer kan få sämre prestanda, och vissa spel kan fungera felaktigt. +Svagare processorer kan få sämre prestanda och vissa spel kan fungera felaktigt. @@ -446,7 +446,7 @@ Svagare processorer kan få sämre prestanda, och vissa spel kan fungera felakti Set a custom value of CPU ticks. Higher values can increase performance, but may cause deadlocks. A range of 77-21000 is recommended. - Ange ett anpassat värde för CPU-ticks. Högre värden kan öka prestandan, men kan orsaka deadlocks. Ett intervall på 77-21000 rekommenderas. + Ange ett anpassat värde för CPU-ticks. Högre värden kan öka prestandan, men kan orsaka deadlocks. Ett intervall på 77 till 21000 rekommenderas. @@ -734,12 +734,32 @@ Aggressivt läge kan påverka prestandan hos andra program, till exempel inspeln Hoppar över vissa cache-ogiltigförklaringar under minnesuppdateringar, vilket minskar CPU-användningen och förbättrar latensen. Detta kan orsaka mjuka krascher. - + + GPU Readback Before NCE Invalidation + GPU-återläsning före NCE-ogiltigförklaring + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + Skriver tillbaka GPU-buffertdata till gästens minne innan NCE ogiltigförklarar hela gästsidan, så att data bevaras medan CPU-lagringen fortsätter. + + + + Patch Runtime NROs for NCE + Korrigera NRO:er under körning för NCE + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + Tillämpar NCE-korrigeringar på NRO-moduler som läses in under körning. Det krävs för att vissa spel ska fungera korrekt. + + + VSync Mode: VSync-läge: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -750,12 +770,12 @@ Mailbox kan ha lägre latens än FIFO och uppvisar inte tearing, men kan tappa b Immediate (ingen synkronisering) visar allt som är tillgängligt och kan uppvisa tearing. - + Sync Memory Operations Synkronisera minnesoperationer - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -764,44 +784,44 @@ Det här alternativet åtgärdar problem i spel, men kan försämra prestandan. Unreal Engine 4-spel upplever ofta de mest betydande förändringarna av detta. - + Enable asynchronous presentation (Vulkan only) Aktivera asynkron presentation (endast Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Förbättrar prestandan något genom att flytta presentationen till en separat CPU-tråd. - + Force maximum clocks (Vulkan only) Tvinga fram maximal klockfrekvens (endast Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Körs i bakgrunden i väntan på grafikkommandon för att förhindra att GPU:n sänker sin klockhastighet. - + Anisotropic Filtering: Anisotropisk filtrering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Kontrollerar kvaliteten på texturrendering vid sneda vinklar. -Säker att ställa in på 16x på de flesta GPU:er. +Det går att ställa in 16× på de flesta GPU:er. - + GPU Mode: GPU-läge: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -810,12 +830,12 @@ De flesta spel återges bra med Snabb, men Exakt krävs fortfarande för vissa. Partiklar återges ofta korrekt endast i läget Exakt. - + DMA Accuracy: DMA-noggrannhet: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -824,12 +844,12 @@ Osäker är snabbare, medan Säker är stabilare och kan lösa problem i vissa s Standard följer inställningen för GPU-noggrannhet. - + GPU Fence Behavior: Beteende för GPU-staket: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -842,44 +862,44 @@ Exakt förbättrar kompatibiliteten ytterligare, men på bekostnad av viss prest Standard följer inställningen för GPU-läge. - + Enable asynchronous shader compilation Aktivera asynkron shaderkompilering - + May reduce shader stutter. Kan minska shader-hackighet. - + GPU Clocks GPU-klockfrekvenser - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. Får spelet att tro att GPU-arbetet avslutas snabbare än det gör, så att det slutar sänka upplösning och ritaravstånd för att passa Switch-klockfrekvenserna. - + GPU Unswizzle GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Accelererar avkodning av BCn 3D-texturer med hjälp av GPU-beräkningar. Inaktivera om du upplever krascher eller grafiska fel. - + GPU Unswizzle Max Texture Size Maximal texturstorlek för GPU Unswizzle - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -888,48 +908,48 @@ GPU är snabbare för medelstora och stora texturer, men CPU kan vara effektivar Justera detta för att hitta balansen mellan GPU-acceleration och CPU-överbelastning. - + GPU Unswizzle Stream Size Strömstorlek för GPU Unswizzle - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Ställer in den maximala mängden texturdata (i MiB) som bearbetas per bildruta. Högre värden kan minska hackighet under texturinläsning men kan påverka bildrutans konsistens. - + GPU Unswizzle Chunk Size Chunk-storlek för GPU Unswizzle - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Bestämmer antalet djupskivor som bearbetas i en enda sändning. Att öka detta kan förbättra genomströmningen på avancerade GPU:er, men kan orsaka TDR eller drivrutinstidsgränser på svagare hårdvara. - + Use Vulkan pipeline cache Använda Vulkan pipeline-cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Aktiverar GPU-leverantörsspecifik pipeline-cache. Det här alternativet kan förbättra laddningstiden för shaders avsevärt i fall där Vulkan-drivrutinen inte lagrar pipeline-cache-filer internt. - + Enable Compute Pipelines (Intel Vulkan Only) Aktivera compute pipelines (endast Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -938,194 +958,182 @@ Denna inställning finns endast för Intels egna drivrutiner och kan orsaka kras Beräkningspipelines är alltid aktiverade på alla andra drivrutiner. - + Enable Reactive Flushing Aktivera Reactive Flushing - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Använder reaktiv rensning i stället för prediktiv rensning, vilket ger mer exakt minnessynkning. - + Sync to framerate of video playback Synkronisera med bildfrekvensen för videouppspelning - + Run the game at normal speed during video playback, even when the framerate is unlocked. Kör spelet i normal hastighet under videouppspelning, även när bildfrekvensen är upplåst. - + Barrier feedback loops Återkopplingsloopar för barriärer - + Improves rendering of transparency effects in specific games. Förbättrar renderingen av transparenseffekter i vissa spel. - + Enable buffer history Aktivera bufferthistorik - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Aktiverar åtkomst till tidigare bufferttillstånd. Det här alternativet kan förbättra renderingskvaliteten och prestandakonsistensen i vissa spel. - + Fix bloom effects Korrigera bloom-effekter - + Removes bloom in Burnout. Tar bort bloom i Burnout. - - Enable Legacy Rescale Pass - Aktivera äldre omskalningspass - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - Kan åtgärda skalningsproblem i vissa spel genom att förlita sig på beteendet från den tidigare implementeringen. -Äldre beteende som åtgärdar linjeartefakter på AMD- och Intel-GPU:er och grå texturflimmer på Nvidia-GPU:er i Luigis Mansion 3. - - - + Extended Dynamic State Utökad dynamisk status - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Kontrollerar antalet funktioner som kan användas i utökat dynamiskt tillstånd. Högre tillstånd möjliggör fler funktioner och kan öka prestandan, men kan orsaka ytterligare grafiska problem. - + Vertex Input Dynamic State Dynamiskt tillstånd för vertexinmatning - + Enables vertex input dynamic state feature for better quality and performance. Aktiverar funktionen för dynamiskt tillstånd för vertexinmatning för bättre kvalitet och prestanda. - + Sample Shading Provskuggning - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Tillåter fragment-shadern att exekveras per prov i ett multisamplade fragment istället för en gång per fragment. Förbättrar grafikens kvalitet på bekostnad av prestanda. Högre värden förbättrar kvaliteten men försämrar prestandan. - + RNG Seed RNG-frö - + Controls the seed of the random number generator. Mainly used for speedrunning. Att kontrollera fröet till slumptalsgeneratorn. Används främst för speedrunning. - + Device Name Enhetsnamn - + The name of the console. Konsolens namn. - + Homebrew Args Homebrew-argument - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Kommandoradsargument som skickas till homebrew vid start (t.ex. -noglsl). - + Custom RTC Date: Anpassat RTC-datum: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Med det här alternativet kan du ändra klockan på konsolen. Kan användas för att manipulera tiden i spel. - + The number of seconds from the current unix time Antalet sekunder från aktuell Unix-tid - + Language: Språk: - + This option can be overridden when region setting is auto-select - Det här alternativet kan åsidosättas när regioninställningen är automatiskt vald. + Det här alternativet kan åsidosättas när regioninställningen är automatiskt vald - + Region: Region: - + The region of the console. Konsolens region. - + Time Zone: Tidszon: - + The time zone of the console. Konsolens tidszon. - + Sound Output Mode: Ljudutmatningsläge: - + Console Mode: Konsolläge: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1134,1026 +1142,1026 @@ Spel ändrar upplösning, detaljer och stödda kontroller beroende på denna ins Inställningen Handhållen kan förbättra prestandan för enklare system. - + Prompt for user profile on boot Fråga efter användarprofil vid uppstart - + Useful if multiple people use the same PC. Användbart om flera personer använder samma dator. - + Pause when not in focus Pausa när inte i fokus - + Pauses emulation when focusing on other windows. Pausar emulering när fokus är på andra fönster. - + Confirm before stopping emulation Bekräfta innan emuleringen stoppas - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Åsidosätter frågor om att bekräfta att emuleringen ska avslutas. Om du aktiverar den hoppar du över sådana uppmaningar och avslutar emuleringen direkt. - + Hide mouse on inactivity Dölj musen vid inaktivitet - + Hides the mouse after 2.5s of inactivity. Döljer musen efter 2,5 sekunders inaktivitet. - + Check for updates Leta efter uppdateringar - + Whether or not to check for updates upon startup. Om uppdateringar ska sökas vid start eller inte. - + Enable Gamemode Aktivera Gamemode - + Force X11 as Graphics Backend Tvinga X11 som grafikbackend - + Custom frontend Anpassad frontend - + Real applet Verklig applet - - + + Disabled Inaktiverad - + Never Aldrig - + On Load Vid inläsning - + Always Alltid - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU asynkron - + Uncompressed (Best quality) Okomprimerad (bästa kvalitet) - + BC1 (Low quality) BC1 (låg kvalitet) - + BC3 (Medium quality) BC3 (medelhög kvalitet) - - + + Auto Auto - + 30 FPS 30 bilder/s - + 60 FPS 60 bilder/s - + 90 FPS 90 bilder/s - + 120 FPS 120 bilder/s - + Conservative Konservativ - + Aggressive Aggressiv - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (Assembly Shaders, endast NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (Experimentell, endast AMD/Mesa) - + Null Null - + Fast Snabb - - - + + + Accurate Exakt - - - + + + Default Standard - + Unsafe (fast) Osäker (snabb) - + Safe (stable) Säker (stabil) - + Immediate Omedelbar - + Balanced Balanserad - + Unsafe Inte säker - + Paranoid (disables most optimizations) Paranoid (inaktiverar de flesta optimeringar) - + Debugging Felsökning - + Dynarmic Dynarmisk - + NCE NCE - + Borderless Windowed Ramlöst fönsterläge - + Exclusive Fullscreen Exklusiv helskärm - + No Video Output Ingen videoutgång - + CPU Video Decoding CPU-videoavkodning - + GPU Video Decoding (Default) GPU videoavkodning (standard) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [EXPERIMENTELL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [EXPERIMENTELL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [EXPERIMENTELL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [EXPERIMENTELL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [EXPERIMENTELL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Närmsta granne - + Bilinear Bilinjär - + Bicubic Bikubisk - + Gaussian Gaussisk - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Område - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Ingen - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Standard (16:9) - + Force 4:3 Tvinga 4:3 - + Force 21:9 Tvinga 21:9 - + Force 16:10 Tvinga 16:10 - + Stretch to Window Sträck ut till fönster - + Automatic Automatiskt - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japanska (日本語) - + American English Amerikansk engelska - + French (français) Franska (français) - + German (Deutsch) Tyska (Deutsch) - + Italian (italiano) Italienska (italiano) - + Spanish (español) Spanska (español) - + Chinese Kinesiska - + Korean (한국어) Koreanska (한국어) - + Dutch (Nederlands) Nederländska (Nederlands) - + Portuguese (português) Portugisiska (português) - + Russian (Русский) Ryska (Русский) - + Taiwanese Taiwanesiska - + British English Brittisk engelska - + Canadian French Kanadensisk franska - + Latin American Spanish Latinamerikansk spanska - + Simplified Chinese Förenklad kinesiska - + Traditional Chinese (正體中文) Traditionell kinesiska (正體中文) - + Brazilian Portuguese (português do Brasil) Brasiliansk portugisiska (português do Brasil) - + Polish (polska) Polska (polska) - + Thai (แบบไทย) Thai (แบบไทย) - - + + Japan Japan - + USA USA - + Europe Europa - + Australia Australien - + China Kina - + Korea Korea - + Taiwan Taiwan - + Auto (%1) Auto select time zone Auto (%1) - + Default (%1) Default time zone Standard (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Kuba - + EET EET - + Egypt Egypten - + Eire Irland - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Irland - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hongkong - + HST HST - + Iceland Island - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libyen - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Polen - + Portugal Portugal - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Turkiet - + UCT UCT - + Universal Universal - + UTC UTC - + W-SU W-SU - + WET VÅT - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4 GB DRAM (standard) - + 6GB DRAM (Unsafe) 6 GB DRAM (osäker) - + 8GB DRAM 8 GB DRAM - + 10GB DRAM (Unsafe) 10 GB DRAM (osäker) - + 12GB DRAM (Unsafe) 12 GB DRAM (osäker) - + Docked Dockad - + Handheld Handhållen - - + + Normal Normal - - + + Boost Förstärk - - + + Overclock Överklocka - + Always ask (Default) Fråga alltid (standard) - + Only if game specifies not to stop Endast om spelet anger att det inte ska stoppas - + Never ask Fråga aldrig - + Very Small (16 MB) Mycket liten (16 MB) - + Small (32 MB) Liten (32 MB) - + Normal (128 MB) Normal (128 MB) - + Large (256 MB) Stor (256 MB) - + Very Large (512 MB) Mycket stor (512 MB) - + Very Low (4 MB) Mycket låg (4 MB) - + Low (8 MB) Låg (8 MB) - + Normal (16 MB) Normal (16 MB) - + Medium (32 MB) Medium (32 MB) - + High (64 MB) Hög (64 MB) - + Very Low (32) Mycket låg (32) - + Low (64) Låg (64) - + Normal (128) Normal (128) - + Medium (256) Medium (256) - + High (512) Hög (512) - + ExtendedDynamicState 1 ExtendedDynamicState 1 - + ExtendedDynamicState 2 ExtendedDynamicState 2 - + ExtendedDynamicState 3 ExtendedDynamicState 3 - + Tree View Trädvy - + Grid View Rutnätsvy @@ -2974,7 +2982,7 @@ Om du aktiverar den hoppar du över sådana uppmaningar och avslutar emuleringen ... - ... + … @@ -3049,33 +3057,33 @@ Om du aktiverar den hoppar du över sådana uppmaningar och avslutar emuleringen Select Emulated NAND Directory... - Välj katalog för emulerad NAND... + Välj katalog för emulerad NAND… Select Emulated SD Directory... - Välj katalog för emulerad SD... + Välj katalog för emulerad SD… Select Save Data Directory... - Välj katalog för sparat data... + Välj katalog för sparat data… Select Gamecard Path... - Välj sökväg för Gamecard... + Välj sökväg för Gamecard… Select Dump Directory... - Välj dumpkatalog... + Välj dumpkatalog… Select Mod Load Directory... - Välj katalog för modinläsningar... + Välj katalog för modinläsningar… @@ -3133,7 +3141,7 @@ Till: %2 Migrating save data... - Migrerar sparat data... + Migrerar sparat data… @@ -3224,7 +3232,7 @@ Vill du ta bort gammalt sparat data? Select External Content Directory... - Välj katalog för externt innehåll... + Välj katalog för externt innehåll… @@ -3273,7 +3281,7 @@ Vill du ta bort gammalt sparat data? Configure Effects... - Konfigurera effekter... + Konfigurera effekter… @@ -3820,7 +3828,7 @@ Vill du ta bort gammalt sparat data? Aimed to disable SDL GUIDE button hack: synthetic GUIDE(HOME) event when SELECT(MINUS) + START(PLUS) pressed. May impact Win related trigger/rumble/etc stuff - Avsedd att stänga av SDL:s GUIDE-knappshack: syntetisk GUIDE(HOME)-händelse när SELECT(MINUS) + START(PLUS) trycks ned. Kan påverka Windows-relaterade avtryckare, vibrationer med mera. + Avsedd att stänga av SDL:s GUIDE-knappshack: syntetisk GUIDE(HOME)-händelse när SELECT(MINUS) + START(PLUS) trycks ned. Kan påverka Windows-relaterade avtryckare, vibrationer med mera @@ -4019,7 +4027,7 @@ Vill du ta bort gammalt sparat data? Modifier Range: 0% - Modifieringsintervall: 0% + Modifieringsintervall: 0 % @@ -4203,7 +4211,7 @@ Vill du ta bort gammalt sparat data? Choose a value between 0% and 100% - Välj ett värde mellan 0% och 100% + Välj ett värde mellan 0 % och 100 % @@ -4241,13 +4249,13 @@ Om du vill invertera axlarna för du joysticken först vertikalt och sedan horis Deadzone: %1% - Dödzon: %1% + Dödzon: %1 % Modifier Range: %1% - Modifieringsintervall: %1% + Modifieringsintervall: %1 % @@ -4636,8 +4644,8 @@ Om du vill invertera axlarna för du joysticken först vertikalt och sedan horis Mouse panning works better with a deadzone of 0% and a range of 100%. Current values are %1% and %2% respectively. - Muspanorering fungerar bättre med en dödzon på 0% a och ett intervall på 100%. -Nuvarande värden är %1% respektive %2%. + Muspanorering fungerar bättre med en dödzon på 0 % och ett intervall på 100 %. +Nuvarande värden är %1 % respektive %2 %. @@ -4886,7 +4894,7 @@ För att ta bort NAND-installerade uppdateringar, högerklicka på spelet i spel Once deleted, these can NOT be recovered. Are you 100% sure you want to delete them? -När de har tagits bort kan de INTE återställas. Är du 100% säker på att du vill ta bort dem? +När de har tagits bort kan de INTE återställas. Är du 100 % säker på att du vill ta bort dem? @@ -5250,7 +5258,7 @@ UUID: %2 Deadzone: %1% - Dödzon: %1% + Dödzon: %1 % @@ -5377,7 +5385,7 @@ UUID: %2 ... - ... + … @@ -5390,7 +5398,7 @@ UUID: %2 Select TAS Load Directory... - Välj katalog för TAS-inläsningar... + Välj katalog för TAS-inläsningar… @@ -5657,7 +5665,7 @@ Dra punkterna för att ändra position, eller dubbelklicka på tabellcellerna f ... - ... + … @@ -5672,7 +5680,7 @@ Dra punkterna för att ändra position, eller dubbelklicka på tabellcellerna f Select Screenshots Path... - Välj sökväg för skärmdumpar... + Välj sökväg för skärmdumpar… @@ -5924,7 +5932,7 @@ Dra punkterna för att ändra position, eller dubbelklicka på tabellcellerna f Calculating... - Beräknar... + Beräknar… @@ -6806,7 +6814,7 @@ Felsökningsmeddelande: Loading... - Läser in... + Läser in… @@ -6816,7 +6824,7 @@ Felsökningsmeddelande: Launching... - Startar... + Startar… @@ -7033,17 +7041,17 @@ Felsökningsmeddelande: &Install Files to NAND... - &Installera filer till NAND... + &Installera filer till NAND… L&oad File... - Läs &in fil... + Läs &in fil… Load &Folder... - Läs in &mapp... + Läs in &mapp… @@ -7079,7 +7087,7 @@ Felsökningsmeddelande: Con&figure... - Kon&figurera... + Kon&figurera… @@ -7144,7 +7152,7 @@ Felsökningsmeddelande: Load/Remove &Amiibo... - Läs in/ta bort &Amiibo... + Läs in/ta bort &Amiibo… @@ -7194,12 +7202,12 @@ Felsökningsmeddelande: &Configure TAS... - &Konfigurera TAS... + &Konfigurera TAS… Configure C&urrent Game... - Konfigurera a&ktuellt spel... + Konfigurera a&ktuellt spel… @@ -7369,7 +7377,7 @@ Felsökningsmeddelande: Loading Web Applet... - Läser in webbapplet... + Läser in webbapplet… @@ -7397,7 +7405,7 @@ Felsökningsmeddelande: Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a Switch. - Aktuell emuleringshastighet. Värden högre eller lägre än 100% indikerar att emuleringen körs snabbare eller långsammare än en Switch. + Aktuell emuleringshastighet. Värden högre eller lägre än 100 % indikerar att emuleringen körs snabbare eller långsammare än en Switch. @@ -7427,7 +7435,7 @@ Felsökningsmeddelande: Configure Effects... - Konfigurera effekter... + Konfigurera effekter… @@ -7509,7 +7517,7 @@ Felsökningsmeddelande: Closing software... - Stänger programvara... + Stänger programvara… @@ -7626,12 +7634,12 @@ Felsökningsmeddelande: There is not enough free space at %1 to extract the RomFS. Please free up space or select a different dump directory at Emulation > Configure > System > Filesystem > Dump Root - Det finns inte tillräckligt med ledigt utrymme på %1 för att extrahera RomFS. Frigör utrymme eller välj en annan dumpkatalog under Emulering > Konfigurera > System > Filsystem > Dumprot. + Det finns inte tillräckligt med ledigt utrymme på %1 för att extrahera RomFS. Frigör utrymme eller välj en annan dumpkatalog under Emulering > Konfigurera > System > Filsystem > Dumprot Extracting RomFS... - Extraherar RomFS... + Extraherar RomFS… @@ -7713,7 +7721,7 @@ Felsökningsmeddelande: Installing file "%1"... - Installerar filen "%1"... + Installerar filen "%1"… @@ -7800,7 +7808,7 @@ Använd endast denna funktion för att installera uppdateringar och DLC. Select NCA Install Type... - Välj NCA-installationstyp... + Välj NCA-installationstyp… @@ -7884,7 +7892,7 @@ Använd endast denna funktion för att installera uppdateringar och DLC. The current amiibo has been removed - Den aktuella amiibo har tagits bort. + Den aktuella amiibo har tagits bort @@ -7915,7 +7923,7 @@ Använd endast denna funktion för att installera uppdateringar och DLC. The selected file is not a valid amiibo - Den valda filen är inte en giltig amiibo. + Den valda filen är inte en giltig amiibo @@ -8011,12 +8019,12 @@ Använd endast denna funktion för att installera uppdateringar och DLC. Speed: %1% / %2% - Hastighet: %1% / %2% + Hastighet: %1 % / %2 % Speed: %1% - Hastighet: %1% + Hastighet: %1 % @@ -8052,7 +8060,7 @@ Använd endast denna funktion för att installera uppdateringar och DLC. VOLUME: %1% Volume percentage (e.g. 50%) - VOLYM: %1% + VOLYM: %1 % @@ -8503,7 +8511,7 @@ Fortsätt ändå? UUID must be 32 hex characters (0-9, A-F) - UUID måste vara 32 hexadecimala tecken (0-9, A-F) + UUID måste vara 32 hexadecimala tecken (0 till 9, A-F) @@ -8587,7 +8595,7 @@ Fortsätt ändå? Must be 32 hex characters (0-9, a-f) Tooltip - Måste vara 32 hexadecimala tecken (0-9, a-f) + Måste vara 32 hexadecimala tecken (0 till 9, a-f) @@ -8793,7 +8801,7 @@ p, li { white-space: pre-wrap; } Migrating, this may take a while... - Migrerar, det kan ta ett tag... + Migrerar, det kan ta ett tag… @@ -9308,7 +9316,7 @@ p, li { white-space: pre-wrap; } ... - ... + … @@ -9356,7 +9364,7 @@ p, li { white-space: pre-wrap; } Installing Firmware... - Installerar firmware... + Installerar firmware… @@ -9396,7 +9404,7 @@ p, li { white-space: pre-wrap; } Verifying integrity... - Verifierar integritet... + Verifierar integritet… @@ -9454,7 +9462,7 @@ p, li { white-space: pre-wrap; } UNEXPECTED BAD THINGS MAY HAPPEN IF YOU DON'T READ THIS!<br>Eden has detected the following save directories with no attached profile:<br>%1<br><br>The following profiles are valid:<br>%2<br><br>Click "OK" to open your save folder and fix up your profiles.<br>Hint: copy the contents of the largest or last-modified folder elsewhere, delete all orphaned profiles, and move your copied contents to the good profile.<br><br>Still confused? See the <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/Orphaned.md'>help page</a>.<br> - OVÄNTADE PROBLEM KAN UPPSTÅ OM DU INTE LÄSER DETTA!<br>Eden har upptäckt följande sparningskataloger utan bifogade profiler:<br>%1<br><br>Följande profiler är giltiga:<br>%2<br><br>Klicka på ”OK” för att öppna din sparningsmapp och fixa dina profiler.<br>Tips: kopiera innehållet i den största eller senast ändrade mappen till en annan plats, ta bort alla övergivna profiler och flytta det kopierade innehållet till den giltiga profilen.<br><br>Fortfarande förvirrad? Se <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/Orphaned.md'>hjälpsidan</a>.<br> + OVÄNTADE PROBLEM KAN UPPSTÅ OM DU INTE LÄSER DETTA!<br>Eden har upptäckt följande sparningskataloger utan bifogade profiler:<br>%1<br><br>Följande profiler är giltiga:<br>%2<br><br>Klicka på ”OK” för att öppna din sparningsmapp och rätta till dina profiler.<br>Tips: kopiera innehållet i den största eller senast ändrade mappen till en annan plats, ta bort alla övergivna profiler och flytta det kopierade innehållet till den giltiga profilen.<br><br>Fortfarande förvirrad? Se <a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/Orphaned.md'>hjälpsidan</a>.<br> @@ -9476,12 +9484,12 @@ p, li { white-space: pre-wrap; } Once deleted, your data will NOT come back! Only do this if you're 100% sure you want to delete this data. När dina data har raderats kan de INTE återställas! -Gör detta endast om du är 100% säker på att du vill radera dessa data. +Gör detta endast om du är 100 % säker på att du vill radera dessa data. Clearing... - Tömmer... + Tömmer… @@ -9503,7 +9511,7 @@ Gör detta endast om du är 100% säker på att du vill radera dessa data. Exporting data. This may take a while... - Exporterar data. Detta kan ta en stund... + Exporterar data. Detta kan ta en stund… @@ -9558,7 +9566,7 @@ Gör detta endast om du är 100% säker på att du vill radera dessa data. Importing data. This may take a while... - Importerar data. Detta kan ta en stund... + Importerar data. Detta kan ta en stund… @@ -10073,12 +10081,12 @@ De flesta mods är RomFS-mods, men patchar (.pchtxt) är vanligtvis ExeFS-mods.< Successfully installed firmware version %1 - Firmware-version %1 har installerats. + Firmware-version %1 har installerats Unable to locate potential firmware NCA files - Det går inte att hitta potentiella NCA-filer för firmware. + Det går inte att hitta potentiella NCA-filer för firmware @@ -10198,7 +10206,7 @@ Detta rekommenderas om du vill dela data mellan emulatorer. 1 - 8 - 1 - 8 + 1 till 8 @@ -10608,7 +10616,7 @@ p, li { white-space: pre-wrap; } By selecting "From Eden", previous save data stored in Ryujinx will be deleted, and vice versa for "From Ryujinx". Genom att länka sparade data till Ryujinx kan både Ryujinx och Eden referera till samma sparade filer för dina spel. -Om du väljer ”Från Eden” tas tidigare sparade data bort som lagrats i Ryujinx, och vice versa för ”Från Ryujinx”. +Om du väljer ”Från Eden” tas tidigare sparade data bort som lagrats i Ryujinx och vice versa för ”Från Ryujinx”. @@ -10726,7 +10734,7 @@ Om du väljer ”Från Eden” tas tidigare sparade data bort som lagrats i Ryuj Downloading... - Hämtar ner... + Hämtar ner… diff --git a/dist/languages/tr_TR.ts b/dist/languages/tr_TR.ts index 95f0e25c31..b63445c3fb 100644 --- a/dist/languages/tr_TR.ts +++ b/dist/languages/tr_TR.ts @@ -712,12 +712,32 @@ Aggressive mode may impact performance of other applications such as recording s Bellek güncellemeleri sırasında belirli önbellek geçersiz kılma işlemlerini atlayarak işlemci kullanımını azaltır ve gecikmeyi iyileştirir. Bu, hafif çökmelere neden olabilir. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: VSync Modu: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -725,79 +745,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te FIFO (VSync) kare düşürmez veya yırtılma göstermez ancak ekran yenileme hızıyla sınırlıdır. FIFO Relaxed, yavaşlamadan toparlanırken yırtılmaya izin verir. Mailbox, FIFO'dan daha düşük gecikmeye sahip olabilir ve yırtılma yapmaz ancak kare düşürebilir. Immediate (senkronizasyon yok), mevcut olanı anında sunar ve yırtılmalara neden olabilir. - + Sync Memory Operations Bellek İşlemlerini Senkronize Et - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. Hesaplama ve bellek işlemleri arasında veri tutarlılığı sağlar. Bu seçenek oyunlardaki sorunları giderir ancak performansı düşürebilir. Unreal Engine 4 oyunları genellikle bundan en önemli ölçüde etkilenenlerdir. - + Enable asynchronous presentation (Vulkan only) Asenkron sunumu etkinleştir (Yalnızca Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Sunum işlemini ayrı bir işlemci iş parçacığına taşıyarak performansı biraz artırır. - + Force maximum clocks (Vulkan only) En yüksek hızı zorla (Yalnızca Vulkan için) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Grafik komutlarını beklerken GPU'nun hızının düşmesini engellemek için arka planda görev yürütür - + Anisotropic Filtering: Anisotropic Filtering: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Eğik açılardaki doku oluşturma kalitesini kontrol eder. Çoğu grafik kartında 16x olarak ayarlanması güvenlidir. - + GPU Mode: Grafik Kartı Modu - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: DMA Doğruluğu: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -806,1302 +826,1291 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Asenkron gölgelendirici derlemeyi etkinleştir - + May reduce shader stutter. Gölgelendirici/shader takılmalarını azaltabilir. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Vulkan pipeline önbelleği kullan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Grafik kartı üreticisine özel işlem hattı önbelleğini etkinleştirir. Bu seçenek, Vulkan sürücüsünün işlem hattı önbellek dosyalarını dahili olarak saklamadığı durumlarda gölgelendirici yükleme süresini önemli ölçüde iyileştirebilir. - + Enable Compute Pipelines (Intel Vulkan Only) Hesaplama İşlem Hatlarını Etkinleştir (Yalnızca Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. Bazı oyunlar için gereklidir. Bu ayar yalnızca Intel'in tescilli sürücüleri için mevcuttur ve etkinleştirilirse çökmeye neden olabilir. Hesaplama işlem hatları diğer tüm sürücülerde her zaman etkindir. - + Enable Reactive Flushing Reaktif Temizlemeyi Etkinleştir - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Tahminli temizleme yerine reaktif temizleme kullanarak daha doğru bellek senkronizasyonu sağlar. - + Sync to framerate of video playback Video oynatma kare hızına senkronize et - + Run the game at normal speed during video playback, even when the framerate is unlocked. Kare hızı kilidi açık olsa bile video oynatımı sırasında oyunu normal hızda çalıştırır. - + Barrier feedback loops Bariyer geri besleme döngüleri - + Improves rendering of transparency effects in specific games. Belirli oyunlarda şeffaflık efektlerinin oluşturulmasını iyileştirir. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State Genişletilmiş Dinamik Durum - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Genişletilmiş Dinamik Durumda kullanılabilecek özelliklerin sayısını kontrol eder. Daha yüksek durumlar daha fazla özelliğe izin verir ve performansı artırabilir, ancak ek grafik sorunlarına neden olabilir. - + Vertex Input Dynamic State Vertex Dinamik Durumu - + Enables vertex input dynamic state feature for better quality and performance. Daha iyi kalite ve performans için Vertex dinamik durum özelliğini etkinleştirir. - + Sample Shading Örnek Gölgelendirme - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Parça gölgelendiricinin, her parça için bir kez yerine çoklu örneklenmiş bir parçadaki her örnek için yürütülmesine olanak tanır. Performans pahasına grafik kalitesini artırır. Daha yüksek değerler kaliteyi artırır ancak performansı düşürür. - + RNG Seed RNG çekirdeği - + Controls the seed of the random number generator. Mainly used for speedrunning. Rastgele sayı üretecinin tohumunu kontrol eder. Esas olarak hızlı bitirme denemeleri için kullanılır. - + Device Name Cihaz İsmi - + The name of the console. Konsolun adı - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: Özel RTC Tarihi - + This option allows to change the clock of the console. Can be used to manipulate time in games. Bu seçenek konsolun saatini değiştirmeye olanak tanır. Oyunlarda zamanı manipüle etmek için kullanılabilir. - + The number of seconds from the current unix time Mevcut unix zamanından itibaren saniye sayısı - + Language: Dil: - + This option can be overridden when region setting is auto-select Bölge ayarı otomatik seçim olduğunda bu seçenek geçersiz kılınabilir. - + Region: Bölge: - + The region of the console. Konsolun bölgesi - + Time Zone: Saat Dilimi: - + The time zone of the console. Konsolun saat dilimi - + Sound Output Mode: Ses Çıkış Modu: - + Console Mode: Konsol Modu: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. Konsolun Yerleşik veya El Modunda olup olmadığını seçer. Oyunlar bu ayara bağlı olarak çözünürlüklerini, detaylarını ve desteklenen kontrolcülerini değiştirecektir. El Moduna ayarlamak, düşük seviyeli sistemler için performansı artırmaya yardımcı olabilir. - + Prompt for user profile on boot Açılışta kullanıcı profili için sor - + Useful if multiple people use the same PC. Aynı bilgisayarı birden fazla kişi kullanıyorsa yararlıdır. - + Pause when not in focus Odaklı değilken duraklat - + Pauses emulation when focusing on other windows. Diğer pencerelere odaklanıldığında emülasyonu duraklatır. - + Confirm before stopping emulation Emülasyonu durdurmadan önce onayla - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Emülasyonu durdurma onayı isteklerini/istemlerini geçersiz kılar. Etkinleştirildiğinde, bu tür istekleri/istemleri atlar ve emülasyonu doğrudan/dirket olarak kapatır. - + Hide mouse on inactivity Hareketsizlik durumunda imleci gizle - + Hides the mouse after 2.5s of inactivity. 2,5 saniye hareketsizlikten sonra fareyi gizler. - + Check for updates Güncellemeleri Kontrol Et - + Whether or not to check for updates upon startup. Başlangıçta güncellemelerin kontrol edilip edilmeyeceği. - + Enable Gamemode Oyun Modunu/Gamemode Etkinleştir - + Force X11 as Graphics Backend Grafik arka ucu olarak X11'i zorla - + Custom frontend Özel ön yüz - + Real applet Gerçek aplikasyon - - + + Disabled Devre Dışı - + Never Asla - + On Load Yüklemede - + Always Her zaman - + CPU CPU - + GPU GPU - + CPU Asynchronous Asenkron CPU - + Uncompressed (Best quality) Sıkıştırılmamış (En iyi kalite) - + BC1 (Low quality) BC1 (Düşük kalite) - + BC3 (Medium quality) BC3 (Orta kalite) - - + + Auto Otomatik - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative Muhafazakar - + Aggressive Agresif - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Boş - + Fast Hızlı - - - + + + Accurate Doğru - - - + + + Default Varsayılan - + Unsafe (fast) Güvenli Değil (hızlı) - + Safe (stable) Güvenli (Stabil) - + Immediate - + Balanced Dengeli - + Unsafe Güvensiz - + Paranoid (disables most optimizations) Paranoya (çoğu optimizasyonu kapatır) - + Debugging Hata ayıklama - + Dynarmic Dinamik - + NCE NCE - + Borderless Windowed Kenarlıksız Tam Ekran - + Exclusive Fullscreen Ayrılmış Tam Ekran - + No Video Output Video Çıkışı Yok - + CPU Video Decoding CPU Video Decoding - + GPU Video Decoding (Default) GPU Video Decoding (Varsayılan) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [DENEYSEL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [DENEYSEL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [DENEYSEL] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [DENEYSEL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [DENEYSEL] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor En Yakın Komşu Algoritması - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gausyen - + Lanczos Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Süper Çözünürlük - + Area Area - + MMPX MMPX - + Zero-Tangent Zero-Tangent - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Yok - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Varsayılan (16:9) - + Force 4:3 4:3'e Zorla - + Force 21:9 21:9'a Zorla - + Force 16:10 16:10'a Zorla - + Stretch to Window Ekrana Sığdır - + Automatic Otomatik - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Japonca (日本語) - + American English Amerikan İngilizcesi - + French (français) Fransızca (français) - + German (Deutsch) Almanca (Deutsch) - + Italian (italiano) İtalyanca (italiano) - + Spanish (español) İspanyolca (español) - + Chinese Çince - + Korean (한국어) Korece (한국어) - + Dutch (Nederlands) Flemenkçe (Nederlands) - + Portuguese (português) Portekizce (português) - + Russian (Русский) Rusça (Русский) - + Taiwanese Tayvanca - + British English İngiliz İngilizcesi - + Canadian French Kanada Fransızcası - + Latin American Spanish Latin Amerika İspanyolcası - + Simplified Chinese Basitleştirilmiş Çince - + Traditional Chinese (正體中文) Geleneksel Çince (正體中文) - + Brazilian Portuguese (português do Brasil) Brezilya Portekizcesi (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Japonya - + USA ABD - + Europe Avrupa - + Australia Avustralya - + China Çin - + Korea Kore - + Taiwan Tayvan - + Auto (%1) Auto select time zone Otomatik (%1) - + Default (%1) Default time zone Varsayılan (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Küba - + EET EET - + Egypt Mısır - + Eire İrlanda - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-İrlanda - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 MT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hong Kong - + HST HST - + Iceland İzlanda - + Iran İran - + Israel İsrail - + Jamaica Jamaika - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navaho - + NZ Yeni Zelanda - + NZ-CHAT Chatham Adaları - + Poland Polonya - + Portugal Portekiz - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapur - + Turkey Türkiye - + UCT UCT - + Universal Evrensel - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) 4GB DRAM (Varsayılan) - + 6GB DRAM (Unsafe) 6GB DRAM (Güvenli Değil) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (Güvenli Değil) - + 12GB DRAM (Unsafe) 12GB DRAM (Güvenli Değil) - + Docked Dock Modu Aktif - + Handheld Taşınabilir - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Her zaman sor (Varsayılan) - + Only if game specifies not to stop Sadece oyun durdurulmamasını belirtirse - + Never ask Asla sorma - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) Orta (256) - + High (512) Yüksek (512) - + ExtendedDynamicState 1 Genişletilmiş Dinamik Durum 1 - + ExtendedDynamicState 2 Genişletilmiş Dinamik Durum 2 - + ExtendedDynamicState 3 Genişletilmiş Dinamik Durum 3 - + Tree View - + Grid View diff --git a/dist/languages/uk.ts b/dist/languages/uk.ts index 2fdce360cc..fd166bc4f9 100644 --- a/dist/languages/uk.ts +++ b/dist/languages/uk.ts @@ -732,12 +732,32 @@ Aggressive mode may impact performance of other applications such as recording s Пропускає деякі анулювання кешу під час оновлень пам’яті, зменшуючи використання ЦП й виправляючи затримки. Це може спричинити збої. - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Режим вертикальної синхронізації: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -748,12 +768,12 @@ Mailbox може мати меншу затримку, ніж FIFO, і не ма Immediate (без синхронізації) показує всі кадри й може створювати розриви. - + Sync Memory Operations Синхронізувати операції з пам’яттю - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -762,44 +782,44 @@ Unreal Engine 4 games often see the most significant changes thereof. Ігри на Unreal Engine 4 часто зазнають найзначніших змін. - + Enable asynchronous presentation (Vulkan only) Увімкнути асинхронне подання (лише Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. Трохи покращує продуктивність завдяки переміщенню подання на окремий потік ЦП. - + Force maximum clocks (Vulkan only) Примусово максимальна тактова частота (лише Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Виконує роботу у фоновому режимі в очікуванні графічних команд, не даючи змоги ГП знижувати тактову частоту. - + Anisotropic Filtering: Анізотропна фільтрація: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. Керує якістю візуалізації текстур під непрямими кутами. Для більшості ГП можна вільно вибирати 16x. - + GPU Mode: Режим ГП: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -808,24 +828,24 @@ Particles tend to only render correctly with Accurate mode. Частинки зазвичай правильно візуалізуються лише з режимом «Точно». - + DMA Accuracy: Точність DMA: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -834,44 +854,44 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation Увімкнути асинхронну компіляцію шейдерів - + May reduce shader stutter. Може зменшити шейдерні затримки. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle Розпакування за допомогою ГП - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. Прискорює декодування 3D-текстур BCn застосовуючи обчислення за допомогою ГП. Вимкніть у разі збоїв або проблем із графікою. - + GPU Unswizzle Max Texture Size Максимальний розмір текстур для розпакування за допомогою ГП - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -880,48 +900,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size Розмір потоку розпакування за допомогою ГП - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. Встановлює максимальний обсяг даних текстур (у МіБ) для обробки на кадр. Вищі значення здатні зменшити затримки під час завантаження текстур, але можуть вплинути на стабільність кадрів. - + GPU Unswizzle Chunk Size Розмір блоків розпакування за допомогою ГП - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. Визначає кількість зрізів глибини, оброблених за одне відправлення. Збільшення здатне покращити пропускну здатність на потужних ГП, але може призвести до TDR або затримок драйвера зі слабшим устаткуванням. - + Use Vulkan pipeline cache Використовувати кеш конвеєра Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. Вмикає особливий для різних виробників ГП кеш конвеєра. Це налаштування може значно зменшити час завантаження шейдерів у випадках, коли драйвер Vulkan не зберігає власний кеш конвеєра. - + Enable Compute Pipelines (Intel Vulkan Only) Увімкнути обчислювальні конвеєри (лише Intel Vulkan) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -930,194 +950,182 @@ Compute pipelines are always enabled on all other drivers. Обчислювальні конвеєри завжди увімкнені у всіх інших драйверах. - + Enable Reactive Flushing Увімкнути реактивне очищення - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. Використовує реактивне очищення замість прогнозованого, забезпечуючи точнішу синхронізацію пам’яті. - + Sync to framerate of video playback Синхронізувати частоту кадрів з відтворенням відео - + Run the game at normal speed during video playback, even when the framerate is unlocked. Відтворювати гру з нормальною швидкістю під час відтворення відео навіть при розблокованій частоті кадрів. - + Barrier feedback loops Бар’єрні цикли відгуку - + Improves rendering of transparency effects in specific games. Покращує візуалізацію ефектів прозорості в деяких іграх. - + Enable buffer history Увімкнути історію буфера - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. Вмикає доступ до попередніх станів буфера. Цей параметр може покращити якість візуалізації та стабільну продуктивність у деяких іграх. - + Fix bloom effects Виправити ефекти світіння - + Removes bloom in Burnout. Прибирає світіння в Burnout. - - Enable Legacy Rescale Pass - Увімкнути застаріле масштабування - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - Може виправити проблеми з масштабуванням в іграх, покладаючись на поведінку з попередньої імплементації. -Застаріле масштабування виправляє артефакти з лініями на ГП від AMD та Intel, а також сіре блимання текстур на ГП від Nvidia в Luigis Mansion 3. - - - + Extended Dynamic State Розширений динамічний стан - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. Керує кількістю функцій, які можна використовувати в «Розширеному динамічному стані». Вищі значення допускають більше функцій і можуть збільшити продуктивність, але можуть спричинити додаткові проблеми з графікою. - + Vertex Input Dynamic State Динамічний стан введення вершин - + Enables vertex input dynamic state feature for better quality and performance. Вмикає можливість динамічного стану введення вершин для кращих якості й продуктивності. - + Sample Shading Шейдинг зразків - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. Дозволяє виконувати фрагмент шейдера для кожного зразка в багатозразковому фрагменті замість одного разу для кожного фрагмента. Покращує якість графікі ціною втрати продуктивності. Вищі значення покращують якість, але погіршують продуктивність. - + RNG Seed Початкове значення RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. Керує початковим значення генератора випадкових чисел. Зазвичай використовується в спідранах. - + Device Name Назва пристрою - + The name of the console. Назва консолі. - + Homebrew Args Параметри запуску Homebrew - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). Параметри командного рядка, що передаються Homebrew при запуску (як-от noglsl). - + Custom RTC Date: Користувацька дата RTC: - + This option allows to change the clock of the console. Can be used to manipulate time in games. Це налаштування дозволяє змінити час годинника консолі. Можна використовувати для маніпуляцій із часом в іграх. - + The number of seconds from the current unix time Кількість секунд від поточного unix-часу. - + Language: Мова: - + This option can be overridden when region setting is auto-select Це налаштування може перевизначитися, якщо налаштування регіону вибирається автоматично - + Region: Регіон: - + The region of the console. Регіон консолі. - + Time Zone: Часовий пояс: - + The time zone of the console. Часовий пояс консолі. - + Sound Output Mode: Режим виведення звуку: - + Console Mode: Режим консолі: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1126,1026 +1134,1026 @@ Setting to Handheld can help improve performance for low end systems. Налаштування «Портативний» може покращити продуктивність на слабких системах. - + Prompt for user profile on boot Запитувати профіль користувача під час запуску - + Useful if multiple people use the same PC. Корисно, якщо одним комп’ютером користуються кілька користувачів. - + Pause when not in focus Призупиняти, якщо не у фокусі - + Pauses emulation when focusing on other windows. Призупиняє емуляцію при фокусування на інших вікнах. - + Confirm before stopping emulation Підтверджувати зупинку емуляції - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. Перевизначає запити на підтвердження зупинки емуляції. Увімкнення обходить такі запити й одразу зупиняє емуляцію. - + Hide mouse on inactivity Приховувати курсор миші при бездіяльності - + Hides the mouse after 2.5s of inactivity. Приховує курсор миші після 2,5 с її бездіяльності. - + Check for updates Перевіряти оновлення - + Whether or not to check for updates upon startup. Чи перевіряти оновлення при запуску. - + Enable Gamemode Увімкнути ігровий режим - + Force X11 as Graphics Backend Примусово використовувати X11 як графічний бекенд - + Custom frontend Користувацький фронтенд - + Real applet Справжній аплет - - + + Disabled Вимкнено - + Never Ніколи - + On Load При завантаженні - + Always Завжди - + CPU ЦП - + GPU ГП - + CPU Asynchronous Асинхронно ЦП - + Uncompressed (Best quality) Без стиснення (Найкраща якість) - + BC1 (Low quality) ВС1 (Низька якість) - + BC3 (Medium quality) ВС3 (Середня якість) - - + + Auto Автоматично - + 30 FPS 30 к/с - + 60 FPS 60 к/с - + 90 FPS 90 к/с - + 120 FPS 120 к/с - + Conservative Заощадження - + Aggressive Агресивно - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (асемблерні шейдери, лише NVIDIA) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (експериментально, лише AMD/Mesa) - + Null Нічого - + Fast Швидко - - - + + + Accurate Точно - - - + + + Default Стандартно - + Unsafe (fast) Небезпечно (швидко) - + Safe (stable) Безпечно (стабільно) - + Immediate - + Balanced Збалансовано - + Unsafe Небезпечно - + Paranoid (disables most optimizations) Параноїк (вимикає більшість оптимізацій) - + Debugging Зневадження - + Dynarmic Динамічно - + NCE NCE - + Borderless Windowed Безрамкове вікно - + Exclusive Fullscreen Ексклюзивний повноекранний - + No Video Output Виведення відео відсутнє - + CPU Video Decoding Декодування відео на ЦП - + GPU Video Decoding (Default) Декодування відео на ГП (стандатно) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [ЕКСПЕРИМЕНТАЛЬНО] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [ЕКСПЕРИМЕНТАЛЬНО] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [ЕКСПЕРИМЕНТАЛЬНО] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [ЕКСПЕРИМЕНТАЛЬНО] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [ЕКСПЕРИМЕНТАЛЬНО] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Найближчий сусід - + Bilinear Білінійний - + Bicubic Бікубічний - + Gaussian Ґаусса - + Lanczos Ланцоша - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution AMD FidelityFX Super Resolution - + Area Області - + MMPX MMPX - + Zero-Tangent Нульовий тангенс - + B-Spline B-Spline - + Mitchell Мітчелла - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir Snapdragon Game Super Resolution EdgeDir - + None Немає - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Стандартно (16:9) - + Force 4:3 Примусово 4:3 - + Force 21:9 Примусово 21:9 - + Force 16:10 Примусово 16:10 - + Stretch to Window Розтягнути до вікна - + Automatic Автоматично - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Японська (日本語) - + American English Американська англійська - + French (français) Французька (français) - + German (Deutsch) Німецька (Deutsch) - + Italian (italiano) Італійська (italiano) - + Spanish (español) Іспанська (español) - + Chinese Китайська - + Korean (한국어) Корейська (한국어) - + Dutch (Nederlands) Нідерландська (Nederlands) - + Portuguese (português) Португальська (português) - + Russian (Русский) Російська (Русский) - + Taiwanese Тайванська - + British English Британська англійська - + Canadian French Канадська французька - + Latin American Spanish Латиноамериканська іспанська - + Simplified Chinese Спрощена китайська - + Traditional Chinese (正體中文) Традиційна китайська (正體中文) - + Brazilian Portuguese (português do Brasil) Бразильська португальська (português do Brasil) - + Polish (polska) Польська (polska) - + Thai (แบบไทย) Тайська (แบบไทย) - - + + Japan Японія - + USA США - + Europe Європа - + Australia Австралія - + China Китай - + Korea Корея - + Taiwan Тайвань - + Auto (%1) Auto select time zone Автоматично (%1) - + Default (%1) Default time zone Стандартно (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Куба - + EET EET - + Egypt Єгипет - + Eire Ейре - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Гринвіч - + Hongkong Гонконг - + HST HST - + Iceland Ісландія - + Iran Іран - + Israel Ізраїль - + Jamaica Ямайка - + Kwajalein Кваджалейн - + Libya Лівія - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Навахо - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Польща - + Portugal Португалія - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Сінгапур - + Turkey Туреччина - + UCT UCT - + Universal Універсальний - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Зулу - + Mono Моно - + Stereo Стерео - + Surround Об’ємний - + 4GB DRAM (Default) 4GB DRAM (стандартно) - + 6GB DRAM (Unsafe) 6GB DRAM (небезпечно) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (небезпечно) - + 12GB DRAM (Unsafe) 12GB DRAM (небезпечно) - + Docked У докстанції - + Handheld Портативний - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) Завжди запитувати (стандартно) - + Only if game specifies not to stop Лише якщо гра вказує не зупиняти - + Never ask Ніколи не запитувати - + Very Small (16 MB) Дуже малий (16 МБ) - + Small (32 MB) Малий (32 МБ) - + Normal (128 MB) Нормальний (128 МБ) - + Large (256 MB) Великий (256 МБ) - + Very Large (512 MB) Дуже великий (512 МБ) - + Very Low (4 MB) Дуже низький (4 МБ) - + Low (8 MB) Низький (8 МБ) - + Normal (16 MB) Нормальний (16 МБ) - + Medium (32 MB) Середній (32 МБ) - + High (64 MB) Високий (64 МБ) - + Very Low (32) Дуже низький (32) - + Low (64) Низький (64) - + Normal (128) Нормальний (128) - + Medium (256) Середньо (256) - + High (512) Високо (512) - + ExtendedDynamicState 1 Розширений динамічний стан 1 - + ExtendedDynamicState 2 Розширений динамічний стан 2 - + ExtendedDynamicState 3 Розширений динамічний стан 3 - + Tree View Дерево вибору - + Grid View Таблиця diff --git a/dist/languages/vi.ts b/dist/languages/vi.ts index f1257a08f5..f0a7e591bd 100644 --- a/dist/languages/vi.ts +++ b/dist/languages/vi.ts @@ -696,12 +696,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Chế độ Vsync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -709,79 +729,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Bật hiển thị bất đồng bộ (chỉ cho Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) Buộc chạy ở xung nhịp tối đa (chỉ cho Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Chạy các công việc trong nền trong khi đang chờ lệnh đồ họa để giữ cho GPU không giảm xung nhịp. - + Anisotropic Filtering: Lọc bất đẳng hướng: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -790,1301 +810,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Dùng bộ nhớ đệm pipeline Vulkan - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Bật xả tương ứng - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback Đồng bộ hóa với tốc độ khung hình khi phát video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Chạy game với tốc độ bình thường trong quá trình phát video, ngay cả khi tốc độ khung hình được mở khóa. - + Barrier feedback loops Vòng lặp phản hồi rào cản - + Improves rendering of transparency effects in specific games. Cải thiện hiệu quả kết xuất của hiệu ứng trong suốt trong một số game. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Hạt giống RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Tên thiết bị - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Vùng: - + The region of the console. - + Time Zone: Múi giờ: - + The time zone of the console. - + Sound Output Mode: Chế độ đầu ra âm thanh: - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Ẩn con trỏ chuột khi không dùng - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) Không nén (Chất lượng tốt nhất) - + BC1 (Low quality) BC1 (Chất lượng thấp) - + BC3 (Medium quality) BC3 (Chất lượng trung bình) - - + + Auto Tự động - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Chính xác - - - + + + Default Mặc định - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Không an toàn - + Paranoid (disables most optimizations) Paranoid (vô hiệu hoá hầu hết sự tối ưu) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Cửa sổ không viền - + Exclusive Fullscreen Toàn màn hình - + No Video Output Không có đầu ra video - + CPU Video Decoding Giải mã video bằng CPU - + GPU Video Decoding (Default) Giải mã video bằng GPU (Mặc định) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [THỬ NGHIỆM] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [THỬ NGHIỆM] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian Gaussian - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Không có - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Mặc định (16:9) - + Force 4:3 Dùng 4:3 - + Force 21:9 Dùng 21:9 - + Force 16:10 Dùng 16:10 - + Stretch to Window Mở rộng đến cửa sổ - + Automatic Tự động - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Tiếng Nhật (日本語) - + American English Tiếng Anh Mỹ - + French (français) Tiếng Pháp (French) - + German (Deutsch) Tiếng Đức (Deutsch) - + Italian (italiano) Tiếng Ý (italiano) - + Spanish (español) Tiếng Tây Ban Nha (Español) - + Chinese Tiếng Trung - + Korean (한국어) Tiếng Hàn (한국어) - + Dutch (Nederlands) Tiếng Hà Lan (Nederlands) - + Portuguese (português) Tiếng Bồ Đào Nha (Portuguese) - + Russian (Русский) Tiếng Nga (Русский) - + Taiwanese Tiếng Đài Loan - + British English Tiếng Anh Anh - + Canadian French Tiếng Pháp Canada - + Latin American Spanish Tiếng Tây Ban Nha Mỹ Latinh - + Simplified Chinese Tiếng Trung giản thể - + Traditional Chinese (正體中文) Tiếng Trung phồn thể (正體中文) - + Brazilian Portuguese (português do Brasil) Tiếng Bồ Đào Nha Brasil (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Nhật Bản - + USA Hoa Kỳ - + Europe Châu Âu - + Australia Úc - + China Trung Quốc - + Korea Hàn Quốc - + Taiwan Đài Loan - + Auto (%1) Auto select time zone Tự động (%1) - + Default (%1) Default time zone Mặc định (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ai Cập - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hồng Kông - + HST HST - + Iceland Iceland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Ba Lan - + Portugal Bồ Đào Nha - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Thổ Nhĩ Kỳ - + UCT UCT - + Universal Quốc tế - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Docked - + Handheld Handheld - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/vi_VN.ts b/dist/languages/vi_VN.ts index 64edf2850d..51156ca9c8 100644 --- a/dist/languages/vi_VN.ts +++ b/dist/languages/vi_VN.ts @@ -696,12 +696,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: Chế độ Vsync: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -709,79 +729,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) Bật hiển thị bất đồng bộ (chỉ dành cho Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. - + Force maximum clocks (Vulkan only) Buộc chạy ở xung nhịp tối đa (chỉ Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. Chạy các công việc trong nền trong khi đang chờ lệnh đồ họa để giữ cho GPU không giảm xung nhịp. - + Anisotropic Filtering: Bộ lọc góc nghiêng: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -790,1301 +810,1290 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache Dùng Vulkan pipeline cache - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. - + Enable Compute Pipelines (Intel Vulkan Only) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing Bật xả tương ứng - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. - + Sync to framerate of video playback Đồng bộ hóa với tốc độ khung hình khi phát video - + Run the game at normal speed during video playback, even when the framerate is unlocked. Chạy game với tốc độ bình thường trong quá trình phát video, ngay cả khi tốc độ khung hình được mở khóa. - + Barrier feedback loops Vòng lặp phản hồi rào cản - + Improves rendering of transparency effects in specific games. Cải thiện hiệu quả hiển thị của hiệu ứng trong suốt trong một số trò chơi. - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed Hạt giống RNG - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name Tên thiết bị - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: - + This option can be overridden when region setting is auto-select - + Region: Vùng: - + The region of the console. - + Time Zone: Múi giờ: - + The time zone of the console. - + Sound Output Mode: Chế độ đầu ra âm thanh - + Console Mode: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity Ẩn con trỏ chuột khi không dùng - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode - + Force X11 as Graphics Backend - + Custom frontend - + Real applet - - + + Disabled - + Never - + On Load - + Always - + CPU CPU - + GPU - + CPU Asynchronous - + Uncompressed (Best quality) Không nén (Chất lượng tốt nhất) - + BC1 (Low quality) BC1 (Chất lượng thấp) - + BC3 (Medium quality) BC3 (Chất lượng trung bình) - - + + Auto Tự động - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative - + Aggressive - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null Null - + Fast - - - + + + Accurate Tuyệt đối - - - + + + Default Mặc định - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe Tương đối - + Paranoid (disables most optimizations) Paranoid (vô hiệu hoá hầu hết sự tối ưu) - + Debugging - + Dynarmic - + NCE - + Borderless Windowed Cửa sổ không viền - + Exclusive Fullscreen Toàn màn hình - + No Video Output Không Video Đầu Ra - + CPU Video Decoding Giải mã video bằng CPU - + GPU Video Decoding (Default) Giải mã video bằng GPU (Mặc định) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [THỬ NGHIỆM] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [THỬ NGHIỆM] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor Nearest Neighbor - + Bilinear Bilinear - + Bicubic Bicubic - + Gaussian ScaleForce - + Lanczos - + ScaleForce ScaleForce - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None Trống - + FXAA FXAA - + SMAA SMAA - + Default (16:9) Mặc định (16:9) - + Force 4:3 Dùng 4:3 - + Force 21:9 Dùng 21:9 - + Force 16:10 Dung 16:10 - + Stretch to Window Kéo dãn đến cửa sổ phần mềm - + Automatic Tự động - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) Tiếng Nhật (日本語) - + American English Tiếng Anh Mỹ - + French (français) Tiếng Pháp (French) - + German (Deutsch) Tiếng Đức (Deutsch) - + Italian (italiano) Tiếng Ý (italiano) - + Spanish (español) Tiếng Tây Ban Nha (Spanish) - + Chinese Tiếng Trung - + Korean (한국어) Tiếng Hàn (한국어) - + Dutch (Nederlands) Tiếng Hà Lan (Dutch) - + Portuguese (português) Tiếng Bồ Đào Nha (Portuguese) - + Russian (Русский) Tiếng Nga (Русский) - + Taiwanese Tiếng Đài Loan - + British English Tiếng Anh UK (British English) - + Canadian French Tiếng Pháp Canada - + Latin American Spanish Tiếng Mỹ La-tinh - + Simplified Chinese Tiếng Trung giản thể - + Traditional Chinese (正體中文) Tiếng Trung phồn thể (正體中文) - + Brazilian Portuguese (português do Brasil) Tiếng Bồ Đào Nha của người Brazil (Português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan Nhật Bản - + USA Hoa Kỳ - + Europe Châu Âu - + Australia Châu Úc - + China Trung Quốc - + Korea Hàn Quốc - + Taiwan Đài Loan - + Auto (%1) Auto select time zone Tự động (%1) - + Default (%1) Default time zone Mặc định (%1) - + CET CET - + CST6CDT CST6CDT - + Cuba Cuba - + EET EET - + Egypt Ai Cập - + Eire Eire - + EST EST - + EST5EDT EST5EDT - + GB GB - + GB-Eire GB-Eire - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich Greenwich - + Hongkong Hồng Kông - + HST HST - + Iceland Iceland - + Iran Iran - + Israel Israel - + Jamaica Jamaica - + Kwajalein Kwajalein - + Libya Libya - + MET MET - + MST MST - + MST7MDT MST7MDT - + Navajo Navajo - + NZ NZ - + NZ-CHAT NZ-CHAT - + Poland Ba Lan - + Portugal Bồ Đào Nha - + PRC PRC - + PST8PDT PST8PDT - + ROC ROC - + ROK ROK - + Singapore Singapore - + Turkey Thổ Nhĩ Kỳ - + UCT UCT - + Universal Quốc tế - + UTC UTC - + W-SU W-SU - + WET WET - + Zulu Zulu - + Mono Mono - + Stereo Stereo - + Surround Surround - + 4GB DRAM (Default) - + 6GB DRAM (Unsafe) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked Chế độ cắm TV - + Handheld Cầm tay - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) - + Only if game specifies not to stop - + Never ask - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/dist/languages/zh_CN.ts b/dist/languages/zh_CN.ts index e6d5890370..2b86a73843 100644 --- a/dist/languages/zh_CN.ts +++ b/dist/languages/zh_CN.ts @@ -734,12 +734,32 @@ Aggressive mode may impact performance of other applications such as recording s 在内存更新期间跳过某些缓存失效,从而降低 CPU 使用率并改善延迟。这可能导致软件崩溃。 - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: 垂直同步模式: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -750,12 +770,12 @@ Mailbox 的延迟可能比 FIFO 低且不会导致撕裂,但可能会丢帧。 Immediate (不同步) 会呈现全部可用内容,并可能出现撕裂。 - + Sync Memory Operations 同步内存操作 - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. @@ -764,44 +784,44 @@ Unreal Engine 4 games often see the most significant changes thereof. 虚幻 4 引擎的游戏通常会看到最显著的变化。 - + Enable asynchronous presentation (Vulkan only) 启用异步帧提交 (仅限 Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. 将帧提交移动到单独的 CPU 线程,略微提高性能。 - + Force maximum clocks (Vulkan only) 强制最大时钟 (仅限 Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. 在后台运行的同时等待图形命令,以防止 GPU 降低时钟速度。 - + Anisotropic Filtering: 各向异性过滤: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. 控制在斜角下纹理渲染的质量。 大多数 GPU 上设置为 16 倍是安全的。 - + GPU Mode: GPU 模式: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. @@ -809,12 +829,12 @@ Particles tend to only render correctly with Accurate mode. 大多数游戏在“快速”模式下渲染效果良好,但有些游戏仍需使用“精确”模式。而粒子效果通常只有在“精确”模式下才能正确渲染。 - + DMA Accuracy: DMA 精度: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. @@ -823,12 +843,12 @@ Default follows the GPU Accuracy setting. 默认使用 GPU 精度设置。 - + GPU Fence Behavior: GPU 围栏行为: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -837,43 +857,43 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation 开启异步着色器编译 - + May reduce shader stutter. 可能减少着色器卡顿。 - + GPU Clocks GPU 时钟频率 - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. 通过让游戏误以为 GPU 的处理速度比实际更快,以避免游戏为了适应 Switch 的时钟频率而降低分辨率和渲染距离。 - + GPU Unswizzle GPU 还原 - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. 利用 GPU 计算来加速 BCn 格式 3D 纹理的解码。如果遇到崩溃或画面花屏,请禁用此项。 - + GPU Unswizzle Max Texture Size GPU 还原最大纹理尺寸 - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. @@ -882,48 +902,48 @@ Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size GPU 还原流大小 - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. 设置每帧处理的纹理数据最大量(单位:MiB)。 较高的数值可以减少纹理加载时的卡顿,但可能会影响帧率的稳定性(即造成帧时间波动)。 - + GPU Unswizzle Chunk Size GPU 还原块大小 - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. 确定在单次调度(Dispatch)中处理的深度切片(Depth Slices)数量。 增加此数值可以提高高端 GPU 的吞吐量(处理效率),但在性能较弱的硬件上可能会引发 TDR(驱动程序重置)或驱动超时。 - + Use Vulkan pipeline cache 启用 Vulkan 管线缓存 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. 启用 GPU 供应商专用的管线缓存。 在 Vulkan 驱动程序内部不存储管线缓存的情况下,此选项可显著提高着色器加载速度。 - + Enable Compute Pipelines (Intel Vulkan Only) 启用计算管线 (仅限 Intel 显卡 Vulkan 模式) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. @@ -932,193 +952,181 @@ Compute pipelines are always enabled on all other drivers. 在所有其他驱动程序上始终启用计算管线。 - + Enable Reactive Flushing 启用反应性刷新 - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. 使用反应性刷新取代预测性刷新,从而更精确地同步内存。 - + Sync to framerate of video playback 播放视频时帧率同步 - + Run the game at normal speed during video playback, even when the framerate is unlocked. 在视频播放期间以正常速度运行游戏,即使帧率未锁定。 - + Barrier feedback loops 屏障反馈环路 - + Improves rendering of transparency effects in specific games. 改进某些游戏中透明效果的渲染。 - + Enable buffer history 启用缓冲区历史 - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. 允许访问之前的缓冲状态。 这个选项可能会提升某些游戏的渲染质量和性能一致性。 - + Fix bloom effects 修复泛光效果 - + Removes bloom in Burnout. 去除《火爆狂飙》中的泛光特效。 - - Enable Legacy Rescale Pass - 启用旧版缩放 - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - 通过依赖之前实现的行为,可能会修复部分游戏的缩放重叠问题。 -修复 AMD 和 Intel 显卡上的线条伪影,以及《路易斯洋楼3》中 Nvidia 显卡的灰色纹理闪烁的遗留行为变通方法。 - - - + Extended Dynamic State 扩展动态状态 - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. 控制在扩展动态状态中可使用的函数数量。更高的数值允许启用更多功能,并可能提升性能,但同时也可能导致额外的图形问题。 - + Vertex Input Dynamic State 顶点输入动态状态 - + Enables vertex input dynamic state feature for better quality and performance. 开启顶点输入动态状态功能来获得更好的质量和性能。 - + Sample Shading 采样着色 - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. 允许片段着色器在多重采样的片段中每个样本执行一次而不是每个片段执行一次。可以提高图形质量,但会降低性能。 更高的值可以提高质量但会降低性能。 - + RNG Seed 随机数生成器种子 - + Controls the seed of the random number generator. Mainly used for speedrunning. 控制随机数生成器的种子。 主要用于竞速游戏。 - + Device Name 设备名称 - + The name of the console. 主机的数量。 - + Homebrew Args 自制软件参数 - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). 启动 homebrew 时需要传递的命令行参数 (例如 -noglsl)。 - + Custom RTC Date: 自定义系统时间: - + This option allows to change the clock of the console. Can be used to manipulate time in games. 此选项允许更改控制台的时钟。 可用于操纵游戏中的时间。 - + The number of seconds from the current unix time 来自当前 unix 时间的秒数。 - + Language: 语言: - + This option can be overridden when region setting is auto-select 当区域设置为自动选择时可以使用此选项替代。 - + Region: 地区: - + The region of the console. 主机的区域。 - + Time Zone: 时区: - + The time zone of the console. 主机的时区。 - + Sound Output Mode: 声音输出模式: - + Console Mode: 控制台模式: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. @@ -1127,1026 +1135,1026 @@ Setting to Handheld can help improve performance for low end systems. 将设置为掌机模式可以帮助低端系统提高性能。 - + Prompt for user profile on boot 启动时提示选择用户账户 - + Useful if multiple people use the same PC. 在多人使用相同的 PC 时有效。 - + Pause when not in focus 在丢失焦点时暂停 - + Pauses emulation when focusing on other windows. 当焦点位于其它窗口时暂停模拟器。 - + Confirm before stopping emulation 停止模拟时需要确认 - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. 替代提示以确认停止模拟。 启用它将绕过此类提示并直接退出模拟。 - + Hide mouse on inactivity 自动隐藏鼠标光标 - + Hides the mouse after 2.5s of inactivity. 在 2.5 秒无活动后隐藏鼠标。 - + Check for updates 检查更新 - + Whether or not to check for updates upon startup. 在启动时是否检查更新。 - + Enable Gamemode 启用游戏模式 - + Force X11 as Graphics Backend 强制使用 X11 作为图形后端 - + Custom frontend 自定义前端 - + Real applet 真实的小程序 - - + + Disabled 禁用 - + Never 永不 - + On Load 加载时 - + Always 总是 - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 异步模拟 - + Uncompressed (Best quality) 不压缩 (最高质量) - + BC1 (Low quality) BC1 (低质量) - + BC3 (Medium quality) BC3 (中等质量) - - + + Auto 自动 - + 30 FPS 30 FPS - + 60 FPS 60 FPS - + 90 FPS 90 FPS - + 120 FPS 120 FPS - + Conservative 保守模式 - + Aggressive 激进模式 - + Vulkan Vulkan - + OpenGL GLSL OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) OpenGL GLASM (汇编着色器,仅限 NVIDIA 显卡) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) OpenGL SPIR-V (实验性,仅限 AMD/Mesa) - + Null 无 - + Fast 高速 - - - + + + Accurate 高精度 - - - + + + Default 系统默认 - + Unsafe (fast) 不安全(快速) - + Safe (stable) 安全(稳定) - + Immediate 即时 - + Balanced 平衡 - + Unsafe 低精度 - + Paranoid (disables most optimizations) 偏执模式 (禁用绝大多数优化项) - + Debugging 调试 - + Dynarmic 动态编译 - + NCE 本机代码执行 - + Borderless Windowed 无边框窗口 - + Exclusive Fullscreen 独占全屏 - + No Video Output 无视频输出 - + CPU Video Decoding CPU 视频解码 - + GPU Video Decoding (Default) GPU 视频解码 (默认) - + 0.25X (180p/270p) [EXPERIMENTAL] 0.25X (180p/270p) [实验性] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [实验性] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [实验性] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] 1.25X (900p/1350p) [实验性] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [实验性] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 近邻取样 - + Bilinear 双线性过滤 - + Bicubic 双三线过滤 - + Gaussian 高斯模糊 - + Lanczos Lanczos - + ScaleForce 强制缩放 - + AMD FidelityFX Super Resolution AMD FidelityFX 超级分辨率 - + Area 区域 - + MMPX MMPX - + Zero-Tangent 零切线 - + B-Spline B-Spline - + Mitchell Mitchell - + Spline-1 Spline-1 - + Snapdragon Game Super Resolution 骁龙游戏超级分辨率 - + Snapdragon Game Super Resolution EdgeDir 骁龙游戏超级分辨率 EdgeDir - + None 无 - + FXAA 快速近似抗锯齿 - + SMAA 子像素形态学抗锯齿 - + Default (16:9) 默认 (16:9) - + Force 4:3 强制 4:3 - + Force 21:9 强制 21:9 - + Force 16:10 强制 16:10 - + Stretch to Window 拉伸窗口 - + Automatic 自动 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日语 (日本語) - + American English 美式英语 - + French (français) 法语 (français) - + German (Deutsch) 德语 (Deutsch) - + Italian (italiano) 意大利语 (italiano) - + Spanish (español) 西班牙语 (español) - + Chinese 中文 - + Korean (한국어) 韩语 (한국어) - + Dutch (Nederlands) 荷兰语 (Nederlands) - + Portuguese (português) 葡萄牙语 (português) - + Russian (Русский) 俄语 (Русский) - + Taiwanese 台湾中文 - + British English 英式英语 - + Canadian French 加拿大法语 - + Latin American Spanish 拉美西班牙语 - + Simplified Chinese 简体中文 - + Traditional Chinese (正體中文) 繁体中文 (正體中文) - + Brazilian Portuguese (português do Brasil) 巴西-葡萄牙语 (português do Brasil) - + Polish (polska) 波兰语(波兰语) - + Thai (แบบไทย) 泰语 - - + + Japan 日本 - + USA 美国 - + Europe 欧洲 - + Australia 澳大利亚 - + China 中国 - + Korea 韩国 - + Taiwan 台湾地区 - + Auto (%1) Auto select time zone 自动 (%1) - + Default (%1) Default time zone 默认 (%1) - + CET 欧洲中部时间 - + CST6CDT 古巴标准时间&古巴夏令时 - + Cuba 古巴 - + EET 东欧时间 - + Egypt 埃及 - + Eire 爱尔兰 - + EST 东部标准时间 - + EST5EDT 东部标准时间&东部夏令时 - + GB 英国 - + GB-Eire 英国-爱尔兰时间 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 格林威治 - + Hongkong 香港 - + HST 美国夏威夷时间 - + Iceland 冰岛 - + Iran 伊朗 - + Israel 以色列 - + Jamaica 牙买加 - + Kwajalein 夸贾林环礁 - + Libya 利比亚 - + MET 中欧时间 - + MST 山区标准时间 (北美) - + MST7MDT 山区标准时间&山区夏令时 (北美) - + Navajo 纳瓦霍 - + NZ 新西兰时间 - + NZ-CHAT NZ-CHAT - + Poland 波兰 - + Portugal 葡萄牙 - + PRC 中国标准时间 - + PST8PDT 太平洋标准时间&太平洋夏令时 - + ROC 台湾时间 - + ROK 韩国时间 - + Singapore 新加坡 - + Turkey 土耳其 - + UCT UCT - + Universal 世界时间 - + UTC 协调世界时 - + W-SU 欧洲-莫斯科时间 - + WET 西欧时间 - + Zulu 祖鲁 - + Mono 单声道 - + Stereo 立体声 - + Surround 环绕声 - + 4GB DRAM (Default) 4GB DRAM (默认) - + 6GB DRAM (Unsafe) 6GB DRAM (不安全) - + 8GB DRAM 8GB DRAM - + 10GB DRAM (Unsafe) 10GB DRAM (不安全) - + 12GB DRAM (Unsafe) 12GB DRAM (不安全) - + Docked 主机模式 - + Handheld 掌机模式 - - + + Normal 正常 - - + + Boost 升频 - - + + Overclock 超频 - + Always ask (Default) 总是询问 (默认) - + Only if game specifies not to stop 仅当游戏不希望停止时 - + Never ask 从不询问 - + Very Small (16 MB) 很小 (16 MB) - + Small (32 MB) 较小 (32 MB) - + Normal (128 MB) 正常 (128 MB) - + Large (256 MB) 较大 (256 MB) - + Very Large (512 MB) 很大 (512 MB) - + Very Low (4 MB) 很低 (4 MB) - + Low (8 MB) 低 (8 MB) - + Normal (16 MB) 正常 (16 MB) - + Medium (32 MB) 中 (32 MB) - + High (64 MB) 高 (64 MB) - + Very Low (32) 很低 (32) - + Low (64) 低 (64) - + Normal (128) 正常 (128) - + Medium (256) 中(256) - + High (512) 高(512) - + ExtendedDynamicState 1 扩展动态状态 1 - + ExtendedDynamicState 2 扩展动态状态 2 - + ExtendedDynamicState 3 扩展动态状态 3 - + Tree View 树景视图 - + Grid View 网格视图 diff --git a/dist/languages/zh_TW.ts b/dist/languages/zh_TW.ts index 499262847d..463d7fa2ed 100644 --- a/dist/languages/zh_TW.ts +++ b/dist/languages/zh_TW.ts @@ -722,12 +722,32 @@ Aggressive mode may impact performance of other applications such as recording s - + + GPU Readback Before NCE Invalidation + + + + + Flushes GPU buffer data back to guest memory before NCE invalidates the whole guest page, preserving it while the CPU store proceeds. + + + + + Patch Runtime NROs for NCE + + + + + Applies NCE code patches to runtime-loaded NRO modules.This is required for some games to run correctly. + + + + VSync Mode: 垂直同步: - + FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate. FIFO Relaxed allows tearing as it recovers from a slow down. Mailbox can have lower latency than FIFO and does not tear but may drop frames. @@ -735,79 +755,79 @@ Immediate (no synchronization) presents whatever is available and can exhibit te - + Sync Memory Operations 同步記憶體操作 - + Ensures data consistency between compute and memory operations. This option fixes issues in games, but may degrade performance. Unreal Engine 4 games often see the most significant changes thereof. - + Enable asynchronous presentation (Vulkan only) 啟用非同步顯示(僅限Vulkan) - + Slightly improves performance by moving presentation to a separate CPU thread. 透過將畫面顯示移至獨立的CPU執行緒來略微提升性能。 - + Force maximum clocks (Vulkan only) 強制使用最大時脈(僅限Vulkan) - + Runs work in the background while waiting for graphics commands to keep the GPU from lowering its clock speed. 在等待圖形命令時於背景執行任務以防GPU降低時脈 - + Anisotropic Filtering: 各向異性過濾: - + Controls the quality of texture rendering at oblique angles. Safe to set at 16x on most GPUs. - + GPU Mode: - + Controls the GPU emulation mode. Most games render fine with Fast, but Accurate is still required for some. Particles tend to only render correctly with Accurate mode. - + DMA Accuracy: - + Controls the DMA read mode. Unsafe is faster, while Safe is more stable and can fix issues in some games. Default follows the GPU Accuracy setting. - + GPU Fence Behavior: - + Controls the GPU fence synchronization behavior. Immediate is the fastest option, but can introduce some issues. Balanced offers better compatibility and may fix issues in some games. @@ -816,1302 +836,1291 @@ Default follows the GPU Mode setting. - + Enable asynchronous shader compilation - + May reduce shader stutter. - + GPU Clocks - + Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch's clocks. - + GPU Unswizzle - + Accelerates BCn 3D texture decoding using GPU compute. Disable if experiencing crashes or graphical glitches. - + GPU Unswizzle Max Texture Size - + Sets the maximum size (MiB) for GPU-based texture unswizzling. While the GPU is faster for medium and large textures, the CPU may be more efficient for very small ones. Adjust this to find the balance between GPU acceleration and CPU overhead. - + GPU Unswizzle Stream Size - + Sets the maximum amount of texture data (in MiB) processed per frame. Higher values can reduce stutter during texture loading but may impact frame consistency. - + GPU Unswizzle Chunk Size - + Determines the number of depth slices processed in a single dispatch. Increasing this can improve throughput on high-end GPUs but may cause TDR or driver timeouts on weaker hardware. - + Use Vulkan pipeline cache 启用 Vulkan 管线缓存 - + Enables GPU vendor-specific pipeline cache. This option can improve shader loading time significantly in cases where the Vulkan driver does not store pipeline cache files internally. 启用 GPU 供应商专用的管线缓存。 在 Vulkan 驱动程序内部不存储管线缓存的情况下,此选项可显著提高着色器加载速度。 - + Enable Compute Pipelines (Intel Vulkan Only) 启用计算管线 (仅限 Intel 显卡 Vulkan 模式) - + Required by some games. This setting only exists for Intel proprietary drivers and may crash if enabled. Compute pipelines are always enabled on all other drivers. - + Enable Reactive Flushing 启用反应性刷新 - + Uses reactive flushing instead of predictive flushing, allowing more accurate memory syncing. 使用反应性刷新取代预测性刷新,从而更精确地同步内存。 - + Sync to framerate of video playback 播放视频时帧率同步 - + Run the game at normal speed during video playback, even when the framerate is unlocked. 在视频播放期间以正常速度运行游戏,即使帧率未锁定。 - + Barrier feedback loops 屏障反馈循环 - + Improves rendering of transparency effects in specific games. 改进某些游戏中透明效果的渲染。 - + Enable buffer history - + Enables access to previous buffer states. This option may improve rendering quality and performance consistency in some games. - + Fix bloom effects - + Removes bloom in Burnout. - - Enable Legacy Rescale Pass - - - - - May fix rescale issues in some games by relying on behavior from the previous implementation. -Legacy behavior workaround that fixes line artifacts on AMD and Intel GPUs, and grey texture flicker on Nvidia GPUs in Luigis Mansion 3. - - - - + Extended Dynamic State - + Controls the number of features that can be used in Extended Dynamic State. Higher states allow for more features and can increase performance, but may cause additional graphical issues. - + Vertex Input Dynamic State - + Enables vertex input dynamic state feature for better quality and performance. - + Sample Shading - + Allows the fragment shader to execute per sample in a multi-sampled fragment instead of once per fragment. Improves graphics quality at the cost of performance. Higher values improve quality but degrade performance. - + RNG Seed 隨機種子 - + Controls the seed of the random number generator. Mainly used for speedrunning. - + Device Name 裝置名稱 - + The name of the console. - + Homebrew Args - + Command-line arguments passed to homebrew at launch (e.g. -noglsl). - + Custom RTC Date: 自定义系统时间: - + This option allows to change the clock of the console. Can be used to manipulate time in games. - + The number of seconds from the current unix time - + Language: 语言: - + This option can be overridden when region setting is auto-select - + Region: 區域: - + The region of the console. - + Time Zone: 時區: - + The time zone of the console. - + Sound Output Mode: 音訊輸出模式: - + Console Mode: 控制台模式: - + Selects if the console is in Docked or Handheld mode. Games will change their resolution, details and supported controllers and depending on this setting. Setting to Handheld can help improve performance for low end systems. - + Prompt for user profile on boot - + Useful if multiple people use the same PC. - + Pause when not in focus - + Pauses emulation when focusing on other windows. - + Confirm before stopping emulation 停止模拟时需要确认 - + Overrides prompts asking to confirm stopping the emulation. Enabling it bypasses such prompts and directly exits the emulation. - + Hide mouse on inactivity 滑鼠閒置時自動隱藏 - + Hides the mouse after 2.5s of inactivity. - + Check for updates - + Whether or not to check for updates upon startup. - + Enable Gamemode 启用游戏模式 - + Force X11 as Graphics Backend - + Custom frontend 自定义前端 - + Real applet 真实的小程序 - - + + Disabled - + Never - + On Load - + Always - + CPU CPU - + GPU GPU - + CPU Asynchronous CPU 异步模拟 - + Uncompressed (Best quality) 不壓縮 (最高品質) - + BC1 (Low quality) BC1 (低品質) - + BC3 (Medium quality) BC3 (中品質) - - + + Auto 自動 - + 30 FPS - + 60 FPS - + 90 FPS - + 120 FPS - + Conservative 保守模式(节省 VRAM) - + Aggressive 激进模式 - + Vulkan Vulkan - + OpenGL GLSL - + OpenGL GLASM (Assembly Shaders, NVIDIA Only) - + OpenGL SPIR-V (Experimental, AMD/Mesa Only) - + Null 無 - + Fast - - - + + + Accurate 高精度 - - - + + + Default 預設 - + Unsafe (fast) - + Safe (stable) - + Immediate - + Balanced - + Unsafe 低精度 - + Paranoid (disables most optimizations) 偏执模式 (禁用绝大多数优化项) - + Debugging - + Dynarmic Dynarmic - + NCE NCE - + Borderless Windowed 無邊框視窗 - + Exclusive Fullscreen 全螢幕獨占 - + No Video Output 無視訊輸出 - + CPU Video Decoding CPU 視訊解碼 - + GPU Video Decoding (Default) GPU 視訊解碼(預設) - + 0.25X (180p/270p) [EXPERIMENTAL] - + 0.5X (360p/540p) [EXPERIMENTAL] 0.5X (360p/540p) [实验性] - + 0.75X (540p/810p) [EXPERIMENTAL] 0.75X (540p/810p) [實驗性] - + 1X (720p/1080p) 1X (720p/1080p) - + 1.25X (900p/1350p) [EXPERIMENTAL] - + 1.5X (1080p/1620p) [EXPERIMENTAL] 1.5X (1080p/1620p) [實驗性] - + 2X (1440p/2160p) 2X (1440p/2160p) - + 3X (2160p/3240p) 3X (2160p/3240p) - + 4X (2880p/4320p) 4X (2880p/4320p) - + 5X (3600p/5400p) 5X (3600p/5400p) - + 6X (4320p/6480p) 6X (4320p/6480p) - + 7X (5040p/7560p) 7X (5040p/7560p) - + 8X (5760p/8640p) 8X (5760p/8640p) - + Nearest Neighbor 最近鄰 - + Bilinear 雙線性 - + Bicubic 雙立方 - + Gaussian 高斯 - + Lanczos - + ScaleForce 強制縮放 - + AMD FidelityFX Super Resolution - + Area - + MMPX - + Zero-Tangent - + B-Spline - + Mitchell - + Spline-1 - + Snapdragon Game Super Resolution - + Snapdragon Game Super Resolution EdgeDir - + None 無 - + FXAA FXAA - + SMAA SMAA - + Default (16:9) 預設 (16:9) - + Force 4:3 強制 4:3 - + Force 21:9 強制 21:9 - + Force 16:10 強制 16:10 - + Stretch to Window 延伸視窗 - + Automatic 自動 - + 2x 2x - + 4x 4x - + 8x 8x - + 16x 16x - + Japanese (日本語) 日文 (日本語) - + American English 美式英语 - + French (français) 法文 (français) - + German (Deutsch) 德文 (Deutsch) - + Italian (italiano) 義大利文 (italiano) - + Spanish (español) 西班牙文 (español) - + Chinese 中文 - + Korean (한국어) 韓文 (한국어) - + Dutch (Nederlands) 荷蘭文 (Nederlands) - + Portuguese (português) 葡萄牙文 (português) - + Russian (Русский) 俄文 (Русский) - + Taiwanese 台灣中文 - + British English 英式英文 - + Canadian French 加拿大法文 - + Latin American Spanish 拉丁美洲西班牙文 - + Simplified Chinese 簡體中文 - + Traditional Chinese (正體中文) 正體中文 (正體中文) - + Brazilian Portuguese (português do Brasil) 巴西-葡萄牙語 (português do Brasil) - + Polish (polska) - + Thai (แบบไทย) - - + + Japan 日本 - + USA 美國 - + Europe 歐洲 - + Australia 澳洲 - + China 中國 - + Korea 南韓 - + Taiwan 台灣 - + Auto (%1) Auto select time zone 自動 (%1) - + Default (%1) Default time zone 預設 (%1) - + CET 中歐 - + CST6CDT CST6CDT - + Cuba 古巴 - + EET EET - + Egypt 埃及 - + Eire 愛爾蘭 - + EST 北美東部 - + EST5EDT EST5EDT - + GB GB - + GB-Eire 英國-愛爾蘭 - + GMT GMT - + GMT+0 GMT+0 - + GMT-0 GMT-0 - + GMT0 GMT0 - + Greenwich 格林威治 - + Hongkong 香港 - + HST 夏威夷 - + Iceland 冰島 - + Iran 伊朗 - + Israel 以色列 - + Jamaica 牙買加 - + Kwajalein 瓜加林環礁 - + Libya 利比亞 - + MET 中歐 - + MST 北美山區 - + MST7MDT MST7MDT - + Navajo 納瓦霍 - + NZ 紐西蘭 - + NZ-CHAT 紐西蘭-查塔姆群島 - + Poland 波蘭 - + Portugal 葡萄牙 - + PRC 中國 - + PST8PDT 太平洋 - + ROC 臺灣 - + ROK 韓國 - + Singapore 新加坡 - + Turkey 土耳其 - + UCT UCT - + Universal 世界 - + UTC UTC - + W-SU 莫斯科 - + WET 西歐 - + Zulu 協調世界時 - + Mono 單聲道 - + Stereo 立體聲 - + Surround 環繞音效 - + 4GB DRAM (Default) 4GB DRAM (默认) - + 6GB DRAM (Unsafe) 6GB DRAM (不安全) - + 8GB DRAM - + 10GB DRAM (Unsafe) - + 12GB DRAM (Unsafe) - + Docked TV - + Handheld 掌機模式 - - + + Normal - - + + Boost - - + + Overclock - + Always ask (Default) 总是询问 (默认) - + Only if game specifies not to stop 仅当游戏不希望停止时 - + Never ask 从不询问 - + Very Small (16 MB) - + Small (32 MB) - + Normal (128 MB) - + Large (256 MB) - + Very Large (512 MB) - + Very Low (4 MB) - + Low (8 MB) - + Normal (16 MB) - + Medium (32 MB) - + High (64 MB) - + Very Low (32) - + Low (64) - + Normal (128) - + Medium (256) - + High (512) - + ExtendedDynamicState 1 - + ExtendedDynamicState 2 - + ExtendedDynamicState 3 - + Tree View - + Grid View diff --git a/src/android/app/src/main/res/values-ar/strings.xml b/src/android/app/src/main/res/values-ar/strings.xml index 5669aab8ba..09722b486e 100644 --- a/src/android/app/src/main/res/values-ar/strings.xml +++ b/src/android/app/src/main/res/values-ar/strings.xml @@ -254,7 +254,7 @@ إعداد بيانات المحاكي يلزم وجود مفاتيح حتى يعمل المحاكي، ويوصى باستخدام الفيرموير ويكون ضروريًا لاستخدام تطبيق القائمة الرئيسية. منح الأذونات - منح أذونات اختيارية لاستخدام ميزات معينة للمحاكي + منح أذونات اختيارية لاستخدام ميزات محددة في المحاكي العديد من الألعاب تتطلب الوصول إلى الفيرموير لتشغيل بشكل صحيح. https://yuzu-mirror.github.io/help/quickstart/#guide-introduction الإشعارات @@ -587,6 +587,10 @@ يجعل اللعبة تعتقد أن عمل وحدة معالجة الرسومات ينتهي بشكل أسرع مما هو عليه في الواقع، لذلك تتوقف عن خفض الدقة ومسافة العرض لتتناسب مع سرعات جهاز Switch. تخطي إبطال صلاحية وحدة المعالجة المركزية الداخلية يتخطى بعض عمليات إبطال ذاكرة التخزين المؤقتة من جانب وحدة المعالجة المركزية أثناء تحديثات الذاكرة، مما يقلل من استخدام وحدة المعالجة المركزية ويحسن أداءها. قد يتسبب ذلك في حدوث أعطال أو تعطل في بعض الألعاب. + إعادة قراءة وحدة معالجة الرسومات قبل إبطال صلاحية NCE + إصلاح مؤقت. يعالج مشكلة تعطل لعبة Ender Magnolia (وغيرها من ألعاب UE). قد يؤدي إلى انخفاض في الأداء. يجري العمل على تحسينه. + تصحيح حالات NRO في وقت التشغيل لـ NCE + حل مؤقت. إصلاح مشكلة تشغيل لعبة Biomutant. قد يؤثر ذلك على الأداء. يجري العمل على تحسينه. إصلاح تأثيرات التوهج يقلل من ضبابية التوهج في LA/EOW (Adreno A6XX - A7XX/ Turnip)، ويزيل التوهج في Burnout. تحذير: قد يسبب تشوهات رسومية في ألعاب أخرى. محاكاة BGR565 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 index 9a30acd3ac..3f3272daf4 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -1,12 +1,12 @@ - 本軟體可執行Nintendo Switch主機的遊戲,軟體不提供遊戲和金鑰檔案。

在開始之前,請先安裝您的 prod.keys ]]> 檔案,了解更多]]>
+ 本軟體可執行 Nintendo Switch 主機的遊戲,軟體不提供遊戲和金鑰檔案。

在開始之前,請先安裝您的 prod.keys ]]> 檔案,了解更多]]>
通知和錯誤 發生錯誤時顯示通知 未授予通知權限! - Eden模擬器通知 - Eden正在執行 + Eden 模擬器通知 + Eden 正在執行 秒 @@ -32,7 +32,7 @@ 使用控制器時自動隱藏虛擬按鍵 在使用控制器時自動隱藏畫面上的虛擬按鍵,會在控制器斷開連接後重新出現 反轉手把的 確認/返回 按鈕 - 使用Eden時將手把的確認及返回鍵反轉以符合Switch與Xbox的操作方式 + 使用 Eden 時將手把的確認及返回鍵反轉以符合 Switch 與 Xbox 的操作方式 虛擬按鍵設定 調整虛擬按鍵的位置與顯示設定 @@ -54,7 +54,7 @@ 啟用效能統計疊加層 設定疊加層中顯示的資訊 顯示影格率 - 顯示當前影格率 + 顯示目前的影格率 顯示影格時間 顯示應用程式的記憶體用量 顯示模擬器的記憶體用量 @@ -67,7 +67,7 @@ 當著色器在編譯時顯示 顯示正在編譯的著色器數量 管線工作執行緒 - 設定用於建置Vulkan管線的CPU核心數量,設定的數值越大效能越好,但溫度也會上升更快 + 設定用於建置 Vulkan 管線的 CPU 核心數量,設定的數值越大效能越好,但溫度也會上升更快 疊加層位置 選擇疊加層在畫面上的顯示位置 左上 @@ -85,11 +85,11 @@ 裝置疊加層 設定裝置疊加層中顯示的資訊 - 顯示Eden的組建版本 + 顯示 Eden 的組建版本 顯示圖形驅動程式的版本 顯示裝置型號 - 顯示GPU型號 - 顯示CPU型號 + 顯示 GPU 型號 + 顯示 CPU 型號 顯示韌體版本 @@ -98,15 +98,15 @@ 同步核心速度 將核心速度與最大速度百分比同步,在不改變遊戲實際速度的情況下提高效能 - 啟用主機MMU模擬 - 此最佳化可加速客體程式的記憶體存取。啟用後,客體記憶體讀取/寫入將直接在記憶體中執行並利用主機的MMU。停用此功能將強制所有記憶體存取使用軟體MMU模擬 + 啟用主機 MMU 模擬 + 此最佳化可加速客體程式的記憶體存取。啟用後,客體記憶體讀取/寫入將直接在記憶體中執行並利用主機的 MMU。停用此功能將強制所有記憶體存取使用軟體 MMU 模擬 偵錯開關 僅限開發用途 - 0到65535 + 0 到 65535 - NVDEC模擬 - 若在過場動畫中當機請切換成CPU + NVDEC 模擬 + 若在過場動畫中當機請切換成 CPU 無 @@ -121,7 +121,7 @@ 加入 瀏覽公開房間 使用者名稱 - IP位址 + IP 位址 埠 房間建立成功 成功加入房間 @@ -129,8 +129,8 @@ 網路錯誤 連線中斷 使用者名稱已被其他人使用 - MAC位址衝突 - 主機ID衝突 + MAC 位址衝突 + 主機 ID 衝突 版本不符 密碼錯誤 無法連接 @@ -143,7 +143,7 @@ 您已被房主踢出 未知錯誤 房間未初始化 - 房間閒置 + 房間閒置中 正在加入房間 已加入房間 房間管理員 @@ -151,7 +151,7 @@ %1$s 離開 %1$s 被踢出 %1$s 被封鎖 - IP位址已解封 + IP 位址已解封 踢出成員 密碼 正在加入… @@ -184,14 +184,14 @@ 搜尋房間… 遊戲 大廳類型 - 長度需為3-20個字元 - 必填 - 需要Web令牌,請前往進階設定 -> 系統 -> 網路 - IP格式無效 - 必須介於4-20個字元之間,並且僅能使用英文字母、數字、句點、破折號、底線和空格(標點符號須為英文格式) + 長度需為 3-20 個字元 + 請填寫這個欄位 + 需要 Web 令牌,請前往進階設定 -> 系統 -> 網路 + IP 格式無效 + 必須介於 4-20 個字元之間,並且僅能使用英文字母、數字、句點、破折號、底線和空格(標點符號須為英文格式) 使用者名稱無效,請在系統 -> 網路中檢查設定 - 必須為48個字元,且僅包含小寫字母a-z - 埠號需為1-65535 + 必須為 48 個字元,且僅包含小寫字母 a-z + 埠號需為 1-65535 取消 確定 重新整理 @@ -228,7 +228,7 @@ 不再顯示 遊戲目錄新增成功 檢查更新 - 在Eden啟動時檢查有無新版本並選擇是否要下載與安裝更新 + 在 Eden 啟動時檢查有無新版本並選擇是否要下載與安裝更新 發現新版本 有更新可供安裝:%1$s\n\n您要進行更新嗎? 下載更新中 @@ -252,7 +252,7 @@ https://yuzu-mirror.github.io/help/quickstart/#guide-introduction 跳過安裝韌體? 設定模擬器資料 - 模擬器需要金鑰才能正常執行,同時建議安裝韌體以啟動QLaunch小程式 + 模擬器需要金鑰才能正常執行,同時建議安裝韌體以啟動 QLaunch 小程式 授予權限 授予權限以使用模擬器的特定功能 許多遊戲需要韌體才能正常運作 @@ -273,10 +273,10 @@ 版本號碼 基本資訊 硬體 - 支援的ABI - CPU資訊 - GPU資訊 - Vulkan驅動程式版本 + 支援的 ABI + CPU 資訊 + GPU 資訊 + Vulkan 驅動程式版本 取得裝置資訊失敗 記憶體資訊 記憶體大小 @@ -287,9 +287,9 @@ 跳過 取消 安裝 Amiibo 金鑰 - 需要先安裝才能在遊戲中使用Amiibo - GPU驅動程式下載器 - GPU驅動程式管理員 + 需要先安裝才能在遊戲中使用 Amiibo + GPU 驅動程式下載器 + GPU 驅動程式管理員 安裝替代驅動程式以取得潛在的更佳效能或準確度 後製處理效果 在渲染完成後套用 ReShade FX 效果 @@ -330,84 +330,84 @@ 自動 開啟或關閉影格生成後選擇影格倍率 選擇要生成的目標影格率,倍率器會自動調整 - 用來預測影格之間動態的解析度,較低的數值可以減少GPU運算時間 + 用來預測影格之間動態的解析度,較低的數值可以減少 GPU 運算時間 影格佇列目標 最多允許多少個已完成的影格在顯示器前等待,較大的佇列可以吸收 GPU 突發負載,但會增加輸入延遲 最低延遲(無緩衝) - 平衡(1影格) - 最流暢(2影格) + 平衡(1 影格) + 最流暢(2 影格) 配合遊戲調整運動預測 以遊戲實際渲染的解析度而非升頻後的輸出進行運動預測,由於升頻後不會增加任何動態細節,因此不會影響準確度 運動預測解析度 光流處理的解析度,以輸出解析度的比例表示,降低此設定值是減少效能負載最有效的方法 無法使用影格生成 - 此GPU驅動程式缺少Lossless Scaling著色器所需的Vulkan記憶體模型或半精度浮點數(float16)支援 + 此 GPU 驅動程式缺少 Lossless Scaling 著色器所需的 Vulkan 記憶體模型或半精度浮點數(float16)支援 可選擇安裝自己擁有的 Lossless.dll 以在之後啟用影格生成功能 安裝 Lossless.dll 您需要擁有從合法管道獲得的 Lossless Scaling 並從該軟體的資料夾中取得 Lossless.dll 檔案才能使用影格生成功能 安裝不同的 Lossless.dll 檔案 影格生成 支援 - 不支援(無Vulkan記憶體模型或float16) + 不支援(無 Vulkan 記憶體模型或 float16) Lossless Scaling - 安裝您擁有的Lossless.dll檔案以使用影格生成 + 安裝您擁有的 Lossless.dll 檔案以使用影格生成 已安裝 未安裝 更換 刪除 - 刪除已安裝的Lossless.dll及預先編譯的著色器 - 影格生成功能會停止運作直到您重新安裝Lossless.dll,您的Lossless.dll原始檔不會被 Eden 修改 + 刪除已安裝的 Lossless.dll 及預先編譯的著色器 + 影格生成功能會停止運作直到您重新安裝Lossless.dll,您的 Lossless.dll原始檔不會被 Eden 修改 Lossless.dll 未安裝 前往 設定 -> Lossless Scaling 安裝以使用影格生成功能 請先關閉遊戲 - Lossless.dll無法在遊戲執行時進行更換 + Lossless.dll 無法在遊戲執行時進行更換 沒有東西可以刪除 - 尚未安裝Lossless.dll + 尚未安裝 Lossless.dll 準備影格生成著色器中... - 成功安裝Lossless.dll - 無法安裝Lossless.dll + 成功安裝 Lossless.dll + 無法安裝 Lossless.dll 無法複製選取的檔案 無法讀取選取的檔案 - 選取的檔案並不是Windows程式庫。請在Lossless Scaling的安裝位置(資料夾)中選擇Lossless.dll - 這個Lossless.dll的副本並未包含影格生成著色器。請更新Lossless Scaling後重試 - 無法轉譯影格生成著色器,尚不支援此Lossless Scaling版本 + 選取的檔案並不是 Windows 程式庫。請在 Lossless Scaling 的安裝位置(資料夾)中選擇 Lossless.dll + 這個 Lossless.dll 的副本並未包含影格生成著色器。請更新 Lossless Scaling 後重試 + 無法轉譯影格生成著色器,尚不支援此 Lossless Scaling 版本 轉譯的著色器無法寫入到儲存空間,請確認手機容量是否充足 進階設定 調整模擬器設定 最近遊玩 最近新增 - 開啟Eden資料夾 - 管理Eden的內部檔案 - 自訂Eden的主題與介面 + 開啟 Eden 資料夾 + 管理 Eden 的內部檔案 + 自訂 Eden 的主題與介面 找不到檔案管理員 - 無法開啟Eden目錄 + 無法開啟 Eden 目錄 請使用檔案管理員的側邊面板手動定位到使用者資料夾 管理儲存資料 - 導入/導出遊戲的儲存資料\n壓縮檔必須為.zip格式\n壓縮檔中首個子資料夾名稱必須為遊戲ID - 導入儲存資料 - 這將會以提供的檔案覆寫現有的該遊戲儲存資料,您確定要繼續嗎? - 正在導入儲存資料… - 正在導出儲存資料… - 已成功導入 + 匯入/匯出遊戲的儲存資料\n壓縮檔必須為.zip格式\n壓縮檔中首個子資料夾名稱必須為遊戲ID + 匯入儲存資料 + 這將會以提供的檔案覆蓋現有的該遊戲儲存資料,您確定要繼續嗎? + 正在匯入儲存資料… + 正在匯出儲存資料… + 已成功匯入 無效的儲存目錄結構 - 首個子資料夾名稱必須為遊戲ID + 首個子資料夾名稱必須為遊戲 ID 安裝韌體 - 韌體必須為ZIP壓縮檔,將會用於部分遊戲的啟動 + 韌體必須為 ZIP 壓縮檔,將會用於部分遊戲的啟動 正在安裝韌體 韌體安裝失敗 - 請確保韌體nca檔案位於zip壓縮檔的根目錄後再試一次 + 請確保韌體 nca 檔案位於 zip 壓縮檔的根目錄後再試一次 韌體解除安裝失敗 分享偵錯記錄 - 分享Eden的記錄檔以便對相關問題進行偵錯 + 分享 Eden 的記錄檔以便對相關問題進行偵錯 找不到日誌檔案 - 分享GPU日誌 - 分享Eden的GPU日誌以對圖形問題進行偵錯 - 找不到GPU日誌檔案 + 分享 GPU 日誌 + 分享 Eden 的 GPU 日誌以對圖形問題進行偵錯 + 找不到 GPU 日誌檔案 安裝遊戲內容 - 安裝遊戲更新或DLC + 安裝遊戲更新或 DLC 正在安裝內容… - 安裝檔案至NAND時發生錯誤 - 請確保內容有效並且prod.keys檔案已安裝 + 安裝檔案至 NAND 時發生錯誤 + 請確保內容有效並且 prod.keys 檔案已安裝 為避免產生衝突,無法直接安裝遊戲本體 %1$d 安裝錯誤 遊戲內容已成功安裝 @@ -416,7 +416,7 @@ https://yuzu-mirror.github.io/help/quickstart/#dumping-installed-updates 您的裝置不支援自訂驅動程式 此裝置不支援注入自訂驅動程式\n請以後再來查看是否已新增支援! - 管理Eden資料 + 管理 Eden 資料 安裝韌體、金鑰,導入/導出使用者資料及安裝其它項目! 遊戲資料夾 深度掃描 @@ -433,7 +433,7 @@ 驗證已安裝內容的完整性 檢查所有已安裝的內容是否有損壞 - 缺少prod.keys + 缺少 prod.keys 無法解密韌體和零售遊戲 https://yuzu-mirror.github.io/help/quickstart/#dumping-decryption-keys @@ -446,12 +446,12 @@ 金鑰安裝失敗 金鑰安裝成功 一個或多個金鑰安裝失敗 - 請確保金鑰檔案具有.keys副檔名後重試 + 請確保金鑰檔案具有 .keys 副檔名後重試 金鑰初始化失敗,請檢查您的轉儲工具是否為最新版本並重新轉儲金鑰 Qlaunch - 從Switch系統主畫面啟動應用程式(目前僅支援英文) + 從 Switch 系統主畫面啟動應用程式(目前僅支援英文) 小程式啟動器 使用已安裝的韌體啟動系統小程式 未安裝韌體 @@ -459,48 +459,48 @@ prod.keys檔案和韌體已安裝並重試]]> 相簿 使用系統相片檢視器查看儲存在使用者螢幕截圖資料夾中的影像 - Mii編輯 - 使用系統編輯器來檢視並編輯Mii + Mii 編輯 + 使用系統編輯器來檢視並編輯 Mii Cabinet - 編輯、刪除儲存在amiibo上的資料 - Cabinet啟動器 + 編輯、刪除儲存在 amiibo 上的資料 + Cabinet 啟動器 暱稱和擁有者設定 刪除遊戲資料 還原程式 格式化程式 - Gaia不存在 + Gaia 不存在 已複製到剪貼簿 - 一個開放原始碼的Switch模擬器 + 一個開放原始碼的 Switch 模擬器 參與者 - 這些人讓Eden Android版成為可能 - 這些專案使Eden Android版成為可能 + 這些人讓 Eden Android 版成為可能 + 這些專案使 Eden Android 版成為可能 組建版本 使用者資料 - 導入/導出所有應用程式資料\n\n導入使用者資料時,現有的使用者資料將被取代!\n\n直接從 Citron 導入使用者資料可能會出現問題,建議手動導入所有所需資料 - 正在導出使用者資料… - 正在導入使用者資料… - 無效的Eden備份 - 使用者資料導出成功 - 使用者資料導入成功 - 導出已取消 - 請確保使用者資料夾位於zip壓縮檔的根目錄,並在 config/config.ini 路徑中包含組態檔案後重試 + 匯入/匯出所有應用程式資料\n\n匯入使用者資料時,現有的使用者資料將被取代!\n\n直接從 Citron 匯入使用者資料可能會出現問題,建議手動匯入所有所需資料 + 正在匯出使用者資料… + 正在匯入使用者資料… + 無效的 Eden 備份 + 使用者資料匯出成功 + 使用者資料匯入成功 + 匯出已取消 + 請確保使用者資料夾位於 zip 壓縮檔的根目錄,並在 config/config.ini 路徑中包含組態檔案後重試 限制模擬速度 將模擬速度限制在標準速度的指定百分比 限制速度百分比 - 指定模擬速度的百分比,100%為標準速度,更高或更低的值將會減少或增加速度限制 + 指定模擬速度的百分比,100% 為標準速度,更高或更低的值將會減少或增加速度限制 加速模式 當開啟加速模式時,模擬器將以此速度執行 慢速模式 當慢速模式開啟時,模擬器將會以此速度執行 - CPU後端 - CPU準確度 + CPU 後端 + CPU 準確度 %1$s%2$s - Homebrew參數 - 在啟動時傳遞給Homebrew的命令列參數(例如:-noglsl) + Homebrew 參數 + 在啟動時傳遞給 Homebrew 的命令列參數(例如:-noglsl) 裝置名稱 @@ -508,60 +508,60 @@ 提高解析度,降低效能。停用後將會使用手提模式,會降低解析度並提高效能 模擬區域 模擬語言 - 選擇RTC日期 - 選擇RTC時間 - 自訂RTC + 選擇 RTC 日期 + 選擇 RTC 時間 + 自訂 RTC 允許您設定與您的目前系統時間相互獨立的自訂時間 - 設定自訂RTC + 設定自訂 RTC - CPU時脈 - 提高模擬CPU回報的時脈,可以減少某些FPS限制。較弱的CPU可能會出現效能下降的情況,部分遊戲可能會出現異常 - 自訂CPU時脈 - 自訂CPU時脈,更高的值可能提高效能,但也可能導致遊戲卡死。建議範圍為77-21000 + CPU 時脈 + 提高模擬 CPU 回報的時脈,可以減少某些 FPS 限制。較弱的 CPU 可能會出現效能下降的情況,部分遊戲可能會出現異常 + 自訂 CPU 時脈 + 自訂 CPU 時脈,更高的值可能提高效能,但也可能導致遊戲卡死。建議範圍為 77-21000 時脈 記憶體布局 - (實驗性)更改模擬記憶體布局,此設定不會提高效能,但可能有助於使用模組來提高解析度的遊戲的載入。不要在RAM為8GB或更少的手機上使用。若遊戲崩潰請將進階設定裡偵錯選項中的CPU後端改為Dynarmic (JIT) + (實驗性)更改模擬記憶體布局,此設定不會提高效能,但可能有助於使用模組來提高解析度的遊戲的載入。不要在 RAM 為 8GB 或更少的手機上使用。若遊戲崩潰請將進階設定裡偵錯選項中的 CPU 後端改為 Dynarmic(JIT) 生成 網路令牌 - 用於建立公開大廳的網路令牌,由48個小寫字母a-z組成 + 用於建立公開大廳的網路令牌,由 48 個小寫字母 a-z 組成 網路使用者名稱 - 多人遊戲房間中顯示的使用者名稱。必須為4-20個字元,僅能使用英文字母、數字、句點、破折號、底線和空格(標點符號須為英文格式) + 多人遊戲房間中顯示的使用者名稱。必須為 4-20 個字元,僅能使用英文字母、數字、句點、破折號、底線和空格(標點符號須為英文格式) 網路 解析度 (手提/底座) 垂直同步 視窗自適應濾波器 - FSR/SGSR銳化度 - 使用FSR/SGSR時圖片的銳化程度 + FSR/SGSR 銳化度 + 使用 FSR/SGSR 時圖片的銳化程度 抗鋸齒 進階 - GPU模式 - 設定GPU模擬的準確度,大多數遊戲在設定為快速時即可正常渲染,但有些需要渲染粒子的遊戲仍需設為準確來避免圖形錯誤 - DMA準確度 - 控制DMA準確度,將準確度設為穩定可以修復某些遊戲中的問題,但在某些情況下也可能影響效能。如果不確定,請保留為預設 + GPU 模式 + 設定 GPU 模擬的準確度,大多數遊戲在設定為快速時即可正常渲染,但有些需要渲染粒子的遊戲仍需設為準確來避免圖形錯誤 + DMA 準確度 + 控制 DMA 準確度,將準確度設為穩定可以修復某些遊戲中的問題,但在某些情況下也可能影響效能。如果不確定,請保留為預設 GPU 同步柵欄模式 控制 GPU 同步柵欄模式,即時是速度最快的選項,但可能會導致一些問題;使用平衡可以提供更好的相容性並修復某些遊戲中的錯誤;準確則是在犧牲部分效能的情況下進一步提升相容性;嚴格是最慢的選項,但可以修復那些對同步要求更嚴格的遊戲中的問題;預設則會依照 GPU 準確度設定 各向異性過濾 改善斜角檢視時的紋理品質 - VRAM使用模式 - 控制GPU記憶體的分配與釋放策略 - ASTC解碼方式 - 選擇ASTC壓縮紋理的解碼方式:CPU(慢速、穩定)、GPU(快速、推薦)或CPU非同步(無卡頓,可能導致問題) + VRAM 使用模式 + 控制 GPU 記憶體的分配與釋放策略 + ASTC 解碼方式 + 選擇 ASTC 壓縮紋理的解碼方式:CPU(慢速、穩定)、GPU(快速、推薦)或 CPU 非同步(無卡頓,可能導致問題) 同步記憶體操作 - 確保計算和記憶體操作之間的資料一致性,此選項應能修復某些遊戲中的問題,但在某些情況下可能會降低效能。使用Unreal Engine 4的遊戲似乎受影響最大 + 確保計算和記憶體操作之間的資料一致性,此選項應能修復某些遊戲中的問題,但在某些情況下可能會降低效能。使用 Unreal Engine 4 的遊戲似乎受影響最大 磁碟著色器快取 將產生的著色器快取儲存至硬碟以減少中斷 - 強制使用最大時脈 (僅限Adreno) - 強制 GPU 以可能的最大時脈執行 (熱溫限制仍會被套用) + 強制使用最大時脈(僅限 Adreno) + 強制GPU以可能的最大時脈運作(熱溫限制仍會被套用) GPU 非同步模擬 此修改可透過使用 GPU 非同步模擬來提升性能,不過可能會導致圖形問題且會提高在進行時序相關操作時當機的機率 使用重新啟用排清 @@ -569,32 +569,36 @@ 啟用緩衝區歷史 允許存取先前的緩衝區狀態,此選項可能會改善部分遊戲的渲染品質與效能穩定性 最佳化頂點緩衝區 - 啟用最佳化的頂點緩衝區綁定,需要安裝 Mesa 26.0+ Turnip drivers/Qualcomm drivers。使用舊版 Turnip drivers 會導致當機(25.3版和更低的版本) + 啟用最佳化的頂點緩衝區綁定,需要安裝 Mesa 26.0+ Turnip drivers/Qualcomm drivers。使用舊版 Turnip drivers 會導致當機(25.3 版或更低的版本) 修改 - GPU時脈 - 讓遊戲誤以為GPU工作能更快完成,避免遊戲為了配合Switch的時脈而降低解析度與渲染距離 - 跳過CPU內部失效處理 - 在記憶體更新期間跳過某些CPU端快取的失效處理,減少CPU使用率並提高其性能。可能會導致某些遊戲出現故障或當機 + GPU 時脈 + 讓遊戲誤以為 GPU 工作能更快完成,避免遊戲為了配合 Switch 的時脈而降低解析度與渲染距離 + 跳過 CPU 內部失效處理 + 在記憶體更新期間跳過某些 CPU 端快取的失效處理,減少 CPU 使用率並提高其性能。可能會導致某些遊戲出現故障或當機 + 在 NCE 無效化前進行 GPU 回讀 + (暫時性功能)修復 \"終結者瑪格諾莉亞:霧中綻放\" 及其它使用虛幻引擎之遊戲中的當機問題,可能會降低效能。此功能正在改善中 + 對 NCE Runtime 的 NRO 檔案進行修補 + (暫時性功能)修復 \"Biomutant\" 的啟動問題,可能會對效能造成影響。此功能正在改善中 修正光暈特效 - 在 \"薩爾達傳說:織夢島\" 和 \"薩爾達傳說:智慧的再現\" 中減少光暈模糊的問題並移除 \"橫衝直撞:狂飆樂園重製版\" 中的光暈效果(適用於Adreno A6XX - A7XX/ Turnip)。警告:可能會在其它遊戲中導致圖形異常 - 模擬BGR565 + 在 \"薩爾達傳說:織夢島\" 和 \"薩爾達傳說:智慧的再現\" 中減少光暈模糊的問題並移除 \"橫衝直撞:狂飆樂園重製版\" 中的光暈效果(適用於 Adreno A6XX - A7XX/ Turnip)。警告:可能會在其它遊戲中導致圖形異常 + 模擬 BGR565 修正遊戲中出現的色彩反轉、圖形異常或陰影異常 啟用舊版重新縮放處理 透過快速重新縮放處理來啟用遊戲重新縮放設定階段的舊版處理方式 使用非同步著色器 使用非同步編譯著色器,這可能會減少卡頓,但也可能導致圖形錯誤 - GPU Unswizzle設定 - 設定基於GPU的Unswizzling參數或完全停用此功能,調整此設定以在性能與紋理載入品質中取得平衡 - 啟用GPU Unswizzle + GPU Unswizzle 設定 + 設定基於 GPU 的 Unswizzling 參數或完全停用此功能,調整此設定以在性能與紋理載入品質中取得平衡 + 啟用 GPU Unswizzle 停用 - GPU Unswizzle最大紋理尺寸 - 設定 GPU 紋理 Unswizzling 的最大值(MB),雖然 GPU 處理中型和大型紋理的速度較快,但 CPU 處理非常小的紋理可能更有效率。調整此設定以在GPU加速與CPU負載之間取得平衡 - GPU Unswizzle Stream大小 - 設定每個影格處理大型紋理Unswizzling的資料上限,數值越高載入紋理的速度越快,但會增加畫面延遲;數值較低則能降低 GPU 負載,不過有可能導致至紋理載入不完全甚至突然出現 - GPU Unswizzle Chunk大小 - 設定 3D 紋理每批次處理的深度切片數量,增加此數值可提升規格較佳GPU的處理效率,但在較低規格的硬體上可能導致卡頓或驅動程式逾時 + GPU Unswizzle 最大紋理尺寸 + 設定 GPU 紋理 Unswizzling 的最大值(MB),雖然 GPU 處理中型和大型紋理的速度較快,但 CPU 處理非常小的紋理可能更有效率。調整此設定以在 GPU 加速與 CPU 負載之間取得平衡 + GPU Unswizzle Stream 大小 + 設定每個影格處理大型紋理 Unswizzling 的資料上限,數值越高載入紋理的速度越快,但會增加畫面延遲;數值較低則能降低 GPU 負載,不過有可能導致至紋理載入不完全甚至突然出現 + GPU Unswizzle Chunk 大小 + 設定 3D 紋理每批次處理的深度切片數量,增加此數值可提升規格較佳 GPU 的處理效率,但在較低規格的硬體上可能導致卡頓或驅動程式逾時 預設 @@ -617,7 +621,7 @@ 子母畫面 位於背景時最小化視窗 - 解析度縮放到2倍或更高可能會導致問題,並可能顯著降低設備速度 + 解析度縮放到 2 倍或更高可能會導致問題,並可能顯著降低設備速度 CPU @@ -628,38 +632,38 @@ GPU API 圖形偵錯 - 將圖形API設為慢速偵錯模式 - BCn區塊壓縮紋理修補 - 覆寫Adreno GPU的BCn紋理格式自動偵測。通常會根據Android版本自動偵測(會在API 28以上的裝置自動啟用) + 將圖形 API 設為慢速偵錯模式 + BCn 區塊壓縮紋理修補 + 覆寫 Adreno GPU 的 BCn 紋理格式自動偵測。通常會根據 Android 版本自動偵測(會在 API 28 以上的裝置自動啟用) Fastmem 日誌 按行寫入偵錯日誌 - 在寫入一行日誌就立刻更新偵錯記錄,讓程式在當機或閃退時更容易偵錯 + 寫入一行日誌就立刻更新偵錯記錄,讓程式在當機或畫面凍結時更容易偵錯 啟用更詳細的日誌記錄 - 將日誌檔的最大檔案限制從100MB提高到1GB + 將日誌檔的最大檔案限制從 100MB 提高到 1GB 日誌過濾器 控制 Eden 日誌的紀錄類別。例如: *:Info Service.LM:Debug - GPU日誌 + GPU 日誌 記錄層級 - GPU日誌的詳細層級(越高日誌越詳細,不過會更容易過熱) - 記錄Vulkan API呼叫 - 在環形緩衝區中記錄所有Vulkan API呼叫 - 傾印SPIR-V著色器 - 將重新編譯後的SPIR-V二進位檔案(.spv)儲存至Eden資料夾裡的dump資料夾中。可使用 spirv-dis/spirv-cross/spirv-val 進行檢查 + GPU 日誌的詳細層級(越高日誌越詳細,不過會更容易過熱) + 記錄 Vulkan API 呼叫 + 在環形緩衝區中記錄所有 Vulkan API 呼叫 + 傾印 SPIR-V 著色器 + 將重新編譯後的 SPIR-V 二進位檔案(.spv)儲存至 Eden 資料夾裡的 dump 資料夾中。可使用 spirv-dis/spirv-cross/spirv-val 進行檢查 傾印客體(Maxwell)著色器 - 將Maxwell客體著色器位元組碼檔案(.ash)儲存至Eden資料夾裡的dump資料夾中。可使用 nvdisasm 進行檢查 - 傾印Maxwell巨集 - 將Maxwell巨集程式檔案(.macro)儲存至Eden資料夾裡的dump資料夾中。可使用 envydis 進行檢查 - 追蹤GPU記憶體 - 監控GPU記憶體的分配和釋放 + 將 Maxwell 客體著色器位元組碼檔案(.ash)儲存至 Eden 資料夾裡的 dump 資料夾中。可使用 nvdisasm 進行檢查 + 傾印 Maxwell 巨集 + 將 Maxwell 巨集程式檔案(.macro)儲存至 Eden 資料夾裡的 dump 資料夾中。可使用 envydis 進行檢查 + 追蹤 GPU 記憶體 + 監控 GPU 記憶體的分配和釋放 驅動程式偵錯資料 擷取驅動程式的特定偵錯資料(例如 Turnip breadcrumbs) 環形緩衝區大小 - 追蹤的近期Vulkan呼叫數量(預設為512) - 64至4096個項目 + 追蹤的近期 Vulkan 呼叫數量(預設為 512) + 64 至 4096 個項目 一般 @@ -683,17 +687,17 @@ 左搖桿 控制搖桿 右搖桿 - C搖桿 + C 搖桿 按壓 靈敏度 無感帶 用按鈕、按鍵來模擬搖桿 - 修改按鈕模擬左/右搖桿的值,視遊戲不同而有所差異\n(模擬左搖桿時,若將此數值設為50,則按下按鈕時遊戲裡的人物可能只會走動而不是奔跑;模擬右搖桿時所使用的值則是會影響到轉視角的速度,數值越高代表使用的模擬值越大) + 修改按鈕模擬左/右搖桿的值,視遊戲不同而有所差異\n(模擬左搖桿時,若將此數值設為 50,則按下按鈕時遊戲裡的人物可能只會走動而不是奔跑;模擬右搖桿時所使用的值則是會影響到轉視角的速度,數值越高代表使用的模擬值越大) 肩部按鍵 - 左SL - 左SR - 右SL - 右SR + 左 SL + 左 SR + 右 SL + 右 SR 無效 無 未知 @@ -708,12 +712,12 @@ 選擇一個控制器以嘗試自動配對按鈕、搖桿 嘗試為 %1$s 自動配對 控制器類型 - Pro手把 + Pro 手把 掌機模式 - 雙Joycon手把 - 左Joycon手把 - 右Joycon手把 - GameCube手把 + 雙 Joycon 手把 + 左 Joycon 手把 + 右 Joycon 手把 + GameCube 手把 方向反轉 反轉按鈕 切換按鍵 @@ -738,7 +742,7 @@ 按下一個按鈕或肩部按鍵/移動搖桿 將方向鍵配對到 %1$s 配對到 %1$s - 導入設定檔失敗 + 匯入設定檔失敗 儲存設定檔失敗 重設控制器配對 您確定要將此控制器的所有配對重設為預設值?此動作無法復原 @@ -759,21 +763,21 @@ 自動 提交 無 - 導入 - 導出 - 導出失敗 - 導入失敗 + 匯入 + 匯出 + 匯出失敗 + 匯入失敗 正在取消 安裝 下載 刪除 編輯 - 已成功導入 - 已成功導出 + 已成功匯入 + 已成功匯出 開始 全域設定 個別遊戲設定 - 導入完成 + 匯入完成 使用全域設定 操作已成功完成 確認 @@ -804,9 +808,9 @@ 安裝中… 最新 推薦驅動程式: - GPU型號 - 不支援的GPU - 您的GPU不支援驅動程式注入,不建議嘗試設定自訂驅動程式 + GPU 型號 + 不支援的 GPU + 您的 GPU 不支援驅動程式注入,不建議嘗試設定自訂驅動程式 設定 @@ -836,13 +840,13 @@ 成功遷移儲存資料 儲存資料遷移失敗 存檔目錄設定完成 - 所選取的位置已有儲存資料。是否要取代該檔案? + 所選取的位置已有儲存資料,是否要取代該檔案? 若要自訂路徑必須授予所有檔案的存取權 授予權限 NAND 路徑 設定 NAND 資料的自訂路徑 - 虛擬 SD卡 路徑 - 設定虛擬 SD卡 儲存空間的自訂路徑 + 虛擬SD卡路徑 + 設定虛擬SD卡儲存空間的自訂路徑 路徑設定成功 跳過 @@ -861,7 +865,7 @@ 切換模組、更新及 DLC 遊玩時間: 重設遊玩時間 - 將此遊戲的遊玩時間重設為0 + 將此遊戲的遊玩時間重設為 0 您確定要重設此遊戲的遊玩時間嗎? 遊玩時間已重設 修改遊玩時間 @@ -870,16 +874,16 @@ 小時 分鐘 秒 - 必須介於0到9999小時之間 - 必須介於0到59分鐘之間 - 必須介於0到59秒之間 - 成功更新遊玩時間 + 必須介於 0 到 9999 小時之間 + 必須介於 0 到 59 分鐘之間 + 必須介於 0 到 59 秒之間 + 成功修改遊玩時間 清除著色器快取 清除此遊戲所有已編譯的著色器快取 重新編譯著色器快取的過程中可能會導致遊戲有些微卡頓 著色器快取已成功清除 已刪除著色器快取 - 為了維持Vulkan管線驗證,Eden已自動清除所有著色器快取。為了預防閃退和圖形錯誤,這是必須的動作。因為著色器需要重新編譯,您在遊戲過程中可能會遇到些微卡頓的情況 + 為了維持Vulkan管線驗證,Eden 已自動清除所有著色器快取,若要預防閃退和圖形錯誤,這是必須的動作。因為著色器需要重新編譯,您在遊戲過程中可能會遇到些微卡頓的情況 附加元件:%1$s 儲存資料 管理此遊戲的儲存資料 @@ -911,8 +915,8 @@ 未完成文件完整性檢查 以下文件的完整性驗證失敗:\n %1$s 分享設定 - 導入設定 - 導出設定 + 匯入設定 + 匯出設定 分享設定失敗 @@ -928,12 +932,12 @@ 正在搜尋遊戲... - 找不到標題ID的遊戲: %1$s + 找不到標題 ID 的遊戲: %1$s 自訂設定失敗 無法套用自訂設定 %1$s: %2$s 使用預設設定啟動 啟動已取消 - 無法套用請求的設定。這可能是由於缺少GPU驅動程式或設定問題。 + 無法套用請求的設定,這可能是由於缺少 GPU 驅動程式或設定問題 已套用自訂設定 正在啟動 %1$s... 無法初始化遊戲 @@ -954,10 +958,10 @@ 未安裝所需的驅動程式: %s 無效的驅動程式檔案: %s - 無可用網路連線。請檢查您的網路連線並重試 - 需要GPU驅動程式 + 無可用網路連線,請檢查您的網路連線並重試 + 需要 GPU 驅動程式 這個遊戲的設定需要 \"%s\"驅動程式,而它並沒有安裝在您的裝置上\n\n要下載並安裝此驅動程式嗎? - 驅動程式下載已取消。沒有所需的驅動程式無法啟動遊戲。 + 驅動程式下載已取消,沒有所需的驅動程式無法啟動遊戲 下載 @@ -979,7 +983,7 @@ 暫停模擬 繼續模擬 疊加層/虛擬按鍵設定 - 導入Amiibo + 導入 Amiibo 觸控螢幕 鎖定側邊選單 解鎖側邊選單 @@ -987,12 +991,12 @@ Amiibo - 該amiibo已被移除 - 此遊戲目前沒有在尋找amiibo - 您所選擇的並不是正確的amiibo金鑰檔 + 該 amiibo 已被移除 + 此遊戲目前沒有在尋找 amiibo + 您所選擇的並不是正確的 amiibo 金鑰檔 選擇的檔案已在使用中 發生未知的錯誤 - 已導入Amiibo + Amiibo 已匯入 @@ -1021,9 +1025,9 @@ 臺灣 - 4GB (推薦) - 6GB (不穩定) - 8GB (不穩定) + 4GB(推薦) + 6GB(不穩定) + 8GB(不穩定) 正常 @@ -1073,20 +1077,26 @@ 效能 - 準確 + 品質 預設 不穩定 穩定 + + 預設 + 即時 + 平衡 + 準確 + 保守 積極 - 即時 (關閉) + 即時(關閉) Mailbox - FIFO (開啟) + FIFO(開啟) FIFO 寬鬆 @@ -1108,6 +1118,18 @@ 不合理 偵錯 + + Freedreno 設定 + GPU 驅動程式設定 + 預先提供的設定檔 + 目前使用的設定 + 進階設定 + 變數名稱 (例如: TU_DEBUG) + 變數值 + 新增變數 + 全部清除 + Freedreno 設定已儲存 + 已清除所有 Freedreno 變數 方向鍵 左搖桿 From 4dc69c06f764a235bccd01afbfc765d9ddbebc9f Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 12 Oct 2026 22:21:17 +0200 Subject: [PATCH 174/198] [*] Remove Fix{Static,Small}VectorADL workaround for GCC 12 (#4386) 1. We demand at least, minimum, gcc 14 2. Debian stable boost uses a newer version https://packages.debian.org/trixie/libboost-all-dev, so fix isn't longer required - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4386 Reviewed-by: MaranBr Reviewed-by: crueter --- src/audio_core/in/audio_in_system.cpp | 19 ++------------ src/video_core/buffer_cache/buffer_cache.h | 2 +- src/video_core/memory_manager.cpp | 2 +- .../renderer_vulkan/vk_buffer_cache.cpp | 4 +-- .../renderer_vulkan/vk_texture_cache.cpp | 6 ++--- src/video_core/texture_cache/texture_cache.h | 26 +++++++++---------- src/video_core/texture_cache/util.h | 23 +--------------- 7 files changed, 23 insertions(+), 59 deletions(-) diff --git a/src/audio_core/in/audio_in_system.cpp b/src/audio_core/in/audio_in_system.cpp index f71a2df6be..f8946cc0f6 100644 --- a/src/audio_core/in/audio_in_system.cpp +++ b/src/audio_core/in/audio_in_system.cpp @@ -14,21 +14,6 @@ #include "core/core_timing.h" #include "core/hle/kernel/k_event.h" -// See texture_cache/util.h -template -#if BOOST_VERSION >= 108100 || __GNUC__ > 12 -[[nodiscard]] boost::container::static_vector FixStaticVectorADL(const boost::container::static_vector& v) { - return v; -} -#else -[[nodiscard]] std::vector FixStaticVectorADL(const boost::container::static_vector& v) { - std::vector u; - for (auto const& e : v) - u.push_back(e); - return u; -} -#endif - namespace AudioCore::AudioIn { System::System(Core::System& system_, Kernel::KEvent* event_, const size_t session_id_) @@ -110,7 +95,7 @@ Result System::Start() { boost::container::static_vector buffers_to_flush{}; buffers.RegisterBuffers(buffers_to_flush); - session->AppendBuffers(FixStaticVectorADL(buffers_to_flush)); + session->AppendBuffers(buffers_to_flush); session->SetRingSize(static_cast(buffers_to_flush.size())); return ResultSuccess; @@ -155,7 +140,7 @@ void System::RegisterBuffers() { if (state == State::Started) { boost::container::static_vector registered_buffers{}; buffers.RegisterBuffers(registered_buffers); - session->AppendBuffers(FixStaticVectorADL(registered_buffers)); + session->AppendBuffers(registered_buffers); } } diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 9a5d6f322a..53addb5dec 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1664,7 +1664,7 @@ void BufferCache

::JoinOverlap(BufferId new_buffer_id, BufferId overlap_id, .size = overlap.SizeBytes(), }); new_buffer.MarkUsage(copies[0].dst_offset, copies[0].size); - runtime.CopyBuffer(new_buffer, overlap, FixSmallVectorADL(copies), true); + runtime.CopyBuffer(new_buffer, overlap, copies, true); #ifdef YUZU_LEGACY if (immediately_free) runtime.Finish(); diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index d5838a387d..8ffdcb6276 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -713,7 +713,7 @@ void MemoryManager::FlushCaching() { if (accumulator.InvalidateAll([this](GPUVAddr addr, size_t size) { GetSubmappedRangeImpl(addr, size, page_stash2); })) { - rasterizer->InnerInvalidation(VideoCommon::FixSmallVectorADL(page_stash2)); + rasterizer->InnerInvalidation(page_stash2); page_stash2.clear(); } } diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 1a33189bf8..493de2cc20 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -471,7 +471,7 @@ void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, if (src_buffer == staging_pool.StreamBuf() && can_reorder_upload) { scheduler.RecordWithUploadBuffer([src_buffer, dst_buffer, vk_copies]( vk::CommandBuffer, vk::CommandBuffer upload_cmdbuf) { - upload_cmdbuf.CopyBuffer(src_buffer, dst_buffer, VideoCommon::FixSmallVectorADL(vk_copies)); + upload_cmdbuf.CopyBuffer(src_buffer, dst_buffer, vk_copies); }); return; } @@ -482,7 +482,7 @@ void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, cmdbuf.PipelineBarrier(vk::PIPELINE_STAGE_GRAPHICS_COMPUTE_TRANSFER, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, READ_BARRIER); } - cmdbuf.CopyBuffer(src_buffer, dst_buffer, VideoCommon::FixSmallVectorADL(vk_copies)); + cmdbuf.CopyBuffer(src_buffer, dst_buffer, vk_copies); if (barrier) { cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, vk::PIPELINE_STAGE_GRAPHICS_COMPUTE, 0, WRITE_BARRIER); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index bc2e82acae..583cb6edaf 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1642,7 +1642,7 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, nullptr, nullptr, pre_barriers); cmdbuf.CopyImage(src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst_image, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VideoCommon::FixSmallVectorADL(vk_copies)); + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, vk_copies); cmdbuf.PipelineBarrier( VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | @@ -2006,7 +2006,7 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset, scheduler->Record([src_buffer, temp_vk_image, vk_aspect_mask, vk_copies](vk::CommandBuffer cmdbuf) { - CopyBufferToImage(cmdbuf, src_buffer, temp_vk_image, vk_aspect_mask, false, VideoCommon::FixSmallVectorADL(vk_copies)); + CopyBufferToImage(cmdbuf, src_buffer, temp_vk_image, vk_aspect_mask, false, vk_copies); }); const auto [samples_x, samples_y] = VideoCommon::SamplesLog2(info.num_samples); @@ -2060,7 +2060,7 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset, scheduler->Record([src_buffer, vk_image, vk_aspect_mask, was_initialized, vk_copies](vk::CommandBuffer cmdbuf) { - CopyBufferToImage(cmdbuf, src_buffer, vk_image, vk_aspect_mask, was_initialized, VideoCommon::FixSmallVectorADL(vk_copies)); + CopyBufferToImage(cmdbuf, src_buffer, vk_image, vk_aspect_mask, was_initialized, vk_copies); }); if (is_rescaled) { diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 640bd38407..e92e54f8ce 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -140,7 +140,7 @@ void TextureCache

::RunGarbageCollector() { } if (must_download) { auto map = runtime.DownloadStagingBuffer(image.unswizzled_size_bytes); - const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); + const auto copies = FullDownloadCopies(image.info); image.DownloadMemory(map, copies); runtime.Finish(); SwizzleImage(*gpu_memory, image.gpu_addr, image.info, copies, map.mapped_span, swizzle_data_buffer); @@ -629,7 +629,7 @@ void TextureCache

::DownloadMemory(DAddr cpu_addr, size_t size) { for (const ImageId image_id : images) { Image& image = slot_images[image_id]; auto map = runtime.DownloadStagingBuffer(image.unswizzled_size_bytes); - const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); + const auto copies = FullDownloadCopies(image.info); image.DownloadMemory(map, copies); runtime.Finish(); SwizzleImage(*gpu_memory, image.gpu_addr, image.info, copies, map.mapped_span, @@ -893,7 +893,7 @@ void TextureCache

::CommitAsyncFlushes() { for (const PendingDownload& download_info : download_ids) { if (download_info.is_swizzle) { Image& image = slot_images[download_info.object_id]; - const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); + const auto copies = FullDownloadCopies(image.info); image.DownloadMemory(download_map, copies); download_map.offset += Common::AlignUp(image.unswizzled_size_bytes, 64); } @@ -926,7 +926,7 @@ void TextureCache

::PopAsyncFlushes() { auto& download_buffer = download_map[download_info.async_buffer_id]; if (download_info.is_swizzle) { const ImageBase& image = slot_images[download_info.object_id]; - const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); + const auto copies = FullDownloadCopies(image.info); download_buffer.offset -= Common::AlignUp(image.unswizzled_size_bytes, 64); std::span download_span = download_buffer.mapped_span.subspan(download_buffer.offset); @@ -964,7 +964,7 @@ void TextureCache

::PopAsyncFlushes() { continue; } Image& image = slot_images[download_info.object_id]; - const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); + const auto copies = FullDownloadCopies(image.info); image.DownloadMemory(download_map, copies); download_map.offset += image.unswizzled_size_bytes; } @@ -977,7 +977,7 @@ void TextureCache

::PopAsyncFlushes() { continue; } const ImageBase& image = slot_images[download_info.object_id]; - const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); + const auto copies = FullDownloadCopies(image.info); SwizzleImage(*gpu_memory, image.gpu_addr, image.info, copies, download_span, swizzle_data_buffer); download_map.offset += image.unswizzled_size_bytes; download_span = download_span.subspan(image.unswizzled_size_bytes); @@ -1160,7 +1160,7 @@ void TextureCache

::UploadImageContents(Image& image, StagingBuffer& staging) gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), mapped_span.size_bytes(), VideoCommon::CacheType::NoTextureCache); const auto uploads = FullUploadSwizzles(image.info); - runtime.AccelerateImageUpload(image, staging, FixSmallVectorADL(uploads), 0, 0); + runtime.AccelerateImageUpload(image, staging, uploads, 0, 0); return; } @@ -1168,11 +1168,11 @@ void TextureCache

::UploadImageContents(Image& image, StagingBuffer& staging) *gpu_memory, gpu_addr, image.guest_size_bytes, &swizzle_data_buffer); if (True(image.flags & ImageFlagBits::Converted)) { unswizzle_data_buffer.resize_destructive(image.unswizzled_size_bytes); - auto copies = FixSmallVectorADL(UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, unswizzle_data_buffer)); + auto copies = UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, unswizzle_data_buffer); ConvertImage(unswizzle_data_buffer, image.info, mapped_span, copies); image.UploadMemory(staging, copies); } else { - const auto copies = FixSmallVectorADL(UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, mapped_span)); + const auto copies = UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, mapped_span); image.UploadMemory(staging, copies); } } @@ -1401,7 +1401,7 @@ void TextureCache

::TickAsyncDecode() { auto staging = runtime.UploadStagingBuffer(MapSizeBytes(image)); std::memcpy(staging.mapped_span.data(), async_decode->decoded_data.data(), async_decode->decoded_data.size()); - image.UploadMemory(staging, FixSmallVectorADL(async_decode->copies)); + image.UploadMemory(staging, async_decode->copies); image.flags &= ~ImageFlagBits::IsDecoding; has_uploads = true; i = async_decodes.erase(i); @@ -1469,7 +1469,7 @@ void TextureCache

::TickAsyncUnswizzle() { if (z_count > 0) { const auto uploads = FullUploadSwizzles(task.info); - runtime.AccelerateImageUpload(image, task.staging_buffer, FixSmallVectorADL(uploads), z_start, z_count); + runtime.AccelerateImageUpload(image, task.staging_buffer, uploads, z_start, z_count); task.last_submitted_offset += (static_cast(z_count) * task.bytes_per_slice); } } @@ -1730,9 +1730,9 @@ ImageId TextureCache

::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA const u32 down_shift = can_rescale ? resolution.down_shift : 0; auto copies = MakeShrinkImageCopies(new_info, overlap.info, base, up_scale, down_shift); if (overlap.info.num_samples != new_image.info.num_samples) { - runtime.CopyImageMSAA(new_image, overlap, FixSmallVectorADL(copies)); + runtime.CopyImageMSAA(new_image, overlap, copies); } else { - runtime.CopyImage(new_image, overlap, FixSmallVectorADL(copies)); + runtime.CopyImage(new_image, overlap, copies); } new_image.modification_tick = overlap.modification_tick; } diff --git a/src/video_core/texture_cache/util.h b/src/video_core/texture_cache/util.h index 3e8bb00032..590d85b042 100644 --- a/src/video_core/texture_cache/util.h +++ b/src/video_core/texture_cache/util.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project @@ -122,25 +122,4 @@ void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase* [[nodiscard]] u32 MapSizeBytes(const ImageBase& image); -// TODO: Remove once Debian STABLE no longer has such outdated boost -// This is a gcc bug where ADL lookup fails for range niebloids of std::span -// for any given type of the static_vector/small_vector, etc which makes a whole mess -// for anything using std::span so we just do this terrible hack on older versions of -// GCC12 because people actually still use stable debian so... yeah -// One may say: "This is bad for performance" - to which I say, using GCC 12 you already know -// what kind of bs you will be dealing with anyways. -template -#if BOOST_VERSION >= 108100 || __GNUC__ > 12 -[[nodiscard]] boost::container::small_vector FixSmallVectorADL(const boost::container::small_vector& v) { - return v; -} -#else -[[nodiscard]] std::vector FixSmallVectorADL(const boost::container::small_vector& v) { - std::vector u; - for (auto const& e : v) - u.push_back(e); - return u; -} -#endif - } // namespace VideoCommon From 218c6705d950635bc18f8458d738a1996fb592b6 Mon Sep 17 00:00:00 2001 From: lizzie Date: Tue, 13 Oct 2026 04:38:36 +0200 Subject: [PATCH 175/198] [hle] constexpr handler dispatch maps, introduce version gating (#4480) This PR primarily focuses on upbringing constexpr maps for handlers. Each time an HLE object of a service is construed, it registers it's own handlers, over and over. Regardless of whetever it needs them at the moment or not. Additionally we don't require to keep track of different function pointers amongst each object. This can be done by overriding the given function instead, as opposed to having a separate hash map for every given object. In other words: Remove handlers (and handlers_tipc) map for every instance then read from a static defined per-class. - [x] Migrate all HLE functions to new `frozen::map` constexpr time finder - [ ] Measure if this approach actually makes better codegen Optional: - [x] Properly gate all functions (that have versions commented next to them) - [x] Maybe store `HandlerFnP<>` and `const char*` separately, version gating can go in a different map as well Information such as name can be used on debug builds, but doesn't particularly help on release as one can consult an external reference (or have an annotated IPC map) Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Co-authored-by: Maufeat Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4480 Reviewed-by: Maufeat Reviewed-by: MaranBr --- docs/DesignOverview.md | 2 +- docs/README.md | 2 +- docs/{HosKernel.md => SubsystemHLE.md} | 53 +- src/core/CMakeLists.txt | 70 +- src/core/hle/service/acc/acc.cpp | 1933 +++++++++-------- src/core/hle/service/acc/acc.h | 64 - src/core/hle/service/acc/async_context.cpp | 11 - src/core/hle/service/acc/async_context.h | 13 + src/core/hle/service/am/am.cpp | 1341 +++++++++++- .../all_system_applet_proxies_service.cpp | 135 -- .../all_system_applet_proxies_service.h | 56 - .../am/service/applet_common_functions.cpp | 98 - .../am/service/applet_common_functions.h | 33 - .../am/service/application_accessor.cpp | 64 +- .../service/am/service/application_accessor.h | 4 + .../am/service/application_creator.cpp | 20 +- .../service/am/service/application_creator.h | 3 +- .../am/service/application_functions.cpp | 153 +- .../am/service/application_functions.h | 1 + .../service/am/service/application_proxy.cpp | 106 - .../service/am/service/application_proxy.h | 49 - .../am/service/application_proxy_service.cpp | 44 - .../am/service/application_proxy_service.h | 33 - .../service/am/service/audio_controller.cpp | 26 +- .../hle/service/am/service/audio_controller.h | 4 + .../am/service/common_state_getter.cpp | 209 +- .../service/am/service/common_state_getter.h | 1 + .../am/service/cradle_firmware_updater.cpp | 28 +- .../am/service/cradle_firmware_updater.h | 4 + .../service/am/service/debug_functions.cpp | 43 - .../hle/service/am/service/debug_functions.h | 16 - .../service/am/service/display_controller.cpp | 68 +- .../service/am/service/display_controller.h | 3 +- .../am/service/global_state_controller.cpp | 41 +- .../am/service/global_state_controller.h | 7 +- .../am/service/home_menu_functions.cpp | 42 +- .../service/am/service/home_menu_functions.h | 1 + .../am/service/library_applet_accessor.cpp | 64 +- .../am/service/library_applet_accessor.h | 22 +- .../am/service/library_applet_creator.cpp | 287 --- .../am/service/library_applet_creator.h | 44 - .../am/service/library_applet_proxy.cpp | 134 -- .../service/am/service/library_applet_proxy.h | 56 - .../service/library_applet_self_accessor.cpp | 332 --- .../am/service/library_applet_self_accessor.h | 87 - .../hle/service/am/service/lock_accessor.cpp | 78 - .../hle/service/am/service/lock_accessor.h | 32 - .../am/service/overlay_applet_proxy.cpp | 120 - .../service/am/service/overlay_applet_proxy.h | 55 - .../service/am/service/overlay_functions.cpp | 52 +- .../service/am/service/overlay_functions.h | 35 +- .../am/service/process_winding_controller.cpp | 28 +- .../am/service/process_winding_controller.h | 1 + .../service/am/service/self_controller.cpp | 113 +- .../hle/service/am/service/self_controller.h | 1 + src/core/hle/service/am/service/storage.cpp | 78 +- src/core/hle/service/am/service/storage.h | 4 + .../service/am/service/storage_accessor.cpp | 68 - .../hle/service/am/service/storage_accessor.h | 38 - .../am/service/system_applet_proxy.cpp | 133 -- .../service/am/service/system_applet_proxy.h | 58 - .../service/am/service/window_controller.cpp | 31 +- .../service/am/service/window_controller.h | 4 + .../hle/service/aoc/addon_content_manager.cpp | 57 +- .../hle/service/aoc/addon_content_manager.h | 5 +- .../service/aoc/purchase_event_manager.cpp | 30 +- .../hle/service/aoc/purchase_event_manager.h | 5 + src/core/hle/service/apm/apm_interface.cpp | 38 +- src/core/hle/service/apm/apm_interface.h | 24 + src/core/hle/service/audio/audio.cpp | 208 +- .../hle/service/audio/audio_controller.cpp | 140 +- src/core/hle/service/audio/audio_controller.h | 4 +- src/core/hle/service/audio/audio_device.cpp | 52 +- src/core/hle/service/audio/audio_device.h | 1 + src/core/hle/service/audio/audio_in.cpp | 50 +- src/core/hle/service/audio/audio_in.h | 4 + .../hle/service/audio/audio_in_manager.cpp | 33 +- src/core/hle/service/audio/audio_in_manager.h | 4 + src/core/hle/service/audio/audio_out.cpp | 40 +- src/core/hle/service/audio/audio_out.h | 5 + .../hle/service/audio/audio_out_manager.cpp | 20 +- .../hle/service/audio/audio_out_manager.h | 1 + src/core/hle/service/audio/audio_renderer.cpp | 51 +- src/core/hle/service/audio/audio_renderer.h | 4 + .../service/audio/audio_renderer_manager.cpp | 22 +- .../service/audio/audio_renderer_manager.h | 1 + .../audio/final_output_recorder_manager.cpp | 42 +- .../audio/final_output_recorder_manager.h | 10 + ...nal_output_recorder_manager_for_applet.cpp | 11 +- ...final_output_recorder_manager_for_applet.h | 11 + .../service/audio/hardware_opus_decoder.cpp | 35 +- .../hle/service/audio/hardware_opus_decoder.h | 4 + .../audio/hardware_opus_decoder_manager.cpp | 34 +- .../audio/hardware_opus_decoder_manager.h | 4 + src/core/hle/service/bcat/bcat_service.cpp | 75 +- src/core/hle/service/bcat/bcat_service.h | 1 + .../bcat/delivery_cache_directory_service.cpp | 18 +- .../bcat/delivery_cache_directory_service.h | 4 + .../bcat/delivery_cache_file_service.cpp | 23 +- .../bcat/delivery_cache_file_service.h | 4 + .../bcat/delivery_cache_progress_service.cpp | 19 +- .../bcat/delivery_cache_progress_service.h | 4 + .../bcat/delivery_cache_storage_service.cpp | 20 +- .../bcat/delivery_cache_storage_service.h | 4 + .../bcat/news/newly_arrived_event_holder.cpp | 22 +- .../bcat/news/newly_arrived_event_holder.h | 4 + .../service/bcat/news/news_data_service.cpp | 19 +- .../hle/service/bcat/news/news_data_service.h | 3 +- .../bcat/news/news_database_service.cpp | 25 +- .../service/bcat/news/news_database_service.h | 4 +- .../hle/service/bcat/news/news_service.cpp | 52 +- src/core/hle/service/bcat/news/news_service.h | 11 +- .../bcat/news/overwrite_event_holder.cpp | 21 +- .../bcat/news/overwrite_event_holder.h | 4 + .../hle/service/bcat/news/service_creator.cpp | 25 +- .../hle/service/bcat/news/service_creator.h | 4 + src/core/hle/service/bcat/service_creator.cpp | 26 +- src/core/hle/service/bcat/service_creator.h | 4 + src/core/hle/service/bpc/bpc.cpp | 138 +- src/core/hle/service/btdrv/btdrv.cpp | 310 +-- src/core/hle/service/btm/btm.cpp | 497 ++++- src/core/hle/service/btm/btm_debug.cpp | 40 - src/core/hle/service/btm/btm_debug.h | 21 - src/core/hle/service/btm/btm_system.cpp | 34 - src/core/hle/service/btm/btm_system.h | 25 - src/core/hle/service/btm/btm_system_core.cpp | 135 -- src/core/hle/service/btm/btm_system_core.h | 62 - src/core/hle/service/btm/btm_user.cpp | 33 - src/core/hle/service/btm/btm_user.h | 25 - src/core/hle/service/btm/btm_user_core.cpp | 106 - src/core/hle/service/btm/btm_user_core.h | 47 - src/core/hle/service/caps/caps.cpp | 218 +- src/core/hle/service/caps/caps_a.cpp | 211 -- src/core/hle/service/caps/caps_a.h | 63 - src/core/hle/service/caps/caps_c.cpp | 50 +- src/core/hle/service/caps/caps_c.h | 12 +- src/core/hle/service/caps/caps_sc.cpp | 29 +- src/core/hle/service/caps/caps_sc.h | 29 + src/core/hle/service/caps/caps_ss.cpp | 26 +- src/core/hle/service/caps/caps_ss.h | 4 + src/core/hle/service/caps/caps_su.cpp | 22 +- src/core/hle/service/caps/caps_su.h | 5 +- src/core/hle/service/caps/caps_u.cpp | 40 +- src/core/hle/service/caps/caps_u.h | 4 + src/core/hle/service/erpt/erpt.cpp | 64 +- src/core/hle/service/es/es.cpp | 342 +-- src/core/hle/service/eupld/eupld.cpp | 47 +- src/core/hle/service/fatal/fatal.cpp | 31 +- src/core/hle/service/fatal/fatal_p.cpp | 19 - src/core/hle/service/fatal/fatal_p.h | 16 - src/core/hle/service/fatal/fatal_u.cpp | 20 - src/core/hle/service/fatal/fatal_u.h | 16 - src/core/hle/service/fgm/fgm.cpp | 52 +- .../service/filesystem/fsp/fs_i_directory.cpp | 16 +- .../service/filesystem/fsp/fs_i_directory.h | 5 + .../hle/service/filesystem/fsp/fs_i_file.cpp | 12 - .../hle/service/filesystem/fsp/fs_i_file.h | 16 + .../filesystem/fsp/fs_i_filesystem.cpp | 43 +- .../service/filesystem/fsp/fs_i_filesystem.h | 1 + .../fsp/fs_i_multi_commit_manager.cpp | 8 +- .../fsp/fs_i_multi_commit_manager.h | 10 + .../fsp/fs_i_save_data_info_reader.cpp | 7 +- .../fsp/fs_i_save_data_info_reader.h | 9 + .../service/filesystem/fsp/fs_i_storage.cpp | 9 - .../hle/service/filesystem/fsp/fs_i_storage.h | 18 +- .../hle/service/filesystem/fsp/fsp_ldr.cpp | 12 +- src/core/hle/service/filesystem/fsp/fsp_ldr.h | 12 + .../hle/service/filesystem/fsp/fsp_pr.cpp | 13 +- src/core/hle/service/filesystem/fsp/fsp_pr.h | 13 + .../hle/service/filesystem/fsp/fsp_srv.cpp | 271 ++- src/core/hle/service/filesystem/fsp/fsp_srv.h | 1 + src/core/hle/service/friend/friend.cpp | 378 ++-- .../hle/service/friend/friend_interface.cpp | 20 - .../hle/service/friend/friend_interface.h | 16 - src/core/hle/service/glue/arp.cpp | 42 +- src/core/hle/service/glue/arp.h | 26 + src/core/hle/service/glue/bgtc.cpp | 43 +- src/core/hle/service/glue/bgtc.h | 42 + src/core/hle/service/glue/ectx.cpp | 38 +- src/core/hle/service/glue/ectx.h | 26 + src/core/hle/service/glue/notif.cpp | 96 +- src/core/hle/service/glue/notif.h | 5 + src/core/hle/service/glue/time/static.cpp | 59 +- src/core/hle/service/glue/time/static.h | 6 +- src/core/hle/service/glue/time/time_zone.cpp | 40 +- src/core/hle/service/glue/time/time_zone.h | 1 + src/core/hle/service/gpio/gpio.cpp | 16 +- src/core/hle/service/grc/grc.cpp | 39 +- .../hid/active_vibration_device_list.cpp | 14 +- .../hid/active_vibration_device_list.h | 5 +- src/core/hle/service/hid/applet_resource.cpp | 11 +- src/core/hle/service/hid/applet_resource.h | 4 + src/core/hle/service/hid/hid.cpp | 365 +++- src/core/hle/service/hid/hid_debug_server.cpp | 296 +-- src/core/hle/service/hid/hid_debug_server.h | 29 +- src/core/hle/service/hid/hid_server.cpp | 396 ++-- src/core/hle/service/hid/hid_server.h | 2 + .../hle/service/hid/hid_system_server.cpp | 246 --- src/core/hle/service/hid/hid_system_server.h | 249 +++ src/core/hle/service/hid/hidbus.cpp | 42 +- src/core/hle/service/hid/hidbus.h | 5 + src/core/hle/service/hid/irs.cpp | 58 +- src/core/hle/service/hid/irs.h | 15 + src/core/hle/service/hid/xcd.cpp | 30 +- src/core/hle/service/hid/xcd.h | 30 + src/core/hle/service/i2c/i2c.cpp | 54 +- src/core/hle/service/jit/jit.cpp | 37 +- src/core/hle/service/lbl/lbl.cpp | 71 +- src/core/hle/service/ldn/ldn.cpp | 138 +- src/core/hle/service/ldn/monitor_service.cpp | 31 +- src/core/hle/service/ldn/monitor_service.h | 4 + .../hle/service/ldn/sf_monitor_service.cpp | 21 +- src/core/hle/service/ldn/sf_monitor_service.h | 4 + src/core/hle/service/ldn/sf_service.cpp | 37 - src/core/hle/service/ldn/sf_service.h | 21 - .../hle/service/ldn/sf_service_monitor.cpp | 41 +- src/core/hle/service/ldn/sf_service_monitor.h | 7 +- .../system_local_communication_service.cpp | 75 +- .../ldn/system_local_communication_service.h | 4 + .../ldn/user_local_communication_service.cpp | 72 +- .../ldn/user_local_communication_service.h | 3 +- src/core/hle/service/ldr/ldr.cpp | 53 +- src/core/hle/service/lm/lm.cpp | 55 +- src/core/hle/service/mig/mig.cpp | 86 +- src/core/hle/service/mii/mii.cpp | 134 +- src/core/hle/service/mii/mii.h | 4 + src/core/hle/service/mm/mm_u.cpp | 27 +- src/core/hle/service/mnpp/mnpp.cpp | 62 +- src/core/hle/service/ncm/ncm.cpp | 220 +- src/core/hle/service/nfc/nfc.cpp | 230 +- src/core/hle/service/nfp/nfp.cpp | 266 ++- src/core/hle/service/ngc/ngc.cpp | 160 +- src/core/hle/service/nifm/nifm.cpp | 227 +- src/core/hle/service/nifm/nifm.h | 3 +- src/core/hle/service/nim/nim.cpp | 681 +++--- src/core/hle/service/npns/npns.cpp | 196 +- .../service/ns/account_proxy_interface.cpp | 10 +- .../hle/service/ns/account_proxy_interface.h | 10 + .../ns/application_manager_interface.cpp | 904 ++++---- .../ns/application_manager_interface.h | 1 + .../ns/application_version_interface.cpp | 22 +- .../ns/application_version_interface.h | 22 + src/core/hle/service/ns/async_result.cpp | 18 +- src/core/hle/service/ns/async_result.h | 1 + .../ns/content_management_interface.cpp | 16 - .../service/ns/content_management_interface.h | 16 + src/core/hle/service/ns/develop_interface.cpp | 28 +- src/core/hle/service/ns/develop_interface.h | 28 + .../hle/service/ns/document_interface.cpp | 12 +- src/core/hle/service/ns/document_interface.h | 12 + .../service/ns/download_task_interface.cpp | 18 +- .../hle/service/ns/download_task_interface.h | 18 + .../service/ns/dynamic_rights_interface.cpp | 70 +- .../hle/service/ns/dynamic_rights_interface.h | 2 + .../hle/service/ns/ecommerce_interface.cpp | 16 +- src/core/hle/service/ns/ecommerce_interface.h | 16 + .../service/ns/factory_reset_interface.cpp | 29 +- .../hle/service/ns/factory_reset_interface.h | 4 + src/core/hle/service/ns/ns.cpp | 63 +- .../service/ns/platform_service_manager.cpp | 44 +- .../hle/service/ns/platform_service_manager.h | 12 +- src/core/hle/service/ns/query_service.cpp | 64 +- src/core/hle/service/ns/query_service.h | 1 + ...nly_application_control_data_interface.cpp | 48 +- ..._only_application_control_data_interface.h | 2 + ...read_only_application_record_interface.cpp | 19 +- .../read_only_application_record_interface.h | 4 +- .../service/ns/service_getter_interface.cpp | 37 +- .../hle/service/ns/service_getter_interface.h | 5 + .../hle/service/ns/system_update_control.cpp | 32 +- .../hle/service/ns/system_update_control.h | 32 + .../service/ns/system_update_interface.cpp | 49 +- .../hle/service/ns/system_update_interface.h | 5 +- src/core/hle/service/nvdrv/nvdrv.cpp | 74 +- .../hle/service/nvdrv/nvdrv_interface.cpp | 18 - src/core/hle/service/nvdrv/nvdrv_interface.h | 24 +- src/core/hle/service/nvdrv/nvmemp.cpp | 5 - src/core/hle/service/nvdrv/nvmemp.h | 11 + .../service/nvnflinger/hos_binder_driver.cpp | 20 +- .../service/nvnflinger/hos_binder_driver.h | 1 + .../hle/service/olsc/daemon_controller.cpp | 36 +- src/core/hle/service/olsc/daemon_controller.h | 2 + .../hle/service/olsc/native_handle_holder.cpp | 14 +- .../hle/service/olsc/native_handle_holder.h | 1 + src/core/hle/service/olsc/olsc.cpp | 173 +- .../olsc/olsc_service_for_application.cpp | 59 +- .../olsc/olsc_service_for_application.h | 2 + .../olsc/olsc_service_for_system_service.cpp | 144 -- .../olsc/olsc_service_for_system_service.h | 53 - .../olsc/remote_storage_controller.cpp | 72 +- .../service/olsc/remote_storage_controller.h | 2 + .../olsc/transfer_task_list_controller.cpp | 74 +- .../olsc/transfer_task_list_controller.h | 2 + .../service/omm/operation_mode_manager.cpp | 38 +- .../hle/service/omm/operation_mode_manager.h | 38 + .../hle/service/omm/policy_manager_system.cpp | 15 +- .../hle/service/omm/policy_manager_system.h | 15 + .../hle/service/omm/power_state_interface.cpp | 21 +- .../hle/service/omm/power_state_interface.h | 21 + src/core/hle/service/pcie/pcie.cpp | 90 +- .../service/pctl/parental_control_service.cpp | 498 ----- .../service/pctl/parental_control_service.h | 99 - .../pctl/parental_control_service_factory.cpp | 44 - .../pctl/parental_control_service_factory.h | 31 - src/core/hle/service/pctl/pctl.cpp | 636 +++++- src/core/hle/service/pctl/pctl_results.h | 15 - src/core/hle/service/pctl/pctl_types.h | 73 - src/core/hle/service/pcv/pcv.cpp | 172 +- src/core/hle/service/pm/pm.cpp | 100 +- src/core/hle/service/prepo/prepo.cpp | 91 +- src/core/hle/service/psc/ovln/receiver.cpp | 118 - src/core/hle/service/psc/ovln/receiver.h | 46 - .../hle/service/psc/ovln/receiver_service.cpp | 123 +- .../hle/service/psc/ovln/receiver_service.h | 5 + src/core/hle/service/psc/ovln/sender.cpp | 32 - src/core/hle/service/psc/ovln/sender.h | 21 - .../hle/service/psc/ovln/sender_service.cpp | 43 +- .../hle/service/psc/ovln/sender_service.h | 8 +- src/core/hle/service/psc/pm_control.cpp | 28 - src/core/hle/service/psc/pm_control.h | 16 - src/core/hle/service/psc/pm_module.cpp | 24 - src/core/hle/service/psc/pm_module.h | 16 - src/core/hle/service/psc/pm_service.cpp | 28 - src/core/hle/service/psc/pm_service.h | 22 - src/core/hle/service/psc/psc.cpp | 181 +- src/core/hle/service/psc/time/alarms.cpp | 24 +- src/core/hle/service/psc/time/alarms.h | 21 +- src/core/hle/service/psc/time/manager.h | 31 +- .../service/psc/time/power_state_service.cpp | 19 +- .../service/psc/time/power_state_service.h | 1 + .../hle/service/psc/time/service_manager.cpp | 48 +- .../hle/service/psc/time/service_manager.h | 2 + src/core/hle/service/psc/time/static.cpp | 50 +- src/core/hle/service/psc/time/static.h | 2 + .../hle/service/psc/time/steady_clock.cpp | 28 +- src/core/hle/service/psc/time/steady_clock.h | 2 + .../hle/service/psc/time/system_clock.cpp | 24 +- src/core/hle/service/psc/time/system_clock.h | 1 + .../service/psc/time/time_zone_service.cpp | 42 +- .../hle/service/psc/time/time_zone_service.h | 1 + src/core/hle/service/ptm/psm.cpp | 53 +- src/core/hle/service/ptm/psm.h | 25 + src/core/hle/service/ptm/ptm.cpp | 32 +- src/core/hle/service/ptm/ts.cpp | 29 +- src/core/hle/service/ptm/ts.h | 14 + src/core/hle/service/ro/ro.cpp | 371 +++- src/core/hle/service/ro/ro_nro_utils.cpp | 185 -- src/core/hle/service/ro/ro_nro_utils.h | 26 - src/core/hle/service/ro/ro_results.h | 29 - src/core/hle/service/ro/ro_types.h | 142 -- src/core/hle/service/service.cpp | 69 +- src/core/hle/service/service.h | 145 +- .../service/set/factory_settings_server.cpp | 52 +- .../hle/service/set/factory_settings_server.h | 52 + .../set/firmware_debug_settings_server.cpp | 19 +- .../set/firmware_debug_settings_server.h | 20 + src/core/hle/service/set/settings_server.cpp | 38 +- src/core/hle/service/set/settings_server.h | 25 +- .../service/set/system_settings_server.cpp | 465 ++-- .../hle/service/set/system_settings_server.h | 2 +- src/core/hle/service/sm/sm.cpp | 205 +- src/core/hle/service/sm/sm.h | 24 +- src/core/hle/service/sm/sm_controller.cpp | 128 -- src/core/hle/service/sm/sm_controller.h | 27 - src/core/hle/service/sockets/bsd.cpp | 81 - src/core/hle/service/sockets/bsd.h | 81 + src/core/hle/service/sockets/nsd.cpp | 32 - src/core/hle/service/sockets/nsd.h | 32 + src/core/hle/service/sockets/sfdnsres.cpp | 27 - src/core/hle/service/sockets/sfdnsres.h | 31 + src/core/hle/service/sockets/sockets.cpp | 62 +- src/core/hle/service/spl/spl.cpp | 171 +- src/core/hle/service/spl/spl.h | 141 ++ src/core/hle/service/spl/spl_module.cpp | 15 +- src/core/hle/service/ssl/ssl.cpp | 395 ++-- src/core/hle/service/tma/tma.cpp | 12 +- src/core/hle/service/usb/usb.cpp | 290 ++- .../vi/application_display_service.cpp | 56 +- .../service/vi/application_display_service.h | 2 +- .../service/vi/application_root_service.cpp | 16 +- .../hle/service/vi/application_root_service.h | 4 + .../service/vi/manager_display_service.cpp | 176 +- .../hle/service/vi/manager_display_service.h | 3 +- .../hle/service/vi/manager_root_service.cpp | 24 +- .../hle/service/vi/manager_root_service.h | 4 + .../hle/service/vi/shared_buffer_manager.h | 4 + .../hle/service/vi/system_display_service.cpp | 112 +- .../hle/service/vi/system_display_service.h | 1 + .../hle/service/vi/system_root_service.cpp | 20 +- src/core/hle/service/vi/system_root_service.h | 4 + src/core/hle/service/wlan/wlan.cpp | 368 ++-- tools/README.md | 2 +- 392 files changed, 12860 insertions(+), 14029 deletions(-) rename docs/{HosKernel.md => SubsystemHLE.md} (55%) delete mode 100644 src/core/hle/service/am/service/all_system_applet_proxies_service.cpp delete mode 100644 src/core/hle/service/am/service/all_system_applet_proxies_service.h delete mode 100644 src/core/hle/service/am/service/applet_common_functions.cpp delete mode 100644 src/core/hle/service/am/service/applet_common_functions.h delete mode 100644 src/core/hle/service/am/service/application_proxy.cpp delete mode 100644 src/core/hle/service/am/service/application_proxy.h delete mode 100644 src/core/hle/service/am/service/application_proxy_service.cpp delete mode 100644 src/core/hle/service/am/service/application_proxy_service.h delete mode 100644 src/core/hle/service/am/service/debug_functions.cpp delete mode 100644 src/core/hle/service/am/service/debug_functions.h delete mode 100644 src/core/hle/service/am/service/library_applet_creator.cpp delete mode 100644 src/core/hle/service/am/service/library_applet_creator.h delete mode 100644 src/core/hle/service/am/service/library_applet_proxy.cpp delete mode 100644 src/core/hle/service/am/service/library_applet_proxy.h delete mode 100644 src/core/hle/service/am/service/library_applet_self_accessor.cpp delete mode 100644 src/core/hle/service/am/service/library_applet_self_accessor.h delete mode 100644 src/core/hle/service/am/service/lock_accessor.cpp delete mode 100644 src/core/hle/service/am/service/lock_accessor.h delete mode 100644 src/core/hle/service/am/service/overlay_applet_proxy.cpp delete mode 100644 src/core/hle/service/am/service/overlay_applet_proxy.h delete mode 100644 src/core/hle/service/am/service/storage_accessor.cpp delete mode 100644 src/core/hle/service/am/service/storage_accessor.h delete mode 100644 src/core/hle/service/am/service/system_applet_proxy.cpp delete mode 100644 src/core/hle/service/am/service/system_applet_proxy.h delete mode 100644 src/core/hle/service/btm/btm_debug.cpp delete mode 100644 src/core/hle/service/btm/btm_debug.h delete mode 100644 src/core/hle/service/btm/btm_system.cpp delete mode 100644 src/core/hle/service/btm/btm_system.h delete mode 100644 src/core/hle/service/btm/btm_system_core.cpp delete mode 100644 src/core/hle/service/btm/btm_system_core.h delete mode 100644 src/core/hle/service/btm/btm_user.cpp delete mode 100644 src/core/hle/service/btm/btm_user.h delete mode 100644 src/core/hle/service/btm/btm_user_core.cpp delete mode 100644 src/core/hle/service/btm/btm_user_core.h delete mode 100644 src/core/hle/service/caps/caps_a.cpp delete mode 100644 src/core/hle/service/caps/caps_a.h delete mode 100644 src/core/hle/service/fatal/fatal_p.cpp delete mode 100644 src/core/hle/service/fatal/fatal_p.h delete mode 100644 src/core/hle/service/fatal/fatal_u.cpp delete mode 100644 src/core/hle/service/fatal/fatal_u.h delete mode 100644 src/core/hle/service/friend/friend_interface.cpp delete mode 100644 src/core/hle/service/friend/friend_interface.h delete mode 100644 src/core/hle/service/ldn/sf_service.cpp delete mode 100644 src/core/hle/service/ldn/sf_service.h delete mode 100644 src/core/hle/service/olsc/olsc_service_for_system_service.cpp delete mode 100644 src/core/hle/service/olsc/olsc_service_for_system_service.h delete mode 100644 src/core/hle/service/pctl/parental_control_service.cpp delete mode 100644 src/core/hle/service/pctl/parental_control_service.h delete mode 100644 src/core/hle/service/pctl/parental_control_service_factory.cpp delete mode 100644 src/core/hle/service/pctl/parental_control_service_factory.h delete mode 100644 src/core/hle/service/pctl/pctl_results.h delete mode 100644 src/core/hle/service/pctl/pctl_types.h delete mode 100644 src/core/hle/service/psc/ovln/receiver.cpp delete mode 100644 src/core/hle/service/psc/ovln/receiver.h delete mode 100644 src/core/hle/service/psc/ovln/sender.cpp delete mode 100644 src/core/hle/service/psc/ovln/sender.h delete mode 100644 src/core/hle/service/psc/pm_control.cpp delete mode 100644 src/core/hle/service/psc/pm_control.h delete mode 100644 src/core/hle/service/psc/pm_module.cpp delete mode 100644 src/core/hle/service/psc/pm_module.h delete mode 100644 src/core/hle/service/psc/pm_service.cpp delete mode 100644 src/core/hle/service/psc/pm_service.h delete mode 100644 src/core/hle/service/ro/ro_nro_utils.cpp delete mode 100644 src/core/hle/service/ro/ro_nro_utils.h delete mode 100644 src/core/hle/service/ro/ro_results.h delete mode 100644 src/core/hle/service/ro/ro_types.h delete mode 100644 src/core/hle/service/sm/sm_controller.cpp delete mode 100644 src/core/hle/service/sm/sm_controller.h diff --git a/docs/DesignOverview.md b/docs/DesignOverview.md index c6a328cb9c..959fbfdbb2 100644 --- a/docs/DesignOverview.md +++ b/docs/DesignOverview.md @@ -1,6 +1,6 @@ # Design Overview -Modern game consoles require heavy power to be emulated appropriately. This is why the emulator uses an approach known as HLE (High-Level-Emulation), in a nutshell: Instead of accurately emulating every subsystem that forms part of a component, emulate the resulting visible I/O interface instead. +Modern game consoles require heavy power to emulate. This is why the emulator uses an approach known as HLE (High-Level-Emulation), in a nutshell: Instead of accurately emulating every subsystem that forms part of a component, emulate the resulting visible output of said interface instead. For example, take a disk write, instead of emulating a proper SD card we instead use the C++ standard library for I/O. Additionally we use the abstractions provided by the `fs` service to "lie" to programs about certain SD card properties. Notably this includes making up sizes for the fake SD card, giving "realistic" values or expected outputs for a given card, and so on. And instead of writing to an actual SD card, the emulator simply writes to a file. diff --git a/docs/README.md b/docs/README.md index 5bcaf30239..f7568e16f3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -21,7 +21,7 @@ This contains documentation created by developers, build instructions, guideline - Subsystems: - **[Design Overview](./DesignOverview.md)** - **[Dynarmic](./dynarmic/README.md)** - - **[HOS Kernel](./HosKernel.md)** + - **[Subsystem: HLE](./SubsystemHLE.md)** - **[Settings](./Settings.md)** ## Policies diff --git a/docs/HosKernel.md b/docs/SubsystemHLE.md similarity index 55% rename from docs/HosKernel.md rename to docs/SubsystemHLE.md index 87df2072a5..7a59fef9fa 100644 --- a/docs/HosKernel.md +++ b/docs/SubsystemHLE.md @@ -1,4 +1,6 @@ -# HOS Kernel +# Subsystem: HLE + +## HOS Kernel In brief, the HOS kernel is a microkernel, all services and programs run in userspace, the primary way to do communication between these is via `HIPC` (not covered here); otherwise most of the primitives reside in the forms of syscalls invoked via `svc #imm`. The kernel supports both 32-bit and 64-bit programs, and has the capacity to use 32, 36 and 39 bits of address space for spawned processes. Most of the networking stack is based off FreeBSD's network stack. @@ -29,3 +31,52 @@ Every process keeps it's own tracking of the following structures: The emulator willingly restricts itself to only use 4 threads (to emulate 4 cores), this is because most existing applications do not benefit greatly from the added core count, and in fact can be detrimental due to extra contention. This translates equitatively to about 4 `ArmInterface` slots for each process, these are then redirected to whatever is the last `pc` of the last thread running on the core is meant to be; proceed to run it, then when returning (due to halt or interruption), proceed to reschedule the thread. The scheduler as-is isn't 100% faithful to the original (for example the original is cooperative and not preemptive), and has great timing variance (especially due to the fact the emulator can run in systems with wildly different timings). + +## Services + +Consult [SwitchBrew](https://switchbrew.org/) for per-service methods, and implementation details. + +All services are instatiated implicitly using `ServiceFramework`. To register a new interface or service, you can inherit from said class, providing additionally a template parameter that references `Self`, for example: + +```c++ +// Follows as: +// class MyInterface [final] : public ServiceFramework { ... }; +// [final] is optional, but should be used whenever there is no intention of this class itself being inherited. +class IFloatingRegistrationRequest final : public ServiceFramework { +public: + // ctor, you can pass extra parameters here (if so required) + explicit IFloatingRegistrationRequest(Core::System& system_) + : ServiceFramework{system_, "IFloatingRegistrationRequest"} + {} + + // Must be placed after all methods are defined (or declared). + // Define here your functions and methods, please order them. + // Use FindRequestTipc for TIPC handlers. + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetSessionId"}, + FunctionInfo{12, nullptr, "GetAccountId"}, + FunctionInfo{13, nullptr, "GetLinkedNintendoAccountId"}, + FunctionInfo{14, nullptr, "GetNickname"}, + FunctionInfo{15, nullptr, "GetProfileImage"}, + FunctionInfo{16, nullptr, "GetProfileLargeImage", MakeVersionGate({18,0,0})}, + FunctionInfo{21, nullptr, "LoadIdTokenCache"}, + FunctionInfo{100, nullptr, "RegisterUser"}, + FunctionInfo{101, nullptr, "RegisterUserWithUid"}, + FunctionInfo{102, nullptr, "RegisterNetworkServiceAccountAsync", MakeVersionGate({4,0,0})}, + FunctionInfo{103, nullptr, "RegisterNetworkServiceAccountWithUidAsync", MakeVersionGate({4,0,0})}, + FunctionInfo{110, nullptr, "SetSystemProgramIdentification"}, + FunctionInfo{111, nullptr, "EnsureIdTokenCacheAsync"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } +}; +``` + +Try to keep service structures local, that is, don't place them on header files if they're only going to be used by a specific service. + +In each `.cpp` file that uses `D<...>/C<...>` CMIF wrapper helpers, remember to include the corresponding instancer, so you don't face linker errors: +```c++ +#include "core/hle/service/cmif_serialization.h" +``` +This will properly instatiate the corresponding wrappers and decompose the provided arguments in the wiring order. diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 31f9931d3a..f1d4bdae42 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -444,28 +444,18 @@ add_library(core STATIC hle/service/am/process_creation.h hle/service/am/process_holder.cpp hle/service/am/process_holder.h - hle/service/am/service/all_system_applet_proxies_service.cpp - hle/service/am/service/all_system_applet_proxies_service.h - hle/service/am/service/applet_common_functions.cpp - hle/service/am/service/applet_common_functions.h hle/service/am/service/application_accessor.cpp hle/service/am/service/application_accessor.h hle/service/am/service/application_creator.cpp hle/service/am/service/application_creator.h hle/service/am/service/application_functions.cpp hle/service/am/service/application_functions.h - hle/service/am/service/application_proxy.cpp - hle/service/am/service/application_proxy.h - hle/service/am/service/application_proxy_service.cpp - hle/service/am/service/application_proxy_service.h hle/service/am/service/audio_controller.cpp hle/service/am/service/audio_controller.h hle/service/am/service/common_state_getter.cpp hle/service/am/service/common_state_getter.h hle/service/am/service/cradle_firmware_updater.cpp hle/service/am/service/cradle_firmware_updater.h - hle/service/am/service/debug_functions.cpp - hle/service/am/service/debug_functions.h hle/service/am/service/display_controller.cpp hle/service/am/service/display_controller.h hle/service/am/service/global_state_controller.cpp @@ -474,28 +464,14 @@ add_library(core STATIC hle/service/am/service/home_menu_functions.h hle/service/am/service/library_applet_accessor.cpp hle/service/am/service/library_applet_accessor.h - hle/service/am/service/library_applet_creator.cpp - hle/service/am/service/library_applet_creator.h - hle/service/am/service/library_applet_proxy.cpp - hle/service/am/service/library_applet_proxy.h - hle/service/am/service/library_applet_self_accessor.cpp - hle/service/am/service/library_applet_self_accessor.h - hle/service/am/service/lock_accessor.cpp - hle/service/am/service/lock_accessor.h hle/service/am/service/overlay_functions.cpp hle/service/am/service/overlay_functions.h - hle/service/am/service/overlay_applet_proxy.cpp - hle/service/am/service/overlay_applet_proxy.h hle/service/am/service/process_winding_controller.cpp hle/service/am/service/process_winding_controller.h hle/service/am/service/self_controller.cpp hle/service/am/service/self_controller.h hle/service/am/service/storage.cpp hle/service/am/service/storage.h - hle/service/am/service/storage_accessor.cpp - hle/service/am/service/storage_accessor.h - hle/service/am/service/system_applet_proxy.cpp - hle/service/am/service/system_applet_proxy.h hle/service/am/service/window_controller.cpp hle/service/am/service/window_controller.h hle/service/am/window_system.cpp @@ -580,20 +556,8 @@ add_library(core STATIC hle/service/btdrv/btdrv.h hle/service/btm/btm.cpp hle/service/btm/btm.h - hle/service/btm/btm_debug.cpp - hle/service/btm/btm_debug.h - hle/service/btm/btm_system.cpp - hle/service/btm/btm_system.h - hle/service/btm/btm_system_core.cpp - hle/service/btm/btm_system_core.h - hle/service/btm/btm_user.cpp - hle/service/btm/btm_user.h - hle/service/btm/btm_user_core.cpp - hle/service/btm/btm_user_core.h hle/service/caps/caps.cpp hle/service/caps/caps.h - hle/service/caps/caps_a.cpp - hle/service/caps/caps_a.h hle/service/caps/caps_c.cpp hle/service/caps/caps_c.h hle/service/caps/caps_manager.cpp @@ -618,10 +582,6 @@ add_library(core STATIC hle/service/eupld/eupld.h hle/service/fatal/fatal.cpp hle/service/fatal/fatal.h - hle/service/fatal/fatal_p.cpp - hle/service/fatal/fatal_p.h - hle/service/fatal/fatal_u.cpp - hle/service/fatal/fatal_u.h hle/service/fgm/fgm.cpp hle/service/fgm/fgm.h hle/service/filesystem/filesystem.cpp @@ -653,8 +613,6 @@ add_library(core STATIC hle/service/filesystem/save_data_controller.h hle/service/friend/friend.cpp hle/service/friend/friend.h - hle/service/friend/friend_interface.cpp - hle/service/friend/friend_interface.h hle/service/glue/arp.cpp hle/service/glue/arp.h hle/service/glue/bgtc.cpp @@ -723,8 +681,6 @@ add_library(core STATIC hle/service/ldn/monitor_service.h hle/service/ldn/sf_monitor_service.cpp hle/service/ldn/sf_monitor_service.h - hle/service/ldn/sf_service.cpp - hle/service/ldn/sf_service.h hle/service/ldn/sf_service_monitor.cpp hle/service/ldn/sf_service_monitor.h hle/service/ldn/system_local_communication_service.cpp @@ -913,8 +869,6 @@ add_library(core STATIC hle/service/olsc/native_handle_holder.h hle/service/olsc/olsc_service_for_application.cpp hle/service/olsc/olsc_service_for_application.h - hle/service/olsc/olsc_service_for_system_service.cpp - hle/service/olsc/olsc_service_for_system_service.h hle/service/olsc/olsc.cpp hle/service/olsc/olsc.h hle/service/olsc/remote_storage_controller.cpp @@ -944,14 +898,8 @@ add_library(core STATIC hle/service/os/process.h hle/service/pcie/pcie.cpp hle/service/pcie/pcie.h - hle/service/pctl/parental_control_service_factory.cpp - hle/service/pctl/parental_control_service_factory.h - hle/service/pctl/parental_control_service.cpp - hle/service/pctl/parental_control_service.h hle/service/pctl/pctl.cpp hle/service/pctl/pctl.h - hle/service/pctl/pctl_results.h - hle/service/pctl/pctl_types.h hle/service/pcv/pcv.cpp hle/service/pcv/pcv.h hle/service/pm/pm.cpp @@ -961,18 +909,8 @@ add_library(core STATIC hle/service/psc/ovln/ovln_types.h hle/service/psc/ovln/receiver_service.cpp hle/service/psc/ovln/receiver_service.h - hle/service/psc/ovln/receiver.cpp - hle/service/psc/ovln/receiver.h hle/service/psc/ovln/sender_service.cpp hle/service/psc/ovln/sender_service.h - hle/service/psc/ovln/sender.cpp - hle/service/psc/ovln/sender.h - hle/service/psc/pm_control.cpp - hle/service/psc/pm_control.h - hle/service/psc/pm_module.cpp - hle/service/psc/pm_module.h - hle/service/psc/pm_service.cpp - hle/service/psc/pm_service.h hle/service/psc/psc.cpp hle/service/psc/psc.h hle/service/psc/time/alarms.cpp @@ -1023,10 +961,6 @@ add_library(core STATIC hle/service/ptm/ts.h hle/service/ro/ro.cpp hle/service/ro/ro.h - hle/service/ro/ro_nro_utils.cpp - hle/service/ro/ro_nro_utils.h - hle/service/ro/ro_results.h - hle/service/ro/ro_types.h hle/service/server_manager.cpp hle/service/server_manager.h hle/service/service.cpp @@ -1055,8 +989,6 @@ add_library(core STATIC hle/service/set/system_settings_server.h hle/service/sm/sm.cpp hle/service/sm/sm.h - hle/service/sm/sm_controller.cpp - hle/service/sm/sm_controller.h hle/service/sockets/bsd.cpp hle/service/sockets/bsd.h hle/service/sockets/nsd.cpp @@ -1222,7 +1154,7 @@ target_link_libraries(core PRIVATE RenderDoc::API ZLIB::ZLIB) -target_link_libraries(core PUBLIC httplib::httplib zstd::zstd) +target_link_libraries(core PUBLIC httplib::httplib zstd::zstd frozen::frozen-headers) if (ENABLE_WEB_SERVICE) target_compile_definitions(core PUBLIC ENABLE_WEB_SERVICE) diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index d68b6bde0d..9b29a7773c 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -75,41 +75,6 @@ class IManagerForSystemService final : public ServiceFramework, "CheckAvailability"}, - {1, D<&IManagerForSystemService::GetAccountId>, "GetAccountId"}, - {2, nullptr, "EnsureIdTokenCacheAsync"}, - {3, D<&IManagerForSystemService::LoadIdTokenCacheDeprecated>, "LoadIdTokenCacheDeprecated"}, // 19.0.0+ - {4, D<&IManagerForSystemService::LoadIdTokenCache>, "LoadIdTokenCache"}, // 19.0.0+ - {100, nullptr, "SetSystemProgramIdentification"}, - {101, nullptr, "RefreshNotificationTokenAsync"}, // 7.0.0+ - {110, nullptr, "GetServiceEntryRequirementCache"}, // 4.0.0+ - {111, nullptr, "InvalidateServiceEntryRequirementCache"}, // 4.0.0+ - {112, nullptr, "InvalidateTokenCache"}, // 4.0.0 - 6.2.0 - {113, nullptr, "GetServiceEntryRequirementCacheForOnlinePlay"}, // 6.1.0+ - {120, nullptr, "GetNintendoAccountId"}, - {121, nullptr, "CalculateNintendoAccountAuthenticationFingerprint"}, // 9.0.0+ - {130, nullptr, "GetNintendoAccountUserResourceCache"}, - {131, nullptr, "RefreshNintendoAccountUserResourceCacheAsync"}, - {132, nullptr, "RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed"}, - {133, nullptr, "GetNintendoAccountVerificationUrlCache"}, // 9.0.0+ - {134, nullptr, "RefreshNintendoAccountVerificationUrlCache"}, // 9.0.0+ - {135, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed"}, // 9.0.0+ - {136, nullptr, "GetNintendoAccountUserResourceCache"}, // 19.0.0+ - {140, nullptr, "GetNetworkServiceLicenseCache"}, // 5.0.0+ - {141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+ - {142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+ - {143, D<&IManagerForSystemService::GetNetworkServiceLicenseCacheEx>, "GetNetworkServiceLicenseCacheEx"}, // 15.0.0+ - {150, nullptr, "CreateAuthorizationRequest"}, - {160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, - {161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, - {170, nullptr, "CreateDeviceHistoryRequest"}, // 17.0.0+ - {180, nullptr, "GetRequestForNintendoAccountReauthentication"} // 18.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } private: @@ -143,6 +108,40 @@ private: R_SUCCEED(); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IManagerForSystemService::CheckAvailability>, "CheckAvailability"}, + FunctionInfo{1, D<&IManagerForSystemService::GetAccountId>, "GetAccountId"}, + FunctionInfo{2, nullptr, "EnsureIdTokenCacheAsync"}, + FunctionInfo{3, D<&IManagerForSystemService::LoadIdTokenCacheDeprecated>, "LoadIdTokenCacheDeprecated", MakeVersionGate({19,0,0})}, + FunctionInfo{4, D<&IManagerForSystemService::LoadIdTokenCache>, "LoadIdTokenCache", MakeVersionGate({19,0,0})}, + FunctionInfo{100, nullptr, "SetSystemProgramIdentification"}, + FunctionInfo{101, nullptr, "RefreshNotificationTokenAsync", MakeVersionGate({7,0,0})}, + FunctionInfo{110, nullptr, "GetServiceEntryRequirementCache", MakeVersionGate({4,0,0})}, + FunctionInfo{111, nullptr, "InvalidateServiceEntryRequirementCache", MakeVersionGate({4,0,0})}, + FunctionInfo{112, nullptr, "InvalidateTokenCache", MakeVersionGate({4,0,0}, {6,2,0})}, + FunctionInfo{113, nullptr, "GetServiceEntryRequirementCacheForOnlinePlay", MakeVersionGate({6,1,0})}, + FunctionInfo{120, nullptr, "GetNintendoAccountId"}, + FunctionInfo{121, nullptr, "CalculateNintendoAccountAuthenticationFingerprint", MakeVersionGate({9,0,0})}, + FunctionInfo{130, nullptr, "GetNintendoAccountUserResourceCache"}, + FunctionInfo{131, nullptr, "RefreshNintendoAccountUserResourceCacheAsync"}, + FunctionInfo{132, nullptr, "RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed"}, + FunctionInfo{133, nullptr, "GetNintendoAccountVerificationUrlCache", MakeVersionGate({9,0,0})}, + FunctionInfo{134, nullptr, "RefreshNintendoAccountVerificationUrlCache", MakeVersionGate({9,0,0})}, + FunctionInfo{135, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed", MakeVersionGate({9,0,0})}, + FunctionInfo{136, nullptr, "GetNintendoAccountUserResourceCache", MakeVersionGate({19,0,0})}, + FunctionInfo{140, nullptr, "GetNetworkServiceLicenseCache", MakeVersionGate({5,0,0})}, + FunctionInfo{141, nullptr, "RefreshNetworkServiceLicenseCacheAsync", MakeVersionGate({5,0,0})}, + FunctionInfo{142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed", MakeVersionGate({5,0,0})}, + FunctionInfo{143, D<&IManagerForSystemService::GetNetworkServiceLicenseCacheEx>, "GetNetworkServiceLicenseCacheEx", MakeVersionGate({15,0,0})}, + FunctionInfo{150, nullptr, "CreateAuthorizationRequest"}, + FunctionInfo{160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, + FunctionInfo{161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, + FunctionInfo{170, nullptr, "CreateDeviceHistoryRequest", MakeVersionGate({17,0,0})}, + FunctionInfo{180, nullptr, "GetRequestForNintendoAccountReauthentication", MakeVersionGate({18,0,0})} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } Common::UUID account_id; }; @@ -151,25 +150,25 @@ class IFloatingRegistrationRequest final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; @@ -177,62 +176,6 @@ class IAdministrator final : public ServiceFramework { public: explicit IAdministrator(Core::System& system_, Common::UUID) : ServiceFramework{system_, "IAdministrator"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CheckAvailability"}, - {1, nullptr, "GetAccountId"}, - {2, nullptr, "EnsureIdTokenCacheAsync"}, - {3, nullptr, "LoadIdTokenCache"}, - {100, nullptr, "SetSystemProgramIdentification"}, - {101, nullptr, "RefreshNotificationTokenAsync"}, // 7.0.0+ - {110, nullptr, "GetServiceEntryRequirementCache"}, // 4.0.0+ - {111, nullptr, "InvalidateServiceEntryRequirementCache"}, // 4.0.0+ - {112, nullptr, "InvalidateTokenCache"}, // 4.0.0 - 6.2.0 - {113, nullptr, "GetServiceEntryRequirementCacheForOnlinePlay"}, // 6.1.0+ - {120, nullptr, "GetNintendoAccountId"}, - {121, nullptr, "CalculateNintendoAccountAuthenticationFingerprint"}, // 9.0.0+ - {130, nullptr, "GetNintendoAccountUserResourceCache"}, - {131, nullptr, "RefreshNintendoAccountUserResourceCacheAsync"}, - {132, nullptr, "RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed"}, - {133, nullptr, "GetNintendoAccountVerificationUrlCache"}, // 9.0.0+ - {134, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsync"}, // 9.0.0+ - {135, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed"}, // 9.0.0+ - {140, nullptr, "GetNetworkServiceLicenseCache"}, // 5.0.0+ - {141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+ - {142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+ - {143, nullptr, "GetNetworkServiceLicenseCacheEx"}, - {150, nullptr, "CreateAuthorizationRequest"}, - {160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, - {161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, - {170, nullptr, "CreateDeviceHistoryRequest"}, // 17.0.0+ - {180, nullptr, "GetRequestForNintendoAccountReauthentication"}, // 18.0.0+ - {200, nullptr, "IsRegistered"}, - {201, nullptr, "RegisterAsync"}, - {202, nullptr, "UnregisterAsync"}, - {203, nullptr, "DeleteRegistrationInfoLocally"}, - {220, nullptr, "SynchronizeProfileAsync"}, - {221, nullptr, "UploadProfileAsync"}, - {222, nullptr, "SynchronizaProfileAsyncIfSecondsElapsed"}, - {250, &IAdministrator::IsLinkedWithNintendoAccount, "IsLinkedWithNintendoAccount"}, - {251, nullptr, "CreateProcedureToLinkWithNintendoAccount"}, - {252, nullptr, "ResumeProcedureToLinkWithNintendoAccount"}, - {255, nullptr, "CreateProcedureToUpdateLinkageStateOfNintendoAccount"}, - {256, nullptr, "ResumeProcedureToUpdateLinkageStateOfNintendoAccount"}, - {260, nullptr, "CreateProcedureToLinkNnidWithNintendoAccount"}, // 3.0.0+ - {261, nullptr, "ResumeProcedureToLinkNnidWithNintendoAccount"}, // 3.0.0+ - {280, nullptr, "ProxyProcedureToAcquireApplicationAuthorizationForNintendoAccount"}, - {290, nullptr, "GetRequestForNintendoAccountUserResourceView"}, // 8.0.0+ - {300, nullptr, "TryRecoverNintendoAccountUserStateAsync"}, // 6.0.0+ - {400, nullptr, "IsServiceEntryRequirementCacheRefreshRequiredForOnlinePlay"}, // 6.1.0+ - {401, nullptr, "RefreshServiceEntryRequirementCacheForOnlinePlayAsync"}, // 6.1.0+ - {900, nullptr, "GetAuthenticationInfoForWin"}, // 9.0.0+ - {901, nullptr, "ImportAsyncForWin"}, // 9.0.0+ - {997, nullptr, "DebugUnlinkNintendoAccountAsync"}, - {998, nullptr, "DebugSetAvailabilityErrorDetail"}, - }; - // clang-format on - - RegisterHandlers(functions); } private: @@ -241,42 +184,97 @@ private: rb.Push(ResultSuccess); rb.Push(false); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CheckAvailability"}, + FunctionInfo{1, nullptr, "GetAccountId"}, + FunctionInfo{2, nullptr, "EnsureIdTokenCacheAsync"}, + FunctionInfo{3, nullptr, "LoadIdTokenCache"}, + FunctionInfo{100, nullptr, "SetSystemProgramIdentification"}, + FunctionInfo{101, nullptr, "RefreshNotificationTokenAsync", MakeVersionGate({7,0,0})}, + FunctionInfo{110, nullptr, "GetServiceEntryRequirementCache", MakeVersionGate({4,0,0})}, + FunctionInfo{111, nullptr, "InvalidateServiceEntryRequirementCache", MakeVersionGate({4,0,0})}, + FunctionInfo{112, nullptr, "InvalidateTokenCache", MakeVersionGate({4,0,0}, {6,2,0})}, + FunctionInfo{113, nullptr, "GetServiceEntryRequirementCacheForOnlinePlay", MakeVersionGate({6,1,0})}, + FunctionInfo{120, nullptr, "GetNintendoAccountId"}, + FunctionInfo{121, nullptr, "CalculateNintendoAccountAuthenticationFingerprint", MakeVersionGate({9,0,0})}, + FunctionInfo{130, nullptr, "GetNintendoAccountUserResourceCache"}, + FunctionInfo{131, nullptr, "RefreshNintendoAccountUserResourceCacheAsync"}, + FunctionInfo{132, nullptr, "RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed"}, + FunctionInfo{133, nullptr, "GetNintendoAccountVerificationUrlCache", MakeVersionGate({9,0,0})}, + FunctionInfo{134, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsync", MakeVersionGate({9,0,0})}, + FunctionInfo{135, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed", MakeVersionGate({9,0,0})}, + FunctionInfo{140, nullptr, "GetNetworkServiceLicenseCache", MakeVersionGate({5,0,0})}, + FunctionInfo{141, nullptr, "RefreshNetworkServiceLicenseCacheAsync", MakeVersionGate({5,0,0})}, + FunctionInfo{142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed", MakeVersionGate({5,0,0})}, + FunctionInfo{143, nullptr, "GetNetworkServiceLicenseCacheEx"}, + FunctionInfo{150, nullptr, "CreateAuthorizationRequest"}, + FunctionInfo{160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, + FunctionInfo{161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, + FunctionInfo{170, nullptr, "CreateDeviceHistoryRequest", MakeVersionGate({17,0,0})}, + FunctionInfo{180, nullptr, "GetRequestForNintendoAccountReauthentication", MakeVersionGate({18,0,0})}, + FunctionInfo{200, nullptr, "IsRegistered"}, + FunctionInfo{201, nullptr, "RegisterAsync"}, + FunctionInfo{202, nullptr, "UnregisterAsync"}, + FunctionInfo{203, nullptr, "DeleteRegistrationInfoLocally"}, + FunctionInfo{220, nullptr, "SynchronizeProfileAsync"}, + FunctionInfo{221, nullptr, "UploadProfileAsync"}, + FunctionInfo{222, nullptr, "SynchronizaProfileAsyncIfSecondsElapsed"}, + FunctionInfo{250, &IAdministrator::IsLinkedWithNintendoAccount, "IsLinkedWithNintendoAccount"}, + FunctionInfo{251, nullptr, "CreateProcedureToLinkWithNintendoAccount"}, + FunctionInfo{252, nullptr, "ResumeProcedureToLinkWithNintendoAccount"}, + FunctionInfo{255, nullptr, "CreateProcedureToUpdateLinkageStateOfNintendoAccount"}, + FunctionInfo{256, nullptr, "ResumeProcedureToUpdateLinkageStateOfNintendoAccount"}, + FunctionInfo{260, nullptr, "CreateProcedureToLinkNnidWithNintendoAccount", MakeVersionGate({3,0,0})}, + FunctionInfo{261, nullptr, "ResumeProcedureToLinkNnidWithNintendoAccount", MakeVersionGate({3,0,0})}, + FunctionInfo{280, nullptr, "ProxyProcedureToAcquireApplicationAuthorizationForNintendoAccount"}, + FunctionInfo{290, nullptr, "GetRequestForNintendoAccountUserResourceView", MakeVersionGate({8,0,0})}, + FunctionInfo{300, nullptr, "TryRecoverNintendoAccountUserStateAsync", MakeVersionGate({6,0,0})}, + FunctionInfo{400, nullptr, "IsServiceEntryRequirementCacheRefreshRequiredForOnlinePlay", MakeVersionGate({6,1,0})}, + FunctionInfo{401, nullptr, "RefreshServiceEntryRequirementCacheForOnlinePlayAsync", MakeVersionGate({6,1,0})}, + FunctionInfo{900, nullptr, "GetAuthenticationInfoForWin", MakeVersionGate({9,0,0})}, + FunctionInfo{901, nullptr, "ImportAsyncForWin", MakeVersionGate({9,0,0})}, + FunctionInfo{997, nullptr, "DebugUnlinkNintendoAccountAsync"}, + FunctionInfo{998, nullptr, "DebugSetAvailabilityErrorDetail"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } }; class IAuthorizationRequest final : public ServiceFramework { public: explicit IAuthorizationRequest(Core::System& system_, Common::UUID) : ServiceFramework{system_, "IAuthorizationRequest"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetSessionId"}, - {10, nullptr, "InvokeWithoutInteractionAsync"}, - {19, nullptr, "IsAuthorized"}, - {20, nullptr, "GetAuthorizationCode"}, - {21, nullptr, "GetIdToken"}, - {22, nullptr, "GetState"}, - }; - // clang-format on + } - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetSessionId"}, + FunctionInfo{10, nullptr, "InvokeWithoutInteractionAsync"}, + FunctionInfo{19, nullptr, "IsAuthorized"}, + FunctionInfo{20, nullptr, "GetAuthorizationCode"}, + FunctionInfo{21, nullptr, "GetIdToken"}, + FunctionInfo{22, nullptr, "GetState"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IOAuthProcedure final : public ServiceFramework { public: explicit IOAuthProcedure(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IOAuthProcedure"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "PrepareAsync"}, - {1, nullptr, "GetRequest"}, - {2, nullptr, "ApplyResponse"}, - {3, nullptr, "ApplyResponseAsync"}, - {10, nullptr, "Suspend"}, - }; - // clang-format on + : ServiceFramework{system_, "IOAuthProcedure"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "PrepareAsync"}, + FunctionInfo{1, nullptr, "GetRequest"}, + FunctionInfo{2, nullptr, "ApplyResponse"}, + FunctionInfo{3, nullptr, "ApplyResponseAsync"}, + FunctionInfo{10, nullptr, "Suspend"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; @@ -284,96 +282,69 @@ public: class IOAuthProcedureForExternalNsa final : public ServiceFramework { public: explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "PrepareAsync"}, - {1, nullptr, "GetRequest"}, - {2, nullptr, "ApplyResponse"}, - {3, nullptr, "ApplyResponseAsync"}, - {10, nullptr, "Suspend"}, - {100, nullptr, "GetAccountId"}, - {101, nullptr, "GetLinkedNintendoAccountId"}, - {102, nullptr, "GetNickname"}, - {103, nullptr, "GetProfileImage"}, - {104, nullptr, "GetProfileLargeImage"} // 18.0.0+ - }; - // clang-format on + : ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} + {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "PrepareAsync"}, + FunctionInfo{1, nullptr, "GetRequest"}, + FunctionInfo{2, nullptr, "ApplyResponse"}, + FunctionInfo{3, nullptr, "ApplyResponseAsync"}, + FunctionInfo{10, nullptr, "Suspend"}, + FunctionInfo{100, nullptr, "GetAccountId"}, + FunctionInfo{101, nullptr, "GetLinkedNintendoAccountId"}, + FunctionInfo{102, nullptr, "GetNickname"}, + FunctionInfo{103, nullptr, "GetProfileImage"}, + FunctionInfo{104, nullptr, "GetProfileLargeImage", MakeVersionGate({18,0,0})} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; -class IOAuthProcedureForNintendoAccountLinkage final - : public ServiceFramework { +class IOAuthProcedureForNintendoAccountLinkage final : public ServiceFramework { public: explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "PrepareAsync"}, - {1, nullptr, "GetRequest"}, - {2, nullptr, "ApplyResponse"}, - {3, nullptr, "ApplyResponseAsync"}, - {10, nullptr, "Suspend"}, - {100, nullptr, "GetRequestWithTheme"}, - {101, nullptr, "IsNetworkServiceAccountReplaced"}, - {199, nullptr, "GetUrlForIntroductionOfExtraMembership"}, // 2.0.0 - 5.1.0 - {200, nullptr, "ApplyAsyncWithAuthorizedToken"}, - {210, nullptr, "IsProfileAvailable"}, // 17.0.0+ - {220, nullptr, "RegisterUserAsyncWithoutProfile"}, // 17.0.0+ - {221, nullptr, "RegisterUserWithProfileAsync"}, // 17.0.0+ - {230, nullptr, "RegisterUserWithLargeImageProfileAsync"}, // 18.0.0+ - }; - // clang-format on + : ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} + {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "PrepareAsync"}, + FunctionInfo{1, nullptr, "GetRequest"}, + FunctionInfo{2, nullptr, "ApplyResponse"}, + FunctionInfo{3, nullptr, "ApplyResponseAsync"}, + FunctionInfo{10, nullptr, "Suspend"}, + FunctionInfo{100, nullptr, "GetRequestWithTheme"}, + FunctionInfo{101, nullptr, "IsNetworkServiceAccountReplaced"}, + FunctionInfo{199, nullptr, "GetUrlForIntroductionOfExtraMembership", MakeVersionGate({2,0,0}, {5,1,0})}, + FunctionInfo{200, nullptr, "ApplyAsyncWithAuthorizedToken"}, + FunctionInfo{210, nullptr, "IsProfileAvailable", MakeVersionGate({17,0,0})}, + FunctionInfo{220, nullptr, "RegisterUserAsyncWithoutProfile", MakeVersionGate({17,0,0})}, + FunctionInfo{221, nullptr, "RegisterUserWithProfileAsync", MakeVersionGate({17,0,0})}, + FunctionInfo{230, nullptr, "RegisterUserWithLargeImageProfileAsync", MakeVersionGate({18,0,0})} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class INotifier final : public ServiceFramework { public: explicit INotifier(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "INotifier"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetSystemEvent"}, - }; - // clang-format on + : ServiceFramework{system_, "INotifier"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetSystemEvent"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IProfileCommon : public ServiceFramework { public: - explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands, - Common::UUID user_id_, ProfileManager& profile_manager_) + explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands, Common::UUID user_id_, ProfileManager& profile_manager_) : ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IProfileCommon::Get, "Get"}, - {1, &IProfileCommon::GetBase, "GetBase"}, - {10, &IProfileCommon::GetImageSize, "GetImageSize"}, - {11, &IProfileCommon::LoadImage, "LoadImage"}, - {20, &IProfileCommon::Unknown20, "Unknown20"}, - {21, &IProfileCommon::Unknown21, "Unknown21"}, - {30, &IProfileCommon::Unknown30, "Unknown30"} - }; - // clang-format on - RegisterHandlers(functions); - - if (editor_commands) { - // clang-format off - static const FunctionInfo editor_functions[] = { - {100, &IProfileCommon::Store, "Store"}, - {101, &IProfileCommon::StoreWithImage, "StoreWithImage"}, - {110, &IProfileCommon::Unknown110, "Unknown110"} - }; - // clang-format on - - RegisterHandlers(editor_functions); - } } protected: @@ -600,6 +571,22 @@ protected: rb.Push(ResultSuccess); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IProfileCommon::Get, "Get"}, + FunctionInfo{1, &IProfileCommon::GetBase, "GetBase"}, + FunctionInfo{10, &IProfileCommon::GetImageSize, "GetImageSize"}, + FunctionInfo{11, &IProfileCommon::LoadImage, "LoadImage"}, + FunctionInfo{20, &IProfileCommon::Unknown20, "Unknown20"}, + FunctionInfo{21, &IProfileCommon::Unknown21, "Unknown21"}, + FunctionInfo{30, &IProfileCommon::Unknown30, "Unknown30"}, + // Editor commands + FunctionInfo{100, &IProfileCommon::Store, "Store"}, + FunctionInfo{101, &IProfileCommon::StoreWithImage, "StoreWithImage"}, + FunctionInfo{110, &IProfileCommon::Unknown110, "Unknown110"} + ); ProfileManager& profile_manager; Common::UUID user_id{}; ///< The user id this profile refers to. }; @@ -621,35 +608,33 @@ public: class ISessionObject final : public ServiceFramework { public: explicit ISessionObject(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "ISessionObject"} { - // clang-format off - static const FunctionInfo functions[] = { - {999, nullptr, "Dummy"}, - }; - // clang-format on + : ServiceFramework{system_, "ISessionObject"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{999, nullptr, "Dummy"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IGuestLoginRequest final : public ServiceFramework { public: explicit IGuestLoginRequest(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IGuestLoginRequest"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetSessionId"}, - {11, nullptr, "Unknown"}, // 1.0.0 - 2.3.0 (the name is blank on Switchbrew) - {12, nullptr, "GetAccountId"}, - {13, nullptr, "GetLinkedNintendoAccountId"}, - {14, nullptr, "GetNickname"}, - {15, nullptr, "GetProfileImage"}, - {16, nullptr, "GetProfileLargeImage"}, // 18.0.0+ - {21, nullptr, "LoadIdTokenCache"}, // 3.0.0+ - }; - // clang-format on + : ServiceFramework{system_, "IGuestLoginRequest"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetSessionId"}, + FunctionInfo{11, nullptr, "Unknown", MakeVersionGate({1,0,0}, {2,3,0})}, // the name is blank on Switchbrew + FunctionInfo{12, nullptr, "GetAccountId"}, + FunctionInfo{13, nullptr, "GetLinkedNintendoAccountId"}, + FunctionInfo{14, nullptr, "GetNickname"}, + FunctionInfo{15, nullptr, "GetProfileImage"}, + FunctionInfo{16, nullptr, "GetProfileLargeImage", MakeVersionGate({18,0,0})}, + FunctionInfo{21, nullptr, "LoadIdTokenCache", MakeVersionGate({3,0,0})} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; @@ -686,23 +671,10 @@ public: const std::shared_ptr& profile_manager_) : ServiceFramework{system_, "IManagerForApplication"}, ensure_token_id{std::make_shared(system)}, - profile_manager{profile_manager_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, - {1, &IManagerForApplication::GetAccountId, "GetAccountId"}, - {2, &IManagerForApplication::EnsureIdTokenCacheAsync, "EnsureIdTokenCacheAsync"}, - {3, &IManagerForApplication::LoadIdTokenCacheDeprecated, "LoadIdTokenCacheDeprecated"}, - {4, &IManagerForApplication::LoadIdTokenCache, "LoadIdTokenCache"}, - {130, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCacheForApplication"}, - {136, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCache"}, // 19.0.0+ - {150, nullptr, "CreateAuthorizationRequest"}, - {160, &IManagerForApplication::StoreOpenContext, "StoreOpenContext"}, - {170, nullptr, "LoadNetworkServiceLicenseKindAsync"}, - }; - // clang-format on + profile_manager{profile_manager_} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -772,6 +744,18 @@ private: rb.Push(ResultSuccess); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, + FunctionInfo{1, &IManagerForApplication::GetAccountId, "GetAccountId"}, + FunctionInfo{2, &IManagerForApplication::EnsureIdTokenCacheAsync, "EnsureIdTokenCacheAsync"}, + FunctionInfo{3, &IManagerForApplication::LoadIdTokenCacheDeprecated, "LoadIdTokenCacheDeprecated"}, + FunctionInfo{4, &IManagerForApplication::LoadIdTokenCache, "LoadIdTokenCache"}, + FunctionInfo{130, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCacheForApplication"}, + FunctionInfo{136, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCache", MakeVersionGate({19,0,0})}, + FunctionInfo{150, nullptr, "CreateAuthorizationRequest"}, + FunctionInfo{160, &IManagerForApplication::StoreOpenContext, "StoreOpenContext"}, + FunctionInfo{170, nullptr, "LoadNetworkServiceLicenseKindAsync"} + ); std::shared_ptr ensure_token_id{}; std::shared_ptr profile_manager; }; @@ -781,18 +765,17 @@ class IAsyncNetworkServiceLicenseKindContext final : public ServiceFramework { public: explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetSystemEvent"}, - {1, nullptr, "Cancel"}, - {2, nullptr, "HasDone"}, - {3, nullptr, "GetResult"}, - {4, nullptr, "GetNetworkServiceLicenseKind"}, - }; - // clang-format on + : ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetSystemEvent"}, + FunctionInfo{1, nullptr, "Cancel"}, + FunctionInfo{2, nullptr, "HasDone"}, + FunctionInfo{3, nullptr, "GetResult"}, + FunctionInfo{4, nullptr, "GetNetworkServiceLicenseKind"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; @@ -801,56 +784,54 @@ class IOAuthProcedureForUserRegistration final : public ServiceFramework { public: explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "PrepareAsync"}, - {1, nullptr, "GetRequest"}, - {2, nullptr, "ApplyResponse"}, - {3, nullptr, "ApplyResponseAsync"}, - {10, nullptr, "Suspend"}, - {100, nullptr, "GetAccountId"}, - {101, nullptr, "GetLinkedNintendoAccountId"}, - {102, nullptr, "GetNickname"}, - {103, nullptr, "GetProfileImage"}, - {104, nullptr, "GetProfileLargeImage"}, // 18.0.0+ - {110, nullptr, "RegisterUserAsync"}, - {111, nullptr, "GetUid"}, - {200, nullptr, "ApplyResponseForUserCreationAsync"}, // 17.0.0+ - {205, nullptr, "SuspendAfterApplyResponse"}, // 17.0.0+ - {210, nullptr, "IsProfileAvailable"}, // 17.0.0+ - {220, nullptr, "RegisterUserAsyncWithoutProfile"}, // 17.0.0+ - {221, nullptr, "RegisterUserWithProfileAsync"}, // 17.0.0+ - {230, nullptr, "RegisterUserWithLargeImageProfileAsync"} // 18.0.0+ - }; - // clang-format on + : ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "PrepareAsync"}, + FunctionInfo{1, nullptr, "GetRequest"}, + FunctionInfo{2, nullptr, "ApplyResponse"}, + FunctionInfo{3, nullptr, "ApplyResponseAsync"}, + FunctionInfo{10, nullptr, "Suspend"}, + FunctionInfo{100, nullptr, "GetAccountId"}, + FunctionInfo{101, nullptr, "GetLinkedNintendoAccountId"}, + FunctionInfo{102, nullptr, "GetNickname"}, + FunctionInfo{103, nullptr, "GetProfileImage"}, + FunctionInfo{104, nullptr, "GetProfileLargeImage", MakeVersionGate({18,0,0})}, + FunctionInfo{110, nullptr, "RegisterUserAsync"}, + FunctionInfo{111, nullptr, "GetUid"}, + FunctionInfo{200, nullptr, "ApplyResponseForUserCreationAsync", MakeVersionGate({17,0,0})}, + FunctionInfo{205, nullptr, "SuspendAfterApplyResponse", MakeVersionGate({17,0,0})}, + FunctionInfo{210, nullptr, "IsProfileAvailable", MakeVersionGate({17,0,0})}, + FunctionInfo{220, nullptr, "RegisterUserAsyncWithoutProfile", MakeVersionGate({17,0,0})}, + FunctionInfo{221, nullptr, "RegisterUserWithProfileAsync", MakeVersionGate({17,0,0})}, + FunctionInfo{230, nullptr, "RegisterUserWithLargeImageProfileAsync", MakeVersionGate({18,0,0})} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class DAUTH_O final : public ServiceFramework { public: - explicit DAUTH_O(Core::System& system_, Common::UUID) : ServiceFramework{system_, "dauth:o"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, - {1, nullptr, "LoadAuthenticationTokenCache"}, - {2, nullptr, "InvalidateAuthenticationTokenCache"}, - {3, nullptr, "IsDeviceAuthenticationTokenCacheAvailable"}, - {10, nullptr, "EnsureEdgeTokenCacheAsync"}, - {11, nullptr, "LoadEdgeTokenCache"}, - {12, nullptr, "InvalidateEdgeTokenCache"}, - {13, nullptr, "IsEdgeTokenCacheAvailable"}, - {20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, - {21, nullptr, "LoadApplicationAuthenticationTokenCache"}, - {22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, - {23, nullptr, "IsApplicationAuthenticationCacheAvailable"}, - {24, nullptr, "InvalidateApplicationAuthenticationCache"}, - }; - // clang-format on + explicit DAUTH_O(Core::System& system_, Common::UUID) : ServiceFramework{system_, "dauth:o"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, + FunctionInfo{1, nullptr, "LoadAuthenticationTokenCache"}, + FunctionInfo{2, nullptr, "InvalidateAuthenticationTokenCache"}, + FunctionInfo{3, nullptr, "IsDeviceAuthenticationTokenCacheAvailable"}, + FunctionInfo{10, nullptr, "EnsureEdgeTokenCacheAsync"}, + FunctionInfo{11, nullptr, "LoadEdgeTokenCache"}, + FunctionInfo{12, nullptr, "InvalidateEdgeTokenCache"}, + FunctionInfo{13, nullptr, "IsEdgeTokenCacheAvailable"}, + FunctionInfo{20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, + FunctionInfo{21, nullptr, "LoadApplicationAuthenticationTokenCache"}, + FunctionInfo{22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, + FunctionInfo{23, nullptr, "IsApplicationAuthenticationCacheAvailable"}, + FunctionInfo{24, nullptr, "InvalidateApplicationAuthenticationCache"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; @@ -858,781 +839,809 @@ public: class IAsyncResult final : public ServiceFramework { public: explicit IAsyncResult(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IAsyncResult"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetResult"}, - {1, nullptr, "Cancel"}, - {2, nullptr, "IsAvailable"}, - {3, nullptr, "GetSystemEvent"}, - }; - // clang-format on + : ServiceFramework{system_, "IAsyncResult"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetResult"}, + FunctionInfo{1, nullptr, "Cancel"}, + FunctionInfo{2, nullptr, "IsAvailable"}, + FunctionInfo{3, nullptr, "GetSystemEvent"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; -void Module::Interface::GetUserCount(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(static_cast(profile_manager->GetUserCount())); -} +class Module final { +public: + class Interface : public ServiceFramework { + public: + explicit Interface(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_, const char* name) + : ServiceFramework{system_, name} + , module{std::move(module_)} + , profile_manager{std::move(profile_manager_)} + {} + ~Interface() override = default; -void Module::Interface::GetUserExistence(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); - LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(profile_manager->UserExists(user_id)); -} - -void Module::Interface::ListAllUsers(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - ctx.WriteBuffer(profile_manager->GetAllUsers()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); -} - -void Module::Interface::ListOpenUsers(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - ctx.WriteBuffer(profile_manager->GetOpenUsers()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); -} - -void Module::Interface::GetLastOpenedUser(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - IPC::ResponseBuilder rb{ctx, 6}; - rb.Push(ResultSuccess); - rb.PushRaw(profile_manager->GetLastOpenedUser()); -} - -void Module::Interface::GetProfile(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); - LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); - - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, user_id, *profile_manager); -} - -void Module::Interface::IsUserRegistrationRequestPermitted(HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(profile_manager->CanSystemRegisterUser()); -} - -void Module::Interface::InitializeApplicationInfo(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(InitializeApplicationInfoBase()); -} - -void Module::Interface::InitializeApplicationInfoRestricted(HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(Partial implementation) called"); - - // TODO(ogniK): We require checking if the user actually owns the title and what not. As of - // currently, we assume the user owns the title. InitializeApplicationInfoBase SHOULD be called - // first then we do extra checks if the game is a digital copy. - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(InitializeApplicationInfoBase()); -} - -Result Module::Interface::InitializeApplicationInfoBase() { - if (application_info) { - LOG_ERROR(Service_ACC, "Application already initialized"); - return Account::ResultApplicationInfoAlreadyInitialized; - } - - // TODO(ogniK): This should be changed to reflect the target process for when we have multiple - // processes emulated. As we don't actually have pid support we should assume we're just using - // our own process - Glue::ApplicationLaunchProperty launch_property{}; - const auto result = system.GetARPManager().GetLaunchProperty( - &launch_property, system.GetApplicationProcessProgramID()); - - if (result != ResultSuccess) { - LOG_ERROR(Service_ACC, "Failed to get launch property"); - return Account::ResultInvalidApplication; - } - - switch (launch_property.base_game_storage_id) { - case FileSys::StorageId::GameCard: - application_info.application_type = ApplicationType::GameCard; - break; - case FileSys::StorageId::Host: - case FileSys::StorageId::NandSystem: - case FileSys::StorageId::NandUser: - case FileSys::StorageId::SdCard: - case FileSys::StorageId::None: // Yuzu specific, differs from hardware - application_info.application_type = ApplicationType::Digital; - break; - default: - LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}", - launch_property.base_game_storage_id); - return Account::ResultInvalidApplication; - } - - LOG_WARNING(Service_ACC, "ApplicationInfo init required"); - // TODO(ogniK): Actual initialization here - - return ResultSuccess; -} - -void Module::Interface::GetBaasAccountManagerForApplication(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, profile_manager); -} - -void Module::Interface::IsUserAccountSwitchLocked(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - FileSys::NACP nacp; - const auto res = system.GetAppLoader().ReadControlData(nacp); - - bool is_locked = false; - - if (res != Loader::ResultStatus::Success) { - const FileSys::PatchManager pm{system.GetApplicationProcessProgramID(), - system.GetFileSystemController(), - system.GetContentProvider()}; - const auto nacp_unique = pm.GetControlMetadata().first; - - if (nacp_unique != nullptr) { - is_locked = nacp_unique->GetUserAccountSwitchLock(); - } else { - LOG_ERROR(Service_ACC, "nacp_unique is null!"); + void GetUserCount(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(static_cast(profile_manager->GetUserCount())); } - } else { - is_locked = nacp.GetUserAccountSwitchLock(); - } - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(is_locked); -} + void GetUserExistence(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); + LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); -void Module::Interface::InitializeApplicationInfoV2(HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(profile_manager->UserExists(user_id)); + } - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); -} + void ListAllUsers(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + ctx.WriteBuffer(profile_manager->GetAllUsers()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } -void Module::Interface::BeginUserRegistration(HLERequestContext& ctx) { - const auto user_id = Common::UUID::MakeRandom(); - profile_manager->CreateNewUser(user_id, "Eden"); + void ListOpenUsers(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + ctx.WriteBuffer(profile_manager->GetOpenUsers()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } - LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); + void GetLastOpenedUser(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 6}; + rb.Push(ResultSuccess); + rb.PushRaw(profile_manager->GetLastOpenedUser()); + } - IPC::ResponseBuilder rb{ctx, 6}; - rb.Push(ResultSuccess); - rb.PushRaw(user_id); -} + void GetProfile(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); + LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); -void Module::Interface::CompleteUserRegistration(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, user_id, *profile_manager); + } - LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); + void IsUserRegistrationRequestPermitted(HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(profile_manager->CanSystemRegisterUser()); + } - profile_manager->WriteUserSaveFile(); + void InitializeApplicationInfo(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(InitializeApplicationInfoBase()); + } - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); -} + void InitializeApplicationInfoRestricted(HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(Partial implementation) called"); -void Module::Interface::DeleteUser(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); - LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); - if (!profile_manager->RemoveUser(user_id)) { - LOG_ERROR(Service_ACC, "Failed to delete user with uuid={}", user_id.RawString()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(1U); - return; - } - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); -} + // TODO(ogniK): We require checking if the user actually owns the title and what not. As of + // currently, we assume the user owns the title. InitializeApplicationInfoBase SHOULD be called + // first then we do extra checks if the game is a digital copy. -void Module::Interface::SetUserPosition(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(InitializeApplicationInfoBase()); + } - u64 position = rp.Pop(); - Common::UUID user_id = rp.PopRaw(); + void GetBaasAccountManagerForApplication(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, profile_manager); + } - LOG_DEBUG(Service_ACC, "called, position={} user_id={}", position, user_id.FormattedString()); + void IsUserAccountSwitchLocked(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + FileSys::NACP nacp; + const auto res = system.GetAppLoader().ReadControlData(nacp); - profile_manager->SetUserPosition(position, user_id); + bool is_locked = false; - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); -} + if (res != Loader::ResultStatus::Success) { + const FileSys::PatchManager pm{system.GetApplicationProcessProgramID(), + system.GetFileSystemController(), + system.GetContentProvider()}; + const auto nacp_unique = pm.GetControlMetadata().first; -void Module::Interface::GetProfileEditor(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); + if (nacp_unique != nullptr) { + is_locked = nacp_unique->GetUserAccountSwitchLock(); + } else { + LOG_ERROR(Service_ACC, "nacp_unique is null!"); + } + } else { + is_locked = nacp.GetUserAccountSwitchLock(); + } - LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString()); + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(is_locked); + } - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, user_id, *profile_manager); -} + void InitializeApplicationInfoV2(HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(STUBBED) called"); -void Module::Interface::GetBaasAccountAdministrator(HLERequestContext &ctx) { - IPC::RequestParser rp{ctx}; - const auto uuid = rp.PopRaw(); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } - LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString()); + void BeginUserRegistration(HLERequestContext& ctx) { + const auto user_id = Common::UUID::MakeRandom(); + profile_manager->CreateNewUser(user_id, "Eden"); - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, uuid); -} + LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); -void Module::Interface::ListQualifiedUsers(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 6}; + rb.Push(ResultSuccess); + rb.PushRaw(user_id); + } - // All users should be qualified. We don't actually have parental control or anything to do with - // nintendo online currently. We're just going to assume the user running the game has access to - // the game regardless of parental control settings. - ctx.WriteBuffer(profile_manager->GetAllUsers()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); -} + void CompleteUserRegistration(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); -void Module::Interface::ListOpenContextStoredUsers(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); + LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); - ctx.WriteBuffer(profile_manager->GetStoredOpenedUsers()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); -} + profile_manager->WriteUserSaveFile(); -void Module::Interface::StoreSaveDataThumbnailApplication(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const auto uuid = rp.PopRaw(); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } - LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString()); + void DeleteUser(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); + LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); + if (!profile_manager->RemoveUser(user_id)) { + LOG_ERROR(Service_ACC, "Failed to delete user with uuid={}", user_id.RawString()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(1U); + return; + } + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } - // TODO(ogniK): Check if application ID is zero on acc initialize. As we don't have a reliable - // way of confirming things like the TID, we're going to assume a non zero value for the time - // being. - constexpr u64 tid{1}; - StoreSaveDataThumbnail(ctx, uuid, tid); -} + void SetUserPosition(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; -void Module::Interface::GetBaasAccountManagerForSystemService(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const auto uuid = rp.PopRaw(); + u64 position = rp.Pop(); + Common::UUID user_id = rp.PopRaw(); - LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString()); + LOG_DEBUG(Service_ACC, "called, position={} user_id={}", position, user_id.FormattedString()); - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, uuid); -} + profile_manager->SetUserPosition(position, user_id); -void Module::Interface::StoreSaveDataThumbnailSystem(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const auto uuid = rp.PopRaw(); - const auto tid = rp.Pop(); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } - LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid); - StoreSaveDataThumbnail(ctx, uuid, tid); -} + void GetProfileEditor(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); -void Module::Interface::GetPinCodeLength(HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); + LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString()); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(0); -} + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, user_id, *profile_manager); + } -void Module::Interface::StoreSaveDataThumbnail(HLERequestContext& ctx, const Common::UUID& uuid, - const u64 tid) { - IPC::ResponseBuilder rb{ctx, 2}; + void GetBaasAccountAdministrator(HLERequestContext &ctx) { + IPC::RequestParser rp{ctx}; + const auto uuid = rp.PopRaw(); - if (tid == 0) { - LOG_ERROR(Service_ACC, "TitleID is not valid!"); - rb.Push(Account::ResultInvalidApplication); - return; - } + LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString()); - if (uuid.IsInvalid()) { - LOG_ERROR(Service_ACC, "User ID is not valid!"); - rb.Push(Account::ResultInvalidUserId); - return; - } - const auto thumbnail_size = ctx.GetReadBufferSize(); - if (thumbnail_size != THUMBNAIL_SIZE) { - LOG_ERROR(Service_ACC, "Buffer size is empty! size={:X} expecting {:X}", thumbnail_size, - THUMBNAIL_SIZE); - rb.Push(Account::ResultInvalidArrayLength); - return; - } + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, uuid); + } - // TODO(ogniK): Construct save data thumbnail - rb.Push(ResultSuccess); -} + void ListQualifiedUsers(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); -void Module::Interface::TrySelectUserWithoutInteractionDeprecated(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - // A u8 is passed into this function which we can safely ignore. It's to determine if we have - // access to use the network or not by the looks of it - IPC::ResponseBuilder rb{ctx, 6}; - if (profile_manager->GetUserCount() != 1) { - rb.Push(ResultSuccess); - rb.PushRaw(Common::InvalidUUID); - return; - } + // All users should be qualified. We don't actually have parental control or anything to do with + // nintendo online currently. We're just going to assume the user running the game has access to + // the game regardless of parental control settings. + ctx.WriteBuffer(profile_manager->GetAllUsers()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } - const auto user_list = profile_manager->GetAllUsers(); - if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { - rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code - rb.PushRaw(Common::InvalidUUID); - return; - } + void ListOpenContextStoredUsers(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); - // Select the first user we have - rb.Push(ResultSuccess); - rb.PushRaw(profile_manager->GetUser(0)->uuid); -} + ctx.WriteBuffer(profile_manager->GetStoredOpenedUsers()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } -void Module::Interface::TrySelectUserWithoutInteraction(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - // A u8 is passed into this function which we can safely ignore. It's to determine if we have - // access to use the network or not by the looks of it - IPC::ResponseBuilder rb{ctx, 6}; - if (profile_manager->GetUserCount() != 1) { - rb.Push(ResultSuccess); - rb.PushRaw(Common::InvalidUUID); - return; - } + void StoreSaveDataThumbnailApplication(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto uuid = rp.PopRaw(); - const auto user_list = profile_manager->GetAllUsers(); - if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { - rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code - rb.PushRaw(Common::InvalidUUID); - return; - } + LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString()); - // Select the first user we have - rb.Push(ResultSuccess); - rb.PushRaw(profile_manager->GetUser(0)->uuid); -} + // TODO(ogniK): Check if application ID is zero on acc initialize. As we don't have a reliable + // way of confirming things like the TID, we're going to assume a non zero value for the time + // being. + constexpr u64 tid{1}; + StoreSaveDataThumbnail(ctx, uuid, tid); + } -Module::Interface::Interface(std::shared_ptr module_, - std::shared_ptr profile_manager_, - Core::System& system_, const char* name) - : ServiceFramework{system_, name}, module{std::move(module_)}, - profile_manager{std::move(profile_manager_)} {} + void GetBaasAccountManagerForSystemService(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto uuid = rp.PopRaw(); -Module::Interface::~Interface() = default; + LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString()); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, uuid); + } + + void StoreSaveDataThumbnailSystem(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto uuid = rp.PopRaw(); + const auto tid = rp.Pop(); + + LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid); + StoreSaveDataThumbnail(ctx, uuid, tid); + } + + void GetPinCodeLength(HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(0); + } + + void TrySelectUserWithoutInteractionDeprecated(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + // A u8 is passed into this function which we can safely ignore. It's to determine if we have + // access to use the network or not by the looks of it + IPC::ResponseBuilder rb{ctx, 6}; + if (profile_manager->GetUserCount() != 1) { + rb.Push(ResultSuccess); + rb.PushRaw(Common::InvalidUUID); + return; + } + + const auto user_list = profile_manager->GetAllUsers(); + if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { + rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code + rb.PushRaw(Common::InvalidUUID); + return; + } + + // Select the first user we have + rb.Push(ResultSuccess); + rb.PushRaw(profile_manager->GetUser(0)->uuid); + } + + void TrySelectUserWithoutInteraction(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + // A u8 is passed into this function which we can safely ignore. It's to determine if we have + // access to use the network or not by the looks of it + IPC::ResponseBuilder rb{ctx, 6}; + if (profile_manager->GetUserCount() != 1) { + rb.Push(ResultSuccess); + rb.PushRaw(Common::InvalidUUID); + return; + } + + const auto user_list = profile_manager->GetAllUsers(); + if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { + rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code + rb.PushRaw(Common::InvalidUUID); + return; + } + + // Select the first user we have + rb.Push(ResultSuccess); + rb.PushRaw(profile_manager->GetUser(0)->uuid); + } + + private: + Result InitializeApplicationInfoBase() { + if (application_info) { + LOG_ERROR(Service_ACC, "Application already initialized"); + return Account::ResultApplicationInfoAlreadyInitialized; + } + + // TODO(ogniK): This should be changed to reflect the target process for when we have multiple + // processes emulated. As we don't actually have pid support we should assume we're just using + // our own process + Glue::ApplicationLaunchProperty launch_property{}; + const auto result = system.GetARPManager().GetLaunchProperty( + &launch_property, system.GetApplicationProcessProgramID()); + + if (result != ResultSuccess) { + LOG_ERROR(Service_ACC, "Failed to get launch property"); + return Account::ResultInvalidApplication; + } + + switch (launch_property.base_game_storage_id) { + case FileSys::StorageId::GameCard: + application_info.application_type = ApplicationType::GameCard; + break; + case FileSys::StorageId::Host: + case FileSys::StorageId::NandSystem: + case FileSys::StorageId::NandUser: + case FileSys::StorageId::SdCard: + case FileSys::StorageId::None: // Yuzu specific, differs from hardware + application_info.application_type = ApplicationType::Digital; + break; + default: + LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}", + launch_property.base_game_storage_id); + return Account::ResultInvalidApplication; + } + + LOG_WARNING(Service_ACC, "ApplicationInfo init required"); + // TODO(ogniK): Actual initialization here + + return ResultSuccess; + } + + void StoreSaveDataThumbnail(HLERequestContext& ctx, const Common::UUID& uuid, + const u64 tid) { + IPC::ResponseBuilder rb{ctx, 2}; + + if (tid == 0) { + LOG_ERROR(Service_ACC, "TitleID is not valid!"); + rb.Push(Account::ResultInvalidApplication); + return; + } + + if (uuid.IsInvalid()) { + LOG_ERROR(Service_ACC, "User ID is not valid!"); + rb.Push(Account::ResultInvalidUserId); + return; + } + const auto thumbnail_size = ctx.GetReadBufferSize(); + if (thumbnail_size != THUMBNAIL_SIZE) { + LOG_ERROR(Service_ACC, "Buffer size is empty! size={:X} expecting {:X}", thumbnail_size, + THUMBNAIL_SIZE); + rb.Push(Account::ResultInvalidArrayLength); + return; + } + + // TODO(ogniK): Construct save data thumbnail + rb.Push(ResultSuccess); + } + + enum class ApplicationType : u32_le { + GameCard = 0, + Digital = 1, + Unknown = 3, + }; + + struct ApplicationInfo { + Service::Glue::ApplicationLaunchProperty launch_property; + ApplicationType application_type; + + constexpr explicit operator bool() const { + return launch_property.title_id != 0x0; + } + }; + + ApplicationInfo application_info{}; + protected: + std::shared_ptr module; + std::shared_ptr profile_manager; + }; +}; class ACC_AA final : public Module::Interface { public: explicit ACC_AA(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:aa") { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "EnsureCacheAsync"}, - {1, nullptr, "LoadCache"}, - {2, nullptr, "GetDeviceAccountId"}, - {50, nullptr, "RegisterNotificationTokenAsync"}, // 1.0.0 - 6.2.0 - {51, nullptr, "UnregisterNotificationTokenAsync"}, // 1.0.0 - 6.2.0 - }; - // clang-format on - RegisterHandlers(functions); + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:aa") {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~ACC_AA() override = default; + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "EnsureCacheAsync"}, + FunctionInfo{1, nullptr, "LoadCache"}, + FunctionInfo{2, nullptr, "GetDeviceAccountId"}, + FunctionInfo{50, nullptr, "RegisterNotificationTokenAsync", MakeVersionGate({1,0,0}, {6,2,0})}, + FunctionInfo{51, nullptr, "UnregisterNotificationTokenAsync", MakeVersionGate({1,0,0}, {6,2,0})} + ); }; class ACC_SU final : public Module::Interface { public: explicit ACC_SU(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:su") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &ACC_SU::GetUserCount, "GetUserCount"}, - {1, &ACC_SU::GetUserExistence, "GetUserExistence"}, - {2, &ACC_SU::ListAllUsers, "ListAllUsers"}, - {3, &ACC_SU::ListOpenUsers, "ListOpenUsers"}, - {4, &ACC_SU::GetLastOpenedUser, "GetLastOpenedUser"}, - {5, &ACC_SU::GetProfile, "GetProfile"}, - {6, nullptr, "GetProfileDigest"}, - {50, &ACC_SU::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, - {51, &ACC_SU::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, - {52, &ACC_SU::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, // 19.0.0+ - {60, &ACC_SU::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, - {99, nullptr, "DebugActivateOpenContextRetention"}, - {100, nullptr, "GetUserRegistrationNotifier"}, - {101, nullptr, "GetUserStateChangeNotifier"}, - {102, &ACC_SU::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, - {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - {104, nullptr, "GetProfileUpdateNotifier"}, - {105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - {106, nullptr, "GetProfileSyncNotifier"}, - {110, &ACC_SU::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"}, - {111, nullptr, "ClearSaveDataThumbnail"}, - {112, nullptr, "LoadSaveDataThumbnail"}, - {113, nullptr, "GetSaveDataThumbnailExistence"}, - {120, nullptr, "ListOpenUsersInApplication"}, - {130, nullptr, "ActivateOpenContextRetention"}, - {140, &ACC_SU::ListQualifiedUsers, "ListQualifiedUsers"}, - {150, nullptr, "AuthenticateApplicationAsync"}, - {151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - {152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - {190, nullptr, "GetUserLastOpenedApplication"}, - {191, nullptr, "ActivateOpenContextHolder"}, - {200, &ACC_SU::BeginUserRegistration, "BeginUserRegistration"}, - {201, &ACC_SU::CompleteUserRegistration, "CompleteUserRegistration"}, - {202, nullptr, "CancelUserRegistration"}, - {203, &ACC_SU::DeleteUser, "DeleteUser"}, - {204, &ACC_SU::SetUserPosition, "SetUserPosition"}, - {205, &ACC_SU::GetProfileEditor, "GetProfileEditor"}, - {206, nullptr, "CompleteUserRegistrationForcibly"}, - {210, nullptr, "CreateFloatingRegistrationRequest"}, - {211, nullptr, "CreateProcedureToRegisterUserWithNintendoAccount"}, - {212, nullptr, "ResumeProcedureToRegisterUserWithNintendoAccount"}, - {230, nullptr, "AuthenticateServiceAsync"}, - {250, &ACC_SU::GetBaasAccountAdministrator, "GetBaasAccountAdministrator"}, - {290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, - {291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, - {299, nullptr, "SuspendBackgroundDaemon"}, - {400, nullptr, "SetPinCode"}, // 18.0.0+ - {401, &ACC_SU::GetPinCodeLength, "GetPinCodeLength"}, // 18.0.0+ - {402, nullptr, "GetPinCode"}, // 18.0.0+ - {403, nullptr, "GetPinCodeParity"}, - {404, nullptr, "VerifyPinCode"}, - {405, nullptr, "IsPinCodeVerificationForbidden"}, - {410, nullptr, "GetPinCodeErrorCount"}, // 18.0.0+ - {411, nullptr, "ResetPinCodeErrorCount"}, // 18.0.0+ - {412, nullptr, "IncrementPinCodeErrorCount"}, // 18.0.0+ - {900, nullptr, "SetUserUnqualifiedForDebug"}, - {901, nullptr, "UnsetUserUnqualifiedForDebug"}, - {902, nullptr, "ListUsersUnqualifiedForDebug"}, - {910, nullptr, "RefreshFirmwareSettingsForDebug"}, - {997, nullptr, "DebugInvalidateTokenCacheForUser"}, - {998, nullptr, "DebugSetUserStateClose"}, - {999, nullptr, "DebugSetUserStateOpen"}, - }; - // clang-format on + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:su") {} - RegisterHandlers(functions); - } ~ACC_SU() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ACC_SU::GetUserCount, "GetUserCount"}, + FunctionInfo{1, &ACC_SU::GetUserExistence, "GetUserExistence"}, + FunctionInfo{2, &ACC_SU::ListAllUsers, "ListAllUsers"}, + FunctionInfo{3, &ACC_SU::ListOpenUsers, "ListOpenUsers"}, + FunctionInfo{4, &ACC_SU::GetLastOpenedUser, "GetLastOpenedUser"}, + FunctionInfo{5, &ACC_SU::GetProfile, "GetProfile"}, + FunctionInfo{6, nullptr, "GetProfileDigest"}, + FunctionInfo{50, &ACC_SU::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, + FunctionInfo{51, &ACC_SU::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, + FunctionInfo{52, &ACC_SU::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction", MakeVersionGate({19,0,0})}, + FunctionInfo{60, &ACC_SU::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, + FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, + FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, + FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, + FunctionInfo{102, &ACC_SU::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, + FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, + FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, + FunctionInfo{110, &ACC_SU::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"}, + FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, + FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, + FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, + FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, + FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, + FunctionInfo{140, &ACC_SU::ListQualifiedUsers, "ListQualifiedUsers"}, + FunctionInfo{150, nullptr, "AuthenticateApplicationAsync"}, + FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + FunctionInfo{190, nullptr, "GetUserLastOpenedApplication"}, + FunctionInfo{191, nullptr, "ActivateOpenContextHolder"}, + FunctionInfo{200, &ACC_SU::BeginUserRegistration, "BeginUserRegistration"}, + FunctionInfo{201, &ACC_SU::CompleteUserRegistration, "CompleteUserRegistration"}, + FunctionInfo{202, nullptr, "CancelUserRegistration"}, + FunctionInfo{203, &ACC_SU::DeleteUser, "DeleteUser"}, + FunctionInfo{204, &ACC_SU::SetUserPosition, "SetUserPosition"}, + FunctionInfo{205, &ACC_SU::GetProfileEditor, "GetProfileEditor"}, + FunctionInfo{206, nullptr, "CompleteUserRegistrationForcibly"}, + FunctionInfo{210, nullptr, "CreateFloatingRegistrationRequest"}, + FunctionInfo{211, nullptr, "CreateProcedureToRegisterUserWithNintendoAccount"}, + FunctionInfo{212, nullptr, "ResumeProcedureToRegisterUserWithNintendoAccount"}, + FunctionInfo{230, nullptr, "AuthenticateServiceAsync"}, + FunctionInfo{250, &ACC_SU::GetBaasAccountAdministrator, "GetBaasAccountAdministrator"}, + FunctionInfo{290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, + FunctionInfo{291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, + FunctionInfo{299, nullptr, "SuspendBackgroundDaemon"}, + FunctionInfo{400, nullptr, "SetPinCode", MakeVersionGate({18,0,0})}, + FunctionInfo{401, &ACC_SU::GetPinCodeLength, "GetPinCodeLength", MakeVersionGate({18,0,0})}, + FunctionInfo{402, nullptr, "GetPinCode", MakeVersionGate({18,0,0})}, + FunctionInfo{403, nullptr, "GetPinCodeParity"}, + FunctionInfo{404, nullptr, "VerifyPinCode"}, + FunctionInfo{405, nullptr, "IsPinCodeVerificationForbidden"}, + FunctionInfo{410, nullptr, "GetPinCodeErrorCount", MakeVersionGate({18,0,0})}, + FunctionInfo{411, nullptr, "ResetPinCodeErrorCount", MakeVersionGate({18,0,0})}, + FunctionInfo{412, nullptr, "IncrementPinCodeErrorCount", MakeVersionGate({18,0,0})}, + FunctionInfo{900, nullptr, "SetUserUnqualifiedForDebug"}, + FunctionInfo{901, nullptr, "UnsetUserUnqualifiedForDebug"}, + FunctionInfo{902, nullptr, "ListUsersUnqualifiedForDebug"}, + FunctionInfo{910, nullptr, "RefreshFirmwareSettingsForDebug"}, + FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, + FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, + FunctionInfo{999, nullptr, "DebugSetUserStateOpen"} + ); }; class ACC_U0 final : public Module::Interface { public: ACC_U0(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:u0") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &ACC_U0::GetUserCount, "GetUserCount"}, - {1, &ACC_U0::GetUserExistence, "GetUserExistence"}, - {2, &ACC_U0::ListAllUsers, "ListAllUsers"}, - {3, &ACC_U0::ListOpenUsers, "ListOpenUsers"}, - {4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"}, - {5, &ACC_U0::GetProfile, "GetProfile"}, - {6, nullptr, "GetProfileDigest"}, // 3.0.0+ - {50, &ACC_U0::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, - {51, &ACC_U0::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, - {52, &ACC_U0::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, - {60, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 5.0.0 - 5.1.0 - {99, nullptr, "DebugActivateOpenContextRetention"}, // 6.0.0+ - {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, - {101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"}, - {102, nullptr, "AuthenticateApplicationAsync"}, - {103, nullptr, "CheckNetworkServiceAvailabilityAsync"}, // 4.0.0+ - {110, &ACC_U0::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, - {111, nullptr, "ClearSaveDataThumbnail"}, - {120, nullptr, "CreateGuestLoginRequest"}, - {130, nullptr, "LoadOpenContext"}, // 5.0.0+ - {131, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 6.0.0+ - {140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted"}, // 6.0.0+ - {141, &ACC_U0::ListQualifiedUsers, "ListQualifiedUsers"}, // 6.0.0+ - {150, &ACC_U0::IsUserAccountSwitchLocked, "IsUserAccountSwitchLocked"}, // 6.0.0+ - {160, &ACC_U0::InitializeApplicationInfoV2, "InitializeApplicationInfoV2"}, - }; - // clang-format on + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:u0") {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~ACC_U0() override = default; + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ACC_U0::GetUserCount, "GetUserCount"}, + FunctionInfo{1, &ACC_U0::GetUserExistence, "GetUserExistence"}, + FunctionInfo{2, &ACC_U0::ListAllUsers, "ListAllUsers"}, + FunctionInfo{3, &ACC_U0::ListOpenUsers, "ListOpenUsers"}, + FunctionInfo{4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"}, + FunctionInfo{5, &ACC_U0::GetProfile, "GetProfile"}, + FunctionInfo{6, nullptr, "GetProfileDigest", MakeVersionGate({3,0,0})}, + FunctionInfo{50, &ACC_U0::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, + FunctionInfo{51, &ACC_U0::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, + FunctionInfo{52, &ACC_U0::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, + FunctionInfo{60, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers", MakeVersionGate({5,0,0}, {5,1,0})}, + FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention", MakeVersionGate({6,0,0})}, + FunctionInfo{100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, + FunctionInfo{101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"}, + FunctionInfo{102, nullptr, "AuthenticateApplicationAsync"}, + FunctionInfo{103, nullptr, "CheckNetworkServiceAvailabilityAsync", MakeVersionGate({4,0,0})}, + FunctionInfo{110, &ACC_U0::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, + FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, + FunctionInfo{120, nullptr, "CreateGuestLoginRequest"}, + FunctionInfo{130, nullptr, "LoadOpenContext", MakeVersionGate({5,0,0})}, + FunctionInfo{131, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers", MakeVersionGate({6,0,0})}, + FunctionInfo{140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted", MakeVersionGate({6,0,0})}, + FunctionInfo{141, &ACC_U0::ListQualifiedUsers, "ListQualifiedUsers", MakeVersionGate({6,0,0})}, + FunctionInfo{150, &ACC_U0::IsUserAccountSwitchLocked, "IsUserAccountSwitchLocked", MakeVersionGate({6,0,0})}, + FunctionInfo{160, &ACC_U0::InitializeApplicationInfoV2, "InitializeApplicationInfoV2"} + ); }; class ACC_U1 final : public Module::Interface { public: ACC_U1(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:u1") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &ACC_U1::GetUserCount, "GetUserCount"}, - {1, &ACC_U1::GetUserExistence, "GetUserExistence"}, - {2, &ACC_U1::ListAllUsers, "ListAllUsers"}, - {3, &ACC_U1::ListOpenUsers, "ListOpenUsers"}, - {4, &ACC_U1::GetLastOpenedUser, "GetLastOpenedUser"}, - {5, &ACC_U1::GetProfile, "GetProfile"}, - {6, nullptr, "GetProfileDigest"}, - {50, &ACC_U1::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, - {51, &ACC_U1::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, - {52, &ACC_U1::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, - {60, &ACC_U1::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, - {99, nullptr, "DebugActivateOpenContextRetention"}, - {100, nullptr, "GetUserRegistrationNotifier"}, - {101, nullptr, "GetUserStateChangeNotifier"}, - {102, &ACC_U1::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, - {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - {104, nullptr, "GetProfileUpdateNotifier"}, - {105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - {106, nullptr, "GetProfileSyncNotifier"}, - {110, &ACC_U1::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, - {111, nullptr, "ClearSaveDataThumbnail"}, - {112, nullptr, "LoadSaveDataThumbnail"}, - {113, nullptr, "GetSaveDataThumbnailExistence"}, - {120, nullptr, "ListOpenUsersInApplication"}, - {130, nullptr, "ActivateOpenContextRetention"}, - {140, &ACC_U1::ListQualifiedUsers, "ListQualifiedUsers"}, - {150, nullptr, "AuthenticateApplicationAsync"}, - {151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - {152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - {190, nullptr, "GetUserLastOpenedApplication"}, - {191, nullptr, "ActivateOpenContextHolder"}, - {401, &ACC_U1::GetPinCodeLength, "GetPinCodeLength"}, // 18.0.0+ - {402, nullptr, "GetPinCode"}, // 18.0.0+ - {997, nullptr, "DebugInvalidateTokenCacheForUser"}, - {998, nullptr, "DebugSetUserStateClose"}, - {999, nullptr, "DebugSetUserStateOpen"}, - }; - // clang-format on + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:u1") {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~ACC_U1() override = default; + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ACC_U1::GetUserCount, "GetUserCount"}, + FunctionInfo{1, &ACC_U1::GetUserExistence, "GetUserExistence"}, + FunctionInfo{2, &ACC_U1::ListAllUsers, "ListAllUsers"}, + FunctionInfo{3, &ACC_U1::ListOpenUsers, "ListOpenUsers"}, + FunctionInfo{4, &ACC_U1::GetLastOpenedUser, "GetLastOpenedUser"}, + FunctionInfo{5, &ACC_U1::GetProfile, "GetProfile"}, + FunctionInfo{6, nullptr, "GetProfileDigest"}, + FunctionInfo{50, &ACC_U1::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, + FunctionInfo{51, &ACC_U1::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, + FunctionInfo{52, &ACC_U1::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, + FunctionInfo{60, &ACC_U1::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, + FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, + FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, + FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, + FunctionInfo{102, &ACC_U1::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, + FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, + FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, + FunctionInfo{110, &ACC_U1::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, + FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, + FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, + FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, + FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, + FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, + FunctionInfo{140, &ACC_U1::ListQualifiedUsers, "ListQualifiedUsers"}, + FunctionInfo{150, nullptr, "AuthenticateApplicationAsync"}, + FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + FunctionInfo{190, nullptr, "GetUserLastOpenedApplication"}, + FunctionInfo{191, nullptr, "ActivateOpenContextHolder"}, + FunctionInfo{401, &ACC_U1::GetPinCodeLength, "GetPinCodeLength", MakeVersionGate({18,0,0})}, + FunctionInfo{402, nullptr, "GetPinCode", MakeVersionGate({18,0,0})}, + FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, + FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, + FunctionInfo{999, nullptr, "DebugSetUserStateOpen"} + ); }; class DAUTH_0 final : public ServiceFramework { public: - explicit DAUTH_0(Core::System& system_) : ServiceFramework{system_, "dauth:0"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, - {1, nullptr, "LoadAuthenticationTokenCache"}, - {2, nullptr, "InvalidateAuthenticationTokenCache"}, - {3, nullptr, "IsDeviceAuthenticationTokenCacheAvailable"}, - {10, nullptr, "EnsureEdgeTokenCacheAsync"}, - {11, nullptr, "LoadEdgeTokenCache"}, - {12, nullptr, "InvalidateEdgeTokenCache"}, - {13, nullptr, "IsEdgeTokenCacheAvailable"}, - {20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, - {21, nullptr, "LoadApplicationAuthenticationTokenCache"}, - {22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, - {23, nullptr, "IsApplicationAuthenticationCacheAvailable"}, - {24, nullptr, "InvalidateApplicationAuthenticationCache"}, - {30, nullptr, "EnsureGameCardAuthenticationCacheAsync"}, - {31, nullptr, "LoadGameCardAuthenticationTokenCache"}, - {32, nullptr, "IsGameCardAuthenticationCacheAvailable"}, - {33, nullptr, "InvalidateGameCardAuthenticationCache"}, - {1000, nullptr, "GetInactiveElicenseUsedEvent"}, - {9000, nullptr, "ImportVirtualClientCertificate"}, - {9010, nullptr, "DeleteVirtualClientCertificate"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit DAUTH_0(Core::System& system_) : ServiceFramework{system_, "dauth:0"} {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, + FunctionInfo{1, nullptr, "LoadAuthenticationTokenCache"}, + FunctionInfo{2, nullptr, "InvalidateAuthenticationTokenCache"}, + FunctionInfo{3, nullptr, "IsDeviceAuthenticationTokenCacheAvailable"}, + FunctionInfo{10, nullptr, "EnsureEdgeTokenCacheAsync"}, + FunctionInfo{11, nullptr, "LoadEdgeTokenCache"}, + FunctionInfo{12, nullptr, "InvalidateEdgeTokenCache"}, + FunctionInfo{13, nullptr, "IsEdgeTokenCacheAvailable"}, + FunctionInfo{20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, + FunctionInfo{21, nullptr, "LoadApplicationAuthenticationTokenCache"}, + FunctionInfo{22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, + FunctionInfo{23, nullptr, "IsApplicationAuthenticationCacheAvailable"}, + FunctionInfo{24, nullptr, "InvalidateApplicationAuthenticationCache"}, + FunctionInfo{30, nullptr, "EnsureGameCardAuthenticationCacheAsync"}, + FunctionInfo{31, nullptr, "LoadGameCardAuthenticationTokenCache"}, + FunctionInfo{32, nullptr, "IsGameCardAuthenticationCacheAvailable"}, + FunctionInfo{33, nullptr, "InvalidateGameCardAuthenticationCache"}, + FunctionInfo{1000, nullptr, "GetInactiveElicenseUsedEvent"}, + FunctionInfo{9000, nullptr, "ImportVirtualClientCertificate"}, + FunctionInfo{9010, nullptr, "DeleteVirtualClientCertificate"} + ); }; class ACC_E final : public Module::Interface { public: explicit ACC_E(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e") { - // clang-format off - static const FunctionInfo functions[] = { - { 0, nullptr, "GetUserCount"}, - { 1, nullptr, "GetUserExistence"}, - { 2, nullptr, "ListAllUsers"}, - { 3, nullptr, "ListOpenUsers"}, - { 4, nullptr, "GetLastOpenedUser"}, - { 5, nullptr, "GetProfile"}, - { 6, nullptr, "GetProfileDigest"}, - { 50, nullptr, "IsUserRegistrationRequestPermitted"}, - { 51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, - { 52, nullptr, "TrySelectUserWithoutInteraction"}, - { 99, nullptr, "DebugActivateOpenContextRetention"}, - { 100, nullptr, "GetUserRegistrationNotifier"}, - { 101, nullptr, "GetUserStateChangeNotifier"}, - { 102, nullptr, "GetBaasAccountManagerForSystemService"}, - { 103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - { 104, nullptr, "GetProfileUpdateNotifier"}, - { 105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - { 106, nullptr, "GetProfileSyncNotifier"}, - { 110, nullptr, "StoreSaveDataThumbnail"}, - { 111, nullptr, "ClearSaveDataThumbnail"}, - { 112, nullptr, "LoadSaveDataThumbnail"}, - { 113, nullptr, "GetSaveDataThumbnailExistence"}, - { 120, nullptr, "ListOpenUsersInApplication"}, - { 130, nullptr, "ActivateOpenContextRetention"}, - { 140, nullptr, "ListQualifiedUsers"}, - { 151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - { 152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - { 170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, - { 191, nullptr, "UpdateNotificationReceiverInfo"}, - { 200, nullptr, "BeginUserRegistration"}, - { 201, nullptr, "CompleteUserRegistration"}, - { 202, nullptr, "CancelUserRegistration"}, - { 203, nullptr, "DeleteUser"}, - { 204, nullptr, "SetUserPosition"}, - { 205, nullptr, "GetProfileEditor"}, - { 206, nullptr, "CompleteUserRegistrationForcibly"}, - { 210, nullptr, "CreateFloatingRegistrationRequest"}, - { 211, nullptr, "CreateProcedureToRegisterUserWithNintendoAccount"}, - { 212, nullptr, "ResumeProcedureToRegisterUserWithNintendoAccount"}, - { 213, nullptr, "CreateProcedureToCreateUserWithNintendoAccount"}, - { 214, nullptr, "ResumeProcedureToCreateUserWithNintendoAccount"}, - { 215, nullptr, "ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse"}, - { 230, nullptr, "AuthenticateServiceAsync"}, - { 250, nullptr, "GetBaasAccountAdministrator"}, - { 251, nullptr, "SynchronizeNetworkServiceAccountsSnapshotAsync"}, - { 290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, - { 291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, - { 292, nullptr, "ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser"}, - { 293, nullptr, "ProxyProcedureForDeviceMigrationDownload"}, - { 299, nullptr, "SuspendBackgroundDaemon"}, - { 350, nullptr, "CreateDeviceMigrationUserExportRequest"}, - { 351, nullptr, "UploadNasCredential"}, - { 352, nullptr, "CreateDeviceMigrationUserImportRequest"}, - { 353, nullptr, "DeleteUserMigrationSaveData"}, - { 400, nullptr, "SetPinCode"}, - { 401, nullptr, "GetPinCodeLength"}, - { 402, nullptr, "GetPinCode"}, - { 403, nullptr, "GetPinCodeParity"}, - { 404, nullptr, "VerifyPinCode"}, - { 405, nullptr, "IsPinCodeVerificationForbidden"}, - { 410, nullptr, "GetPinCodeErrorCount"}, - { 411, nullptr, "ResetPinCodeErrorCount"}, - { 412, nullptr, "IncrementPinCodeErrorCount"}, - { 413, nullptr, "SetPinCodeErrorCount"}, - { 420, nullptr, "SetStartPenaltyTime"}, - { 421, nullptr, "GetStartPenaltyTime"}, - { 900, nullptr, "SetUserUnqualifiedForDebug"}, - { 901, nullptr, "UnsetUserUnqualifiedForDebug"}, - { 902, nullptr, "ListUsersUnqualifiedForDebug"}, - { 910, nullptr, "RefreshFirmwareSettingsForDebug"}, - { 997, nullptr, "DebugInvalidateTokenCacheForUser"}, - { 998, nullptr, "DebugSetUserStateClose"}, - { 999, nullptr, "DebugSetUserStateOpen"}, - { 1000, nullptr, "CreateIAccountEntityServiceForApplication"}, - { 1100, nullptr, "CreateIUserStateManager"}, - { 10050, nullptr, "IsUserRegistrationRequestPermittedForAccountPolicy"}, - { 10105, nullptr, "CheckNetworkServiceAvailabilityAsyncForAccountPolicy"}, - }; - // clang-format on - RegisterHandlers(functions); + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e") {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetUserCount"}, + FunctionInfo{1, nullptr, "GetUserExistence"}, + FunctionInfo{2, nullptr, "ListAllUsers"}, + FunctionInfo{3, nullptr, "ListOpenUsers"}, + FunctionInfo{4, nullptr, "GetLastOpenedUser"}, + FunctionInfo{5, nullptr, "GetProfile"}, + FunctionInfo{6, nullptr, "GetProfileDigest"}, + FunctionInfo{50, nullptr, "IsUserRegistrationRequestPermitted"}, + FunctionInfo{51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, + FunctionInfo{52, nullptr, "TrySelectUserWithoutInteraction"}, + FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, + FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, + FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, + FunctionInfo{102, nullptr, "GetBaasAccountManagerForSystemService"}, + FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, + FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, + FunctionInfo{110, nullptr, "StoreSaveDataThumbnail"}, + FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, + FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, + FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, + FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, + FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, + FunctionInfo{140, nullptr, "ListQualifiedUsers"}, + FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + FunctionInfo{170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, + FunctionInfo{191, nullptr, "UpdateNotificationReceiverInfo"}, + FunctionInfo{200, nullptr, "BeginUserRegistration"}, + FunctionInfo{201, nullptr, "CompleteUserRegistration"}, + FunctionInfo{202, nullptr, "CancelUserRegistration"}, + FunctionInfo{203, nullptr, "DeleteUser"}, + FunctionInfo{204, nullptr, "SetUserPosition"}, + FunctionInfo{205, nullptr, "GetProfileEditor"}, + FunctionInfo{206, nullptr, "CompleteUserRegistrationForcibly"}, + FunctionInfo{210, nullptr, "CreateFloatingRegistrationRequest"}, + FunctionInfo{211, nullptr, "CreateProcedureToRegisterUserWithNintendoAccount"}, + FunctionInfo{212, nullptr, "ResumeProcedureToRegisterUserWithNintendoAccount"}, + FunctionInfo{213, nullptr, "CreateProcedureToCreateUserWithNintendoAccount"}, + FunctionInfo{214, nullptr, "ResumeProcedureToCreateUserWithNintendoAccount"}, + FunctionInfo{215, nullptr, "ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse"}, + FunctionInfo{230, nullptr, "AuthenticateServiceAsync"}, + FunctionInfo{250, nullptr, "GetBaasAccountAdministrator"}, + FunctionInfo{251, nullptr, "SynchronizeNetworkServiceAccountsSnapshotAsync"}, + FunctionInfo{290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, + FunctionInfo{291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, + FunctionInfo{292, nullptr, "ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser"}, + FunctionInfo{293, nullptr, "ProxyProcedureForDeviceMigrationDownload"}, + FunctionInfo{299, nullptr, "SuspendBackgroundDaemon"}, + FunctionInfo{350, nullptr, "CreateDeviceMigrationUserExportRequest"}, + FunctionInfo{351, nullptr, "UploadNasCredential"}, + FunctionInfo{352, nullptr, "CreateDeviceMigrationUserImportRequest"}, + FunctionInfo{353, nullptr, "DeleteUserMigrationSaveData"}, + FunctionInfo{400, nullptr, "SetPinCode"}, + FunctionInfo{401, nullptr, "GetPinCodeLength"}, + FunctionInfo{402, nullptr, "GetPinCode"}, + FunctionInfo{403, nullptr, "GetPinCodeParity"}, + FunctionInfo{404, nullptr, "VerifyPinCode"}, + FunctionInfo{405, nullptr, "IsPinCodeVerificationForbidden"}, + FunctionInfo{410, nullptr, "GetPinCodeErrorCount"}, + FunctionInfo{411, nullptr, "ResetPinCodeErrorCount"}, + FunctionInfo{412, nullptr, "IncrementPinCodeErrorCount"}, + FunctionInfo{413, nullptr, "SetPinCodeErrorCount"}, + FunctionInfo{420, nullptr, "SetStartPenaltyTime"}, + FunctionInfo{421, nullptr, "GetStartPenaltyTime"}, + FunctionInfo{900, nullptr, "SetUserUnqualifiedForDebug"}, + FunctionInfo{901, nullptr, "UnsetUserUnqualifiedForDebug"}, + FunctionInfo{902, nullptr, "ListUsersUnqualifiedForDebug"}, + FunctionInfo{910, nullptr, "RefreshFirmwareSettingsForDebug"}, + FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, + FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, + FunctionInfo{999, nullptr, "DebugSetUserStateOpen"}, + FunctionInfo{1000, nullptr, "CreateIAccountEntityServiceForApplication"}, + FunctionInfo{1100, nullptr, "CreateIUserStateManager"}, + FunctionInfo{10050, nullptr, "IsUserRegistrationRequestPermittedForAccountPolicy"}, + FunctionInfo{10105, nullptr, "CheckNetworkServiceAvailabilityAsyncForAccountPolicy"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class ACC_E_U1 final : public Module::Interface { public: explicit ACC_E_U1(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e:u1") { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetUserCount"}, - {1, nullptr, "GetUserExistence"}, - {2, nullptr, "ListAllUsers"}, - {3, nullptr, "ListOpenUsers"}, - {4, nullptr, "GetLastOpenedUser"}, - {5, nullptr, "GetProfile"}, - {6, nullptr, "GetProfileDigest"}, - {50, nullptr, "IsUserRegistrationRequestPermitted"}, - {51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, - {99, nullptr, "DebugActivateOpenContextRetention"}, - {100, nullptr, "GetUserRegistrationNotifier"}, - {101, nullptr, "GetUserStateChangeNotifier"}, - {102, nullptr, "GetBaasAccountManagerForSystemService"}, - {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - {104, nullptr, "GetProfileUpdateNotifier"}, - {105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - {106, nullptr, "GetProfileSyncNotifier"}, - {110, nullptr, "StoreSaveDataThumbnail"}, - {111, nullptr, "ClearSaveDataThumbnail"}, - {112, nullptr, "LoadSaveDataThumbnail"}, - {113, nullptr, "GetSaveDataThumbnailExistence"}, - {120, nullptr, "ListOpenUsersInApplication"}, - {130, nullptr, "ActivateOpenContextRetention"}, - {140, nullptr, "ListQualifiedUsers"}, - {151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - {152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - {170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, - {191, nullptr, "UpdateNotificationReceiverInfo"}, - {997, nullptr, "DebugInvalidateTokenCacheForUser"}, - {998, nullptr, "DebugSetUserStateClose"}, - {999, nullptr, "DebugSetUserStateOpen"}, - }; - // clang-format on - RegisterHandlers(functions); + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e:u1") {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetUserCount"}, + FunctionInfo{1, nullptr, "GetUserExistence"}, + FunctionInfo{2, nullptr, "ListAllUsers"}, + FunctionInfo{3, nullptr, "ListOpenUsers"}, + FunctionInfo{4, nullptr, "GetLastOpenedUser"}, + FunctionInfo{5, nullptr, "GetProfile"}, + FunctionInfo{6, nullptr, "GetProfileDigest"}, + FunctionInfo{50, nullptr, "IsUserRegistrationRequestPermitted"}, + FunctionInfo{51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, + FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, + FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, + FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, + FunctionInfo{102, nullptr, "GetBaasAccountManagerForSystemService"}, + FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, + FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, + FunctionInfo{110, nullptr, "StoreSaveDataThumbnail"}, + FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, + FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, + FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, + FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, + FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, + FunctionInfo{140, nullptr, "ListQualifiedUsers"}, + FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + FunctionInfo{170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, + FunctionInfo{191, nullptr, "UpdateNotificationReceiverInfo"}, + FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, + FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, + FunctionInfo{999, nullptr, "DebugSetUserStateOpen"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class ACC_E_U2 final : public Module::Interface { public: explicit ACC_E_U2(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e:u2") { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetUserCount"}, - {1, nullptr, "GetUserExistence"}, - {2, nullptr, "ListAllUsers"}, - {3, nullptr, "ListOpenUsers"}, - {4, nullptr, "GetLastOpenedUser"}, - {5, nullptr, "GetProfile"}, - {6, nullptr, "GetProfileDigest"}, - {50, nullptr, "#IsUserRegistrationRequestPermitted"}, - {51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, - {52, nullptr, "TrySelectUserWithoutInteraction"}, - {99, nullptr, "DebugActivateOpenContextRetention"}, - {100, nullptr, "GetUserRegistrationNotifier"}, - {101, nullptr, "GetUserStateChangeNotifier"}, - {102, nullptr, "GetBaasAccountManagerForSystemService"}, - {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - {104, nullptr, "GetProfileUpdateNotifier"}, - {105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - {106, nullptr, "GetProfileSyncNotifier"}, - {110, nullptr, "StoreSaveDataThumbnail"}, - {111, nullptr, "ClearSaveDataThumbnail"}, - {112, nullptr, "LoadSaveDataThumbnail"}, - {113, nullptr, "GetSaveDataThumbnailExistence"}, - {120, nullptr, "ListOpenUsersInApplication"}, - {130, nullptr, "ActivateOpenContextRetention"}, - {140, nullptr, "ListQualifiedUsers"}, - {151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - {152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - {170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, - {191, nullptr, "UpdateNotificationReceiverInfo"}, - {205, nullptr, "GetProfileEditor"}, - {401, nullptr, "GetPinCodeLength"}, - {402, nullptr, "GetPinCode"}, - {403, nullptr, "GetPinCodeParity"}, - {404, nullptr, "VerifyPinCode"}, - {405, nullptr, "IsPinCodeVerificationForbidden"}, - {997, nullptr, "DebugInvalidateTokenCacheForUser"}, - {998, nullptr, "DebugSetUserStateClose"}, - {999, nullptr, "DebugSetUserStateOpen"}, - }; - // clang-format on - RegisterHandlers(functions); + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e:u2") {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetUserCount"}, + FunctionInfo{1, nullptr, "GetUserExistence"}, + FunctionInfo{2, nullptr, "ListAllUsers"}, + FunctionInfo{3, nullptr, "ListOpenUsers"}, + FunctionInfo{4, nullptr, "GetLastOpenedUser"}, + FunctionInfo{5, nullptr, "GetProfile"}, + FunctionInfo{6, nullptr, "GetProfileDigest"}, + FunctionInfo{50, nullptr, "IsUserRegistrationRequestPermitted"}, + FunctionInfo{51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, + FunctionInfo{52, nullptr, "TrySelectUserWithoutInteraction"}, + FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, + FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, + FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, + FunctionInfo{102, nullptr, "GetBaasAccountManagerForSystemService"}, + FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, + FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, + FunctionInfo{110, nullptr, "StoreSaveDataThumbnail"}, + FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, + FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, + FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, + FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, + FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, + FunctionInfo{140, nullptr, "ListQualifiedUsers"}, + FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + FunctionInfo{170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, + FunctionInfo{191, nullptr, "UpdateNotificationReceiverInfo"}, + FunctionInfo{205, nullptr, "GetProfileEditor"}, + FunctionInfo{401, nullptr, "GetPinCodeLength"}, + FunctionInfo{402, nullptr, "GetPinCode"}, + FunctionInfo{403, nullptr, "GetPinCodeParity"}, + FunctionInfo{404, nullptr, "VerifyPinCode"}, + FunctionInfo{405, nullptr, "IsPinCodeVerificationForbidden"}, + FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, + FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, + FunctionInfo{999, nullptr, "DebugSetUserStateOpen"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h index 19af7c74c9..9c2c96acdb 100644 --- a/src/core/hle/service/acc/acc.h +++ b/src/core/hle/service/acc/acc.h @@ -14,70 +14,6 @@ namespace Service::Account { class ProfileManager; -class Module final { -public: - class Interface : public ServiceFramework { - public: - explicit Interface(std::shared_ptr module_, - std::shared_ptr profile_manager_, Core::System& system_, - const char* name); - ~Interface() override; - - void GetUserCount(HLERequestContext& ctx); - void GetUserExistence(HLERequestContext& ctx); - void ListAllUsers(HLERequestContext& ctx); - void ListOpenUsers(HLERequestContext& ctx); - void GetLastOpenedUser(HLERequestContext& ctx); - void GetProfile(HLERequestContext& ctx); - void InitializeApplicationInfo(HLERequestContext& ctx); - void InitializeApplicationInfoRestricted(HLERequestContext& ctx); - void GetBaasAccountManagerForApplication(HLERequestContext& ctx); - void IsUserRegistrationRequestPermitted(HLERequestContext& ctx); - void TrySelectUserWithoutInteractionDeprecated(HLERequestContext& ctx); - void TrySelectUserWithoutInteraction(HLERequestContext& ctx); - void IsUserAccountSwitchLocked(HLERequestContext& ctx); - void InitializeApplicationInfoV2(HLERequestContext& ctx); - void BeginUserRegistration(HLERequestContext& ctx); - void CompleteUserRegistration(HLERequestContext& ctx); - void DeleteUser(HLERequestContext& ctx); - void SetUserPosition(HLERequestContext& ctx); - void GetProfileEditor(HLERequestContext& ctx); - void GetBaasAccountAdministrator(HLERequestContext &ctx); - void ListQualifiedUsers(HLERequestContext& ctx); - void ListOpenContextStoredUsers(HLERequestContext& ctx); - void StoreSaveDataThumbnailApplication(HLERequestContext& ctx); - void GetBaasAccountManagerForSystemService(HLERequestContext& ctx); - void StoreSaveDataThumbnailSystem(HLERequestContext& ctx); - void GetPinCodeLength(HLERequestContext& ctx); - - private: - Result InitializeApplicationInfoBase(); - void StoreSaveDataThumbnail(HLERequestContext& ctx, const Common::UUID& uuid, - const u64 tid); - - enum class ApplicationType : u32_le { - GameCard = 0, - Digital = 1, - Unknown = 3, - }; - - struct ApplicationInfo { - Service::Glue::ApplicationLaunchProperty launch_property; - ApplicationType application_type; - - constexpr explicit operator bool() const { - return launch_property.title_id != 0x0; - } - }; - - ApplicationInfo application_info{}; - - protected: - std::shared_ptr module; - std::shared_ptr profile_manager; - }; -}; - void LoopProcess(Core::System& system); } // namespace Service::Account diff --git a/src/core/hle/service/acc/async_context.cpp b/src/core/hle/service/acc/async_context.cpp index 8dec886ad7..a7f751d756 100644 --- a/src/core/hle/service/acc/async_context.cpp +++ b/src/core/hle/service/acc/async_context.cpp @@ -12,17 +12,6 @@ namespace Service::Account { IAsyncContext::IAsyncContext(Core::System& system_) : ServiceFramework{system_, "IAsyncContext"}, service_context{system_, "IAsyncContext"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IAsyncContext::GetSystemEvent, "GetSystemEvent"}, - {1, &IAsyncContext::Cancel, "Cancel"}, - {2, &IAsyncContext::HasDone, "HasDone"}, - {3, &IAsyncContext::GetResult, "GetResult"}, - }; - // clang-format on - - RegisterHandlers(functions); - completion_event = service_context.CreateEvent("IAsyncContext:CompletionEvent"); } diff --git a/src/core/hle/service/acc/async_context.h b/src/core/hle/service/acc/async_context.h index d7bffc055e..0137567d11 100644 --- a/src/core/hle/service/acc/async_context.h +++ b/src/core/hle/service/acc/async_context.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -30,6 +33,16 @@ protected: void MarkComplete(); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IAsyncContext::GetSystemEvent, "GetSystemEvent"}, + FunctionInfo{1, &IAsyncContext::Cancel, "Cancel"}, + FunctionInfo{2, &IAsyncContext::HasDone, "HasDone"}, + FunctionInfo{3, &IAsyncContext::GetResult, "GetResult"} + ); + KernelHelpers::ServiceContext service_context; std::atomic is_complete{false}; diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 2ef393439b..472be8f0f0 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -1,16 +1,1343 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include "common/settings.h" +#include "core/core.h" +#include "core/file_sys/common_funcs.h" +#include "core/file_sys/patch_manager.h" +#include "core/file_sys/romfs_factory.h" +#include "core/file_sys/control_metadata.h" +#include "core/hle/api_version.h" +#include "core/hle/kernel/k_transfer_memory.h" +#include "core/hle/service/server_manager.h" +#include "core/hle/service/am/applet_manager.h" +#include "core/hle/service/am/window_system.h" #include "core/hle/service/am/am.h" #include "core/hle/service/am/button_poller.h" #include "core/hle/service/am/event_observer.h" -#include "core/hle/service/am/service/all_system_applet_proxies_service.h" -#include "core/hle/service/am/service/application_proxy_service.h" -#include "core/hle/service/am/window_system.h" -#include "core/hle/service/server_manager.h" +#include "core/hle/service/am/service/application_creator.h" +#include "core/hle/service/am/service/audio_controller.h" +#include "core/hle/service/am/service/common_state_getter.h" +#include "core/hle/service/am/service/display_controller.h" +#include "core/hle/service/am/service/global_state_controller.h" +#include "core/hle/service/am/service/home_menu_functions.h" +#include "core/hle/service/am/service/process_winding_controller.h" +#include "core/hle/service/am/service/self_controller.h" +#include "core/hle/service/am/service/window_controller.h" +#include "core/hle/service/am/service/application_functions.h" +#include "core/hle/service/am/applet_data_broker.h" +#include "core/hle/service/am/frontend/applets.h" +#include "core/hle/service/am/library_applet_storage.h" +#include "core/hle/service/am/process_creation.h" +#include "core/hle/service/am/service/library_applet_accessor.h" +#include "core/hle/service/am/service/overlay_functions.h" +#include "core/hle/service/am/service/storage.h" +#include "core/hle/service/ns/language.h" +#include "core/hle/service/ns/application_manager_interface.h" +#include "core/hle/service/ns/service_getter_interface.h" +#include "core/hle/service/glue/glue_manager.h" +#include "core/hle/service/sm/sm.h" +#include "core/hle/service/acc/profile_manager.h" +#include "core/hle/service/am/frontend/applet_profile_select.h" +#include "core/hle/service/cmif_serialization.h" namespace Service::AM { +struct Applet; +class IAppletCommonFunctions; +class IApplicationCreator; +class IAudioController; +class ICommonStateGetter; +class IDebugFunctions; +class IDisplayController; +class IHomeMenuFunctions; +class IGlobalStateController; +class ILibraryAppletCreator; +class IProcessWindingController; +class ISelfController; +class IWindowController; +class WindowSystem; + +class IDebugFunctions final : public ServiceFramework { +public: + explicit IDebugFunctions(Core::System& system_) : ServiceFramework{system_, "IDebugFunctions"} {} + ~IDebugFunctions() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "NotifyMessageToHomeMenuForDebug"}, + FunctionInfo{1, nullptr, "OpenMainApplication"}, + FunctionInfo{10, nullptr, "PerformSystemButtonPressing"}, + FunctionInfo{20, nullptr, "InvalidateTransitionLayer"}, + FunctionInfo{30, nullptr, "RequestLaunchApplicationWithUserAndArgumentForDebug"}, + FunctionInfo{31, nullptr, "RequestLaunchApplicationByApplicationLaunchInfoForDebug"}, + FunctionInfo{40, nullptr, "GetAppletResourceUsageInfo"}, + FunctionInfo{50, nullptr, "AddSystemProgramIdAndAppletIdForDebug"}, + FunctionInfo{51, nullptr, "AddOperationConfirmedLibraryAppletIdForDebug"}, + FunctionInfo{100, nullptr, "SetCpuBoostModeForApplet"}, + FunctionInfo{101, nullptr, "CancelCpuBoostModeForApplet"}, + FunctionInfo{110, nullptr, "PushToAppletBoundChannelForDebug"}, + FunctionInfo{111, nullptr, "TryPopFromAppletBoundChannelForDebug"}, + FunctionInfo{120, nullptr, "AlarmSettingNotificationEnableAppEventReserve"}, + FunctionInfo{121, nullptr, "AlarmSettingNotificationDisableAppEventReserve"}, + FunctionInfo{122, nullptr, "AlarmSettingNotificationPushAppEventNotify"}, + FunctionInfo{130, nullptr, "FriendInvitationSetApplicationParameter"}, + FunctionInfo{131, nullptr, "FriendInvitationClearApplicationParameter"}, + FunctionInfo{132, nullptr, "FriendInvitationPushApplicationParameter"}, + FunctionInfo{140, nullptr, "RestrictPowerOperationForSecureLaunchModeForDebug"}, + FunctionInfo{200, nullptr, "CreateFloatingLibraryAppletAccepterForDebug"}, + FunctionInfo{300, nullptr, "TerminateAllRunningApplicationsForDebug"}, + FunctionInfo{900, nullptr, "GetGrcProcessLaunchedSystemEvent"} + ); +}; + +class IApplicationProxy final : public ServiceFramework { +public: + explicit IApplicationProxy(Core::System& system_, std::shared_ptr applet, + Kernel::KProcess* process, WindowSystem& window_system) + : ServiceFramework{system_, "IApplicationProxy"}, + m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { + } + + ~IApplicationProxy() override = default; + + Result GetAudioController( + Out> out_audio_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_audio_controller = std::make_shared(system); + R_SUCCEED(); + } + + Result GetDisplayController( + Out> out_display_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_display_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetProcessWindingController( + Out> out_process_winding_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_process_winding_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetDebugFunctions( + Out> out_debug_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_debug_functions = std::make_shared(system); + R_SUCCEED(); + } + + Result GetWindowController( + Out> out_window_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_window_controller = std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result GetSelfController( + Out> out_self_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_self_controller = std::make_shared(system, m_applet, m_process); + R_SUCCEED(); + } + + Result GetCommonStateGetter( + Out> out_common_state_getter) { + LOG_DEBUG(Service_AM, "called"); + *out_common_state_getter = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetLibraryAppletCreator( + Out> out_library_applet_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_creator = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result GetApplicationFunctions( + Out> out_application_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_application_functions = std::make_shared(system, m_applet); + R_SUCCEED(); + } + +private: + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IApplicationProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, + FunctionInfo{1, D<&IApplicationProxy::GetSelfController>, "GetSelfController"}, + FunctionInfo{2, D<&IApplicationProxy::GetWindowController>, "GetWindowController"}, + FunctionInfo{3, D<&IApplicationProxy::GetAudioController>, "GetAudioController"}, + FunctionInfo{4, D<&IApplicationProxy::GetDisplayController>, "GetDisplayController"}, + FunctionInfo{10, D<&IApplicationProxy::GetProcessWindingController>, "GetProcessWindingController"}, + FunctionInfo{11, D<&IApplicationProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, + FunctionInfo{20, D<&IApplicationProxy::GetApplicationFunctions>, "GetApplicationFunctions"}, + FunctionInfo{1000, D<&IApplicationProxy::GetDebugFunctions>, "GetDebugFunctions"} + ); + WindowSystem& m_window_system; + Kernel::KProcess* const m_process; + const std::shared_ptr m_applet; +}; + +class IApplicationProxyService final : public ServiceFramework { +public: + explicit IApplicationProxyService(Core::System& system_, + WindowSystem& window_system) + : ServiceFramework{system_, "appletOE"}, m_window_system{window_system} { + } + + ~IApplicationProxyService() override = default; + + Result OpenApplicationProxy( + Out> out_application_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_DEBUG(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid)) { + *out_application_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } + } + + std::shared_ptr GetAppletFromProcessId(ProcessId process_id) { + return m_window_system.GetByAppletResourceUserId(process_id.pid); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IApplicationProxyService::OpenApplicationProxy>, "OpenApplicationProxy"} + ); + WindowSystem& m_window_system; +}; + +class IAppletCommonFunctions final : public ServiceFramework { +public: + explicit IAppletCommonFunctions(Core::System& system_, std::shared_ptr applet_) : ServiceFramework{system_, "IAppletCommonFunctions"}, applet{std::move(applet_)} {} + ~IAppletCommonFunctions() override = default; + + Result SetHomeButtonDoubleClickEnabled( + bool home_button_double_click_enabled) { + LOG_WARNING(Service_AM, "(STUBBED) called, home_button_double_click_enabled={}", home_button_double_click_enabled); + R_SUCCEED(); + } + + Result GetHomeButtonDoubleClickEnabled( + Out out_home_button_double_click_enabled) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_home_button_double_click_enabled = false; + R_SUCCEED(); + } + + Result SetDisplayMagnification(f32 x, f32 y, f32 width, f32 height) { + LOG_DEBUG(Service_AM, "(STUBBED) called, x={}, y={}, width={}, height={}", x, y, width, height); + std::scoped_lock lk{applet->lock}; + applet->display_magnification = Common::Rectangle{x, y, x + width, y + height}; + R_SUCCEED(); + } + + Result SetCpuBoostRequestPriority(s32 priority) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + std::scoped_lock lk{applet->lock}; + applet->cpu_boost_request_priority = priority; + R_SUCCEED(); + } + + Result GetCurrentApplicationId(Out out_application_id) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_application_id = FileSys::GetBaseTitleID(system.GetApplicationProcessProgramID()); + R_SUCCEED(); + } + + Result SetGpuTimeSliceBoost(s64 time_span) { + LOG_WARNING(Service_AM, "(STUBBED) called, time_span={}", time_span); + R_SUCCEED(); + } + + Result Unknown350(Out out_unknown) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_unknown = 0; + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetTerminateResult"}, + FunctionInfo{10, nullptr, "ReadThemeStorage"}, + FunctionInfo{11, nullptr, "WriteThemeStorage"}, + FunctionInfo{20, nullptr, "PushToAppletBoundChannel"}, + FunctionInfo{21, nullptr, "TryPopFromAppletBoundChannel"}, + FunctionInfo{40, nullptr, "GetDisplayLogicalResolution"}, + FunctionInfo{42, D<&IAppletCommonFunctions::SetDisplayMagnification>, "SetDisplayMagnification"}, + FunctionInfo{50, D<&IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled>, "SetHomeButtonDoubleClickEnabled"}, + FunctionInfo{51, D<&IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled>, "GetHomeButtonDoubleClickEnabled"}, + FunctionInfo{52, nullptr, "IsHomeButtonShortPressedBlocked"}, + FunctionInfo{60, nullptr, "IsVrModeCurtainRequired"}, + FunctionInfo{61, nullptr, "IsSleepRequiredByHighTemperature"}, + FunctionInfo{62, nullptr, "IsSleepRequiredByLowBattery"}, + FunctionInfo{70, D<&IAppletCommonFunctions::SetCpuBoostRequestPriority>, "SetCpuBoostRequestPriority"}, + FunctionInfo{80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"}, + FunctionInfo{81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"}, + FunctionInfo{90, nullptr, "OpenNamedChannelAsParent"}, + FunctionInfo{91, nullptr, "OpenNamedChannelAsChild"}, + FunctionInfo{100, nullptr, "SetApplicationCoreUsageMode"}, + FunctionInfo{300, D<&IAppletCommonFunctions::GetCurrentApplicationId>, "GetCurrentApplicationId"}, + FunctionInfo{310, nullptr, "IsSystemAppletHomeMenu", MakeVersionGate({19,0,0})}, + FunctionInfo{320, D<&IAppletCommonFunctions::SetGpuTimeSliceBoost>, "SetGpuTimeSliceBoost", MakeVersionGate({19,0,0})}, + FunctionInfo{321, nullptr, "SetGpuTimeSliceBoostDueToApplication", MakeVersionGate({19,0,0})}, + FunctionInfo{350, D<&IAppletCommonFunctions::Unknown350>, "Unknown350", MakeVersionGate({20,0,0})} + ); + const std::shared_ptr applet; +}; + +class ISystemAppletProxy final : public ServiceFramework { +public: + explicit ISystemAppletProxy(Core::System& system_, std::shared_ptr applet, Kernel::KProcess* process, WindowSystem& window_system) + : ServiceFramework{system_, "ISystemAppletProxy"}, + m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { + } + + ~ISystemAppletProxy() override = default; + + Result GetAudioController( + Out> out_audio_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_audio_controller = std::make_shared(system); + R_SUCCEED(); + } + + Result GetDisplayController( + Out> out_display_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_display_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetProcessWindingController( + Out> out_process_winding_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_process_winding_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetDebugFunctions( + Out> out_debug_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_debug_functions = std::make_shared(system); + R_SUCCEED(); + } + + Result GetWindowController( + Out> out_window_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_window_controller = std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result GetSelfController( + Out> out_self_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_self_controller = std::make_shared(system, m_applet, m_process); + R_SUCCEED(); + } + + Result GetCommonStateGetter( + Out> out_common_state_getter) { + LOG_DEBUG(Service_AM, "called"); + *out_common_state_getter = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetLibraryAppletCreator( + Out> out_library_applet_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_creator = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result GetApplicationCreator( + Out> out_application_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_application_creator = std::make_shared(system, m_window_system); + R_SUCCEED(); + } + + Result GetAppletCommonFunctions( + Out> out_applet_common_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_applet_common_functions = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetHomeMenuFunctions( + Out> out_home_menu_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_home_menu_functions = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result GetGlobalStateController( + Out> out_global_state_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_global_state_controller = std::make_shared(system); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ISystemAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, + FunctionInfo{1, D<&ISystemAppletProxy::GetSelfController>, "GetSelfController"}, + FunctionInfo{2, D<&ISystemAppletProxy::GetWindowController>, "GetWindowController"}, + FunctionInfo{3, D<&ISystemAppletProxy::GetAudioController>, "GetAudioController"}, + FunctionInfo{4, D<&ISystemAppletProxy::GetDisplayController>, "GetDisplayController"}, + FunctionInfo{10, D<&ISystemAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, + FunctionInfo{11, D<&ISystemAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, + FunctionInfo{20, D<&ISystemAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"}, + FunctionInfo{21, D<&ISystemAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, + FunctionInfo{22, D<&ISystemAppletProxy::GetApplicationCreator>, "GetApplicationCreator"}, + FunctionInfo{23, D<&ISystemAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, + FunctionInfo{1000, D<&ISystemAppletProxy::GetDebugFunctions>, "GetDebugFunctions"} + ); + WindowSystem& m_window_system; + Kernel::KProcess* const m_process; + const std::shared_ptr m_applet; +}; + +static AppletIdentityInfo GetCallerIdentity(Applet& applet) { + if (const auto caller_applet = applet.caller_applet.lock(); caller_applet) { + // TODO: is this actually the application ID? + return { + .applet_id = caller_applet->applet_id, + .application_id = caller_applet->program_id, + }; + } else { + return { + .applet_id = AppletId::QLaunch, + .application_id = 0x0100000000001000ull, + }; + } +} + +class ILibraryAppletSelfAccessor final : public ServiceFramework { +public: + ILibraryAppletSelfAccessor(Core::System& system_, + std::shared_ptr applet) + : ServiceFramework{system_, "ILibraryAppletSelfAccessor"}, m_applet{std::move(applet)}, + m_broker{m_applet->caller_applet_broker} { + } + + ~ILibraryAppletSelfAccessor() = default; + + Result PopInData(Out> out_storage) { + LOG_INFO(Service_AM, "called"); + R_RETURN(m_broker->GetInData().Pop(system.Kernel(), out_storage)); + } + + Result PushOutData(SharedPointer storage) { + LOG_INFO(Service_AM, "called"); + m_broker->GetOutData().Push(system.Kernel(), storage); + R_SUCCEED(); + } + + Result PopInteractiveInData(Out> out_storage) { + LOG_INFO(Service_AM, "called"); + R_RETURN(m_broker->GetInteractiveInData().Pop(system.Kernel(), out_storage)); + } + + Result PushInteractiveOutData(SharedPointer storage) { + LOG_INFO(Service_AM, "called"); + m_broker->GetInteractiveOutData().Push(system.Kernel(), storage); + R_SUCCEED(); + } + + Result GetPopInDataEvent( + OutCopyHandle out_event) { + LOG_INFO(Service_AM, "called"); + *out_event = m_broker->GetInData().GetEvent(); + R_SUCCEED(); + } + + Result GetPopInteractiveInDataEvent( + OutCopyHandle out_event) { + LOG_INFO(Service_AM, "called"); + *out_event = m_broker->GetInteractiveInData().GetEvent(); + R_SUCCEED(); + } + + Result GetLibraryAppletInfo( + Out out_library_applet_info) { + LOG_INFO(Service_AM, "called"); + *out_library_applet_info = { + .applet_id = m_applet->applet_id, + .library_applet_mode = m_applet->library_applet_mode, + }; + R_SUCCEED(); + } + + Result GetMainAppletIdentityInfo( + Out out_identity_info) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_identity_info = { + .applet_id = AppletId::QLaunch, + .application_id = 0x0100000000001000ull, + }; + R_SUCCEED(); + } + + Result CanUseApplicationCore(Out out_can_use_application_core) { + // TODO: This appears to read the NPDM from state and check the core mask of the applet. + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_can_use_application_core = false; + R_SUCCEED(); + } + + Result GetMainAppletApplicationControlProperty( + OutLargeData, BufferAttr_HipcMapAlias> out_nacp) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + + // TODO: this should be the main applet, not the caller applet + const auto application = GetCallerIdentity(*m_applet); + std::vector nacp; + const auto result = + system.GetARPManager().GetControlProperty(&nacp, application.application_id); + + if (R_SUCCEEDED(result)) { + std::memcpy(out_nacp->data(), nacp.data(), (std::min)(nacp.size(), out_nacp->size())); + } + + R_RETURN(result); + } + + Result GetMainAppletStorageId(Out out_storage_id) { + LOG_INFO(Service_AM, "(STUBBED) called"); + *out_storage_id = FileSys::StorageId::NandUser; + R_SUCCEED(); + } + + Result ExitProcessAndReturn() { + LOG_INFO(Service_AM, "called"); + + if (const auto caller_applet = m_applet->caller_applet.lock(); caller_applet) { + m_applet->process->Terminate(); + } else { + system.GetUserChannel() = m_applet->user_channel_launch_parameter; + system.ExecuteProgram(0); + } + + R_SUCCEED(); + } + + Result GetCallerAppletIdentityInfo( + Out out_identity_info) { + LOG_INFO(Service_AM, "called"); + *out_identity_info = GetCallerIdentity(*m_applet); + R_SUCCEED(); + } + + Result GetCallerAppletIdentityInfoStack( + Out out_count, OutArray out_identity_info) { + LOG_INFO(Service_AM, "called"); + + std::shared_ptr applet = m_applet; + *out_count = 0; + + do { + if (*out_count >= static_cast(out_identity_info.size())) { + break; + } + out_identity_info[(*out_count)++] = GetCallerIdentity(*applet); + } while ((applet = applet->caller_applet.lock())); + + R_SUCCEED(); + } + + Result GetDesirableKeyboardLayout(Out out_desirable_layout) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_desirable_layout = 0; + R_SUCCEED(); + } + + Result ReportVisibleError(ErrorCode error_code) { + LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category, + error_code.number); + R_SUCCEED(); + } + + Result ReportVisibleErrorWithErrorContext( + ErrorCode error_code, InLargeData error_context) { + LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category, + error_code.number); + R_SUCCEED(); + } + + Result UnpopInData(SharedPointer storage) { + LOG_INFO(Service_AM, "called"); + m_broker->GetInData().Unpop(system.Kernel(), storage); + R_SUCCEED(); + } + + Result GetMainAppletApplicationDesiredLanguage( + Out out_desired_language) { + // FIXME: this is copied from IApplicationFunctions::GetDesiredLanguage + // FIXME: all of this stuff belongs to ns + auto identity = GetCallerIdentity(*m_applet); + + // TODO(bunnei): This should be configurable + LOG_DEBUG(Service_AM, "called"); + + // Get supported languages from NACP, if possible + // Default to 0 (all languages supported) + u32 supported_languages = 0; + + const auto res = FileSys::PatchManager::GetMetadataFromBaseOrUpdate(system, identity.application_id); + + if (res.first != nullptr) { + supported_languages = res.first->GetSupportedLanguages(); + } + + // Call IApplicationManagerInterface implementation. + auto& service_manager = system.ServiceManager(); + auto ns_am2 = service_manager.GetService("ns:am2"); + + std::shared_ptr app_man; + R_TRY(ns_am2->GetApplicationManagerInterface(&app_man)); + + // Get desired application language + NS::ApplicationLanguage desired_language{}; + R_TRY(app_man->GetApplicationDesiredLanguage(&desired_language, supported_languages)); + + // Convert to settings language code. + u64 language_code{}; + R_TRY(app_man->ConvertApplicationLanguageToLanguageCode(&language_code, desired_language)); + + LOG_DEBUG(Service_AM, "got desired_language={:016X}", language_code); + + *out_desired_language = language_code; + R_SUCCEED(); + } + + Result GetCurrentApplicationId(Out out_application_id) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + + // TODO: this should be the main applet, not the caller applet + const auto main_applet = GetCallerIdentity(*m_applet); + *out_application_id = main_applet.application_id; + + R_SUCCEED(); + } + + Result GetMainAppletAvailableUsers( + Out out_can_select_any_user, Out out_users_count, + OutArray out_users) { + const Service::Account::ProfileManager manager{}; + + *out_can_select_any_user = false; + *out_users_count = -1; + + LOG_INFO(Service_AM, "called"); + + if (manager.GetUserCount() > 0) { + *out_can_select_any_user = true; + *out_users_count = static_cast(manager.GetUserCount()); + + const auto users = manager.GetAllUsers(); + for (size_t i = 0; i < users.size() && i < out_users.size(); i++) { + out_users[i] = users[i]; + } + } + + R_SUCCEED(); + } + + Result ShouldSetGpuTimeSliceManually( + Out out_should_set_gpu_time_slice_manually) { + LOG_INFO(Service_AM, "(STUBBED) called"); + *out_should_set_gpu_time_slice_manually = false; + R_SUCCEED(); + } + + Result GetLibraryAppletInfoEx( + Out out_library_applet_info) { + LOG_INFO(Service_AM, "called"); + *out_library_applet_info = { + .applet_id = m_applet->applet_id, + .library_applet_mode = m_applet->library_applet_mode, + }; + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ILibraryAppletSelfAccessor::PopInData>, "PopInData"}, + FunctionInfo{1, D<&ILibraryAppletSelfAccessor::PushOutData>, "PushOutData"}, + FunctionInfo{2, D<&ILibraryAppletSelfAccessor::PopInteractiveInData>, "PopInteractiveInData"}, + FunctionInfo{3, D<&ILibraryAppletSelfAccessor::PushInteractiveOutData>, "PushInteractiveOutData"}, + FunctionInfo{5, D<&ILibraryAppletSelfAccessor::GetPopInDataEvent>, "GetPopInDataEvent"}, + FunctionInfo{6, D<&ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent>, "GetPopInteractiveInDataEvent"}, + FunctionInfo{10, D<&ILibraryAppletSelfAccessor::ExitProcessAndReturn>, "ExitProcessAndReturn"}, + FunctionInfo{11, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"}, + FunctionInfo{12, D<&ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo>, "GetMainAppletIdentityInfo"}, + FunctionInfo{13, D<&ILibraryAppletSelfAccessor::CanUseApplicationCore>, "CanUseApplicationCore"}, + FunctionInfo{14, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo>, "GetCallerAppletIdentityInfo"}, + FunctionInfo{15, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty>, "GetMainAppletApplicationControlProperty"}, + FunctionInfo{16, D<&ILibraryAppletSelfAccessor::GetMainAppletStorageId>, "GetMainAppletStorageId"}, + FunctionInfo{17, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack>, "GetCallerAppletIdentityInfoStack"}, + FunctionInfo{18, nullptr, "GetNextReturnDestinationAppletIdentityInfo"}, + FunctionInfo{19, D<&ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout>, "GetDesirableKeyboardLayout"}, + FunctionInfo{20, nullptr, "PopExtraStorage"}, + FunctionInfo{25, nullptr, "GetPopExtraStorageEvent"}, + FunctionInfo{30, D<&ILibraryAppletSelfAccessor::UnpopInData>, "UnpopInData"}, + FunctionInfo{31, nullptr, "UnpopExtraStorage"}, + FunctionInfo{40, nullptr, "GetIndirectLayerProducerHandle"}, + FunctionInfo{50, D<&ILibraryAppletSelfAccessor::ReportVisibleError>, "ReportVisibleError"}, + FunctionInfo{51, D<&ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext>, "ReportVisibleErrorWithErrorContext"}, + FunctionInfo{60, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage>, "GetMainAppletApplicationDesiredLanguage"}, + FunctionInfo{70, D<&ILibraryAppletSelfAccessor::GetCurrentApplicationId>, "GetCurrentApplicationId"}, + FunctionInfo{80, nullptr, "RequestExitToSelf"}, + FunctionInfo{90, nullptr, "CreateApplicationAndPushAndRequestToLaunch"}, + FunctionInfo{100, nullptr, "CreateGameMovieTrimmer"}, + FunctionInfo{101, nullptr, "ReserveResourceForMovieOperation"}, + FunctionInfo{102, nullptr, "UnreserveResourceForMovieOperation"}, + FunctionInfo{110, D<&ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers>, "GetMainAppletAvailableUsers"}, + FunctionInfo{120, nullptr, "GetLaunchStorageInfoForDebug"}, + FunctionInfo{130, nullptr, "GetGpuErrorDetectedSystemEvent"}, + FunctionInfo{140, nullptr, "SetApplicationMemoryReservation"}, + FunctionInfo{150, D<&ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually>, "ShouldSetGpuTimeSliceManually"}, + FunctionInfo{160, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx>, "GetLibraryAppletInfoEx"} + ); + const std::shared_ptr m_applet; + const std::shared_ptr m_broker; +}; + +class ILibraryAppletProxy final : public ServiceFramework { +public: + explicit ILibraryAppletProxy(Core::System& system_, std::shared_ptr applet, + Kernel::KProcess* process, WindowSystem& window_system) + : ServiceFramework{system_, "ILibraryAppletProxy"}, + m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { + } + ~ILibraryAppletProxy() override = default; + + Result GetAudioController( + Out> out_audio_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_audio_controller = std::make_shared(system); + R_SUCCEED(); + } + + Result GetDisplayController( + Out> out_display_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_display_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetProcessWindingController( + Out> out_process_winding_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_process_winding_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetDebugFunctions( + Out> out_debug_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_debug_functions = std::make_shared(system); + R_SUCCEED(); + } + + Result GetWindowController( + Out> out_window_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_window_controller = std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result GetSelfController( + Out> out_self_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_self_controller = std::make_shared(system, m_applet, m_process); + R_SUCCEED(); + } + + Result GetCommonStateGetter( + Out> out_common_state_getter) { + LOG_DEBUG(Service_AM, "called"); + *out_common_state_getter = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetLibraryAppletCreator( + Out> out_library_applet_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_creator = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result OpenLibraryAppletSelfAccessor( + Out> out_library_applet_self_accessor) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_self_accessor = + std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetAppletCommonFunctions( + Out> out_applet_common_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_applet_common_functions = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetHomeMenuFunctions( + Out> out_home_menu_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_home_menu_functions = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result GetGlobalStateController( + Out> out_global_state_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_global_state_controller = std::make_shared(system); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ILibraryAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, + FunctionInfo{1, D<&ILibraryAppletProxy::GetSelfController>, "GetSelfController"}, + FunctionInfo{2, D<&ILibraryAppletProxy::GetWindowController>, "GetWindowController"}, + FunctionInfo{3, D<&ILibraryAppletProxy::GetAudioController>, "GetAudioController"}, + FunctionInfo{4, D<&ILibraryAppletProxy::GetDisplayController>, "GetDisplayController"}, + FunctionInfo{10, D<&ILibraryAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, + FunctionInfo{11, D<&ILibraryAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, + FunctionInfo{20, D<&ILibraryAppletProxy::OpenLibraryAppletSelfAccessor>, "OpenLibraryAppletSelfAccessor"}, + FunctionInfo{21, D<&ILibraryAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, + FunctionInfo{22, D<&ILibraryAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"}, + FunctionInfo{23, D<&ILibraryAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, + FunctionInfo{1000, D<&ILibraryAppletProxy::GetDebugFunctions>, "GetDebugFunctions"} + ); + WindowSystem& m_window_system; + Kernel::KProcess* const m_process; + const std::shared_ptr m_applet; +}; + +class IOverlayAppletProxy final : public ServiceFramework { +public: + explicit IOverlayAppletProxy(Core::System &system_, std::shared_ptr applet, + Kernel::KProcess *process, WindowSystem &window_system) + : ServiceFramework{system_, "IOverlayAppletProxy"}, + m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { + } + + ~IOverlayAppletProxy() override = default; + + Result GetCommonStateGetter( + Out > out_common_state_getter) { + LOG_DEBUG(Service_AM, "called"); + *out_common_state_getter = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetSelfController( + Out > out_self_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_self_controller = std::make_shared(system, m_applet, m_process); + R_SUCCEED(); + } + + Result GetWindowController( + Out > out_window_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_window_controller = std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result GetAudioController( + Out > out_audio_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_audio_controller = std::make_shared(system); + R_SUCCEED(); + } + + Result GetDisplayController( + Out > out_display_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_display_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetProcessWindingController( + Out > out_process_winding_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_process_winding_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetLibraryAppletCreator( + Out > out_library_applet_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_creator = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result GetOverlayFunctions( + Out > out_overlay_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_overlay_functions = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetAppletCommonFunctions( + Out > out_applet_common_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_applet_common_functions = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result GetGlobalStateController( + Out > out_global_state_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_global_state_controller = std::make_shared(system); + R_SUCCEED(); + } + + Result GetDebugFunctions( + Out > out_debug_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_debug_functions = std::make_shared(system); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IOverlayAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, + FunctionInfo{1, D<&IOverlayAppletProxy::GetSelfController>, "GetSelfController"}, + FunctionInfo{2, D<&IOverlayAppletProxy::GetWindowController>, "GetWindowController"}, + FunctionInfo{3, D<&IOverlayAppletProxy::GetAudioController>, "GetAudioController"}, + FunctionInfo{4, D<&IOverlayAppletProxy::GetDisplayController>, "GetDisplayController"}, + FunctionInfo{10, D<&IOverlayAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, + FunctionInfo{11, D<&IOverlayAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, + FunctionInfo{20, D<&IOverlayAppletProxy::GetOverlayFunctions>, "GetOverlayFunctions"}, + FunctionInfo{21, D<&IOverlayAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, + FunctionInfo{23, D<&IOverlayAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, + FunctionInfo{1000, D<&IOverlayAppletProxy::GetDebugFunctions>, "GetDebugFunctions"} + ); + WindowSystem& m_window_system; + Kernel::KProcess* const m_process; + const std::shared_ptr m_applet; +}; + +static bool ShouldCreateGuestApplet(AppletId applet_id) { +#define X(Name, name) \ + if (applet_id == AppletId::Name && \ + Settings::values.name##_applet_mode.GetValue() != Settings::AppletMode::LLE) { \ + return false; \ + } + + X(Cabinet, cabinet) + X(Controller, controller) + X(DataErase, data_erase) + X(Error, error) + X(NetConnect, net_connect) + X(ProfileSelect, player_select) + X(SoftwareKeyboard, swkbd) + X(MiiEdit, mii_edit) + X(Web, web) + X(Shop, shop) + X(PhotoViewer, photo_viewer) + X(OfflineWeb, offline_web) + X(LoginShare, login_share) + X(WebAuth, wifi_web_auth) + X(MyPage, my_page) + +#undef X + + return true; +} + +static AppletProgramId AppletIdToProgramId(AppletId applet_id) { + switch (applet_id) { + case AppletId::OverlayDisplay: + return AppletProgramId::OverlayDisplay; + case AppletId::QLaunch: + return AppletProgramId::QLaunch; + case AppletId::Starter: + return AppletProgramId::Starter; + case AppletId::Auth: + return AppletProgramId::Auth; + case AppletId::Cabinet: + return AppletProgramId::Cabinet; + case AppletId::Controller: + return AppletProgramId::Controller; + case AppletId::DataErase: + return AppletProgramId::DataErase; + case AppletId::Error: + return AppletProgramId::Error; + case AppletId::NetConnect: + return AppletProgramId::NetConnect; + case AppletId::ProfileSelect: + return AppletProgramId::ProfileSelect; + case AppletId::SoftwareKeyboard: + return AppletProgramId::SoftwareKeyboard; + case AppletId::MiiEdit: + return AppletProgramId::MiiEdit; + case AppletId::Web: + return AppletProgramId::Web; + case AppletId::Shop: + return AppletProgramId::Shop; + case AppletId::PhotoViewer: + return AppletProgramId::PhotoViewer; + case AppletId::Settings: + return AppletProgramId::Settings; + case AppletId::OfflineWeb: + return AppletProgramId::OfflineWeb; + case AppletId::LoginShare: + return AppletProgramId::LoginShare; + case AppletId::WebAuth: + return AppletProgramId::WebAuth; + case AppletId::MyPage: + return AppletProgramId::MyPage; + default: + return static_cast(0); + } +} + +static std::shared_ptr CreateGuestApplet(Core::System& system, + WindowSystem& window_system, + std::shared_ptr caller_applet, + AppletId applet_id, + LibraryAppletMode mode) { + const auto program_id = static_cast(AppletIdToProgramId(applet_id)); + if (program_id == 0) { + // Unknown applet + return {}; + } + + auto process = CreateProcess(system, program_id, 1, HLE::ApiVersion::HOS_VERSION_MAJOR); + if (process) { + const auto applet = std::make_shared(system, std::move(process), false); + applet->program_id = program_id; + applet->applet_id = applet_id; + applet->type = AppletType::LibraryApplet; + applet->library_applet_mode = mode; + applet->window_visible = mode != LibraryAppletMode::AllForegroundInitiallyHidden; + + auto broker = std::make_shared(system); + applet->caller_applet = caller_applet; + applet->caller_applet_broker = broker; + { + std::scoped_lock lk{caller_applet->lock}; + caller_applet->child_applets.push_back(applet); + } + window_system.TrackApplet(applet, false); + return std::make_shared(system, broker, applet); + } + // Couldn't initialize the guest process + return {}; +} + +static std::shared_ptr CreateFrontendApplet(Core::System& system, + WindowSystem& window_system, + std::shared_ptr caller_applet, + AppletId applet_id, + LibraryAppletMode mode) { + const auto program_id = static_cast(AppletIdToProgramId(applet_id)); + + auto process = std::make_unique(system); + auto applet = std::make_shared(system, std::move(process), false); + applet->program_id = program_id; + applet->applet_id = applet_id; + applet->type = AppletType::LibraryApplet; + applet->library_applet_mode = mode; + + auto storage = std::make_shared(system); + applet->caller_applet = caller_applet; + applet->caller_applet_broker = storage; + applet->frontend = system.GetFrontendAppletHolder().GetApplet(applet, applet_id, mode); + { + std::scoped_lock lk{caller_applet->lock}; + caller_applet->child_applets.push_back(applet); + } + return std::make_shared(system, storage, applet); +} + +class ILibraryAppletCreator final : public ServiceFramework { +public: + explicit ILibraryAppletCreator(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) + : ServiceFramework{system_, "ILibraryAppletCreator"} + , m_window_system{window_system}, m_applet{std::move(applet)} { + } + ~ILibraryAppletCreator() override = default; + + Result CreateLibraryApplet( + Out> out_library_applet_accessor, AppletId applet_id, + LibraryAppletMode library_applet_mode) { + LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={}", applet_id, + library_applet_mode); + + std::shared_ptr library_applet; + if (ShouldCreateGuestApplet(applet_id)) { + library_applet = + CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); + } + if (!library_applet) { + library_applet = + CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); + } + if (!library_applet) { + LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); + R_THROW(ResultUnknown); + } + + // Applet is created, can now be launched. + m_applet->library_applet_launchable_event.Signal(system.Kernel()); + *out_library_applet_accessor = library_applet; + R_SUCCEED(); + } + + Result CreateLibraryAppletEx( + Out> out_library_applet_accessor, AppletId applet_id, + LibraryAppletMode library_applet_mode, u64 thread_id) { + LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={} thread_id={}", applet_id, + library_applet_mode, thread_id); + + std::shared_ptr library_applet; + if (ShouldCreateGuestApplet(applet_id)) { + library_applet = + CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); + } + if (!library_applet) { + library_applet = + CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); + } + if (!library_applet) { + LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); + R_THROW(ResultUnknown); + } + + // Applet is created, can now be launched. + m_applet->library_applet_launchable_event.Signal(system.Kernel()); + *out_library_applet_accessor = library_applet; + R_SUCCEED(); + } + + Result CreateStorage(Out> out_storage, s64 size) { + LOG_DEBUG(Service_AM, "called, size={}", size); + + if (size <= 0) { + LOG_ERROR(Service_AM, "size is less than or equal to 0"); + R_THROW(ResultUnknown); + } + + *out_storage = std::make_shared(system, AM::CreateStorage(std::vector(size))); + R_SUCCEED(); + } + + Result CreateTransferMemoryStorage( + Out> out_storage, bool is_writable, s64 size, + InCopyHandle transfer_memory_handle) { + LOG_DEBUG(Service_AM, "called, is_writable={} size={}", is_writable, size); + + if (size <= 0) { + LOG_ERROR(Service_AM, "size is less than or equal to 0"); + R_THROW(ResultUnknown); + } + + if (!transfer_memory_handle) { + LOG_ERROR(Service_AM, "transfer_memory_handle is null"); + R_THROW(ResultUnknown); + } + + *out_storage = std::make_shared( + system, AM::CreateTransferMemoryStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(), + transfer_memory_handle.Get(), is_writable, size)); + R_SUCCEED(); + } + + Result CreateHandleStorage( + Out> out_storage, s64 size, + InCopyHandle transfer_memory_handle) { + LOG_DEBUG(Service_AM, "called, size={}", size); + + if (size <= 0) { + LOG_ERROR(Service_AM, "size is less than or equal to 0"); + R_THROW(ResultUnknown); + } + + if (!transfer_memory_handle) { + LOG_ERROR(Service_AM, "transfer_memory_handle is null"); + R_THROW(ResultUnknown); + } + + *out_storage = std::make_shared( + system, AM::CreateHandleStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(), + transfer_memory_handle.Get(), size)); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"}, + FunctionInfo{1, nullptr, "TerminateAllLibraryApplets"}, + FunctionInfo{2, nullptr, "AreAnyLibraryAppletsLeft"}, + FunctionInfo{3, D<&ILibraryAppletCreator::CreateLibraryAppletEx>, "CreateLibraryAppletEx"}, + FunctionInfo{10, D<&ILibraryAppletCreator::CreateStorage>, "CreateStorage"}, + FunctionInfo{11, D<&ILibraryAppletCreator::CreateTransferMemoryStorage>, "CreateTransferMemoryStorage"}, + FunctionInfo{12, D<&ILibraryAppletCreator::CreateHandleStorage>, "CreateHandleStorage"} + ); + WindowSystem& m_window_system; + const std::shared_ptr m_applet; +}; + +class IAllSystemAppletProxiesService final + : public ServiceFramework { +public: + explicit IAllSystemAppletProxiesService(Core::System& system_, WindowSystem& window_system) + : ServiceFramework{system_, "appletAE"}, m_window_system{window_system} { + } + + ~IAllSystemAppletProxiesService() override = default; + + Result OpenSystemAppletProxy( + Out> out_system_applet_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_DEBUG(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid); applet) { + *out_system_applet_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } + } + + Result OpenLibraryAppletProxy( + Out> out_library_applet_proxy, ClientProcessId pid, + InCopyHandle process_handle, + InLargeData attribute) { + LOG_DEBUG(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid); applet) { + *out_library_applet_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } + } + + Result OpenOverlayAppletProxy( + Out> out_overlay_applet_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_WARNING(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid); applet) { + *out_overlay_applet_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } + } + + Result OpenSystemApplicationProxy( + Out> out_system_application_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_DEBUG(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid); applet) { + *out_system_application_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } + } + + Result OpenLibraryAppletProxyOld( + Out> out_library_applet_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_DEBUG(Service_AM, "called"); + + AppletAttribute attribute{}; + R_RETURN(this->OpenLibraryAppletProxy(out_library_applet_proxy, pid, process_handle, attribute)); + } + + Result GetSystemProcessCommonFunctions() { + LOG_DEBUG(Service_AM, "(STUBBED) called."); + // TODO (jarrodnorwell) + R_SUCCEED(); + } + + Result GetAppletAlternativeFunctions() { + LOG_DEBUG(Service_AM, "(STUBBED) called."); + // TODO (maufeat) + R_SUCCEED(); + } + + std::shared_ptr GetAppletFromProcessId(ProcessId process_id) { + return m_window_system.GetByAppletResourceUserId(process_id.pid); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{100, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxy"}, + FunctionInfo{110, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxyEx"}, + FunctionInfo{200, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld>, "OpenLibraryAppletProxyOld"}, + FunctionInfo{201, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxy>, "OpenLibraryAppletProxy"}, + FunctionInfo{300, D<&IAllSystemAppletProxiesService::OpenOverlayAppletProxy>, "OpenOverlayAppletProxy"}, + FunctionInfo{350, D<&IAllSystemAppletProxiesService::OpenSystemApplicationProxy>, "OpenSystemApplicationProxy"}, + FunctionInfo{400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"}, + FunctionInfo{410, nullptr, "GetSystemAppletControllerForDebug"}, + FunctionInfo{450, D<&IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions>, "GetSystemProcessCommonFunctions", MakeVersionGate({19,0,0})}, + FunctionInfo{460, D<&IAllSystemAppletProxiesService::GetAppletAlternativeFunctions>, "GetAppletAlternativeFunctions", MakeVersionGate({20,0,0})}, + FunctionInfo{1000, nullptr, "GetDebugFunctions"} + ); + WindowSystem& m_window_system; +}; + void LoopProcess(Core::System& system) { WindowSystem window_system(system); ButtonPoller button_poller(system, window_system); @@ -18,10 +1345,8 @@ void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); - server_manager->RegisterNamedService( - "appletAE", std::make_shared(system, window_system)); - server_manager->RegisterNamedService( - "appletOE", std::make_shared(system, window_system)); + server_manager->RegisterNamedService("appletAE", std::make_shared(system, window_system)); + server_manager->RegisterNamedService("appletOE", std::make_shared(system, window_system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp b/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp deleted file mode 100644 index 437032c2f4..0000000000 --- a/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/core.h" -#include "core/hle/service/am/applet_manager.h" -#include "core/hle/service/am/service/all_system_applet_proxies_service.h" -#include "core/hle/service/am/service/application_proxy.h" -#include "core/hle/service/am/service/library_applet_proxy.h" -#include "core/hle/service/am/service/system_applet_proxy.h" -#include "core/hle/service/am/service/overlay_applet_proxy.h" -#include "core/hle/service/am/window_system.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::AM { - -IAllSystemAppletProxiesService::IAllSystemAppletProxiesService(Core::System& system_, - WindowSystem& window_system) - : ServiceFramework{system_, "appletAE"}, m_window_system{window_system} { - // clang-format off - static const FunctionInfo functions[] = { - {100, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxy"}, - {110, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxyEx"}, - {200, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld>, "OpenLibraryAppletProxyOld"}, - {201, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxy>, "OpenLibraryAppletProxy"}, - {300, D<&IAllSystemAppletProxiesService::OpenOverlayAppletProxy>, "OpenOverlayAppletProxy"}, - {350, D<&IAllSystemAppletProxiesService::OpenSystemApplicationProxy>, "OpenSystemApplicationProxy"}, - {400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"}, - {410, nullptr, "GetSystemAppletControllerForDebug"}, - {450, D<&IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions>, "GetSystemProcessCommonFunctions"}, // 19.0.0+ - {460, D<&IAllSystemAppletProxiesService::GetAppletAlternativeFunctions>, "GetAppletAlternativeFunctions"}, // 20.0.0+ - {1000, nullptr, "GetDebugFunctions"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IAllSystemAppletProxiesService::~IAllSystemAppletProxiesService() = default; - -Result IAllSystemAppletProxiesService::OpenSystemAppletProxy( - Out> out_system_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_DEBUG(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid); applet) { - *out_system_applet_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } -} - -Result IAllSystemAppletProxiesService::OpenLibraryAppletProxy( - Out> out_library_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle, - InLargeData attribute) { - LOG_DEBUG(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid); applet) { - *out_library_applet_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } -} - -Result IAllSystemAppletProxiesService::OpenOverlayAppletProxy( - Out> out_overlay_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_WARNING(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid); applet) { - *out_overlay_applet_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } -} - -Result IAllSystemAppletProxiesService::OpenSystemApplicationProxy( - Out> out_system_application_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_DEBUG(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid); applet) { - *out_system_application_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } -} - -Result IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld( - Out> out_library_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_DEBUG(Service_AM, "called"); - - AppletAttribute attribute{}; - R_RETURN( - this->OpenLibraryAppletProxy(out_library_applet_proxy, pid, process_handle, attribute)); -} - -Result IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions() { - LOG_DEBUG(Service_AM, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - R_SUCCEED(); -} - -Result IAllSystemAppletProxiesService::GetAppletAlternativeFunctions() { - LOG_DEBUG(Service_AM, "(STUBBED) called."); - - // TODO (maufeat) - - R_SUCCEED(); -} - -std::shared_ptr IAllSystemAppletProxiesService::GetAppletFromProcessId( - ProcessId process_id) { - return m_window_system.GetByAppletResourceUserId(process_id.pid); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/all_system_applet_proxies_service.h b/src/core/hle/service/am/service/all_system_applet_proxies_service.h deleted file mode 100644 index 73cb8a09ac..0000000000 --- a/src/core/hle/service/am/service/all_system_applet_proxies_service.h +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" -#include "core/hle/service/am/service/overlay_applet_proxy.h" - -namespace Service { - -namespace AM { - -struct Applet; -struct AppletAttribute; -class IApplicationProxy; -class ILibraryAppletProxy; -class ISystemAppletProxy; -class WindowSystem; - -class IAllSystemAppletProxiesService final - : public ServiceFramework { -public: - explicit IAllSystemAppletProxiesService(Core::System& system_, WindowSystem& window_system); - ~IAllSystemAppletProxiesService() override; - -private: - Result OpenSystemAppletProxy(Out> out_system_applet_proxy, - ClientProcessId pid, - InCopyHandle process_handle); - Result OpenLibraryAppletProxy(Out> out_library_applet_proxy, - ClientProcessId pid, - InCopyHandle process_handle, - InLargeData attribute); - Result OpenOverlayAppletProxy(Out> out_overlay_applet_proxy, - ClientProcessId pid, InCopyHandle process_handle); - Result OpenLibraryAppletProxyOld( - Out> out_library_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle); - Result OpenSystemApplicationProxy( - Out> out_system_application_proxy, ClientProcessId pid, - InCopyHandle process_handle); - Result GetSystemProcessCommonFunctions(); - Result GetAppletAlternativeFunctions(); - -private: - std::shared_ptr GetAppletFromProcessId(ProcessId pid); - - WindowSystem& m_window_system; -}; - -} // namespace AM -} // namespace Service diff --git a/src/core/hle/service/am/service/applet_common_functions.cpp b/src/core/hle/service/am/service/applet_common_functions.cpp deleted file mode 100644 index 5ffec23b3e..0000000000 --- a/src/core/hle/service/am/service/applet_common_functions.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/core.h" -#include "core/file_sys/common_funcs.h" -#include "core/hle/service/am/applet.h" -#include "core/hle/service/am/service/applet_common_functions.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::AM { - -IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_, - std::shared_ptr applet_) - : ServiceFramework{system_, "IAppletCommonFunctions"}, applet{std::move(applet_)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "SetTerminateResult"}, - {10, nullptr, "ReadThemeStorage"}, - {11, nullptr, "WriteThemeStorage"}, - {20, nullptr, "PushToAppletBoundChannel"}, - {21, nullptr, "TryPopFromAppletBoundChannel"}, - {40, nullptr, "GetDisplayLogicalResolution"}, - {42, D<&IAppletCommonFunctions::SetDisplayMagnification>, "SetDisplayMagnification"}, - {50, D<&IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled>, "SetHomeButtonDoubleClickEnabled"}, - {51, D<&IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled>, "GetHomeButtonDoubleClickEnabled"}, - {52, nullptr, "IsHomeButtonShortPressedBlocked"}, - {60, nullptr, "IsVrModeCurtainRequired"}, - {61, nullptr, "IsSleepRequiredByHighTemperature"}, - {62, nullptr, "IsSleepRequiredByLowBattery"}, - {70, D<&IAppletCommonFunctions::SetCpuBoostRequestPriority>, "SetCpuBoostRequestPriority"}, - {80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"}, - {81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"}, - {90, nullptr, "OpenNamedChannelAsParent"}, - {91, nullptr, "OpenNamedChannelAsChild"}, - {100, nullptr, "SetApplicationCoreUsageMode"}, - {300, D<&IAppletCommonFunctions::GetCurrentApplicationId>, "GetCurrentApplicationId"}, - {310, nullptr, "IsSystemAppletHomeMenu"}, //19.0.0+ - {320, D<&IAppletCommonFunctions::SetGpuTimeSliceBoost>, "SetGpuTimeSliceBoost"}, //19.0.0+ - {321, nullptr, "SetGpuTimeSliceBoostDueToApplication"}, //19.0.0+ - {350, D<&IAppletCommonFunctions::Unknown350>, "Unknown350"} //20.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); -} - -IAppletCommonFunctions::~IAppletCommonFunctions() = default; - -Result IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled( - bool home_button_double_click_enabled) { - LOG_WARNING(Service_AM, "(STUBBED) called, home_button_double_click_enabled={}", - home_button_double_click_enabled); - R_SUCCEED(); -} - -Result IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled( - Out out_home_button_double_click_enabled) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_home_button_double_click_enabled = false; - R_SUCCEED(); -} - -Result IAppletCommonFunctions::SetDisplayMagnification(f32 x, f32 y, f32 width, f32 height) { - LOG_DEBUG(Service_AM, "(STUBBED) called, x={}, y={}, width={}, height={}", x, y, width, - height); - std::scoped_lock lk{applet->lock}; - applet->display_magnification = Common::Rectangle{x, y, x + width, y + height}; - R_SUCCEED(); -} - -Result IAppletCommonFunctions::SetCpuBoostRequestPriority(s32 priority) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - std::scoped_lock lk{applet->lock}; - applet->cpu_boost_request_priority = priority; - R_SUCCEED(); -} - -Result IAppletCommonFunctions::GetCurrentApplicationId(Out out_application_id) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_application_id = FileSys::GetBaseTitleID(system.GetApplicationProcessProgramID()); - R_SUCCEED(); -} - -Result IAppletCommonFunctions::SetGpuTimeSliceBoost(s64 time_span) { - LOG_WARNING(Service_AM, "(STUBBED) called, time_span={}", time_span); - R_SUCCEED(); -} - -Result IAppletCommonFunctions::Unknown350(Out out_unknown) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_unknown = 0; - R_SUCCEED(); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/applet_common_functions.h b/src/core/hle/service/am/service/applet_common_functions.h deleted file mode 100644 index 696fcd5bd1..0000000000 --- a/src/core/hle/service/am/service/applet_common_functions.h +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service::AM { - -struct Applet; - -class IAppletCommonFunctions final : public ServiceFramework { -public: - explicit IAppletCommonFunctions(Core::System& system_, std::shared_ptr applet_); - ~IAppletCommonFunctions() override; - -private: - Result SetHomeButtonDoubleClickEnabled(bool home_button_double_click_enabled); - Result GetHomeButtonDoubleClickEnabled(Out out_home_button_double_click_enabled); - Result SetDisplayMagnification(f32 x, f32 y, f32 width, f32 height); - Result SetCpuBoostRequestPriority(s32 priority); - Result GetCurrentApplicationId(Out out_application_id); - Result SetGpuTimeSliceBoost(s64 time_span); - Result Unknown350(Out out_unknown); - - const std::shared_ptr applet; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_accessor.cpp b/src/core/hle/service/am/service/application_accessor.cpp index f357871706..d24c2616dc 100644 --- a/src/core/hle/service/am/service/application_accessor.cpp +++ b/src/core/hle/service/am/service/application_accessor.cpp @@ -18,42 +18,42 @@ namespace Service::AM { +std::optional IApplicationAccessor::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IApplicationAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"}, + FunctionInfo{1, nullptr, "IsCompleted"}, + FunctionInfo{10, D<&IApplicationAccessor::Start>, "Start"}, + FunctionInfo{20, D<&IApplicationAccessor::RequestExit>, "RequestExit"}, + FunctionInfo{25, D<&IApplicationAccessor::Terminate>, "Terminate"}, + FunctionInfo{30, D<&IApplicationAccessor::GetResult>, "GetResult"}, + FunctionInfo{101, D<&IApplicationAccessor::RequestForApplicationToGetForeground>, "RequestForApplicationToGetForeground"}, + FunctionInfo{110, nullptr, "TerminateAllLibraryApplets"}, + FunctionInfo{111, nullptr, "AreAnyLibraryAppletsLeft"}, + FunctionInfo{112, D<&IApplicationAccessor::GetCurrentLibraryApplet>, "GetCurrentLibraryApplet"}, + FunctionInfo{120, nullptr, "GetApplicationId"}, + FunctionInfo{121, D<&IApplicationAccessor::PushLaunchParameter>, "PushLaunchParameter"}, + FunctionInfo{122, D<&IApplicationAccessor::GetApplicationControlProperty>, "GetApplicationControlProperty"}, + FunctionInfo{123, nullptr, "GetApplicationLaunchProperty"}, + FunctionInfo{124, nullptr, "GetApplicationLaunchRequestInfo"}, + FunctionInfo{130, D<&IApplicationAccessor::SetUsers>, "SetUsers"}, + FunctionInfo{131, D<&IApplicationAccessor::CheckRightsEnvironmentAvailable>, "CheckRightsEnvironmentAvailable"}, + FunctionInfo{132, D<&IApplicationAccessor::GetNsRightsEnvironmentHandle>, "GetNsRightsEnvironmentHandle"}, + FunctionInfo{140, nullptr, "GetDesirableUids"}, + FunctionInfo{150, D<&IApplicationAccessor::ReportApplicationExitTimeout>, "ReportApplicationExitTimeout"}, + FunctionInfo{160, nullptr, "SetApplicationAttribute"}, + FunctionInfo{170, nullptr, "HasSaveDataAccessPermission"}, + FunctionInfo{180, nullptr, "PushToFriendInvitationStorageChannel"}, + FunctionInfo{190, nullptr, "PushToNotificationStorageChannel"}, + FunctionInfo{200, nullptr, "RequestApplicationSoftReset"}, + FunctionInfo{201, nullptr, "RestartApplicationTimer"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IApplicationAccessor::IApplicationAccessor(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) : ServiceFramework{system_, "IApplicationAccessor"}, m_window_system(window_system), m_applet(std::move(applet)) { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IApplicationAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"}, - {1, nullptr, "IsCompleted"}, - {10, D<&IApplicationAccessor::Start>, "Start"}, - {20, D<&IApplicationAccessor::RequestExit>, "RequestExit"}, - {25, D<&IApplicationAccessor::Terminate>, "Terminate"}, - {30, D<&IApplicationAccessor::GetResult>, "GetResult"}, - {101, D<&IApplicationAccessor::RequestForApplicationToGetForeground>, "RequestForApplicationToGetForeground"}, - {110, nullptr, "TerminateAllLibraryApplets"}, - {111, nullptr, "AreAnyLibraryAppletsLeft"}, - {112, D<&IApplicationAccessor::GetCurrentLibraryApplet>, "GetCurrentLibraryApplet"}, - {120, nullptr, "GetApplicationId"}, - {121, D<&IApplicationAccessor::PushLaunchParameter>, "PushLaunchParameter"}, - {122, D<&IApplicationAccessor::GetApplicationControlProperty>, "GetApplicationControlProperty"}, - {123, nullptr, "GetApplicationLaunchProperty"}, - {124, nullptr, "GetApplicationLaunchRequestInfo"}, - {130, D<&IApplicationAccessor::SetUsers>, "SetUsers"}, - {131, D<&IApplicationAccessor::CheckRightsEnvironmentAvailable>, "CheckRightsEnvironmentAvailable"}, - {132, D<&IApplicationAccessor::GetNsRightsEnvironmentHandle>, "GetNsRightsEnvironmentHandle"}, - {140, nullptr, "GetDesirableUids"}, - {150, D<&IApplicationAccessor::ReportApplicationExitTimeout>, "ReportApplicationExitTimeout"}, - {160, nullptr, "SetApplicationAttribute"}, - {170, nullptr, "HasSaveDataAccessPermission"}, - {180, nullptr, "PushToFriendInvitationStorageChannel"}, - {190, nullptr, "PushToNotificationStorageChannel"}, - {200, nullptr, "RequestApplicationSoftReset"}, - {201, nullptr, "RestartApplicationTimer"}, - }; - // clang-format on - - RegisterHandlers(functions); } IApplicationAccessor::~IApplicationAccessor() = default; diff --git a/src/core/hle/service/am/service/application_accessor.h b/src/core/hle/service/am/service/application_accessor.h index b9797bcc0a..57b222fc19 100644 --- a/src/core/hle/service/am/service/application_accessor.h +++ b/src/core/hle/service/am/service/application_accessor.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -36,6 +39,7 @@ private: Result GetNsRightsEnvironmentHandle(Out out_handle); Result ReportApplicationExitTimeout(); + std::optional FindRequest(u32 key) override; WindowSystem& m_window_system; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/application_creator.cpp b/src/core/hle/service/am/service/application_creator.cpp index 4eb2f29e22..8d57f917fb 100644 --- a/src/core/hle/service/am/service/application_creator.cpp +++ b/src/core/hle/service/am/service/application_creator.cpp @@ -20,6 +20,16 @@ namespace Service::AM { +std::optional IApplicationCreator::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"}, + FunctionInfo{1, nullptr, "PopLaunchRequestedApplication"}, + FunctionInfo{10, D<&IApplicationCreator::CreateSystemApplication>, "CreateSystemApplication"}, + FunctionInfo{100, nullptr, "PopFloatingApplicationForDevelopment"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + namespace { Result CreateGuestApplication(SharedPointer* out_application_accessor, Core::System& system, WindowSystem& window_system, u64 program_id) { @@ -54,16 +64,6 @@ Result CreateGuestApplication(SharedPointer* out_applicati IApplicationCreator::IApplicationCreator(Core::System& system_, WindowSystem& window_system) : ServiceFramework{system_, "IApplicationCreator"}, m_window_system{window_system} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"}, - {1, nullptr, "PopLaunchRequestedApplication"}, - {10, D<&IApplicationCreator::CreateSystemApplication>, "CreateSystemApplication"}, - {100, nullptr, "PopFloatingApplicationForDevelopment"}, - }; - // clang-format on - - RegisterHandlers(functions); } IApplicationCreator::~IApplicationCreator() = default; diff --git a/src/core/hle/service/am/service/application_creator.h b/src/core/hle/service/am/service/application_creator.h index 75975b9596..64434af542 100644 --- a/src/core/hle/service/am/service/application_creator.h +++ b/src/core/hle/service/am/service/application_creator.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -24,6 +24,7 @@ private: Result CreateApplication(Out>, u64 application_id); Result CreateSystemApplication(Out>, u64 application_id); + std::optional FindRequest(u32 key) override; WindowSystem& m_window_system; }; diff --git a/src/core/hle/service/am/service/application_functions.cpp b/src/core/hle/service/am/service/application_functions.cpp index 90d292c4a2..4fda5eedd6 100644 --- a/src/core/hle/service/am/service/application_functions.cpp +++ b/src/core/hle/service/am/service/application_functions.cpp @@ -51,84 +51,85 @@ FileSys::PatchManager::Metadata GetApplicationMetadata(Core::System& system, u64 } // Anonymous namespace -IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_ptr applet) - : ServiceFramework{system_, "IApplicationFunctions"}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {1, D<&IApplicationFunctions::PopLaunchParameter>, "PopLaunchParameter"}, - {10, nullptr, "CreateApplicationAndPushAndRequestToStart"}, - {11, nullptr, "CreateApplicationAndPushAndRequestToStartForQuest"}, - {12, D<&IApplicationFunctions::CreateApplicationAndRequestToStart>, "CreateApplicationAndRequestToStart"}, - {13, nullptr, "CreateApplicationAndRequestToStartForQuest"}, - {14, nullptr, "CreateApplicationWithAttributeAndPushAndRequestToStartForQuest"}, - {15, nullptr, "CreateApplicationWithAttributeAndRequestToStartForQuest"}, - {20, D<&IApplicationFunctions::EnsureSaveData>, "EnsureSaveData"}, - {21, D<&IApplicationFunctions::GetDesiredLanguage>, "GetDesiredLanguage"}, - {22, D<&IApplicationFunctions::SetTerminateResult>, "SetTerminateResult"}, - {23, D<&IApplicationFunctions::GetDisplayVersion>, "GetDisplayVersion"}, - {24, nullptr, "GetLaunchStorageInfoForDebug"}, - {25, D<&IApplicationFunctions::ExtendSaveData>, "ExtendSaveData"}, - {26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"}, - {27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"}, - {28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"}, - {29, D<&IApplicationFunctions::GetCacheStorageMax>, "GetCacheStorageMax"}, - {30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"}, - {31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"}, - {32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"}, - {33, D<&IApplicationFunctions::EndBlockingHomeButton>, "EndBlockingHomeButton"}, - {34, nullptr, "SelectApplicationLicense"}, - {35, nullptr, "GetDeviceSaveDataSizeMax"}, - {36, nullptr, "GetLimitedApplicationLicense"}, - {37, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, - {40, D<&IApplicationFunctions::NotifyRunning>, "NotifyRunning"}, - {50, D<&IApplicationFunctions::GetPseudoDeviceId>, "GetPseudoDeviceId"}, - {60, D<&IApplicationFunctions::SetMediaPlaybackStateForApplication>, "SetMediaPlaybackStateForApplication"}, - {65, D<&IApplicationFunctions::IsGamePlayRecordingSupported>, "IsGamePlayRecordingSupported"}, - {66, D<&IApplicationFunctions::InitializeGamePlayRecording>, "InitializeGamePlayRecording"}, - {67, D<&IApplicationFunctions::SetGamePlayRecordingState>, "SetGamePlayRecordingState"}, - {68, nullptr, "RequestFlushGamePlayingMovieForDebug"}, - {70, nullptr, "RequestToShutdown"}, - {71, nullptr, "RequestToReboot"}, - {72, nullptr, "RequestToSleep"}, - {80, nullptr, "ExitAndRequestToShowThanksMessage"}, - {90, D<&IApplicationFunctions::EnableApplicationCrashReport>, "EnableApplicationCrashReport"}, - {100, D<&IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer>, "InitializeApplicationCopyrightFrameBuffer"}, - {101, D<&IApplicationFunctions::SetApplicationCopyrightImage>, "SetApplicationCopyrightImage"}, - {102, D<&IApplicationFunctions::SetApplicationCopyrightVisibility>, "SetApplicationCopyrightVisibility"}, - {110, D<&IApplicationFunctions::QueryApplicationPlayStatistics>, "QueryApplicationPlayStatistics"}, - {111, D<&IApplicationFunctions::QueryApplicationPlayStatisticsByUid>, "QueryApplicationPlayStatisticsByUid"}, - {120, D<&IApplicationFunctions::ExecuteProgram>, "ExecuteProgram"}, - {121, D<&IApplicationFunctions::ClearUserChannel>, "ClearUserChannel"}, - {122, D<&IApplicationFunctions::UnpopToUserChannel>, "UnpopToUserChannel"}, - {123, D<&IApplicationFunctions::GetPreviousProgramIndex>, "GetPreviousProgramIndex"}, - {124, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, - {130, D<&IApplicationFunctions::GetGpuErrorDetectedSystemEvent>, "GetGpuErrorDetectedSystemEvent"}, - {131, nullptr, "SetDelayTimeToAbortOnGpuError"}, - {140, D<&IApplicationFunctions::GetFriendInvitationStorageChannelEvent>, "GetFriendInvitationStorageChannelEvent"}, - {141, D<&IApplicationFunctions::TryPopFromFriendInvitationStorageChannel>, "TryPopFromFriendInvitationStorageChannel"}, - {150, D<&IApplicationFunctions::GetNotificationStorageChannelEvent>, "GetNotificationStorageChannelEvent"}, - {151, nullptr, "TryPopFromNotificationStorageChannel"}, - {160, D<&IApplicationFunctions::GetHealthWarningDisappearedSystemEvent>, "GetHealthWarningDisappearedSystemEvent"}, - {170, nullptr, "SetHdcpAuthenticationActivated"}, - {180, nullptr, "GetLaunchRequiredVersion"}, - {181, nullptr, "UpgradeLaunchRequiredVersion"}, - {190, nullptr, "SendServerMaintenanceOverlayNotification"}, - {200, nullptr, "GetLastApplicationExitReason"}, - {210, D<&IApplicationFunctions::GetUnknownEvent210>, "Unknown210"}, - {220, nullptr, "Unknown220"}, // [20.0.0+] - {300, nullptr, "CreateMovieWriter"}, // [19.0.0+] - {310, nullptr, "Unknown310"}, // [20.0.0+] - {320, nullptr, "Unknown320"}, // [20.0.0+] - {330, D<&IApplicationFunctions::Unknown330>, "Unknown330"}, // [20.0.0+] - {500, nullptr, "StartContinuousRecordingFlushForDebug"}, - {1000, nullptr, "CreateMovieMaker"}, - {1001, D<&IApplicationFunctions::PrepareForJit>, "PrepareForJit"}, - }; - // clang-format on - - RegisterHandlers(functions); +std::optional IApplicationFunctions::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, D<&IApplicationFunctions::PopLaunchParameter>, "PopLaunchParameter"}, + FunctionInfo{10, nullptr, "CreateApplicationAndPushAndRequestToStart"}, + FunctionInfo{11, nullptr, "CreateApplicationAndPushAndRequestToStartForQuest"}, + FunctionInfo{12, D<&IApplicationFunctions::CreateApplicationAndRequestToStart>, "CreateApplicationAndRequestToStart"}, + FunctionInfo{13, nullptr, "CreateApplicationAndRequestToStartForQuest"}, + FunctionInfo{14, nullptr, "CreateApplicationWithAttributeAndPushAndRequestToStartForQuest"}, + FunctionInfo{15, nullptr, "CreateApplicationWithAttributeAndRequestToStartForQuest"}, + FunctionInfo{20, D<&IApplicationFunctions::EnsureSaveData>, "EnsureSaveData"}, + FunctionInfo{21, D<&IApplicationFunctions::GetDesiredLanguage>, "GetDesiredLanguage"}, + FunctionInfo{22, D<&IApplicationFunctions::SetTerminateResult>, "SetTerminateResult"}, + FunctionInfo{23, D<&IApplicationFunctions::GetDisplayVersion>, "GetDisplayVersion"}, + FunctionInfo{24, nullptr, "GetLaunchStorageInfoForDebug"}, + FunctionInfo{25, D<&IApplicationFunctions::ExtendSaveData>, "ExtendSaveData"}, + FunctionInfo{26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"}, + FunctionInfo{27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"}, + FunctionInfo{28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"}, + FunctionInfo{29, D<&IApplicationFunctions::GetCacheStorageMax>, "GetCacheStorageMax"}, + FunctionInfo{30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"}, + FunctionInfo{31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"}, + FunctionInfo{32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"}, + FunctionInfo{33, D<&IApplicationFunctions::EndBlockingHomeButton>, "EndBlockingHomeButton"}, + FunctionInfo{34, nullptr, "SelectApplicationLicense"}, + FunctionInfo{35, nullptr, "GetDeviceSaveDataSizeMax"}, + FunctionInfo{36, nullptr, "GetLimitedApplicationLicense"}, + FunctionInfo{37, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, + FunctionInfo{40, D<&IApplicationFunctions::NotifyRunning>, "NotifyRunning"}, + FunctionInfo{50, D<&IApplicationFunctions::GetPseudoDeviceId>, "GetPseudoDeviceId"}, + FunctionInfo{60, D<&IApplicationFunctions::SetMediaPlaybackStateForApplication>, "SetMediaPlaybackStateForApplication"}, + FunctionInfo{65, D<&IApplicationFunctions::IsGamePlayRecordingSupported>, "IsGamePlayRecordingSupported"}, + FunctionInfo{66, D<&IApplicationFunctions::InitializeGamePlayRecording>, "InitializeGamePlayRecording"}, + FunctionInfo{67, D<&IApplicationFunctions::SetGamePlayRecordingState>, "SetGamePlayRecordingState"}, + FunctionInfo{68, nullptr, "RequestFlushGamePlayingMovieForDebug"}, + FunctionInfo{70, nullptr, "RequestToShutdown"}, + FunctionInfo{71, nullptr, "RequestToReboot"}, + FunctionInfo{72, nullptr, "RequestToSleep"}, + FunctionInfo{80, nullptr, "ExitAndRequestToShowThanksMessage"}, + FunctionInfo{90, D<&IApplicationFunctions::EnableApplicationCrashReport>, "EnableApplicationCrashReport"}, + FunctionInfo{100, D<&IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer>, "InitializeApplicationCopyrightFrameBuffer"}, + FunctionInfo{101, D<&IApplicationFunctions::SetApplicationCopyrightImage>, "SetApplicationCopyrightImage"}, + FunctionInfo{102, D<&IApplicationFunctions::SetApplicationCopyrightVisibility>, "SetApplicationCopyrightVisibility"}, + FunctionInfo{110, D<&IApplicationFunctions::QueryApplicationPlayStatistics>, "QueryApplicationPlayStatistics"}, + FunctionInfo{111, D<&IApplicationFunctions::QueryApplicationPlayStatisticsByUid>, "QueryApplicationPlayStatisticsByUid"}, + FunctionInfo{120, D<&IApplicationFunctions::ExecuteProgram>, "ExecuteProgram"}, + FunctionInfo{121, D<&IApplicationFunctions::ClearUserChannel>, "ClearUserChannel"}, + FunctionInfo{122, D<&IApplicationFunctions::UnpopToUserChannel>, "UnpopToUserChannel"}, + FunctionInfo{123, D<&IApplicationFunctions::GetPreviousProgramIndex>, "GetPreviousProgramIndex"}, + FunctionInfo{124, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, + FunctionInfo{130, D<&IApplicationFunctions::GetGpuErrorDetectedSystemEvent>, "GetGpuErrorDetectedSystemEvent"}, + FunctionInfo{131, nullptr, "SetDelayTimeToAbortOnGpuError"}, + FunctionInfo{140, D<&IApplicationFunctions::GetFriendInvitationStorageChannelEvent>, "GetFriendInvitationStorageChannelEvent"}, + FunctionInfo{141, D<&IApplicationFunctions::TryPopFromFriendInvitationStorageChannel>, "TryPopFromFriendInvitationStorageChannel"}, + FunctionInfo{150, D<&IApplicationFunctions::GetNotificationStorageChannelEvent>, "GetNotificationStorageChannelEvent"}, + FunctionInfo{151, nullptr, "TryPopFromNotificationStorageChannel"}, + FunctionInfo{160, D<&IApplicationFunctions::GetHealthWarningDisappearedSystemEvent>, "GetHealthWarningDisappearedSystemEvent"}, + FunctionInfo{170, nullptr, "SetHdcpAuthenticationActivated"}, + FunctionInfo{180, nullptr, "GetLaunchRequiredVersion"}, + FunctionInfo{181, nullptr, "UpgradeLaunchRequiredVersion"}, + FunctionInfo{190, nullptr, "SendServerMaintenanceOverlayNotification"}, + FunctionInfo{200, nullptr, "GetLastApplicationExitReason"}, + FunctionInfo{210, D<&IApplicationFunctions::GetUnknownEvent210>, "Unknown210"}, + FunctionInfo{220, nullptr, "Unknown220"}, // [20.0.0+] + FunctionInfo{300, nullptr, "CreateMovieWriter"}, // [19.0.0+] + FunctionInfo{310, nullptr, "Unknown310"}, // [20.0.0+] + FunctionInfo{320, nullptr, "Unknown320"}, // [20.0.0+] + FunctionInfo{330, D<&IApplicationFunctions::Unknown330>, "Unknown330"}, // [20.0.0+] + FunctionInfo{500, nullptr, "StartContinuousRecordingFlushForDebug"}, + FunctionInfo{1000, nullptr, "CreateMovieMaker"}, + FunctionInfo{1001, D<&IApplicationFunctions::PrepareForJit>, "PrepareForJit"} + ); + return HandlerTableGenerateWithFind(key, functions); } +IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_ptr applet) + : ServiceFramework{system_, "IApplicationFunctions"} + , m_applet{std::move(applet)} +{} + IApplicationFunctions::~IApplicationFunctions() = default; Result IApplicationFunctions::PopLaunchParameter(Out> out_storage, diff --git a/src/core/hle/service/am/service/application_functions.h b/src/core/hle/service/am/service/application_functions.h index b97ed7e25e..7093d13f82 100644 --- a/src/core/hle/service/am/service/application_functions.h +++ b/src/core/hle/service/am/service/application_functions.h @@ -84,6 +84,7 @@ private: Result GetUnknownEvent210(OutCopyHandle out_event); Result Unknown330(Out out); Result PrepareForJit(); + std::optional FindRequest(u32 key) override; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/application_proxy.cpp b/src/core/hle/service/am/service/application_proxy.cpp deleted file mode 100644 index 6e1328fee7..0000000000 --- a/src/core/hle/service/am/service/application_proxy.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/service/applet_common_functions.h" -#include "core/hle/service/am/service/application_functions.h" -#include "core/hle/service/am/service/application_proxy.h" -#include "core/hle/service/am/service/audio_controller.h" -#include "core/hle/service/am/service/common_state_getter.h" -#include "core/hle/service/am/service/debug_functions.h" -#include "core/hle/service/am/service/display_controller.h" -#include "core/hle/service/am/service/library_applet_creator.h" -#include "core/hle/service/am/service/process_winding_controller.h" -#include "core/hle/service/am/service/self_controller.h" -#include "core/hle/service/am/service/window_controller.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::AM { - -IApplicationProxy::IApplicationProxy(Core::System& system_, std::shared_ptr applet, - Kernel::KProcess* process, WindowSystem& window_system) - : ServiceFramework{system_, "IApplicationProxy"}, - m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IApplicationProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, - {1, D<&IApplicationProxy::GetSelfController>, "GetSelfController"}, - {2, D<&IApplicationProxy::GetWindowController>, "GetWindowController"}, - {3, D<&IApplicationProxy::GetAudioController>, "GetAudioController"}, - {4, D<&IApplicationProxy::GetDisplayController>, "GetDisplayController"}, - {10, D<&IApplicationProxy::GetProcessWindingController>, "GetProcessWindingController"}, - {11, D<&IApplicationProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, - {20, D<&IApplicationProxy::GetApplicationFunctions>, "GetApplicationFunctions"}, - {1000, D<&IApplicationProxy::GetDebugFunctions>, "GetDebugFunctions"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IApplicationProxy::~IApplicationProxy() = default; - -Result IApplicationProxy::GetAudioController( - Out> out_audio_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_audio_controller = std::make_shared(system); - R_SUCCEED(); -} - -Result IApplicationProxy::GetDisplayController( - Out> out_display_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_display_controller = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result IApplicationProxy::GetProcessWindingController( - Out> out_process_winding_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_process_winding_controller = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result IApplicationProxy::GetDebugFunctions( - Out> out_debug_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_debug_functions = std::make_shared(system); - R_SUCCEED(); -} - -Result IApplicationProxy::GetWindowController( - Out> out_window_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_window_controller = std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); -} - -Result IApplicationProxy::GetSelfController( - Out> out_self_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_self_controller = std::make_shared(system, m_applet, m_process); - R_SUCCEED(); -} - -Result IApplicationProxy::GetCommonStateGetter( - Out> out_common_state_getter) { - LOG_DEBUG(Service_AM, "called"); - *out_common_state_getter = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result IApplicationProxy::GetLibraryAppletCreator( - Out> out_library_applet_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_creator = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); -} - -Result IApplicationProxy::GetApplicationFunctions( - Out> out_application_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_application_functions = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_proxy.h b/src/core/hle/service/am/service/application_proxy.h deleted file mode 100644 index 8c62459c45..0000000000 --- a/src/core/hle/service/am/service/application_proxy.h +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service::AM { - -struct Applet; -class IAudioController; -class IApplicationFunctions; -class ICommonStateGetter; -class IDebugFunctions; -class IDisplayController; -class ILibraryAppletCreator; -class IProcessWindingController; -class ISelfController; -class IWindowController; -class WindowSystem; - -class IApplicationProxy final : public ServiceFramework { -public: - explicit IApplicationProxy(Core::System& system_, std::shared_ptr applet, - Kernel::KProcess* process, WindowSystem& window_system); - ~IApplicationProxy(); - -private: - Result GetAudioController(Out> out_audio_controller); - Result GetDisplayController(Out> out_display_controller); - Result GetProcessWindingController( - Out> out_process_winding_controller); - Result GetDebugFunctions(Out> out_debug_functions); - Result GetWindowController(Out> out_window_controller); - Result GetSelfController(Out> out_self_controller); - Result GetCommonStateGetter(Out> out_common_state_getter); - Result GetLibraryAppletCreator( - Out> out_library_applet_creator); - Result GetApplicationFunctions( - Out> out_application_functions); - -private: - WindowSystem& m_window_system; - Kernel::KProcess* const m_process; - const std::shared_ptr m_applet; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_proxy_service.cpp b/src/core/hle/service/am/service/application_proxy_service.cpp deleted file mode 100644 index b7d7b3c2d9..0000000000 --- a/src/core/hle/service/am/service/application_proxy_service.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/core.h" -#include "core/hle/service/am/am.h" -#include "core/hle/service/am/applet_manager.h" -#include "core/hle/service/am/service/application_proxy.h" -#include "core/hle/service/am/service/application_proxy_service.h" -#include "core/hle/service/am/window_system.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::AM { - -IApplicationProxyService::IApplicationProxyService(Core::System& system_, - WindowSystem& window_system) - : ServiceFramework{system_, "appletOE"}, m_window_system{window_system} { - static const FunctionInfo functions[] = { - {0, D<&IApplicationProxyService::OpenApplicationProxy>, "OpenApplicationProxy"}, - }; - RegisterHandlers(functions); -} - -IApplicationProxyService::~IApplicationProxyService() = default; - -Result IApplicationProxyService::OpenApplicationProxy( - Out> out_application_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_DEBUG(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid)) { - *out_application_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } -} - -std::shared_ptr IApplicationProxyService::GetAppletFromProcessId(ProcessId process_id) { - return m_window_system.GetByAppletResourceUserId(process_id.pid); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_proxy_service.h b/src/core/hle/service/am/service/application_proxy_service.h deleted file mode 100644 index e5f4ea345b..0000000000 --- a/src/core/hle/service/am/service/application_proxy_service.h +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service { - -namespace AM { - -struct Applet; -class IApplicationProxy; -class WindowSystem; - -class IApplicationProxyService final : public ServiceFramework { -public: - explicit IApplicationProxyService(Core::System& system_, WindowSystem& window_system); - ~IApplicationProxyService() override; - -private: - Result OpenApplicationProxy(Out> out_application_proxy, - ClientProcessId pid, InCopyHandle process_handle); - -private: - std::shared_ptr GetAppletFromProcessId(ProcessId pid); - - WindowSystem& m_window_system; -}; - -} // namespace AM -} // namespace Service diff --git a/src/core/hle/service/am/service/audio_controller.cpp b/src/core/hle/service/am/service/audio_controller.cpp index f627b1df0e..2c8494e056 100644 --- a/src/core/hle/service/am/service/audio_controller.cpp +++ b/src/core/hle/service/am/service/audio_controller.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -9,20 +9,20 @@ namespace Service::AM { +std::optional IAudioController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAudioController::SetExpectedMasterVolume>, "SetExpectedMasterVolume"}, + FunctionInfo{1, D<&IAudioController::GetMainAppletExpectedMasterVolume>, "GetMainAppletExpectedMasterVolume"}, + FunctionInfo{2, D<&IAudioController::GetLibraryAppletExpectedMasterVolume>, "GetLibraryAppletExpectedMasterVolume"}, + FunctionInfo{3, D<&IAudioController::ChangeMainAppletMasterVolume>, "ChangeMainAppletMasterVolume"}, + FunctionInfo{4, D<&IAudioController::SetTransparentVolumeRate>, "SetTransparentVolumeRate"}, + FunctionInfo{5, nullptr, "Unknown5", MakeVersionGate({20,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAudioController::IAudioController(Core::System& system_) : ServiceFramework{system_, "IAudioController"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IAudioController::SetExpectedMasterVolume>, "SetExpectedMasterVolume"}, - {1, D<&IAudioController::GetMainAppletExpectedMasterVolume>, "GetMainAppletExpectedMasterVolume"}, - {2, D<&IAudioController::GetLibraryAppletExpectedMasterVolume>, "GetLibraryAppletExpectedMasterVolume"}, - {3, D<&IAudioController::ChangeMainAppletMasterVolume>, "ChangeMainAppletMasterVolume"}, - {4, D<&IAudioController::SetTransparentVolumeRate>, "SetTransparentVolumeRate"}, - {5, nullptr, "Unknown5"}, //20.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } IAudioController::~IAudioController() = default; diff --git a/src/core/hle/service/am/service/audio_controller.h b/src/core/hle/service/am/service/audio_controller.h index 4b0f3f9aed..9cdb33820d 100644 --- a/src/core/hle/service/am/service/audio_controller.h +++ b/src/core/hle/service/am/service/audio_controller.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -20,6 +23,7 @@ private: Result ChangeMainAppletMasterVolume(f32 volume, s64 fade_time_ns); Result SetTransparentVolumeRate(f32 transparent_volume_rate); + std::optional FindRequest(u32 key) override; static constexpr float MinAllowedVolume = 0.0f; static constexpr float MaxAllowedVolume = 1.0f; diff --git a/src/core/hle/service/am/service/common_state_getter.cpp b/src/core/hle/service/am/service/common_state_getter.cpp index 044929e434..6a6a51f42e 100644 --- a/src/core/hle/service/am/service/common_state_getter.cpp +++ b/src/core/hle/service/am/service/common_state_getter.cpp @@ -8,7 +8,6 @@ #include "core/hle/service/am/am_results.h" #include "core/hle/service/am/applet.h" #include "core/hle/service/am/service/common_state_getter.h" -#include "core/hle/service/am/service/lock_accessor.h" #include "core/hle/service/am/service/storage.h" #include "core/hle/service/apm/apm_interface.h" #include "core/hle/service/cmif_serialization.h" @@ -18,77 +17,147 @@ namespace Service::AM { +std::optional ICommonStateGetter::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ICommonStateGetter::GetEventHandle>, "GetEventHandle"}, + FunctionInfo{1, D<&ICommonStateGetter::ReceiveMessage>, "ReceiveMessage"}, + FunctionInfo{2, nullptr, "GetThisAppletKind"}, + FunctionInfo{3, nullptr, "AllowToEnterSleep"}, + FunctionInfo{4, nullptr, "DisallowToEnterSleep"}, + FunctionInfo{5, D<&ICommonStateGetter::GetOperationMode>, "GetOperationMode"}, + FunctionInfo{6, D<&ICommonStateGetter::GetPerformanceMode>, "GetPerformanceMode"}, + FunctionInfo{7, nullptr, "GetCradleStatus"}, + FunctionInfo{8, D<&ICommonStateGetter::GetBootMode>, "GetBootMode"}, + FunctionInfo{9, D<&ICommonStateGetter::GetCurrentFocusState>, "GetCurrentFocusState"}, + FunctionInfo{10, D<&ICommonStateGetter::RequestToAcquireSleepLock>, "RequestToAcquireSleepLock"}, + FunctionInfo{11, D<&ICommonStateGetter::ReleaseSleepLock>, "ReleaseSleepLock"}, + FunctionInfo{12, D<&ICommonStateGetter::ReleaseSleepLockTransiently>, "ReleaseSleepLockTransiently"}, + FunctionInfo{13, D<&ICommonStateGetter::GetAcquiredSleepLockEvent>, "GetAcquiredSleepLockEvent"}, + FunctionInfo{14, nullptr, "GetWakeupCount", MakeVersionGate({11,0,0})}, + FunctionInfo{15, nullptr, "Unknown15", MakeVersionGate({19,0,0})}, + FunctionInfo{20, D<&ICommonStateGetter::PushToGeneralChannel>, "PushToGeneralChannel"}, + FunctionInfo{30, D<&ICommonStateGetter::GetHomeButtonReaderLockAccessor>, "GetHomeButtonReaderLockAccessor"}, + FunctionInfo{31, D<&ICommonStateGetter::GetReaderLockAccessorEx>, "GetReaderLockAccessorEx", MakeVersionGate({2,0,0})}, + FunctionInfo{32, D<&ICommonStateGetter::GetWriterLockAccessorEx>, "GetWriterLockAccessorEx", MakeVersionGate({7,0,0})}, + FunctionInfo{40, nullptr, "GetCradleFwVersion", MakeVersionGate({2,0,0})}, + FunctionInfo{50, D<&ICommonStateGetter::IsVrModeEnabled>, "IsVrModeEnabled", MakeVersionGate({3,0,0})}, + FunctionInfo{51, D<&ICommonStateGetter::SetVrModeEnabled>, "SetVrModeEnabled", MakeVersionGate({3,0,0})}, + FunctionInfo{52, D<&ICommonStateGetter::SetLcdBacklighOffEnabled>, "SetLcdBacklighOffEnabled", MakeVersionGate({4,0,0})}, + FunctionInfo{53, D<&ICommonStateGetter::BeginVrModeEx>, "BeginVrModeEx", MakeVersionGate({7,0,0})}, + FunctionInfo{54, D<&ICommonStateGetter::EndVrModeEx>, "EndVrModeEx", MakeVersionGate({7,0,0})}, + FunctionInfo{55, D<&ICommonStateGetter::IsInControllerFirmwareUpdateSection>, "IsInControllerFirmwareUpdateSection", MakeVersionGate({3,0,0})}, + FunctionInfo{59, nullptr, "SetVrPositionForDebug", MakeVersionGate({1,0,0})}, + FunctionInfo{60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"}, + FunctionInfo{61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"}, + FunctionInfo{62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"}, + FunctionInfo{63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"}, + FunctionInfo{64, nullptr, "SetTvPowerStateMatchingMode"}, + FunctionInfo{65, nullptr, "GetApplicationIdByContentActionName"}, + FunctionInfo{66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"}, + FunctionInfo{67, nullptr, "CancelCpuBoostMode"}, + FunctionInfo{68, D<&ICommonStateGetter::GetBuiltInDisplayType>, "GetBuiltInDisplayType"}, + FunctionInfo{80, D<&ICommonStateGetter::PerformSystemButtonPressingIfInFocus>, "PerformSystemButtonPressingIfInFocus"}, + FunctionInfo{90, nullptr, "SetPerformanceConfigurationChangedNotification"}, + FunctionInfo{91, nullptr, "GetCurrentPerformanceConfiguration"}, + FunctionInfo{100, D<&ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"}, + FunctionInfo{110, nullptr, "OpenMyGpuErrorHandler"}, + FunctionInfo{120, D<&ICommonStateGetter::GetAppletLaunchedHistory>, "GetAppletLaunchedHistory", MakeVersionGate({13,0,0})}, + FunctionInfo{130, D<&ICommonStateGetter::EnableStartupLogoDisappearedMessage>, "EnableStartupLogoDisappearedMessage", MakeVersionGate({21,0,0})}, + FunctionInfo{200, D<&ICommonStateGetter::GetOperationModeSystemInfo>, "GetOperationModeSystemInfo"}, + FunctionInfo{300, D<&ICommonStateGetter::GetSettingsPlatformRegion>, "GetSettingsPlatformRegion"}, + FunctionInfo{400, nullptr, "ActivateMigrationService"}, + FunctionInfo{401, nullptr, "DeactivateMigrationService"}, + FunctionInfo{500, nullptr, "DisableSleepTillShutdown"}, + FunctionInfo{501, nullptr, "SuppressDisablingSleepTemporarily"}, + FunctionInfo{502, nullptr, "IsSleepEnabled"}, + FunctionInfo{503, nullptr, "IsDisablingSleepSuppressed"}, + FunctionInfo{600, nullptr, "SetHidInputMagnificationForApplication", MakeVersionGate({20,0,0})}, + FunctionInfo{610, D<&ICommonStateGetter::Unknown610>, "Unknown610", MakeVersionGate({21,0,0})}, + FunctionInfo{611, D<&ICommonStateGetter::Unknown611>, "Unknown611", MakeVersionGate({22,0,0})}, + FunctionInfo{900, D<&ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled>, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled", MakeVersionGate({11,0,0})}, + FunctionInfo{910, nullptr, "GetLaunchRequiredTick", MakeVersionGate({17,0,0})}, + FunctionInfo{1000, D<&ICommonStateGetter::BeginVrMode3d>, "BeginVrMode3d", MakeVersionGate({19,0,0})}, + FunctionInfo{1001, D<&ICommonStateGetter::EndVrMode3d>, "EndVrMode3d", MakeVersionGate({19,0,0})}, + FunctionInfo{1002, D<&ICommonStateGetter::IsVrModeEnabled3d>, "IsVrModeEnabled3d", MakeVersionGate({19,0,0})}, + FunctionInfo{1003, D<&ICommonStateGetter::GetVrLaboGoggleViewport>, "GetVrLaboGoggleViewport", MakeVersionGate({21,0,0})}, + FunctionInfo{1004, D<&ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle>, "GetPanelPhysicalSizeForSpecificTitle", MakeVersionGate({21,0,0})}, + FunctionInfo{1005, D<&ICommonStateGetter::GetPanelResolutionForSpecificTitle>, "GetPanelResolutionForSpecificTitle", MakeVersionGate({21,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + +class ILockAccessor final : public ServiceFramework { +public: + explicit ILockAccessor(Core::System& system_) + : ServiceFramework{system_, "ILockAccessor"}, m_context{system_, "ILockAccessor"}, + m_event{m_context} { + m_event.Signal(system.Kernel()); + } + ~ILockAccessor() override = default; + + Result TryLock(Out out_is_locked, OutCopyHandle out_handle, bool return_handle) { + LOG_INFO(Service_AM, "called, return_handle={}", return_handle); + + { + std::scoped_lock lk{m_mutex}; + if (m_is_locked) { + *out_is_locked = false; + } else { + m_is_locked = true; + *out_is_locked = true; + } + } + + if (return_handle) { + *out_handle = m_event.GetHandle(); + } + + R_SUCCEED(); + } + + Result Unlock() { + LOG_INFO(Service_AM, "called"); + + { + std::scoped_lock lk{m_mutex}; + m_is_locked = false; + } + + m_event.Signal(system.Kernel()); + R_SUCCEED(); + } + + Result GetEvent(OutCopyHandle out_handle) { + LOG_INFO(Service_AM, "called"); + *out_handle = m_event.GetHandle(); + R_SUCCEED(); + } + + Result IsLocked(Out out_is_locked) { + LOG_INFO(Service_AM, "called"); + std::scoped_lock lk{m_mutex}; + *out_is_locked = m_is_locked; + R_SUCCEED(); + } + +private: + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, D<&ILockAccessor::TryLock>, "TryLock"}, + FunctionInfo{2, D<&ILockAccessor::Unlock>, "Unlock"}, + FunctionInfo{3, D<&ILockAccessor::GetEvent>, "GetEvent"}, + FunctionInfo{4, D<&ILockAccessor::IsLocked>, "IsLocked"} + ); + KernelHelpers::ServiceContext m_context; + Event m_event; + std::mutex m_mutex{}; + bool m_is_locked{}; +}; + ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr applet) : ServiceFramework{system_, "ICommonStateGetter"}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ICommonStateGetter::GetEventHandle>, "GetEventHandle"}, - {1, D<&ICommonStateGetter::ReceiveMessage>, "ReceiveMessage"}, - {2, nullptr, "GetThisAppletKind"}, - {3, nullptr, "AllowToEnterSleep"}, - {4, nullptr, "DisallowToEnterSleep"}, - {5, D<&ICommonStateGetter::GetOperationMode>, "GetOperationMode"}, - {6, D<&ICommonStateGetter::GetPerformanceMode>, "GetPerformanceMode"}, - {7, nullptr, "GetCradleStatus"}, - {8, D<&ICommonStateGetter::GetBootMode>, "GetBootMode"}, - {9, D<&ICommonStateGetter::GetCurrentFocusState>, "GetCurrentFocusState"}, - {10, D<&ICommonStateGetter::RequestToAcquireSleepLock>, "RequestToAcquireSleepLock"}, - {11, D<&ICommonStateGetter::ReleaseSleepLock>, "ReleaseSleepLock"}, - {12, D<&ICommonStateGetter::ReleaseSleepLockTransiently>, "ReleaseSleepLockTransiently"}, - {13, D<&ICommonStateGetter::GetAcquiredSleepLockEvent>, "GetAcquiredSleepLockEvent"}, - {14, nullptr, "GetWakeupCount"}, //11.0.0+ - {15, nullptr, "Unknown15"}, //19.0.0+ - {20, D<&ICommonStateGetter::PushToGeneralChannel>, "PushToGeneralChannel"}, - {30, D<&ICommonStateGetter::GetHomeButtonReaderLockAccessor>, "GetHomeButtonReaderLockAccessor"}, - {31, D<&ICommonStateGetter::GetReaderLockAccessorEx>, "GetReaderLockAccessorEx"}, //2.0.0+ - {32, D<&ICommonStateGetter::GetWriterLockAccessorEx>, "GetWriterLockAccessorEx"}, //7.0.0+ - {40, nullptr, "GetCradleFwVersion"}, //2.0.0+ - {50, D<&ICommonStateGetter::IsVrModeEnabled>, "IsVrModeEnabled"}, //3.0.0+ - {51, D<&ICommonStateGetter::SetVrModeEnabled>, "SetVrModeEnabled"}, //3.0.0+ - {52, D<&ICommonStateGetter::SetLcdBacklighOffEnabled>, "SetLcdBacklighOffEnabled"}, //4.0.0+ - {53, D<&ICommonStateGetter::BeginVrModeEx>, "BeginVrModeEx"}, //7.0.0+ - {54, D<&ICommonStateGetter::EndVrModeEx>, "EndVrModeEx"}, //7.0.0+ - {55, D<&ICommonStateGetter::IsInControllerFirmwareUpdateSection>, "IsInControllerFirmwareUpdateSection"}, //3.0.0+ - {59, nullptr, "SetVrPositionForDebug"}, //1.0.0+ - {60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"}, - {61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"}, - {62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"}, - {63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"}, - {64, nullptr, "SetTvPowerStateMatchingMode"}, - {65, nullptr, "GetApplicationIdByContentActionName"}, - {66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"}, - {67, nullptr, "CancelCpuBoostMode"}, - {68, D<&ICommonStateGetter::GetBuiltInDisplayType>, "GetBuiltInDisplayType"}, - {80, D<&ICommonStateGetter::PerformSystemButtonPressingIfInFocus>, "PerformSystemButtonPressingIfInFocus"}, - {90, nullptr, "SetPerformanceConfigurationChangedNotification"}, - {91, nullptr, "GetCurrentPerformanceConfiguration"}, - {100, D<&ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"}, - {110, nullptr, "OpenMyGpuErrorHandler"}, - {120, D<&ICommonStateGetter::GetAppletLaunchedHistory>, "GetAppletLaunchedHistory"}, //13.0.0+ - {130, D<&ICommonStateGetter::EnableStartupLogoDisappearedMessage>, "EnableStartupLogoDisappearedMessage"}, //21.0.0+ - {200, D<&ICommonStateGetter::GetOperationModeSystemInfo>, "GetOperationModeSystemInfo"}, - {300, D<&ICommonStateGetter::GetSettingsPlatformRegion>, "GetSettingsPlatformRegion"}, - {400, nullptr, "ActivateMigrationService"}, - {401, nullptr, "DeactivateMigrationService"}, - {500, nullptr, "DisableSleepTillShutdown"}, - {501, nullptr, "SuppressDisablingSleepTemporarily"}, - {502, nullptr, "IsSleepEnabled"}, - {503, nullptr, "IsDisablingSleepSuppressed"}, - {600, nullptr, "SetHidInputMagnificationForApplication"}, //20.0.0+ - {610, D<&ICommonStateGetter::Unknown610>, "Unknown610"}, //21.0.0+ - {611, D<&ICommonStateGetter::Unknown611>, "Unknown611"}, //22.0.0+ - {900, D<&ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled>, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled"}, //11.0.0+ - {910, nullptr, "GetLaunchRequiredTick"}, //17.0.0+ - {1000, D<&ICommonStateGetter::BeginVrMode3d>, "BeginVrMode3d"}, //19.0.0+ - {1001, D<&ICommonStateGetter::EndVrMode3d>, "EndVrMode3d"}, //19.0.0+ - {1002, D<&ICommonStateGetter::IsVrModeEnabled3d>, "IsVrModeEnabled3d"}, //19.0.0+ - {1003, D<&ICommonStateGetter::GetVrLaboGoggleViewport>, "GetVrLaboGoggleViewport"}, //21.0.0+ - {1004, D<&ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle>, "GetPanelPhysicalSizeForSpecificTitle"}, //21.0.0+ - {1005, D<&ICommonStateGetter::GetPanelResolutionForSpecificTitle>, "GetPanelResolutionForSpecificTitle"}, //21.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } ICommonStateGetter::~ICommonStateGetter() = default; diff --git a/src/core/hle/service/am/service/common_state_getter.h b/src/core/hle/service/am/service/common_state_getter.h index da86b5d079..ad782ca48e 100644 --- a/src/core/hle/service/am/service/common_state_getter.h +++ b/src/core/hle/service/am/service/common_state_getter.h @@ -76,6 +76,7 @@ private: void SetCpuBoostMode(HLERequestContext& ctx); + std::optional FindRequest(u32 key) override; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/cradle_firmware_updater.cpp b/src/core/hle/service/am/service/cradle_firmware_updater.cpp index 0a8af0858d..a8097ea209 100644 --- a/src/core/hle/service/am/service/cradle_firmware_updater.cpp +++ b/src/core/hle/service/am/service/cradle_firmware_updater.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -6,22 +9,21 @@ namespace Service::AM { + std::optional ICradleFirmwareUpdater::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ICradleFirmwareUpdater::StartUpdate>, "StartUpdate"}, + FunctionInfo{1, D<&ICradleFirmwareUpdater::FinishUpdate>, "FinishUpdate"}, + FunctionInfo{2, D<&ICradleFirmwareUpdater::GetCradleDeviceInfo>, "GetCradleDeviceInfo"}, + FunctionInfo{3, D<&ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent>, "GetCradleDeviceInfoChangeEvent"}, + FunctionInfo{4, nullptr, "GetUpdateProgressInfo"}, + FunctionInfo{5, nullptr, "GetLastInternalResult"} + ); + return HandlerTableGenerateWithFind(key, functions); + } + ICradleFirmwareUpdater::ICradleFirmwareUpdater(Core::System& system_) : ServiceFramework{system_, "ICradleFirmwareUpdater"}, m_context{system, "ICradleFirmwareUpdater"}, m_cradle_device_info_event{m_context} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ICradleFirmwareUpdater::StartUpdate>, "StartUpdate"}, - {1, D<&ICradleFirmwareUpdater::FinishUpdate>, "FinishUpdate"}, - {2, D<&ICradleFirmwareUpdater::GetCradleDeviceInfo>, "GetCradleDeviceInfo"}, - {3, D<&ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent>, "GetCradleDeviceInfoChangeEvent"}, - {4, nullptr, "GetUpdateProgressInfo"}, - {5, nullptr, "GetLastInternalResult"}, - - }; - // clang-format on - - RegisterHandlers(functions); } ICradleFirmwareUpdater::~ICradleFirmwareUpdater() = default; diff --git a/src/core/hle/service/am/service/cradle_firmware_updater.h b/src/core/hle/service/am/service/cradle_firmware_updater.h index 3e803f0ae9..f8e4b93b27 100644 --- a/src/core/hle/service/am/service/cradle_firmware_updater.h +++ b/src/core/hle/service/am/service/cradle_firmware_updater.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -30,6 +33,7 @@ private: Result GetCradleDeviceInfoChangeEvent(OutCopyHandle out_event); private: + std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext m_context; Event m_cradle_device_info_event; }; diff --git a/src/core/hle/service/am/service/debug_functions.cpp b/src/core/hle/service/am/service/debug_functions.cpp deleted file mode 100644 index fcac4776db..0000000000 --- a/src/core/hle/service/am/service/debug_functions.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/service/debug_functions.h" - -namespace Service::AM { - -IDebugFunctions::IDebugFunctions(Core::System& system_) - : ServiceFramework{system_, "IDebugFunctions"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "NotifyMessageToHomeMenuForDebug"}, - {1, nullptr, "OpenMainApplication"}, - {10, nullptr, "PerformSystemButtonPressing"}, - {20, nullptr, "InvalidateTransitionLayer"}, - {30, nullptr, "RequestLaunchApplicationWithUserAndArgumentForDebug"}, - {31, nullptr, "RequestLaunchApplicationByApplicationLaunchInfoForDebug"}, - {40, nullptr, "GetAppletResourceUsageInfo"}, - {50, nullptr, "AddSystemProgramIdAndAppletIdForDebug"}, - {51, nullptr, "AddOperationConfirmedLibraryAppletIdForDebug"}, - {100, nullptr, "SetCpuBoostModeForApplet"}, - {101, nullptr, "CancelCpuBoostModeForApplet"}, - {110, nullptr, "PushToAppletBoundChannelForDebug"}, - {111, nullptr, "TryPopFromAppletBoundChannelForDebug"}, - {120, nullptr, "AlarmSettingNotificationEnableAppEventReserve"}, - {121, nullptr, "AlarmSettingNotificationDisableAppEventReserve"}, - {122, nullptr, "AlarmSettingNotificationPushAppEventNotify"}, - {130, nullptr, "FriendInvitationSetApplicationParameter"}, - {131, nullptr, "FriendInvitationClearApplicationParameter"}, - {132, nullptr, "FriendInvitationPushApplicationParameter"}, - {140, nullptr, "RestrictPowerOperationForSecureLaunchModeForDebug"}, - {200, nullptr, "CreateFloatingLibraryAppletAccepterForDebug"}, - {300, nullptr, "TerminateAllRunningApplicationsForDebug"}, - {900, nullptr, "GetGrcProcessLaunchedSystemEvent"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IDebugFunctions::~IDebugFunctions() = default; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/debug_functions.h b/src/core/hle/service/am/service/debug_functions.h deleted file mode 100644 index d559687439..0000000000 --- a/src/core/hle/service/am/service/debug_functions.h +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/service.h" - -namespace Service::AM { - -class IDebugFunctions final : public ServiceFramework { -public: - explicit IDebugFunctions(Core::System& system_); - ~IDebugFunctions() override; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/display_controller.cpp b/src/core/hle/service/am/service/display_controller.cpp index 8f87327b17..eb95dd1b86 100644 --- a/src/core/hle/service/am/service/display_controller.cpp +++ b/src/core/hle/service/am/service/display_controller.cpp @@ -12,42 +12,42 @@ namespace Service::AM { +std::optional IDisplayController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetLastForegroundCaptureImage"}, + FunctionInfo{1, nullptr, "UpdateLastForegroundCaptureImage"}, + FunctionInfo{2, nullptr, "GetLastApplicationCaptureImage"}, + FunctionInfo{3, nullptr, "GetCallerAppletCaptureImage"}, + FunctionInfo{4, nullptr, "UpdateCallerAppletCaptureImage"}, + FunctionInfo{5, D<&IDisplayController::GetLastForegroundCaptureImageEx>, "GetLastForegroundCaptureImageEx"}, + FunctionInfo{6, nullptr, "GetLastApplicationCaptureImageEx"}, + FunctionInfo{7, D<&IDisplayController::GetCallerAppletCaptureImageEx>, "GetCallerAppletCaptureImageEx"}, + FunctionInfo{8, D<&IDisplayController::TakeScreenShotOfOwnLayer>, "TakeScreenShotOfOwnLayer"}, + FunctionInfo{9, nullptr, "CopyBetweenCaptureBuffers"}, + FunctionInfo{10, nullptr, "AcquireLastApplicationCaptureBuffer"}, + FunctionInfo{11, nullptr, "ReleaseLastApplicationCaptureBuffer"}, + FunctionInfo{12, nullptr, "AcquireLastForegroundCaptureBuffer"}, + FunctionInfo{13, nullptr, "ReleaseLastForegroundCaptureBuffer"}, + FunctionInfo{14, nullptr, "AcquireCallerAppletCaptureBuffer"}, + FunctionInfo{15, nullptr, "ReleaseCallerAppletCaptureBuffer"}, + FunctionInfo{16, nullptr, "AcquireLastApplicationCaptureBufferEx"}, + FunctionInfo{17, nullptr, "AcquireLastForegroundCaptureBufferEx"}, + FunctionInfo{18, nullptr, "AcquireCallerAppletCaptureBufferEx"}, + FunctionInfo{20, D<&IDisplayController::ClearCaptureBuffer>, "ClearCaptureBuffer"}, + FunctionInfo{21, nullptr, "ClearAppletTransitionBuffer"}, + FunctionInfo{22, D<&IDisplayController::AcquireLastApplicationCaptureSharedBuffer>, "AcquireLastApplicationCaptureSharedBuffer"}, + FunctionInfo{23, D<&IDisplayController::ReleaseLastApplicationCaptureSharedBuffer>, "ReleaseLastApplicationCaptureSharedBuffer"}, + FunctionInfo{24, D<&IDisplayController::AcquireLastForegroundCaptureSharedBuffer>, "AcquireLastForegroundCaptureSharedBuffer"}, + FunctionInfo{25, D<&IDisplayController::ReleaseLastForegroundCaptureSharedBuffer>, "ReleaseLastForegroundCaptureSharedBuffer"}, + FunctionInfo{26, D<&IDisplayController::AcquireCallerAppletCaptureSharedBuffer>, "AcquireCallerAppletCaptureSharedBuffer"}, + FunctionInfo{27, D<&IDisplayController::ReleaseCallerAppletCaptureSharedBuffer>, "ReleaseCallerAppletCaptureSharedBuffer"}, + FunctionInfo{28, nullptr, "TakeScreenShotOfOwnLayerEx"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IDisplayController::IDisplayController(Core::System& system_, std::shared_ptr applet_) : ServiceFramework{system_, "IDisplayController"}, applet(std::move(applet_)) { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetLastForegroundCaptureImage"}, - {1, nullptr, "UpdateLastForegroundCaptureImage"}, - {2, nullptr, "GetLastApplicationCaptureImage"}, - {3, nullptr, "GetCallerAppletCaptureImage"}, - {4, nullptr, "UpdateCallerAppletCaptureImage"}, - {5, D<&IDisplayController::GetLastForegroundCaptureImageEx>, "GetLastForegroundCaptureImageEx"}, - {6, nullptr, "GetLastApplicationCaptureImageEx"}, - {7, D<&IDisplayController::GetCallerAppletCaptureImageEx>, "GetCallerAppletCaptureImageEx"}, - {8, D<&IDisplayController::TakeScreenShotOfOwnLayer>, "TakeScreenShotOfOwnLayer"}, - {9, nullptr, "CopyBetweenCaptureBuffers"}, - {10, nullptr, "AcquireLastApplicationCaptureBuffer"}, - {11, nullptr, "ReleaseLastApplicationCaptureBuffer"}, - {12, nullptr, "AcquireLastForegroundCaptureBuffer"}, - {13, nullptr, "ReleaseLastForegroundCaptureBuffer"}, - {14, nullptr, "AcquireCallerAppletCaptureBuffer"}, - {15, nullptr, "ReleaseCallerAppletCaptureBuffer"}, - {16, nullptr, "AcquireLastApplicationCaptureBufferEx"}, - {17, nullptr, "AcquireLastForegroundCaptureBufferEx"}, - {18, nullptr, "AcquireCallerAppletCaptureBufferEx"}, - {20, D<&IDisplayController::ClearCaptureBuffer>, "ClearCaptureBuffer"}, - {21, nullptr, "ClearAppletTransitionBuffer"}, - {22, D<&IDisplayController::AcquireLastApplicationCaptureSharedBuffer>, "AcquireLastApplicationCaptureSharedBuffer"}, - {23, D<&IDisplayController::ReleaseLastApplicationCaptureSharedBuffer>, "ReleaseLastApplicationCaptureSharedBuffer"}, - {24, D<&IDisplayController::AcquireLastForegroundCaptureSharedBuffer>, "AcquireLastForegroundCaptureSharedBuffer"}, - {25, D<&IDisplayController::ReleaseLastForegroundCaptureSharedBuffer>, "ReleaseLastForegroundCaptureSharedBuffer"}, - {26, D<&IDisplayController::AcquireCallerAppletCaptureSharedBuffer>, "AcquireCallerAppletCaptureSharedBuffer"}, - {27, D<&IDisplayController::ReleaseCallerAppletCaptureSharedBuffer>, "ReleaseCallerAppletCaptureSharedBuffer"}, - {28, nullptr, "TakeScreenShotOfOwnLayerEx"}, - }; - // clang-format on - - RegisterHandlers(functions); } IDisplayController::~IDisplayController() = default; diff --git a/src/core/hle/service/am/service/display_controller.h b/src/core/hle/service/am/service/display_controller.h index 171feace6e..03d29f93c5 100644 --- a/src/core/hle/service/am/service/display_controller.h +++ b/src/core/hle/service/am/service/display_controller.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -35,6 +35,7 @@ private: Out out_fbshare_layer_index); Result ReleaseLastApplicationCaptureSharedBuffer(); + std::optional FindRequest(u32 key) override; const std::shared_ptr applet; }; diff --git a/src/core/hle/service/am/service/global_state_controller.cpp b/src/core/hle/service/am/service/global_state_controller.cpp index 3e3b61b0a0..be080ffcb3 100644 --- a/src/core/hle/service/am/service/global_state_controller.cpp +++ b/src/core/hle/service/am/service/global_state_controller.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,28 +10,28 @@ namespace Service::AM { + std::optional IGlobalStateController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestToEnterSleep"}, + FunctionInfo{1, nullptr, "EnterSleep"}, + FunctionInfo{2, nullptr, "StartSleepSequence"}, + FunctionInfo{3, D<&IGlobalStateController::StartShutdownSequence>, "StartShutdownSequence"}, + FunctionInfo{4, D<&IGlobalStateController::StartRebootSequence>, "StartRebootSequence"}, + FunctionInfo{9, nullptr, "IsAutoPowerDownRequested"}, + FunctionInfo{10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"}, + FunctionInfo{11, nullptr, "NotifyCecSettingsChanged"}, + FunctionInfo{12, nullptr, "SetDefaultHomeButtonLongPressTime"}, + FunctionInfo{13, nullptr, "UpdateDefaultDisplayResolution"}, + FunctionInfo{14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"}, + FunctionInfo{15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"}, + FunctionInfo{30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"} + ); + return HandlerTableGenerateWithFind(key, functions); + } + IGlobalStateController::IGlobalStateController(Core::System& system_) : ServiceFramework{system_, "IGlobalStateController"}, m_context{system_, "IGlobalStateController"}, m_hdcp_authentication_failed_event{m_context} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestToEnterSleep"}, - {1, nullptr, "EnterSleep"}, - {2, nullptr, "StartSleepSequence"}, - {3, D<&IGlobalStateController::StartShutdownSequence>, "StartShutdownSequence"}, - {4, D<&IGlobalStateController::StartRebootSequence>, "StartRebootSequence"}, - {9, nullptr, "IsAutoPowerDownRequested"}, - {10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"}, - {11, nullptr, "NotifyCecSettingsChanged"}, - {12, nullptr, "SetDefaultHomeButtonLongPressTime"}, - {13, nullptr, "UpdateDefaultDisplayResolution"}, - {14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"}, - {15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"}, - {30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"}, - }; - // clang-format on - - RegisterHandlers(functions); } Result IGlobalStateController::StartShutdownSequence() { diff --git a/src/core/hle/service/am/service/global_state_controller.h b/src/core/hle/service/am/service/global_state_controller.h index 83efb57dfc..0de1415295 100644 --- a/src/core/hle/service/am/service/global_state_controller.h +++ b/src/core/hle/service/am/service/global_state_controller.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -23,9 +26,9 @@ private: Result LoadAndApplyIdlePolicySettings(); Result ShouldSleepOnBoot(Out out_should_sleep_on_boot); Result GetHdcpAuthenticationFailedEvent(OutCopyHandle out_event); - Result OpenCradleFirmwareUpdater( - Out> out_cradle_firmware_updater); + Result OpenCradleFirmwareUpdater(Out> out_cradle_firmware_updater); + std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext m_context; Event m_hdcp_authentication_failed_event; }; diff --git a/src/core/hle/service/am/service/home_menu_functions.cpp b/src/core/hle/service/am/service/home_menu_functions.cpp index f9d402ca99..5f61c842a2 100644 --- a/src/core/hle/service/am/service/home_menu_functions.cpp +++ b/src/core/hle/service/am/service/home_menu_functions.cpp @@ -14,31 +14,31 @@ namespace Service::AM { +std::optional IHomeMenuFunctions::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{10, D<&IHomeMenuFunctions::RequestToGetForeground>, "RequestToGetForeground"}, + FunctionInfo{11, D<&IHomeMenuFunctions::LockForeground>, "LockForeground"}, + FunctionInfo{12, D<&IHomeMenuFunctions::UnlockForeground>, "UnlockForeground"}, + FunctionInfo{20, D<&IHomeMenuFunctions::PopFromGeneralChannel>, "PopFromGeneralChannel"}, + FunctionInfo{21, D<&IHomeMenuFunctions::GetPopFromGeneralChannelEvent>, "GetPopFromGeneralChannelEvent"}, + FunctionInfo{30, nullptr, "GetHomeButtonWriterLockAccessor"}, + FunctionInfo{31, nullptr, "GetWriterLockAccessorEx"}, + FunctionInfo{40, D<&IHomeMenuFunctions::IsSleepEnabled>, "IsSleepEnabled"}, + FunctionInfo{41, D<&IHomeMenuFunctions::IsRebootEnabled>, "IsRebootEnabled"}, + FunctionInfo{50, nullptr, "LaunchSystemApplet"}, + FunctionInfo{51, nullptr, "LaunchStarter"}, + FunctionInfo{100, nullptr, "PopRequestLaunchApplicationForDebug"}, + FunctionInfo{110, D<&IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug>, "IsForceTerminateApplicationDisabledForDebug"}, + FunctionInfo{200, nullptr, "LaunchDevMenu"}, + FunctionInfo{1000, nullptr, "SetLastApplicationExitReason"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IHomeMenuFunctions::IHomeMenuFunctions(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) : ServiceFramework{system_, "IHomeMenuFunctions"}, m_window_system{window_system}, m_applet{std::move(applet)}, m_context{system, "IHomeMenuFunctions"} { - // clang-format off - static const FunctionInfo functions[] = { - {10, D<&IHomeMenuFunctions::RequestToGetForeground>, "RequestToGetForeground"}, - {11, D<&IHomeMenuFunctions::LockForeground>, "LockForeground"}, - {12, D<&IHomeMenuFunctions::UnlockForeground>, "UnlockForeground"}, - {20, D<&IHomeMenuFunctions::PopFromGeneralChannel>, "PopFromGeneralChannel"}, - {21, D<&IHomeMenuFunctions::GetPopFromGeneralChannelEvent>, "GetPopFromGeneralChannelEvent"}, - {30, nullptr, "GetHomeButtonWriterLockAccessor"}, - {31, nullptr, "GetWriterLockAccessorEx"}, - {40, D<&IHomeMenuFunctions::IsSleepEnabled>, "IsSleepEnabled"}, - {41, D<&IHomeMenuFunctions::IsRebootEnabled>, "IsRebootEnabled"}, - {50, nullptr, "LaunchSystemApplet"}, - {51, nullptr, "LaunchStarter"}, - {100, nullptr, "PopRequestLaunchApplicationForDebug"}, - {110, D<&IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug>, "IsForceTerminateApplicationDisabledForDebug"}, - {200, nullptr, "LaunchDevMenu"}, - {1000, nullptr, "SetLastApplicationExitReason"}, - }; - // clang-format on - - RegisterHandlers(functions); } IHomeMenuFunctions::~IHomeMenuFunctions() = default; diff --git a/src/core/hle/service/am/service/home_menu_functions.h b/src/core/hle/service/am/service/home_menu_functions.h index 2c3ef54375..25eb9db45e 100644 --- a/src/core/hle/service/am/service/home_menu_functions.h +++ b/src/core/hle/service/am/service/home_menu_functions.h @@ -34,6 +34,7 @@ private: Result IsForceTerminateApplicationDisabledForDebug( Out out_is_force_terminate_application_disabled_for_debug); + std::optional FindRequest(u32 key) override; WindowSystem& m_window_system; const std::shared_ptr m_applet; KernelHelpers::ServiceContext m_context; diff --git a/src/core/hle/service/am/service/library_applet_accessor.cpp b/src/core/hle/service/am/service/library_applet_accessor.cpp index 849e5794cf..c5386fb1a1 100644 --- a/src/core/hle/service/am/service/library_applet_accessor.cpp +++ b/src/core/hle/service/am/service/library_applet_accessor.cpp @@ -17,9 +17,7 @@ namespace Service::AM { -namespace { - -void EnableSingleUserPlay(const std::shared_ptr& impl) { +static void EnableSingleUserPlay(const std::shared_ptr& impl) { constexpr s64 DisplayOptionsOffset = 0x90; constexpr s64 IsSkipEnabledOffset = 1; constexpr s64 ShowSkipButtonOffset = 4; @@ -29,7 +27,7 @@ void EnableSingleUserPlay(const std::shared_ptr& impl) { impl->Write(DisplayOptionsOffset + ShowSkipButtonOffset, &enabled, sizeof(enabled)); } -void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr& impl) { +static void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr& impl) { Frontend::UiReturnArg return_arg{}; impl->Read(0, &return_arg, sizeof(return_arg)); @@ -47,42 +45,40 @@ void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr } } -} // namespace + std::optional ILibraryAppletAccessor::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ILibraryAppletAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"}, + FunctionInfo{1, D<&ILibraryAppletAccessor::IsCompleted>, "IsCompleted"}, + FunctionInfo{10, D<&ILibraryAppletAccessor::Start>, "Start"}, + FunctionInfo{20, D<&ILibraryAppletAccessor::RequestExit>, "RequestExit"}, + FunctionInfo{25, D<&ILibraryAppletAccessor::Terminate>, "Terminate"}, + FunctionInfo{30, D<&ILibraryAppletAccessor::GetResult>, "GetResult"}, + FunctionInfo{50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"}, + FunctionInfo{60, D<&ILibraryAppletAccessor::PresetLibraryAppletGpuTimeSliceZero>, "PresetLibraryAppletGpuTimeSliceZero", MakeVersionGate({10,0,0})}, + FunctionInfo{80, nullptr, "RequestForLibraryAppletToGetForeground", MakeVersionGate({19,0,0})}, + FunctionInfo{81, nullptr, "GetCurrentChildLibraryApplet", MakeVersionGate({19,0,0})}, + FunctionInfo{90, D<&ILibraryAppletAccessor::Unknown90>, "Unknown90", MakeVersionGate({20,0,0})}, + FunctionInfo{100, D<&ILibraryAppletAccessor::PushInData>, "PushInData"}, + FunctionInfo{101, D<&ILibraryAppletAccessor::PopOutData>, "PopOutData"}, + FunctionInfo{102, nullptr, "PushExtraStorage"}, + FunctionInfo{103, D<&ILibraryAppletAccessor::PushInteractiveInData>, "PushInteractiveInData"}, + FunctionInfo{104, D<&ILibraryAppletAccessor::PopInteractiveOutData>, "PopInteractiveOutData"}, + FunctionInfo{105, D<&ILibraryAppletAccessor::GetPopOutDataEvent>, "GetPopOutDataEvent"}, + FunctionInfo{106, D<&ILibraryAppletAccessor::GetPopInteractiveOutDataEvent>, "GetPopInteractiveOutDataEvent"}, + FunctionInfo{110, nullptr, "NeedsToExitProcess"}, + FunctionInfo{120, D<&ILibraryAppletAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"}, + FunctionInfo{150, nullptr, "RequestForAppletToGetForeground"}, + FunctionInfo{160, D<&ILibraryAppletAccessor::GetIndirectLayerConsumerHandle>, "GetIndirectLayerConsumerHandle", MakeVersionGate({2,0,0})}, + FunctionInfo{170, D<&ILibraryAppletAccessor::Unknown170>, "Unknown170", MakeVersionGate({22,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); + } ILibraryAppletAccessor::ILibraryAppletAccessor(Core::System& system_, std::shared_ptr broker, std::shared_ptr applet) : ServiceFramework{system_, "ILibraryAppletAccessor"}, m_broker{std::move(broker)}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ILibraryAppletAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"}, - {1, D<&ILibraryAppletAccessor::IsCompleted>, "IsCompleted"}, - {10, D<&ILibraryAppletAccessor::Start>, "Start"}, - {20, D<&ILibraryAppletAccessor::RequestExit>, "RequestExit"}, - {25, D<&ILibraryAppletAccessor::Terminate>, "Terminate"}, - {30, D<&ILibraryAppletAccessor::GetResult>, "GetResult"}, - {50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"}, - {60, D<&ILibraryAppletAccessor::PresetLibraryAppletGpuTimeSliceZero>, "PresetLibraryAppletGpuTimeSliceZero"}, //10.0.0+ - {80, nullptr, "RequestForLibraryAppletToGetForeground"}, //19.0.0+ - {81, nullptr, "GetCurrentChildLibraryApplet"}, //19.0.0+ - {90, D<&ILibraryAppletAccessor::Unknown90>, "Unknown90"}, //20.0.0+ - {100, D<&ILibraryAppletAccessor::PushInData>, "PushInData"}, - {101, D<&ILibraryAppletAccessor::PopOutData>, "PopOutData"}, - {102, nullptr, "PushExtraStorage"}, - {103, D<&ILibraryAppletAccessor::PushInteractiveInData>, "PushInteractiveInData"}, - {104, D<&ILibraryAppletAccessor::PopInteractiveOutData>, "PopInteractiveOutData"}, - {105, D<&ILibraryAppletAccessor::GetPopOutDataEvent>, "GetPopOutDataEvent"}, - {106, D<&ILibraryAppletAccessor::GetPopInteractiveOutDataEvent>, "GetPopInteractiveOutDataEvent"}, - {110, nullptr, "NeedsToExitProcess"}, - {120, D<&ILibraryAppletAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"}, - {150, nullptr, "RequestForAppletToGetForeground"}, - {160, D<&ILibraryAppletAccessor::GetIndirectLayerConsumerHandle>, "GetIndirectLayerConsumerHandle"}, //2.0.0+ - {170, D<&ILibraryAppletAccessor::Unknown170>, "Unknown170"}, //22.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } ILibraryAppletAccessor::~ILibraryAppletAccessor() = default; diff --git a/src/core/hle/service/am/service/library_applet_accessor.h b/src/core/hle/service/am/service/library_applet_accessor.h index ad40bc76c7..e14ddb3bde 100644 --- a/src/core/hle/service/am/service/library_applet_accessor.h +++ b/src/core/hle/service/am/service/library_applet_accessor.h @@ -6,7 +6,6 @@ #pragma once -#include "core/hle/service/am/service/library_applet_self_accessor.h" #include "core/hle/service/cmif_types.h" #include "core/hle/service/service.h" @@ -16,6 +15,26 @@ class AppletDataBroker; struct Applet; class IStorage; +struct LibraryAppletInfo { + AppletId applet_id; + LibraryAppletMode library_applet_mode; +}; +static_assert(sizeof(LibraryAppletInfo) == 0x8, "LibraryAppletInfo has incorrect size."); + +struct ErrorCode { + u32 category; + u32 number; +}; +static_assert(sizeof(ErrorCode) == 0x8, "ErrorCode has incorrect size."); + +struct ErrorContext { + u8 type; + INSERT_PADDING_BYTES_NOINIT(0x7); + std::array data; + Result result; +}; +static_assert(sizeof(ErrorContext) == 0x200, "ErrorContext has incorrect size."); + class ILibraryAppletAccessor final : public ServiceFramework { public: explicit ILibraryAppletAccessor(Core::System& system_, std::shared_ptr broker, @@ -49,6 +68,7 @@ private: void FrontendExecuteInteractive(); void FrontendRequestExit(); + std::optional FindRequest(u32 key) override; const std::shared_ptr m_broker; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/library_applet_creator.cpp b/src/core/hle/service/am/service/library_applet_creator.cpp deleted file mode 100644 index 4ee92908b5..0000000000 --- a/src/core/hle/service/am/service/library_applet_creator.cpp +++ /dev/null @@ -1,287 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/settings.h" -#include "core/hle/kernel/k_transfer_memory.h" -#include "core/hle/service/am/applet_data_broker.h" -#include "core/hle/service/am/applet_manager.h" -#include "core/hle/service/am/frontend/applets.h" -#include "core/hle/service/am/library_applet_storage.h" -#include "core/hle/service/am/process_creation.h" -#include "core/hle/service/am/service/library_applet_accessor.h" -#include "core/hle/service/am/service/library_applet_creator.h" - -#include "core/hle/api_version.h" -#include "core/hle/service/am/service/storage.h" -#include "core/hle/service/am/window_system.h" -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/sm/sm.h" - -namespace Service::AM { - -namespace { - -bool ShouldCreateGuestApplet(AppletId applet_id) { -#define X(Name, name) \ - if (applet_id == AppletId::Name && \ - Settings::values.name##_applet_mode.GetValue() != Settings::AppletMode::LLE) { \ - return false; \ - } - - X(Cabinet, cabinet) - X(Controller, controller) - X(DataErase, data_erase) - X(Error, error) - X(NetConnect, net_connect) - X(ProfileSelect, player_select) - X(SoftwareKeyboard, swkbd) - X(MiiEdit, mii_edit) - X(Web, web) - X(Shop, shop) - X(PhotoViewer, photo_viewer) - X(OfflineWeb, offline_web) - X(LoginShare, login_share) - X(WebAuth, wifi_web_auth) - X(MyPage, my_page) - -#undef X - - return true; -} - -AppletProgramId AppletIdToProgramId(AppletId applet_id) { - switch (applet_id) { - case AppletId::OverlayDisplay: - return AppletProgramId::OverlayDisplay; - case AppletId::QLaunch: - return AppletProgramId::QLaunch; - case AppletId::Starter: - return AppletProgramId::Starter; - case AppletId::Auth: - return AppletProgramId::Auth; - case AppletId::Cabinet: - return AppletProgramId::Cabinet; - case AppletId::Controller: - return AppletProgramId::Controller; - case AppletId::DataErase: - return AppletProgramId::DataErase; - case AppletId::Error: - return AppletProgramId::Error; - case AppletId::NetConnect: - return AppletProgramId::NetConnect; - case AppletId::ProfileSelect: - return AppletProgramId::ProfileSelect; - case AppletId::SoftwareKeyboard: - return AppletProgramId::SoftwareKeyboard; - case AppletId::MiiEdit: - return AppletProgramId::MiiEdit; - case AppletId::Web: - return AppletProgramId::Web; - case AppletId::Shop: - return AppletProgramId::Shop; - case AppletId::PhotoViewer: - return AppletProgramId::PhotoViewer; - case AppletId::Settings: - return AppletProgramId::Settings; - case AppletId::OfflineWeb: - return AppletProgramId::OfflineWeb; - case AppletId::LoginShare: - return AppletProgramId::LoginShare; - case AppletId::WebAuth: - return AppletProgramId::WebAuth; - case AppletId::MyPage: - return AppletProgramId::MyPage; - default: - return static_cast(0); - } -} - -std::shared_ptr CreateGuestApplet(Core::System& system, - WindowSystem& window_system, - std::shared_ptr caller_applet, - AppletId applet_id, - LibraryAppletMode mode) { - const auto program_id = static_cast(AppletIdToProgramId(applet_id)); - if (program_id == 0) { - // Unknown applet - return {}; - } - - auto process = CreateProcess(system, program_id, 1, HLE::ApiVersion::HOS_VERSION_MAJOR); - if (process) { - const auto applet = std::make_shared(system, std::move(process), false); - applet->program_id = program_id; - applet->applet_id = applet_id; - applet->type = AppletType::LibraryApplet; - applet->library_applet_mode = mode; - applet->window_visible = mode != LibraryAppletMode::AllForegroundInitiallyHidden; - - auto broker = std::make_shared(system); - applet->caller_applet = caller_applet; - applet->caller_applet_broker = broker; - { - std::scoped_lock lk{caller_applet->lock}; - caller_applet->child_applets.push_back(applet); - } - window_system.TrackApplet(applet, false); - return std::make_shared(system, broker, applet); - } - // Couldn't initialize the guest process - return {}; -} - -std::shared_ptr CreateFrontendApplet(Core::System& system, - WindowSystem& window_system, - std::shared_ptr caller_applet, - AppletId applet_id, - LibraryAppletMode mode) { - const auto program_id = static_cast(AppletIdToProgramId(applet_id)); - - auto process = std::make_unique(system); - auto applet = std::make_shared(system, std::move(process), false); - applet->program_id = program_id; - applet->applet_id = applet_id; - applet->type = AppletType::LibraryApplet; - applet->library_applet_mode = mode; - - auto storage = std::make_shared(system); - applet->caller_applet = caller_applet; - applet->caller_applet_broker = storage; - applet->frontend = system.GetFrontendAppletHolder().GetApplet(applet, applet_id, mode); - { - std::scoped_lock lk{caller_applet->lock}; - caller_applet->child_applets.push_back(applet); - } - return std::make_shared(system, storage, applet); -} - -} // namespace - -ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr applet, - WindowSystem& window_system) - : ServiceFramework{system_, "ILibraryAppletCreator"}, - m_window_system{window_system}, m_applet{std::move(applet)} { - static const FunctionInfo functions[] = { - {0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"}, - {1, nullptr, "TerminateAllLibraryApplets"}, - {2, nullptr, "AreAnyLibraryAppletsLeft"}, - {3, D<&ILibraryAppletCreator::CreateLibraryAppletEx>, "CreateLibraryAppletEx"}, - {10, D<&ILibraryAppletCreator::CreateStorage>, "CreateStorage"}, - {11, D<&ILibraryAppletCreator::CreateTransferMemoryStorage>, "CreateTransferMemoryStorage"}, - {12, D<&ILibraryAppletCreator::CreateHandleStorage>, "CreateHandleStorage"}, - }; - RegisterHandlers(functions); -} - -ILibraryAppletCreator::~ILibraryAppletCreator() = default; - -Result ILibraryAppletCreator::CreateLibraryApplet( - Out> out_library_applet_accessor, AppletId applet_id, - LibraryAppletMode library_applet_mode) { - LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={}", applet_id, - library_applet_mode); - - std::shared_ptr library_applet; - if (ShouldCreateGuestApplet(applet_id)) { - library_applet = - CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); - } - if (!library_applet) { - library_applet = - CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); - } - if (!library_applet) { - LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); - R_THROW(ResultUnknown); - } - - // Applet is created, can now be launched. - m_applet->library_applet_launchable_event.Signal(system.Kernel()); - *out_library_applet_accessor = library_applet; - R_SUCCEED(); -} - -Result ILibraryAppletCreator::CreateLibraryAppletEx( - Out> out_library_applet_accessor, AppletId applet_id, - LibraryAppletMode library_applet_mode, u64 thread_id) { - LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={} thread_id={}", applet_id, - library_applet_mode, thread_id); - - std::shared_ptr library_applet; - if (ShouldCreateGuestApplet(applet_id)) { - library_applet = - CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); - } - if (!library_applet) { - library_applet = - CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); - } - if (!library_applet) { - LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); - R_THROW(ResultUnknown); - } - - // Applet is created, can now be launched. - m_applet->library_applet_launchable_event.Signal(system.Kernel()); - *out_library_applet_accessor = library_applet; - R_SUCCEED(); -} - -Result ILibraryAppletCreator::CreateStorage(Out> out_storage, s64 size) { - LOG_DEBUG(Service_AM, "called, size={}", size); - - if (size <= 0) { - LOG_ERROR(Service_AM, "size is less than or equal to 0"); - R_THROW(ResultUnknown); - } - - *out_storage = std::make_shared(system, AM::CreateStorage(std::vector(size))); - R_SUCCEED(); -} - -Result ILibraryAppletCreator::CreateTransferMemoryStorage( - Out> out_storage, bool is_writable, s64 size, - InCopyHandle transfer_memory_handle) { - LOG_DEBUG(Service_AM, "called, is_writable={} size={}", is_writable, size); - - if (size <= 0) { - LOG_ERROR(Service_AM, "size is less than or equal to 0"); - R_THROW(ResultUnknown); - } - - if (!transfer_memory_handle) { - LOG_ERROR(Service_AM, "transfer_memory_handle is null"); - R_THROW(ResultUnknown); - } - - *out_storage = std::make_shared( - system, AM::CreateTransferMemoryStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(), - transfer_memory_handle.Get(), is_writable, size)); - R_SUCCEED(); -} - -Result ILibraryAppletCreator::CreateHandleStorage( - Out> out_storage, s64 size, - InCopyHandle transfer_memory_handle) { - LOG_DEBUG(Service_AM, "called, size={}", size); - - if (size <= 0) { - LOG_ERROR(Service_AM, "size is less than or equal to 0"); - R_THROW(ResultUnknown); - } - - if (!transfer_memory_handle) { - LOG_ERROR(Service_AM, "transfer_memory_handle is null"); - R_THROW(ResultUnknown); - } - - *out_storage = std::make_shared( - system, AM::CreateHandleStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(), - transfer_memory_handle.Get(), size)); - R_SUCCEED(); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_creator.h b/src/core/hle/service/am/service/library_applet_creator.h deleted file mode 100644 index 34e7586e8f..0000000000 --- a/src/core/hle/service/am/service/library_applet_creator.h +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/am/am_types.h" -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service::AM { - -struct Applet; -class ILibraryAppletAccessor; -class IStorage; -class WindowSystem; - -class ILibraryAppletCreator final : public ServiceFramework { -public: - explicit ILibraryAppletCreator(Core::System& system_, std::shared_ptr applet, - WindowSystem& window_system); - ~ILibraryAppletCreator() override; - -private: - Result CreateLibraryApplet( - Out> out_library_applet_accessor, AppletId applet_id, - LibraryAppletMode library_applet_mode); - Result CreateLibraryAppletEx( - Out> out_library_applet_accessor, AppletId applet_id, - LibraryAppletMode library_applet_mode, u64 thread_id); - Result CreateStorage(Out> out_storage, s64 size); - Result CreateTransferMemoryStorage( - Out> out_storage, bool is_writable, s64 size, - InCopyHandle transfer_memory_handle); - Result CreateHandleStorage(Out> out_storage, s64 size, - InCopyHandle transfer_memory_handle); - - WindowSystem& m_window_system; - const std::shared_ptr m_applet; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_proxy.cpp b/src/core/hle/service/am/service/library_applet_proxy.cpp deleted file mode 100644 index f9cfb82a90..0000000000 --- a/src/core/hle/service/am/service/library_applet_proxy.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/service/applet_common_functions.h" -#include "core/hle/service/am/service/audio_controller.h" -#include "core/hle/service/am/service/common_state_getter.h" -#include "core/hle/service/am/service/debug_functions.h" -#include "core/hle/service/am/service/display_controller.h" -#include "core/hle/service/am/service/global_state_controller.h" -#include "core/hle/service/am/service/home_menu_functions.h" -#include "core/hle/service/am/service/library_applet_creator.h" -#include "core/hle/service/am/service/library_applet_proxy.h" -#include "core/hle/service/am/service/library_applet_self_accessor.h" -#include "core/hle/service/am/service/process_winding_controller.h" -#include "core/hle/service/am/service/self_controller.h" -#include "core/hle/service/am/service/window_controller.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::AM { - -ILibraryAppletProxy::ILibraryAppletProxy(Core::System& system_, std::shared_ptr applet, - Kernel::KProcess* process, WindowSystem& window_system) - : ServiceFramework{system_, "ILibraryAppletProxy"}, - m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ILibraryAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, - {1, D<&ILibraryAppletProxy::GetSelfController>, "GetSelfController"}, - {2, D<&ILibraryAppletProxy::GetWindowController>, "GetWindowController"}, - {3, D<&ILibraryAppletProxy::GetAudioController>, "GetAudioController"}, - {4, D<&ILibraryAppletProxy::GetDisplayController>, "GetDisplayController"}, - {10, D<&ILibraryAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, - {11, D<&ILibraryAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, - {20, D<&ILibraryAppletProxy::OpenLibraryAppletSelfAccessor>, "OpenLibraryAppletSelfAccessor"}, - {21, D<&ILibraryAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, - {22, D<&ILibraryAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"}, - {23, D<&ILibraryAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, - {1000, D<&ILibraryAppletProxy::GetDebugFunctions>, "GetDebugFunctions"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -ILibraryAppletProxy::~ILibraryAppletProxy() = default; - -Result ILibraryAppletProxy::GetAudioController( - Out> out_audio_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_audio_controller = std::make_shared(system); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetDisplayController( - Out> out_display_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_display_controller = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetProcessWindingController( - Out> out_process_winding_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_process_winding_controller = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetDebugFunctions( - Out> out_debug_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_debug_functions = std::make_shared(system); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetWindowController( - Out> out_window_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_window_controller = std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetSelfController( - Out> out_self_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_self_controller = std::make_shared(system, m_applet, m_process); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetCommonStateGetter( - Out> out_common_state_getter) { - LOG_DEBUG(Service_AM, "called"); - *out_common_state_getter = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetLibraryAppletCreator( - Out> out_library_applet_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_creator = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::OpenLibraryAppletSelfAccessor( - Out> out_library_applet_self_accessor) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_self_accessor = - std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetAppletCommonFunctions( - Out> out_applet_common_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_applet_common_functions = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetHomeMenuFunctions( - Out> out_home_menu_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_home_menu_functions = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); -} - -Result ILibraryAppletProxy::GetGlobalStateController( - Out> out_global_state_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_global_state_controller = std::make_shared(system); - R_SUCCEED(); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_proxy.h b/src/core/hle/service/am/service/library_applet_proxy.h deleted file mode 100644 index 792d585827..0000000000 --- a/src/core/hle/service/am/service/library_applet_proxy.h +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service::AM { - -struct Applet; -class IAppletCommonFunctions; -class IAudioController; -class ICommonStateGetter; -class IDebugFunctions; -class IDisplayController; -class IHomeMenuFunctions; -class IGlobalStateController; -class ILibraryAppletCreator; -class ILibraryAppletSelfAccessor; -class IProcessWindingController; -class ISelfController; -class IWindowController; -class WindowSystem; - -class ILibraryAppletProxy final : public ServiceFramework { -public: - explicit ILibraryAppletProxy(Core::System& system_, std::shared_ptr applet, - Kernel::KProcess* process, WindowSystem& window_system); - ~ILibraryAppletProxy(); - -private: - Result GetAudioController(Out> out_audio_controller); - Result GetDisplayController(Out> out_display_controller); - Result GetProcessWindingController( - Out> out_process_winding_controller); - Result GetDebugFunctions(Out> out_debug_functions); - Result GetWindowController(Out> out_window_controller); - Result GetSelfController(Out> out_self_controller); - Result GetCommonStateGetter(Out> out_common_state_getter); - Result GetLibraryAppletCreator( - Out> out_library_applet_creator); - Result OpenLibraryAppletSelfAccessor( - Out> out_library_applet_self_accessor); - Result GetAppletCommonFunctions( - Out> out_applet_common_functions); - Result GetHomeMenuFunctions(Out> out_home_menu_functions); - Result GetGlobalStateController( - Out> out_global_state_controller); - - WindowSystem& m_window_system; - Kernel::KProcess* const m_process; - const std::shared_ptr m_applet; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.cpp b/src/core/hle/service/am/service/library_applet_self_accessor.cpp deleted file mode 100644 index 907be49204..0000000000 --- a/src/core/hle/service/am/service/library_applet_self_accessor.cpp +++ /dev/null @@ -1,332 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/core_timing.h" -#include "core/file_sys/control_metadata.h" -#include "core/file_sys/patch_manager.h" -#include "core/file_sys/registered_cache.h" -#include "core/hle/service/acc/profile_manager.h" -#include "core/hle/service/am/applet_data_broker.h" -#include "core/hle/service/am/applet_manager.h" -#include "core/hle/service/am/frontend/applets.h" -#include "core/hle/service/am/service/library_applet_self_accessor.h" -#include "core/hle/service/am/service/storage.h" -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/filesystem/filesystem.h" -#include "core/hle/service/glue/glue_manager.h" -#include "core/hle/service/ns/application_manager_interface.h" -#include "core/hle/service/ns/service_getter_interface.h" -#include "core/hle/service/sm/sm.h" - -namespace Service::AM { - -namespace { - -AppletIdentityInfo GetCallerIdentity(Applet& applet) { - if (const auto caller_applet = applet.caller_applet.lock(); caller_applet) { - // TODO: is this actually the application ID? - return { - .applet_id = caller_applet->applet_id, - .application_id = caller_applet->program_id, - }; - } else { - return { - .applet_id = AppletId::QLaunch, - .application_id = 0x0100000000001000ull, - }; - } -} - -} // namespace - -ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_, - std::shared_ptr applet) - : ServiceFramework{system_, "ILibraryAppletSelfAccessor"}, m_applet{std::move(applet)}, - m_broker{m_applet->caller_applet_broker} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ILibraryAppletSelfAccessor::PopInData>, "PopInData"}, - {1, D<&ILibraryAppletSelfAccessor::PushOutData>, "PushOutData"}, - {2, D<&ILibraryAppletSelfAccessor::PopInteractiveInData>, "PopInteractiveInData"}, - {3, D<&ILibraryAppletSelfAccessor::PushInteractiveOutData>, "PushInteractiveOutData"}, - {5, D<&ILibraryAppletSelfAccessor::GetPopInDataEvent>, "GetPopInDataEvent"}, - {6, D<&ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent>, "GetPopInteractiveInDataEvent"}, - {10, D<&ILibraryAppletSelfAccessor::ExitProcessAndReturn>, "ExitProcessAndReturn"}, - {11, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"}, - {12, D<&ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo>, "GetMainAppletIdentityInfo"}, - {13, D<&ILibraryAppletSelfAccessor::CanUseApplicationCore>, "CanUseApplicationCore"}, - {14, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo>, "GetCallerAppletIdentityInfo"}, - {15, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty>, "GetMainAppletApplicationControlProperty"}, - {16, D<&ILibraryAppletSelfAccessor::GetMainAppletStorageId>, "GetMainAppletStorageId"}, - {17, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack>, "GetCallerAppletIdentityInfoStack"}, - {18, nullptr, "GetNextReturnDestinationAppletIdentityInfo"}, - {19, D<&ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout>, "GetDesirableKeyboardLayout"}, - {20, nullptr, "PopExtraStorage"}, - {25, nullptr, "GetPopExtraStorageEvent"}, - {30, D<&ILibraryAppletSelfAccessor::UnpopInData>, "UnpopInData"}, - {31, nullptr, "UnpopExtraStorage"}, - {40, nullptr, "GetIndirectLayerProducerHandle"}, - {50, D<&ILibraryAppletSelfAccessor::ReportVisibleError>, "ReportVisibleError"}, - {51, D<&ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext>, "ReportVisibleErrorWithErrorContext"}, - {60, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage>, "GetMainAppletApplicationDesiredLanguage"}, - {70, D<&ILibraryAppletSelfAccessor::GetCurrentApplicationId>, "GetCurrentApplicationId"}, - {80, nullptr, "RequestExitToSelf"}, - {90, nullptr, "CreateApplicationAndPushAndRequestToLaunch"}, - {100, nullptr, "CreateGameMovieTrimmer"}, - {101, nullptr, "ReserveResourceForMovieOperation"}, - {102, nullptr, "UnreserveResourceForMovieOperation"}, - {110, D<&ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers>, "GetMainAppletAvailableUsers"}, - {120, nullptr, "GetLaunchStorageInfoForDebug"}, - {130, nullptr, "GetGpuErrorDetectedSystemEvent"}, - {140, nullptr, "SetApplicationMemoryReservation"}, - {150, D<&ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually>, "ShouldSetGpuTimeSliceManually"}, - {160, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx>, "GetLibraryAppletInfoEx"}, - }; - // clang-format on - RegisterHandlers(functions); -} - -ILibraryAppletSelfAccessor::~ILibraryAppletSelfAccessor() = default; - -Result ILibraryAppletSelfAccessor::PopInData(Out> out_storage) { - LOG_INFO(Service_AM, "called"); - R_RETURN(m_broker->GetInData().Pop(system.Kernel(), out_storage)); -} - -Result ILibraryAppletSelfAccessor::PushOutData(SharedPointer storage) { - LOG_INFO(Service_AM, "called"); - m_broker->GetOutData().Push(system.Kernel(), storage); - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::PopInteractiveInData(Out> out_storage) { - LOG_INFO(Service_AM, "called"); - R_RETURN(m_broker->GetInteractiveInData().Pop(system.Kernel(), out_storage)); -} - -Result ILibraryAppletSelfAccessor::PushInteractiveOutData(SharedPointer storage) { - LOG_INFO(Service_AM, "called"); - m_broker->GetInteractiveOutData().Push(system.Kernel(), storage); - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetPopInDataEvent( - OutCopyHandle out_event) { - LOG_INFO(Service_AM, "called"); - *out_event = m_broker->GetInData().GetEvent(); - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent( - OutCopyHandle out_event) { - LOG_INFO(Service_AM, "called"); - *out_event = m_broker->GetInteractiveInData().GetEvent(); - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetLibraryAppletInfo( - Out out_library_applet_info) { - LOG_INFO(Service_AM, "called"); - *out_library_applet_info = { - .applet_id = m_applet->applet_id, - .library_applet_mode = m_applet->library_applet_mode, - }; - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo( - Out out_identity_info) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_identity_info = { - .applet_id = AppletId::QLaunch, - .application_id = 0x0100000000001000ull, - }; - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::CanUseApplicationCore(Out out_can_use_application_core) { - // TODO: This appears to read the NPDM from state and check the core mask of the applet. - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_can_use_application_core = false; - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty( - OutLargeData, BufferAttr_HipcMapAlias> out_nacp) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - - // TODO: this should be the main applet, not the caller applet - const auto application = GetCallerIdentity(*m_applet); - std::vector nacp; - const auto result = - system.GetARPManager().GetControlProperty(&nacp, application.application_id); - - if (R_SUCCEEDED(result)) { - std::memcpy(out_nacp->data(), nacp.data(), (std::min)(nacp.size(), out_nacp->size())); - } - - R_RETURN(result); -} - -Result ILibraryAppletSelfAccessor::GetMainAppletStorageId(Out out_storage_id) { - LOG_INFO(Service_AM, "(STUBBED) called"); - *out_storage_id = FileSys::StorageId::NandUser; - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::ExitProcessAndReturn() { - LOG_INFO(Service_AM, "called"); - - if (const auto caller_applet = m_applet->caller_applet.lock(); caller_applet) { - m_applet->process->Terminate(); - } else { - system.GetUserChannel() = m_applet->user_channel_launch_parameter; - system.ExecuteProgram(0); - } - - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo( - Out out_identity_info) { - LOG_INFO(Service_AM, "called"); - *out_identity_info = GetCallerIdentity(*m_applet); - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack( - Out out_count, OutArray out_identity_info) { - LOG_INFO(Service_AM, "called"); - - std::shared_ptr applet = m_applet; - *out_count = 0; - - do { - if (*out_count >= static_cast(out_identity_info.size())) { - break; - } - out_identity_info[(*out_count)++] = GetCallerIdentity(*applet); - } while ((applet = applet->caller_applet.lock())); - - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout(Out out_desirable_layout) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_desirable_layout = 0; - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::ReportVisibleError(ErrorCode error_code) { - LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category, - error_code.number); - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext( - ErrorCode error_code, InLargeData error_context) { - LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category, - error_code.number); - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::UnpopInData(SharedPointer storage) { - LOG_INFO(Service_AM, "called"); - m_broker->GetInData().Unpop(system.Kernel(), storage); - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage( - Out out_desired_language) { - // FIXME: this is copied from IApplicationFunctions::GetDesiredLanguage - // FIXME: all of this stuff belongs to ns - auto identity = GetCallerIdentity(*m_applet); - - // TODO(bunnei): This should be configurable - LOG_DEBUG(Service_AM, "called"); - - // Get supported languages from NACP, if possible - // Default to 0 (all languages supported) - u32 supported_languages = 0; - - const auto res = FileSys::PatchManager::GetMetadataFromBaseOrUpdate(system, identity.application_id); - - if (res.first != nullptr) { - supported_languages = res.first->GetSupportedLanguages(); - } - - // Call IApplicationManagerInterface implementation. - auto& service_manager = system.ServiceManager(); - auto ns_am2 = service_manager.GetService("ns:am2"); - - std::shared_ptr app_man; - R_TRY(ns_am2->GetApplicationManagerInterface(&app_man)); - - // Get desired application language - NS::ApplicationLanguage desired_language{}; - R_TRY(app_man->GetApplicationDesiredLanguage(&desired_language, supported_languages)); - - // Convert to settings language code. - u64 language_code{}; - R_TRY(app_man->ConvertApplicationLanguageToLanguageCode(&language_code, desired_language)); - - LOG_DEBUG(Service_AM, "got desired_language={:016X}", language_code); - - *out_desired_language = language_code; - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetCurrentApplicationId(Out out_application_id) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - - // TODO: this should be the main applet, not the caller applet - const auto main_applet = GetCallerIdentity(*m_applet); - *out_application_id = main_applet.application_id; - - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers( - Out out_can_select_any_user, Out out_users_count, - OutArray out_users) { - const Service::Account::ProfileManager manager{}; - - *out_can_select_any_user = false; - *out_users_count = -1; - - LOG_INFO(Service_AM, "called"); - - if (manager.GetUserCount() > 0) { - *out_can_select_any_user = true; - *out_users_count = static_cast(manager.GetUserCount()); - - const auto users = manager.GetAllUsers(); - for (size_t i = 0; i < users.size() && i < out_users.size(); i++) { - out_users[i] = users[i]; - } - } - - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually( - Out out_should_set_gpu_time_slice_manually) { - LOG_INFO(Service_AM, "(STUBBED) called"); - *out_should_set_gpu_time_slice_manually = false; - R_SUCCEED(); -} - -Result ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx( - Out out_library_applet_info) { - LOG_INFO(Service_AM, "called"); - *out_library_applet_info = { - .applet_id = m_applet->applet_id, - .library_applet_mode = m_applet->library_applet_mode, - }; - R_SUCCEED(); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.h b/src/core/hle/service/am/service/library_applet_self_accessor.h deleted file mode 100644 index d287f6b403..0000000000 --- a/src/core/hle/service/am/service/library_applet_self_accessor.h +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/uuid.h" -#include "core/hle/service/am/am_types.h" -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace FileSys { -enum class StorageId : u8; -} - -namespace Kernel { -class KReadableEvent; -} - -namespace Service::AM { - -class AppletDataBroker; -struct Applet; -class IStorage; - -struct LibraryAppletInfo { - AppletId applet_id; - LibraryAppletMode library_applet_mode; -}; -static_assert(sizeof(LibraryAppletInfo) == 0x8, "LibraryAppletInfo has incorrect size."); - -struct ErrorCode { - u32 category; - u32 number; -}; -static_assert(sizeof(ErrorCode) == 0x8, "ErrorCode has incorrect size."); - -struct ErrorContext { - u8 type; - INSERT_PADDING_BYTES_NOINIT(0x7); - std::array data; - Result result; -}; -static_assert(sizeof(ErrorContext) == 0x200, "ErrorContext has incorrect size."); - -class ILibraryAppletSelfAccessor final : public ServiceFramework { -public: - explicit ILibraryAppletSelfAccessor(Core::System& system_, std::shared_ptr applet); - ~ILibraryAppletSelfAccessor() override; - -private: - Result PopInData(Out> out_storage); - Result PushOutData(SharedPointer storage); - Result PopInteractiveInData(Out> out_storage); - Result PushInteractiveOutData(SharedPointer storage); - Result GetPopInDataEvent(OutCopyHandle out_event); - Result GetPopInteractiveInDataEvent(OutCopyHandle out_event); - Result GetLibraryAppletInfo(Out out_library_applet_info); - Result GetMainAppletIdentityInfo(Out out_identity_info); - Result CanUseApplicationCore(Out out_can_use_application_core); - Result GetMainAppletApplicationControlProperty( - OutLargeData, BufferAttr_HipcMapAlias> out_nacp); - Result GetMainAppletStorageId(Out out_storage_id); - Result ExitProcessAndReturn(); - Result GetCallerAppletIdentityInfo(Out out_identity_info); - Result GetCallerAppletIdentityInfoStack( - Out out_count, - OutArray out_identity_info); - Result GetDesirableKeyboardLayout(Out out_desirable_layout); - Result ReportVisibleError(ErrorCode error_code); - Result ReportVisibleErrorWithErrorContext( - ErrorCode error_code, InLargeData error_context); - Result UnpopInData(SharedPointer storage); - Result GetMainAppletApplicationDesiredLanguage(Out out_desired_language); - Result GetCurrentApplicationId(Out out_application_id); - Result GetMainAppletAvailableUsers(Out out_can_select_any_user, Out out_users_count, - OutArray out_users); - Result ShouldSetGpuTimeSliceManually(Out out_should_set_gpu_time_slice_manually); - Result GetLibraryAppletInfoEx(Out out_library_applet_info); - - const std::shared_ptr m_applet; - const std::shared_ptr m_broker; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/lock_accessor.cpp b/src/core/hle/service/am/service/lock_accessor.cpp deleted file mode 100644 index 0341254449..0000000000 --- a/src/core/hle/service/am/service/lock_accessor.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/service/lock_accessor.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::AM { - -ILockAccessor::ILockAccessor(Core::System& system_) - : ServiceFramework{system_, "ILockAccessor"}, m_context{system_, "ILockAccessor"}, - m_event{m_context} { - // clang-format off - static const FunctionInfo functions[] = { - {1, D<&ILockAccessor::TryLock>, "TryLock"}, - {2, D<&ILockAccessor::Unlock>, "Unlock"}, - {3, D<&ILockAccessor::GetEvent>, "GetEvent"}, - {4, D<&ILockAccessor::IsLocked>, "IsLocked"}, - }; - // clang-format on - - RegisterHandlers(functions); - - m_event.Signal(system.Kernel()); -} - -ILockAccessor::~ILockAccessor() = default; - -Result ILockAccessor::TryLock(Out out_is_locked, - OutCopyHandle out_handle, - bool return_handle) { - LOG_INFO(Service_AM, "called, return_handle={}", return_handle); - - { - std::scoped_lock lk{m_mutex}; - if (m_is_locked) { - *out_is_locked = false; - } else { - m_is_locked = true; - *out_is_locked = true; - } - } - - if (return_handle) { - *out_handle = m_event.GetHandle(); - } - - R_SUCCEED(); -} - -Result ILockAccessor::Unlock() { - LOG_INFO(Service_AM, "called"); - - { - std::scoped_lock lk{m_mutex}; - m_is_locked = false; - } - - m_event.Signal(system.Kernel()); - R_SUCCEED(); -} - -Result ILockAccessor::GetEvent(OutCopyHandle out_handle) { - LOG_INFO(Service_AM, "called"); - *out_handle = m_event.GetHandle(); - R_SUCCEED(); -} - -Result ILockAccessor::IsLocked(Out out_is_locked) { - LOG_INFO(Service_AM, "called"); - std::scoped_lock lk{m_mutex}; - *out_is_locked = m_is_locked; - R_SUCCEED(); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/lock_accessor.h b/src/core/hle/service/am/service/lock_accessor.h deleted file mode 100644 index 9bfb5c0502..0000000000 --- a/src/core/hle/service/am/service/lock_accessor.h +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/kernel_helpers.h" -#include "core/hle/service/os/event.h" -#include "core/hle/service/service.h" - -namespace Service::AM { - -class ILockAccessor final : public ServiceFramework { -public: - explicit ILockAccessor(Core::System& system_); - ~ILockAccessor() override; - -private: - Result TryLock(Out out_is_locked, OutCopyHandle out_handle, - bool return_handle); - Result Unlock(); - Result GetEvent(OutCopyHandle out_handle); - Result IsLocked(Out out_is_locked); - -private: - KernelHelpers::ServiceContext m_context; - Event m_event; - std::mutex m_mutex{}; - bool m_is_locked{}; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/overlay_applet_proxy.cpp b/src/core/hle/service/am/service/overlay_applet_proxy.cpp deleted file mode 100644 index 5e140fe031..0000000000 --- a/src/core/hle/service/am/service/overlay_applet_proxy.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "core/hle/service/am/service/common_state_getter.h" -#include "core/hle/service/am/service/display_controller.h" -#include "core/hle/service/am/service/global_state_controller.h" -#include "core/hle/service/am/service/audio_controller.h" -#include "core/hle/service/am/service/applet_common_functions.h" -#include "core/hle/service/am/service/overlay_applet_proxy.h" -#include "core/hle/service/am/service/library_applet_creator.h" -#include "core/hle/service/am/service/process_winding_controller.h" -#include "core/hle/service/am/service/self_controller.h" -#include "core/hle/service/am/service/window_controller.h" -#include "core/hle/service/am/service/debug_functions.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::AM { - IOverlayAppletProxy::IOverlayAppletProxy(Core::System &system_, std::shared_ptr applet, - Kernel::KProcess *process, WindowSystem &window_system) - : ServiceFramework{system_, "IOverlayAppletProxy"}, - m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IOverlayAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, - {1, D<&IOverlayAppletProxy::GetSelfController>, "GetSelfController"}, - {2, D<&IOverlayAppletProxy::GetWindowController>, "GetWindowController"}, - {3, D<&IOverlayAppletProxy::GetAudioController>, "GetAudioController"}, - {4, D<&IOverlayAppletProxy::GetDisplayController>, "GetDisplayController"}, - {10, D<&IOverlayAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, - {11, D<&IOverlayAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, - {20, D<&IOverlayAppletProxy::GetOverlayFunctions>, "GetOverlayFunctions"}, - {21, D<&IOverlayAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, - {23, D<&IOverlayAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, - {1000, D<&IOverlayAppletProxy::GetDebugFunctions>, "GetDebugFunctions"}, - }; - // clang-format on - - RegisterHandlers(functions); - } - - IOverlayAppletProxy::~IOverlayAppletProxy() = default; - - Result IOverlayAppletProxy::GetCommonStateGetter( - Out > out_common_state_getter) { - LOG_DEBUG(Service_AM, "called"); - *out_common_state_getter = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetSelfController( - Out > out_self_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_self_controller = std::make_shared(system, m_applet, m_process); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetWindowController( - Out > out_window_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_window_controller = std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetAudioController( - Out > out_audio_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_audio_controller = std::make_shared(system); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetDisplayController( - Out > out_display_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_display_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetProcessWindingController( - Out > out_process_winding_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_process_winding_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetLibraryAppletCreator( - Out > out_library_applet_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_creator = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetOverlayFunctions( - Out > out_overlay_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_overlay_functions = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetAppletCommonFunctions( - Out > out_applet_common_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_applet_common_functions = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetGlobalStateController( - Out > out_global_state_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_global_state_controller = std::make_shared(system); - R_SUCCEED(); - } - - Result IOverlayAppletProxy::GetDebugFunctions( - Out > out_debug_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_debug_functions = std::make_shared(system); - R_SUCCEED(); - } -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/overlay_applet_proxy.h b/src/core/hle/service/am/service/overlay_applet_proxy.h deleted file mode 100644 index 2c7fa57dfd..0000000000 --- a/src/core/hle/service/am/service/overlay_applet_proxy.h +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" -#include "core/hle/service/am/service/overlay_functions.h" - -namespace Service::AM { - -struct Applet; -class IAppletCommonFunctions; -class IAudioController; -class ICommonStateGetter; -class IDebugFunctions; -class IDisplayController; -class IHomeMenuFunctions; -class IGlobalStateController; -class ILibraryAppletCreator; -class ILibraryAppletSelfAccessor; -class IProcessWindingController; -class ISelfController; -class IWindowController; -class WindowSystem; - -class IOverlayAppletProxy final : public ServiceFramework { -public: - explicit IOverlayAppletProxy(Core::System& system_, std::shared_ptr applet, - Kernel::KProcess* process, WindowSystem& window_system); - ~IOverlayAppletProxy(); - -private: - Result GetCommonStateGetter(Out> out_common_state_getter); - Result GetSelfController(Out> out_self_controller); - Result GetWindowController(Out> out_window_controller); - Result GetAudioController(Out> out_audio_controller); - Result GetDisplayController(Out> out_display_controller); - Result GetProcessWindingController( - Out> out_process_winding_controller); - Result GetLibraryAppletCreator( - Out> out_library_applet_creator); - Result GetOverlayFunctions(Out> out_overlay_functions); - Result GetAppletCommonFunctions( - Out> out_applet_common_functions); - Result GetGlobalStateController( - Out> out_global_state_controller); - Result GetDebugFunctions(Out> out_debug_functions); - - WindowSystem& m_window_system; - Kernel::KProcess* const m_process; - const std::shared_ptr m_applet; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/overlay_functions.cpp b/src/core/hle/service/am/service/overlay_functions.cpp index 8150b5dd07..006610bd47 100644 --- a/src/core/hle/service/am/service/overlay_functions.cpp +++ b/src/core/hle/service/am/service/overlay_functions.cpp @@ -8,34 +8,34 @@ #include "core/hle/service/am/window_system.h" namespace Service::AM { + std::optional IOverlayFunctions::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IOverlayFunctions::BeginToWatchShortHomeButtonMessage>, "BeginToWatchShortHomeButtonMessage"}, + FunctionInfo{1, D<&IOverlayFunctions::EndToWatchShortHomeButtonMessage>, "EndToWatchShortHomeButtonMessage"}, + FunctionInfo{2, D<&IOverlayFunctions::GetApplicationIdForLogo>, "GetApplicationIdForLogo"}, + FunctionInfo{3, nullptr, "SetGpuTimeSliceBoost"}, + FunctionInfo{4, D<&IOverlayFunctions::SetAutoSleepTimeAndDimmingTimeEnabled>, "SetAutoSleepTimeAndDimmingTimeEnabled"}, + FunctionInfo{5, nullptr, "TerminateApplicationAndSetReason"}, + FunctionInfo{6, nullptr, "SetScreenShotPermissionGlobally"}, + FunctionInfo{10, nullptr, "StartShutdownSequenceForOverlay"}, + FunctionInfo{11, nullptr, "StartRebootSequenceForOverlay"}, + FunctionInfo{20, D<&IOverlayFunctions::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"}, + FunctionInfo{21, D<&IOverlayFunctions::SetHandlingTouchScreenInputEnabled>, "SetHandlingTouchScreenInputEnabled"}, + FunctionInfo{30, nullptr, "SetHealthWarningShowingState"}, + FunctionInfo{31, D<&IOverlayFunctions::IsHealthWarningRequired>, "IsHealthWarningRequired"}, + FunctionInfo{40, nullptr, "GetApplicationNintendoLogo"}, + FunctionInfo{41, nullptr, "GetApplicationStartupMovie"}, + FunctionInfo{50, nullptr, "SetGpuTimeSliceBoostForApplication"}, + FunctionInfo{60, nullptr, "Unknown60"}, + FunctionInfo{70, D<&IOverlayFunctions::Unknown70>, "Unknown70"}, + FunctionInfo{90, nullptr, "SetRequiresGpuResourceUse"}, + FunctionInfo{101, nullptr, "BeginToObserveHidInputForDevelop"} + ); + return HandlerTableGenerateWithFind(key, functions); + } + IOverlayFunctions::IOverlayFunctions(Core::System &system_, std::shared_ptr applet) : ServiceFramework{system_, "IOverlayFunctions"}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IOverlayFunctions::BeginToWatchShortHomeButtonMessage>, "BeginToWatchShortHomeButtonMessage"}, - {1, D<&IOverlayFunctions::EndToWatchShortHomeButtonMessage>, "EndToWatchShortHomeButtonMessage"}, - {2, D<&IOverlayFunctions::GetApplicationIdForLogo>, "GetApplicationIdForLogo"}, - {3, nullptr, "SetGpuTimeSliceBoost"}, - {4, D<&IOverlayFunctions::SetAutoSleepTimeAndDimmingTimeEnabled>, "SetAutoSleepTimeAndDimmingTimeEnabled"}, - {5, nullptr, "TerminateApplicationAndSetReason"}, - {6, nullptr, "SetScreenShotPermissionGlobally"}, - {10, nullptr, "StartShutdownSequenceForOverlay"}, - {11, nullptr, "StartRebootSequenceForOverlay"}, - {20, D<&IOverlayFunctions::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"}, - {21, D<&IOverlayFunctions::SetHandlingTouchScreenInputEnabled>, "SetHandlingTouchScreenInputEnabled"}, - {30, nullptr, "SetHealthWarningShowingState"}, - {31, D<&IOverlayFunctions::IsHealthWarningRequired>, "IsHealthWarningRequired"}, - {40, nullptr, "GetApplicationNintendoLogo"}, - {41, nullptr, "GetApplicationStartupMovie"}, - {50, nullptr, "SetGpuTimeSliceBoostForApplication"}, - {60, nullptr, "Unknown60"}, - {70, D<&IOverlayFunctions::Unknown70>, "Unknown70"}, - {90, nullptr, "SetRequiresGpuResourceUse"}, - {101, nullptr, "BeginToObserveHidInputForDevelop"}, - }; - // clang-format on - - RegisterHandlers(functions); } IOverlayFunctions::~IOverlayFunctions() = default; diff --git a/src/core/hle/service/am/service/overlay_functions.h b/src/core/hle/service/am/service/overlay_functions.h index eefd8d862b..b94f0cc0d5 100644 --- a/src/core/hle/service/am/service/overlay_functions.h +++ b/src/core/hle/service/am/service/overlay_functions.h @@ -6,24 +6,25 @@ #include "core/hle/service/service.h" namespace Service::AM { - struct Applet; +struct Applet; - class IOverlayFunctions final : public ServiceFramework { - public: - explicit IOverlayFunctions(Core::System &system_, std::shared_ptr applet); - ~IOverlayFunctions() override; +class IOverlayFunctions final : public ServiceFramework { +public: + explicit IOverlayFunctions(Core::System &system_, std::shared_ptr applet); + ~IOverlayFunctions() override; - private: - Result BeginToWatchShortHomeButtonMessage(); - Result EndToWatchShortHomeButtonMessage(); - Result GetApplicationIdForLogo(Out out_application_id); - Result SetAutoSleepTimeAndDimmingTimeEnabled(bool enabled); - Result IsHealthWarningRequired(Out is_required); - Result SetHandlingHomeButtonShortPressedEnabled(bool enabled); - Result SetHandlingTouchScreenInputEnabled(bool enabled); - Result Unknown70(); +private: + Result BeginToWatchShortHomeButtonMessage(); + Result EndToWatchShortHomeButtonMessage(); + Result GetApplicationIdForLogo(Out out_application_id); + Result SetAutoSleepTimeAndDimmingTimeEnabled(bool enabled); + Result IsHealthWarningRequired(Out is_required); + Result SetHandlingHomeButtonShortPressedEnabled(bool enabled); + Result SetHandlingTouchScreenInputEnabled(bool enabled); + Result Unknown70(); - private: - const std::shared_ptr m_applet; - }; +private: + std::optional FindRequest(u32 key) override; + const std::shared_ptr m_applet; +}; } // namespace Service::AM diff --git a/src/core/hle/service/am/service/process_winding_controller.cpp b/src/core/hle/service/am/service/process_winding_controller.cpp index e284aa2d89..159f4dfd5c 100644 --- a/src/core/hle/service/am/service/process_winding_controller.cpp +++ b/src/core/hle/service/am/service/process_winding_controller.cpp @@ -13,23 +13,23 @@ namespace Service::AM { + std::optional IProcessWindingController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"}, + FunctionInfo{11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"}, + FunctionInfo{21, D<&IProcessWindingController::PushContext>, "PushContext"}, + FunctionInfo{22, D<&IProcessWindingController::PopContext>, "PopContext"}, + FunctionInfo{23, D<&IProcessWindingController::CancelWindingReservation>, "CancelWindingReservation"}, + FunctionInfo{30, D<&IProcessWindingController::WindAndDoReserved>, "WindAndDoReserved"}, + FunctionInfo{40, D<&IProcessWindingController::ReserveToStartAndWaitAndUnwindThis>, "ReserveToStartAndWaitAndUnwindThis"}, + FunctionInfo{41, D<&IProcessWindingController::ReserveToStartAndWait>, "ReserveToStartAndWait"} + ); + return HandlerTableGenerateWithFind(key, functions); + } + IProcessWindingController::IProcessWindingController(Core::System& system_, std::shared_ptr applet) : ServiceFramework{system_, "IProcessWindingController"}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"}, - {11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"}, - {21, D<&IProcessWindingController::PushContext>, "PushContext"}, - {22, D<&IProcessWindingController::PopContext>, "PopContext"}, - {23, D<&IProcessWindingController::CancelWindingReservation>, "CancelWindingReservation"}, - {30, D<&IProcessWindingController::WindAndDoReserved>, "WindAndDoReserved"}, - {40, D<&IProcessWindingController::ReserveToStartAndWaitAndUnwindThis>, "ReserveToStartAndWaitAndUnwindThis"}, - {41, D<&IProcessWindingController::ReserveToStartAndWait>, "ReserveToStartAndWait"}, - }; - // clang-format on - - RegisterHandlers(functions); } IProcessWindingController::~IProcessWindingController() = default; diff --git a/src/core/hle/service/am/service/process_winding_controller.h b/src/core/hle/service/am/service/process_winding_controller.h index f3417bcd97..91b29ac04b 100644 --- a/src/core/hle/service/am/service/process_winding_controller.h +++ b/src/core/hle/service/am/service/process_winding_controller.h @@ -33,6 +33,7 @@ private: SharedPointer reserved_applet_accessor); Result ReserveToStartAndWait(SharedPointer reserved_applet_accessor); + std::optional FindRequest(u32 key) override; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/self_controller.cpp b/src/core/hle/service/am/service/self_controller.cpp index 3a654b9daa..ce8a308d6a 100644 --- a/src/core/hle/service/am/service/self_controller.cpp +++ b/src/core/hle/service/am/service/self_controller.cpp @@ -17,67 +17,66 @@ namespace Service::AM { + std::optional ISelfController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ISelfController::Exit>, "Exit"}, + FunctionInfo{1, D<&ISelfController::LockExit>, "LockExit"}, + FunctionInfo{2, D<&ISelfController::UnlockExit>, "UnlockExit"}, + FunctionInfo{3, D<&ISelfController::EnterFatalSection>, "EnterFatalSection"}, + FunctionInfo{4, D<&ISelfController::LeaveFatalSection>, "LeaveFatalSection"}, + FunctionInfo{9, D<&ISelfController::GetLibraryAppletLaunchableEvent>, "GetLibraryAppletLaunchableEvent"}, + FunctionInfo{10, D<&ISelfController::SetScreenShotPermission>, "SetScreenShotPermission"}, + FunctionInfo{11, D<&ISelfController::SetOperationModeChangedNotification>, "SetOperationModeChangedNotification"}, + FunctionInfo{12, D<&ISelfController::SetPerformanceModeChangedNotification>, "SetPerformanceModeChangedNotification"}, + FunctionInfo{13, D<&ISelfController::SetFocusHandlingMode>, "SetFocusHandlingMode"}, + FunctionInfo{14, D<&ISelfController::SetRestartMessageEnabled>, "SetRestartMessageEnabled"}, + FunctionInfo{15, D<&ISelfController::SetScreenShotAppletIdentityInfo>, "SetScreenShotAppletIdentityInfo"}, + FunctionInfo{16, D<&ISelfController::SetOutOfFocusSuspendingEnabled>, "SetOutOfFocusSuspendingEnabled"}, + FunctionInfo{17, nullptr, "SetControllerFirmwareUpdateSection"}, + FunctionInfo{18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"}, + FunctionInfo{19, D<&ISelfController::SetAlbumImageOrientation>, "SetAlbumImageOrientation"}, + FunctionInfo{20, nullptr, "SetDesirableKeyboardLayout"}, + FunctionInfo{21, nullptr, "GetScreenShotProgramId"}, + FunctionInfo{40, D<&ISelfController::CreateManagedDisplayLayer>, "CreateManagedDisplayLayer"}, + FunctionInfo{41, D<&ISelfController::IsSystemBufferSharingEnabled>, "IsSystemBufferSharingEnabled"}, + FunctionInfo{42, D<&ISelfController::GetSystemSharedLayerHandle>, "GetSystemSharedLayerHandle"}, + FunctionInfo{43, D<&ISelfController::GetSystemSharedBufferHandle>, "GetSystemSharedBufferHandle"}, + FunctionInfo{44, D<&ISelfController::CreateManagedDisplaySeparableLayer>, "CreateManagedDisplaySeparableLayer"}, + FunctionInfo{45, nullptr, "SetManagedDisplayLayerSeparationMode"}, + FunctionInfo{46, nullptr, "SetRecordingLayerCompositionEnabled"}, + FunctionInfo{50, D<&ISelfController::SetHandlesRequestToDisplay>, "SetHandlesRequestToDisplay"}, + FunctionInfo{51, D<&ISelfController::ApproveToDisplay>, "ApproveToDisplay"}, + FunctionInfo{60, D<&ISelfController::OverrideAutoSleepTimeAndDimmingTime>, "OverrideAutoSleepTimeAndDimmingTime"}, + FunctionInfo{61, D<&ISelfController::SetMediaPlaybackState>, "SetMediaPlaybackState"}, + FunctionInfo{62, D<&ISelfController::SetIdleTimeDetectionExtension>, "SetIdleTimeDetectionExtension"}, + FunctionInfo{63, D<&ISelfController::GetIdleTimeDetectionExtension>, "GetIdleTimeDetectionExtension"}, + FunctionInfo{64, nullptr, "SetInputDetectionSourceSet"}, + FunctionInfo{65, D<&ISelfController::ReportUserIsActive>, "ReportUserIsActive"}, + FunctionInfo{66, nullptr, "GetCurrentIlluminance"}, + FunctionInfo{67, D<&ISelfController::IsIlluminanceAvailable>, "IsIlluminanceAvailable"}, + FunctionInfo{68, D<&ISelfController::SetAutoSleepDisabled>, "SetAutoSleepDisabled"}, + FunctionInfo{69, D<&ISelfController::IsAutoSleepDisabled>, "IsAutoSleepDisabled"}, + FunctionInfo{70, nullptr, "ReportMultimediaError"}, + FunctionInfo{71, nullptr, "GetCurrentIlluminanceEx"}, + FunctionInfo{72, D<&ISelfController::SetInputDetectionPolicy>, "SetInputDetectionPolicy"}, + FunctionInfo{80, nullptr, "SetWirelessPriorityMode"}, + FunctionInfo{90, D<&ISelfController::GetAccumulatedSuspendedTickValue>, "GetAccumulatedSuspendedTickValue"}, + FunctionInfo{91, D<&ISelfController::GetAccumulatedSuspendedTickChangedEvent>, "GetAccumulatedSuspendedTickChangedEvent"}, + FunctionInfo{100, D<&ISelfController::SetAlbumImageTakenNotificationEnabled>, "SetAlbumImageTakenNotificationEnabled"}, + FunctionInfo{110, nullptr, "SetApplicationAlbumUserData"}, + FunctionInfo{120, D<&ISelfController::SaveCurrentScreenshot>, "SaveCurrentScreenshot"}, + FunctionInfo{130, D<&ISelfController::SetRecordVolumeMuted>, "SetRecordVolumeMuted"}, + FunctionInfo{230, D<&ISelfController::Unknown230>, "Unknown230"}, + FunctionInfo{240, D<&ISelfController::Unknown240>, "Unknown240"}, + FunctionInfo{1000, nullptr, "GetDebugStorageChannel"} + ); + return HandlerTableGenerateWithFind(key, functions); + } + ISelfController::ISelfController(Core::System& system_, std::shared_ptr applet, Kernel::KProcess* process) : ServiceFramework{system_, "ISelfController"}, m_process{process}, m_applet{ std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ISelfController::Exit>, "Exit"}, - {1, D<&ISelfController::LockExit>, "LockExit"}, - {2, D<&ISelfController::UnlockExit>, "UnlockExit"}, - {3, D<&ISelfController::EnterFatalSection>, "EnterFatalSection"}, - {4, D<&ISelfController::LeaveFatalSection>, "LeaveFatalSection"}, - {9, D<&ISelfController::GetLibraryAppletLaunchableEvent>, "GetLibraryAppletLaunchableEvent"}, - {10, D<&ISelfController::SetScreenShotPermission>, "SetScreenShotPermission"}, - {11, D<&ISelfController::SetOperationModeChangedNotification>, "SetOperationModeChangedNotification"}, - {12, D<&ISelfController::SetPerformanceModeChangedNotification>, "SetPerformanceModeChangedNotification"}, - {13, D<&ISelfController::SetFocusHandlingMode>, "SetFocusHandlingMode"}, - {14, D<&ISelfController::SetRestartMessageEnabled>, "SetRestartMessageEnabled"}, - {15, D<&ISelfController::SetScreenShotAppletIdentityInfo>, "SetScreenShotAppletIdentityInfo"}, - {16, D<&ISelfController::SetOutOfFocusSuspendingEnabled>, "SetOutOfFocusSuspendingEnabled"}, - {17, nullptr, "SetControllerFirmwareUpdateSection"}, - {18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"}, - {19, D<&ISelfController::SetAlbumImageOrientation>, "SetAlbumImageOrientation"}, - {20, nullptr, "SetDesirableKeyboardLayout"}, - {21, nullptr, "GetScreenShotProgramId"}, - {40, D<&ISelfController::CreateManagedDisplayLayer>, "CreateManagedDisplayLayer"}, - {41, D<&ISelfController::IsSystemBufferSharingEnabled>, "IsSystemBufferSharingEnabled"}, - {42, D<&ISelfController::GetSystemSharedLayerHandle>, "GetSystemSharedLayerHandle"}, - {43, D<&ISelfController::GetSystemSharedBufferHandle>, "GetSystemSharedBufferHandle"}, - {44, D<&ISelfController::CreateManagedDisplaySeparableLayer>, "CreateManagedDisplaySeparableLayer"}, - {45, nullptr, "SetManagedDisplayLayerSeparationMode"}, - {46, nullptr, "SetRecordingLayerCompositionEnabled"}, - {50, D<&ISelfController::SetHandlesRequestToDisplay>, "SetHandlesRequestToDisplay"}, - {51, D<&ISelfController::ApproveToDisplay>, "ApproveToDisplay"}, - {60, D<&ISelfController::OverrideAutoSleepTimeAndDimmingTime>, "OverrideAutoSleepTimeAndDimmingTime"}, - {61, D<&ISelfController::SetMediaPlaybackState>, "SetMediaPlaybackState"}, - {62, D<&ISelfController::SetIdleTimeDetectionExtension>, "SetIdleTimeDetectionExtension"}, - {63, D<&ISelfController::GetIdleTimeDetectionExtension>, "GetIdleTimeDetectionExtension"}, - {64, nullptr, "SetInputDetectionSourceSet"}, - {65, D<&ISelfController::ReportUserIsActive>, "ReportUserIsActive"}, - {66, nullptr, "GetCurrentIlluminance"}, - {67, D<&ISelfController::IsIlluminanceAvailable>, "IsIlluminanceAvailable"}, - {68, D<&ISelfController::SetAutoSleepDisabled>, "SetAutoSleepDisabled"}, - {69, D<&ISelfController::IsAutoSleepDisabled>, "IsAutoSleepDisabled"}, - {70, nullptr, "ReportMultimediaError"}, - {71, nullptr, "GetCurrentIlluminanceEx"}, - {72, D<&ISelfController::SetInputDetectionPolicy>, "SetInputDetectionPolicy"}, - {80, nullptr, "SetWirelessPriorityMode"}, - {90, D<&ISelfController::GetAccumulatedSuspendedTickValue>, "GetAccumulatedSuspendedTickValue"}, - {91, D<&ISelfController::GetAccumulatedSuspendedTickChangedEvent>, "GetAccumulatedSuspendedTickChangedEvent"}, - {100, D<&ISelfController::SetAlbumImageTakenNotificationEnabled>, "SetAlbumImageTakenNotificationEnabled"}, - {110, nullptr, "SetApplicationAlbumUserData"}, - {120, D<&ISelfController::SaveCurrentScreenshot>, "SaveCurrentScreenshot"}, - {130, D<&ISelfController::SetRecordVolumeMuted>, "SetRecordVolumeMuted"}, - {230, D<&ISelfController::Unknown230>, "Unknown230"}, - {240, D<&ISelfController::Unknown240>, "Unknown240"}, - {1000, nullptr, "GetDebugStorageChannel"}, - }; - // clang-format on - - RegisterHandlers(functions); - std::scoped_lock lk{m_applet->lock}; m_applet->display_layer_manager.Initialize(system, m_process, m_applet->applet_id, m_applet->library_applet_mode); diff --git a/src/core/hle/service/am/service/self_controller.h b/src/core/hle/service/am/service/self_controller.h index c9f480f575..ce77769da2 100644 --- a/src/core/hle/service/am/service/self_controller.h +++ b/src/core/hle/service/am/service/self_controller.h @@ -70,6 +70,7 @@ private: Result Unknown230(u32 in_val, Out out_val); Result Unknown240(u32 in_val); + std::optional FindRequest(u32 key) override; Kernel::KProcess* const m_process; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/storage.cpp b/src/core/hle/service/am/service/storage.cpp index 5fe191bf2f..110a9f5a42 100644 --- a/src/core/hle/service/am/service/storage.cpp +++ b/src/core/hle/service/am/service/storage.cpp @@ -4,22 +4,86 @@ // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include "core/hle/kernel/k_transfer_memory.h" #include "core/hle/service/am/am_results.h" #include "core/hle/service/am/library_applet_storage.h" #include "core/hle/service/am/service/storage.h" -#include "core/hle/service/am/service/storage_accessor.h" #include "core/hle/service/cmif_serialization.h" namespace Service::AM { +class IStorageAccessor final : public ServiceFramework { +public: + explicit IStorageAccessor(Core::System& system_, std::shared_ptr impl) : ServiceFramework{system_, "IStorageAccessor"}, m_impl{std::move(impl)} {} + ~IStorageAccessor() override = default; + + Result GetSize(Out out_size) { + LOG_DEBUG(Service_AM, "called"); + *out_size = m_impl->GetSize(); + R_SUCCEED(); + } + + Result Write(InBuffer buffer, s64 offset) { + LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, buffer.size()); + R_RETURN(m_impl->Write(offset, buffer.data(), buffer.size())); + } + + Result Read(OutBuffer out_buffer, s64 offset) { + LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, out_buffer.size()); + R_RETURN(m_impl->Read(offset, out_buffer.data(), out_buffer.size())); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IStorageAccessor::GetSize>, "GetSize"}, + FunctionInfo{10, D<&IStorageAccessor::Write>, "Write"}, + FunctionInfo{11, D<&IStorageAccessor::Read>, "Read"} + ); + + const std::shared_ptr m_impl; +}; + +class ITransferStorageAccessor final : public ServiceFramework { +public: + explicit ITransferStorageAccessor(Core::System& system_, std::shared_ptr impl) : ServiceFramework{system_, "ITransferStorageAccessor"}, m_impl{std::move(impl)} {} + ~ITransferStorageAccessor() override = default; + + Result GetSize(Out out_size) { + LOG_DEBUG(Service_AM, "called"); + *out_size = m_impl->GetSize(); + R_SUCCEED(); + } + + Result GetHandle(Out out_size, OutCopyHandle out_handle) { + LOG_INFO(Service_AM, "called"); + *out_size = m_impl->GetSize(); + *out_handle = m_impl->GetHandle(); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ITransferStorageAccessor::GetSize>, "GetSize"}, + FunctionInfo{1, D<&ITransferStorageAccessor::GetHandle>, "GetHandle"} + ); + + const std::shared_ptr m_impl; +}; + +std::optional IStorage::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IStorage::Open>, "Open"}, + FunctionInfo{1, D<&IStorage::OpenTransferStorage>, "OpenTransferStorage"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IStorage::IStorage(Core::System& system_, std::shared_ptr impl) : ServiceFramework{system_, "IStorage"}, m_impl{std::move(impl)} { - static const FunctionInfo functions[] = { - {0, D<&IStorage::Open>, "Open"}, - {1, D<&IStorage::OpenTransferStorage>, "OpenTransferStorage"}, - }; - - RegisterHandlers(functions); } IStorage::IStorage(Core::System& system_, std::vector&& data) diff --git a/src/core/hle/service/am/service/storage.h b/src/core/hle/service/am/service/storage.h index cde2ed0ead..63b7a0ad4c 100644 --- a/src/core/hle/service/am/service/storage.h +++ b/src/core/hle/service/am/service/storage.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -29,6 +32,7 @@ private: Result OpenTransferStorage( Out> out_transfer_storage_accessor); + std::optional FindRequest(u32 key) override; const std::shared_ptr m_impl; }; diff --git a/src/core/hle/service/am/service/storage_accessor.cpp b/src/core/hle/service/am/service/storage_accessor.cpp deleted file mode 100644 index 84577fee45..0000000000 --- a/src/core/hle/service/am/service/storage_accessor.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/kernel/k_transfer_memory.h" -#include "core/hle/service/am/library_applet_storage.h" -#include "core/hle/service/am/service/storage_accessor.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::AM { - -IStorageAccessor::IStorageAccessor(Core::System& system_, - std::shared_ptr impl) - : ServiceFramework{system_, "IStorageAccessor"}, m_impl{std::move(impl)} { - static const FunctionInfo functions[] = { - {0, D<&IStorageAccessor::GetSize>, "GetSize"}, - {10, D<&IStorageAccessor::Write>, "Write"}, - {11, D<&IStorageAccessor::Read>, "Read"}, - }; - - RegisterHandlers(functions); -} - -IStorageAccessor::~IStorageAccessor() = default; - -Result IStorageAccessor::GetSize(Out out_size) { - LOG_DEBUG(Service_AM, "called"); - *out_size = m_impl->GetSize(); - R_SUCCEED(); -} - -Result IStorageAccessor::Write(InBuffer buffer, s64 offset) { - LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, buffer.size()); - R_RETURN(m_impl->Write(offset, buffer.data(), buffer.size())); -} - -Result IStorageAccessor::Read(OutBuffer out_buffer, s64 offset) { - LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, out_buffer.size()); - R_RETURN(m_impl->Read(offset, out_buffer.data(), out_buffer.size())); -} - -ITransferStorageAccessor::ITransferStorageAccessor(Core::System& system_, - std::shared_ptr impl) - : ServiceFramework{system_, "ITransferStorageAccessor"}, m_impl{std::move(impl)} { - static const FunctionInfo functions[] = { - {0, D<&ITransferStorageAccessor::GetSize>, "GetSize"}, - {1, D<&ITransferStorageAccessor::GetHandle>, "GetHandle"}, - }; - - RegisterHandlers(functions); -} - -ITransferStorageAccessor::~ITransferStorageAccessor() = default; - -Result ITransferStorageAccessor::GetSize(Out out_size) { - LOG_DEBUG(Service_AM, "called"); - *out_size = m_impl->GetSize(); - R_SUCCEED(); -} - -Result ITransferStorageAccessor::GetHandle(Out out_size, - OutCopyHandle out_handle) { - LOG_INFO(Service_AM, "called"); - *out_size = m_impl->GetSize(); - *out_handle = m_impl->GetHandle(); - R_SUCCEED(); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/storage_accessor.h b/src/core/hle/service/am/service/storage_accessor.h deleted file mode 100644 index 1a01730e00..0000000000 --- a/src/core/hle/service/am/service/storage_accessor.h +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/am/library_applet_storage.h" -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service::AM { - -class IStorageAccessor final : public ServiceFramework { -public: - explicit IStorageAccessor(Core::System& system_, std::shared_ptr impl); - ~IStorageAccessor() override; - -private: - Result GetSize(Out out_size); - Result Write(InBuffer buffer, s64 offset); - Result Read(OutBuffer out_buffer, s64 offset); - - const std::shared_ptr m_impl; -}; - -class ITransferStorageAccessor final : public ServiceFramework { -public: - explicit ITransferStorageAccessor(Core::System& system_, - std::shared_ptr impl); - ~ITransferStorageAccessor() override; - -private: - Result GetSize(Out out_size); - Result GetHandle(Out out_size, OutCopyHandle out_handle); - - const std::shared_ptr m_impl; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/system_applet_proxy.cpp b/src/core/hle/service/am/service/system_applet_proxy.cpp deleted file mode 100644 index c435288a26..0000000000 --- a/src/core/hle/service/am/service/system_applet_proxy.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/service/applet_common_functions.h" -#include "core/hle/service/am/service/application_creator.h" -#include "core/hle/service/am/service/audio_controller.h" -#include "core/hle/service/am/service/common_state_getter.h" -#include "core/hle/service/am/service/debug_functions.h" -#include "core/hle/service/am/service/display_controller.h" -#include "core/hle/service/am/service/global_state_controller.h" -#include "core/hle/service/am/service/home_menu_functions.h" -#include "core/hle/service/am/service/library_applet_creator.h" -#include "core/hle/service/am/service/process_winding_controller.h" -#include "core/hle/service/am/service/self_controller.h" -#include "core/hle/service/am/service/system_applet_proxy.h" -#include "core/hle/service/am/service/window_controller.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::AM { - -ISystemAppletProxy::ISystemAppletProxy(Core::System& system_, std::shared_ptr applet, - Kernel::KProcess* process, WindowSystem& window_system) - : ServiceFramework{system_, "ISystemAppletProxy"}, - m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ISystemAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, - {1, D<&ISystemAppletProxy::GetSelfController>, "GetSelfController"}, - {2, D<&ISystemAppletProxy::GetWindowController>, "GetWindowController"}, - {3, D<&ISystemAppletProxy::GetAudioController>, "GetAudioController"}, - {4, D<&ISystemAppletProxy::GetDisplayController>, "GetDisplayController"}, - {10, D<&ISystemAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, - {11, D<&ISystemAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, - {20, D<&ISystemAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"}, - {21, D<&ISystemAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, - {22, D<&ISystemAppletProxy::GetApplicationCreator>, "GetApplicationCreator"}, - {23, D<&ISystemAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, - {1000, D<&ISystemAppletProxy::GetDebugFunctions>, "GetDebugFunctions"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -ISystemAppletProxy::~ISystemAppletProxy() = default; - -Result ISystemAppletProxy::GetAudioController( - Out> out_audio_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_audio_controller = std::make_shared(system); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetDisplayController( - Out> out_display_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_display_controller = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetProcessWindingController( - Out> out_process_winding_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_process_winding_controller = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetDebugFunctions( - Out> out_debug_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_debug_functions = std::make_shared(system); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetWindowController( - Out> out_window_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_window_controller = std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetSelfController( - Out> out_self_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_self_controller = std::make_shared(system, m_applet, m_process); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetCommonStateGetter( - Out> out_common_state_getter) { - LOG_DEBUG(Service_AM, "called"); - *out_common_state_getter = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetLibraryAppletCreator( - Out> out_library_applet_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_creator = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetApplicationCreator( - Out> out_application_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_application_creator = std::make_shared(system, m_window_system); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetAppletCommonFunctions( - Out> out_applet_common_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_applet_common_functions = std::make_shared(system, m_applet); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetHomeMenuFunctions( - Out> out_home_menu_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_home_menu_functions = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); -} - -Result ISystemAppletProxy::GetGlobalStateController( - Out> out_global_state_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_global_state_controller = std::make_shared(system); - R_SUCCEED(); -} - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/system_applet_proxy.h b/src/core/hle/service/am/service/system_applet_proxy.h deleted file mode 100644 index ab9769b3d9..0000000000 --- a/src/core/hle/service/am/service/system_applet_proxy.h +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service::AM { - -struct Applet; -class IAppletCommonFunctions; -class IApplicationCreator; -class IAudioController; -class ICommonStateGetter; -class IDebugFunctions; -class IDisplayController; -class IHomeMenuFunctions; -class IGlobalStateController; -class ILibraryAppletCreator; -class IProcessWindingController; -class ISelfController; -class IWindowController; -class WindowSystem; - -class ISystemAppletProxy final : public ServiceFramework { -public: - explicit ISystemAppletProxy(Core::System& system, std::shared_ptr applet, - Kernel::KProcess* process, WindowSystem& window_system); - ~ISystemAppletProxy(); - -private: - Result GetCommonStateGetter(Out> out_common_state_getter); - Result GetSelfController(Out> out_self_controller); - Result GetWindowController(Out> out_window_controller); - Result GetAudioController(Out> out_audio_controller); - Result GetDisplayController(Out> out_display_controller); - Result GetProcessWindingController( - Out> out_process_winding_controller); - Result GetDebugFunctions(Out> out_debug_functions); - Result GetLibraryAppletCreator( - Out> out_library_applet_creator); - Result GetApplicationCreator(Out> out_application_creator); - Result GetAppletCommonFunctions( - Out> out_applet_common_functions); - Result GetHomeMenuFunctions(Out> out_home_menu_functions); - Result GetGlobalStateController( - Out> out_global_state_controller); - - WindowSystem& m_window_system; - Kernel::KProcess* const m_process; - const std::shared_ptr m_applet; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/window_controller.cpp b/src/core/hle/service/am/service/window_controller.cpp index 54396affbe..d07aba0c79 100644 --- a/src/core/hle/service/am/service/window_controller.cpp +++ b/src/core/hle/service/am/service/window_controller.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -9,24 +12,24 @@ namespace Service::AM { +std::optional IWindowController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateWindow"}, + FunctionInfo{1, D<&IWindowController::GetAppletResourceUserId>, "GetAppletResourceUserId"}, + FunctionInfo{2, D<&IWindowController::GetAppletResourceUserIdOfCallerApplet>, "GetAppletResourceUserIdOfCallerApplet"}, + FunctionInfo{10, D<&IWindowController::AcquireForegroundRights>, "AcquireForegroundRights"}, + FunctionInfo{11, D<&IWindowController::ReleaseForegroundRights>, "ReleaseForegroundRights"}, + FunctionInfo{12, D<&IWindowController::RejectToChangeIntoBackground>, "RejectToChangeIntoBackground"}, + FunctionInfo{20, D<&IWindowController::SetAppletWindowVisibility>, "SetAppletWindowVisibility"}, + FunctionInfo{21, D<&IWindowController::SetAppletGpuTimeSlice>, "SetAppletGpuTimeSlice"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IWindowController::IWindowController(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) : ServiceFramework{system_, "IWindowController"}, m_window_system{window_system}, m_applet{std::move(applet)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateWindow"}, - {1, D<&IWindowController::GetAppletResourceUserId>, "GetAppletResourceUserId"}, - {2, D<&IWindowController::GetAppletResourceUserIdOfCallerApplet>, "GetAppletResourceUserIdOfCallerApplet"}, - {10, D<&IWindowController::AcquireForegroundRights>, "AcquireForegroundRights"}, - {11, D<&IWindowController::ReleaseForegroundRights>, "ReleaseForegroundRights"}, - {12, D<&IWindowController::RejectToChangeIntoBackground>, "RejectToChangeIntoBackground"}, - {20, D<&IWindowController::SetAppletWindowVisibility>, "SetAppletWindowVisibility"}, - {21, D<&IWindowController::SetAppletGpuTimeSlice>, "SetAppletGpuTimeSlice"}, - }; - // clang-format on - - RegisterHandlers(functions); } IWindowController::~IWindowController() = default; diff --git a/src/core/hle/service/am/service/window_controller.h b/src/core/hle/service/am/service/window_controller.h index a784dd4a49..29fd723421 100644 --- a/src/core/hle/service/am/service/window_controller.h +++ b/src/core/hle/service/am/service/window_controller.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -26,6 +29,7 @@ private: Result SetAppletWindowVisibility(bool visible); Result SetAppletGpuTimeSlice(s64 time_slice); + std::optional FindRequest(u32 key) override; WindowSystem& m_window_system; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/aoc/addon_content_manager.cpp b/src/core/hle/service/aoc/addon_content_manager.cpp index be2aa34baa..0222d9c52b 100644 --- a/src/core/hle/service/aoc/addon_content_manager.cpp +++ b/src/core/hle/service/aoc/addon_content_manager.cpp @@ -28,6 +28,34 @@ namespace Service::AOC { +std::optional IAddOnContentManager::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CountAddOnContentByApplicationId"}, + FunctionInfo{1, nullptr, "ListAddOnContentByApplicationId"}, + FunctionInfo{2, D<&IAddOnContentManager::CountAddOnContent>, "CountAddOnContent"}, + FunctionInfo{3, D<&IAddOnContentManager::ListAddOnContent>, "ListAddOnContent"}, + FunctionInfo{4, nullptr, "GetAddOnContentBaseIdByApplicationId"}, + FunctionInfo{5, D<&IAddOnContentManager::GetAddOnContentBaseId>, "GetAddOnContentBaseId"}, + FunctionInfo{6, nullptr, "PrepareAddOnContentByApplicationId"}, + FunctionInfo{7, D<&IAddOnContentManager::PrepareAddOnContent>, "PrepareAddOnContent"}, + FunctionInfo{8, D<&IAddOnContentManager::GetAddOnContentListChangedEvent>, "GetAddOnContentListChangedEvent"}, + FunctionInfo{9, nullptr, "GetAddOnContentLostErrorCode"}, + FunctionInfo{10, D<&IAddOnContentManager::GetAddOnContentListChangedEventWithProcessId>, "GetAddOnContentListChangedEventWithProcessId"}, + FunctionInfo{11, D<&IAddOnContentManager::NotifyMountAddOnContent>, "NotifyMountAddOnContent"}, + FunctionInfo{12, D<&IAddOnContentManager::NotifyUnmountAddOnContent>, "NotifyUnmountAddOnContent"}, + FunctionInfo{13, nullptr, "IsAddOnContentMountedForDebug"}, + FunctionInfo{50, D<&IAddOnContentManager::CheckAddOnContentMountStatus>, "CheckAddOnContentMountStatus"}, + FunctionInfo{100, D<&IAddOnContentManager::CreateEcPurchasedEventManager>, "CreateEcPurchasedEventManager"}, + FunctionInfo{101, D<&IAddOnContentManager::CreatePermanentEcPurchasedEventManager>, "CreatePermanentEcPurchasedEventManager"}, + FunctionInfo{110, nullptr, "CreateContentsServiceManager"}, + FunctionInfo{200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, + FunctionInfo{300, nullptr, "SetupHostAddOnContent"}, + FunctionInfo{301, nullptr, "GetRegisteredAddOnContentPath"}, + FunctionInfo{302, nullptr, "UpdateCachedList"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + static bool CheckAOCTitleIDMatchesBase(u64 title_id, u64 base) { return FileSys::GetBaseTitleID(title_id) == base; } @@ -57,35 +85,6 @@ static std::vector AccumulateAOCTitleIDs(Core::System& system) { IAddOnContentManager::IAddOnContentManager(Core::System& system_) : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)}, service_context{system_, "aoc:u"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CountAddOnContentByApplicationId"}, - {1, nullptr, "ListAddOnContentByApplicationId"}, - {2, D<&IAddOnContentManager::CountAddOnContent>, "CountAddOnContent"}, - {3, D<&IAddOnContentManager::ListAddOnContent>, "ListAddOnContent"}, - {4, nullptr, "GetAddOnContentBaseIdByApplicationId"}, - {5, D<&IAddOnContentManager::GetAddOnContentBaseId>, "GetAddOnContentBaseId"}, - {6, nullptr, "PrepareAddOnContentByApplicationId"}, - {7, D<&IAddOnContentManager::PrepareAddOnContent>, "PrepareAddOnContent"}, - {8, D<&IAddOnContentManager::GetAddOnContentListChangedEvent>, "GetAddOnContentListChangedEvent"}, - {9, nullptr, "GetAddOnContentLostErrorCode"}, - {10, D<&IAddOnContentManager::GetAddOnContentListChangedEventWithProcessId>, "GetAddOnContentListChangedEventWithProcessId"}, - {11, D<&IAddOnContentManager::NotifyMountAddOnContent>, "NotifyMountAddOnContent"}, - {12, D<&IAddOnContentManager::NotifyUnmountAddOnContent>, "NotifyUnmountAddOnContent"}, - {13, nullptr, "IsAddOnContentMountedForDebug"}, - {50, D<&IAddOnContentManager::CheckAddOnContentMountStatus>, "CheckAddOnContentMountStatus"}, - {100, D<&IAddOnContentManager::CreateEcPurchasedEventManager>, "CreateEcPurchasedEventManager"}, - {101, D<&IAddOnContentManager::CreatePermanentEcPurchasedEventManager>, "CreatePermanentEcPurchasedEventManager"}, - {110, nullptr, "CreateContentsServiceManager"}, - {200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, - {300, nullptr, "SetupHostAddOnContent"}, - {301, nullptr, "GetRegisteredAddOnContentPath"}, - {302, nullptr, "UpdateCachedList"}, - }; - // clang-format on - - RegisterHandlers(functions); - aoc_change_event = service_context.CreateEvent("GetAddOnContentListChanged:Event"); } diff --git a/src/core/hle/service/aoc/addon_content_manager.h b/src/core/hle/service/aoc/addon_content_manager.h index 91857df4c7..8ddb86cf19 100644 --- a/src/core/hle/service/aoc/addon_content_manager.h +++ b/src/core/hle/service/aoc/addon_content_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -40,9 +43,9 @@ public: OutInterface out_interface); private: + std::optional FindRequest(u32 key) override; std::vector add_on_content; KernelHelpers::ServiceContext service_context; - Kernel::KEvent* aoc_change_event; }; diff --git a/src/core/hle/service/aoc/purchase_event_manager.cpp b/src/core/hle/service/aoc/purchase_event_manager.cpp index 9e718510b4..eded803b25 100644 --- a/src/core/hle/service/aoc/purchase_event_manager.cpp +++ b/src/core/hle/service/aoc/purchase_event_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -8,21 +11,20 @@ namespace Service::AOC { constexpr Result ResultNoPurchasedProductInfoAvailable{ErrorModule::NIMShop, 400}; +std::optional IPurchaseEventManager::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"}, + FunctionInfo{1, D<&IPurchaseEventManager::SetDeliveryTarget>, "SetDeliveryTarget"}, + FunctionInfo{2, D<&IPurchaseEventManager::GetPurchasedEvent>, "GetPurchasedEvent"}, + FunctionInfo{3, D<&IPurchaseEventManager::PopPurchasedProductInfo>, "PopPurchasedProductInfo"}, + FunctionInfo{4, D<&IPurchaseEventManager::PopPurchasedProductInfoWithUid>, "PopPurchasedProductInfoWithUid"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IPurchaseEventManager::IPurchaseEventManager(Core::System& system_) - : ServiceFramework{system_, "IPurchaseEventManager"}, service_context{system, - "IPurchaseEventManager"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"}, - {1, D<&IPurchaseEventManager::SetDeliveryTarget>, "SetDeliveryTarget"}, - {2, D<&IPurchaseEventManager::GetPurchasedEvent>, "GetPurchasedEvent"}, - {3, D<&IPurchaseEventManager::PopPurchasedProductInfo>, "PopPurchasedProductInfo"}, - {4, D<&IPurchaseEventManager::PopPurchasedProductInfoWithUid>, "PopPurchasedProductInfoWithUid"}, - }; - // clang-format on - - RegisterHandlers(functions); - + : ServiceFramework{system_, "IPurchaseEventManager"} + , service_context{system, "IPurchaseEventManager"} { purchased_event = service_context.CreateEvent("IPurchaseEventManager:PurchasedEvent"); } diff --git a/src/core/hle/service/aoc/purchase_event_manager.h b/src/core/hle/service/aoc/purchase_event_manager.h index ea3836bc93..d11089e567 100644 --- a/src/core/hle/service/aoc/purchase_event_manager.h +++ b/src/core/hle/service/aoc/purchase_event_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -22,6 +25,8 @@ public: Result PopPurchasedProductInfo(); Result PopPurchasedProductInfoWithUid(); + std::optional FindRequest(u32 key) override; + private: KernelHelpers::ServiceContext service_context; Kernel::KEvent* purchased_event; diff --git a/src/core/hle/service/apm/apm_interface.cpp b/src/core/hle/service/apm/apm_interface.cpp index 51c01e2f25..2b4768478e 100644 --- a/src/core/hle/service/apm/apm_interface.cpp +++ b/src/core/hle/service/apm/apm_interface.cpp @@ -14,15 +14,7 @@ namespace Service::APM { class ISession final : public ServiceFramework { public: - explicit ISession(Core::System& system_, Controller& controller_) - : ServiceFramework{system_, "ISession"}, controller{controller_} { - static const FunctionInfo functions[] = { - {0, &ISession::SetPerformanceConfiguration, "SetPerformanceConfiguration"}, - {1, &ISession::GetPerformanceConfiguration, "GetPerformanceConfiguration"}, - {2, &ISession::SetCpuOverclockEnabled, "SetCpuOverclockEnabled"}, - }; - RegisterHandlers(functions); - } + explicit ISession(Core::System& system_, Controller& controller_) : ServiceFramework{system_, "ISession"}, controller{controller_} {} private: void SetPerformanceConfiguration(HLERequestContext& ctx) { @@ -61,18 +53,20 @@ private: rb.Push(ResultSuccess); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ISession::SetPerformanceConfiguration, "SetPerformanceConfiguration"}, + FunctionInfo{1, &ISession::GetPerformanceConfiguration, "GetPerformanceConfiguration"}, + FunctionInfo{2, &ISession::SetCpuOverclockEnabled, "SetCpuOverclockEnabled"} + ); Controller& controller; }; APM::APM(Core::System& system_, std::shared_ptr apm_, Controller& controller_, const char* name) : ServiceFramework{system_, name}, apm(std::move(apm_)), controller{controller_} { - static const FunctionInfo functions[] = { - {0, &APM::OpenSession, "OpenSession"}, - {1, &APM::GetPerformanceMode, "GetPerformanceMode"}, - {6, &APM::IsCpuOverclockEnabled, "IsCpuOverclockEnabled"}, - }; - RegisterHandlers(functions); } APM::~APM() = default; @@ -102,20 +96,6 @@ void APM::IsCpuOverclockEnabled(HLERequestContext& ctx) { APM_Sys::APM_Sys(Core::System& system_, Controller& controller_) : ServiceFramework{system_, "apm:sys"}, controller{controller_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestPerformanceMode"}, - {1, &APM_Sys::GetPerformanceEvent, "GetPerformanceEvent"}, - {2, nullptr, "GetThrottlingState"}, - {3, nullptr, "GetLastThrottlingState"}, - {4, nullptr, "ClearLastThrottlingState"}, - {5, nullptr, "LoadAndApplySettings"}, - {6, &APM_Sys::SetCpuBoostMode, "SetCpuBoostMode"}, - {7, &APM_Sys::GetCurrentPerformanceConfiguration, "GetCurrentPerformanceConfiguration"}, - }; - // clang-format on - - RegisterHandlers(functions); } APM_Sys::~APM_Sys() = default; diff --git a/src/core/hle/service/apm/apm_interface.h b/src/core/hle/service/apm/apm_interface.h index 58718453b6..0bbcd185a3 100644 --- a/src/core/hle/service/apm/apm_interface.h +++ b/src/core/hle/service/apm/apm_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -21,6 +24,14 @@ private: void GetPerformanceMode(HLERequestContext& ctx); void IsCpuOverclockEnabled(HLERequestContext& ctx); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &APM::OpenSession, "OpenSession"}, + FunctionInfo{1, &APM::GetPerformanceMode, "GetPerformanceMode"}, + FunctionInfo{6, &APM::IsCpuOverclockEnabled, "IsCpuOverclockEnabled"} + ); std::shared_ptr apm; Controller& controller; }; @@ -36,6 +47,19 @@ private: void GetPerformanceEvent(HLERequestContext& ctx); void GetCurrentPerformanceConfiguration(HLERequestContext& ctx); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestPerformanceMode"}, + FunctionInfo{1, &APM_Sys::GetPerformanceEvent, "GetPerformanceEvent"}, + FunctionInfo{2, nullptr, "GetThrottlingState"}, + FunctionInfo{3, nullptr, "GetLastThrottlingState"}, + FunctionInfo{4, nullptr, "ClearLastThrottlingState"}, + FunctionInfo{5, nullptr, "LoadAndApplySettings"}, + FunctionInfo{6, &APM_Sys::SetCpuBoostMode, "SetCpuBoostMode"}, + FunctionInfo{7, &APM_Sys::GetCurrentPerformanceConfiguration, "GetCurrentPerformanceConfiguration"} + ); Controller& controller; }; diff --git a/src/core/hle/service/audio/audio.cpp b/src/core/hle/service/audio/audio.cpp index fde766a275..6177efd46c 100644 --- a/src/core/hle/service/audio/audio.cpp +++ b/src/core/hle/service/audio/audio.cpp @@ -21,164 +21,164 @@ namespace Service::Audio { class IAudioOutManagerForApplet final : public ServiceFramework { public: explicit IAudioOutManagerForApplet(Core::System& system_) - : ServiceFramework{system_, "audout:a"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestSuspend"}, - {1, nullptr, "RequestResume"}, - {2, nullptr, "GetProcessMasterVolume"}, - {3, nullptr, "SetProcessMasterVolume"}, - {4, nullptr, "GetProcessRecordVolume"}, - {5, nullptr, "SetProcessRecordVolume"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "audout:a"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestSuspend"}, + FunctionInfo{1, nullptr, "RequestResume"}, + FunctionInfo{2, nullptr, "GetProcessMasterVolume"}, + FunctionInfo{3, nullptr, "SetProcessMasterVolume"}, + FunctionInfo{4, nullptr, "GetProcessRecordVolume"}, + FunctionInfo{5, nullptr, "SetProcessRecordVolume"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IAudioSnoopManager final : public ServiceFramework { public: explicit IAudioSnoopManager(Core::System& system_) - : ServiceFramework{system_, "auddev"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetDspStatistics"}, - {1, nullptr, "GetAppletStateSummaries"}, - {2, nullptr, "SetDspStatisticsParameter"}, - {3, nullptr, "GetDspStatisticsParameter"}, - {6, nullptr, "GetDspUsage"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "auddev"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetDspStatistics"}, + FunctionInfo{1, nullptr, "GetAppletStateSummaries"}, + FunctionInfo{2, nullptr, "SetDspStatisticsParameter"}, + FunctionInfo{3, nullptr, "GetDspStatisticsParameter"}, + FunctionInfo{6, nullptr, "GetDspUsage"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IAudioInManagerForApplet final : public ServiceFramework { public: explicit IAudioInManagerForApplet(Core::System& system_) - : ServiceFramework{system_, "audin:a"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestSuspend"}, - {1, nullptr, "RequestResume"}, - {2, nullptr, "GetProcessMasterVolume"}, - {3, nullptr, "SetProcessMasterVolume"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "audin:a"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestSuspend"}, + FunctionInfo{1, nullptr, "RequestResume"}, + FunctionInfo{2, nullptr, "GetProcessMasterVolume"}, + FunctionInfo{3, nullptr, "SetProcessMasterVolume"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IAudioRendererManagerForApplet final : public ServiceFramework { public: explicit IAudioRendererManagerForApplet(Core::System& system_) - : ServiceFramework{system_, "audren:a"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestSuspend"}, - {1, nullptr, "RequestResume"}, - {2, nullptr, "GetProcessMasterVolume"}, - {3, nullptr, "SetProcessMasterVolume"}, - {4, nullptr, "RegisterAppletResourceUserId"}, - {5, nullptr, "UnregisterAppletResourceUserId"}, - {6, nullptr, "GetProcessRecordVolume"}, - {7, nullptr, "SetProcessRecordVolume"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "audren:a"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestSuspend"}, + FunctionInfo{1, nullptr, "RequestResume"}, + FunctionInfo{2, nullptr, "GetProcessMasterVolume"}, + FunctionInfo{3, nullptr, "SetProcessMasterVolume"}, + FunctionInfo{4, nullptr, "RegisterAppletResourceUserId"}, + FunctionInfo{5, nullptr, "UnregisterAppletResourceUserId"}, + FunctionInfo{6, nullptr, "GetProcessRecordVolume"}, + FunctionInfo{7, nullptr, "SetProcessRecordVolume"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IAudioOutManagerForDebugger final : public ServiceFramework { public: explicit IAudioOutManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "audout:d"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestSuspend"}, - {1, nullptr, "RequestResume"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "audout:d"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestSuspend"}, + FunctionInfo{1, nullptr, "RequestResume"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IAudioInManagerForDebugger final : public ServiceFramework { public: explicit IAudioInManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "audin:d"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestSuspend"}, - {1, nullptr, "RequestResume"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "audin:d"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestSuspend"}, + FunctionInfo{1, nullptr, "RequestResume"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IFinalOutputRecorderManagerForDebugger final : public ServiceFramework { public: explicit IFinalOutputRecorderManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "audrec:d"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestSuspend"}, - {1, nullptr, "RequestResume"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "audrec:d"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestSuspend"}, + FunctionInfo{1, nullptr, "RequestResume"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IAudioRendererManagerForDebugger final : public ServiceFramework { public: explicit IAudioRendererManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "audren:d"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestSuspend"}, - {1, nullptr, "RequestResume"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "audren:d"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestSuspend"}, + FunctionInfo{1, nullptr, "RequestResume"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IAudioSystemManagerForApplet final : public ServiceFramework { public: explicit IAudioSystemManagerForApplet(Core::System& system_) - : ServiceFramework{system_, "aud:a"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RegisterAppletResourceUserId"}, - {1, nullptr, "UnregisterAppletResourceUserId"}, - {2, nullptr, "RequestSuspendAudio"}, - {3, nullptr, "RequestResumeAudio"}, - {4, nullptr, "GetAudioOutputProcessMasterVolume"}, - {5, nullptr, "SetAudioOutputProcessMasterVolume"}, - {6, nullptr, "GetAudioInputProcessMasterVolume"}, - {7, nullptr, "SetAudioInputProcessMasterVolume"}, - {8, nullptr, "GetAudioOutputProcessRecordVolume"}, - {9, nullptr, "SetAudioOutputProcessRecordVolume"}, - {10, nullptr, "GetAppletStateSummaries"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "aud:a"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RegisterAppletResourceUserId"}, + FunctionInfo{1, nullptr, "UnregisterAppletResourceUserId"}, + FunctionInfo{2, nullptr, "RequestSuspendAudio"}, + FunctionInfo{3, nullptr, "RequestResumeAudio"}, + FunctionInfo{4, nullptr, "GetAudioOutputProcessMasterVolume"}, + FunctionInfo{5, nullptr, "SetAudioOutputProcessMasterVolume"}, + FunctionInfo{6, nullptr, "GetAudioInputProcessMasterVolume"}, + FunctionInfo{7, nullptr, "SetAudioInputProcessMasterVolume"}, + FunctionInfo{8, nullptr, "GetAudioOutputProcessRecordVolume"}, + FunctionInfo{9, nullptr, "SetAudioOutputProcessRecordVolume"}, + FunctionInfo{10, nullptr, "GetAppletStateSummaries"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IAudioSystemManagerForDebugger final : public ServiceFramework { public: explicit IAudioSystemManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "aud:d"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestSuspendAudioForDebug"}, - {1, nullptr, "RequestResumeAudioForDebug"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "aud:d"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestSuspendAudioForDebug"}, + FunctionInfo{1, nullptr, "RequestResumeAudioForDebug"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/audio/audio_controller.cpp b/src/core/hle/service/audio/audio_controller.cpp index 611e48e8ba..d912a5e86a 100644 --- a/src/core/hle/service/audio/audio_controller.cpp +++ b/src/core/hle/service/audio/audio_controller.cpp @@ -1,7 +1,7 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project @@ -20,77 +20,75 @@ namespace Service::Audio { +std::optional IAudioController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAudioController::GetTargetVolume>, "GetTargetVolume"}, + FunctionInfo{1, D<&IAudioController::SetTargetVolume>, "SetTargetVolume"}, + FunctionInfo{2, D<&IAudioController::GetTargetVolumeMin>, "GetTargetVolumeMin"}, + FunctionInfo{3, D<&IAudioController::GetTargetVolumeMax>, "GetTargetVolumeMax"}, + FunctionInfo{4, D<&IAudioController::IsTargetMute>, "IsTargetMute"}, + FunctionInfo{5, D<&IAudioController::SetTargetMute>, "SetTargetMute"}, + FunctionInfo{6, nullptr, "IsTargetConnected", MakeVersionGate({20,0,0})}, + FunctionInfo{7, nullptr, "SetDefaultTarget"}, + FunctionInfo{8, nullptr, "GetDefaultTarget"}, + FunctionInfo{9, D<&IAudioController::GetAudioOutputMode>, "GetAudioOutputMode"}, + FunctionInfo{10, D<&IAudioController::SetAudioOutputMode>, "SetAudioOutputMode"}, + FunctionInfo{11, nullptr, "SetForceMutePolicy"}, + FunctionInfo{12, D<&IAudioController::GetForceMutePolicy>, "GetForceMutePolicy"}, + FunctionInfo{13, D<&IAudioController::GetOutputModeSetting>, "GetOutputModeSetting"}, + FunctionInfo{14, D<&IAudioController::SetOutputModeSetting>, "SetOutputModeSetting"}, + FunctionInfo{15, nullptr, "SetOutputTarget"}, + FunctionInfo{16, nullptr, "SetInputTargetForceEnabled"}, + FunctionInfo{17, D<&IAudioController::SetHeadphoneOutputLevelMode>, "SetHeadphoneOutputLevelMode"}, + FunctionInfo{18, D<&IAudioController::GetHeadphoneOutputLevelMode>, "GetHeadphoneOutputLevelMode"}, + FunctionInfo{19, nullptr, "AcquireAudioVolumeUpdateEventForPlayReport"}, + FunctionInfo{20, nullptr, "AcquireAudioOutputDeviceUpdateEventForPlayReport"}, + FunctionInfo{21, nullptr, "GetAudioOutputTargetForPlayReport"}, + FunctionInfo{22, D<&IAudioController::NotifyHeadphoneVolumeWarningDisplayedEvent>, "NotifyHeadphoneVolumeWarningDisplayedEvent"}, + FunctionInfo{23, nullptr, "SetSystemOutputMasterVolume"}, + FunctionInfo{24, nullptr, "GetSystemOutputMasterVolume"}, + FunctionInfo{25, nullptr, "GetAudioVolumeDataForPlayReport"}, + FunctionInfo{26, nullptr, "UpdateHeadphoneSettings"}, + FunctionInfo{27, nullptr, "SetVolumeMappingTableForDev"}, + FunctionInfo{28, nullptr, "GetAudioOutputChannelCountForPlayReport"}, + FunctionInfo{29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, + FunctionInfo{30, D<&IAudioController::SetSpeakerAutoMuteEnabled>, "SetSpeakerAutoMuteEnabled"}, + FunctionInfo{31, D<&IAudioController::IsSpeakerAutoMuteEnabled>, "IsSpeakerAutoMuteEnabled"}, + FunctionInfo{32, D<&IAudioController::GetActiveOutputTarget>, "GetActiveOutputTarget"}, + FunctionInfo{33, nullptr, "GetTargetDeviceInfo"}, + FunctionInfo{34, D<&IAudioController::AcquireTargetNotification>, "AcquireTargetNotification"}, + FunctionInfo{35, nullptr, "SetHearingProtectionSafeguardTimerRemainingTimeForDebug"}, + FunctionInfo{36, nullptr, "GetHearingProtectionSafeguardTimerRemainingTimeForDebug"}, + FunctionInfo{37, nullptr, "SetHearingProtectionSafeguardEnabled"}, + FunctionInfo{38, nullptr, "IsHearingProtectionSafeguardEnabled"}, + FunctionInfo{39, nullptr, "IsHearingProtectionSafeguardMonitoringOutputForDebug"}, + FunctionInfo{40, nullptr, "GetSystemInformationForDebug"}, + FunctionInfo{41, nullptr, "SetVolumeButtonLongPressTime"}, + FunctionInfo{42, nullptr, "SetNativeVolumeForDebug"}, + FunctionInfo{43, nullptr, "Unknown43", MakeVersionGate({21,0,0})}, + FunctionInfo{5000, D<&IAudioController::Unknown5000>, "Unknown5000", MakeVersionGate({19,0,0})}, + FunctionInfo{10000, nullptr, "NotifyAudioOutputTargetForPlayReport"}, + FunctionInfo{10001, nullptr, "NotifyAudioOutputChannelCountForPlayReport"}, + FunctionInfo{10002, nullptr, "NotifyUnsupportedUsbOutputDeviceAttachedForPlayReport"}, + FunctionInfo{10100, nullptr, "GetAudioVolumeDataForPlayReport"}, + FunctionInfo{10101, nullptr, "BindAudioVolumeUpdateEventForPlayReport"}, + FunctionInfo{10102, nullptr, "BindAudioOutputTargetUpdateEventForPlayReport"}, + FunctionInfo{10103, nullptr, "GetAudioOutputTargetForPlayReport"}, + FunctionInfo{10104, nullptr, "GetAudioOutputChannelCountForPlayReport"}, + FunctionInfo{10105, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport", MakeVersionGate({14,0,0}, {19,0,1})}, + FunctionInfo{10106, nullptr, "GetDefaultAudioOutputTargetForPlayReport", MakeVersionGate({14,0,0}, {19,0,1})}, + FunctionInfo{10200, nullptr, "Unknown10200", MakeVersionGate({20,0,0})}, + FunctionInfo{50000, nullptr, "SetAnalogInputBoostGainForPrototyping", MakeVersionGate({15,0,0}, {18,1,0})}, + FunctionInfo{50001, nullptr, "OverrideDefaultTargetForDebug", MakeVersionGate({19,0,0}, {19,0,1})}, + FunctionInfo{50003, nullptr, "SetForceOverrideExternalDeviceNameForDebug", MakeVersionGate({19,0,0})}, + FunctionInfo{50004, nullptr, "ClearForceOverrideExternalDeviceNameForDebug", MakeVersionGate({19,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAudioController::IAudioController(Core::System& system_) : ServiceFramework{system_, "audctl"}, service_context{system, "audctl"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IAudioController::GetTargetVolume>, "GetTargetVolume"}, - {1, D<&IAudioController::SetTargetVolume>, "SetTargetVolume"}, - {2, D<&IAudioController::GetTargetVolumeMin>, "GetTargetVolumeMin"}, - {3, D<&IAudioController::GetTargetVolumeMax>, "GetTargetVolumeMax"}, - {4, D<&IAudioController::IsTargetMute>, "IsTargetMute"}, - {5, D<&IAudioController::SetTargetMute>, "SetTargetMute"}, - {6, nullptr, "IsTargetConnected"}, //20.0.0+ - {7, nullptr, "SetDefaultTarget"}, - {8, nullptr, "GetDefaultTarget"}, - {9, D<&IAudioController::GetAudioOutputMode>, "GetAudioOutputMode"}, - {10, D<&IAudioController::SetAudioOutputMode>, "SetAudioOutputMode"}, - {11, nullptr, "SetForceMutePolicy"}, - {12, D<&IAudioController::GetForceMutePolicy>, "GetForceMutePolicy"}, - {13, D<&IAudioController::GetOutputModeSetting>, "GetOutputModeSetting"}, - {14, D<&IAudioController::SetOutputModeSetting>, "SetOutputModeSetting"}, - {15, nullptr, "SetOutputTarget"}, - {16, nullptr, "SetInputTargetForceEnabled"}, - {17, D<&IAudioController::SetHeadphoneOutputLevelMode>, "SetHeadphoneOutputLevelMode"}, - {18, D<&IAudioController::GetHeadphoneOutputLevelMode>, "GetHeadphoneOutputLevelMode"}, - {19, nullptr, "AcquireAudioVolumeUpdateEventForPlayReport"}, - {20, nullptr, "AcquireAudioOutputDeviceUpdateEventForPlayReport"}, - {21, nullptr, "GetAudioOutputTargetForPlayReport"}, - {22, D<&IAudioController::NotifyHeadphoneVolumeWarningDisplayedEvent>, "NotifyHeadphoneVolumeWarningDisplayedEvent"}, - {23, nullptr, "SetSystemOutputMasterVolume"}, - {24, nullptr, "GetSystemOutputMasterVolume"}, - {25, nullptr, "GetAudioVolumeDataForPlayReport"}, - {26, nullptr, "UpdateHeadphoneSettings"}, - {27, nullptr, "SetVolumeMappingTableForDev"}, - {28, nullptr, "GetAudioOutputChannelCountForPlayReport"}, - {29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, - {30, D<&IAudioController::SetSpeakerAutoMuteEnabled>, "SetSpeakerAutoMuteEnabled"}, - {31, D<&IAudioController::IsSpeakerAutoMuteEnabled>, "IsSpeakerAutoMuteEnabled"}, - {32, D<&IAudioController::GetActiveOutputTarget>, "GetActiveOutputTarget"}, - {33, nullptr, "GetTargetDeviceInfo"}, - {34, D<&IAudioController::AcquireTargetNotification>, "AcquireTargetNotification"}, - {35, nullptr, "SetHearingProtectionSafeguardTimerRemainingTimeForDebug"}, - {36, nullptr, "GetHearingProtectionSafeguardTimerRemainingTimeForDebug"}, - {37, nullptr, "SetHearingProtectionSafeguardEnabled"}, - {38, nullptr, "IsHearingProtectionSafeguardEnabled"}, - {39, nullptr, "IsHearingProtectionSafeguardMonitoringOutputForDebug"}, - {40, nullptr, "GetSystemInformationForDebug"}, - {41, nullptr, "SetVolumeButtonLongPressTime"}, - {42, nullptr, "SetNativeVolumeForDebug"}, - {43, nullptr, "Unknown43"}, //21.0.0+ - {5000, D<&IAudioController::Unknown5000>, "Unknown5000"}, //19.0.0+ - {10000, nullptr, "NotifyAudioOutputTargetForPlayReport"}, - {10001, nullptr, "NotifyAudioOutputChannelCountForPlayReport"}, - {10002, nullptr, "NotifyUnsupportedUsbOutputDeviceAttachedForPlayReport"}, - {10100, nullptr, "GetAudioVolumeDataForPlayReport"}, - {10101, nullptr, "BindAudioVolumeUpdateEventForPlayReport"}, - {10102, nullptr, "BindAudioOutputTargetUpdateEventForPlayReport"}, - {10103, nullptr, "GetAudioOutputTargetForPlayReport"}, - {10104, nullptr, "GetAudioOutputChannelCountForPlayReport"}, - {10105, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, //14.0.0-19.0.1 - {10106, nullptr, "GetDefaultAudioOutputTargetForPlayReport"}, //14.0.0-19.0.1 - {10200, nullptr, "Unknown10200"}, //20.0.0+ - {50000, nullptr, "SetAnalogInputBoostGainForPrototyping"}, //15.0.0-18.1.0 - {50001, nullptr, "OverrideDefaultTargetForDebug"}, //19.0.0-19.0.1 - {50003, nullptr, "SetForceOverrideExternalDeviceNameForDebug"}, //19.0.0+ - {50004, nullptr, "ClearForceOverrideExternalDeviceNameForDebug"} //19.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); - - m_set_sys = - system.ServiceManager().GetService("set:sys", true); + m_set_sys = system.ServiceManager().GetService("set:sys", true); notification_event = service_context.CreateEvent("IAudioController:NotificationEvent"); // Probably shouldn't do this in constructor? diff --git a/src/core/hle/service/audio/audio_controller.h b/src/core/hle/service/audio/audio_controller.h index ff51f4c244..e5c615fa21 100644 --- a/src/core/hle/service/audio/audio_controller.h +++ b/src/core/hle/service/audio/audio_controller.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project @@ -59,8 +59,8 @@ private: Result AcquireTargetNotification(OutCopyHandle out_notification_event); Result Unknown5000(Out> out_audio_controller); + std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext service_context; - Kernel::KEvent* notification_event; std::shared_ptr m_set_sys; std::array m_target_volumes{{15, 15, 15, 15, 15, 15}}; diff --git a/src/core/hle/service/audio/audio_device.cpp b/src/core/hle/service/audio/audio_device.cpp index e9f7e074a1..fc24bf3ccd 100644 --- a/src/core/hle/service/audio/audio_device.cpp +++ b/src/core/hle/service/audio/audio_device.cpp @@ -12,36 +12,38 @@ namespace Service::Audio { using namespace AudioCore::Renderer; +std::optional IAudioDevice::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAudioDevice::ListAudioDeviceName>, "ListAudioDeviceName"}, + FunctionInfo{1, D<&IAudioDevice::SetAudioDeviceOutputVolume>, "SetAudioDeviceOutputVolume"}, + FunctionInfo{2, D<&IAudioDevice::GetAudioDeviceOutputVolume>, "GetAudioDeviceOutputVolume"}, + FunctionInfo{3, D<&IAudioDevice::GetActiveAudioDeviceName>, "GetActiveAudioDeviceName"}, + FunctionInfo{4, D<&IAudioDevice::QueryAudioDeviceSystemEvent>, "QueryAudioDeviceSystemEvent"}, + FunctionInfo{5, D<&IAudioDevice::GetActiveChannelCount>, "GetActiveChannelCount"}, + FunctionInfo{6, D<&IAudioDevice::ListAudioDeviceNameAuto>, "ListAudioDeviceNameAuto"}, + FunctionInfo{7, D<&IAudioDevice::SetAudioDeviceOutputVolumeAuto>, "SetAudioDeviceOutputVolumeAuto"}, + FunctionInfo{8, D<&IAudioDevice::GetAudioDeviceOutputVolumeAuto>, "GetAudioDeviceOutputVolumeAuto"}, + FunctionInfo{10, D<&IAudioDevice::GetActiveAudioDeviceNameAuto>, "GetActiveAudioDeviceNameAuto"}, + FunctionInfo{11, D<&IAudioDevice::QueryAudioDeviceInputEvent>, "QueryAudioDeviceInputEvent"}, + FunctionInfo{12, D<&IAudioDevice::QueryAudioDeviceOutputEvent>, "QueryAudioDeviceOutputEvent"}, + FunctionInfo{13, D<&IAudioDevice::GetActiveAudioDeviceName>, "GetActiveAudioOutputDeviceName"}, + FunctionInfo{14, D<&IAudioDevice::ListAudioOutputDeviceName>, "ListAudioOutputDeviceName"}, + FunctionInfo{15, nullptr, "AcquireAudioInputDeviceNotification", MakeVersionGate({17,0,0})}, + FunctionInfo{16, nullptr, "ReleaseAudioInputDeviceNotification", MakeVersionGate({17,0,0})}, + FunctionInfo{17, nullptr, "AcquireAudioOutputDeviceNotification", MakeVersionGate({17,0,0})}, + FunctionInfo{18, nullptr, "ReleaseAudioOutputDeviceNotification", MakeVersionGate({17,0,0})}, + FunctionInfo{19, D<&IAudioDevice::SetAudioDeviceOutputVolumeAutoTuneEnabled>, "SetAudioDeviceOutputVolumeAutoTuneEnabled", MakeVersionGate({18,0,0})}, + FunctionInfo{20, D<&IAudioDevice::IsAudioDeviceOutputVolumeAutoTuneEnabled>, "IsAudioDeviceOutputVolumeAutoTuneEnabled", MakeVersionGate({18,0,0})}, + FunctionInfo{21, nullptr, "IsActiveOutputDeviceEstimatedLowLatency", MakeVersionGate({21,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAudioDevice::IAudioDevice(Core::System& system_, u64 applet_resource_user_id, u32 revision, u32 device_num) : ServiceFramework{system_, "IAudioDevice"}, service_context{system_, "IAudioDevice"}, impl{std::make_unique(system_, applet_resource_user_id, revision)}, event{service_context.CreateEvent(fmt::format("IAudioDeviceEvent-{}", device_num))} { - static const FunctionInfo functions[] = { - {0, D<&IAudioDevice::ListAudioDeviceName>, "ListAudioDeviceName"}, - {1, D<&IAudioDevice::SetAudioDeviceOutputVolume>, "SetAudioDeviceOutputVolume"}, - {2, D<&IAudioDevice::GetAudioDeviceOutputVolume>, "GetAudioDeviceOutputVolume"}, - {3, D<&IAudioDevice::GetActiveAudioDeviceName>, "GetActiveAudioDeviceName"}, - {4, D<&IAudioDevice::QueryAudioDeviceSystemEvent>, "QueryAudioDeviceSystemEvent"}, - {5, D<&IAudioDevice::GetActiveChannelCount>, "GetActiveChannelCount"}, - {6, D<&IAudioDevice::ListAudioDeviceNameAuto>, "ListAudioDeviceNameAuto"}, - {7, D<&IAudioDevice::SetAudioDeviceOutputVolumeAuto>, "SetAudioDeviceOutputVolumeAuto"}, - {8, D<&IAudioDevice::GetAudioDeviceOutputVolumeAuto>, "GetAudioDeviceOutputVolumeAuto"}, - {10, D<&IAudioDevice::GetActiveAudioDeviceNameAuto>, "GetActiveAudioDeviceNameAuto"}, - {11, D<&IAudioDevice::QueryAudioDeviceInputEvent>, "QueryAudioDeviceInputEvent"}, - {12, D<&IAudioDevice::QueryAudioDeviceOutputEvent>, "QueryAudioDeviceOutputEvent"}, - {13, D<&IAudioDevice::GetActiveAudioDeviceName>, "GetActiveAudioOutputDeviceName"}, - {14, D<&IAudioDevice::ListAudioOutputDeviceName>, "ListAudioOutputDeviceName"}, - {15, nullptr, "AcquireAudioInputDeviceNotification"}, //17.0.0+ - {16, nullptr, "ReleaseAudioInputDeviceNotification"}, //17.0.0+ - {17, nullptr, "AcquireAudioOutputDeviceNotification"}, //17.0.0+ - {18, nullptr, "ReleaseAudioOutputDeviceNotification"}, //17.0.0+ - {19, D<&IAudioDevice::SetAudioDeviceOutputVolumeAutoTuneEnabled>, "SetAudioDeviceOutputVolumeAutoTuneEnabled"}, //18.0.0+ - {20, D<&IAudioDevice::IsAudioDeviceOutputVolumeAutoTuneEnabled>, "IsAudioDeviceOutputVolumeAutoTuneEnabled"}, //18.0.0+ - {21, nullptr, "IsActiveOutputDeviceEstimatedLowLatency"} //21.0.0+ - }; - RegisterHandlers(functions); - event->Signal(system.Kernel()); } diff --git a/src/core/hle/service/audio/audio_device.h b/src/core/hle/service/audio/audio_device.h index f6c12fbfeb..bd0aaa5f7c 100644 --- a/src/core/hle/service/audio/audio_device.h +++ b/src/core/hle/service/audio/audio_device.h @@ -55,6 +55,7 @@ private: Result SetAudioDeviceOutputVolumeAutoTuneEnabled(bool enabled); Result IsAudioDeviceOutputVolumeAutoTuneEnabled(Out out_enabled); + std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext service_context; std::unique_ptr impl; Kernel::KEvent* event; diff --git a/src/core/hle/service/audio/audio_in.cpp b/src/core/hle/service/audio/audio_in.cpp index 6208c2d104..068574dbd2 100644 --- a/src/core/hle/service/audio/audio_in.cpp +++ b/src/core/hle/service/audio/audio_in.cpp @@ -11,35 +11,33 @@ namespace Service::Audio { using namespace AudioCore::AudioIn; +std::optional IAudioIn::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAudioIn::GetAudioInState>, "GetAudioInState"}, + FunctionInfo{1, D<&IAudioIn::Start>, "Start"}, + FunctionInfo{2, D<&IAudioIn::Stop>, "Stop"}, + FunctionInfo{3, D<&IAudioIn::AppendAudioInBuffer>, "AppendAudioInBuffer"}, + FunctionInfo{4, D<&IAudioIn::RegisterBufferEvent>, "RegisterBufferEvent"}, + FunctionInfo{5, D<&IAudioIn::GetReleasedAudioInBuffers>, "GetReleasedAudioInBuffers"}, + FunctionInfo{6, D<&IAudioIn::ContainsAudioInBuffer>, "ContainsAudioInBuffer"}, + FunctionInfo{7, D<&IAudioIn::AppendAudioInBuffer>, "AppendUacInBuffer"}, + FunctionInfo{8, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendAudioInBufferAuto"}, + FunctionInfo{9, D<&IAudioIn::GetReleasedAudioInBuffersAuto>, "GetReleasedAudioInBuffersAuto"}, + FunctionInfo{10, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendUacInBufferAuto"}, + FunctionInfo{11, D<&IAudioIn::GetAudioInBufferCount>, "GetAudioInBufferCount"}, + FunctionInfo{12, D<&IAudioIn::SetDeviceGain>, "SetDeviceGain"}, + FunctionInfo{13, D<&IAudioIn::GetDeviceGain>, "GetDeviceGain"}, + FunctionInfo{14, D<&IAudioIn::FlushAudioInBuffers>, "FlushAudioInBuffers"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAudioIn::IAudioIn(Core::System& system_, Manager& manager, size_t session_id, const std::string& device_name, const AudioInParameter& in_params, Kernel::KProcess* handle, u64 applet_resource_user_id) - : ServiceFramework{system_, "IAudioIn"}, process{handle}, service_context{system_, "IAudioIn"}, - event{service_context.CreateEvent("AudioInEvent")}, impl{std::make_shared(system_, - manager, event, - session_id)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IAudioIn::GetAudioInState>, "GetAudioInState"}, - {1, D<&IAudioIn::Start>, "Start"}, - {2, D<&IAudioIn::Stop>, "Stop"}, - {3, D<&IAudioIn::AppendAudioInBuffer>, "AppendAudioInBuffer"}, - {4, D<&IAudioIn::RegisterBufferEvent>, "RegisterBufferEvent"}, - {5, D<&IAudioIn::GetReleasedAudioInBuffers>, "GetReleasedAudioInBuffers"}, - {6, D<&IAudioIn::ContainsAudioInBuffer>, "ContainsAudioInBuffer"}, - {7, D<&IAudioIn::AppendAudioInBuffer>, "AppendUacInBuffer"}, - {8, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendAudioInBufferAuto"}, - {9, D<&IAudioIn::GetReleasedAudioInBuffersAuto>, "GetReleasedAudioInBuffersAuto"}, - {10, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendUacInBufferAuto"}, - {11, D<&IAudioIn::GetAudioInBufferCount>, "GetAudioInBufferCount"}, - {12, D<&IAudioIn::SetDeviceGain>, "SetDeviceGain"}, - {13, D<&IAudioIn::GetDeviceGain>, "GetDeviceGain"}, - {14, D<&IAudioIn::FlushAudioInBuffers>, "FlushAudioInBuffers"}, - }; - // clang-format on - - RegisterHandlers(functions); - + : ServiceFramework{system_, "IAudioIn"}, process{handle}, service_context{system_, "IAudioIn"} + , event{service_context.CreateEvent("AudioInEvent")}, impl{std::make_shared(system_, manager, event, session_id)} +{ process->Open(system.Kernel()); if (impl->GetSystem() diff --git a/src/core/hle/service/audio/audio_in.h b/src/core/hle/service/audio/audio_in.h index 3fe1e1e870..dd7a41f300 100644 --- a/src/core/hle/service/audio/audio_in.h +++ b/src/core/hle/service/audio/audio_in.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -43,6 +46,7 @@ public: Result FlushAudioInBuffers(Out out_flushed); private: + std::optional FindRequest(u32 key) override; Kernel::KProcess* process; KernelHelpers::ServiceContext service_context; Kernel::KEvent* event; diff --git a/src/core/hle/service/audio/audio_in_manager.cpp b/src/core/hle/service/audio/audio_in_manager.cpp index 2675a57735..422e72148b 100644 --- a/src/core/hle/service/audio/audio_in_manager.cpp +++ b/src/core/hle/service/audio/audio_in_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -9,23 +12,23 @@ namespace Service::Audio { using namespace AudioCore::AudioIn; -IAudioInManager::IAudioInManager(Core::System& system_) - : ServiceFramework{system_, "audin:u"}, impl{std::make_unique( - system_)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IAudioInManager::ListAudioIns>, "ListAudioIns"}, - {1, D<&IAudioInManager::OpenAudioIn>, "OpenAudioIn"}, - {2, D<&IAudioInManager::ListAudioIns>, "ListAudioInsAuto"}, - {3, D<&IAudioInManager::OpenAudioIn>, "OpenAudioInAuto"}, - {4, D<&IAudioInManager::ListAudioInsAutoFiltered>, "ListAudioInsAutoFiltered"}, - {5, D<&IAudioInManager::OpenAudioInProtocolSpecified>, "OpenAudioInProtocolSpecified"}, - }; - // clang-format on - - RegisterHandlers(functions); +std::optional IAudioInManager::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAudioInManager::ListAudioIns>, "ListAudioIns"}, + FunctionInfo{1, D<&IAudioInManager::OpenAudioIn>, "OpenAudioIn"}, + FunctionInfo{2, D<&IAudioInManager::ListAudioIns>, "ListAudioInsAuto"}, + FunctionInfo{3, D<&IAudioInManager::OpenAudioIn>, "OpenAudioInAuto"}, + FunctionInfo{4, D<&IAudioInManager::ListAudioInsAutoFiltered>, "ListAudioInsAutoFiltered"}, + FunctionInfo{5, D<&IAudioInManager::OpenAudioInProtocolSpecified>, "OpenAudioInProtocolSpecified"} + ); + return HandlerTableGenerateWithFind(key, functions); } +IAudioInManager::IAudioInManager(Core::System& system_) + : ServiceFramework{system_, "audin:u"} + , impl{std::make_unique(system_)} +{} + IAudioInManager::~IAudioInManager() = default; Result IAudioInManager::ListAudioIns( diff --git a/src/core/hle/service/audio/audio_in_manager.h b/src/core/hle/service/audio/audio_in_manager.h index 2a983bc607..0ee0badba7 100644 --- a/src/core/hle/service/audio/audio_in_manager.h +++ b/src/core/hle/service/audio/audio_in_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -51,6 +54,7 @@ private: AudioCore::AudioIn::AudioInParameter parameter, InCopyHandle process_handle, ClientAppletResourceUserId aruid); + std::optional FindRequest(u32 key) override; std::unique_ptr impl; }; diff --git a/src/core/hle/service/audio/audio_out.cpp b/src/core/hle/service/audio/audio_out.cpp index 996eeede58..a5f06faab8 100644 --- a/src/core/hle/service/audio/audio_out.cpp +++ b/src/core/hle/service/audio/audio_out.cpp @@ -15,6 +15,26 @@ namespace Service::Audio { using namespace AudioCore::AudioOut; +std::optional IAudioOut::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAudioOut::GetAudioOutState>, "GetAudioOutState"}, + FunctionInfo{1, D<&IAudioOut::Start>, "Start"}, + FunctionInfo{2, D<&IAudioOut::Stop>, "Stop"}, + FunctionInfo{3, D<&IAudioOut::AppendAudioOutBuffer>, "AppendAudioOutBuffer"}, + FunctionInfo{4, D<&IAudioOut::RegisterBufferEvent>, "RegisterBufferEvent"}, + FunctionInfo{5, D<&IAudioOut::GetReleasedAudioOutBuffers>, "GetReleasedAudioOutBuffers"}, + FunctionInfo{6, D<&IAudioOut::ContainsAudioOutBuffer>, "ContainsAudioOutBuffer"}, + FunctionInfo{7, D<&IAudioOut::AppendAudioOutBufferAuto>, "AppendAudioOutBufferAuto"}, + FunctionInfo{8, D<&IAudioOut::GetReleasedAudioOutBuffersAuto>, "GetReleasedAudioOutBuffersAuto"}, + FunctionInfo{9, D<&IAudioOut::GetAudioOutBufferCount>, "GetAudioOutBufferCount"}, + FunctionInfo{10, D<&IAudioOut::GetAudioOutPlayedSampleCount>, "GetAudioOutPlayedSampleCount"}, + FunctionInfo{11, D<&IAudioOut::FlushAudioOutBuffers>, "FlushAudioOutBuffers"}, + FunctionInfo{12, D<&IAudioOut::SetAudioOutVolume>, "SetAudioOutVolume"}, + FunctionInfo{13, D<&IAudioOut::GetAudioOutVolume>, "GetAudioOutVolume"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAudioOut::IAudioOut(Core::System& system_, Manager& manager, size_t session_id, const std::string& device_name, const AudioOutParameter& in_params, Kernel::KProcess* handle, u64 applet_resource_user_id) @@ -22,26 +42,6 @@ IAudioOut::IAudioOut(Core::System& system_, Manager& manager, size_t session_id, event{service_context.CreateEvent("AudioOutEvent")}, process{handle}, impl{std::make_shared(system_, manager, event, session_id)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IAudioOut::GetAudioOutState>, "GetAudioOutState"}, - {1, D<&IAudioOut::Start>, "Start"}, - {2, D<&IAudioOut::Stop>, "Stop"}, - {3, D<&IAudioOut::AppendAudioOutBuffer>, "AppendAudioOutBuffer"}, - {4, D<&IAudioOut::RegisterBufferEvent>, "RegisterBufferEvent"}, - {5, D<&IAudioOut::GetReleasedAudioOutBuffers>, "GetReleasedAudioOutBuffers"}, - {6, D<&IAudioOut::ContainsAudioOutBuffer>, "ContainsAudioOutBuffer"}, - {7, D<&IAudioOut::AppendAudioOutBufferAuto>, "AppendAudioOutBufferAuto"}, - {8, D<&IAudioOut::GetReleasedAudioOutBuffersAuto>, "GetReleasedAudioOutBuffersAuto"}, - {9, D<&IAudioOut::GetAudioOutBufferCount>, "GetAudioOutBufferCount"}, - {10, D<&IAudioOut::GetAudioOutPlayedSampleCount>, "GetAudioOutPlayedSampleCount"}, - {11, D<&IAudioOut::FlushAudioOutBuffers>, "FlushAudioOutBuffers"}, - {12, D<&IAudioOut::SetAudioOutVolume>, "SetAudioOutVolume"}, - {13, D<&IAudioOut::GetAudioOutVolume>, "GetAudioOutVolume"}, - }; - // clang-format on - RegisterHandlers(functions); - process->Open(system.Kernel()); } diff --git a/src/core/hle/service/audio/audio_out.h b/src/core/hle/service/audio/audio_out.h index 779b213e78..311eb84afe 100644 --- a/src/core/hle/service/audio/audio_out.h +++ b/src/core/hle/service/audio/audio_out.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -49,6 +52,8 @@ public: Result GetAudioOutVolume(Out out_volume); private: + std::optional FindRequest(u32 key) override; + KernelHelpers::ServiceContext service_context; Kernel::KEvent* event; Kernel::KProcess* process; diff --git a/src/core/hle/service/audio/audio_out_manager.cpp b/src/core/hle/service/audio/audio_out_manager.cpp index 3b2087932c..9f24bc3513 100644 --- a/src/core/hle/service/audio/audio_out_manager.cpp +++ b/src/core/hle/service/audio/audio_out_manager.cpp @@ -13,20 +13,20 @@ namespace Service::Audio { using namespace AudioCore::AudioOut; +std::optional IAudioOutManager::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAudioOutManager::ListAudioOuts>, "ListAudioOuts"}, + FunctionInfo{1, D<&IAudioOutManager::OpenAudioOut>, "OpenAudioOut"}, + FunctionInfo{2, D<&IAudioOutManager::ListAudioOutsAuto>, "ListAudioOutsAuto"}, + FunctionInfo{3, D<&IAudioOutManager::OpenAudioOutAuto>, "OpenAudioOutAuto"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAudioOutManager::IAudioOutManager(Core::System& system_) : ServiceFramework{system_, "audout:u"} , impl(system_) { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IAudioOutManager::ListAudioOuts>, "ListAudioOuts"}, - {1, D<&IAudioOutManager::OpenAudioOut>, "OpenAudioOut"}, - {2, D<&IAudioOutManager::ListAudioOutsAuto>, "ListAudioOutsAuto"}, - {3, D<&IAudioOutManager::OpenAudioOutAuto>, "OpenAudioOutAuto"}, - }; - // clang-format on - - RegisterHandlers(functions); } IAudioOutManager::~IAudioOutManager() = default; diff --git a/src/core/hle/service/audio/audio_out_manager.h b/src/core/hle/service/audio/audio_out_manager.h index ec974aaba4..4c71c12cdf 100644 --- a/src/core/hle/service/audio/audio_out_manager.h +++ b/src/core/hle/service/audio/audio_out_manager.h @@ -43,6 +43,7 @@ private: AudioCore::AudioOut::AudioOutParameter parameter, InCopyHandle process_handle, ClientAppletResourceUserId aruid); + std::optional FindRequest(u32 key) override; std::optional impl; }; diff --git a/src/core/hle/service/audio/audio_renderer.cpp b/src/core/hle/service/audio/audio_renderer.cpp index dd76544094..bcb2adaf61 100644 --- a/src/core/hle/service/audio/audio_renderer.cpp +++ b/src/core/hle/service/audio/audio_renderer.cpp @@ -10,38 +10,37 @@ namespace Service::Audio { using namespace AudioCore::Renderer; +std::optional IAudioRenderer::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAudioRenderer::GetSampleRate>, "GetSampleRate"}, + FunctionInfo{1, D<&IAudioRenderer::GetSampleCount>, "GetSampleCount"}, + FunctionInfo{2, D<&IAudioRenderer::GetMixBufferCount>, "GetMixBufferCount"}, + FunctionInfo{3, D<&IAudioRenderer::GetState>, "GetState"}, + FunctionInfo{4, D<&IAudioRenderer::RequestUpdate>, "RequestUpdate"}, + FunctionInfo{5, D<&IAudioRenderer::Start>, "Start"}, + FunctionInfo{6, D<&IAudioRenderer::Stop>, "Stop"}, + FunctionInfo{7, D<&IAudioRenderer::QuerySystemEvent>, "QuerySystemEvent"}, + FunctionInfo{8, D<&IAudioRenderer::SetRenderingTimeLimit>, "SetRenderingTimeLimit"}, + FunctionInfo{9, D<&IAudioRenderer::GetRenderingTimeLimit>, "GetRenderingTimeLimit"}, + FunctionInfo{10, D<&IAudioRenderer::RequestUpdateAuto>, "RequestUpdateAuto", MakeVersionGate({3,0,0})}, + FunctionInfo{11, nullptr, "ExecuteAudioRendererRendering", MakeVersionGate({3,0,0})}, + FunctionInfo{12, D<&IAudioRenderer::SetVoiceDropParameter>, "SetVoiceDropParameter", MakeVersionGate({15,0,0})}, + FunctionInfo{13, D<&IAudioRenderer::GetVoiceDropParameter>, "GetVoiceDropParameter", MakeVersionGate({15,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAudioRenderer::IAudioRenderer(Core::System& system_, Manager& manager_, AudioCore::AudioRendererParameterInternal& params, Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, Kernel::KProcess* process_handle_, u64 applet_resource_user_id, s32 session_id) - : ServiceFramework{system_, "IAudioRenderer"}, service_context{system_, "IAudioRenderer"}, - rendered_event{service_context.CreateEvent("IAudioRendererEvent")}, manager{manager_}, - impl{std::make_unique(system_, manager, rendered_event)}, process_handle{ - process_handle_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IAudioRenderer::GetSampleRate>, "GetSampleRate"}, - {1, D<&IAudioRenderer::GetSampleCount>, "GetSampleCount"}, - {2, D<&IAudioRenderer::GetMixBufferCount>, "GetMixBufferCount"}, - {3, D<&IAudioRenderer::GetState>, "GetState"}, - {4, D<&IAudioRenderer::RequestUpdate>, "RequestUpdate"}, - {5, D<&IAudioRenderer::Start>, "Start"}, - {6, D<&IAudioRenderer::Stop>, "Stop"}, - {7, D<&IAudioRenderer::QuerySystemEvent>, "QuerySystemEvent"}, - {8, D<&IAudioRenderer::SetRenderingTimeLimit>, "SetRenderingTimeLimit"}, - {9, D<&IAudioRenderer::GetRenderingTimeLimit>, "GetRenderingTimeLimit"}, - {10, D<&IAudioRenderer::RequestUpdateAuto>, "RequestUpdateAuto"}, //3.0.0+ - {11, nullptr, "ExecuteAudioRendererRendering"}, //3.0.0+ - {12, D<&IAudioRenderer::SetVoiceDropParameter>, "SetVoiceDropParameter"}, //15.0.0+ - {13, D<&IAudioRenderer::GetVoiceDropParameter>, "GetVoiceDropParameter"}, //15.0.0+ - }; - // clang-format on - RegisterHandlers(functions); - + : ServiceFramework{system_, "IAudioRenderer"}, service_context{system_, "IAudioRenderer"} + , rendered_event{service_context.CreateEvent("IAudioRendererEvent")}, manager{manager_} + , impl{std::make_unique(system_, manager, rendered_event)} + , process_handle{process_handle_} { process_handle->Open(system_.Kernel()); - impl->Initialize(params, transfer_memory, transfer_memory_size, process_handle, - applet_resource_user_id, session_id); + impl->Initialize(params, transfer_memory, transfer_memory_size, process_handle, applet_resource_user_id, session_id); } IAudioRenderer::~IAudioRenderer() { diff --git a/src/core/hle/service/audio/audio_renderer.h b/src/core/hle/service/audio/audio_renderer.h index f25c50ce8d..e03fc6551d 100644 --- a/src/core/hle/service/audio/audio_renderer.h +++ b/src/core/hle/service/audio/audio_renderer.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -42,6 +45,7 @@ private: Result SetVoiceDropParameter(f32 voice_drop_parameter); Result GetVoiceDropParameter(Out out_voice_drop_parameter); + std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext service_context; Kernel::KEvent* rendered_event; AudioCore::Renderer::Manager& manager; diff --git a/src/core/hle/service/audio/audio_renderer_manager.cpp b/src/core/hle/service/audio/audio_renderer_manager.cpp index 4756802eeb..98701c79c1 100644 --- a/src/core/hle/service/audio/audio_renderer_manager.cpp +++ b/src/core/hle/service/audio/audio_renderer_manager.cpp @@ -18,21 +18,21 @@ namespace Service::Audio { using namespace AudioCore::Renderer; +std::optional IAudioRendererManager::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAudioRendererManager::OpenAudioRenderer>, "OpenAudioRenderer"}, + FunctionInfo{1, D<&IAudioRendererManager::GetWorkBufferSize>, "GetWorkBufferSize"}, + FunctionInfo{2, D<&IAudioRendererManager::GetAudioDeviceService>, "GetAudioDeviceService"}, + FunctionInfo{3, nullptr, "OpenAudioRendererForManualExecution"}, + FunctionInfo{4, D<&IAudioRendererManager::GetAudioDeviceServiceWithRevisionInfo>, "GetAudioDeviceServiceWithRevisionInfo"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAudioRendererManager::IAudioRendererManager(Core::System& system_) : ServiceFramework{system_, "audren:u"} , impl(system_) { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IAudioRendererManager::OpenAudioRenderer>, "OpenAudioRenderer"}, - {1, D<&IAudioRendererManager::GetWorkBufferSize>, "GetWorkBufferSize"}, - {2, D<&IAudioRendererManager::GetAudioDeviceService>, "GetAudioDeviceService"}, - {3, nullptr, "OpenAudioRendererForManualExecution"}, - {4, D<&IAudioRendererManager::GetAudioDeviceServiceWithRevisionInfo>, "GetAudioDeviceServiceWithRevisionInfo"}, - }; - // clang-format on - - RegisterHandlers(functions); } IAudioRendererManager::~IAudioRendererManager() = default; diff --git a/src/core/hle/service/audio/audio_renderer_manager.h b/src/core/hle/service/audio/audio_renderer_manager.h index fdce8b6ffa..bd3ea06326 100644 --- a/src/core/hle/service/audio/audio_renderer_manager.h +++ b/src/core/hle/service/audio/audio_renderer_manager.h @@ -33,6 +33,7 @@ private: Result GetAudioDeviceServiceWithRevisionInfo(Out> out_audio_device, u32 revision, ClientAppletResourceUserId aruid); + std::optional FindRequest(u32 key) override; std::optional impl; u32 num_audio_devices{0}; }; diff --git a/src/core/hle/service/audio/final_output_recorder_manager.cpp b/src/core/hle/service/audio/final_output_recorder_manager.cpp index f70a0e62d7..9c51613de6 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager.cpp +++ b/src/core/hle/service/audio/final_output_recorder_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -8,34 +11,29 @@ namespace Service::Audio { class IFinalOutputRecorder final : public ServiceFramework { public: explicit IFinalOutputRecorder(Core::System& system_) - : ServiceFramework{system_, "IFinalOutputRecorder"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetFinalOutputRecorderState"}, - {1, nullptr, "Start"}, - {2, nullptr, "Stop"}, - {3, nullptr, "AppendFinalOutputRecorderBuffer"}, - {4, nullptr, "RegisterBufferEvent"}, - {5, nullptr, "GetReleasedFinalOutputRecorderBuffers"}, - {6, nullptr, "ContainsFinalOutputRecorderBuffer"}, - {7, nullptr, "GetFinalOutputRecorderBufferEndTime"}, - {8, nullptr, "AppendFinalOutputRecorderBufferAuto"}, - {9, nullptr, "GetReleasedFinalOutputRecorderBufferAuto"}, - {10, nullptr, "FlushFinalOutputRecorderBuffers"}, - {11, nullptr, "AttachWorkBuffer"}, - }; - // clang-format on + : ServiceFramework{system_, "IFinalOutputRecorder"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetFinalOutputRecorderState"}, + FunctionInfo{1, nullptr, "Start"}, + FunctionInfo{2, nullptr, "Stop"}, + FunctionInfo{3, nullptr, "AppendFinalOutputRecorderBuffer"}, + FunctionInfo{4, nullptr, "RegisterBufferEvent"}, + FunctionInfo{5, nullptr, "GetReleasedFinalOutputRecorderBuffers"}, + FunctionInfo{6, nullptr, "ContainsFinalOutputRecorderBuffer"}, + FunctionInfo{7, nullptr, "GetFinalOutputRecorderBufferEndTime"}, + FunctionInfo{8, nullptr, "AppendFinalOutputRecorderBufferAuto"}, + FunctionInfo{9, nullptr, "GetReleasedFinalOutputRecorderBufferAuto"}, + FunctionInfo{10, nullptr, "FlushFinalOutputRecorderBuffers"}, + FunctionInfo{11, nullptr, "AttachWorkBuffer"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; IFinalOutputRecorderManager::IFinalOutputRecorderManager(Core::System& system_) : ServiceFramework{system_, "audrec:u"} { - static const FunctionInfo functions[] = { - {0, nullptr, "OpenFinalOutputRecorder"}, - }; - RegisterHandlers(functions); } IFinalOutputRecorderManager::~IFinalOutputRecorderManager() = default; diff --git a/src/core/hle/service/audio/final_output_recorder_manager.h b/src/core/hle/service/audio/final_output_recorder_manager.h index 0663b894e7..ee392b2ada 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager.h +++ b/src/core/hle/service/audio/final_output_recorder_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,13 @@ class IFinalOutputRecorderManager final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenFinalOutputRecorder"} + ); }; } // namespace Service::Audio diff --git a/src/core/hle/service/audio/final_output_recorder_manager_for_applet.cpp b/src/core/hle/service/audio/final_output_recorder_manager_for_applet.cpp index 7e2e42bbe7..42c08d90ec 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager_for_applet.cpp +++ b/src/core/hle/service/audio/final_output_recorder_manager_for_applet.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,14 +10,6 @@ namespace Service::Audio { IFinalOutputRecorderManagerForApplet::IFinalOutputRecorderManagerForApplet(Core::System& system_) : ServiceFramework{system_, "audrec:a"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestSuspend"}, - {1, nullptr, "RequestResume"}, - }; - // clang-format on - - RegisterHandlers(functions); } IFinalOutputRecorderManagerForApplet::~IFinalOutputRecorderManagerForApplet() = default; diff --git a/src/core/hle/service/audio/final_output_recorder_manager_for_applet.h b/src/core/hle/service/audio/final_output_recorder_manager_for_applet.h index 27940f7e0d..7beaa888ff 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager_for_applet.h +++ b/src/core/hle/service/audio/final_output_recorder_manager_for_applet.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -16,6 +19,14 @@ class IFinalOutputRecorderManagerForApplet final public: explicit IFinalOutputRecorderManagerForApplet(Core::System& system_); ~IFinalOutputRecorderManagerForApplet() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestSuspend"}, + FunctionInfo{1, nullptr, "RequestResume"} + ); }; } // namespace Service::Audio diff --git a/src/core/hle/service/audio/hardware_opus_decoder.cpp b/src/core/hle/service/audio/hardware_opus_decoder.cpp index 03d3374c14..f0dde63e14 100644 --- a/src/core/hle/service/audio/hardware_opus_decoder.cpp +++ b/src/core/hle/service/audio/hardware_opus_decoder.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -8,25 +11,25 @@ namespace Service::Audio { using namespace AudioCore::OpusDecoder; + std::optional IHardwareOpusDecoder::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IHardwareOpusDecoder::DecodeInterleavedOld>, "DecodeInterleavedOld"}, + FunctionInfo{1, D<&IHardwareOpusDecoder::SetContext>, "SetContext"}, + FunctionInfo{2, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamOld>, "DecodeInterleavedForMultiStreamOld"}, + FunctionInfo{3, D<&IHardwareOpusDecoder::SetContextForMultiStream>, "SetContextForMultiStream"}, + FunctionInfo{4, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfOld>, "DecodeInterleavedWithPerfOld"}, + FunctionInfo{5, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfOld>, "DecodeInterleavedForMultiStreamWithPerfOld"}, + FunctionInfo{6, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfAndResetOld>, "DecodeInterleavedWithPerfAndResetOld"}, + FunctionInfo{7, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfAndResetOld>, "DecodeInterleavedForMultiStreamWithPerfAndResetOld"}, + FunctionInfo{8, D<&IHardwareOpusDecoder::DecodeInterleaved>, "DecodeInterleaved"}, + FunctionInfo{9, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStream>, "DecodeInterleavedForMultiStream"} + ); + return HandlerTableGenerateWithFind(key, functions); + } + IHardwareOpusDecoder::IHardwareOpusDecoder(Core::System& system_, HardwareOpus& hardware_opus) : ServiceFramework{system_, "IHardwareOpusDecoder"}, impl{std::make_unique(system_, hardware_opus)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IHardwareOpusDecoder::DecodeInterleavedOld>, "DecodeInterleavedOld"}, - {1, D<&IHardwareOpusDecoder::SetContext>, "SetContext"}, - {2, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamOld>, "DecodeInterleavedForMultiStreamOld"}, - {3, D<&IHardwareOpusDecoder::SetContextForMultiStream>, "SetContextForMultiStream"}, - {4, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfOld>, "DecodeInterleavedWithPerfOld"}, - {5, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfOld>, "DecodeInterleavedForMultiStreamWithPerfOld"}, - {6, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfAndResetOld>, "DecodeInterleavedWithPerfAndResetOld"}, - {7, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfAndResetOld>, "DecodeInterleavedForMultiStreamWithPerfAndResetOld"}, - {8, D<&IHardwareOpusDecoder::DecodeInterleaved>, "DecodeInterleaved"}, - {9, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStream>, "DecodeInterleavedForMultiStream"}, - }; - // clang-format on - - RegisterHandlers(functions); } IHardwareOpusDecoder::~IHardwareOpusDecoder() = default; diff --git a/src/core/hle/service/audio/hardware_opus_decoder.h b/src/core/hle/service/audio/hardware_opus_decoder.h index 511bf46bdb..9f9b17bc81 100644 --- a/src/core/hle/service/audio/hardware_opus_decoder.h +++ b/src/core/hle/service/audio/hardware_opus_decoder.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -55,6 +58,7 @@ private: Out out_data_size, Out out_sample_count, Out out_time_taken, InBuffer opus_data, bool reset); + std::optional FindRequest(u32 key) override; std::unique_ptr impl; Common::ScratchBuffer output_data; diff --git a/src/core/hle/service/audio/hardware_opus_decoder_manager.cpp b/src/core/hle/service/audio/hardware_opus_decoder_manager.cpp index 9de72e30fe..3000ba8c60 100644 --- a/src/core/hle/service/audio/hardware_opus_decoder_manager.cpp +++ b/src/core/hle/service/audio/hardware_opus_decoder_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -9,23 +12,24 @@ namespace Service::Audio { using namespace AudioCore::OpusDecoder; +std::optional IHardwareOpusDecoderManager::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoder>, "OpenHardwareOpusDecoder"}, + FunctionInfo{1, D<&IHardwareOpusDecoderManager::GetWorkBufferSize>, "GetWorkBufferSize"}, + FunctionInfo{2, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStream>, "OpenOpusDecoderForMultiStream"}, + FunctionInfo{3, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStream>, "GetWorkBufferSizeForMultiStream"}, + FunctionInfo{4, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderEx>, "OpenHardwareOpusDecoderEx"}, + FunctionInfo{5, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeEx>, "GetWorkBufferSizeEx"}, + FunctionInfo{6, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStreamEx>, "OpenHardwareOpusDecoderForMultiStreamEx"}, + FunctionInfo{7, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamEx>, "GetWorkBufferSizeForMultiStreamEx"}, + FunctionInfo{8, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeExEx>, "GetWorkBufferSizeExEx"}, + FunctionInfo{9, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamExEx>, "GetWorkBufferSizeForMultiStreamExEx"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IHardwareOpusDecoderManager::IHardwareOpusDecoderManager(Core::System& system_) : ServiceFramework{system_, "hwopus"}, system{system_}, impl{system} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoder>, "OpenHardwareOpusDecoder"}, - {1, D<&IHardwareOpusDecoderManager::GetWorkBufferSize>, "GetWorkBufferSize"}, - {2, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStream>, "OpenOpusDecoderForMultiStream"}, - {3, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStream>, "GetWorkBufferSizeForMultiStream"}, - {4, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderEx>, "OpenHardwareOpusDecoderEx"}, - {5, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeEx>, "GetWorkBufferSizeEx"}, - {6, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStreamEx>, "OpenHardwareOpusDecoderForMultiStreamEx"}, - {7, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamEx>, "GetWorkBufferSizeForMultiStreamEx"}, - {8, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeExEx>, "GetWorkBufferSizeExEx"}, - {9, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamExEx>, "GetWorkBufferSizeForMultiStreamExEx"}, - }; - // clang-format on - RegisterHandlers(functions); } IHardwareOpusDecoderManager::~IHardwareOpusDecoderManager() = default; diff --git a/src/core/hle/service/audio/hardware_opus_decoder_manager.h b/src/core/hle/service/audio/hardware_opus_decoder_manager.h index 4f869c5174..1dbac9addb 100644 --- a/src/core/hle/service/audio/hardware_opus_decoder_manager.h +++ b/src/core/hle/service/audio/hardware_opus_decoder_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -46,6 +49,7 @@ private: Result GetWorkBufferSizeForMultiStreamExEx( Out out_size, InLargeData params); + std::optional FindRequest(u32 key) override; Core::System& system; AudioCore::OpusDecoder::OpusDecoderManager impl; }; diff --git a/src/core/hle/service/bcat/bcat_service.cpp b/src/core/hle/service/bcat/bcat_service.cpp index bc2a3e3457..85f262f6eb 100644 --- a/src/core/hle/service/bcat/bcat_service.cpp +++ b/src/core/hle/service/bcat/bcat_service.cpp @@ -24,45 +24,46 @@ static u64 GetCurrentBuildID(const Core::System::CurrentBuildProcessID& id) { return out; } -IBcatService::IBcatService(Core::System& system_, BcatBackend& backend_, u64 program_id_) - : ServiceFramework{system_, "IBcatService"}, backend{backend_}, program_id{program_id_}, - progress{{ - ProgressServiceBackend{system_, "Normal"}, - ProgressServiceBackend{system_, "Directory"}, - }} { - // clang-format off - static const FunctionInfo functions[] = { - {10100, D<&IBcatService::RequestSyncDeliveryCache>, "RequestSyncDeliveryCache"}, - {10101, D<&IBcatService::RequestSyncDeliveryCacheWithDirectoryName>, "RequestSyncDeliveryCacheWithDirectoryName"}, - {10200, nullptr, "CancelSyncDeliveryCacheRequest"}, - {20100, nullptr, "RequestSyncDeliveryCacheWithApplicationId"}, - {20101, nullptr, "RequestSyncDeliveryCacheWithApplicationIdAndDirectoryName"}, - {20300, nullptr, "GetDeliveryCacheStorageUpdateNotifier"}, - {20301, nullptr, "RequestSuspendDeliveryTask"}, - {20400, nullptr, "RegisterSystemApplicationDeliveryTask"}, - {20401, nullptr, "UnregisterSystemApplicationDeliveryTask"}, - {20410, nullptr, "SetSystemApplicationDeliveryTaskTimer"}, - {30100, D<&IBcatService::SetPassphrase>, "SetPassphrase"}, - {30101, nullptr, "Unknown30101"}, //2.0.0-2.3.0 - {30102, nullptr, "Unknown30102"}, //2.0.0-2.3.0 - {30200, nullptr, "RegisterBackgroundDeliveryTask"}, - {30201, nullptr, "UnregisterBackgroundDeliveryTask"}, - {30202, nullptr, "BlockDeliveryTask"}, - {30203, nullptr, "UnblockDeliveryTask"}, - {30210, nullptr, "SetDeliveryTaskTimer"}, - {30300, D<&IBcatService::RegisterSystemApplicationDeliveryTasks>, "RegisterSystemApplicationDeliveryTasks"}, - {90100, nullptr, "GetDeliveryTaskList"}, - {90101, nullptr, "GetDeliveryTaskListForSystem"}, //11.0.0+ - {90200, nullptr, "GetDeliveryList"}, - {90201, D<&IBcatService::ClearDeliveryCacheStorage>, "ClearDeliveryCacheStorage"}, - {90202, nullptr, "ClearDeliveryTaskSubscriptionStatus"}, - {90300, nullptr, "GetPushNotificationLog"}, - {90301, nullptr, "GetDeliveryCacheStorageUsage"}, //11.0.0+ - }; - // clang-format on - RegisterHandlers(functions); +std::optional IBcatService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{10100, D<&IBcatService::RequestSyncDeliveryCache>, "RequestSyncDeliveryCache"}, + FunctionInfo{10101, D<&IBcatService::RequestSyncDeliveryCacheWithDirectoryName>, "RequestSyncDeliveryCacheWithDirectoryName"}, + FunctionInfo{10200, nullptr, "CancelSyncDeliveryCacheRequest"}, + FunctionInfo{20100, nullptr, "RequestSyncDeliveryCacheWithApplicationId"}, + FunctionInfo{20101, nullptr, "RequestSyncDeliveryCacheWithApplicationIdAndDirectoryName"}, + FunctionInfo{20300, nullptr, "GetDeliveryCacheStorageUpdateNotifier"}, + FunctionInfo{20301, nullptr, "RequestSuspendDeliveryTask"}, + FunctionInfo{20400, nullptr, "RegisterSystemApplicationDeliveryTask"}, + FunctionInfo{20401, nullptr, "UnregisterSystemApplicationDeliveryTask"}, + FunctionInfo{20410, nullptr, "SetSystemApplicationDeliveryTaskTimer"}, + FunctionInfo{30100, D<&IBcatService::SetPassphrase>, "SetPassphrase"}, + FunctionInfo{30101, nullptr, "Unknown30101", MakeVersionGate({2,0,0}, {2,3,0})}, + FunctionInfo{30102, nullptr, "Unknown30102", MakeVersionGate({2,0,0}, {2,3,0})}, + FunctionInfo{30200, nullptr, "RegisterBackgroundDeliveryTask"}, + FunctionInfo{30201, nullptr, "UnregisterBackgroundDeliveryTask"}, + FunctionInfo{30202, nullptr, "BlockDeliveryTask"}, + FunctionInfo{30203, nullptr, "UnblockDeliveryTask"}, + FunctionInfo{30210, nullptr, "SetDeliveryTaskTimer"}, + FunctionInfo{30300, D<&IBcatService::RegisterSystemApplicationDeliveryTasks>, "RegisterSystemApplicationDeliveryTasks"}, + FunctionInfo{90100, nullptr, "GetDeliveryTaskList"}, + FunctionInfo{90101, nullptr, "GetDeliveryTaskListForSystem", MakeVersionGate({11,0,0})}, + FunctionInfo{90200, nullptr, "GetDeliveryList"}, + FunctionInfo{90201, D<&IBcatService::ClearDeliveryCacheStorage>, "ClearDeliveryCacheStorage"}, + FunctionInfo{90202, nullptr, "ClearDeliveryTaskSubscriptionStatus"}, + FunctionInfo{90300, nullptr, "GetPushNotificationLog"}, + FunctionInfo{90301, nullptr, "GetDeliveryCacheStorageUsage", MakeVersionGate({11,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); } +IBcatService::IBcatService(Core::System& system_, BcatBackend& backend_, u64 program_id_) + : ServiceFramework{system_, "IBcatService"}, backend{backend_}, program_id{program_id_} + , progress{{ + ProgressServiceBackend{system_, "Normal"}, + ProgressServiceBackend{system_, "Directory"}, + }} +{} + IBcatService::~IBcatService() = default; Result IBcatService::RequestSyncDeliveryCache( diff --git a/src/core/hle/service/bcat/bcat_service.h b/src/core/hle/service/bcat/bcat_service.h index 5e11059a78..ed95f021d0 100644 --- a/src/core/hle/service/bcat/bcat_service.h +++ b/src/core/hle/service/bcat/bcat_service.h @@ -41,6 +41,7 @@ private: ProgressServiceBackend& GetProgressBackend(SyncType type); const ProgressServiceBackend& GetProgressBackend(SyncType type) const; + std::optional FindRequest(u32 key) override; BcatBackend& backend; u64 program_id; std::array(SyncType::Count)> progress; diff --git a/src/core/hle/service/bcat/delivery_cache_directory_service.cpp b/src/core/hle/service/bcat/delivery_cache_directory_service.cpp index 8ead0bae99..0d464a2fdc 100644 --- a/src/core/hle/service/bcat/delivery_cache_directory_service.cpp +++ b/src/core/hle/service/bcat/delivery_cache_directory_service.cpp @@ -27,18 +27,18 @@ static BcatDigest DigestFile(const FileSys::VirtualFile& file) { return out; } +std::optional IDeliveryCacheDirectoryService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IDeliveryCacheDirectoryService::Open>, "Open"}, + FunctionInfo{1, D<&IDeliveryCacheDirectoryService::Read>, "Read"}, + FunctionInfo{2, D<&IDeliveryCacheDirectoryService::GetCount>, "GetCount"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IDeliveryCacheDirectoryService::IDeliveryCacheDirectoryService(Core::System& system_, FileSys::VirtualDir root_) : ServiceFramework{system_, "IDeliveryCacheDirectoryService"}, root(std::move(root_)) { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IDeliveryCacheDirectoryService::Open>, "Open"}, - {1, D<&IDeliveryCacheDirectoryService::Read>, "Read"}, - {2, D<&IDeliveryCacheDirectoryService::GetCount>, "GetCount"}, - }; - // clang-format on - - RegisterHandlers(functions); } IDeliveryCacheDirectoryService::~IDeliveryCacheDirectoryService() = default; diff --git a/src/core/hle/service/bcat/delivery_cache_directory_service.h b/src/core/hle/service/bcat/delivery_cache_directory_service.h index b902c64959..af90680390 100644 --- a/src/core/hle/service/bcat/delivery_cache_directory_service.h +++ b/src/core/hle/service/bcat/delivery_cache_directory_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -26,6 +29,7 @@ private: OutArray out_buffer); Result GetCount(Out out_count); + std::optional FindRequest(u32 key) override; FileSys::VirtualDir root; FileSys::VirtualDir current_dir; }; diff --git a/src/core/hle/service/bcat/delivery_cache_file_service.cpp b/src/core/hle/service/bcat/delivery_cache_file_service.cpp index b75fac4bfe..d9b6ff77ee 100644 --- a/src/core/hle/service/bcat/delivery_cache_file_service.cpp +++ b/src/core/hle/service/bcat/delivery_cache_file_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -9,19 +12,19 @@ namespace Service::BCAT { +std::optional IDeliveryCacheFileService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IDeliveryCacheFileService::Open>, "Open"}, + FunctionInfo{1, D<&IDeliveryCacheFileService::Read>, "Read"}, + FunctionInfo{2, D<&IDeliveryCacheFileService::GetSize>, "GetSize"}, + FunctionInfo{3, D<&IDeliveryCacheFileService::GetDigest>, "GetDigest"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IDeliveryCacheFileService::IDeliveryCacheFileService(Core::System& system_, FileSys::VirtualDir root_) : ServiceFramework{system_, "IDeliveryCacheFileService"}, root(std::move(root_)) { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IDeliveryCacheFileService::Open>, "Open"}, - {1, D<&IDeliveryCacheFileService::Read>, "Read"}, - {2, D<&IDeliveryCacheFileService::GetSize>, "GetSize"}, - {3, D<&IDeliveryCacheFileService::GetDigest>, "GetDigest"}, - }; - // clang-format on - - RegisterHandlers(functions); } IDeliveryCacheFileService::~IDeliveryCacheFileService() = default; diff --git a/src/core/hle/service/bcat/delivery_cache_file_service.h b/src/core/hle/service/bcat/delivery_cache_file_service.h index e1012e6873..176c8eb3e5 100644 --- a/src/core/hle/service/bcat/delivery_cache_file_service.h +++ b/src/core/hle/service/bcat/delivery_cache_file_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -26,6 +29,7 @@ private: Result GetSize(Out out_size); Result GetDigest(Out out_digest); + std::optional FindRequest(u32 key) override; FileSys::VirtualDir root; FileSys::VirtualFile current_file; }; diff --git a/src/core/hle/service/bcat/delivery_cache_progress_service.cpp b/src/core/hle/service/bcat/delivery_cache_progress_service.cpp index 79e7e0d957..4de42dd580 100644 --- a/src/core/hle/service/bcat/delivery_cache_progress_service.cpp +++ b/src/core/hle/service/bcat/delivery_cache_progress_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,18 +10,18 @@ namespace Service::BCAT { +std::optional IDeliveryCacheProgressService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IDeliveryCacheProgressService::GetEvent>, "GetEvent"}, + FunctionInfo{1, D<&IDeliveryCacheProgressService::GetImpl>, "GetImpl"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IDeliveryCacheProgressService::IDeliveryCacheProgressService(Core::System& system_, Kernel::KReadableEvent& event_, const DeliveryCacheProgressImpl& impl_) : ServiceFramework{system_, "IDeliveryCacheProgressService"}, event{event_}, impl{impl_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IDeliveryCacheProgressService::GetEvent>, "Get"}, - {1, D<&IDeliveryCacheProgressService::GetImpl>, "Get"}, - }; - // clang-format on - - RegisterHandlers(functions); } IDeliveryCacheProgressService::~IDeliveryCacheProgressService() = default; diff --git a/src/core/hle/service/bcat/delivery_cache_progress_service.h b/src/core/hle/service/bcat/delivery_cache_progress_service.h index f81a139806..88f49cea85 100644 --- a/src/core/hle/service/bcat/delivery_cache_progress_service.h +++ b/src/core/hle/service/bcat/delivery_cache_progress_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -28,6 +31,7 @@ private: Result GetEvent(OutCopyHandle out_event); Result GetImpl(OutLargeData out_impl); + std::optional FindRequest(u32 key) override; Kernel::KReadableEvent& event; const DeliveryCacheProgressImpl& impl; }; diff --git a/src/core/hle/service/bcat/delivery_cache_storage_service.cpp b/src/core/hle/service/bcat/delivery_cache_storage_service.cpp index 46ed4dae67..67dc857642 100644 --- a/src/core/hle/service/bcat/delivery_cache_storage_service.cpp +++ b/src/core/hle/service/bcat/delivery_cache_storage_service.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -12,18 +12,18 @@ namespace Service::BCAT { +std::optional IDeliveryCacheStorageService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IDeliveryCacheStorageService::CreateFileService>, "CreateFileService"}, + FunctionInfo{1, D<&IDeliveryCacheStorageService::CreateDirectoryService>, "CreateDirectoryService"}, + FunctionInfo{10, D<&IDeliveryCacheStorageService::EnumerateDeliveryCacheDirectory>, "EnumerateDeliveryCacheDirectory"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IDeliveryCacheStorageService::IDeliveryCacheStorageService(Core::System& system_, FileSys::VirtualDir root_) : ServiceFramework{system_, "IDeliveryCacheStorageService"}, root(std::move(root_)) { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IDeliveryCacheStorageService::CreateFileService>, "CreateFileService"}, - {1, D<&IDeliveryCacheStorageService::CreateDirectoryService>, "CreateDirectoryService"}, - {10, D<&IDeliveryCacheStorageService::EnumerateDeliveryCacheDirectory>, "EnumerateDeliveryCacheDirectory"}, - }; - // clang-format on - - RegisterHandlers(functions); } IDeliveryCacheStorageService::~IDeliveryCacheStorageService() = default; diff --git a/src/core/hle/service/bcat/delivery_cache_storage_service.h b/src/core/hle/service/bcat/delivery_cache_storage_service.h index 3b8dfb1a39..b30f24fb47 100644 --- a/src/core/hle/service/bcat/delivery_cache_storage_service.h +++ b/src/core/hle/service/bcat/delivery_cache_storage_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -28,6 +31,7 @@ private: Out out_directory_count, OutArray out_directories); + std::optional FindRequest(u32 key) override; FileSys::VirtualDir root; std::vector entries; std::size_t next_read_index = 0; diff --git a/src/core/hle/service/bcat/news/newly_arrived_event_holder.cpp b/src/core/hle/service/bcat/news/newly_arrived_event_holder.cpp index ed393f7a26..57d71c49d8 100644 --- a/src/core/hle/service/bcat/news/newly_arrived_event_holder.cpp +++ b/src/core/hle/service/bcat/news/newly_arrived_event_holder.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -6,17 +9,16 @@ namespace Service::News { -INewlyArrivedEventHolder::INewlyArrivedEventHolder(Core::System& system_) - : ServiceFramework{system_, "INewlyArrivedEventHolder"}, service_context{ - system_, - "INewlyArrivedEventHolder"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&INewlyArrivedEventHolder::Get>, "Get"}, - }; - // clang-format on +std::optional INewlyArrivedEventHolder::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&INewlyArrivedEventHolder::Get>, "Get"} + ); + return HandlerTableGenerateWithFind(key, functions); +} - RegisterHandlers(functions); +INewlyArrivedEventHolder::INewlyArrivedEventHolder(Core::System& system_) + : ServiceFramework{system_, "INewlyArrivedEventHolder"} + , service_context{system_, "INewlyArrivedEventHolder"} { arrived_event = service_context.CreateEvent("INewlyArrivedEventHolder::ArrivedEvent"); } diff --git a/src/core/hle/service/bcat/news/newly_arrived_event_holder.h b/src/core/hle/service/bcat/news/newly_arrived_event_holder.h index 6cc9ae0997..fccc8d6e55 100644 --- a/src/core/hle/service/bcat/news/newly_arrived_event_holder.h +++ b/src/core/hle/service/bcat/news/newly_arrived_event_holder.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -26,6 +29,7 @@ public: private: Result Get(OutCopyHandle out_event); + std::optional FindRequest(u32 key) override; Kernel::KEvent* arrived_event; KernelHelpers::ServiceContext service_context; }; diff --git a/src/core/hle/service/bcat/news/news_data_service.cpp b/src/core/hle/service/bcat/news/news_data_service.cpp index 200d00e785..f5de93db49 100644 --- a/src/core/hle/service/bcat/news/news_data_service.cpp +++ b/src/core/hle/service/bcat/news/news_data_service.cpp @@ -24,16 +24,19 @@ std::string_view ToStringView(std::span buf) { } // namespace +std::optional INewsDataService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&INewsDataService::Open>, "Open"}, + FunctionInfo{1, D<&INewsDataService::OpenWithNewsRecordV1>, "OpenWithNewsRecordV1"}, + FunctionInfo{2, D<&INewsDataService::Read>, "Read"}, + FunctionInfo{3, D<&INewsDataService::GetSize>, "GetSize"}, + FunctionInfo{1001, D<&INewsDataService::OpenWithNewsRecord>, "OpenWithNewsRecord"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + INewsDataService::INewsDataService(Core::System& system_) : ServiceFramework{system_, "INewsDataService"} { - static const FunctionInfo functions[] = { - {0, D<&INewsDataService::Open>, "Open"}, - {1, D<&INewsDataService::OpenWithNewsRecordV1>, "OpenWithNewsRecordV1"}, - {2, D<&INewsDataService::Read>, "Read"}, - {3, D<&INewsDataService::GetSize>, "GetSize"}, - {1001, D<&INewsDataService::OpenWithNewsRecord>, "OpenWithNewsRecord"}, - }; - RegisterHandlers(functions); } INewsDataService::~INewsDataService() = default; diff --git a/src/core/hle/service/bcat/news/news_data_service.h b/src/core/hle/service/bcat/news/news_data_service.h index 8f5e031701..8ce10c045d 100644 --- a/src/core/hle/service/bcat/news/news_data_service.h +++ b/src/core/hle/service/bcat/news/news_data_service.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -31,6 +31,7 @@ private: Result Read(Out out_size, s64 offset, OutBuffer out_buffer); Result GetSize(Out out_size); + std::optional FindRequest(u32 key) override; std::vector opened_payload; }; diff --git a/src/core/hle/service/bcat/news/news_database_service.cpp b/src/core/hle/service/bcat/news/news_database_service.cpp index 3580ceb0f7..08fdfcb58b 100644 --- a/src/core/hle/service/bcat/news/news_database_service.cpp +++ b/src/core/hle/service/bcat/news/news_database_service.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -45,18 +45,21 @@ bool UpdateField(NewsRecord& rec, std::string_view column, s32 value, bool addit } // namespace +std::optional INewsDatabaseService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&INewsDatabaseService::GetListV1>, "GetListV1"}, + FunctionInfo{1, D<&INewsDatabaseService::Count>, "Count"}, + FunctionInfo{2, D<&INewsDatabaseService::CountWithKey>, "CountWithKey"}, + FunctionInfo{3, D<&INewsDatabaseService::UpdateIntegerValue>, "UpdateIntegerValue"}, + FunctionInfo{4, D<&INewsDatabaseService::UpdateIntegerValueWithAddition>, "UpdateIntegerValueWithAddition"}, + FunctionInfo{5, D<&INewsDatabaseService::UpdateStringValue>, "UpdateStringValue"}, + FunctionInfo{1000, D<&INewsDatabaseService::GetList>, "GetList"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + INewsDatabaseService::INewsDatabaseService(Core::System& system_) : ServiceFramework{system_, "INewsDatabaseService"} { - static const FunctionInfo functions[] = { - {0, D<&INewsDatabaseService::GetListV1>, "GetListV1"}, - {1, D<&INewsDatabaseService::Count>, "Count"}, - {2, D<&INewsDatabaseService::CountWithKey>, "CountWithKey"}, - {3, D<&INewsDatabaseService::UpdateIntegerValue>, "UpdateIntegerValue"}, - {4, D<&INewsDatabaseService::UpdateIntegerValueWithAddition>, "UpdateIntegerValueWithAddition"}, - {5, D<&INewsDatabaseService::UpdateStringValue>, "UpdateStringValue"}, - {1000, D<&INewsDatabaseService::GetList>, "GetList"}, - }; - RegisterHandlers(functions); } INewsDatabaseService::~INewsDatabaseService() = default; diff --git a/src/core/hle/service/bcat/news/news_database_service.h b/src/core/hle/service/bcat/news/news_database_service.h index 143864e80e..0a097b97bc 100644 --- a/src/core/hle/service/bcat/news/news_database_service.h +++ b/src/core/hle/service/bcat/news/news_database_service.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -49,6 +49,8 @@ private: InBuffer where_phrase, InBuffer order_by_phrase, s32 offset); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::News diff --git a/src/core/hle/service/bcat/news/news_service.cpp b/src/core/hle/service/bcat/news/news_service.cpp index aed1536bfe..7cb931896c 100644 --- a/src/core/hle/service/bcat/news/news_service.cpp +++ b/src/core/hle/service/bcat/news/news_service.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -12,32 +12,32 @@ namespace Service::News { -INewsService::INewsService(Core::System& system_) : ServiceFramework{system_, "INewsService"} { - // clang-format off - static const FunctionInfo functions[] = { - {10100, D<&INewsService::PostLocalNews>, "PostLocalNews"}, - {20100, D<&INewsService::SetPassphrase>, "SetPassphrase"}, - {30100, D<&INewsService::GetSubscriptionStatus>, "GetSubscriptionStatus"}, - {30101, D<&INewsService::GetTopicList>, "GetTopicList"}, //3.0.0+ - {30110, D<&INewsService::GetTopicList>, "Unknown30110"}, //6.0.0+ (stub) - {30200, D<&INewsService::IsSystemUpdateRequired>, "IsSystemUpdateRequired"}, - {30201, D<&INewsService::IsSystemUpdateRequired>, "Unknown30201"}, //8.0.0+ (stub) - {30210, D<&INewsService::IsSystemUpdateRequired>, "Unknown30210"}, //10.0.0+ (stub) - {30300, nullptr, "RequestImmediateReception"}, - {30400, nullptr, "DecodeArchiveFile"}, //3.0.0-18.1.0 (stub) - {30500, nullptr, "Unknown30500"}, //8.0.0+ (stub) - {30900, nullptr, "Unknown30900"}, //1.0.0 (stub) - {30901, nullptr, "Unknown30901"}, //1.0.0 (stub) - {30902, nullptr, "Unknown30902"}, //1.0.0 (stub) - {40100, nullptr, "SetSubscriptionStatus"}, - {40101, D<&INewsService::RequestAutoSubscription>, "RequestAutoSubscription"}, //3.0.0+ - {40200, D<&INewsService::ClearStorage>, "ClearStorage"}, - {40201, D<&INewsService::ClearSubscriptionStatusAll>, "ClearSubscriptionStatusAll"}, - {90100, D<&INewsService::GetNewsDatabaseDump>, "GetNewsDatabaseDump"}, - }; - // clang-format on +std::optional INewsService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{10100, D<&INewsService::PostLocalNews>, "PostLocalNews"}, + FunctionInfo{20100, D<&INewsService::SetPassphrase>, "SetPassphrase"}, + FunctionInfo{30100, D<&INewsService::GetSubscriptionStatus>, "GetSubscriptionStatus"}, + FunctionInfo{30101, D<&INewsService::GetTopicList>, "GetTopicList", MakeVersionGate({3,0,0})}, + FunctionInfo{30110, D<&INewsService::GetTopicList>, "Unknown30110", MakeVersionGate({6,0,0})}, // stub + FunctionInfo{30200, D<&INewsService::IsSystemUpdateRequired>, "IsSystemUpdateRequired"}, + FunctionInfo{30201, D<&INewsService::IsSystemUpdateRequired>, "Unknown30201", MakeVersionGate({8,0,0})}, // stub + FunctionInfo{30210, D<&INewsService::IsSystemUpdateRequired>, "Unknown30210", MakeVersionGate({10,0,0})}, // stub + FunctionInfo{30300, nullptr, "RequestImmediateReception"}, + FunctionInfo{30400, nullptr, "DecodeArchiveFile", MakeVersionGate({3,0,0}, {18,1,0})}, // stub + FunctionInfo{30500, nullptr, "Unknown30500", MakeVersionGate({8,0,0})}, // stub + FunctionInfo{30900, nullptr, "Unknown30900", MakeVersionGate({1,0,0})}, // stub + FunctionInfo{30901, nullptr, "Unknown30901", MakeVersionGate({1,0,0})}, // stub + FunctionInfo{30902, nullptr, "Unknown30902", MakeVersionGate({1,0,0})}, // stub + FunctionInfo{40100, nullptr, "SetSubscriptionStatus"}, + FunctionInfo{40101, D<&INewsService::RequestAutoSubscription>, "RequestAutoSubscription", MakeVersionGate({3,0,0})}, + FunctionInfo{40200, D<&INewsService::ClearStorage>, "ClearStorage"}, + FunctionInfo{40201, D<&INewsService::ClearSubscriptionStatusAll>, "ClearSubscriptionStatusAll"}, + FunctionInfo{90100, D<&INewsService::GetNewsDatabaseDump>, "GetNewsDatabaseDump"} + ); + return HandlerTableGenerateWithFind(key, functions); +} - RegisterHandlers(functions); +INewsService::INewsService(Core::System& system_) : ServiceFramework{system_, "INewsService"} { } INewsService::~INewsService() = default; diff --git a/src/core/hle/service/bcat/news/news_service.h b/src/core/hle/service/bcat/news/news_service.h index 1a320df02f..577147e604 100644 --- a/src/core/hle/service/bcat/news/news_service.h +++ b/src/core/hle/service/bcat/news/news_service.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -22,22 +22,15 @@ public: private: Result PostLocalNews(InBuffer buffer_data); - Result SetPassphrase(InBuffer buffer_data); - Result GetSubscriptionStatus(Out out_status, InBuffer buffer_data); - Result GetTopicList(Out out_count, OutBuffer out_topics, s32 filter); - Result IsSystemUpdateRequired(Out out_is_system_update_required); - Result RequestAutoSubscription(u64 value); - Result ClearStorage(); - Result ClearSubscriptionStatusAll(); - Result GetNewsDatabaseDump(); + std::optional FindRequest(u32 key) override; }; } // namespace Service::News diff --git a/src/core/hle/service/bcat/news/overwrite_event_holder.cpp b/src/core/hle/service/bcat/news/overwrite_event_holder.cpp index 1712971e4d..a6b3029e83 100644 --- a/src/core/hle/service/bcat/news/overwrite_event_holder.cpp +++ b/src/core/hle/service/bcat/news/overwrite_event_holder.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -6,16 +9,16 @@ namespace Service::News { -IOverwriteEventHolder::IOverwriteEventHolder(Core::System& system_) - : ServiceFramework{system_, "IOverwriteEventHolder"}, service_context{system_, - "IOverwriteEventHolder"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IOverwriteEventHolder::Get>, "Get"}, - }; - // clang-format on +std::optional IOverwriteEventHolder::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IOverwriteEventHolder::Get>, "Get"} + ); + return HandlerTableGenerateWithFind(key, functions); +} - RegisterHandlers(functions); +IOverwriteEventHolder::IOverwriteEventHolder(Core::System& system_) + : ServiceFramework{system_, "IOverwriteEventHolder"} + , service_context{system_, "IOverwriteEventHolder"} { overwrite_event = service_context.CreateEvent("IOverwriteEventHolder::OverwriteEvent"); } diff --git a/src/core/hle/service/bcat/news/overwrite_event_holder.h b/src/core/hle/service/bcat/news/overwrite_event_holder.h index cdc87d782c..ba52a36527 100644 --- a/src/core/hle/service/bcat/news/overwrite_event_holder.h +++ b/src/core/hle/service/bcat/news/overwrite_event_holder.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -26,6 +29,7 @@ public: private: Result Get(OutCopyHandle out_event); + std::optional FindRequest(u32 key) override; Kernel::KEvent* overwrite_event; KernelHelpers::ServiceContext service_context; }; diff --git a/src/core/hle/service/bcat/news/service_creator.cpp b/src/core/hle/service/bcat/news/service_creator.cpp index a1b22c0044..66e3b1277e 100644 --- a/src/core/hle/service/bcat/news/service_creator.cpp +++ b/src/core/hle/service/bcat/news/service_creator.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -11,19 +14,19 @@ namespace Service::News { +std::optional IServiceCreator::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IServiceCreator::CreateNewsService>, "CreateNewsService"}, + FunctionInfo{1, D<&IServiceCreator::CreateNewlyArrivedEventHolder>, "CreateNewlyArrivedEventHolder"}, + FunctionInfo{2, D<&IServiceCreator::CreateNewsDataService>, "CreateNewsDataService"}, + FunctionInfo{3, D<&IServiceCreator::CreateNewsDatabaseService>, "CreateNewsDatabaseService"}, + FunctionInfo{4, D<&IServiceCreator::CreateOverwriteEventHolder>, "CreateOverwriteEventHolder"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IServiceCreator::IServiceCreator(Core::System& system_, u32 permissions_, const char* name_) : ServiceFramework{system_, name_}, permissions{permissions_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IServiceCreator::CreateNewsService>, "CreateNewsService"}, - {1, D<&IServiceCreator::CreateNewlyArrivedEventHolder>, "CreateNewlyArrivedEventHolder"}, - {2, D<&IServiceCreator::CreateNewsDataService>, "CreateNewsDataService"}, - {3, D<&IServiceCreator::CreateNewsDatabaseService>, "CreateNewsDatabaseService"}, - {4, D<&IServiceCreator::CreateOverwriteEventHolder>, "CreateOverwriteEventHolder"}, - }; - // clang-format on - - RegisterHandlers(functions); } IServiceCreator::~IServiceCreator() = default; diff --git a/src/core/hle/service/bcat/news/service_creator.h b/src/core/hle/service/bcat/news/service_creator.h index 5a62e7c1a9..a87f30b67e 100644 --- a/src/core/hle/service/bcat/news/service_creator.h +++ b/src/core/hle/service/bcat/news/service_creator.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -29,6 +32,7 @@ private: Result CreateNewsDatabaseService(OutInterface out_interface); Result CreateOverwriteEventHolder(OutInterface out_interface); + std::optional FindRequest(u32 key) override; u32 permissions; }; diff --git a/src/core/hle/service/bcat/service_creator.cpp b/src/core/hle/service/bcat/service_creator.cpp index 15f59d3056..83f97bb17a 100644 --- a/src/core/hle/service/bcat/service_creator.cpp +++ b/src/core/hle/service/bcat/service_creator.cpp @@ -13,6 +13,17 @@ namespace Service::BCAT { +std::optional IServiceCreator::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IServiceCreator::CreateBcatService>, "CreateBcatService"}, + FunctionInfo{1, D<&IServiceCreator::CreateDeliveryCacheStorageService>, "CreateDeliveryCacheStorageService"}, + FunctionInfo{2, D<&IServiceCreator::CreateDeliveryCacheStorageServiceWithApplicationId>, "CreateDeliveryCacheStorageServiceWithApplicationId"}, + FunctionInfo{3, nullptr, "CreateDeliveryCacheProgressService"}, + FunctionInfo{4, nullptr, "CreateDeliveryCacheProgressServiceWithApplicationId"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + std::unique_ptr CreateBackendFromSettings([[maybe_unused]] Core::System& system, DirectoryGetter getter) { return std::make_unique(std::move(getter)); @@ -20,20 +31,7 @@ std::unique_ptr CreateBackendFromSettings([[maybe_unused]] Core::Sy IServiceCreator::IServiceCreator(Core::System& system_, const char* name_) : ServiceFramework{system_, name_}, fsc{system.GetFileSystemController()} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IServiceCreator::CreateBcatService>, "CreateBcatService"}, - {1, D<&IServiceCreator::CreateDeliveryCacheStorageService>, "CreateDeliveryCacheStorageService"}, - {2, D<&IServiceCreator::CreateDeliveryCacheStorageServiceWithApplicationId>, "CreateDeliveryCacheStorageServiceWithApplicationId"}, - {3, nullptr, "CreateDeliveryCacheProgressService"}, - {4, nullptr, "CreateDeliveryCacheProgressServiceWithApplicationId"}, - }; - // clang-format on - - RegisterHandlers(functions); - - backend = - CreateBackendFromSettings(system_, [this](u64 tid) { return fsc.GetBCATDirectory(tid); }); + backend = CreateBackendFromSettings(system_, [this](u64 tid) { return fsc.GetBCATDirectory(tid); }); } IServiceCreator::~IServiceCreator() = default; diff --git a/src/core/hle/service/bcat/service_creator.h b/src/core/hle/service/bcat/service_creator.h index 50e6633248..02527574dc 100644 --- a/src/core/hle/service/bcat/service_creator.h +++ b/src/core/hle/service/bcat/service_creator.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -33,6 +36,7 @@ private: Result CreateDeliveryCacheStorageServiceWithApplicationId( u64 application_id, OutInterface out_interface); + std::optional FindRequest(u32 key) override; std::unique_ptr backend; Service::FileSystem::FileSystemController& fsc; }; diff --git a/src/core/hle/service/bpc/bpc.cpp b/src/core/hle/service/bpc/bpc.cpp index 6f2e00b22b..7c31cd190d 100644 --- a/src/core/hle/service/bpc/bpc.cpp +++ b/src/core/hle/service/bpc/bpc.cpp @@ -14,103 +14,101 @@ namespace Service::BPC { class BPC final : public ServiceFramework { public: - explicit BPC(Core::System& system_) : ServiceFramework{system_, "bpc"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "ShutdownSystem"}, - {1, nullptr, "RebootSystem"}, - {2, nullptr, "GetWakeupReason"}, - {3, nullptr, "GetShutdownReason"}, - {4, nullptr, "GetAcOk"}, - {5, nullptr, "GetBoardPowerControlEvent"}, - {6, nullptr, "GetSleepButtonState"}, - {7, nullptr, "GetPowerEvent"}, - {8, nullptr, "CreateWakeupTimer"}, - {9, nullptr, "CancelWakeupTimer"}, - {10, nullptr, "EnableWakeupTimerOnDevice"}, - {11, nullptr, "CreateWakeupTimerEx"}, - {12, nullptr, "GetLastEnabledWakeupTimerType"}, - {13, nullptr, "CleanAllWakeupTimers"}, - {14, nullptr, "GetPowerButton"}, - {15, nullptr, "SetEnableWakeupTimer"}, - }; - // clang-format on + explicit BPC(Core::System& system_) : ServiceFramework{system_, "bpc"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "ShutdownSystem"}, + FunctionInfo{1, nullptr, "RebootSystem"}, + FunctionInfo{2, nullptr, "GetWakeupReason"}, + FunctionInfo{3, nullptr, "GetShutdownReason"}, + FunctionInfo{4, nullptr, "GetAcOk"}, + FunctionInfo{5, nullptr, "GetBoardPowerControlEvent"}, + FunctionInfo{6, nullptr, "GetSleepButtonState"}, + FunctionInfo{7, nullptr, "GetPowerEvent"}, + FunctionInfo{8, nullptr, "CreateWakeupTimer"}, + FunctionInfo{9, nullptr, "CancelWakeupTimer"}, + FunctionInfo{10, nullptr, "EnableWakeupTimerOnDevice"}, + FunctionInfo{11, nullptr, "CreateWakeupTimerEx"}, + FunctionInfo{12, nullptr, "GetLastEnabledWakeupTimerType"}, + FunctionInfo{13, nullptr, "CleanAllWakeupTimers"}, + FunctionInfo{14, nullptr, "GetPowerButton"}, + FunctionInfo{15, nullptr, "SetEnableWakeupTimer"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class BPC_R final : public ServiceFramework { public: - explicit BPC_R(Core::System& system_) : ServiceFramework{system_, "bpc:r"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetRtcTime"}, - {1, nullptr, "SetRtcTime"}, - {2, nullptr, "GetRtcResetDetected"}, - {3, nullptr, "ClearRtcResetDetected"}, - {4, nullptr, "SetUpRtcResetOnShutdown"}, - }; - // clang-format on + explicit BPC_R(Core::System& system_) : ServiceFramework{system_, "bpc:r"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetRtcTime"}, + FunctionInfo{1, nullptr, "SetRtcTime"}, + FunctionInfo{2, nullptr, "GetRtcResetDetected"}, + FunctionInfo{3, nullptr, "ClearRtcResetDetected"}, + FunctionInfo{4, nullptr, "SetUpRtcResetOnShutdown"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class BPC_C final : public ServiceFramework { public: - explicit BPC_C(Core::System& system_) : ServiceFramework{system_, "bpc:c"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "ShutdownSystem"}, - {1, nullptr, "RebootSystem"}, - {2, nullptr, "GetWakeupReason"}, - {3, nullptr, "GetShutdownReason"}, - {4, nullptr, "GetAcOk"}, - {5, nullptr, "GetPowerEvent"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit BPC_C(Core::System& system_) : ServiceFramework{system_, "bpc:c"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "ShutdownSystem"}, + FunctionInfo{1, nullptr, "RebootSystem"}, + FunctionInfo{2, nullptr, "GetWakeupReason"}, + FunctionInfo{3, nullptr, "GetShutdownReason"}, + FunctionInfo{4, nullptr, "GetAcOk"}, + FunctionInfo{5, nullptr, "GetPowerEvent"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class BPC_B final : public ServiceFramework { public: - explicit BPC_B(Core::System& system_) : ServiceFramework{system_, "bpc:b"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetSleepButtonState"}, - {1, nullptr, "GetPowerButtonEvent"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit BPC_B(Core::System& system_) : ServiceFramework{system_, "bpc:b"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetSleepButtonState"}, + FunctionInfo{1, nullptr, "GetPowerButtonEvent"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class BPC_W final : public ServiceFramework { public: - explicit BPC_W(Core::System& system_) : ServiceFramework{system_, "bpc:w"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateWakeupTimer"}, - {1, nullptr, "CancelWakeupTimer"}, - {2, nullptr, "EnableWakeupTimerOnDevice"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit BPC_W(Core::System& system_) : ServiceFramework{system_, "bpc:w"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateWakeupTimer"}, + FunctionInfo{1, nullptr, "CancelWakeupTimer"}, + FunctionInfo{2, nullptr, "EnableWakeupTimerOnDevice"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class BPC_AMS final : public ServiceFramework { public: - explicit BPC_AMS(Core::System& system_) : ServiceFramework{system_, "bpc:ams"} { - // clang-format off - static const FunctionInfo functions[] = { - {65000, nullptr, "RebootToFatalError"}, - {65001, nullptr, "SetRebootPayload"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit BPC_AMS(Core::System& system_) : ServiceFramework{system_, "bpc:ams"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{65000, nullptr, "RebootToFatalError"}, + FunctionInfo{65001, nullptr, "SetRebootPayload"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index 256a722a84..913c9475e9 100644 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp @@ -20,26 +20,15 @@ namespace Service::BtDrv { class IBluetoothUser final : public ServiceFramework { public: explicit IBluetoothUser(Core::System& system_) - : ServiceFramework{system_, "bt"}, service_context{system_, "bt"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "LeClientReadCharacteristic"}, - {1, nullptr, "LeClientReadDescriptor"}, - {2, nullptr, "LeClientWriteCharacteristic"}, - {3, nullptr, "LeClientWriteDescriptor"}, - {4, nullptr, "LeClientRegisterNotification"}, - {5, nullptr, "LeClientDeregisterNotification"}, - {6, nullptr, "SetLeResponse"}, - {7, nullptr, "LeSendIndication"}, - {8, nullptr, "GetLeEventInfo"}, - {9, C<&IBluetoothUser::RegisterBleEvent>, "RegisterBleEvent"}, - }; - // clang-format on - RegisterHandlers(functions); - + : ServiceFramework{system_, "bt"} + , service_context{system_, "bt"} { register_event = service_context.CreateEvent("BT:RegisterEvent"); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + ~IBluetoothUser() override { service_context.CloseEvent(register_event); } @@ -52,151 +41,28 @@ private: R_SUCCEED(); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "LeClientReadCharacteristic"}, + FunctionInfo{1, nullptr, "LeClientReadDescriptor"}, + FunctionInfo{2, nullptr, "LeClientWriteCharacteristic"}, + FunctionInfo{3, nullptr, "LeClientWriteDescriptor"}, + FunctionInfo{4, nullptr, "LeClientRegisterNotification"}, + FunctionInfo{5, nullptr, "LeClientDeregisterNotification"}, + FunctionInfo{6, nullptr, "SetLeResponse"}, + FunctionInfo{7, nullptr, "LeSendIndication"}, + FunctionInfo{8, nullptr, "GetLeEventInfo"}, + FunctionInfo{9, C<&IBluetoothUser::RegisterBleEvent>, "RegisterBleEvent"} + ); KernelHelpers::ServiceContext service_context; - Kernel::KEvent* register_event; }; class IBluetoothDriver final : public ServiceFramework { public: - explicit IBluetoothDriver(Core::System& system_) : ServiceFramework{system_, "btdrv"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "InitializeBluetoothDriver"}, - {1, nullptr, "InitializeBluetooth"}, - {2, nullptr, "EnableBluetooth"}, - {3, nullptr, "DisableBluetooth"}, - {4, nullptr, "FinalizeBluetooth"}, - {5, nullptr, "GetAdapterProperties"}, - {6, nullptr, "GetAdapterProperty"}, - {7, nullptr, "SetAdapterProperty"}, - {8, nullptr, "StartInquiry"}, - {9, nullptr, "StopInquiry"}, - {10, nullptr, "CreateBond"}, - {11, nullptr, "RemoveBond"}, - {12, nullptr, "CancelBond"}, - {13, nullptr, "RespondToPinRequest"}, - {14, nullptr, "RespondToSspRequest"}, - {15, nullptr, "GetEventInfo"}, - {16, nullptr, "InitializeHid"}, - {17, nullptr, "OpenHidConnection"}, - {18, nullptr, "CloseHidConnection"}, - {19, nullptr, "WriteHidData"}, - {20, nullptr, "WriteHidData2"}, - {21, nullptr, "SetHidReport"}, - {22, nullptr, "GetHidReport"}, - {23, nullptr, "TriggerConnection"}, - {24, nullptr, "AddPairedDeviceInfo"}, - {25, nullptr, "GetPairedDeviceInfo"}, - {26, nullptr, "FinalizeHid"}, - {27, nullptr, "GetHidEventInfo"}, - {28, nullptr, "SetTsi"}, - {29, nullptr, "EnableBurstMode"}, - {30, nullptr, "SetZeroRetransmission"}, - {31, nullptr, "EnableMcMode"}, - {32, nullptr, "EnableLlrScan"}, - {33, nullptr, "DisableLlrScan"}, - {34, C<&IBluetoothDriver::EnableRadio>, "EnableRadio"}, - {35, nullptr, "SetVisibility"}, - {36, nullptr, "EnableTbfcScan"}, - {37, nullptr, "RegisterHidReportEvent"}, - {38, nullptr, "GetHidReportEventInfo"}, - {39, nullptr, "GetLatestPlr"}, - {40, nullptr, "GetPendingConnections"}, - {41, nullptr, "GetChannelMap"}, - {42, nullptr, "EnableTxPowerBoostSetting"}, - {43, nullptr, "IsTxPowerBoostSettingEnabled"}, - {44, nullptr, "EnableAfhSetting"}, - {45, nullptr, "IsAfhSettingEnabled"}, - {46, nullptr, "InitializeBle"}, - {47, nullptr, "EnableBle"}, - {48, nullptr, "DisableBle"}, - {49, nullptr, "FinalizeBle"}, - {50, nullptr, "SetBleVisibility"}, - {51, nullptr, "SetBleConnectionParameter"}, - {52, nullptr, "SetBleDefaultConnectionParameter"}, - {53, nullptr, "SetBleAdvertiseData"}, - {54, nullptr, "SetBleAdvertiseParameter"}, - {55, nullptr, "StartBleScan"}, - {56, nullptr, "StopBleScan"}, - {57, nullptr, "AddBleScanFilterCondition"}, - {58, nullptr, "DeleteBleScanFilterCondition"}, - {59, nullptr, "DeleteBleScanFilter"}, - {60, nullptr, "ClearBleScanFilters"}, - {61, nullptr, "EnableBleScanFilter"}, - {62, nullptr, "RegisterGattClient"}, - {63, nullptr, "UnregisterGattClient"}, - {64, nullptr, "UnregisterAllGattClients"}, - {65, nullptr, "ConnectGattServer"}, - {66, nullptr, "CancelConnectGattServer"}, - {67, nullptr, "DisconnectGattServer"}, - {68, nullptr, "GetGattAttribute"}, - {69, nullptr, "GetGattService"}, - {70, nullptr, "ConfigureAttMtu"}, - {71, nullptr, "RegisterGattServer"}, - {72, nullptr, "UnregisterGattServer"}, - {73, nullptr, "ConnectGattClient"}, - {74, nullptr, "DisconnectGattClient"}, - {75, nullptr, "AddGattService"}, - {76, nullptr, "EnableGattService"}, - {77, nullptr, "AddGattCharacteristic"}, - {78, nullptr, "AddGattDescriptor"}, - {79, nullptr, "GetBleManagedEventInfo"}, - {80, nullptr, "GetGattFirstCharacteristic"}, - {81, nullptr, "GetGattNextCharacteristic"}, - {82, nullptr, "GetGattFirstDescriptor"}, - {83, nullptr, "GetGattNextDescriptor"}, - {84, nullptr, "RegisterGattManagedDataPath"}, - {85, nullptr, "UnregisterGattManagedDataPath"}, - {86, nullptr, "RegisterGattHidDataPath"}, - {87, nullptr, "UnregisterGattHidDataPath"}, - {88, nullptr, "RegisterGattDataPath"}, - {89, nullptr, "UnregisterGattDataPath"}, - {90, nullptr, "ReadGattCharacteristic"}, - {91, nullptr, "ReadGattDescriptor"}, - {92, nullptr, "WriteGattCharacteristic"}, - {93, nullptr, "WriteGattDescriptor"}, - {94, nullptr, "RegisterGattNotification"}, - {95, nullptr, "UnregisterGattNotification"}, - {96, nullptr, "GetLeHidEventInfo"}, - {97, nullptr, "RegisterBleHidEvent"}, - {98, nullptr, "SetBleScanParameter"}, - {99, nullptr, "MoveToSecondaryPiconet"}, - {100, nullptr, "IsBluetoothEnabled"}, - {128, nullptr, "AcquireAudioEvent"}, - {129, nullptr, "GetAudioEventInfo"}, - {130, nullptr, "OpenAudioConnection"}, - {131, nullptr, "CloseAudioConnection"}, - {132, nullptr, "OpenAudioOut"}, - {133, nullptr, "CloseAudioOut"}, - {134, nullptr, "AcquireAudioOutStateChangedEvent"}, - {135, nullptr, "StartAudioOut"}, - {136, nullptr, "StopAudioOut"}, - {137, nullptr, "GetAudioOutState"}, - {138, nullptr, "GetAudioOutFeedingCodec"}, - {139, nullptr, "GetAudioOutFeedingParameter"}, - {140, nullptr, "AcquireAudioOutBufferAvailableEvent"}, - {141, nullptr, "SendAudioData"}, - {142, nullptr, "AcquireAudioControlInputStateChangedEvent"}, - {143, nullptr, "GetAudioControlInputState"}, - {144, nullptr, "AcquireAudioConnectionStateChangedEvent"}, - {145, nullptr, "GetConnectedAudioDevice"}, - {146, nullptr, "CloseAudioControlInput"}, - {147, nullptr, "RegisterAudioControlNotification"}, - {148, nullptr, "SendAudioControlPassthroughCommand"}, - {149, nullptr, "SendAudioControlSetAbsoluteVolumeCommand"}, - {150, nullptr, "AcquireAudioSinkVolumeLocallyChangedEvent"}, - {151, nullptr, "AcquireAudioSinkVolumeUpdateRequestCompletedEvent"}, - {152, nullptr, "GetAudioSinkVolume"}, - {153, nullptr, "RequestUpdateAudioSinkVolume"}, - {154, nullptr, "IsAudioSinkVolumeSupported"}, - {256, nullptr, "IsManufacturingMode"}, - {257, nullptr, "EmulateBluetoothCrash"}, - {258, nullptr, "GetBleChannelMap"}, - }; - // clang-format on + explicit IBluetoothDriver(Core::System& system_) : ServiceFramework{system_, "btdrv"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -204,6 +70,140 @@ private: LOG_WARNING(Service_BTDRV, "(STUBBED) called"); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "InitializeBluetoothDriver"}, + FunctionInfo{1, nullptr, "InitializeBluetooth"}, + FunctionInfo{2, nullptr, "EnableBluetooth"}, + FunctionInfo{3, nullptr, "DisableBluetooth"}, + FunctionInfo{4, nullptr, "FinalizeBluetooth"}, + FunctionInfo{5, nullptr, "GetAdapterProperties"}, + FunctionInfo{6, nullptr, "GetAdapterProperty"}, + FunctionInfo{7, nullptr, "SetAdapterProperty"}, + FunctionInfo{8, nullptr, "StartInquiry"}, + FunctionInfo{9, nullptr, "StopInquiry"}, + FunctionInfo{10, nullptr, "CreateBond"}, + FunctionInfo{11, nullptr, "RemoveBond"}, + FunctionInfo{12, nullptr, "CancelBond"}, + FunctionInfo{13, nullptr, "RespondToPinRequest"}, + FunctionInfo{14, nullptr, "RespondToSspRequest"}, + FunctionInfo{15, nullptr, "GetEventInfo"}, + FunctionInfo{16, nullptr, "InitializeHid"}, + FunctionInfo{17, nullptr, "OpenHidConnection"}, + FunctionInfo{18, nullptr, "CloseHidConnection"}, + FunctionInfo{19, nullptr, "WriteHidData"}, + FunctionInfo{20, nullptr, "WriteHidData2"}, + FunctionInfo{21, nullptr, "SetHidReport"}, + FunctionInfo{22, nullptr, "GetHidReport"}, + FunctionInfo{23, nullptr, "TriggerConnection"}, + FunctionInfo{24, nullptr, "AddPairedDeviceInfo"}, + FunctionInfo{25, nullptr, "GetPairedDeviceInfo"}, + FunctionInfo{26, nullptr, "FinalizeHid"}, + FunctionInfo{27, nullptr, "GetHidEventInfo"}, + FunctionInfo{28, nullptr, "SetTsi"}, + FunctionInfo{29, nullptr, "EnableBurstMode"}, + FunctionInfo{30, nullptr, "SetZeroRetransmission"}, + FunctionInfo{31, nullptr, "EnableMcMode"}, + FunctionInfo{32, nullptr, "EnableLlrScan"}, + FunctionInfo{33, nullptr, "DisableLlrScan"}, + FunctionInfo{34, C<&IBluetoothDriver::EnableRadio>, "EnableRadio"}, + FunctionInfo{35, nullptr, "SetVisibility"}, + FunctionInfo{36, nullptr, "EnableTbfcScan"}, + FunctionInfo{37, nullptr, "RegisterHidReportEvent"}, + FunctionInfo{38, nullptr, "GetHidReportEventInfo"}, + FunctionInfo{39, nullptr, "GetLatestPlr"}, + FunctionInfo{40, nullptr, "GetPendingConnections"}, + FunctionInfo{41, nullptr, "GetChannelMap"}, + FunctionInfo{42, nullptr, "EnableTxPowerBoostSetting"}, + FunctionInfo{43, nullptr, "IsTxPowerBoostSettingEnabled"}, + FunctionInfo{44, nullptr, "EnableAfhSetting"}, + FunctionInfo{45, nullptr, "IsAfhSettingEnabled"}, + FunctionInfo{46, nullptr, "InitializeBle"}, + FunctionInfo{47, nullptr, "EnableBle"}, + FunctionInfo{48, nullptr, "DisableBle"}, + FunctionInfo{49, nullptr, "FinalizeBle"}, + FunctionInfo{50, nullptr, "SetBleVisibility"}, + FunctionInfo{51, nullptr, "SetBleConnectionParameter"}, + FunctionInfo{52, nullptr, "SetBleDefaultConnectionParameter"}, + FunctionInfo{53, nullptr, "SetBleAdvertiseData"}, + FunctionInfo{54, nullptr, "SetBleAdvertiseParameter"}, + FunctionInfo{55, nullptr, "StartBleScan"}, + FunctionInfo{56, nullptr, "StopBleScan"}, + FunctionInfo{57, nullptr, "AddBleScanFilterCondition"}, + FunctionInfo{58, nullptr, "DeleteBleScanFilterCondition"}, + FunctionInfo{59, nullptr, "DeleteBleScanFilter"}, + FunctionInfo{60, nullptr, "ClearBleScanFilters"}, + FunctionInfo{61, nullptr, "EnableBleScanFilter"}, + FunctionInfo{62, nullptr, "RegisterGattClient"}, + FunctionInfo{63, nullptr, "UnregisterGattClient"}, + FunctionInfo{64, nullptr, "UnregisterAllGattClients"}, + FunctionInfo{65, nullptr, "ConnectGattServer"}, + FunctionInfo{66, nullptr, "CancelConnectGattServer"}, + FunctionInfo{67, nullptr, "DisconnectGattServer"}, + FunctionInfo{68, nullptr, "GetGattAttribute"}, + FunctionInfo{69, nullptr, "GetGattService"}, + FunctionInfo{70, nullptr, "ConfigureAttMtu"}, + FunctionInfo{71, nullptr, "RegisterGattServer"}, + FunctionInfo{72, nullptr, "UnregisterGattServer"}, + FunctionInfo{73, nullptr, "ConnectGattClient"}, + FunctionInfo{74, nullptr, "DisconnectGattClient"}, + FunctionInfo{75, nullptr, "AddGattService"}, + FunctionInfo{76, nullptr, "EnableGattService"}, + FunctionInfo{77, nullptr, "AddGattCharacteristic"}, + FunctionInfo{78, nullptr, "AddGattDescriptor"}, + FunctionInfo{79, nullptr, "GetBleManagedEventInfo"}, + FunctionInfo{80, nullptr, "GetGattFirstCharacteristic"}, + FunctionInfo{81, nullptr, "GetGattNextCharacteristic"}, + FunctionInfo{82, nullptr, "GetGattFirstDescriptor"}, + FunctionInfo{83, nullptr, "GetGattNextDescriptor"}, + FunctionInfo{84, nullptr, "RegisterGattManagedDataPath"}, + FunctionInfo{85, nullptr, "UnregisterGattManagedDataPath"}, + FunctionInfo{86, nullptr, "RegisterGattHidDataPath"}, + FunctionInfo{87, nullptr, "UnregisterGattHidDataPath"}, + FunctionInfo{88, nullptr, "RegisterGattDataPath"}, + FunctionInfo{89, nullptr, "UnregisterGattDataPath"}, + FunctionInfo{90, nullptr, "ReadGattCharacteristic"}, + FunctionInfo{91, nullptr, "ReadGattDescriptor"}, + FunctionInfo{92, nullptr, "WriteGattCharacteristic"}, + FunctionInfo{93, nullptr, "WriteGattDescriptor"}, + FunctionInfo{94, nullptr, "RegisterGattNotification"}, + FunctionInfo{95, nullptr, "UnregisterGattNotification"}, + FunctionInfo{96, nullptr, "GetLeHidEventInfo"}, + FunctionInfo{97, nullptr, "RegisterBleHidEvent"}, + FunctionInfo{98, nullptr, "SetBleScanParameter"}, + FunctionInfo{99, nullptr, "MoveToSecondaryPiconet"}, + FunctionInfo{100, nullptr, "IsBluetoothEnabled"}, + FunctionInfo{128, nullptr, "AcquireAudioEvent"}, + FunctionInfo{129, nullptr, "GetAudioEventInfo"}, + FunctionInfo{130, nullptr, "OpenAudioConnection"}, + FunctionInfo{131, nullptr, "CloseAudioConnection"}, + FunctionInfo{132, nullptr, "OpenAudioOut"}, + FunctionInfo{133, nullptr, "CloseAudioOut"}, + FunctionInfo{134, nullptr, "AcquireAudioOutStateChangedEvent"}, + FunctionInfo{135, nullptr, "StartAudioOut"}, + FunctionInfo{136, nullptr, "StopAudioOut"}, + FunctionInfo{137, nullptr, "GetAudioOutState"}, + FunctionInfo{138, nullptr, "GetAudioOutFeedingCodec"}, + FunctionInfo{139, nullptr, "GetAudioOutFeedingParameter"}, + FunctionInfo{140, nullptr, "AcquireAudioOutBufferAvailableEvent"}, + FunctionInfo{141, nullptr, "SendAudioData"}, + FunctionInfo{142, nullptr, "AcquireAudioControlInputStateChangedEvent"}, + FunctionInfo{143, nullptr, "GetAudioControlInputState"}, + FunctionInfo{144, nullptr, "AcquireAudioConnectionStateChangedEvent"}, + FunctionInfo{145, nullptr, "GetConnectedAudioDevice"}, + FunctionInfo{146, nullptr, "CloseAudioControlInput"}, + FunctionInfo{147, nullptr, "RegisterAudioControlNotification"}, + FunctionInfo{148, nullptr, "SendAudioControlPassthroughCommand"}, + FunctionInfo{149, nullptr, "SendAudioControlSetAbsoluteVolumeCommand"}, + FunctionInfo{150, nullptr, "AcquireAudioSinkVolumeLocallyChangedEvent"}, + FunctionInfo{151, nullptr, "AcquireAudioSinkVolumeUpdateRequestCompletedEvent"}, + FunctionInfo{152, nullptr, "GetAudioSinkVolume"}, + FunctionInfo{153, nullptr, "RequestUpdateAudioSinkVolume"}, + FunctionInfo{154, nullptr, "IsAudioSinkVolumeSupported"}, + FunctionInfo{256, nullptr, "IsManufacturingMode"}, + FunctionInfo{257, nullptr, "EmulateBluetoothCrash"}, + FunctionInfo{258, nullptr, "GetBleChannelMap"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index 327c2d2ddb..e8fa29af7c 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project @@ -6,111 +6,414 @@ #include +#include "common/logging.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/set/system_settings_server.h" +#include "core/hle/service/sm/sm.h" #include "core/hle/service/btm/btm.h" -#include "core/hle/service/btm/btm_debug.h" -#include "core/hle/service/btm/btm_system.h" -#include "core/hle/service/btm/btm_user.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" +namespace Kernel { +class KEvent; +class KReadableEvent; +} // namespace Kernel + +namespace Core { +class System; +} + +namespace Service::Set { +class ISystemSettingsServer; +} + namespace Service::BTM { +class IBtmSystemCore final : public ServiceFramework { +public: + explicit IBtmSystemCore(Core::System& system_) + : ServiceFramework{system_, "IBtmSystemCore"}, service_context{system_, "IBtmSystemCore"} { + radio_event = service_context.CreateEvent("IBtmSystemCore:RadioEvent"); + audio_device_connection_event = service_context.CreateEvent("IBtmSystemCore:AudioDeviceConnectionEvent"); + m_set_sys = system.ServiceManager().GetService("set:sys", true); + } + + ~IBtmSystemCore() override { + service_context.CloseEvent(radio_event); + service_context.CloseEvent(audio_device_connection_event); + } + + Result StartGamepadPairing() { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + R_SUCCEED(); + } + + Result CancelGamepadPairing() { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + R_SUCCEED(); + } + + Result EnableRadio() { + LOG_DEBUG(Service_BTM, "called"); + + R_RETURN(m_set_sys->SetBluetoothEnableFlag(true)); + } + Result DisableRadio() { + LOG_DEBUG(Service_BTM, "called"); + + R_RETURN(m_set_sys->SetBluetoothEnableFlag(false)); + } + + Result IsRadioEnabled(Out out_is_enabled) { + LOG_DEBUG(Service_BTM, "called"); + + R_RETURN(m_set_sys->GetBluetoothEnableFlag(out_is_enabled)); + } + + Result AcquireRadioEvent(Out out_is_valid, + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &radio_event->GetReadableEvent(); + R_SUCCEED(); + } + + Result GetDiscoveredAudioDevice(OutArray, BufferAttr_HipcPointer> out_audio_devices, s32 count, Out out_total) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + R_SUCCEED(); + } + + Result AcquireAudioDeviceConnectionEvent( + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_event = &audio_device_connection_event->GetReadableEvent(); + R_SUCCEED(); + } + + Result GetConnectedAudioDevices( + Out out_count, OutArray, BufferAttr_HipcPointer> out_audio_devices) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_count = 0; + R_SUCCEED(); + } + + Result GetPairedAudioDevices( + Out out_count, OutArray, BufferAttr_HipcPointer> out_audio_devices) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_count = 0; + R_SUCCEED(); + } + + Result RequestAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) { + LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid); + R_SUCCEED(); + } + + Result CancelAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) { + LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IBtmSystemCore::StartGamepadPairing>, "StartGamepadPairing"}, + FunctionInfo{1, C<&IBtmSystemCore::CancelGamepadPairing>, "CancelGamepadPairing"}, + FunctionInfo{2, nullptr, "ClearGamepadPairingDatabase"}, + FunctionInfo{3, nullptr, "GetPairedGamepadCount"}, + FunctionInfo{4, C<&IBtmSystemCore::EnableRadio>, "EnableRadio"}, + FunctionInfo{5, C<&IBtmSystemCore::DisableRadio>, "DisableRadio"}, + FunctionInfo{6, C<&IBtmSystemCore::IsRadioEnabled>, "IsRadioEnabled"}, + FunctionInfo{7, C<&IBtmSystemCore::AcquireRadioEvent>, "AcquireRadioEvent"}, + FunctionInfo{8, nullptr, "AcquireGamepadPairingEvent"}, + FunctionInfo{9, nullptr, "IsGamepadPairingStarted"}, + FunctionInfo{10, nullptr, "StartAudioDeviceDiscovery"}, + FunctionInfo{11, nullptr, "StopAudioDeviceDiscovery"}, + FunctionInfo{12, nullptr, "IsDiscoveryingAudioDevice"}, + FunctionInfo{13, C<&IBtmSystemCore::GetDiscoveredAudioDevice>, "GetDiscoveredAudioDevice"}, + FunctionInfo{14, C<&IBtmSystemCore::AcquireAudioDeviceConnectionEvent>, "AcquireAudioDeviceConnectionEvent"}, + FunctionInfo{15, nullptr, "ConnectAudioDevice"}, + FunctionInfo{16, nullptr, "IsConnectingAudioDevice"}, + FunctionInfo{17, C<&IBtmSystemCore::GetConnectedAudioDevices>, "GetConnectedAudioDevices"}, + FunctionInfo{18, nullptr, "DisconnectAudioDevice"}, + FunctionInfo{19, nullptr, "AcquirePairedAudioDeviceInfoChangedEvent"}, + FunctionInfo{20, C<&IBtmSystemCore::GetPairedAudioDevices>, "GetPairedAudioDevices"}, + FunctionInfo{21, nullptr, "RemoveAudioDevicePairing"}, + FunctionInfo{22, C<&IBtmSystemCore::RequestAudioDeviceConnectionRejection>, "RequestAudioDeviceConnectionRejection"}, + FunctionInfo{23, C<&IBtmSystemCore::CancelAudioDeviceConnectionRejection>, "CancelAudioDeviceConnectionRejection"} + ); + KernelHelpers::ServiceContext service_context; + Kernel::KEvent* radio_event; + Kernel::KEvent* audio_device_connection_event; + std::shared_ptr m_set_sys; +}; + +class IBtmSystem final : public ServiceFramework { +public: + explicit IBtmSystem(Core::System& system_) : ServiceFramework{system_, "btm:sys"} {} + ~IBtmSystem() override = default; + + Result GetCore(OutInterface out_interface) { + LOG_WARNING(Service_BTM, "called"); + + *out_interface = std::make_shared(system); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IBtmSystem::GetCore>, "GetCore"} + ); +}; + +class IBtmUserCore final : public ServiceFramework { +public: + explicit IBtmUserCore(Core::System& system_) + : ServiceFramework{system_, "IBtmUserCore"}, service_context{system_, "IBtmUserCore"} { + scan_event = service_context.CreateEvent("IBtmUserCore:ScanEvent"); + connection_event = service_context.CreateEvent("IBtmUserCore:ConnectionEvent"); + service_discovery_event = service_context.CreateEvent("IBtmUserCore:DiscoveryEvent"); + config_event = service_context.CreateEvent("IBtmUserCore:ConfigEvent"); + } + + ~IBtmUserCore() override { + service_context.CloseEvent(scan_event); + service_context.CloseEvent(connection_event); + service_context.CloseEvent(service_discovery_event); + service_context.CloseEvent(config_event); + } + + Result AcquireBleScanEvent(Out out_is_valid, + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &scan_event->GetReadableEvent(); + R_SUCCEED(); + } + + Result AcquireBleConnectionEvent(Out out_is_valid, + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &connection_event->GetReadableEvent(); + R_SUCCEED(); + } + + Result AcquireBleServiceDiscoveryEvent( + Out out_is_valid, OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &service_discovery_event->GetReadableEvent(); + R_SUCCEED(); + } + + Result AcquireBleMtuConfigEvent(Out out_is_valid, + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &config_event->GetReadableEvent(); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IBtmUserCore::AcquireBleScanEvent>, "AcquireBleScanEvent"}, + FunctionInfo{1, nullptr, "GetBleScanFilterParameter"}, + FunctionInfo{2, nullptr, "GetBleScanFilterParameter2"}, + FunctionInfo{3, nullptr, "StartBleScanForGeneral"}, + FunctionInfo{4, nullptr, "StopBleScanForGeneral"}, + FunctionInfo{5, nullptr, "GetBleScanResultsForGeneral"}, + FunctionInfo{6, nullptr, "StartBleScanForPaired"}, + FunctionInfo{7, nullptr, "StopBleScanForPaired"}, + FunctionInfo{8, nullptr, "StartBleScanForSmartDevice"}, + FunctionInfo{9, nullptr, "StopBleScanForSmartDevice"}, + FunctionInfo{10, nullptr, "GetBleScanResultsForSmartDevice"}, + FunctionInfo{17, C<&IBtmUserCore::AcquireBleConnectionEvent>, "AcquireBleConnectionEvent"}, + FunctionInfo{18, nullptr, "BleConnect"}, + FunctionInfo{19, nullptr, "BleDisconnect"}, + FunctionInfo{20, nullptr, "BleGetConnectionState"}, + FunctionInfo{21, nullptr, "AcquireBlePairingEvent"}, + FunctionInfo{22, nullptr, "BlePairDevice"}, + FunctionInfo{23, nullptr, "BleUnPairDevice"}, + FunctionInfo{24, nullptr, "BleUnPairDevice2"}, + FunctionInfo{25, nullptr, "BleGetPairedDevices"}, + FunctionInfo{26, C<&IBtmUserCore::AcquireBleServiceDiscoveryEvent>, "AcquireBleServiceDiscoveryEvent"}, + FunctionInfo{27, nullptr, "GetGattServices"}, + FunctionInfo{28, nullptr, "GetGattService"}, + FunctionInfo{29, nullptr, "GetGattIncludedServices"}, + FunctionInfo{30, nullptr, "GetBelongingGattService"}, + FunctionInfo{31, nullptr, "GetGattCharacteristics"}, + FunctionInfo{32, nullptr, "GetGattDescriptors"}, + FunctionInfo{33, C<&IBtmUserCore::AcquireBleMtuConfigEvent>, "AcquireBleMtuConfigEvent"}, + FunctionInfo{34, nullptr, "ConfigureBleMtu"}, + FunctionInfo{35, nullptr, "GetBleMtu"}, + FunctionInfo{36, nullptr, "RegisterBleGattDataPath"}, + FunctionInfo{37, nullptr, "UnregisterBleGattDataPath"} + ); + KernelHelpers::ServiceContext service_context; + Kernel::KEvent* scan_event; + Kernel::KEvent* connection_event; + Kernel::KEvent* service_discovery_event; + Kernel::KEvent* config_event; +}; + +class IBtmUser final : public ServiceFramework { +public: + explicit IBtmUser(Core::System& system_) : ServiceFramework{system_, "btm:u"} {} + ~IBtmUser() override = default; + + Result GetCore(OutInterface out_interface) { + LOG_WARNING(Service_BTM, "called"); + + *out_interface = std::make_shared(system); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IBtmUser::GetCore>, "GetCore"} + ); +}; + +class IBtmDebug final : public ServiceFramework { +public: + explicit IBtmDebug(Core::System& system_) : ServiceFramework{system_, "btm:dbg"} {} + ~IBtmDebug() override = default; + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "AcquireDiscoveryEvent"}, + FunctionInfo{1, nullptr, "StartDiscovery"}, + FunctionInfo{2, nullptr, "CancelDiscovery"}, + FunctionInfo{3, nullptr, "GetDeviceProperty"}, + FunctionInfo{4, nullptr, "CreateBond"}, + FunctionInfo{5, nullptr, "CancelBond"}, + FunctionInfo{6, nullptr, "SetTsiMode"}, + FunctionInfo{7, nullptr, "GeneralTest"}, + FunctionInfo{8, nullptr, "HidConnect"}, + FunctionInfo{9, nullptr, "GeneralGet", MakeVersionGate({5,0,0})}, + FunctionInfo{10, nullptr, "GetGattClientDisconnectionReason", MakeVersionGate({5,0,0})}, + FunctionInfo{11, nullptr, "GetBleConnectionParameter", MakeVersionGate({5,1,0})}, + FunctionInfo{12, nullptr, "GetBleConnectionParameterRequest", MakeVersionGate({5,1,0})}, + FunctionInfo{13, nullptr, "GetDiscoveredDevice", MakeVersionGate({12,0,0})}, + FunctionInfo{14, nullptr, "SleepAwakeLoopTest", MakeVersionGate({15,0,0})}, + FunctionInfo{15, nullptr, "SleepTest", MakeVersionGate({15,0,0})}, + FunctionInfo{16, nullptr, "MinimumAwakeTest", MakeVersionGate({15,0,0})}, + FunctionInfo{17, nullptr, "ForceEnableBtm", MakeVersionGate({15,0,0})} + ); +}; + class IBtm final : public ServiceFramework { public: - explicit IBtm(Core::System& system_) : ServiceFramework{system_, "btm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetState"}, - {1, nullptr, "GetHostDeviceProperty"}, - {2, nullptr, "AcquireDeviceConditionEvent"}, - {3, nullptr, "GetDeviceCondition"}, - {4, nullptr, "SetBurstMode"}, - {5, nullptr, "SetSlotMode"}, - {6, nullptr, "SetBluetoothMode"}, - {7, nullptr, "SetWlanMode"}, - {8, nullptr, "AcquireDeviceInfoEvent"}, - {9, nullptr, "GetDeviceInfo"}, - {10, nullptr, "AddDeviceInfo"}, - {11, nullptr, "RemoveDeviceInfo"}, - {12, nullptr, "IncreaseDeviceInfoOrder"}, - {13, nullptr, "LlrNotify"}, - {14, nullptr, "EnableRadio"}, - {15, nullptr, "DisableRadio"}, - {16, nullptr, "HidDisconnect"}, - {17, nullptr, "HidSetRetransmissionMode"}, - {18, nullptr, "AcquireAwakeReqEvent"}, - {19, nullptr, "AcquireLlrStateEvent"}, - {20, nullptr, "IsLlrStarted"}, - {21, nullptr, "EnableSlotSaving"}, - {22, nullptr, "ProtectDeviceInfo"}, - {23, nullptr, "AcquireBleScanEvent"}, - {24, nullptr, "GetBleScanParameterGeneral"}, - {25, nullptr, "GetBleScanParameterSmartDevice"}, - {26, nullptr, "StartBleScanForGeneral"}, - {27, nullptr, "StopBleScanForGeneral"}, - {28, nullptr, "GetBleScanResultsForGeneral"}, - {29, nullptr, "StartBleScanForPairedDevice"}, - {30, nullptr, "StopBleScanForPairedDevice"}, - {31, nullptr, "StartBleScanForSmartDevice"}, - {32, nullptr, "StopBleScanForSmartDevice"}, - {33, nullptr, "GetBleScanResultsForSmartDevice"}, - {34, nullptr, "AcquireBleConnectionEvent"}, - {35, nullptr, "BleConnect"}, - {36, nullptr, "BleOverrideConnection"}, - {37, nullptr, "BleDisconnect"}, - {38, nullptr, "BleGetConnectionState"}, - {39, nullptr, "BleGetGattClientConditionList"}, - {40, nullptr, "AcquireBlePairingEvent"}, - {41, nullptr, "BlePairDevice"}, - {42, nullptr, "BleUnpairDeviceOnBoth"}, - {43, nullptr, "BleUnpairDevice"}, - {44, nullptr, "BleGetPairedAddresses"}, - {45, nullptr, "AcquireBleServiceDiscoveryEvent"}, - {46, nullptr, "GetGattServices"}, - {47, nullptr, "GetGattService"}, - {48, nullptr, "GetGattIncludedServices"}, - {49, nullptr, "GetBelongingService"}, - {50, nullptr, "GetGattCharacteristics"}, - {51, nullptr, "GetGattDescriptors"}, - {52, nullptr, "AcquireBleMtuConfigEvent"}, - {53, nullptr, "ConfigureBleMtu"}, - {54, nullptr, "GetBleMtu"}, - {55, nullptr, "RegisterBleGattDataPath"}, - {56, nullptr, "UnregisterBleGattDataPath"}, - {57, nullptr, "RegisterAppletResourceUserId"}, - {58, nullptr, "UnregisterAppletResourceUserId"}, - {59, nullptr, "SetAppletResourceUserId"}, - {60, nullptr, "AcquireBleConnectionParameterUpdateEvent"}, //8.0.0+ - {61, nullptr, "SetCeLength"}, //8.0.0+ - {62, nullptr, "EnsureSlotExpansion"}, //9.0.0+ - {63, nullptr, "IsSlotExpansionEnsured"}, //9.0.0+ - {64, nullptr, "CancelConnectionTrigger"}, //10.0.0+ - {65, nullptr, "GetConnectionCapacity"}, //13.0.0+ - {66, nullptr, "GetWlanMode"}, //13.0.0+ - {67, nullptr, "IsSlotSavingEnabled"}, //13.0.0+ - {68, nullptr, "IsSlotSavingForPairingEnabled"}, //13.0.0+ - {69, nullptr, "AcquireAudioDeviceConnectionEvent"}, //13.0.0+ - {70, nullptr, "GetConnectedAudioDevices"}, //13.0.0+ - {71, nullptr, "SetAudioSourceVolume"}, //13.0.0+ - {72, nullptr, "GetAudioSourceVolume"}, //13.0.0+ - {73, nullptr, "RequestAudioDeviceConnectionRejection"}, //13.0.0+ - {74, nullptr, "CancelAudioDeviceConnectionRejection"}, //13.0.0+ - {75, nullptr, "GetPairedAudioDevices"}, //13.0.0+ - {76, nullptr, "SetWlanModeWithOption"}, //13.1.0+ - {100, nullptr, "AcquireConnectionDisallowedEvent"}, //13.0.0+ - {101, nullptr, "GetUsecaseViolationFactor"}, //13.0.0+ - {110, nullptr, "GetShortenedDeviceInfo"}, //13.0.0+ - {111, nullptr, "AcquirePairingCountUpdateEvent"},//13.0.0+ - {112, nullptr, "Unknown112"}, //14.0.0-14.1.2 - {113, nullptr, "Unknown113"}, //14.0.0-14.1.2 - {114, nullptr, "IsFirstAudioControlConnection"}, //14.0.0+ - {115, nullptr, "GetShortenedDeviceCondition"}, //14.0.0+ - {116, nullptr, "SetAudioSinkVolume"}, //15.0.0+ - {117, nullptr, "GetAudioSinkVolume"}, //15.0.0+ - }; - // clang-format on + explicit IBtm(Core::System& system_) : ServiceFramework{system_, "btm"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetState"}, + FunctionInfo{1, nullptr, "GetHostDeviceProperty"}, + FunctionInfo{2, nullptr, "AcquireDeviceConditionEvent"}, + FunctionInfo{3, nullptr, "GetDeviceCondition"}, + FunctionInfo{4, nullptr, "SetBurstMode"}, + FunctionInfo{5, nullptr, "SetSlotMode"}, + FunctionInfo{6, nullptr, "SetBluetoothMode"}, + FunctionInfo{7, nullptr, "SetWlanMode"}, + FunctionInfo{8, nullptr, "AcquireDeviceInfoEvent"}, + FunctionInfo{9, nullptr, "GetDeviceInfo"}, + FunctionInfo{10, nullptr, "AddDeviceInfo"}, + FunctionInfo{11, nullptr, "RemoveDeviceInfo"}, + FunctionInfo{12, nullptr, "IncreaseDeviceInfoOrder"}, + FunctionInfo{13, nullptr, "LlrNotify"}, + FunctionInfo{14, nullptr, "EnableRadio"}, + FunctionInfo{15, nullptr, "DisableRadio"}, + FunctionInfo{16, nullptr, "HidDisconnect"}, + FunctionInfo{17, nullptr, "HidSetRetransmissionMode"}, + FunctionInfo{18, nullptr, "AcquireAwakeReqEvent"}, + FunctionInfo{19, nullptr, "AcquireLlrStateEvent"}, + FunctionInfo{20, nullptr, "IsLlrStarted"}, + FunctionInfo{21, nullptr, "EnableSlotSaving"}, + FunctionInfo{22, nullptr, "ProtectDeviceInfo"}, + FunctionInfo{23, nullptr, "AcquireBleScanEvent"}, + FunctionInfo{24, nullptr, "GetBleScanParameterGeneral"}, + FunctionInfo{25, nullptr, "GetBleScanParameterSmartDevice"}, + FunctionInfo{26, nullptr, "StartBleScanForGeneral"}, + FunctionInfo{27, nullptr, "StopBleScanForGeneral"}, + FunctionInfo{28, nullptr, "GetBleScanResultsForGeneral"}, + FunctionInfo{29, nullptr, "StartBleScanForPairedDevice"}, + FunctionInfo{30, nullptr, "StopBleScanForPairedDevice"}, + FunctionInfo{31, nullptr, "StartBleScanForSmartDevice"}, + FunctionInfo{32, nullptr, "StopBleScanForSmartDevice"}, + FunctionInfo{33, nullptr, "GetBleScanResultsForSmartDevice"}, + FunctionInfo{34, nullptr, "AcquireBleConnectionEvent"}, + FunctionInfo{35, nullptr, "BleConnect"}, + FunctionInfo{36, nullptr, "BleOverrideConnection"}, + FunctionInfo{37, nullptr, "BleDisconnect"}, + FunctionInfo{38, nullptr, "BleGetConnectionState"}, + FunctionInfo{39, nullptr, "BleGetGattClientConditionList"}, + FunctionInfo{40, nullptr, "AcquireBlePairingEvent"}, + FunctionInfo{41, nullptr, "BlePairDevice"}, + FunctionInfo{42, nullptr, "BleUnpairDeviceOnBoth"}, + FunctionInfo{43, nullptr, "BleUnpairDevice"}, + FunctionInfo{44, nullptr, "BleGetPairedAddresses"}, + FunctionInfo{45, nullptr, "AcquireBleServiceDiscoveryEvent"}, + FunctionInfo{46, nullptr, "GetGattServices"}, + FunctionInfo{47, nullptr, "GetGattService"}, + FunctionInfo{48, nullptr, "GetGattIncludedServices"}, + FunctionInfo{49, nullptr, "GetBelongingService"}, + FunctionInfo{50, nullptr, "GetGattCharacteristics"}, + FunctionInfo{51, nullptr, "GetGattDescriptors"}, + FunctionInfo{52, nullptr, "AcquireBleMtuConfigEvent"}, + FunctionInfo{53, nullptr, "ConfigureBleMtu"}, + FunctionInfo{54, nullptr, "GetBleMtu"}, + FunctionInfo{55, nullptr, "RegisterBleGattDataPath"}, + FunctionInfo{56, nullptr, "UnregisterBleGattDataPath"}, + FunctionInfo{57, nullptr, "RegisterAppletResourceUserId"}, + FunctionInfo{58, nullptr, "UnregisterAppletResourceUserId"}, + FunctionInfo{59, nullptr, "SetAppletResourceUserId"}, + FunctionInfo{60, nullptr, "AcquireBleConnectionParameterUpdateEvent", MakeVersionGate({8,0,0})}, + FunctionInfo{61, nullptr, "SetCeLength", MakeVersionGate({8,0,0})}, + FunctionInfo{62, nullptr, "EnsureSlotExpansion", MakeVersionGate({9,0,0})}, + FunctionInfo{63, nullptr, "IsSlotExpansionEnsured", MakeVersionGate({9,0,0})}, + FunctionInfo{64, nullptr, "CancelConnectionTrigger", MakeVersionGate({10,0,0})}, + FunctionInfo{65, nullptr, "GetConnectionCapacity", MakeVersionGate({13,0,0})}, + FunctionInfo{66, nullptr, "GetWlanMode", MakeVersionGate({13,0,0})}, + FunctionInfo{67, nullptr, "IsSlotSavingEnabled", MakeVersionGate({13,0,0})}, + FunctionInfo{68, nullptr, "IsSlotSavingForPairingEnabled", MakeVersionGate({13,0,0})}, + FunctionInfo{69, nullptr, "AcquireAudioDeviceConnectionEvent", MakeVersionGate({13,0,0})}, + FunctionInfo{70, nullptr, "GetConnectedAudioDevices", MakeVersionGate({13,0,0})}, + FunctionInfo{71, nullptr, "SetAudioSourceVolume", MakeVersionGate({13,0,0})}, + FunctionInfo{72, nullptr, "GetAudioSourceVolume", MakeVersionGate({13,0,0})}, + FunctionInfo{73, nullptr, "RequestAudioDeviceConnectionRejection", MakeVersionGate({13,0,0})}, + FunctionInfo{74, nullptr, "CancelAudioDeviceConnectionRejection", MakeVersionGate({13,0,0})}, + FunctionInfo{75, nullptr, "GetPairedAudioDevices", MakeVersionGate({13,0,0})}, + FunctionInfo{76, nullptr, "SetWlanModeWithOption", MakeVersionGate({13,1,0})}, + FunctionInfo{100, nullptr, "AcquireConnectionDisallowedEvent", MakeVersionGate({13,0,0})}, + FunctionInfo{101, nullptr, "GetUsecaseViolationFactor", MakeVersionGate({13,0,0})}, + FunctionInfo{110, nullptr, "GetShortenedDeviceInfo", MakeVersionGate({13,0,0})}, + FunctionInfo{111, nullptr, "AcquirePairingCountUpdateEvent"},//13.0.0+ + FunctionInfo{112, nullptr, "Unknown112", MakeVersionGate({14,0,0}, {14,1,2})}, + FunctionInfo{113, nullptr, "Unknown113", MakeVersionGate({14,0,0}, {14,1,2})}, + FunctionInfo{114, nullptr, "IsFirstAudioControlConnection", MakeVersionGate({14,0,0})}, + FunctionInfo{115, nullptr, "GetShortenedDeviceCondition", MakeVersionGate({14,0,0})}, + FunctionInfo{116, nullptr, "SetAudioSinkVolume", MakeVersionGate({15,0,0})}, + FunctionInfo{117, nullptr, "GetAudioSinkVolume", MakeVersionGate({15,0,0})} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/btm/btm_debug.cpp b/src/core/hle/service/btm/btm_debug.cpp deleted file mode 100644 index 0c9a3a6557..0000000000 --- a/src/core/hle/service/btm/btm_debug.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "core/hle/service/btm/btm_debug.h" - -namespace Service::BTM { - -IBtmDebug::IBtmDebug(Core::System& system_) : ServiceFramework{system_, "btm:dbg"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "AcquireDiscoveryEvent"}, - {1, nullptr, "StartDiscovery"}, - {2, nullptr, "CancelDiscovery"}, - {3, nullptr, "GetDeviceProperty"}, - {4, nullptr, "CreateBond"}, - {5, nullptr, "CancelBond"}, - {6, nullptr, "SetTsiMode"}, - {7, nullptr, "GeneralTest"}, - {8, nullptr, "HidConnect"}, - {9, nullptr, "GeneralGet"}, //5.0.0+ - {10, nullptr, "GetGattClientDisconnectionReason"}, //5.0.0+ - {11, nullptr, "GetBleConnectionParameter"}, //5.1.0+ - {12, nullptr, "GetBleConnectionParameterRequest"}, //5.1.0+ - {13, nullptr, "GetDiscoveredDevice"}, //12.0.0+ - {14, nullptr, "SleepAwakeLoopTest"}, //15.0.0+ - {15, nullptr, "SleepTest"}, //15.0.0+ - {16, nullptr, "MinimumAwakeTest"}, //15.0.0+ - {17, nullptr, "ForceEnableBtm"}, //15.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); -} - -IBtmDebug::~IBtmDebug() = default; - -} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_debug.h b/src/core/hle/service/btm/btm_debug.h deleted file mode 100644 index bf4f7e14fd..0000000000 --- a/src/core/hle/service/btm/btm_debug.h +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::BTM { - -class IBtmDebug final : public ServiceFramework { -public: - explicit IBtmDebug(Core::System& system_); - ~IBtmDebug() override; -}; - -} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_system.cpp b/src/core/hle/service/btm/btm_system.cpp deleted file mode 100644 index 1684b0193e..0000000000 --- a/src/core/hle/service/btm/btm_system.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "common/logging.h" -#include "core/hle/service/btm/btm_system.h" -#include "core/hle/service/btm/btm_system_core.h" -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/service.h" - -namespace Service::BTM { - -IBtmSystem::IBtmSystem(Core::System& system_) : ServiceFramework{system_, "btm:sys"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&IBtmSystem::GetCore>, "GetCore"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IBtmSystem::~IBtmSystem() = default; - -Result IBtmSystem::GetCore(OutInterface out_interface) { - LOG_WARNING(Service_BTM, "called"); - - *out_interface = std::make_shared(system); - R_SUCCEED(); -} - -} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_system.h b/src/core/hle/service/btm/btm_system.h deleted file mode 100644 index fe1c6dbd78..0000000000 --- a/src/core/hle/service/btm/btm_system.h +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::BTM { -class IBtmSystemCore; - -class IBtmSystem final : public ServiceFramework { -public: - explicit IBtmSystem(Core::System& system_); - ~IBtmSystem() override; - -private: - Result GetCore(OutInterface out_interface); -}; - -} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_system_core.cpp b/src/core/hle/service/btm/btm_system_core.cpp deleted file mode 100644 index 318657fc32..0000000000 --- a/src/core/hle/service/btm/btm_system_core.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "common/logging.h" -#include "core/hle/service/btm/btm_system_core.h" -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/set/system_settings_server.h" -#include "core/hle/service/sm/sm.h" - -namespace Service::BTM { - -IBtmSystemCore::IBtmSystemCore(Core::System& system_) - : ServiceFramework{system_, "IBtmSystemCore"}, service_context{system_, "IBtmSystemCore"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&IBtmSystemCore::StartGamepadPairing>, "StartGamepadPairing"}, - {1, C<&IBtmSystemCore::CancelGamepadPairing>, "CancelGamepadPairing"}, - {2, nullptr, "ClearGamepadPairingDatabase"}, - {3, nullptr, "GetPairedGamepadCount"}, - {4, C<&IBtmSystemCore::EnableRadio>, "EnableRadio"}, - {5, C<&IBtmSystemCore::DisableRadio>, "DisableRadio"}, - {6, C<&IBtmSystemCore::IsRadioEnabled>, "IsRadioEnabled"}, - {7, C<&IBtmSystemCore::AcquireRadioEvent>, "AcquireRadioEvent"}, - {8, nullptr, "AcquireGamepadPairingEvent"}, - {9, nullptr, "IsGamepadPairingStarted"}, - {10, nullptr, "StartAudioDeviceDiscovery"}, - {11, nullptr, "StopAudioDeviceDiscovery"}, - {12, nullptr, "IsDiscoveryingAudioDevice"}, - {13, C<&IBtmSystemCore::GetDiscoveredAudioDevice>, "GetDiscoveredAudioDevice"}, - {14, C<&IBtmSystemCore::AcquireAudioDeviceConnectionEvent>, "AcquireAudioDeviceConnectionEvent"}, - {15, nullptr, "ConnectAudioDevice"}, - {16, nullptr, "IsConnectingAudioDevice"}, - {17, C<&IBtmSystemCore::GetConnectedAudioDevices>, "GetConnectedAudioDevices"}, - {18, nullptr, "DisconnectAudioDevice"}, - {19, nullptr, "AcquirePairedAudioDeviceInfoChangedEvent"}, - {20, C<&IBtmSystemCore::GetPairedAudioDevices>, "GetPairedAudioDevices"}, - {21, nullptr, "RemoveAudioDevicePairing"}, - {22, C<&IBtmSystemCore::RequestAudioDeviceConnectionRejection>, "RequestAudioDeviceConnectionRejection"}, - {23, C<&IBtmSystemCore::CancelAudioDeviceConnectionRejection>, "CancelAudioDeviceConnectionRejection"} - }; - // clang-format on - - RegisterHandlers(functions); - radio_event = service_context.CreateEvent("IBtmSystemCore::RadioEvent"); - audio_device_connection_event = - service_context.CreateEvent("IBtmSystemCore::AudioDeviceConnectionEvent"); - - m_set_sys = - system.ServiceManager().GetService("set:sys", true); -} - -IBtmSystemCore::~IBtmSystemCore() { - service_context.CloseEvent(radio_event); - service_context.CloseEvent(audio_device_connection_event); -} - -Result IBtmSystemCore::StartGamepadPairing() { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - R_SUCCEED(); -} - -Result IBtmSystemCore::CancelGamepadPairing() { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - R_SUCCEED(); -} - -Result IBtmSystemCore::EnableRadio() { - LOG_DEBUG(Service_BTM, "called"); - - R_RETURN(m_set_sys->SetBluetoothEnableFlag(true)); -} -Result IBtmSystemCore::DisableRadio() { - LOG_DEBUG(Service_BTM, "called"); - - R_RETURN(m_set_sys->SetBluetoothEnableFlag(false)); -} - -Result IBtmSystemCore::IsRadioEnabled(Out out_is_enabled) { - LOG_DEBUG(Service_BTM, "called"); - - R_RETURN(m_set_sys->GetBluetoothEnableFlag(out_is_enabled)); -} - -Result IBtmSystemCore::AcquireRadioEvent(Out out_is_valid, - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &radio_event->GetReadableEvent(); - R_SUCCEED(); -} - -Result IBtmSystemCore::GetDiscoveredAudioDevice(OutArray, BufferAttr_HipcPointer> out_audio_devices, s32 count, Out out_total) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - R_SUCCEED(); -} - -Result IBtmSystemCore::AcquireAudioDeviceConnectionEvent( - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_event = &audio_device_connection_event->GetReadableEvent(); - R_SUCCEED(); -} - -Result IBtmSystemCore::GetConnectedAudioDevices( - Out out_count, OutArray, BufferAttr_HipcPointer> out_audio_devices) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_count = 0; - R_SUCCEED(); -} - -Result IBtmSystemCore::GetPairedAudioDevices( - Out out_count, OutArray, BufferAttr_HipcPointer> out_audio_devices) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_count = 0; - R_SUCCEED(); -} - -Result IBtmSystemCore::RequestAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) { - LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid); - R_SUCCEED(); -} - -Result IBtmSystemCore::CancelAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) { - LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid); - R_SUCCEED(); -} - -} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_system_core.h b/src/core/hle/service/btm/btm_system_core.h deleted file mode 100644 index 3fc4c0d56c..0000000000 --- a/src/core/hle/service/btm/btm_system_core.h +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/kernel_helpers.h" -#include "core/hle/service/service.h" - -namespace Kernel { -class KEvent; -class KReadableEvent; -} // namespace Kernel - -namespace Core { -class System; -} - -namespace Service::Set { -class ISystemSettingsServer; -} - -namespace Service::BTM { - -class IBtmSystemCore final : public ServiceFramework { -public: - explicit IBtmSystemCore(Core::System& system_); - ~IBtmSystemCore() override; - -private: - Result StartGamepadPairing(); - Result CancelGamepadPairing(); - Result EnableRadio(); - Result DisableRadio(); - Result IsRadioEnabled(Out out_is_enabled); - - Result AcquireRadioEvent(Out out_is_valid, OutCopyHandle out_event); - Result GetDiscoveredAudioDevice(OutArray, BufferAttr_HipcPointer> out_audio_devices, s32 count, Out out_total); - Result AcquireAudioDeviceConnectionEvent(OutCopyHandle out_event); - - Result GetConnectedAudioDevices( - Out out_count, - OutArray, BufferAttr_HipcPointer> out_audio_devices); - - Result GetPairedAudioDevices( - Out out_count, - OutArray, BufferAttr_HipcPointer> out_audio_devices); - - Result RequestAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid); - Result CancelAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid); - - KernelHelpers::ServiceContext service_context; - - Kernel::KEvent* radio_event; - Kernel::KEvent* audio_device_connection_event; - std::shared_ptr m_set_sys; -}; - -} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_user.cpp b/src/core/hle/service/btm/btm_user.cpp deleted file mode 100644 index c380c573fa..0000000000 --- a/src/core/hle/service/btm/btm_user.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "common/logging.h" -#include "core/hle/service/btm/btm_user.h" -#include "core/hle/service/btm/btm_user_core.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::BTM { - -IBtmUser::IBtmUser(Core::System& system_) : ServiceFramework{system_, "btm:u"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&IBtmUser::GetCore>, "GetCore"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IBtmUser::~IBtmUser() = default; - -Result IBtmUser::GetCore(OutInterface out_interface) { - LOG_WARNING(Service_BTM, "called"); - - *out_interface = std::make_shared(system); - R_SUCCEED(); -} - -} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_user.h b/src/core/hle/service/btm/btm_user.h deleted file mode 100644 index d9ee5db455..0000000000 --- a/src/core/hle/service/btm/btm_user.h +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::BTM { -class IBtmUserCore; - -class IBtmUser final : public ServiceFramework { -public: - explicit IBtmUser(Core::System& system_); - ~IBtmUser() override; - -private: - Result GetCore(OutInterface out_interface); -}; - -} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_user_core.cpp b/src/core/hle/service/btm/btm_user_core.cpp deleted file mode 100644 index b120df14c0..0000000000 --- a/src/core/hle/service/btm/btm_user_core.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#include - -#include "common/logging.h" -#include "core/core.h" -#include "core/hle/kernel/k_event.h" -#include "core/hle/service/btm/btm_user_core.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::BTM { - -IBtmUserCore::IBtmUserCore(Core::System& system_) - : ServiceFramework{system_, "IBtmUserCore"}, service_context{system_, "IBtmUserCore"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&IBtmUserCore::AcquireBleScanEvent>, "AcquireBleScanEvent"}, - {1, nullptr, "GetBleScanFilterParameter"}, - {2, nullptr, "GetBleScanFilterParameter2"}, - {3, nullptr, "StartBleScanForGeneral"}, - {4, nullptr, "StopBleScanForGeneral"}, - {5, nullptr, "GetBleScanResultsForGeneral"}, - {6, nullptr, "StartBleScanForPaired"}, - {7, nullptr, "StopBleScanForPaired"}, - {8, nullptr, "StartBleScanForSmartDevice"}, - {9, nullptr, "StopBleScanForSmartDevice"}, - {10, nullptr, "GetBleScanResultsForSmartDevice"}, - {17, C<&IBtmUserCore::AcquireBleConnectionEvent>, "AcquireBleConnectionEvent"}, - {18, nullptr, "BleConnect"}, - {19, nullptr, "BleDisconnect"}, - {20, nullptr, "BleGetConnectionState"}, - {21, nullptr, "AcquireBlePairingEvent"}, - {22, nullptr, "BlePairDevice"}, - {23, nullptr, "BleUnPairDevice"}, - {24, nullptr, "BleUnPairDevice2"}, - {25, nullptr, "BleGetPairedDevices"}, - {26, C<&IBtmUserCore::AcquireBleServiceDiscoveryEvent>, "AcquireBleServiceDiscoveryEvent"}, - {27, nullptr, "GetGattServices"}, - {28, nullptr, "GetGattService"}, - {29, nullptr, "GetGattIncludedServices"}, - {30, nullptr, "GetBelongingGattService"}, - {31, nullptr, "GetGattCharacteristics"}, - {32, nullptr, "GetGattDescriptors"}, - {33, C<&IBtmUserCore::AcquireBleMtuConfigEvent>, "AcquireBleMtuConfigEvent"}, - {34, nullptr, "ConfigureBleMtu"}, - {35, nullptr, "GetBleMtu"}, - {36, nullptr, "RegisterBleGattDataPath"}, - {37, nullptr, "UnregisterBleGattDataPath"}, - }; - // clang-format on - RegisterHandlers(functions); - - scan_event = service_context.CreateEvent("IBtmUserCore:ScanEvent"); - connection_event = service_context.CreateEvent("IBtmUserCore:ConnectionEvent"); - service_discovery_event = service_context.CreateEvent("IBtmUserCore:DiscoveryEvent"); - config_event = service_context.CreateEvent("IBtmUserCore:ConfigEvent"); -} - -IBtmUserCore::~IBtmUserCore() { - service_context.CloseEvent(scan_event); - service_context.CloseEvent(connection_event); - service_context.CloseEvent(service_discovery_event); - service_context.CloseEvent(config_event); -} - -Result IBtmUserCore::AcquireBleScanEvent(Out out_is_valid, - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &scan_event->GetReadableEvent(); - R_SUCCEED(); -} - -Result IBtmUserCore::AcquireBleConnectionEvent(Out out_is_valid, - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &connection_event->GetReadableEvent(); - R_SUCCEED(); -} - -Result IBtmUserCore::AcquireBleServiceDiscoveryEvent( - Out out_is_valid, OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &service_discovery_event->GetReadableEvent(); - R_SUCCEED(); -} - -Result IBtmUserCore::AcquireBleMtuConfigEvent(Out out_is_valid, - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &config_event->GetReadableEvent(); - R_SUCCEED(); -} - -} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_user_core.h b/src/core/hle/service/btm/btm_user_core.h deleted file mode 100644 index dc0a22e810..0000000000 --- a/src/core/hle/service/btm/btm_user_core.h +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/kernel_helpers.h" -#include "core/hle/service/service.h" - -namespace Kernel { -class KEvent; -class KReadableEvent; -} // namespace Kernel - -namespace Core { -class System; -} - -namespace Service::BTM { - -class IBtmUserCore final : public ServiceFramework { -public: - explicit IBtmUserCore(Core::System& system_); - ~IBtmUserCore() override; - -private: - Result AcquireBleScanEvent(Out out_is_valid, - OutCopyHandle out_event); - - Result AcquireBleConnectionEvent(Out out_is_valid, - OutCopyHandle out_event); - - Result AcquireBleServiceDiscoveryEvent(Out out_is_valid, - OutCopyHandle out_event); - - Result AcquireBleMtuConfigEvent(Out out_is_valid, - OutCopyHandle out_event); - - KernelHelpers::ServiceContext service_context; - - Kernel::KEvent* scan_event; - Kernel::KEvent* connection_event; - Kernel::KEvent* service_discovery_event; - Kernel::KEvent* config_event; -}; - -} // namespace Service::BTM diff --git a/src/core/hle/service/caps/caps.cpp b/src/core/hle/service/caps/caps.cpp index f07fbd2185..6cc37999f3 100644 --- a/src/core/hle/service/caps/caps.cpp +++ b/src/core/hle/service/caps/caps.cpp @@ -5,7 +5,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "core/hle/service/caps/caps.h" -#include "core/hle/service/caps/caps_a.h" #include "core/hle/service/caps/caps_c.h" #include "core/hle/service/caps/caps_manager.h" #include "core/hle/service/caps/caps_sc.h" @@ -14,24 +13,223 @@ #include "core/hle/service/caps/caps_u.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" +#include "common/logging.h" #include "frontend_common/firmware_manager.h" +#include "core/hle/service/caps/caps_result.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/ipc_helpers.h" namespace Service::Capture { class IDecoderControlService final : public ServiceFramework { public: - explicit IDecoderControlService(Core::System& system_) : ServiceFramework{system_, "grc:d"} { - // clang-format off - static const FunctionInfo functions[] = { - {3001, nullptr, "DecodeJpeg"}, - {4001, nullptr, "ShrinkJpeg"}, - {4002, nullptr, "ShrinkJpegEx"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit IDecoderControlService(Core::System& system_) : ServiceFramework{system_, "grc:d"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{3001, nullptr, "DecodeJpeg"}, + FunctionInfo{4001, nullptr, "ShrinkJpeg"}, + FunctionInfo{4002, nullptr, "ShrinkJpegEx"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; +class IAlbumAccessorService final : public ServiceFramework { +public: + explicit IAlbumAccessorService(Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:a"}, manager{album_manager} {} + ~IAlbumAccessorService() override = default; + + Result GetAlbumFileList( + Out out_count, AlbumStorage storage, + OutArray out_entries) { + LOG_INFO(Service_Capture, "called, storage={}", storage); + + const Result result = manager->GetAlbumFileList(out_entries, *out_count, storage, 0); + R_RETURN(TranslateResult(result)); + } + + Result DeleteAlbumFile(AlbumFileId file_id) { + LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}", + file_id.application_id, file_id.storage, file_id.type); + + const Result result = manager->DeleteAlbumFile(file_id); + R_RETURN(TranslateResult(result)); + } + + Result IsAlbumMounted(Out out_is_mounted, AlbumStorage storage) { + LOG_INFO(Service_Capture, "called, storage={}", storage); + + const Result result = manager->IsAlbumMounted(storage); + *out_is_mounted = result.IsSuccess(); + R_RETURN(TranslateResult(result)); + } + + Result Unknown18( + Out out_buffer_size, + OutArray out_buffer) { + LOG_WARNING(Service_Capture, "(STUBBED) called"); + *out_buffer_size = 0; + R_SUCCEED(); + } + + Result GetAlbumFileListEx0( + Out out_entries_size, AlbumStorage storage, u8 flags, + OutArray out_entries) { + LOG_INFO(Service_Capture, "called, storage={}, flags={}", storage, flags); + + const Result result = manager->GetAlbumFileList(out_entries, *out_entries_size, storage, flags); + R_RETURN(TranslateResult(result)); + } + + Result GetAutoSavingStorage(Out out_is_autosaving) { + LOG_WARNING(Service_Capture, "(STUBBED) called"); + + const Result result = manager->GetAutoSavingStorage(*out_is_autosaving); + R_RETURN(TranslateResult(result)); + } + + Result LoadAlbumScreenShotImageEx1( + const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, + OutLargeData out_image_output, + OutArray out_image, + OutArray out_buffer) { + LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}, flags={}", + file_id.application_id, file_id.storage, file_id.type, decoder_options.flags); + + const Result result = + manager->LoadAlbumScreenShotImage(*out_image_output, out_image, file_id, decoder_options); + R_RETURN(TranslateResult(result)); + } + + Result LoadAlbumScreenShotThumbnailImageEx1( + const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, + OutLargeData out_image_output, + OutArray out_image, + OutArray out_buffer) { + LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}, flags={}", + file_id.application_id, file_id.storage, file_id.type, decoder_options.flags); + + const Result result = manager->LoadAlbumScreenShotThumbnail(*out_image_output, out_image, + file_id, decoder_options); + R_RETURN(TranslateResult(result)); + } + + Result TranslateResult(Result in_result) { + if (in_result.IsSuccess()) { + return in_result; + } + + if ((in_result.raw & 0x3801ff) == ResultUnknown1024.raw) { + if (in_result.GetDescription() - 0x514 < 100) { + return ResultInvalidFileData; + } + if (in_result.GetDescription() - 0x5dc < 100) { + return ResultInvalidFileData; + } + + if (in_result.GetDescription() - 0x578 < 100) { + if (in_result == ResultFileCountLimit) { + return ResultUnknown22; + } + return ResultUnknown25; + } + + if (in_result.raw < ResultUnknown1801.raw) { + if (in_result == ResultUnknown1202) { + return ResultUnknown810; + } + if (in_result == ResultUnknown1203) { + return ResultUnknown810; + } + if (in_result == ResultUnknown1701) { + return ResultUnknown5; + } + } else if (in_result.raw < ResultUnknown1803.raw) { + if (in_result == ResultUnknown1801) { + return ResultUnknown5; + } + if (in_result == ResultUnknown1802) { + return ResultUnknown6; + } + } else { + if (in_result == ResultUnknown1803) { + return ResultUnknown7; + } + if (in_result == ResultUnknown1804) { + return ResultOutOfRange; + } + } + return ResultUnknown1024; + } + + if (in_result.GetModule() == ErrorModule::FS) { + if ((in_result.GetDescription() >> 0xc < 0x7d) || + (in_result.GetDescription() - 1000 < 2000) || + (((in_result.GetDescription() - 3000) >> 3) < 0x271)) { + // TODO: Translate FS error + return in_result; + } + } + + return in_result; + } + + Result GetAlbumAccessResultForDebug(Out out_result) { + LOG_WARNING(Service_Capture, "(STUBBED) called"); + *out_result = ResultSuccess; + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetAlbumFileCount"}, + FunctionInfo{1, C<&IAlbumAccessorService::GetAlbumFileList>, "GetAlbumFileList"}, + FunctionInfo{2, nullptr, "LoadAlbumFile"}, + FunctionInfo{3, C<&IAlbumAccessorService::DeleteAlbumFile>, "DeleteAlbumFile"}, + FunctionInfo{4, nullptr, "StorageCopyAlbumFile"}, + FunctionInfo{5, C<&IAlbumAccessorService::IsAlbumMounted>, "IsAlbumMounted"}, + FunctionInfo{6, nullptr, "GetAlbumUsage"}, + FunctionInfo{7, nullptr, "GetAlbumFileSize"}, + FunctionInfo{8, nullptr, "LoadAlbumFileThumbnail"}, + FunctionInfo{9, nullptr, "LoadAlbumScreenShotImage"}, + FunctionInfo{10, nullptr, "LoadAlbumScreenShotThumbnailImage"}, + FunctionInfo{11, nullptr, "GetAlbumEntryFromApplicationAlbumEntry"}, + FunctionInfo{12, nullptr, "LoadAlbumScreenShotImageEx"}, + FunctionInfo{13, nullptr, "LoadAlbumScreenShotThumbnailImageEx"}, + FunctionInfo{14, nullptr, "LoadAlbumScreenShotImageEx0"}, + FunctionInfo{15, nullptr, "GetAlbumUsage3"}, + FunctionInfo{16, nullptr, "GetAlbumMountResult"}, + FunctionInfo{17, nullptr, "GetAlbumUsage16"}, + FunctionInfo{18, C<&IAlbumAccessorService::Unknown18>, "Unknown18"}, + FunctionInfo{19, nullptr, "Unknown19"}, + FunctionInfo{100, nullptr, "GetAlbumFileCountEx0"}, + FunctionInfo{101, C<&IAlbumAccessorService::GetAlbumFileListEx0>, "GetAlbumFileListEx0"}, + FunctionInfo{202, nullptr, "SaveEditedScreenShot"}, + FunctionInfo{301, nullptr, "GetLastThumbnail"}, + FunctionInfo{302, nullptr, "GetLastOverlayMovieThumbnail"}, + FunctionInfo{401, C<&IAlbumAccessorService::GetAutoSavingStorage>, "GetAutoSavingStorage"}, + FunctionInfo{501, nullptr, "GetRequiredStorageSpaceSizeToCopyAll"}, + FunctionInfo{1001, nullptr, "LoadAlbumScreenShotThumbnailImageEx0"}, + FunctionInfo{1002, C<&IAlbumAccessorService::LoadAlbumScreenShotImageEx1>, "LoadAlbumScreenShotImageEx1"}, + FunctionInfo{1003, C<&IAlbumAccessorService::LoadAlbumScreenShotThumbnailImageEx1>, "LoadAlbumScreenShotThumbnailImageEx1"}, + FunctionInfo{8001, nullptr, "ForceAlbumUnmounted"}, + FunctionInfo{8002, nullptr, "ResetAlbumMountStatus"}, + FunctionInfo{8011, nullptr, "RefreshAlbumCache"}, + FunctionInfo{8012, nullptr, "GetAlbumCache"}, + FunctionInfo{8013, nullptr, "GetAlbumCacheEx"}, + FunctionInfo{8021, nullptr, "GetAlbumEntryFromApplicationAlbumEntryAruid"}, + FunctionInfo{10011, nullptr, "SetInternalErrorConversionEnabled"}, + FunctionInfo{50000, nullptr, "LoadMakerNoteInfoForDebug"}, + FunctionInfo{50011, C<&IAlbumAccessorService::GetAlbumAccessResultForDebug>, "GetAlbumAccessResultForDebug"}, + FunctionInfo{60002, nullptr, "OpenAccessorSession"} + ); + + std::shared_ptr manager = nullptr; +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); auto album_manager = std::make_shared(system); diff --git a/src/core/hle/service/caps/caps_a.cpp b/src/core/hle/service/caps/caps_a.cpp deleted file mode 100644 index 8f561bfcdc..0000000000 --- a/src/core/hle/service/caps/caps_a.cpp +++ /dev/null @@ -1,211 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging.h" -#include "core/hle/service/caps/caps_a.h" -#include "core/hle/service/caps/caps_manager.h" -#include "core/hle/service/caps/caps_result.h" -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/ipc_helpers.h" - -namespace Service::Capture { - -IAlbumAccessorService::IAlbumAccessorService(Core::System& system_, - std::shared_ptr album_manager) - : ServiceFramework{system_, "caps:a"}, manager{album_manager} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetAlbumFileCount"}, - {1, C<&IAlbumAccessorService::GetAlbumFileList>, "GetAlbumFileList"}, - {2, nullptr, "LoadAlbumFile"}, - {3, C<&IAlbumAccessorService::DeleteAlbumFile>, "DeleteAlbumFile"}, - {4, nullptr, "StorageCopyAlbumFile"}, - {5, C<&IAlbumAccessorService::IsAlbumMounted>, "IsAlbumMounted"}, - {6, nullptr, "GetAlbumUsage"}, - {7, nullptr, "GetAlbumFileSize"}, - {8, nullptr, "LoadAlbumFileThumbnail"}, - {9, nullptr, "LoadAlbumScreenShotImage"}, - {10, nullptr, "LoadAlbumScreenShotThumbnailImage"}, - {11, nullptr, "GetAlbumEntryFromApplicationAlbumEntry"}, - {12, nullptr, "LoadAlbumScreenShotImageEx"}, - {13, nullptr, "LoadAlbumScreenShotThumbnailImageEx"}, - {14, nullptr, "LoadAlbumScreenShotImageEx0"}, - {15, nullptr, "GetAlbumUsage3"}, - {16, nullptr, "GetAlbumMountResult"}, - {17, nullptr, "GetAlbumUsage16"}, - {18, C<&IAlbumAccessorService::Unknown18>, "Unknown18"}, - {19, nullptr, "Unknown19"}, - {100, nullptr, "GetAlbumFileCountEx0"}, - {101, C<&IAlbumAccessorService::GetAlbumFileListEx0>, "GetAlbumFileListEx0"}, - {202, nullptr, "SaveEditedScreenShot"}, - {301, nullptr, "GetLastThumbnail"}, - {302, nullptr, "GetLastOverlayMovieThumbnail"}, - {401, C<&IAlbumAccessorService::GetAutoSavingStorage>, "GetAutoSavingStorage"}, - {501, nullptr, "GetRequiredStorageSpaceSizeToCopyAll"}, - {1001, nullptr, "LoadAlbumScreenShotThumbnailImageEx0"}, - {1002, C<&IAlbumAccessorService::LoadAlbumScreenShotImageEx1>, "LoadAlbumScreenShotImageEx1"}, - {1003, C<&IAlbumAccessorService::LoadAlbumScreenShotThumbnailImageEx1>, "LoadAlbumScreenShotThumbnailImageEx1"}, - {8001, nullptr, "ForceAlbumUnmounted"}, - {8002, nullptr, "ResetAlbumMountStatus"}, - {8011, nullptr, "RefreshAlbumCache"}, - {8012, nullptr, "GetAlbumCache"}, - {8013, nullptr, "GetAlbumCacheEx"}, - {8021, nullptr, "GetAlbumEntryFromApplicationAlbumEntryAruid"}, - {10011, nullptr, "SetInternalErrorConversionEnabled"}, - {50000, nullptr, "LoadMakerNoteInfoForDebug"}, - {50011, C<&IAlbumAccessorService::GetAlbumAccessResultForDebug>, "GetAlbumAccessResultForDebug"}, - {60002, nullptr, "OpenAccessorSession"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IAlbumAccessorService::~IAlbumAccessorService() = default; - -Result IAlbumAccessorService::GetAlbumFileList( - Out out_count, AlbumStorage storage, - OutArray out_entries) { - LOG_INFO(Service_Capture, "called, storage={}", storage); - - const Result result = manager->GetAlbumFileList(out_entries, *out_count, storage, 0); - R_RETURN(TranslateResult(result)); -} - -Result IAlbumAccessorService::DeleteAlbumFile(AlbumFileId file_id) { - LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}", - file_id.application_id, file_id.storage, file_id.type); - - const Result result = manager->DeleteAlbumFile(file_id); - R_RETURN(TranslateResult(result)); -} - -Result IAlbumAccessorService::IsAlbumMounted(Out out_is_mounted, AlbumStorage storage) { - LOG_INFO(Service_Capture, "called, storage={}", storage); - - const Result result = manager->IsAlbumMounted(storage); - *out_is_mounted = result.IsSuccess(); - R_RETURN(TranslateResult(result)); -} - -Result IAlbumAccessorService::Unknown18( - Out out_buffer_size, - OutArray out_buffer) { - LOG_WARNING(Service_Capture, "(STUBBED) called"); - *out_buffer_size = 0; - R_SUCCEED(); -} - -Result IAlbumAccessorService::GetAlbumFileListEx0( - Out out_entries_size, AlbumStorage storage, u8 flags, - OutArray out_entries) { - LOG_INFO(Service_Capture, "called, storage={}, flags={}", storage, flags); - - const Result result = manager->GetAlbumFileList(out_entries, *out_entries_size, storage, flags); - R_RETURN(TranslateResult(result)); -} - -Result IAlbumAccessorService::GetAutoSavingStorage(Out out_is_autosaving) { - LOG_WARNING(Service_Capture, "(STUBBED) called"); - - const Result result = manager->GetAutoSavingStorage(*out_is_autosaving); - R_RETURN(TranslateResult(result)); -} - -Result IAlbumAccessorService::LoadAlbumScreenShotImageEx1( - const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, - OutLargeData out_image_output, - OutArray out_image, - OutArray out_buffer) { - LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}, flags={}", - file_id.application_id, file_id.storage, file_id.type, decoder_options.flags); - - const Result result = - manager->LoadAlbumScreenShotImage(*out_image_output, out_image, file_id, decoder_options); - R_RETURN(TranslateResult(result)); -} - -Result IAlbumAccessorService::LoadAlbumScreenShotThumbnailImageEx1( - const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, - OutLargeData out_image_output, - OutArray out_image, - OutArray out_buffer) { - LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}, flags={}", - file_id.application_id, file_id.storage, file_id.type, decoder_options.flags); - - const Result result = manager->LoadAlbumScreenShotThumbnail(*out_image_output, out_image, - file_id, decoder_options); - R_RETURN(TranslateResult(result)); -} - -Result IAlbumAccessorService::TranslateResult(Result in_result) { - if (in_result.IsSuccess()) { - return in_result; - } - - if ((in_result.raw & 0x3801ff) == ResultUnknown1024.raw) { - if (in_result.GetDescription() - 0x514 < 100) { - return ResultInvalidFileData; - } - if (in_result.GetDescription() - 0x5dc < 100) { - return ResultInvalidFileData; - } - - if (in_result.GetDescription() - 0x578 < 100) { - if (in_result == ResultFileCountLimit) { - return ResultUnknown22; - } - return ResultUnknown25; - } - - if (in_result.raw < ResultUnknown1801.raw) { - if (in_result == ResultUnknown1202) { - return ResultUnknown810; - } - if (in_result == ResultUnknown1203) { - return ResultUnknown810; - } - if (in_result == ResultUnknown1701) { - return ResultUnknown5; - } - } else if (in_result.raw < ResultUnknown1803.raw) { - if (in_result == ResultUnknown1801) { - return ResultUnknown5; - } - if (in_result == ResultUnknown1802) { - return ResultUnknown6; - } - } else { - if (in_result == ResultUnknown1803) { - return ResultUnknown7; - } - if (in_result == ResultUnknown1804) { - return ResultOutOfRange; - } - } - return ResultUnknown1024; - } - - if (in_result.GetModule() == ErrorModule::FS) { - if ((in_result.GetDescription() >> 0xc < 0x7d) || - (in_result.GetDescription() - 1000 < 2000) || - (((in_result.GetDescription() - 3000) >> 3) < 0x271)) { - // TODO: Translate FS error - return in_result; - } - } - - return in_result; -} - - -Result IAlbumAccessorService::GetAlbumAccessResultForDebug(Out out_result) { - LOG_WARNING(Service_Capture, "(STUBBED) called"); - *out_result = ResultSuccess; - R_SUCCEED(); -} - -} // namespace Service::Capture diff --git a/src/core/hle/service/caps/caps_a.h b/src/core/hle/service/caps/caps_a.h deleted file mode 100644 index 1885ba6be0..0000000000 --- a/src/core/hle/service/caps/caps_a.h +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/caps/caps_types.h" -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::Capture { -class AlbumManager; - -class IAlbumAccessorService final : public ServiceFramework { -public: - explicit IAlbumAccessorService(Core::System& system_, - std::shared_ptr album_manager); - ~IAlbumAccessorService() override; - -private: - Result GetAlbumFileList(Out out_count, AlbumStorage storage, - OutArray out_entries); - - Result DeleteAlbumFile(AlbumFileId file_id); - - Result IsAlbumMounted(Out out_is_mounted, AlbumStorage storage); - - Result Unknown18( - Out out_buffer_size, - OutArray - out_buffer); - - Result GetAlbumFileListEx0(Out out_entries_size, AlbumStorage storage, u8 flags, - OutArray out_entries); - - Result GetAutoSavingStorage(Out out_is_autosaving); - - Result LoadAlbumScreenShotImageEx1( - const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, - OutLargeData out_image_output, - OutArray out_image, - OutArray out_buffer); - - Result LoadAlbumScreenShotThumbnailImageEx1( - const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, - OutLargeData out_image_output, - OutArray out_image, - OutArray out_buffer); - - Result TranslateResult(Result in_result); - - Result GetAlbumAccessResultForDebug(Out out_result); - - std::shared_ptr manager = nullptr; -}; - -} // namespace Service::Capture diff --git a/src/core/hle/service/caps/caps_c.cpp b/src/core/hle/service/caps/caps_c.cpp index 6c9f8e964d..c62c3cd5d3 100644 --- a/src/core/hle/service/caps/caps_c.cpp +++ b/src/core/hle/service/caps/caps_c.cpp @@ -14,34 +14,34 @@ namespace Service::Capture { +std::optional IAlbumControlService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "CaptureRawImage"}, + FunctionInfo{2, nullptr, "CaptureRawImageWithTimeout"}, + FunctionInfo{33, C<&IAlbumControlService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, + FunctionInfo{1001, nullptr, "RequestTakingScreenShot"}, + FunctionInfo{1002, nullptr, "RequestTakingScreenShotWithTimeout"}, + FunctionInfo{1011, nullptr, "NotifyTakingScreenShotRefused"}, + FunctionInfo{2001, nullptr, "NotifyAlbumStorageIsAvailable"}, + FunctionInfo{2002, nullptr, "NotifyAlbumStorageIsUnavailable"}, + FunctionInfo{2011, nullptr, "RegisterAppletResourceUserId"}, + FunctionInfo{2012, nullptr, "UnregisterAppletResourceUserId"}, + FunctionInfo{2013, nullptr, "GetApplicationIdFromAruid"}, + FunctionInfo{2014, nullptr, "CheckApplicationIdRegistered"}, + FunctionInfo{2101, nullptr, "GenerateCurrentAlbumFileId"}, + FunctionInfo{2102, nullptr, "GenerateApplicationAlbumEntry"}, + FunctionInfo{2201, nullptr, "SaveAlbumScreenShotFile"}, + FunctionInfo{2202, nullptr, "SaveAlbumScreenShotFileEx"}, + FunctionInfo{2301, nullptr, "SetOverlayScreenShotThumbnailData"}, + FunctionInfo{2302, nullptr, "SetOverlayMovieThumbnailData"}, + FunctionInfo{60001, nullptr, "OpenControlSession"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAlbumControlService::IAlbumControlService(Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:c"}, manager{album_manager} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "CaptureRawImage"}, - {2, nullptr, "CaptureRawImageWithTimeout"}, - {33, C<&IAlbumControlService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, - {1001, nullptr, "RequestTakingScreenShot"}, - {1002, nullptr, "RequestTakingScreenShotWithTimeout"}, - {1011, nullptr, "NotifyTakingScreenShotRefused"}, - {2001, nullptr, "NotifyAlbumStorageIsAvailable"}, - {2002, nullptr, "NotifyAlbumStorageIsUnavailable"}, - {2011, nullptr, "RegisterAppletResourceUserId"}, - {2012, nullptr, "UnregisterAppletResourceUserId"}, - {2013, nullptr, "GetApplicationIdFromAruid"}, - {2014, nullptr, "CheckApplicationIdRegistered"}, - {2101, nullptr, "GenerateCurrentAlbumFileId"}, - {2102, nullptr, "GenerateApplicationAlbumEntry"}, - {2201, nullptr, "SaveAlbumScreenShotFile"}, - {2202, nullptr, "SaveAlbumScreenShotFileEx"}, - {2301, nullptr, "SetOverlayScreenShotThumbnailData"}, - {2302, nullptr, "SetOverlayMovieThumbnailData"}, - {60001, nullptr, "OpenControlSession"}, - }; - // clang-format on - - RegisterHandlers(functions); } IAlbumControlService::~IAlbumControlService() = default; diff --git a/src/core/hle/service/caps/caps_c.h b/src/core/hle/service/caps/caps_c.h index 0ecdfa1147..a1f19bbfc3 100644 --- a/src/core/hle/service/caps/caps_c.h +++ b/src/core/hle/service/caps/caps_c.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -16,14 +19,11 @@ enum class ShimLibraryVersion : u64; class IAlbumControlService final : public ServiceFramework { public: - explicit IAlbumControlService(Core::System& system_, - std::shared_ptr album_manager); + explicit IAlbumControlService(Core::System& system_, std::shared_ptr album_manager); ~IAlbumControlService() override; - private: - Result SetShimLibraryVersion(ShimLibraryVersion library_version, - ClientAppletResourceUserId aruid); - + Result SetShimLibraryVersion(ShimLibraryVersion library_version, ClientAppletResourceUserId aruid); + std::optional FindRequest(u32 key) override; std::shared_ptr manager = nullptr; }; diff --git a/src/core/hle/service/caps/caps_sc.cpp b/src/core/hle/service/caps/caps_sc.cpp index 6117cb7c6c..59119d8ed7 100644 --- a/src/core/hle/service/caps/caps_sc.cpp +++ b/src/core/hle/service/caps/caps_sc.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,32 +10,6 @@ namespace Service::Capture { IScreenShotControlService::IScreenShotControlService(Core::System& system_) : ServiceFramework{system_, "caps:sc"} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "CaptureRawImage"}, - {2, nullptr, "CaptureRawImageWithTimeout"}, - {3, nullptr, "AttachSharedBuffer"}, - {5, nullptr, "CaptureRawImageToAttachedSharedBuffer"}, - {210, nullptr, "Unknown210"}, - {1001, nullptr, "RequestTakingScreenShot"}, - {1002, nullptr, "RequestTakingScreenShotWithTimeout"}, - {1003, nullptr, "RequestTakingScreenShotEx"}, - {1004, nullptr, "RequestTakingScreenShotEx1"}, - {1009, nullptr, "CancelTakingScreenShot"}, - {1010, nullptr, "SetTakingScreenShotCancelState"}, - {1011, nullptr, "NotifyTakingScreenShotRefused"}, - {1012, nullptr, "NotifyTakingScreenShotFailed"}, - {1101, nullptr, "SetupOverlayMovieThumbnail"}, - {1106, nullptr, "Unknown1106"}, - {1107, nullptr, "Unknown1107"}, - {1201, nullptr, "OpenRawScreenShotReadStream"}, - {1202, nullptr, "CloseRawScreenShotReadStream"}, - {1203, nullptr, "ReadRawScreenShotReadStream"}, - {1204, nullptr, "Unknown1204"}, - }; - // clang-format on - - RegisterHandlers(functions); } IScreenShotControlService::~IScreenShotControlService() = default; diff --git a/src/core/hle/service/caps/caps_sc.h b/src/core/hle/service/caps/caps_sc.h index d555f49792..422f062e59 100644 --- a/src/core/hle/service/caps/caps_sc.h +++ b/src/core/hle/service/caps/caps_sc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,32 @@ class IScreenShotControlService final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "CaptureRawImage"}, + FunctionInfo{2, nullptr, "CaptureRawImageWithTimeout"}, + FunctionInfo{3, nullptr, "AttachSharedBuffer"}, + FunctionInfo{5, nullptr, "CaptureRawImageToAttachedSharedBuffer"}, + FunctionInfo{210, nullptr, "Unknown210"}, + FunctionInfo{1001, nullptr, "RequestTakingScreenShot"}, + FunctionInfo{1002, nullptr, "RequestTakingScreenShotWithTimeout"}, + FunctionInfo{1003, nullptr, "RequestTakingScreenShotEx"}, + FunctionInfo{1004, nullptr, "RequestTakingScreenShotEx1"}, + FunctionInfo{1009, nullptr, "CancelTakingScreenShot"}, + FunctionInfo{1010, nullptr, "SetTakingScreenShotCancelState"}, + FunctionInfo{1011, nullptr, "NotifyTakingScreenShotRefused"}, + FunctionInfo{1012, nullptr, "NotifyTakingScreenShotFailed"}, + FunctionInfo{1101, nullptr, "SetupOverlayMovieThumbnail"}, + FunctionInfo{1106, nullptr, "Unknown1106"}, + FunctionInfo{1107, nullptr, "Unknown1107"}, + FunctionInfo{1201, nullptr, "OpenRawScreenShotReadStream"}, + FunctionInfo{1202, nullptr, "CloseRawScreenShotReadStream"}, + FunctionInfo{1203, nullptr, "ReadRawScreenShotReadStream"}, + FunctionInfo{1204, nullptr, "Unknown1204"} + ); }; } // namespace Service::Capture diff --git a/src/core/hle/service/caps/caps_ss.cpp b/src/core/hle/service/caps/caps_ss.cpp index 0cd641f551..0c444116b7 100644 --- a/src/core/hle/service/caps/caps_ss.cpp +++ b/src/core/hle/service/caps/caps_ss.cpp @@ -12,22 +12,22 @@ namespace Service::Capture { +std::optional IScreenShotService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{201, nullptr, "SaveScreenShot"}, + FunctionInfo{202, nullptr, "SaveEditedScreenShot"}, + FunctionInfo{203, C<&IScreenShotService::SaveScreenShotEx0>, "SaveScreenShotEx0"}, + FunctionInfo{204, nullptr, "SaveEditedScreenShotEx0"}, + FunctionInfo{206, C<&IScreenShotService::SaveEditedScreenShotEx1>, "SaveEditedScreenShotEx1"}, + FunctionInfo{208, nullptr, "SaveScreenShotOfMovieEx1"}, + FunctionInfo{1000, nullptr, "Unknown1000"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IScreenShotService::IScreenShotService(Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:ss"}, manager{album_manager} { - // clang-format off - static const FunctionInfo functions[] = { - {201, nullptr, "SaveScreenShot"}, - {202, nullptr, "SaveEditedScreenShot"}, - {203, C<&IScreenShotService::SaveScreenShotEx0>, "SaveScreenShotEx0"}, - {204, nullptr, "SaveEditedScreenShotEx0"}, - {206, C<&IScreenShotService::SaveEditedScreenShotEx1>, "SaveEditedScreenShotEx1"}, - {208, nullptr, "SaveScreenShotOfMovieEx1"}, - {1000, nullptr, "Unknown1000"}, - }; - // clang-format on - - RegisterHandlers(functions); } IScreenShotService::~IScreenShotService() = default; diff --git a/src/core/hle/service/caps/caps_ss.h b/src/core/hle/service/caps/caps_ss.h index da4b4cc5fc..8817637fb8 100644 --- a/src/core/hle/service/caps/caps_ss.h +++ b/src/core/hle/service/caps/caps_ss.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -34,6 +37,7 @@ private: const InBuffer thumbnail_image_data_buffer); + std::optional FindRequest(u32 key) override; std::shared_ptr manager; }; diff --git a/src/core/hle/service/caps/caps_su.cpp b/src/core/hle/service/caps/caps_su.cpp index 4ecfc840e4..e708ddbb68 100644 --- a/src/core/hle/service/caps/caps_su.cpp +++ b/src/core/hle/service/caps/caps_su.cpp @@ -15,20 +15,20 @@ namespace Service::Capture { +std::optional IScreenShotApplicationService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{32, C<&IScreenShotApplicationService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, + FunctionInfo{201, nullptr, "SaveScreenShot"}, + FunctionInfo{203, C<&IScreenShotApplicationService::SaveScreenShotEx0>, "SaveScreenShotEx0"}, + FunctionInfo{205, C<&IScreenShotApplicationService::SaveScreenShotEx1>, "SaveScreenShotEx1"}, + FunctionInfo{210, nullptr, "SaveScreenShotEx2"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IScreenShotApplicationService::IScreenShotApplicationService( Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:su"}, manager{album_manager} { - // clang-format off - static const FunctionInfo functions[] = { - {32, C<&IScreenShotApplicationService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, - {201, nullptr, "SaveScreenShot"}, - {203, C<&IScreenShotApplicationService::SaveScreenShotEx0>, "SaveScreenShotEx0"}, - {205, C<&IScreenShotApplicationService::SaveScreenShotEx1>, "SaveScreenShotEx1"}, - {210, nullptr, "SaveScreenShotEx2"}, - }; - // clang-format on - - RegisterHandlers(functions); } IScreenShotApplicationService::~IScreenShotApplicationService() = default; diff --git a/src/core/hle/service/caps/caps_su.h b/src/core/hle/service/caps/caps_su.h index 4b4cbd09e6..0fdc994a25 100644 --- a/src/core/hle/service/caps/caps_su.h +++ b/src/core/hle/service/caps/caps_su.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -42,8 +45,8 @@ private: const InBuffer image_data_buffer); + std::optional FindRequest(u32 key) override; std::array image_data; - std::shared_ptr manager; }; diff --git a/src/core/hle/service/caps/caps_u.cpp b/src/core/hle/service/caps/caps_u.cpp index 6472b2bac6..c1fa418e03 100644 --- a/src/core/hle/service/caps/caps_u.cpp +++ b/src/core/hle/service/caps/caps_u.cpp @@ -13,29 +13,29 @@ namespace Service::Capture { +std::optional IAlbumApplicationService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{32, C<&IAlbumApplicationService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, + FunctionInfo{102, C<&IAlbumApplicationService::GetAlbumFileList0AafeAruidDeprecated>, "GetAlbumFileList0AafeAruidDeprecated"}, + FunctionInfo{103, nullptr, "DeleteAlbumFileByAruid"}, + FunctionInfo{104, nullptr, "GetAlbumFileSizeByAruid"}, + FunctionInfo{105, nullptr, "DeleteAlbumFileByAruidForDebug"}, + FunctionInfo{110, nullptr, "LoadAlbumScreenShotImageByAruid"}, + FunctionInfo{120, nullptr, "LoadAlbumScreenShotThumbnailImageByAruid"}, + FunctionInfo{130, nullptr, "PrecheckToCreateContentsByAruid"}, + FunctionInfo{140, nullptr, "GetAlbumFileList1AafeAruidDeprecated"}, + FunctionInfo{141, nullptr, "GetAlbumFileList2AafeUidAruidDeprecated"}, + FunctionInfo{142, C<&IAlbumApplicationService::GetAlbumFileList3AaeAruid>, "GetAlbumFileList3AaeAruid"}, + FunctionInfo{143, nullptr, "GetAlbumFileList4AaeUidAruid"}, + FunctionInfo{144, nullptr, "GetAllAlbumFileList3AaeAruid"}, + FunctionInfo{60002, nullptr, "OpenAccessorSessionForApplication"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAlbumApplicationService::IAlbumApplicationService(Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:u"}, manager{album_manager} { - // clang-format off - static const FunctionInfo functions[] = { - {32, C<&IAlbumApplicationService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, - {102, C<&IAlbumApplicationService::GetAlbumFileList0AafeAruidDeprecated>, "GetAlbumFileList0AafeAruidDeprecated"}, - {103, nullptr, "DeleteAlbumFileByAruid"}, - {104, nullptr, "GetAlbumFileSizeByAruid"}, - {105, nullptr, "DeleteAlbumFileByAruidForDebug"}, - {110, nullptr, "LoadAlbumScreenShotImageByAruid"}, - {120, nullptr, "LoadAlbumScreenShotThumbnailImageByAruid"}, - {130, nullptr, "PrecheckToCreateContentsByAruid"}, - {140, nullptr, "GetAlbumFileList1AafeAruidDeprecated"}, - {141, nullptr, "GetAlbumFileList2AafeUidAruidDeprecated"}, - {142, C<&IAlbumApplicationService::GetAlbumFileList3AaeAruid>, "GetAlbumFileList3AaeAruid"}, - {143, nullptr, "GetAlbumFileList4AaeUidAruid"}, - {144, nullptr, "GetAllAlbumFileList3AaeAruid"}, - {60002, nullptr, "OpenAccessorSessionForApplication"}, - }; - // clang-format on - - RegisterHandlers(functions); } IAlbumApplicationService::~IAlbumApplicationService() = default; diff --git a/src/core/hle/service/caps/caps_u.h b/src/core/hle/service/caps/caps_u.h index 023ee1fe79..52e151bbe2 100644 --- a/src/core/hle/service/caps/caps_u.h +++ b/src/core/hle/service/caps/caps_u.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -33,6 +36,7 @@ private: AlbumFileDateTime end_date_time, ClientAppletResourceUserId aruid, OutArray out_entries); + std::optional FindRequest(u32 key) override; std::shared_ptr manager = nullptr; }; diff --git a/src/core/hle/service/erpt/erpt.cpp b/src/core/hle/service/erpt/erpt.cpp index 014f1da62f..7bed893bd7 100644 --- a/src/core/hle/service/erpt/erpt.cpp +++ b/src/core/hle/service/erpt/erpt.cpp @@ -17,30 +17,10 @@ namespace Service::ERPT { class ErrorReportContext final : public ServiceFramework { public: - explicit ErrorReportContext(Core::System& system_) : ServiceFramework{system_, "erpt:c"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&ErrorReportContext::SubmitContext>, "SubmitContext"}, - {1, C<&ErrorReportContext::CreateReportV0>, "CreateReportV0"}, - {2, nullptr, "SetInitialLaunchSettingsCompletionTime"}, - {3, nullptr, "ClearInitialLaunchSettingsCompletionTime"}, - {4, nullptr, "UpdatePowerOnTime"}, - {5, D<&ErrorReportContext::UpdateAwakeTime>, "UpdateAwakeTime"}, - {6, nullptr, "SubmitMultipleCategoryContext"}, - {7, nullptr, "UpdateApplicationLaunchTime"}, - {8, nullptr, "ClearApplicationLaunchTime"}, - {9, nullptr, "SubmitAttachment"}, - {10, nullptr, "CreateReportWithAttachments"}, - {11, C<&ErrorReportContext::CreateReportV1>, "CreateReportV1"}, - {12, C<&ErrorReportContext::CreateReport>, "CreateReport"}, - {20, nullptr, "RegisterRunningApplet"}, - {21, nullptr, "UnregisterRunningApplet"}, - {22, nullptr, "UpdateAppletSuspendedDuration"}, - {30, nullptr, "InvalidateForcedShutdownDetection"}, - }; - // clang-format on + explicit ErrorReportContext(Core::System& system_) : ServiceFramework{system_, "erpt:c"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -85,21 +65,41 @@ private: data_a.size(), data_b.size(), flag_a, flag_b); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&ErrorReportContext::SubmitContext>, "SubmitContext"}, + FunctionInfo{1, C<&ErrorReportContext::CreateReportV0>, "CreateReportV0"}, + FunctionInfo{2, nullptr, "SetInitialLaunchSettingsCompletionTime"}, + FunctionInfo{3, nullptr, "ClearInitialLaunchSettingsCompletionTime"}, + FunctionInfo{4, nullptr, "UpdatePowerOnTime"}, + FunctionInfo{5, D<&ErrorReportContext::UpdateAwakeTime>, "UpdateAwakeTime"}, + FunctionInfo{6, nullptr, "SubmitMultipleCategoryContext"}, + FunctionInfo{7, nullptr, "UpdateApplicationLaunchTime"}, + FunctionInfo{8, nullptr, "ClearApplicationLaunchTime"}, + FunctionInfo{9, nullptr, "SubmitAttachment"}, + FunctionInfo{10, nullptr, "CreateReportWithAttachments"}, + FunctionInfo{11, C<&ErrorReportContext::CreateReportV1>, "CreateReportV1"}, + FunctionInfo{12, C<&ErrorReportContext::CreateReport>, "CreateReport"}, + FunctionInfo{20, nullptr, "RegisterRunningApplet"}, + FunctionInfo{21, nullptr, "UnregisterRunningApplet"}, + FunctionInfo{22, nullptr, "UpdateAppletSuspendedDuration"}, + FunctionInfo{30, nullptr, "InvalidateForcedShutdownDetection"} + ); }; class ErrorReportSession final : public ServiceFramework { public: - explicit ErrorReportSession(Core::System& system_) : ServiceFramework{system_, "erpt:r"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "OpenReport"}, - {1, nullptr, "OpenManager"}, - {2, nullptr, "OpenAttachment"}, - }; - // clang-format on + explicit ErrorReportSession(Core::System& system_) : ServiceFramework{system_, "erpt:r"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenReport"}, + FunctionInfo{1, nullptr, "OpenManager"}, + FunctionInfo{2, nullptr, "OpenAttachment"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index 432783f96e..01d11183c9 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp @@ -19,110 +19,14 @@ constexpr Result ERROR_INVALID_RIGHTS_ID{ErrorModule::ETicket, 3}; class ETicket final : public ServiceFramework { public: explicit ETicket(Core::System& system_) : ServiceFramework{system_, "es"} { - // clang-format off - static const FunctionInfo functions[] = { - {1, &ETicket::ImportTicket, "ImportTicket"}, - {2, nullptr, "ImportTicketCertificateSet"}, - {3, nullptr, "DeleteTicket"}, - {4, nullptr, "DeletePersonalizedTicket"}, - {5, nullptr, "DeleteAllCommonTicket"}, - {6, nullptr, "DeleteAllPersonalizedTicket"}, - {7, nullptr, "DeleteAllPersonalizedTicketEx"}, - {8, &ETicket::GetTitleKey, "GetTitleKey"}, - {9, &ETicket::CountCommonTicket, "CountCommonTicket"}, - {10, &ETicket::CountPersonalizedTicket, "CountPersonalizedTicket"}, - {11, &ETicket::ListCommonTicketRightsIds, "ListCommonTicketRightsIds"}, - {12, &ETicket::ListPersonalizedTicketRightsIds, "ListPersonalizedTicketRightsIds"}, - {13, nullptr, "ListMissingPersonalizedTicket"}, - {14, &ETicket::GetCommonTicketSize, "GetCommonTicketSize"}, - {15, &ETicket::GetPersonalizedTicketSize, "GetPersonalizedTicketSize"}, - {16, &ETicket::GetCommonTicketData, "GetCommonTicketData"}, - {17, &ETicket::GetPersonalizedTicketData, "GetPersonalizedTicketData"}, - {18, nullptr, "OwnTicket"}, - {19, nullptr, "GetTicketInfo"}, - {20, nullptr, "ListLightTicketInfo"}, - {21, nullptr, "SignData"}, - {22, nullptr, "GetCommonTicketAndCertificateSize"}, - {23, nullptr, "GetCommonTicketAndCertificateData"}, - {24, nullptr, "ImportPrepurchaseRecord"}, - {25, nullptr, "DeletePrepurchaseRecord"}, - {26, nullptr, "DeleteAllPrepurchaseRecord"}, - {27, nullptr, "CountPrepurchaseRecord"}, - {28, nullptr, "ListPrepurchaseRecordRightsIds"}, - {29, nullptr, "ListPrepurchaseRecordInfo"}, - {30, nullptr, "CountTicket"}, - {31, nullptr, "ListTicketRightsIds"}, - {32, nullptr, "CountPrepurchaseRecordEx"}, - {33, nullptr, "ListPrepurchaseRecordRightsIdsEx"}, - {34, nullptr, "GetEncryptedTicketSize"}, - {35, nullptr, "GetEncryptedTicketData"}, - {36, nullptr, "DeleteAllInactiveELicenseRequiredPersonalizedTicket"}, - {37, nullptr, "OwnTicket2"}, - {38, nullptr, "OwnTicket3"}, - {39, nullptr, "DeleteAllInactivePersonalizedTicket"}, - {40, nullptr, "DeletePrepurchaseRecordByNintendoAccountId"}, - {101, nullptr, "Unknown101"}, //18.0.0+ - {102, nullptr, "Unknown102"}, //18.0.0+ - {103, nullptr, "Unknown103"}, //18.0.0+ - {104, nullptr, "Unknown104"}, //18.0.0+ - {105, nullptr, "Unknown105"}, //20.0.0+ - {201, nullptr, "Unknown201"}, //18.0.0+ - {202, nullptr, "Unknown202"}, //18.0.0+ - {203, nullptr, "Unknown203"}, //18.0.0+ - {204, nullptr, "Unknown204"}, //18.0.0+ - {205, nullptr, "Unknown205"}, //18.0.0+ - {501, nullptr, "Unknown501"}, - {502, nullptr, "Unknown502"}, - {503, nullptr, "GetTitleKey"}, - {504, nullptr, "Unknown504"}, - {508, nullptr, "Unknown508"}, - {509, nullptr, "Unknown509"}, - {510, nullptr, "Unknown510"}, - {511, nullptr, "Unknown511"}, - {1001, nullptr, "Unknown1001"}, - {1002, nullptr, "Unknown1001"}, - {1003, nullptr, "Unknown1003"}, - {1004, nullptr, "Unknown1004"}, - {1005, nullptr, "Unknown1005"}, - {1006, nullptr, "Unknown1006"}, - {1007, nullptr, "Unknown1007"}, - {1009, nullptr, "Unknown1009"}, - {1010, nullptr, "Unknown1010"}, - {1011, nullptr, "Unknown1011"}, - {1012, nullptr, "Unknown1012"}, - {1013, nullptr, "Unknown1013"}, - {1014, nullptr, "Unknown1014"}, - {1015, nullptr, "Unknown1015"}, - {1016, nullptr, "Unknown1016"}, - {1017, nullptr, "Unknown1017"}, - {1018, nullptr, "Unknown1018"}, - {1019, nullptr, "Unknown1019"}, - {1020, nullptr, "Unknown1020"}, - {1021, nullptr, "Unknown1021"}, - {1501, nullptr, "Unknown1501"}, - {1502, nullptr, "Unknown1502"}, - {1503, nullptr, "Unknown1503"}, - {1504, nullptr, "Unknown1504"}, - {1505, nullptr, "Unknown1505"}, - {1506, nullptr, "Unknown1506"}, - {2000, nullptr, "Unknown2000"}, - {2001, nullptr, "Unknown2001"}, - {2002, nullptr, "Unknown2002"}, - {2003, nullptr, "Unknown2003"}, - {2100, nullptr, "Unknown2100"}, - {2501, nullptr, "Unknown2501"}, - {2502, nullptr, "Unknown2502"}, - {2601, nullptr, "Unknown2601"}, - {3001, nullptr, "Unknown3001"}, - {3002, nullptr, "Unknown3002"}, - }; - // clang-format on - RegisterHandlers(functions); - keys.PopulateTickets(); keys.SynthesizeTickets(); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + private: bool CheckRightsId(HLERequestContext& ctx, const u128& rights_id) { if (rights_id == u128{}) { @@ -317,89 +221,185 @@ private: rb.Push(write_size); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, &ETicket::ImportTicket, "ImportTicket"}, + FunctionInfo{2, nullptr, "ImportTicketCertificateSet"}, + FunctionInfo{3, nullptr, "DeleteTicket"}, + FunctionInfo{4, nullptr, "DeletePersonalizedTicket"}, + FunctionInfo{5, nullptr, "DeleteAllCommonTicket"}, + FunctionInfo{6, nullptr, "DeleteAllPersonalizedTicket"}, + FunctionInfo{7, nullptr, "DeleteAllPersonalizedTicketEx"}, + FunctionInfo{8, &ETicket::GetTitleKey, "GetTitleKey"}, + FunctionInfo{9, &ETicket::CountCommonTicket, "CountCommonTicket"}, + FunctionInfo{10, &ETicket::CountPersonalizedTicket, "CountPersonalizedTicket"}, + FunctionInfo{11, &ETicket::ListCommonTicketRightsIds, "ListCommonTicketRightsIds"}, + FunctionInfo{12, &ETicket::ListPersonalizedTicketRightsIds, "ListPersonalizedTicketRightsIds"}, + FunctionInfo{13, nullptr, "ListMissingPersonalizedTicket"}, + FunctionInfo{14, &ETicket::GetCommonTicketSize, "GetCommonTicketSize"}, + FunctionInfo{15, &ETicket::GetPersonalizedTicketSize, "GetPersonalizedTicketSize"}, + FunctionInfo{16, &ETicket::GetCommonTicketData, "GetCommonTicketData"}, + FunctionInfo{17, &ETicket::GetPersonalizedTicketData, "GetPersonalizedTicketData"}, + FunctionInfo{18, nullptr, "OwnTicket"}, + FunctionInfo{19, nullptr, "GetTicketInfo"}, + FunctionInfo{20, nullptr, "ListLightTicketInfo"}, + FunctionInfo{21, nullptr, "SignData"}, + FunctionInfo{22, nullptr, "GetCommonTicketAndCertificateSize"}, + FunctionInfo{23, nullptr, "GetCommonTicketAndCertificateData"}, + FunctionInfo{24, nullptr, "ImportPrepurchaseRecord"}, + FunctionInfo{25, nullptr, "DeletePrepurchaseRecord"}, + FunctionInfo{26, nullptr, "DeleteAllPrepurchaseRecord"}, + FunctionInfo{27, nullptr, "CountPrepurchaseRecord"}, + FunctionInfo{28, nullptr, "ListPrepurchaseRecordRightsIds"}, + FunctionInfo{29, nullptr, "ListPrepurchaseRecordInfo"}, + FunctionInfo{30, nullptr, "CountTicket"}, + FunctionInfo{31, nullptr, "ListTicketRightsIds"}, + FunctionInfo{32, nullptr, "CountPrepurchaseRecordEx"}, + FunctionInfo{33, nullptr, "ListPrepurchaseRecordRightsIdsEx"}, + FunctionInfo{34, nullptr, "GetEncryptedTicketSize"}, + FunctionInfo{35, nullptr, "GetEncryptedTicketData"}, + FunctionInfo{36, nullptr, "DeleteAllInactiveELicenseRequiredPersonalizedTicket"}, + FunctionInfo{37, nullptr, "OwnTicket2"}, + FunctionInfo{38, nullptr, "OwnTicket3"}, + FunctionInfo{39, nullptr, "DeleteAllInactivePersonalizedTicket"}, + FunctionInfo{40, nullptr, "DeletePrepurchaseRecordByNintendoAccountId"}, + FunctionInfo{101, nullptr, "Unknown101", MakeVersionGate({18,0,0})}, + FunctionInfo{102, nullptr, "Unknown102", MakeVersionGate({18,0,0})}, + FunctionInfo{103, nullptr, "Unknown103", MakeVersionGate({18,0,0})}, + FunctionInfo{104, nullptr, "Unknown104", MakeVersionGate({18,0,0})}, + FunctionInfo{105, nullptr, "Unknown105", MakeVersionGate({20,0,0})}, + FunctionInfo{201, nullptr, "Unknown201", MakeVersionGate({18,0,0})}, + FunctionInfo{202, nullptr, "Unknown202", MakeVersionGate({18,0,0})}, + FunctionInfo{203, nullptr, "Unknown203", MakeVersionGate({18,0,0})}, + FunctionInfo{204, nullptr, "Unknown204", MakeVersionGate({18,0,0})}, + FunctionInfo{205, nullptr, "Unknown205", MakeVersionGate({18,0,0})}, + FunctionInfo{501, nullptr, "Unknown501"}, + FunctionInfo{502, nullptr, "Unknown502"}, + FunctionInfo{503, nullptr, "GetTitleKey"}, + FunctionInfo{504, nullptr, "Unknown504"}, + FunctionInfo{508, nullptr, "Unknown508"}, + FunctionInfo{509, nullptr, "Unknown509"}, + FunctionInfo{510, nullptr, "Unknown510"}, + FunctionInfo{511, nullptr, "Unknown511"}, + FunctionInfo{1001, nullptr, "Unknown1001"}, + FunctionInfo{1002, nullptr, "Unknown1001"}, + FunctionInfo{1003, nullptr, "Unknown1003"}, + FunctionInfo{1004, nullptr, "Unknown1004"}, + FunctionInfo{1005, nullptr, "Unknown1005"}, + FunctionInfo{1006, nullptr, "Unknown1006"}, + FunctionInfo{1007, nullptr, "Unknown1007"}, + FunctionInfo{1009, nullptr, "Unknown1009"}, + FunctionInfo{1010, nullptr, "Unknown1010"}, + FunctionInfo{1011, nullptr, "Unknown1011"}, + FunctionInfo{1012, nullptr, "Unknown1012"}, + FunctionInfo{1013, nullptr, "Unknown1013"}, + FunctionInfo{1014, nullptr, "Unknown1014"}, + FunctionInfo{1015, nullptr, "Unknown1015"}, + FunctionInfo{1016, nullptr, "Unknown1016"}, + FunctionInfo{1017, nullptr, "Unknown1017"}, + FunctionInfo{1018, nullptr, "Unknown1018"}, + FunctionInfo{1019, nullptr, "Unknown1019"}, + FunctionInfo{1020, nullptr, "Unknown1020"}, + FunctionInfo{1021, nullptr, "Unknown1021"}, + FunctionInfo{1501, nullptr, "Unknown1501"}, + FunctionInfo{1502, nullptr, "Unknown1502"}, + FunctionInfo{1503, nullptr, "Unknown1503"}, + FunctionInfo{1504, nullptr, "Unknown1504"}, + FunctionInfo{1505, nullptr, "Unknown1505"}, + FunctionInfo{1506, nullptr, "Unknown1506"}, + FunctionInfo{2000, nullptr, "Unknown2000"}, + FunctionInfo{2001, nullptr, "Unknown2001"}, + FunctionInfo{2002, nullptr, "Unknown2002"}, + FunctionInfo{2003, nullptr, "Unknown2003"}, + FunctionInfo{2100, nullptr, "Unknown2100"}, + FunctionInfo{2501, nullptr, "Unknown2501"}, + FunctionInfo{2502, nullptr, "Unknown2502"}, + FunctionInfo{2601, nullptr, "Unknown2601"}, + FunctionInfo{3001, nullptr, "Unknown3001"}, + FunctionInfo{3002, nullptr, "Unknown3002"} + ); Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); }; class NDRM_LU final : public ServiceFramework { public: explicit NDRM_LU(Core::System& system_) - : ServiceFramework{system_, "ndrm:lu"} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "Cmd1"}, - {2, nullptr, "Cmd2"}, - {3, nullptr, "Cmd3"}, - {1000, nullptr, "Cmd1000"}, - {8000, nullptr, "Cmd8000"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "ndrm:lu"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "Cmd1"}, + FunctionInfo{2, nullptr, "Cmd2"}, + FunctionInfo{3, nullptr, "Cmd3"}, + FunctionInfo{1000, nullptr, "Cmd1000"}, + FunctionInfo{8000, nullptr, "Cmd8000"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class NDRM_LA final : public ServiceFramework { public: explicit NDRM_LA(Core::System& system_) - : ServiceFramework{system_, "ndrm:la"} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "Cmd1"}, - {2, nullptr, "Cmd2"}, - {3, nullptr, "Cmd3"}, - {4, nullptr, "Cmd4"}, - {5, nullptr, "Cmd5"}, - {6, nullptr, "Cmd6"}, - {7, nullptr, "Cmd7"}, - {8, nullptr, "Cmd8"}, - {9, nullptr, "Cmd9"}, - {10, nullptr, "Cmd10"}, - {11, nullptr, "Cmd11"}, - {12, nullptr, "Cmd12"}, - {13, nullptr, "Cmd13"}, - {14, nullptr, "Cmd14"}, - {15, nullptr, "Cmd15"}, - {16, nullptr, "Cmd16"}, - {17, nullptr, "Cmd17"}, - {18, nullptr, "Cmd18"}, - {19, nullptr, "Cmd19"}, - {20, nullptr, "Cmd20"}, - {21, nullptr, "Cmd21"}, - {22, nullptr, "Cmd22"}, - {23, nullptr, "Cmd23"}, - {24, nullptr, "Cmd24"}, - {25, nullptr, "Cmd25"}, - {26, nullptr, "Cmd26"}, - {27, nullptr, "Cmd27"}, - {28, nullptr, "Cmd28"}, - {29, nullptr, "Cmd29"}, - {30, nullptr, "Cmd30"}, - {31, nullptr, "Cmd31"}, - {32, nullptr, "Cmd32"}, - {33, nullptr, "Cmd33"}, - {34, nullptr, "Cmd34"}, - {35, nullptr, "Cmd35"}, - {36, nullptr, "Cmd36"}, - {37, nullptr, "Cmd37"}, - {38, nullptr, "Cmd38"}, - {39, nullptr, "Cmd39"}, - {40, nullptr, "Cmd40"}, - {42, nullptr, "Cmd42"}, - {43, nullptr, "Cmd43"}, - {44, nullptr, "Cmd44"}, - {45, nullptr, "Cmd45"}, - {46, nullptr, "Cmd46"}, - {47, nullptr, "Cmd47"}, - {48, nullptr, "Cmd48"}, - {49, nullptr, "Cmd49"}, - {50, nullptr, "Cmd50"}, - {51, nullptr, "Cmd51"}, - {8000, nullptr, "Cmd8000"}, - {8001, nullptr, "Cmd8001"}, - {8002, nullptr, "Cmd8002"}, - {8003, nullptr, "Cmd8003"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "ndrm:la"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "Cmd1"}, + FunctionInfo{2, nullptr, "Cmd2"}, + FunctionInfo{3, nullptr, "Cmd3"}, + FunctionInfo{4, nullptr, "Cmd4"}, + FunctionInfo{5, nullptr, "Cmd5"}, + FunctionInfo{6, nullptr, "Cmd6"}, + FunctionInfo{7, nullptr, "Cmd7"}, + FunctionInfo{8, nullptr, "Cmd8"}, + FunctionInfo{9, nullptr, "Cmd9"}, + FunctionInfo{10, nullptr, "Cmd10"}, + FunctionInfo{11, nullptr, "Cmd11"}, + FunctionInfo{12, nullptr, "Cmd12"}, + FunctionInfo{13, nullptr, "Cmd13"}, + FunctionInfo{14, nullptr, "Cmd14"}, + FunctionInfo{15, nullptr, "Cmd15"}, + FunctionInfo{16, nullptr, "Cmd16"}, + FunctionInfo{17, nullptr, "Cmd17"}, + FunctionInfo{18, nullptr, "Cmd18"}, + FunctionInfo{19, nullptr, "Cmd19"}, + FunctionInfo{20, nullptr, "Cmd20"}, + FunctionInfo{21, nullptr, "Cmd21"}, + FunctionInfo{22, nullptr, "Cmd22"}, + FunctionInfo{23, nullptr, "Cmd23"}, + FunctionInfo{24, nullptr, "Cmd24"}, + FunctionInfo{25, nullptr, "Cmd25"}, + FunctionInfo{26, nullptr, "Cmd26"}, + FunctionInfo{27, nullptr, "Cmd27"}, + FunctionInfo{28, nullptr, "Cmd28"}, + FunctionInfo{29, nullptr, "Cmd29"}, + FunctionInfo{30, nullptr, "Cmd30"}, + FunctionInfo{31, nullptr, "Cmd31"}, + FunctionInfo{32, nullptr, "Cmd32"}, + FunctionInfo{33, nullptr, "Cmd33"}, + FunctionInfo{34, nullptr, "Cmd34"}, + FunctionInfo{35, nullptr, "Cmd35"}, + FunctionInfo{36, nullptr, "Cmd36"}, + FunctionInfo{37, nullptr, "Cmd37"}, + FunctionInfo{38, nullptr, "Cmd38"}, + FunctionInfo{39, nullptr, "Cmd39"}, + FunctionInfo{40, nullptr, "Cmd40"}, + FunctionInfo{42, nullptr, "Cmd42"}, + FunctionInfo{43, nullptr, "Cmd43"}, + FunctionInfo{44, nullptr, "Cmd44"}, + FunctionInfo{45, nullptr, "Cmd45"}, + FunctionInfo{46, nullptr, "Cmd46"}, + FunctionInfo{47, nullptr, "Cmd47"}, + FunctionInfo{48, nullptr, "Cmd48"}, + FunctionInfo{49, nullptr, "Cmd49"}, + FunctionInfo{50, nullptr, "Cmd50"}, + FunctionInfo{51, nullptr, "Cmd51"}, + FunctionInfo{8000, nullptr, "Cmd8000"}, + FunctionInfo{8001, nullptr, "Cmd8001"}, + FunctionInfo{8002, nullptr, "Cmd8002"}, + FunctionInfo{8003, nullptr, "Cmd8003"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/eupld/eupld.cpp b/src/core/hle/service/eupld/eupld.cpp index 3cf27513ae..ed1e1c19c5 100644 --- a/src/core/hle/service/eupld/eupld.cpp +++ b/src/core/hle/service/eupld/eupld.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,36 +14,34 @@ namespace Service::EUPLD { class ErrorUploadContext final : public ServiceFramework { public: - explicit ErrorUploadContext(Core::System& system_) : ServiceFramework{system_, "eupld:c"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "SetUrl"}, - {1, nullptr, "ImportCrt"}, - {2, nullptr, "ImportPki"}, - {3, nullptr, "SetAutoUpload"}, - {4, nullptr, "GetAutoUpload"}, - }; - // clang-format on + explicit ErrorUploadContext(Core::System& system_) : ServiceFramework{system_, "eupld:c"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetUrl"}, + FunctionInfo{1, nullptr, "ImportCrt"}, + FunctionInfo{2, nullptr, "ImportPki"}, + FunctionInfo{3, nullptr, "SetAutoUpload"}, + FunctionInfo{4, nullptr, "GetAutoUpload"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class ErrorUploadRequest final : public ServiceFramework { public: - explicit ErrorUploadRequest(Core::System& system_) : ServiceFramework{system_, "eupld:r"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "UploadAll"}, - {2, nullptr, "UploadSelected"}, - {3, nullptr, "GetUploadStatus"}, - {4, nullptr, "CancelUpload"}, - {5, nullptr, "GetResult"}, - }; - // clang-format on + explicit ErrorUploadRequest(Core::System& system_) : ServiceFramework{system_, "eupld:r"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{1, nullptr, "UploadAll"}, + FunctionInfo{2, nullptr, "UploadSelected"}, + FunctionInfo{3, nullptr, "GetUploadStatus"}, + FunctionInfo{4, nullptr, "CancelUpload"}, + FunctionInfo{5, nullptr, "GetResult"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/fatal/fatal.cpp b/src/core/hle/service/fatal/fatal.cpp index db48526614..4c9eca5d5b 100644 --- a/src/core/hle/service/fatal/fatal.cpp +++ b/src/core/hle/service/fatal/fatal.cpp @@ -13,8 +13,6 @@ #include "common/swap.h" #include "core/core.h" #include "core/hle/service/fatal/fatal.h" -#include "core/hle/service/fatal/fatal_p.h" -#include "core/hle/service/fatal/fatal_u.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/server_manager.h" #include "core/reporter.h" @@ -167,6 +165,35 @@ void Module::Interface::ThrowFatalWithCpuContext(HLERequestContext& ctx) { rb.Push(ResultSuccess); } +class Fatal_P final : public Module::Interface { +public: + explicit Fatal_P(std::shared_ptr module_, Core::System& system_) : Interface(std::move(module_), system_, "fatal:p") {} + ~Fatal_P() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetFatalEvent"}, + FunctionInfo{10, nullptr, "GetFatalContext"} + ); +}; + +class Fatal_U final : public Module::Interface { +public: + explicit Fatal_U(std::shared_ptr module_, Core::System& system_) : Interface(std::move(module_), system_, "fatal:u") {} + ~Fatal_U() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &Fatal_U::ThrowFatal, "ThrowFatal"}, + FunctionInfo{1, &Fatal_U::ThrowFatalWithPolicy, "ThrowFatalWithPolicy"}, + FunctionInfo{2, &Fatal_U::ThrowFatalWithCpuContext, "ThrowFatalWithCpuContext"} + ); +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); auto module = std::make_shared(); diff --git a/src/core/hle/service/fatal/fatal_p.cpp b/src/core/hle/service/fatal/fatal_p.cpp deleted file mode 100644 index 4a81bb5e2f..0000000000 --- a/src/core/hle/service/fatal/fatal_p.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/fatal/fatal_p.h" - -namespace Service::Fatal { - -Fatal_P::Fatal_P(std::shared_ptr module_, Core::System& system_) - : Interface(std::move(module_), system_, "fatal:p") { - static const FunctionInfo functions[] = { - {0, nullptr, "GetFatalEvent"}, - {10, nullptr, "GetFatalContext"}, - }; - RegisterHandlers(functions); -} - -Fatal_P::~Fatal_P() = default; - -} // namespace Service::Fatal diff --git a/src/core/hle/service/fatal/fatal_p.h b/src/core/hle/service/fatal/fatal_p.h deleted file mode 100644 index f743368350..0000000000 --- a/src/core/hle/service/fatal/fatal_p.h +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/fatal/fatal.h" - -namespace Service::Fatal { - -class Fatal_P final : public Module::Interface { -public: - explicit Fatal_P(std::shared_ptr module_, Core::System& system_); - ~Fatal_P() override; -}; - -} // namespace Service::Fatal diff --git a/src/core/hle/service/fatal/fatal_u.cpp b/src/core/hle/service/fatal/fatal_u.cpp deleted file mode 100644 index 3739711fce..0000000000 --- a/src/core/hle/service/fatal/fatal_u.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/fatal/fatal_u.h" - -namespace Service::Fatal { - -Fatal_U::Fatal_U(std::shared_ptr module_, Core::System& system_) - : Interface(std::move(module_), system_, "fatal:u") { - static const FunctionInfo functions[] = { - {0, &Fatal_U::ThrowFatal, "ThrowFatal"}, - {1, &Fatal_U::ThrowFatalWithPolicy, "ThrowFatalWithPolicy"}, - {2, &Fatal_U::ThrowFatalWithCpuContext, "ThrowFatalWithCpuContext"}, - }; - RegisterHandlers(functions); -} - -Fatal_U::~Fatal_U() = default; - -} // namespace Service::Fatal diff --git a/src/core/hle/service/fatal/fatal_u.h b/src/core/hle/service/fatal/fatal_u.h deleted file mode 100644 index 65fbe26961..0000000000 --- a/src/core/hle/service/fatal/fatal_u.h +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/fatal/fatal.h" - -namespace Service::Fatal { - -class Fatal_U final : public Module::Interface { -public: - explicit Fatal_U(std::shared_ptr module_, Core::System& system_); - ~Fatal_U() override; -}; - -} // namespace Service::Fatal diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp index cac03ae24c..96ea3478ea 100644 --- a/src/core/hle/service/fgm/fgm.cpp +++ b/src/core/hle/service/fgm/fgm.cpp @@ -16,30 +16,26 @@ namespace Service::FGM { class IRequest final : public ServiceFramework { public: - explicit IRequest(Core::System& system_) : ServiceFramework{system_, "IRequest"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "Set"}, - {2, nullptr, "Get"}, - {3, nullptr, "Cancel"}, - }; - // clang-format on + explicit IRequest(Core::System& system_) : ServiceFramework{system_, "IRequest"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{1, nullptr, "Set"}, + FunctionInfo{2, nullptr, "Get"}, + FunctionInfo{3, nullptr, "Cancel"} + ); }; class FGM final : public ServiceFramework { public: - explicit FGM(Core::System& system_, const char* name) : ServiceFramework{system_, name} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &FGM::Initialize, "Initialize"}, - }; - // clang-format on + explicit FGM(Core::System& system_, const char* name) : ServiceFramework{system_, name} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -50,21 +46,25 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &FGM::Initialize, "Initialize"} + ); }; class FGM_DBG final : public ServiceFramework { public: - explicit FGM_DBG(Core::System& system_) : ServiceFramework{system_, "fgm:dbg"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "Read"}, - {2, nullptr, "Cancel"}, - }; - // clang-format on + explicit FGM_DBG(Core::System& system_) : ServiceFramework{system_, "fgm:dbg"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{1, nullptr, "Read"}, + FunctionInfo{2, nullptr, "Cancel"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp b/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp index 8483394d0c..793b86cc51 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -8,15 +11,18 @@ namespace Service::FileSystem { +std::optional IDirectory::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IDirectory::Read>, "Read"}, + FunctionInfo{1, D<&IDirectory::GetEntryCount>, "GetEntryCount"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IDirectory::IDirectory(Core::System& system_, FileSys::VirtualDir directory_, FileSys::OpenDirectoryMode mode) : ServiceFramework{system_, "IDirectory"}, backend(std::make_unique(directory_, mode)) { - static const FunctionInfo functions[] = { - {0, D<&IDirectory::Read>, "Read"}, - {1, D<&IDirectory::GetEntryCount>, "GetEntryCount"}, - }; - RegisterHandlers(functions); } Result IDirectory::Read( diff --git a/src/core/hle/service/filesystem/fsp/fs_i_directory.h b/src/core/hle/service/filesystem/fsp/fs_i_directory.h index b6251f7fdb..f2a57260e1 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_directory.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_directory.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -26,6 +29,8 @@ private: Result Read(Out out_count, const OutArray out_entries); Result GetEntryCount(Out out_count); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fs_i_file.cpp b/src/core/hle/service/filesystem/fsp/fs_i_file.cpp index 22cbe2be2c..78ca90a4af 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_file.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_file.cpp @@ -12,18 +12,6 @@ namespace Service::FileSystem { IFile::IFile(Core::System& system_, FileSys::VirtualFile file_) : ServiceFramework{system_, "IFile"}, backend{std::make_unique(file_)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IFile::Read>, "Read"}, - {1, D<&IFile::Write>, "Write"}, - {2, D<&IFile::Flush>, "Flush"}, - {3, D<&IFile::SetSize>, "SetSize"}, - {4, D<&IFile::GetSize>, "GetSize"}, - {5, nullptr, "OperateRange"}, - {6, nullptr, "OperateRangeWithBuffer"}, - }; - // clang-format on - RegisterHandlers(functions); } Result IFile::Read( diff --git a/src/core/hle/service/filesystem/fsp/fs_i_file.h b/src/core/hle/service/filesystem/fsp/fs_i_file.h index e8599ee2f8..992330e149 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_file.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_file.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -27,6 +30,19 @@ private: Result Flush(); Result SetSize(s64 size); Result GetSize(Out out_size); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IFile::Read>, "Read"}, + FunctionInfo{1, D<&IFile::Write>, "Write"}, + FunctionInfo{2, D<&IFile::Flush>, "Flush"}, + FunctionInfo{3, D<&IFile::SetSize>, "SetSize"}, + FunctionInfo{4, D<&IFile::GetSize>, "GetSize"}, + FunctionInfo{5, nullptr, "OperateRange"}, + FunctionInfo{6, nullptr, "OperateRangeWithBuffer"} + ); }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp index edd381f57c..6ab4916a36 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp @@ -13,30 +13,33 @@ namespace Service::FileSystem { +std::optional IFileSystem::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IFileSystem::CreateFile>, "CreateFile"}, + FunctionInfo{1, D<&IFileSystem::DeleteFile>, "DeleteFile"}, + FunctionInfo{2, D<&IFileSystem::CreateDirectory>, "CreateDirectory"}, + FunctionInfo{3, D<&IFileSystem::DeleteDirectory>, "DeleteDirectory"}, + FunctionInfo{4, D<&IFileSystem::DeleteDirectoryRecursively>, "DeleteDirectoryRecursively"}, + FunctionInfo{5, D<&IFileSystem::RenameFile>, "RenameFile"}, + FunctionInfo{6, D<&IFileSystem::RenameDirectory>, "RenameDirectory"}, + FunctionInfo{7, D<&IFileSystem::GetEntryType>, "GetEntryType"}, + FunctionInfo{8, D<&IFileSystem::OpenFile>, "OpenFile"}, + FunctionInfo{9, D<&IFileSystem::OpenDirectory>, "OpenDirectory"}, + FunctionInfo{10, D<&IFileSystem::Commit>, "Commit"}, + FunctionInfo{11, D<&IFileSystem::GetFreeSpaceSize>, "GetFreeSpaceSize"}, + FunctionInfo{12, D<&IFileSystem::GetTotalSpaceSize>, "GetTotalSpaceSize"}, + FunctionInfo{13, D<&IFileSystem::CleanDirectoryRecursively>, "CleanDirectoryRecursively"}, + FunctionInfo{14, D<&IFileSystem::GetFileTimeStampRaw>, "GetFileTimeStampRaw"}, + FunctionInfo{15, nullptr, "QueryEntry"}, + FunctionInfo{16, D<&IFileSystem::GetFileSystemAttribute>, "GetFileSystemAttribute"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IFileSystem::IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGetter size_getter_) : ServiceFramework{system_, "IFileSystem"}, backend{std::make_unique( dir_)}, size_getter{std::move(size_getter_)} { - static const FunctionInfo functions[] = { - {0, D<&IFileSystem::CreateFile>, "CreateFile"}, - {1, D<&IFileSystem::DeleteFile>, "DeleteFile"}, - {2, D<&IFileSystem::CreateDirectory>, "CreateDirectory"}, - {3, D<&IFileSystem::DeleteDirectory>, "DeleteDirectory"}, - {4, D<&IFileSystem::DeleteDirectoryRecursively>, "DeleteDirectoryRecursively"}, - {5, D<&IFileSystem::RenameFile>, "RenameFile"}, - {6, D<&IFileSystem::RenameDirectory>, "RenameDirectory"}, - {7, D<&IFileSystem::GetEntryType>, "GetEntryType"}, - {8, D<&IFileSystem::OpenFile>, "OpenFile"}, - {9, D<&IFileSystem::OpenDirectory>, "OpenDirectory"}, - {10, D<&IFileSystem::Commit>, "Commit"}, - {11, D<&IFileSystem::GetFreeSpaceSize>, "GetFreeSpaceSize"}, - {12, D<&IFileSystem::GetTotalSpaceSize>, "GetTotalSpaceSize"}, - {13, D<&IFileSystem::CleanDirectoryRecursively>, "CleanDirectoryRecursively"}, - {14, D<&IFileSystem::GetFileTimeStampRaw>, "GetFileTimeStampRaw"}, - {15, nullptr, "QueryEntry"}, - {16, D<&IFileSystem::GetFileSystemAttribute>, "GetFileSystemAttribute"}, - }; - RegisterHandlers(functions); } Result IFileSystem::CreateFile(const InLargeData path, diff --git a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h index ed03c3ef83..11d3c7fb31 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h @@ -58,6 +58,7 @@ public: Result GetFileSystemAttribute(Out out_attribute); private: + std::optional FindRequest(u32 key) override; std::unique_ptr backend; SizeGetter size_getter; }; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp index 6263282344..f6eac6ca10 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -9,11 +12,6 @@ namespace Service::FileSystem { IMultiCommitManager::IMultiCommitManager(Core::System& system_) : ServiceFramework{system_, "IMultiCommitManager"} { - static const FunctionInfo functions[] = { - {1, D<&IMultiCommitManager::Add>, "Add"}, - {2, D<&IMultiCommitManager::Commit>, "Commit"}, - }; - RegisterHandlers(functions); } IMultiCommitManager::~IMultiCommitManager() = default; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h index 8ebf7c7d96..31182e9159 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -17,6 +20,13 @@ private: Result Add(std::shared_ptr filesystem); Result Commit(); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, D<&IMultiCommitManager::Add>, "Add"}, + FunctionInfo{2, D<&IMultiCommitManager::Commit>, "Commit"} + ); FileSys::VirtualFile backend; }; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp index 495b131df4..8353b72c24 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project @@ -17,11 +17,6 @@ ISaveDataInfoReader::ISaveDataInfoReader(Core::System& system_, FileSys::SaveDataSpaceId space) : ServiceFramework{system_, "ISaveDataInfoReader"}, save_data_controller{ save_data_controller_} { - static const FunctionInfo functions[] = { - {0, D<&ISaveDataInfoReader::ReadSaveDataInfo>, "ReadSaveDataInfo"}, - }; - RegisterHandlers(functions); - FindAllSaves(space); } diff --git a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h index e45ad852ba..7faa4291c0 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -42,6 +45,12 @@ private: void FindNormalSaves(FileSys::SaveDataSpaceId space, const FileSys::VirtualDir& type); void FindTemporaryStorageSaves(FileSys::SaveDataSpaceId space, const FileSys::VirtualDir& type); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ISaveDataInfoReader::ReadSaveDataInfo>, "ReadSaveDataInfo"} + ); std::shared_ptr save_data_controller; std::vector info; u64 next_entry_index = 0; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp index 50b7d1e765..ac884b3b28 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp @@ -12,15 +12,6 @@ namespace Service::FileSystem { IStorage::IStorage(Core::System& system_, FileSys::VirtualFile backend_) : ServiceFramework{system_, "IStorage"}, backend(std::move(backend_)) { - static const FunctionInfo functions[] = { - {0, D<&IStorage::Read>, "Read"}, - {1, nullptr, "Write"}, - {2, nullptr, "Flush"}, - {3, nullptr, "SetSize"}, - {4, D<&IStorage::GetSize>, "GetSize"}, - {5, nullptr, "OperateRange"}, - }; - RegisterHandlers(functions); } Result IStorage::Read( diff --git a/src/core/hle/service/filesystem/fsp/fs_i_storage.h b/src/core/hle/service/filesystem/fsp/fs_i_storage.h index 74d879386f..44d5a6c8bb 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_storage.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_storage.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,12 +18,23 @@ public: explicit IStorage(Core::System& system_, FileSys::VirtualFile backend_); private: - FileSys::VirtualFile backend; - Result Read( OutBuffer out_bytes, s64 offset, s64 length); Result GetSize(Out out_size); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IStorage::Read>, "Read"}, + FunctionInfo{1, nullptr, "Write"}, + FunctionInfo{2, nullptr, "Flush"}, + FunctionInfo{3, nullptr, "SetSize"}, + FunctionInfo{4, D<&IStorage::GetSize>, "GetSize"}, + FunctionInfo{5, nullptr, "OperateRange"} + ); + FileSys::VirtualFile backend; }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fsp_ldr.cpp b/src/core/hle/service/filesystem/fsp/fsp_ldr.cpp index 8ee733f474..1f83d6509b 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_ldr.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_ldr.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -6,15 +9,6 @@ namespace Service::FileSystem { FSP_LDR::FSP_LDR(Core::System& system_) : ServiceFramework{system_, "fsp:ldr"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "OpenCodeFileSystem"}, - {1, nullptr, "IsArchivedProgram"}, - {2, nullptr, "SetCurrentProcess"}, - }; - // clang-format on - - RegisterHandlers(functions); } FSP_LDR::~FSP_LDR() = default; diff --git a/src/core/hle/service/filesystem/fsp/fsp_ldr.h b/src/core/hle/service/filesystem/fsp/fsp_ldr.h index 358739a872..fe3abeff1d 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_ldr.h +++ b/src/core/hle/service/filesystem/fsp/fsp_ldr.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,15 @@ class FSP_LDR final : public ServiceFramework { public: explicit FSP_LDR(Core::System& system_); ~FSP_LDR() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenCodeFileSystem"}, + FunctionInfo{1, nullptr, "IsArchivedProgram"}, + FunctionInfo{2, nullptr, "SetCurrentProcess"} + ); }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fsp_pr.cpp b/src/core/hle/service/filesystem/fsp/fsp_pr.cpp index 7c03ebaeae..9378e6e0c6 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_pr.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_pr.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -6,16 +9,6 @@ namespace Service::FileSystem { FSP_PR::FSP_PR(Core::System& system_) : ServiceFramework{system_, "fsp:pr"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RegisterProgram"}, - {1, nullptr, "UnregisterProgram"}, - {2, nullptr, "SetCurrentProcess"}, - {256, nullptr, "SetEnabledProgramVerification"}, - }; - // clang-format on - - RegisterHandlers(functions); } FSP_PR::~FSP_PR() = default; diff --git a/src/core/hle/service/filesystem/fsp/fsp_pr.h b/src/core/hle/service/filesystem/fsp/fsp_pr.h index bd4e0a730c..bc692151a5 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_pr.h +++ b/src/core/hle/service/filesystem/fsp/fsp_pr.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,16 @@ class FSP_PR final : public ServiceFramework { public: explicit FSP_PR(Core::System& system_); ~FSP_PR() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RegisterProgram"}, + FunctionInfo{1, nullptr, "UnregisterProgram"}, + FunctionInfo{2, nullptr, "SetCurrentProcess"}, + FunctionInfo{256, nullptr, "SetEnabledProgramVerification"} + ); }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index 58303a0bd6..cb349636d5 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp @@ -47,143 +47,142 @@ namespace Service::FileSystem { -FSP_SRV::FSP_SRV(Core::System& system_) - : ServiceFramework{system_, "fsp-srv"}, fsc{system.GetFileSystemController()}, - content_provider{system.GetContentProvider()}, reporter{system.GetReporter()} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "OpenFileSystem"}, - {1, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, - {2, D<&FSP_SRV::OpenDataFileSystemByCurrentProcess>, "OpenDataFileSystemByCurrentProcess"}, - {7, D<&FSP_SRV::OpenFileSystemWithPatch>, "OpenFileSystemWithPatch"}, - {8, nullptr, "OpenFileSystemWithId"}, - {9, nullptr, "OpenDataFileSystemByApplicationId"}, - {11, nullptr, "OpenBisFileSystem"}, - {12, nullptr, "OpenBisStorage"}, - {13, nullptr, "InvalidateBisCache"}, - {17, nullptr, "OpenHostFileSystem"}, - {18, D<&FSP_SRV::OpenSdCardFileSystem>, "OpenSdCardFileSystem"}, - {19, nullptr, "FormatSdCardFileSystem"}, - {21, nullptr, "DeleteSaveDataFileSystem"}, - {22, D<&FSP_SRV::CreateSaveDataFileSystem>, "CreateSaveDataFileSystem"}, - {23, D<&FSP_SRV::CreateSaveDataFileSystemBySystemSaveDataId>, "CreateSaveDataFileSystemBySystemSaveDataId"}, - {24, nullptr, "RegisterSaveDataFileSystemAtomicDeletion"}, - {25, nullptr, "DeleteSaveDataFileSystemBySaveDataSpaceId"}, - {26, nullptr, "FormatSdCardDryRun"}, - {27, D<&FSP_SRV::IsExFatSupported>, "IsExFatSupported"}, - {28, nullptr, "DeleteSaveDataFileSystemBySaveDataAttribute"}, - {30, nullptr, "OpenGameCardStorage"}, - {31, nullptr, "OpenGameCardFileSystem"}, - {32, D<&FSP_SRV::ExtendSaveDataFileSystem>, "ExtendSaveDataFileSystem"}, - {33, nullptr, "DeleteCacheStorage"}, - {34, D<&FSP_SRV::GetCacheStorageSize>, "GetCacheStorageSize"}, - {35, nullptr, "CreateSaveDataFileSystemByHashSalt"}, - {36, nullptr, "OpenHostFileSystemWithOption"}, - {37, D<&FSP_SRV::CreateSaveDataFileSystemWithCreationInfo2>, "CreateSaveDataFileSystemWithCreationInfo2"}, - {51, D<&FSP_SRV::OpenSaveDataFileSystem>, "OpenSaveDataFileSystem"}, - {52, D<&FSP_SRV::OpenSaveDataFileSystemBySystemSaveDataId>, "OpenSaveDataFileSystemBySystemSaveDataId"}, - {53, D<&FSP_SRV::OpenReadOnlySaveDataFileSystem>, "OpenReadOnlySaveDataFileSystem"}, - {57, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataBySaveDataSpaceId>, "ReadSaveDataFileSystemExtraDataBySaveDataSpaceId"}, - {58, D<&FSP_SRV::ReadSaveDataFileSystemExtraData>, "ReadSaveDataFileSystemExtraData"}, - {59, D<&FSP_SRV::WriteSaveDataFileSystemExtraData>, "WriteSaveDataFileSystemExtraData"}, - {60, nullptr, "OpenSaveDataInfoReader"}, - {61, D<&FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId>, "OpenSaveDataInfoReaderBySaveDataSpaceId"}, - {62, D<&FSP_SRV::OpenSaveDataInfoReaderOnlyCacheStorage>, "OpenSaveDataInfoReaderOnlyCacheStorage"}, - {64, nullptr, "OpenSaveDataInternalStorageFileSystem"}, - {65, nullptr, "UpdateSaveDataMacForDebug"}, - {66, nullptr, "WriteSaveDataFileSystemExtraData2"}, - {67, D<&FSP_SRV::FindSaveDataWithFilter>, "FindSaveDataWithFilter"}, - {68, nullptr, "OpenSaveDataInfoReaderBySaveDataFilter"}, - {69, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataBySaveDataAttribute>, "ReadSaveDataFileSystemExtraDataBySaveDataAttribute"}, - {70, D<&FSP_SRV::WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute>, "WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, - {71, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute>, "ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, - {80, nullptr, "OpenSaveDataMetaFile"}, - {81, nullptr, "OpenSaveDataTransferManager"}, - {82, nullptr, "OpenSaveDataTransferManagerVersion2"}, - {83, D<&FSP_SRV::OpenSaveDataTransferProhibiter>, "OpenSaveDataTransferProhibiter"}, - {84, nullptr, "ListApplicationAccessibleSaveDataOwnerId"}, - {85, nullptr, "OpenSaveDataTransferManagerForSaveDataRepair"}, - {86, nullptr, "OpenSaveDataMover"}, - {87, nullptr, "OpenSaveDataTransferManagerForRepair"}, - {100, nullptr, "OpenImageDirectoryFileSystem"}, - {101, nullptr, "OpenBaseFileSystem"}, - {102, nullptr, "FormatBaseFileSystem"}, - {110, nullptr, "OpenContentStorageFileSystem"}, - {120, nullptr, "OpenCloudBackupWorkStorageFileSystem"}, - {130, nullptr, "OpenCustomStorageFileSystem"}, - {200, D<&FSP_SRV::OpenDataStorageByCurrentProcess>, "OpenDataStorageByCurrentProcess"}, - {201, nullptr, "OpenDataStorageByProgramId"}, - {202, D<&FSP_SRV::OpenDataStorageByDataId>, "OpenDataStorageByDataId"}, - {203, D<&FSP_SRV::OpenPatchDataStorageByCurrentProcess>, "OpenPatchDataStorageByCurrentProcess"}, - {204, nullptr, "OpenDataFileSystemByProgramIndex"}, - {205, D<&FSP_SRV::OpenDataStorageWithProgramIndex>, "OpenDataStorageWithProgramIndex"}, - {206, nullptr, "OpenDataStorageByPath"}, - {210, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, - {400, nullptr, "OpenDeviceOperator"}, - {500, nullptr, "OpenSdCardDetectionEventNotifier"}, - {501, nullptr, "OpenGameCardDetectionEventNotifier"}, - {510, nullptr, "OpenSystemDataUpdateEventNotifier"}, - {511, nullptr, "NotifySystemDataUpdateEvent"}, - {520, nullptr, "SimulateGameCardDetectionEvent"}, - {600, nullptr, "SetCurrentPosixTime"}, - {601, nullptr, "QuerySaveDataTotalSize"}, - {602, nullptr, "VerifySaveDataFileSystem"}, - {603, nullptr, "CorruptSaveDataFileSystem"}, - {604, nullptr, "CreatePaddingFile"}, - {605, nullptr, "DeleteAllPaddingFiles"}, - {606, nullptr, "GetRightsId"}, - {607, nullptr, "RegisterExternalKey"}, - {608, nullptr, "UnregisterAllExternalKey"}, - {609, nullptr, "GetRightsIdByPath"}, - {610, nullptr, "GetRightsIdAndKeyGenerationByPath"}, - {611, nullptr, "SetCurrentPosixTimeWithTimeDifference"}, - {612, nullptr, "GetFreeSpaceSizeForSaveData"}, - {613, nullptr, "VerifySaveDataFileSystemBySaveDataSpaceId"}, - {614, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId"}, - {615, nullptr, "QuerySaveDataInternalStorageTotalSize"}, - {616, nullptr, "GetSaveDataCommitId"}, - {617, nullptr, "UnregisterExternalKey"}, - {620, nullptr, "SetSdCardEncryptionSeed"}, - {630, nullptr, "SetSdCardAccessibility"}, - {631, D<&FSP_SRV::IsSdCardAccessible>, "IsSdCardAccessible"}, - {640, nullptr, "IsSignedSystemPartitionOnSdCardValid"}, - {700, nullptr, "OpenAccessFailureResolver"}, - {701, nullptr, "GetAccessFailureDetectionEvent"}, - {702, nullptr, "IsAccessFailureDetected"}, - {710, nullptr, "ResolveAccessFailure"}, - {720, nullptr, "AbandonAccessFailure"}, - {800, nullptr, "GetAndClearFileSystemProxyErrorInfo"}, - {810, nullptr, "RegisterProgramIndexMapInfo"}, - {820, nullptr, "GetContentStorageInfoIndex"}, - {830, nullptr, "EncryptStreamPlaySaveData"}, - {831, nullptr, "DecryptStreamPlaySaveData"}, - {1000, nullptr, "SetBisRootForHost"}, - {1001, nullptr, "SetSaveDataSize"}, - {1002, nullptr, "SetSaveDataRootPath"}, - {1003, D<&FSP_SRV::DisableAutoSaveDataCreation>, "DisableAutoSaveDataCreation"}, - {1004, D<&FSP_SRV::SetGlobalAccessLogMode>, "SetGlobalAccessLogMode"}, - {1005, D<&FSP_SRV::GetGlobalAccessLogMode>, "GetGlobalAccessLogMode"}, - {1006, D<&FSP_SRV::OutputAccessLogToSdCard>, "OutputAccessLogToSdCard"}, - {1007, nullptr, "RegisterUpdatePartition"}, - {1008, nullptr, "OpenRegisteredUpdatePartition"}, - {1009, nullptr, "GetAndClearMemoryReportInfo"}, - {1010, nullptr, "SetDataStorageRedirectTarget"}, - {1011, D<&FSP_SRV::GetProgramIndexForAccessLog>, "GetProgramIndexForAccessLog"}, - {1012, nullptr, "GetFsStackUsage"}, - {1013, nullptr, "UnsetSaveDataRootPath"}, - {1014, nullptr, "OutputMultiProgramTagAccessLog"}, - {1016, D<&FSP_SRV::FlushAccessLogOnSdCard>, "FlushAccessLogOnSdCard"}, - {1017, nullptr, "OutputApplicationInfoAccessLog"}, - {1018, nullptr, "SetDebugOption"}, - {1019, nullptr, "UnsetDebugOption"}, - {1100, nullptr, "OverrideSaveDataTransferTokenSignVerificationKey"}, - {1110, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId2"}, - {1200, D<&FSP_SRV::OpenMultiCommitManager>, "OpenMultiCommitManager"}, - {1300, nullptr, "OpenBisWiper"}, - }; - // clang-format on - RegisterHandlers(functions); +std::optional FSP_SRV::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenFileSystem"}, + FunctionInfo{1, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, + FunctionInfo{2, D<&FSP_SRV::OpenDataFileSystemByCurrentProcess>, "OpenDataFileSystemByCurrentProcess"}, + FunctionInfo{7, D<&FSP_SRV::OpenFileSystemWithPatch>, "OpenFileSystemWithPatch"}, + FunctionInfo{8, nullptr, "OpenFileSystemWithId"}, + FunctionInfo{9, nullptr, "OpenDataFileSystemByApplicationId"}, + FunctionInfo{11, nullptr, "OpenBisFileSystem"}, + FunctionInfo{12, nullptr, "OpenBisStorage"}, + FunctionInfo{13, nullptr, "InvalidateBisCache"}, + FunctionInfo{17, nullptr, "OpenHostFileSystem"}, + FunctionInfo{18, D<&FSP_SRV::OpenSdCardFileSystem>, "OpenSdCardFileSystem"}, + FunctionInfo{19, nullptr, "FormatSdCardFileSystem"}, + FunctionInfo{21, nullptr, "DeleteSaveDataFileSystem"}, + FunctionInfo{22, D<&FSP_SRV::CreateSaveDataFileSystem>, "CreateSaveDataFileSystem"}, + FunctionInfo{23, D<&FSP_SRV::CreateSaveDataFileSystemBySystemSaveDataId>, "CreateSaveDataFileSystemBySystemSaveDataId"}, + FunctionInfo{24, nullptr, "RegisterSaveDataFileSystemAtomicDeletion"}, + FunctionInfo{25, nullptr, "DeleteSaveDataFileSystemBySaveDataSpaceId"}, + FunctionInfo{26, nullptr, "FormatSdCardDryRun"}, + FunctionInfo{27, D<&FSP_SRV::IsExFatSupported>, "IsExFatSupported"}, + FunctionInfo{28, nullptr, "DeleteSaveDataFileSystemBySaveDataAttribute"}, + FunctionInfo{30, nullptr, "OpenGameCardStorage"}, + FunctionInfo{31, nullptr, "OpenGameCardFileSystem"}, + FunctionInfo{32, D<&FSP_SRV::ExtendSaveDataFileSystem>, "ExtendSaveDataFileSystem"}, + FunctionInfo{33, nullptr, "DeleteCacheStorage"}, + FunctionInfo{34, D<&FSP_SRV::GetCacheStorageSize>, "GetCacheStorageSize"}, + FunctionInfo{35, nullptr, "CreateSaveDataFileSystemByHashSalt"}, + FunctionInfo{36, nullptr, "OpenHostFileSystemWithOption"}, + FunctionInfo{37, D<&FSP_SRV::CreateSaveDataFileSystemWithCreationInfo2>, "CreateSaveDataFileSystemWithCreationInfo2"}, + FunctionInfo{51, D<&FSP_SRV::OpenSaveDataFileSystem>, "OpenSaveDataFileSystem"}, + FunctionInfo{52, D<&FSP_SRV::OpenSaveDataFileSystemBySystemSaveDataId>, "OpenSaveDataFileSystemBySystemSaveDataId"}, + FunctionInfo{53, D<&FSP_SRV::OpenReadOnlySaveDataFileSystem>, "OpenReadOnlySaveDataFileSystem"}, + FunctionInfo{57, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataBySaveDataSpaceId>, "ReadSaveDataFileSystemExtraDataBySaveDataSpaceId"}, + FunctionInfo{58, D<&FSP_SRV::ReadSaveDataFileSystemExtraData>, "ReadSaveDataFileSystemExtraData"}, + FunctionInfo{59, D<&FSP_SRV::WriteSaveDataFileSystemExtraData>, "WriteSaveDataFileSystemExtraData"}, + FunctionInfo{60, nullptr, "OpenSaveDataInfoReader"}, + FunctionInfo{61, D<&FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId>, "OpenSaveDataInfoReaderBySaveDataSpaceId"}, + FunctionInfo{62, D<&FSP_SRV::OpenSaveDataInfoReaderOnlyCacheStorage>, "OpenSaveDataInfoReaderOnlyCacheStorage"}, + FunctionInfo{64, nullptr, "OpenSaveDataInternalStorageFileSystem"}, + FunctionInfo{65, nullptr, "UpdateSaveDataMacForDebug"}, + FunctionInfo{66, nullptr, "WriteSaveDataFileSystemExtraData2"}, + FunctionInfo{67, D<&FSP_SRV::FindSaveDataWithFilter>, "FindSaveDataWithFilter"}, + FunctionInfo{68, nullptr, "OpenSaveDataInfoReaderBySaveDataFilter"}, + FunctionInfo{69, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataBySaveDataAttribute>, "ReadSaveDataFileSystemExtraDataBySaveDataAttribute"}, + FunctionInfo{70, D<&FSP_SRV::WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute>, "WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, + FunctionInfo{71, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute>, "ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, + FunctionInfo{80, nullptr, "OpenSaveDataMetaFile"}, + FunctionInfo{81, nullptr, "OpenSaveDataTransferManager"}, + FunctionInfo{82, nullptr, "OpenSaveDataTransferManagerVersion2"}, + FunctionInfo{83, D<&FSP_SRV::OpenSaveDataTransferProhibiter>, "OpenSaveDataTransferProhibiter"}, + FunctionInfo{84, nullptr, "ListApplicationAccessibleSaveDataOwnerId"}, + FunctionInfo{85, nullptr, "OpenSaveDataTransferManagerForSaveDataRepair"}, + FunctionInfo{86, nullptr, "OpenSaveDataMover"}, + FunctionInfo{87, nullptr, "OpenSaveDataTransferManagerForRepair"}, + FunctionInfo{100, nullptr, "OpenImageDirectoryFileSystem"}, + FunctionInfo{101, nullptr, "OpenBaseFileSystem"}, + FunctionInfo{102, nullptr, "FormatBaseFileSystem"}, + FunctionInfo{110, nullptr, "OpenContentStorageFileSystem"}, + FunctionInfo{120, nullptr, "OpenCloudBackupWorkStorageFileSystem"}, + FunctionInfo{130, nullptr, "OpenCustomStorageFileSystem"}, + FunctionInfo{200, D<&FSP_SRV::OpenDataStorageByCurrentProcess>, "OpenDataStorageByCurrentProcess"}, + FunctionInfo{201, nullptr, "OpenDataStorageByProgramId"}, + FunctionInfo{202, D<&FSP_SRV::OpenDataStorageByDataId>, "OpenDataStorageByDataId"}, + FunctionInfo{203, D<&FSP_SRV::OpenPatchDataStorageByCurrentProcess>, "OpenPatchDataStorageByCurrentProcess"}, + FunctionInfo{204, nullptr, "OpenDataFileSystemByProgramIndex"}, + FunctionInfo{205, D<&FSP_SRV::OpenDataStorageWithProgramIndex>, "OpenDataStorageWithProgramIndex"}, + FunctionInfo{206, nullptr, "OpenDataStorageByPath"}, + FunctionInfo{210, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, + FunctionInfo{400, nullptr, "OpenDeviceOperator"}, + FunctionInfo{500, nullptr, "OpenSdCardDetectionEventNotifier"}, + FunctionInfo{501, nullptr, "OpenGameCardDetectionEventNotifier"}, + FunctionInfo{510, nullptr, "OpenSystemDataUpdateEventNotifier"}, + FunctionInfo{511, nullptr, "NotifySystemDataUpdateEvent"}, + FunctionInfo{520, nullptr, "SimulateGameCardDetectionEvent"}, + FunctionInfo{600, nullptr, "SetCurrentPosixTime"}, + FunctionInfo{601, nullptr, "QuerySaveDataTotalSize"}, + FunctionInfo{602, nullptr, "VerifySaveDataFileSystem"}, + FunctionInfo{603, nullptr, "CorruptSaveDataFileSystem"}, + FunctionInfo{604, nullptr, "CreatePaddingFile"}, + FunctionInfo{605, nullptr, "DeleteAllPaddingFiles"}, + FunctionInfo{606, nullptr, "GetRightsId"}, + FunctionInfo{607, nullptr, "RegisterExternalKey"}, + FunctionInfo{608, nullptr, "UnregisterAllExternalKey"}, + FunctionInfo{609, nullptr, "GetRightsIdByPath"}, + FunctionInfo{610, nullptr, "GetRightsIdAndKeyGenerationByPath"}, + FunctionInfo{611, nullptr, "SetCurrentPosixTimeWithTimeDifference"}, + FunctionInfo{612, nullptr, "GetFreeSpaceSizeForSaveData"}, + FunctionInfo{613, nullptr, "VerifySaveDataFileSystemBySaveDataSpaceId"}, + FunctionInfo{614, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId"}, + FunctionInfo{615, nullptr, "QuerySaveDataInternalStorageTotalSize"}, + FunctionInfo{616, nullptr, "GetSaveDataCommitId"}, + FunctionInfo{617, nullptr, "UnregisterExternalKey"}, + FunctionInfo{620, nullptr, "SetSdCardEncryptionSeed"}, + FunctionInfo{630, nullptr, "SetSdCardAccessibility"}, + FunctionInfo{631, D<&FSP_SRV::IsSdCardAccessible>, "IsSdCardAccessible"}, + FunctionInfo{640, nullptr, "IsSignedSystemPartitionOnSdCardValid"}, + FunctionInfo{700, nullptr, "OpenAccessFailureResolver"}, + FunctionInfo{701, nullptr, "GetAccessFailureDetectionEvent"}, + FunctionInfo{702, nullptr, "IsAccessFailureDetected"}, + FunctionInfo{710, nullptr, "ResolveAccessFailure"}, + FunctionInfo{720, nullptr, "AbandonAccessFailure"}, + FunctionInfo{800, nullptr, "GetAndClearFileSystemProxyErrorInfo"}, + FunctionInfo{810, nullptr, "RegisterProgramIndexMapInfo"}, + FunctionInfo{820, nullptr, "GetContentStorageInfoIndex"}, + FunctionInfo{830, nullptr, "EncryptStreamPlaySaveData"}, + FunctionInfo{831, nullptr, "DecryptStreamPlaySaveData"}, + FunctionInfo{1000, nullptr, "SetBisRootForHost"}, + FunctionInfo{1001, nullptr, "SetSaveDataSize"}, + FunctionInfo{1002, nullptr, "SetSaveDataRootPath"}, + FunctionInfo{1003, D<&FSP_SRV::DisableAutoSaveDataCreation>, "DisableAutoSaveDataCreation"}, + FunctionInfo{1004, D<&FSP_SRV::SetGlobalAccessLogMode>, "SetGlobalAccessLogMode"}, + FunctionInfo{1005, D<&FSP_SRV::GetGlobalAccessLogMode>, "GetGlobalAccessLogMode"}, + FunctionInfo{1006, D<&FSP_SRV::OutputAccessLogToSdCard>, "OutputAccessLogToSdCard"}, + FunctionInfo{1007, nullptr, "RegisterUpdatePartition"}, + FunctionInfo{1008, nullptr, "OpenRegisteredUpdatePartition"}, + FunctionInfo{1009, nullptr, "GetAndClearMemoryReportInfo"}, + FunctionInfo{1010, nullptr, "SetDataStorageRedirectTarget"}, + FunctionInfo{1011, D<&FSP_SRV::GetProgramIndexForAccessLog>, "GetProgramIndexForAccessLog"}, + FunctionInfo{1012, nullptr, "GetFsStackUsage"}, + FunctionInfo{1013, nullptr, "UnsetSaveDataRootPath"}, + FunctionInfo{1014, nullptr, "OutputMultiProgramTagAccessLog"}, + FunctionInfo{1016, D<&FSP_SRV::FlushAccessLogOnSdCard>, "FlushAccessLogOnSdCard"}, + FunctionInfo{1017, nullptr, "OutputApplicationInfoAccessLog"}, + FunctionInfo{1018, nullptr, "SetDebugOption"}, + FunctionInfo{1019, nullptr, "UnsetDebugOption"}, + FunctionInfo{1100, nullptr, "OverrideSaveDataTransferTokenSignVerificationKey"}, + FunctionInfo{1110, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId2"}, + FunctionInfo{1200, D<&FSP_SRV::OpenMultiCommitManager>, "OpenMultiCommitManager"}, + FunctionInfo{1300, nullptr, "OpenBisWiper"} + ); + return HandlerTableGenerateWithFind(key, functions); +} +FSP_SRV::FSP_SRV(Core::System& system_) + : ServiceFramework{system_, "fsp-srv"}, fsc{system.GetFileSystemController()}, content_provider{system.GetContentProvider()}, reporter{system.GetReporter()} { if (Settings::values.enable_fs_access_log) { access_log_mode = AccessLogMode::SdCard; } diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.h b/src/core/hle/service/filesystem/fsp/fsp_srv.h index 156cf4e571..ebda008bcc 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.h @@ -115,6 +115,7 @@ private: s64 available_size, s64 journal_size); Result GetCacheStorageSize(s32 index, Out out_data_size, Out out_journal_size); + std::optional FindRequest(u32 key) override; FileSystemController& fsc; const FileSys::ContentProvider& content_provider; const Core::Reporter& reporter; diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp index f8690dbb8b..5480d22b83 100644 --- a/src/core/hle/service/friend/friend.cpp +++ b/src/core/hle/service/friend/friend.cpp @@ -11,139 +11,38 @@ #include "core/hle/kernel/k_event.h" #include "core/hle/service/acc/errors.h" #include "core/hle/service/friend/friend.h" -#include "core/hle/service/friend/friend_interface.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/server_manager.h" namespace Service::Friend { +class Friend final : public Module::Interface { +public: + explicit Friend(std::shared_ptr module_, Core::System& system_, const char* name) : Interface(std::move(module_), system_, name) {} + ~Friend() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &Friend::CreateFriendService, "CreateFriendService"}, + FunctionInfo{1, &Friend::CreateNotificationService, "CreateNotificationService"}, + FunctionInfo{2, nullptr, "CreateDaemonSuspendSessionService"} + ); +}; + class IFriendService final : public ServiceFramework { public: explicit IFriendService(Core::System& system_) : ServiceFramework{system_, "IFriendService"}, service_context{system, "IFriendService"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"}, - {1, &IFriendService::Cancel, "Cancel"}, - {10100, nullptr, "GetFriendListIds"}, - {10101, &IFriendService::GetFriendList, "GetFriendList"}, - {10102, nullptr, "UpdateFriendInfo"}, - {10110, nullptr, "GetFriendProfileImage"}, - {10111, nullptr, "GetFriendProfileImageWithImageSize"}, // 18.0.0+ - {10120, &IFriendService::CheckFriendListAvailability, "CheckFriendListAvailability"}, - {10121, nullptr, "EnsureFriendListAvailable"}, - {10200, nullptr, "SendFriendRequestForApplication"}, - {10211, nullptr, "AddFacedFriendRequestForApplication"}, - {10400, &IFriendService::GetBlockedUserListIds, "GetBlockedUserListIds"}, - {10420, &IFriendService::CheckBlockedUserListAvailability, "CheckBlockedUserListAvailability"}, - {10421, nullptr, "EnsureBlockedUserListAvailable"}, - {10500, nullptr, "GetProfileList"}, - {10501, nullptr, "GetProfileListV2"}, // 18.0.0+ - {10600, nullptr, "DeclareOpenOnlinePlaySession"}, - {10601, &IFriendService::DeclareCloseOnlinePlaySession, "DeclareCloseOnlinePlaySession"}, - {10610, &IFriendService::UpdateUserPresence, "UpdateUserPresence"}, - {10700, &IFriendService::GetPlayHistoryRegistrationKey, "GetPlayHistoryRegistrationKey"}, - {10701, nullptr, "GetPlayHistoryRegistrationKeyWithNetworkServiceAccountId"}, - {10702, nullptr, "AddPlayHistory"}, - {11000, nullptr, "GetProfileImageUrl"}, - {11001, nullptr, "GetProfileImageUrlV2"}, // 18.0.0+ - {20100, &IFriendService::GetFriendCount, "GetFriendCount"}, - {20101, &IFriendService::GetNewlyFriendCount, "GetNewlyFriendCount"}, - {20102, nullptr, "GetFriendDetailedInfo"}, - {20103, nullptr, "SyncFriendList"}, - {20104, &IFriendService::RequestSyncFriendList, "RequestSyncFriendList"}, - {20105, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV1"}, - {20106, nullptr, "UpdateFriendInfoForViewerV1"}, - {20107, nullptr, "GetFriendDetailedInfoV2"}, // 20.0.0+ - {20108, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV2"}, // 22.0.0+ - {20109, nullptr, "UpdateFriendInfoForViewerV2"}, // 22.0.0+ - {20110, nullptr, "LoadFriendSettingV1"}, - {20111, nullptr, "LoadFriendSettingV2"}, // 22.0.0+ - {20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"}, - {20201, nullptr, "GetFriendRequestListV1"}, - {20202, nullptr, "GetFriendRequestListV2"}, // 20.0.0+ - {20203, nullptr, "GetFriendRequestReceivedNotificationCount"}, // 22.0.0+ - {20300, nullptr, "GetFriendCandidateList"}, - {20301, nullptr, "GetNintendoNetworkIdInfo"}, - {20302, nullptr, "GetSnsAccountLinkage"}, // 5.0.0-19.0.1 - {20303, nullptr, "GetSnsAccountProfile"}, // 5.0.0-19.0.1 - {20304, nullptr, "GetSnsAccountFriendList"}, // 5.0.0-19.0.1 - {20400, nullptr, "GetBlockedUserListV1"}, - {20401, nullptr, "SyncBlockedUserList"}, - {20402, nullptr, "GetBlockedUserListV2"}, // 20.0.0+ - {20500, nullptr, "GetProfileExtraListV1"}, - {20501, nullptr, "GetRelationship"}, - {20502, nullptr, "GetProfileExtraListV2"}, // 19.0.0+ - {20600, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV1"}, - {20601, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV2"}, // 19.0.0+ - {20700, nullptr, "GetPlayHistoryListV1"}, - {20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"}, - {20702, nullptr, "GetPlayHistoryListV2"}, // 19.0.0+ - {20800, &IFriendService::LoadUserSetting, "LoadUserSettingV1"}, - {20801, nullptr, "SyncUserSetting"}, - {20802, &IFriendService::LoadUserSetting, "LoadUserSettingV2"}, // 19.0.0+ - {20900, &IFriendService::RequestListSummaryOverlayNotification, "RequestListSummaryOverlayNotification"}, - {21000, nullptr, "GetExternalApplicationCatalog"}, - {22000, nullptr, "GetReceivedFriendInvitationListV1"}, - {22001, nullptr, "GetReceivedFriendInvitationDetailedInfoV1"}, - {22002, nullptr, "GetReceivedFriendInvitationListV2"}, // 19.0.0+ - {22003, nullptr, "GetReceivedFriendInvitationDetailedInfoV2"}, // 19.0.0+ - {22010, &IFriendService::GetReceivedFriendInvitationCountCache, "GetReceivedFriendInvitationCountCache"}, - {30100, nullptr, "DropFriendNewlyFlags"}, - {30101, nullptr, "DeleteFriend"}, - {30110, nullptr, "DropFriendNewlyFlag"}, - {30120, nullptr, "ChangeFriendFavoriteFlag"}, - {30121, nullptr, "ChangeFriendOnlineNotificationFlag"}, - {30130, nullptr, "SetFriendNote"}, // 22.0.0+ - {30131, nullptr, "RequestUploadPendingNote"}, // 22.0.0+ - {30190, nullptr, "RequestSyncLocalUpdates"}, // 22.0.0+ - {30200, nullptr, "SendFriendRequest"}, - {30201, nullptr, "SendFriendRequestWithApplicationInfoV1"}, - {30202, nullptr, "CancelFriendRequest"}, - {30203, nullptr, "AcceptFriendRequest"}, - {30204, nullptr, "RejectFriendRequest"}, - {30205, nullptr, "ReadFriendRequest"}, - {30210, nullptr, "GetFacedFriendRequestRegistrationKey"}, - {30211, nullptr, "AddFacedFriendRequest"}, - {30212, nullptr, "CancelFacedFriendRequest"}, - {30213, nullptr, "GetFacedFriendRequestProfileImage"}, - {30214, nullptr, "GetFacedFriendRequestProfileImageFromPath"}, - {30215, nullptr, "SendFriendRequestWithExternalApplicationCatalogId"}, - {30216, nullptr, "ResendFacedFriendRequest"}, - {30217, nullptr, "SendFriendRequestWithNintendoNetworkIdInfo"}, - {30218, nullptr, "SendFriendRequestWithApplicationInfoV2"}, // 20.0.0+ - {30300, nullptr, "GetSnsAccountLinkPageUrl"}, // 5.0.0-19.0.1 - {30301, nullptr, "UnlinkSnsAccount"}, // 5.0.0-19.0.1 - {30400, nullptr, "BlockUser"}, - {30401, nullptr, "BlockUserWithApplicationInfoV1"}, - {30402, nullptr, "UnblockUser"}, - {30403, nullptr, "BlockUserWithApplicationInfoV2"}, // 20.0.0+ - {30500, nullptr, "GetProfileExtraFromFriendCodeV1"}, - {30501, nullptr, "GetProfileExtraFromFriendCodeV2"}, // 19.0.0+ - {30700, nullptr, "DeletePlayHistory"}, - {30701, nullptr, "AddPlayHistoryWithApplication"}, // 19.0.0+ - {30810, nullptr, "ChangePresencePermission"}, - {30811, nullptr, "ChangeFriendRequestReception"}, - {30812, nullptr, "ChangePlayLogPermission"}, - {30820, nullptr, "IssueFriendCode"}, - {30830, nullptr, "ClearPlayLog"}, - {30900, nullptr, "SendFriendInvitationV1"}, - {30901, nullptr, "SendFriendInvitationV2"}, // 19.0.0+ - {30910, nullptr, "ReadFriendInvitation"}, - {30911, nullptr, "ReadAllFriendInvitations"}, - {31000, nullptr, "OpenUser"}, // 19.0.0+ - {40100, nullptr, "DeleteFriendListCache"}, - {40400, nullptr, "DeleteBlockedUserListCache"}, - {49900, nullptr, "DeleteNetworkServiceAccountCache"}, - }; - // clang-format on - - RegisterHandlers(functions); - completion_event = service_context.CreateEvent("IFriendService:CompletionEvent"); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + ~IFriendService() override { service_context.CloseEvent(completion_event); } @@ -367,29 +266,136 @@ private: rb.Push(0); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"}, + FunctionInfo{1, &IFriendService::Cancel, "Cancel"}, + FunctionInfo{10100, nullptr, "GetFriendListIds"}, + FunctionInfo{10101, &IFriendService::GetFriendList, "GetFriendList"}, + FunctionInfo{10102, nullptr, "UpdateFriendInfo"}, + FunctionInfo{10110, nullptr, "GetFriendProfileImage"}, + FunctionInfo{10111, nullptr, "GetFriendProfileImageWithImageSize", MakeVersionGate({18,0,0})}, + FunctionInfo{10120, &IFriendService::CheckFriendListAvailability, "CheckFriendListAvailability"}, + FunctionInfo{10121, nullptr, "EnsureFriendListAvailable"}, + FunctionInfo{10200, nullptr, "SendFriendRequestForApplication"}, + FunctionInfo{10211, nullptr, "AddFacedFriendRequestForApplication"}, + FunctionInfo{10400, &IFriendService::GetBlockedUserListIds, "GetBlockedUserListIds"}, + FunctionInfo{10420, &IFriendService::CheckBlockedUserListAvailability, "CheckBlockedUserListAvailability"}, + FunctionInfo{10421, nullptr, "EnsureBlockedUserListAvailable"}, + FunctionInfo{10500, nullptr, "GetProfileList"}, + FunctionInfo{10501, nullptr, "GetProfileListV2", MakeVersionGate({18,0,0})}, + FunctionInfo{10600, nullptr, "DeclareOpenOnlinePlaySession"}, + FunctionInfo{10601, &IFriendService::DeclareCloseOnlinePlaySession, "DeclareCloseOnlinePlaySession"}, + FunctionInfo{10610, &IFriendService::UpdateUserPresence, "UpdateUserPresence"}, + FunctionInfo{10700, &IFriendService::GetPlayHistoryRegistrationKey, "GetPlayHistoryRegistrationKey"}, + FunctionInfo{10701, nullptr, "GetPlayHistoryRegistrationKeyWithNetworkServiceAccountId"}, + FunctionInfo{10702, nullptr, "AddPlayHistory"}, + FunctionInfo{11000, nullptr, "GetProfileImageUrl"}, + FunctionInfo{11001, nullptr, "GetProfileImageUrlV2", MakeVersionGate({18,0,0})}, + FunctionInfo{20100, &IFriendService::GetFriendCount, "GetFriendCount"}, + FunctionInfo{20101, &IFriendService::GetNewlyFriendCount, "GetNewlyFriendCount"}, + FunctionInfo{20102, nullptr, "GetFriendDetailedInfo"}, + FunctionInfo{20103, nullptr, "SyncFriendList"}, + FunctionInfo{20104, &IFriendService::RequestSyncFriendList, "RequestSyncFriendList"}, + FunctionInfo{20105, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV1"}, + FunctionInfo{20106, nullptr, "UpdateFriendInfoForViewerV1"}, + FunctionInfo{20107, nullptr, "GetFriendDetailedInfoV2", MakeVersionGate({20,0,0})}, + FunctionInfo{20108, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV2", MakeVersionGate({22,0,0})}, + FunctionInfo{20109, nullptr, "UpdateFriendInfoForViewerV2", MakeVersionGate({22,0,0})}, + FunctionInfo{20110, nullptr, "LoadFriendSettingV1"}, + FunctionInfo{20111, nullptr, "LoadFriendSettingV2", MakeVersionGate({22,0,0})}, + FunctionInfo{20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"}, + FunctionInfo{20201, nullptr, "GetFriendRequestListV1"}, + FunctionInfo{20202, nullptr, "GetFriendRequestListV2", MakeVersionGate({20,0,0})}, + FunctionInfo{20203, nullptr, "GetFriendRequestReceivedNotificationCount", MakeVersionGate({22,0,0})}, + FunctionInfo{20300, nullptr, "GetFriendCandidateList"}, + FunctionInfo{20301, nullptr, "GetNintendoNetworkIdInfo"}, + FunctionInfo{20302, nullptr, "GetSnsAccountLinkage", MakeVersionGate({5,0,0}, {19,0,1})}, + FunctionInfo{20303, nullptr, "GetSnsAccountProfile", MakeVersionGate({5,0,0}, {19,0,1})}, + FunctionInfo{20304, nullptr, "GetSnsAccountFriendList", MakeVersionGate({5,0,0}, {19,0,1})}, + FunctionInfo{20400, nullptr, "GetBlockedUserListV1"}, + FunctionInfo{20401, nullptr, "SyncBlockedUserList"}, + FunctionInfo{20402, nullptr, "GetBlockedUserListV2", MakeVersionGate({20,0,0})}, + FunctionInfo{20500, nullptr, "GetProfileExtraListV1"}, + FunctionInfo{20501, nullptr, "GetRelationship"}, + FunctionInfo{20502, nullptr, "GetProfileExtraListV2", MakeVersionGate({19,0,0})}, + FunctionInfo{20600, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV1"}, + FunctionInfo{20601, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV2", MakeVersionGate({19,0,0})}, + FunctionInfo{20700, nullptr, "GetPlayHistoryListV1"}, + FunctionInfo{20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"}, + FunctionInfo{20702, nullptr, "GetPlayHistoryListV2", MakeVersionGate({19,0,0})}, + FunctionInfo{20800, &IFriendService::LoadUserSetting, "LoadUserSettingV1"}, + FunctionInfo{20801, nullptr, "SyncUserSetting"}, + FunctionInfo{20802, &IFriendService::LoadUserSetting, "LoadUserSettingV2", MakeVersionGate({19,0,0})}, + FunctionInfo{20900, &IFriendService::RequestListSummaryOverlayNotification, "RequestListSummaryOverlayNotification"}, + FunctionInfo{21000, nullptr, "GetExternalApplicationCatalog"}, + FunctionInfo{22000, nullptr, "GetReceivedFriendInvitationListV1"}, + FunctionInfo{22001, nullptr, "GetReceivedFriendInvitationDetailedInfoV1"}, + FunctionInfo{22002, nullptr, "GetReceivedFriendInvitationListV2", MakeVersionGate({19,0,0})}, + FunctionInfo{22003, nullptr, "GetReceivedFriendInvitationDetailedInfoV2", MakeVersionGate({19,0,0})}, + FunctionInfo{22010, &IFriendService::GetReceivedFriendInvitationCountCache, "GetReceivedFriendInvitationCountCache"}, + FunctionInfo{30100, nullptr, "DropFriendNewlyFlags"}, + FunctionInfo{30101, nullptr, "DeleteFriend"}, + FunctionInfo{30110, nullptr, "DropFriendNewlyFlag"}, + FunctionInfo{30120, nullptr, "ChangeFriendFavoriteFlag"}, + FunctionInfo{30121, nullptr, "ChangeFriendOnlineNotificationFlag"}, + FunctionInfo{30130, nullptr, "SetFriendNote", MakeVersionGate({22,0,0})}, + FunctionInfo{30131, nullptr, "RequestUploadPendingNote", MakeVersionGate({22,0,0})}, + FunctionInfo{30190, nullptr, "RequestSyncLocalUpdates", MakeVersionGate({22,0,0})}, + FunctionInfo{30200, nullptr, "SendFriendRequest"}, + FunctionInfo{30201, nullptr, "SendFriendRequestWithApplicationInfoV1"}, + FunctionInfo{30202, nullptr, "CancelFriendRequest"}, + FunctionInfo{30203, nullptr, "AcceptFriendRequest"}, + FunctionInfo{30204, nullptr, "RejectFriendRequest"}, + FunctionInfo{30205, nullptr, "ReadFriendRequest"}, + FunctionInfo{30210, nullptr, "GetFacedFriendRequestRegistrationKey"}, + FunctionInfo{30211, nullptr, "AddFacedFriendRequest"}, + FunctionInfo{30212, nullptr, "CancelFacedFriendRequest"}, + FunctionInfo{30213, nullptr, "GetFacedFriendRequestProfileImage"}, + FunctionInfo{30214, nullptr, "GetFacedFriendRequestProfileImageFromPath"}, + FunctionInfo{30215, nullptr, "SendFriendRequestWithExternalApplicationCatalogId"}, + FunctionInfo{30216, nullptr, "ResendFacedFriendRequest"}, + FunctionInfo{30217, nullptr, "SendFriendRequestWithNintendoNetworkIdInfo"}, + FunctionInfo{30218, nullptr, "SendFriendRequestWithApplicationInfoV2", MakeVersionGate({20,0,0})}, + FunctionInfo{30300, nullptr, "GetSnsAccountLinkPageUrl", MakeVersionGate({5,0,0}, {19,0,1})}, + FunctionInfo{30301, nullptr, "UnlinkSnsAccount", MakeVersionGate({5,0,0}, {19,0,1})}, + FunctionInfo{30400, nullptr, "BlockUser"}, + FunctionInfo{30401, nullptr, "BlockUserWithApplicationInfoV1"}, + FunctionInfo{30402, nullptr, "UnblockUser"}, + FunctionInfo{30403, nullptr, "BlockUserWithApplicationInfoV2", MakeVersionGate({20,0,0})}, + FunctionInfo{30500, nullptr, "GetProfileExtraFromFriendCodeV1"}, + FunctionInfo{30501, nullptr, "GetProfileExtraFromFriendCodeV2", MakeVersionGate({19,0,0})}, + FunctionInfo{30700, nullptr, "DeletePlayHistory"}, + FunctionInfo{30701, nullptr, "AddPlayHistoryWithApplication", MakeVersionGate({19,0,0})}, + FunctionInfo{30810, nullptr, "ChangePresencePermission"}, + FunctionInfo{30811, nullptr, "ChangeFriendRequestReception"}, + FunctionInfo{30812, nullptr, "ChangePlayLogPermission"}, + FunctionInfo{30820, nullptr, "IssueFriendCode"}, + FunctionInfo{30830, nullptr, "ClearPlayLog"}, + FunctionInfo{30900, nullptr, "SendFriendInvitationV1"}, + FunctionInfo{30901, nullptr, "SendFriendInvitationV2", MakeVersionGate({19,0,0})}, + FunctionInfo{30910, nullptr, "ReadFriendInvitation"}, + FunctionInfo{30911, nullptr, "ReadAllFriendInvitations"}, + FunctionInfo{31000, nullptr, "OpenUser", MakeVersionGate({19,0,0})}, + FunctionInfo{40100, nullptr, "DeleteFriendListCache"}, + FunctionInfo{40400, nullptr, "DeleteBlockedUserListCache"}, + FunctionInfo{49900, nullptr, "DeleteNetworkServiceAccountCache"} + ); KernelHelpers::ServiceContext service_context; - Kernel::KEvent* completion_event; }; class INotificationService final : public ServiceFramework { public: explicit INotificationService(Core::System& system_, Common::UUID uuid_) - : ServiceFramework{system_, "INotificationService"}, uuid{uuid_}, - service_context{system_, "INotificationService"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &INotificationService::GetEvent, "GetEvent"}, - {1, &INotificationService::Clear, "Clear"}, - {2, &INotificationService::Pop, "Pop"} - }; - // clang-format on - - RegisterHandlers(functions); - + : ServiceFramework{system_, "INotificationService"}, uuid{uuid_} + , service_context{system_, "INotificationService"} { notification_event = service_context.CreateEvent("INotificationService:NotifyEvent"); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + ~INotificationService() override { service_context.CloseEvent(notification_event); } @@ -465,9 +471,13 @@ private: bool has_received_friend_request; }; + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &INotificationService::GetEvent, "GetEvent"}, + FunctionInfo{1, &INotificationService::Clear, "Clear"}, + FunctionInfo{2, &INotificationService::Pop, "Pop"} + ); Common::UUID uuid; KernelHelpers::ServiceContext service_context; - Kernel::KEvent* notification_event; std::queue notifications; States states{}; @@ -501,61 +511,67 @@ class IServiceForApplication final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetReceivableNeighborInfoCountMax"}, + FunctionInfo{10, nullptr, "IsNeighborDetectionEnabled"} + ); }; class IServiceForSystem final : public ServiceFramework { public: explicit IServiceForSystem(Core::System& system_) : ServiceFramework{system_, "nd:sys"} - { - static const FunctionInfo functions[] = { - {0, nullptr, "GetReceivableNeighborInfoCountMax"}, - {10, nullptr, "IsNeighborDetectionEnabled"}, - {200, nullptr, "SetSystemData"}, - {201, nullptr, "ClearSystemData"}, - {203, nullptr, "GetReceivableNeighborInfoCountForSystem"}, - {204, nullptr, "ReceiveNeighborInfoForSystem"}, - {205, nullptr, "SetSender"}, - {206, nullptr, "GetSender"}, - {207, nullptr, "CreateScannerForSystem"}, - {208, nullptr, "CreateReceiveEventHolderForSystem"}, - {223, nullptr, "EnableNeighborDetection"}, - {224, nullptr, "DisableNeighborDetection"}, - {226, nullptr, "EnablePowerSave"}, - {227, nullptr, "DisablePowerSave"}, - {228, nullptr, "IsPowerSaveEnabled"}, - {232, nullptr, "ClearBlockedUsers"}, - {233, nullptr, "GetBlockedUserCount"}, - {234, nullptr, "BlockUserByLocalUserId"}, - {235, nullptr, "BlockUserByNetworkUserId"}, - {236, nullptr, "UnblockUserByLocalUserId"}, - {237, nullptr, "UnblockUserByNetworkUserId"}, - {240, nullptr, "DeleteApplication"}, - {250, nullptr, "InitializeApplicationInfo"}, - {260, nullptr, "CreateAccountSystemSaveDataAccessSuppressor"}, - {300, nullptr, "AddReceivedNeighborInfoForSystemForDebug"}, - {301, nullptr, "GetSendDataForDebug"}, - {302, nullptr, "ClearReceiveCounterForDebug"}, - {303, nullptr, "GetNextReceiveCounterForDebug"}, - {304, nullptr, "ListBlockedUsersForDebug"}, - {305, nullptr, "RefreshSendDataIdForDebug"}, - {306, nullptr, "ReloadFwdbgSettingsForDebug"}, - {307, nullptr, "EnableApplicationForDebug"}, - {308, nullptr, "GetNextReceiveCountersForDebug"}, - {309, nullptr, "ListApplicationInfoForDebug"}, - {310, nullptr, "SetApplicationDataForDebug"}, - {400, nullptr, "GetNetworkUserId"}, - {401, nullptr, "DeleteNetworkUserId"}, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetReceivableNeighborInfoCountMax"}, + FunctionInfo{10, nullptr, "IsNeighborDetectionEnabled"}, + FunctionInfo{200, nullptr, "SetSystemData"}, + FunctionInfo{201, nullptr, "ClearSystemData"}, + FunctionInfo{203, nullptr, "GetReceivableNeighborInfoCountForSystem"}, + FunctionInfo{204, nullptr, "ReceiveNeighborInfoForSystem"}, + FunctionInfo{205, nullptr, "SetSender"}, + FunctionInfo{206, nullptr, "GetSender"}, + FunctionInfo{207, nullptr, "CreateScannerForSystem"}, + FunctionInfo{208, nullptr, "CreateReceiveEventHolderForSystem"}, + FunctionInfo{223, nullptr, "EnableNeighborDetection"}, + FunctionInfo{224, nullptr, "DisableNeighborDetection"}, + FunctionInfo{226, nullptr, "EnablePowerSave"}, + FunctionInfo{227, nullptr, "DisablePowerSave"}, + FunctionInfo{228, nullptr, "IsPowerSaveEnabled"}, + FunctionInfo{232, nullptr, "ClearBlockedUsers"}, + FunctionInfo{233, nullptr, "GetBlockedUserCount"}, + FunctionInfo{234, nullptr, "BlockUserByLocalUserId"}, + FunctionInfo{235, nullptr, "BlockUserByNetworkUserId"}, + FunctionInfo{236, nullptr, "UnblockUserByLocalUserId"}, + FunctionInfo{237, nullptr, "UnblockUserByNetworkUserId"}, + FunctionInfo{240, nullptr, "DeleteApplication"}, + FunctionInfo{250, nullptr, "InitializeApplicationInfo"}, + FunctionInfo{260, nullptr, "CreateAccountSystemSaveDataAccessSuppressor"}, + FunctionInfo{300, nullptr, "AddReceivedNeighborInfoForSystemForDebug"}, + FunctionInfo{301, nullptr, "GetSendDataForDebug"}, + FunctionInfo{302, nullptr, "ClearReceiveCounterForDebug"}, + FunctionInfo{303, nullptr, "GetNextReceiveCounterForDebug"}, + FunctionInfo{304, nullptr, "ListBlockedUsersForDebug"}, + FunctionInfo{305, nullptr, "RefreshSendDataIdForDebug"}, + FunctionInfo{306, nullptr, "ReloadFwdbgSettingsForDebug"}, + FunctionInfo{307, nullptr, "EnableApplicationForDebug"}, + FunctionInfo{308, nullptr, "GetNextReceiveCountersForDebug"}, + FunctionInfo{309, nullptr, "ListApplicationInfoForDebug"}, + FunctionInfo{310, nullptr, "SetApplicationDataForDebug"}, + FunctionInfo{400, nullptr, "GetNetworkUserId"}, + FunctionInfo{401, nullptr, "DeleteNetworkUserId"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/friend/friend_interface.cpp b/src/core/hle/service/friend/friend_interface.cpp deleted file mode 100644 index c8b98b1f0c..0000000000 --- a/src/core/hle/service/friend/friend_interface.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/friend/friend_interface.h" - -namespace Service::Friend { - -Friend::Friend(std::shared_ptr module_, Core::System& system_, const char* name) - : Interface(std::move(module_), system_, name) { - static const FunctionInfo functions[] = { - {0, &Friend::CreateFriendService, "CreateFriendService"}, - {1, &Friend::CreateNotificationService, "CreateNotificationService"}, - {2, nullptr, "CreateDaemonSuspendSessionService"}, - }; - RegisterHandlers(functions); -} - -Friend::~Friend() = default; - -} // namespace Service::Friend diff --git a/src/core/hle/service/friend/friend_interface.h b/src/core/hle/service/friend/friend_interface.h deleted file mode 100644 index 3a2184c347..0000000000 --- a/src/core/hle/service/friend/friend_interface.h +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/friend/friend.h" - -namespace Service::Friend { - -class Friend final : public Module::Interface { -public: - explicit Friend(std::shared_ptr module_, Core::System& system_, const char* name); - ~Friend() override; -}; - -} // namespace Service::Friend diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp index 7eda57ddc3..203adb7ca7 100644 --- a/src/core/hle/service/glue/arp.cpp +++ b/src/core/hle/service/glue/arp.cpp @@ -35,22 +35,6 @@ std::optional GetTitleIDForProcessID(Core::System& system, u64 process_id) ARP_R::ARP_R(Core::System& system_, const ARPManager& manager_) : ServiceFramework{system_, "arp:r"}, manager{manager_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &ARP_R::GetApplicationLaunchProperty, "GetApplicationLaunchProperty"}, - {1, &ARP_R::GetApplicationLaunchPropertyWithApplicationId, "GetApplicationLaunchPropertyWithApplicationId"}, - {2, &ARP_R::GetApplicationControlProperty, "GetApplicationControlProperty"}, - {3, &ARP_R::GetApplicationControlPropertyWithApplicationId, "GetApplicationControlPropertyWithApplicationId"}, - {4, nullptr, "GetApplicationInstanceUnregistrationNotifier"}, - {5, nullptr, "ListApplicationInstanceId"}, - {6, nullptr, "GetMicroApplicationInstanceId"}, - {7, nullptr, "GetApplicationCertificate"}, - {9998, nullptr, "GetPreomiaApplicationLaunchProperty"}, - {9999, nullptr, "GetPreomiaApplicationControlProperty"}, - }; - // clang-format on - - RegisterHandlers(functions); } ARP_R::~ARP_R() = default; @@ -164,16 +148,10 @@ public: using IssuerFn = std::function)>; explicit IRegistrar(Core::System& system_, IssuerFn&& issuer) - : ServiceFramework{system_, "IRegistrar"}, issue_process_id{std::move(issuer)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IRegistrar::Issue, "Issue"}, - {1, &IRegistrar::SetApplicationLaunchProperty, "SetApplicationLaunchProperty"}, - {2, &IRegistrar::SetApplicationControlProperty, "SetApplicationControlProperty"}, - }; - // clang-format on + : ServiceFramework{system_, "IRegistrar"}, issue_process_id{std::move(issuer)} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -238,6 +216,11 @@ private: rb.Push(ResultSuccess); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IRegistrar::Issue, "Issue"}, + FunctionInfo{1, &IRegistrar::SetApplicationLaunchProperty, "SetApplicationLaunchProperty"}, + FunctionInfo{2, &IRegistrar::SetApplicationControlProperty, "SetApplicationControlProperty"} + ); IssuerFn issue_process_id; bool issued = false; ApplicationLaunchProperty launch{}; @@ -246,15 +229,6 @@ private: ARP_W::ARP_W(Core::System& system_, ARPManager& manager_) : ServiceFramework{system_, "arp:w"}, manager{manager_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &ARP_W::AcquireRegistrar, "AcquireRegistrar"}, - {1, &ARP_W::UnregisterApplicationInstance , "UnregisterApplicationInstance "}, - {2, nullptr, "AcquireUpdater"}, - }; - // clang-format on - - RegisterHandlers(functions); } ARP_W::~ARP_W() = default; diff --git a/src/core/hle/service/glue/arp.h b/src/core/hle/service/glue/arp.h index 5bce801755..de966475f9 100644 --- a/src/core/hle/service/glue/arp.h +++ b/src/core/hle/service/glue/arp.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -21,6 +24,21 @@ private: void GetApplicationControlProperty(HLERequestContext& ctx); void GetApplicationControlPropertyWithApplicationId(HLERequestContext& ctx); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ARP_R::GetApplicationLaunchProperty, "GetApplicationLaunchProperty"}, + FunctionInfo{1, &ARP_R::GetApplicationLaunchPropertyWithApplicationId, "GetApplicationLaunchPropertyWithApplicationId"}, + FunctionInfo{2, &ARP_R::GetApplicationControlProperty, "GetApplicationControlProperty"}, + FunctionInfo{3, &ARP_R::GetApplicationControlPropertyWithApplicationId, "GetApplicationControlPropertyWithApplicationId"}, + FunctionInfo{4, nullptr, "GetApplicationInstanceUnregistrationNotifier"}, + FunctionInfo{5, nullptr, "ListApplicationInstanceId"}, + FunctionInfo{6, nullptr, "GetMicroApplicationInstanceId"}, + FunctionInfo{7, nullptr, "GetApplicationCertificate"}, + FunctionInfo{9998, nullptr, "GetPreomiaApplicationLaunchProperty"}, + FunctionInfo{9999, nullptr, "GetPreomiaApplicationControlProperty"} + ); const ARPManager& manager; }; @@ -33,6 +51,14 @@ private: void AcquireRegistrar(HLERequestContext& ctx); void UnregisterApplicationInstance(HLERequestContext& ctx); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ARP_W::AcquireRegistrar, "AcquireRegistrar"}, + FunctionInfo{1, &ARP_W::UnregisterApplicationInstance , "UnregisterApplicationInstance "}, + FunctionInfo{2, nullptr, "AcquireUpdater"} + ); ARPManager& manager; std::shared_ptr registrar; }; diff --git a/src/core/hle/service/glue/bgtc.cpp b/src/core/hle/service/glue/bgtc.cpp index 360f16f0dd..7c7b5ea13c 100644 --- a/src/core/hle/service/glue/bgtc.cpp +++ b/src/core/hle/service/glue/bgtc.cpp @@ -11,15 +11,7 @@ namespace Service::Glue { -BGTC_T::BGTC_T(Core::System& system_) : ServiceFramework{system_, "bgtc:t"} { - // clang-format off - static const FunctionInfo functions[] = { - {100, &BGTC_T::OpenTaskService, "OpenTaskService"}, - }; - // clang-format on - - RegisterHandlers(functions); -} +BGTC_T::BGTC_T(Core::System& system_) : ServiceFramework{system_, "bgtc:t"} {} BGTC_T::~BGTC_T() = default; @@ -32,44 +24,11 @@ void BGTC_T::OpenTaskService(HLERequestContext& ctx) { } ITaskService::ITaskService(Core::System& system_) : ServiceFramework{system_, "ITaskService"} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "NotifyTaskStarting"}, - {2, nullptr, "NotifyTaskFinished"}, - {3, nullptr, "GetTriggerEvent"}, - {4, nullptr, "IsInHalfAwake"}, - {5, nullptr, "NotifyClientName"}, - {6, nullptr, "IsInFullAwake"}, - {11, nullptr, "ScheduleTask"}, - {12, nullptr, "GetScheduledTaskInterval"}, - {13, nullptr, "UnscheduleTask"}, - {14, nullptr, "GetScheduleEvent"}, - {15, nullptr, "SchedulePeriodicTask"}, - {16, nullptr, "Unknown16"}, - {101, nullptr, "GetOperationMode"}, - {102, nullptr, "WillDisconnectNetworkWhenEnteringSleep"}, - {103, nullptr, "WillStayHalfAwakeInsteadSleep"}, - {200, nullptr, "Unknown200"}, - }; - // clang-format on - - RegisterHandlers(functions); } ITaskService::~ITaskService() = default; BGTC_SC::BGTC_SC(Core::System& system_) : ServiceFramework{system_, "bgtc:sc"} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "GetState"}, - {2, nullptr, "GetStateChangedEvent"}, - {3, nullptr, "NotifyEnteringHalfAwake"}, - {4, nullptr, "NotifyLeavingHalfAwake"}, - {5, nullptr, "SetIsUsingSleepUnsupportedDevices"}, - }; - // clang-format on - - RegisterHandlers(functions); } BGTC_SC::~BGTC_SC() = default; diff --git a/src/core/hle/service/glue/bgtc.h b/src/core/hle/service/glue/bgtc.h index 5a5d9c9a7a..0ef0ab902f 100644 --- a/src/core/hle/service/glue/bgtc.h +++ b/src/core/hle/service/glue/bgtc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -17,18 +20,57 @@ public: ~BGTC_T() override; void OpenTaskService(HLERequestContext& ctx); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{100, &BGTC_T::OpenTaskService, "OpenTaskService"} + ); }; class ITaskService final : public ServiceFramework { public: explicit ITaskService(Core::System& system_); ~ITaskService() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "NotifyTaskStarting"}, + FunctionInfo{2, nullptr, "NotifyTaskFinished"}, + FunctionInfo{3, nullptr, "GetTriggerEvent"}, + FunctionInfo{4, nullptr, "IsInHalfAwake"}, + FunctionInfo{5, nullptr, "NotifyClientName"}, + FunctionInfo{6, nullptr, "IsInFullAwake"}, + FunctionInfo{11, nullptr, "ScheduleTask"}, + FunctionInfo{12, nullptr, "GetScheduledTaskInterval"}, + FunctionInfo{13, nullptr, "UnscheduleTask"}, + FunctionInfo{14, nullptr, "GetScheduleEvent"}, + FunctionInfo{15, nullptr, "SchedulePeriodicTask"}, + FunctionInfo{16, nullptr, "Unknown16"}, + FunctionInfo{101, nullptr, "GetOperationMode"}, + FunctionInfo{102, nullptr, "WillDisconnectNetworkWhenEnteringSleep"}, + FunctionInfo{103, nullptr, "WillStayHalfAwakeInsteadSleep"}, + FunctionInfo{200, nullptr, "Unknown200"} + ); }; class BGTC_SC final : public ServiceFramework { public: explicit BGTC_SC(Core::System& system_); ~BGTC_SC() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "GetState"}, + FunctionInfo{2, nullptr, "GetStateChangedEvent"}, + FunctionInfo{3, nullptr, "NotifyEnteringHalfAwake"}, + FunctionInfo{4, nullptr, "NotifyLeavingHalfAwake"}, + FunctionInfo{5, nullptr, "SetIsUsingSleepUnsupportedDevices"} + ); }; } // namespace Service::Glue diff --git a/src/core/hle/service/glue/ectx.cpp b/src/core/hle/service/glue/ectx.cpp index 322ae45254..80d22a0ca7 100644 --- a/src/core/hle/service/glue/ectx.cpp +++ b/src/core/hle/service/glue/ectx.cpp @@ -12,14 +12,10 @@ namespace Service::Glue { // This is nn::err::context::IContextRegistrar class IContextRegistrar : public ServiceFramework { public: - IContextRegistrar(Core::System& system_) : ServiceFramework{system_, "IContextRegistrar"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IContextRegistrar::Complete, "Complete"}, - }; - // clang-format on + IContextRegistrar(Core::System& system_) : ServiceFramework{system_, "IContextRegistrar"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~IContextRegistrar() override = default; @@ -41,41 +37,21 @@ private: rb.Push(ResultSuccess); rb.Push(0); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IContextRegistrar::Complete, "Complete"} + ); }; ECTX_W::ECTX_W(Core::System& system_) : ServiceFramework{system_, "ectx:w"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateContextRegistrar"}, - {1, nullptr, "CommitContext"}, - {2, nullptr, "RemoveContext"}, - }; - // clang-format on - RegisterHandlers(functions); } ECTX_W::~ECTX_W() = default; ECTX_R::ECTX_R(Core::System& system_) : ServiceFramework{system_, "ectx:r"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetContextInfo"}, - {1, nullptr, "PullContext"}, - {2, nullptr, "ListContextDescriptorWithResultForDebug"}, - }; - // clang-format on - RegisterHandlers(functions); } ECTX_R::~ECTX_R() = default; ECTX_AW::ECTX_AW(Core::System& system_) : ServiceFramework{system_, "ectx:aw"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &ECTX_AW::CreateContextRegistrar, "CreateContextRegistrar"}, - {1, nullptr, "CommitContext"}, - }; - // clang-format on - - RegisterHandlers(functions); } ECTX_AW::~ECTX_AW() = default; diff --git a/src/core/hle/service/glue/ectx.h b/src/core/hle/service/glue/ectx.h index ff48075eda..01f109c609 100644 --- a/src/core/hle/service/glue/ectx.h +++ b/src/core/hle/service/glue/ectx.h @@ -18,12 +18,30 @@ class ECTX_W final : public ServiceFramework { public: explicit ECTX_W(Core::System& system_); ~ECTX_W() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateContextRegistrar"}, + FunctionInfo{1, nullptr, "CommitContext"}, + FunctionInfo{2, nullptr, "RemoveContext"} + ); }; class ECTX_R final : public ServiceFramework { public: explicit ECTX_R(Core::System& system_); ~ECTX_R() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetContextInfo"}, + FunctionInfo{1, nullptr, "PullContext"}, + FunctionInfo{2, nullptr, "ListContextDescriptorWithResultForDebug"} + ); }; class ECTX_AW final : public ServiceFramework { @@ -33,6 +51,14 @@ public: private: void CreateContextRegistrar(HLERequestContext& ctx); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ECTX_AW::CreateContextRegistrar, "CreateContextRegistrar"}, + FunctionInfo{1, nullptr, "CommitContext"} + ); }; } // namespace Service::Glue diff --git a/src/core/hle/service/glue/notif.cpp b/src/core/hle/service/glue/notif.cpp index 716e4da32d..a369b78ddd 100644 --- a/src/core/hle/service/glue/notif.cpp +++ b/src/core/hle/service/glue/notif.cpp @@ -17,9 +17,45 @@ namespace Service::Glue { namespace { - constexpr inline std::size_t MaxAlarms = 8; +} +std::optional INotificationServicesForApplication::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{500, D<&INotificationServicesForApplication::RegisterAlarmSetting>, "RegisterAlarmSetting"}, + FunctionInfo{510, D<&INotificationServicesForApplication::UpdateAlarmSetting>, "UpdateAlarmSetting"}, + FunctionInfo{520, D<&INotificationServicesForApplication::ListAlarmSettings>, "ListAlarmSettings"}, + FunctionInfo{530, D<&INotificationServicesForApplication::LoadApplicationParameter>, "LoadApplicationParameter"}, + FunctionInfo{540, D<&INotificationServicesForApplication::DeleteAlarmSetting>, "DeleteAlarmSetting"}, + FunctionInfo{1000, D<&INotificationServicesForApplication::Initialize>, "Initialize"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + +std::optional INotificationServices::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{500, D<&INotificationServices::RegisterAlarmSetting>, "RegisterAlarmSetting"}, + FunctionInfo{510, D<&INotificationServices::UpdateAlarmSetting>, "UpdateAlarmSetting"}, + FunctionInfo{520, D<&INotificationServices::ListAlarmSettings>, "ListAlarmSettings"}, + FunctionInfo{530, D<&INotificationServices::LoadApplicationParameter>, "LoadApplicationParameter"}, + FunctionInfo{540, D<&INotificationServices::DeleteAlarmSetting>, "DeleteAlarmSetting"}, + FunctionInfo{1000, D<&INotificationServices::Initialize>, "Initialize"}, + FunctionInfo{1010, nullptr, "ListNotifications"}, + FunctionInfo{1020, nullptr, "DeleteNotification"}, + FunctionInfo{1030, nullptr, "ClearNotifications"}, + FunctionInfo{1040, D<&INotificationServices::OpenNotificationSystemEventAccessor>, "OpenNotificationSystemEventAccessor"}, + FunctionInfo{1500, nullptr, "SetNotificationPresentationSetting"}, + FunctionInfo{1510, D<&INotificationServices::GetNotificationPresentationSetting>, "GetNotificationPresentationSetting"}, + FunctionInfo{2000, nullptr, "GetAlarmSetting"}, + FunctionInfo{2001, nullptr, "GetAlarmSettingWithApplicationParameter"}, + FunctionInfo{2010, nullptr, "MuteAlarmSetting"}, + FunctionInfo{2020, nullptr, "IsAlarmSettingReady"}, + FunctionInfo{8000, nullptr, "RegisterAppletResourceUserId"}, + FunctionInfo{8010, nullptr, "UnregisterAppletResourceUserId"}, + FunctionInfo{8999, nullptr, "GetCurrentTime"}, + FunctionInfo{9000, nullptr, "GetAlarmSettingNextNotificationTime"} + ); + return HandlerTableGenerateWithFind(key, functions); } Result NotificationServiceImpl::RegisterAlarmSetting(AlarmSettingId* out_alarm_setting_id, @@ -124,18 +160,6 @@ std::vector::iterator NotificationServiceImpl::GetAlarmFromId(Alar INotificationServicesForApplication::INotificationServicesForApplication(Core::System& system_) : ServiceFramework{system_, "notif:a"} { - // clang-format off - static const FunctionInfo functions[] = { - {500, D<&INotificationServicesForApplication::RegisterAlarmSetting>, "RegisterAlarmSetting"}, - {510, D<&INotificationServicesForApplication::UpdateAlarmSetting>, "UpdateAlarmSetting"}, - {520, D<&INotificationServicesForApplication::ListAlarmSettings>, "ListAlarmSettings"}, - {530, D<&INotificationServicesForApplication::LoadApplicationParameter>, "LoadApplicationParameter"}, - {540, D<&INotificationServicesForApplication::DeleteAlarmSetting>, "DeleteAlarmSetting"}, - {1000, D<&INotificationServicesForApplication::Initialize>, "Initialize"}, - }; - // clang-format on - - RegisterHandlers(functions); } INotificationServicesForApplication::~INotificationServicesForApplication() = default; @@ -178,18 +202,13 @@ class INotificationSystemEventAccessor final : public ServiceFramework { public: explicit INotificationSystemEventAccessor(Core::System& system_) - : ServiceFramework{system_, "INotificationSystemEventAccessor"}, - service_context{system_, "INotificationSystemEventAccessor"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&INotificationSystemEventAccessor::GetSystemEvent>, "GetSystemEvent"}, - }; - // clang-format on + : ServiceFramework{system_, "INotificationSystemEventAccessor"} + , service_context{system_, "INotificationSystemEventAccessor"} { + notification_event = service_context.CreateEvent("INotificationSystemEventAccessor:NotificationEvent"); + } - RegisterHandlers(functions); - - notification_event = - service_context.CreateEvent("INotificationSystemEventAccessor:NotificationEvent"); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~INotificationSystemEventAccessor() { @@ -204,38 +223,15 @@ private: R_SUCCEED(); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&INotificationSystemEventAccessor::GetSystemEvent>, "GetSystemEvent"} + ); KernelHelpers::ServiceContext service_context; Kernel::KEvent* notification_event; }; INotificationServices::INotificationServices(Core::System& system_) : ServiceFramework{system_, "notif:s"} { - // clang-format off - static const FunctionInfo functions[] = { - {500, D<&INotificationServices::RegisterAlarmSetting>, "RegisterAlarmSetting"}, - {510, D<&INotificationServices::UpdateAlarmSetting>, "UpdateAlarmSetting"}, - {520, D<&INotificationServices::ListAlarmSettings>, "ListAlarmSettings"}, - {530, D<&INotificationServices::LoadApplicationParameter>, "LoadApplicationParameter"}, - {540, D<&INotificationServices::DeleteAlarmSetting>, "DeleteAlarmSetting"}, - {1000, D<&INotificationServices::Initialize>, "Initialize"}, - {1010, nullptr, "ListNotifications"}, - {1020, nullptr, "DeleteNotification"}, - {1030, nullptr, "ClearNotifications"}, - {1040, D<&INotificationServices::OpenNotificationSystemEventAccessor>, "OpenNotificationSystemEventAccessor"}, - {1500, nullptr, "SetNotificationPresentationSetting"}, - {1510, D<&INotificationServices::GetNotificationPresentationSetting>, "GetNotificationPresentationSetting"}, - {2000, nullptr, "GetAlarmSetting"}, - {2001, nullptr, "GetAlarmSettingWithApplicationParameter"}, - {2010, nullptr, "MuteAlarmSetting"}, - {2020, nullptr, "IsAlarmSettingReady"}, - {8000, nullptr, "RegisterAppletResourceUserId"}, - {8010, nullptr, "UnregisterAppletResourceUserId"}, - {8999, nullptr, "GetCurrentTime"}, - {9000, nullptr, "GetAlarmSettingNextNotificationTime"}, - }; - // clang-format on - - RegisterHandlers(functions); } INotificationServices::~INotificationServices() = default; diff --git a/src/core/hle/service/glue/notif.h b/src/core/hle/service/glue/notif.h index ef2522fdfb..c5367e5da4 100644 --- a/src/core/hle/service/glue/notif.h +++ b/src/core/hle/service/glue/notif.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -98,6 +101,7 @@ private: Result DeleteAlarmSetting(AlarmSettingId alarm_setting_id); Result Initialize(ClientAppletResourceUserId aruid); + std::optional FindRequest(u32 key) override; NotificationServiceImpl impl; }; @@ -127,6 +131,7 @@ private: Out out_notification_presentation_setting, NotificationChannel notification_channel); + std::optional FindRequest(u32 key) override; NotificationServiceImpl impl; }; } // namespace Service::Glue diff --git a/src/core/hle/service/glue/time/static.cpp b/src/core/hle/service/glue/time/static.cpp index d8672b7248..dc7651fd1f 100644 --- a/src/core/hle/service/glue/time/static.cpp +++ b/src/core/hle/service/glue/time/static.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -21,42 +24,42 @@ namespace Service::Glue::Time { +std::optional StaticService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"}, + FunctionInfo{1, D<&StaticService::GetStandardNetworkSystemClock>, "GetStandardNetworkSystemClock"}, + FunctionInfo{2, D<&StaticService::GetStandardSteadyClock>, "GetStandardSteadyClock"}, + FunctionInfo{3, D<&StaticService::GetTimeZoneService>, "GetTimeZoneService"}, + FunctionInfo{4, D<&StaticService::GetStandardLocalSystemClock>, "GetStandardLocalSystemClock"}, + FunctionInfo{5, D<&StaticService::GetEphemeralNetworkSystemClock>, "GetEphemeralNetworkSystemClock"}, + FunctionInfo{20, D<&StaticService::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, + FunctionInfo{50, D<&StaticService::SetStandardSteadyClockInternalOffset>, "SetStandardSteadyClockInternalOffset"}, + FunctionInfo{51, D<&StaticService::GetStandardSteadyClockRtcValue>, "GetStandardSteadyClockRtcValue"}, + FunctionInfo{100, D<&StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled>, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, + FunctionInfo{101, D<&StaticService::SetStandardUserSystemClockAutomaticCorrectionEnabled>, "SetStandardUserSystemClockAutomaticCorrectionEnabled"}, + FunctionInfo{102, D<&StaticService::GetStandardUserSystemClockInitialYear>, "GetStandardUserSystemClockInitialYear"}, + FunctionInfo{200, D<&StaticService::IsStandardNetworkSystemClockAccuracySufficient>, "IsStandardNetworkSystemClockAccuracySufficient"}, + FunctionInfo{201, D<&StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedTime"}, + FunctionInfo{300, D<&StaticService::CalculateMonotonicSystemClockBaseTimePoint>, "CalculateMonotonicSystemClockBaseTimePoint"}, + FunctionInfo{400, D<&StaticService::GetClockSnapshot>, "GetClockSnapshot"}, + FunctionInfo{401, D<&StaticService::GetClockSnapshotFromSystemClockContext>, "GetClockSnapshotFromSystemClockContext"}, + FunctionInfo{500, D<&StaticService::CalculateStandardUserSystemClockDifferenceByUser>, "CalculateStandardUserSystemClockDifferenceByUser"}, + FunctionInfo{501, D<&StaticService::CalculateSpanBetween>, "CalculateSpanBetween"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + StaticService::StaticService(Core::System& system_, Service::PSC::Time::StaticServiceSetupInfo setup_info, std::shared_ptr time, const char* name) - : ServiceFramework{system_, name}, m_system{system_}, m_time_m{time->m_time_m}, + : ServiceFramework{system_, name}, m_time_m{time->m_time_m}, m_setup_info{setup_info}, m_time_sm{time->m_time_sm}, m_file_timestamp_worker{time->m_file_timestamp_worker}, m_standard_steady_clock_resource{time->m_steady_clock_resource}, m_time_zone_binary{time->m_time_zone_binary} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"}, - {1, D<&StaticService::GetStandardNetworkSystemClock>, "GetStandardNetworkSystemClock"}, - {2, D<&StaticService::GetStandardSteadyClock>, "GetStandardSteadyClock"}, - {3, D<&StaticService::GetTimeZoneService>, "GetTimeZoneService"}, - {4, D<&StaticService::GetStandardLocalSystemClock>, "GetStandardLocalSystemClock"}, - {5, D<&StaticService::GetEphemeralNetworkSystemClock>, "GetEphemeralNetworkSystemClock"}, - {20, D<&StaticService::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, - {50, D<&StaticService::SetStandardSteadyClockInternalOffset>, "SetStandardSteadyClockInternalOffset"}, - {51, D<&StaticService::GetStandardSteadyClockRtcValue>, "GetStandardSteadyClockRtcValue"}, - {100, D<&StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled>, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, - {101, D<&StaticService::SetStandardUserSystemClockAutomaticCorrectionEnabled>, "SetStandardUserSystemClockAutomaticCorrectionEnabled"}, - {102, D<&StaticService::GetStandardUserSystemClockInitialYear>, "GetStandardUserSystemClockInitialYear"}, - {200, D<&StaticService::IsStandardNetworkSystemClockAccuracySufficient>, "IsStandardNetworkSystemClockAccuracySufficient"}, - {201, D<&StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedTime"}, - {300, D<&StaticService::CalculateMonotonicSystemClockBaseTimePoint>, "CalculateMonotonicSystemClockBaseTimePoint"}, - {400, D<&StaticService::GetClockSnapshot>, "GetClockSnapshot"}, - {401, D<&StaticService::GetClockSnapshotFromSystemClockContext>, "GetClockSnapshotFromSystemClockContext"}, - {500, D<&StaticService::CalculateStandardUserSystemClockDifferenceByUser>, "CalculateStandardUserSystemClockDifferenceByUser"}, - {501, D<&StaticService::CalculateSpanBetween>, "CalculateSpanBetween"}, - }; - // clang-format on - - RegisterHandlers(functions); m_set_sys = - m_system.ServiceManager().GetService("set:sys", true); + system.ServiceManager().GetService("set:sys", true); if (m_setup_info.can_write_local_clock && m_setup_info.can_write_user_clock && !m_setup_info.can_write_network_clock && m_setup_info.can_write_timezone_device_location && @@ -106,7 +109,7 @@ Result StaticService::GetTimeZoneService(OutInterface out_servi LOG_DEBUG(Service_Time, "called."); *out_service = std::make_shared( - m_system, m_file_timestamp_worker, m_setup_info.can_write_timezone_device_location, + system, m_file_timestamp_worker, m_setup_info.can_write_timezone_device_location, m_time_zone_binary, m_time_zone); R_SUCCEED(); } diff --git a/src/core/hle/service/glue/time/static.h b/src/core/hle/service/glue/time/static.h index 7bb0e0b36e..5856553461 100644 --- a/src/core/hle/service/glue/time/static.h +++ b/src/core/hle/service/glue/time/static.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -69,12 +72,11 @@ public: Result CalculateSpanBetween(Out out_time, InClockSnapshot a, InClockSnapshot b); private: - Core::System& m_system; + std::optional FindRequest(u32 key) override; std::shared_ptr m_set_sys; std::shared_ptr m_time_m; std::shared_ptr m_wrapped_service; - Service::PSC::Time::StaticServiceSetupInfo m_setup_info; std::shared_ptr m_time_sm; std::shared_ptr m_time_zone; diff --git a/src/core/hle/service/glue/time/time_zone.cpp b/src/core/hle/service/glue/time/time_zone.cpp index 52bd651f2b..6e861b4060 100644 --- a/src/core/hle/service/glue/time/time_zone.cpp +++ b/src/core/hle/service/glue/time/time_zone.cpp @@ -19,6 +19,26 @@ namespace Service::Glue::Time { +std::optional TimeZoneService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"}, + FunctionInfo{1, D<&TimeZoneService::SetDeviceLocationName>, "SetDeviceLocationName"}, + FunctionInfo{2, D<&TimeZoneService::GetTotalLocationNameCount>, "GetTotalLocationNameCount"}, + FunctionInfo{3, D<&TimeZoneService::LoadLocationNameList>, "LoadLocationNameList"}, + FunctionInfo{4, D<&TimeZoneService::LoadTimeZoneRule>, "LoadTimeZoneRule"}, + FunctionInfo{5, D<&TimeZoneService::GetTimeZoneRuleVersion>, "GetTimeZoneRuleVersion"}, + FunctionInfo{6, D<&TimeZoneService::GetDeviceLocationNameAndUpdatedTime>, "GetDeviceLocationNameAndUpdatedTime"}, + FunctionInfo{7, D<&TimeZoneService::SetDeviceLocationNameWithTimeZoneRule>, "SetDeviceLocationNameWithTimeZoneRule"}, + FunctionInfo{8, D<&TimeZoneService::ParseTimeZoneBinary>, "ParseTimeZoneBinary"}, + FunctionInfo{20, D<&TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle>, "GetDeviceLocationNameOperationEventReadableHandle"}, + FunctionInfo{100, D<&TimeZoneService::ToCalendarTime>, "ToCalendarTime"}, + FunctionInfo{101, D<&TimeZoneService::ToCalendarTimeWithMyRule>, "ToCalendarTimeWithMyRule"}, + FunctionInfo{201, D<&TimeZoneService::ToPosixTime>, "ToPosixTime"}, + FunctionInfo{202, D<&TimeZoneService::ToPosixTimeWithMyRule>, "ToPosixTimeWithMyRule"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + TimeZoneService::TimeZoneService( Core::System& system_, FileTimestampWorker& file_timestamp_worker, bool can_write_timezone_device_location, TimeZoneBinary& time_zone_binary, @@ -30,26 +50,6 @@ TimeZoneService::TimeZoneService( , m_operation_event{system} , m_time_zone_binary{time_zone_binary} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"}, - {1, D<&TimeZoneService::SetDeviceLocationName>, "SetDeviceLocationName"}, - {2, D<&TimeZoneService::GetTotalLocationNameCount>, "GetTotalLocationNameCount"}, - {3, D<&TimeZoneService::LoadLocationNameList>, "LoadLocationNameList"}, - {4, D<&TimeZoneService::LoadTimeZoneRule>, "LoadTimeZoneRule"}, - {5, D<&TimeZoneService::GetTimeZoneRuleVersion>, "GetTimeZoneRuleVersion"}, - {6, D<&TimeZoneService::GetDeviceLocationNameAndUpdatedTime>, "GetDeviceLocationNameAndUpdatedTime"}, - {7, D<&TimeZoneService::SetDeviceLocationNameWithTimeZoneRule>, "SetDeviceLocationNameWithTimeZoneRule"}, - {8, D<&TimeZoneService::ParseTimeZoneBinary>, "ParseTimeZoneBinary"}, - {20, D<&TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle>, "GetDeviceLocationNameOperationEventReadableHandle"}, - {100, D<&TimeZoneService::ToCalendarTime>, "ToCalendarTime"}, - {101, D<&TimeZoneService::ToCalendarTimeWithMyRule>, "ToCalendarTimeWithMyRule"}, - {201, D<&TimeZoneService::ToPosixTime>, "ToPosixTime"}, - {202, D<&TimeZoneService::ToPosixTimeWithMyRule>, "ToPosixTimeWithMyRule"}, - }; - // clang-format on - RegisterHandlers(functions); - m_set_sys = system.ServiceManager().GetService("set:sys", true); } diff --git a/src/core/hle/service/glue/time/time_zone.h b/src/core/hle/service/glue/time/time_zone.h index 635070263b..839d823e67 100644 --- a/src/core/hle/service/glue/time/time_zone.h +++ b/src/core/hle/service/glue/time/time_zone.h @@ -80,6 +80,7 @@ public: const Service::PSC::Time::CalendarTime& calendar_time); private: + std::optional FindRequest(u32 key) override; std::shared_ptr m_set_sys; bool m_can_write_timezone_device_location; FileTimestampWorker& m_file_timestamp_worker; diff --git a/src/core/hle/service/gpio/gpio.cpp b/src/core/hle/service/gpio/gpio.cpp index 8b4aa0f5ab..5441149c65 100644 --- a/src/core/hle/service/gpio/gpio.cpp +++ b/src/core/hle/service/gpio/gpio.cpp @@ -13,15 +13,15 @@ namespace Service::GPIO { class GPIO final : public ServiceFramework { public: - explicit GPIO(Core::System& system_) - : ServiceFramework{system_, "gpio"} - { - static const FunctionInfo functions[] = { - {0, nullptr, "Cmd0"}, - }; - RegisterHandlers(functions); - } + explicit GPIO(Core::System& system_) : ServiceFramework{system_, "gpio"} {} ~GPIO() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Cmd0"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/grc/grc.cpp b/src/core/hle/service/grc/grc.cpp index e8e901662d..5f6c84e914 100644 --- a/src/core/hle/service/grc/grc.cpp +++ b/src/core/hle/service/grc/grc.cpp @@ -14,32 +14,31 @@ namespace Service::GRC { class GRC final : public ServiceFramework { public: - explicit GRC(Core::System& system_) : ServiceFramework{system_, "grc:c"} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "OpenContinuousRecorder"}, - {2, nullptr, "OpenGameMovieTrimmer"}, - {3, nullptr, "OpenOffscreenRecorder"}, - {101, nullptr, "CreateMovieMaker"}, - {9903, nullptr, "SetOffscreenRecordingMarker"} - }; - // clang-format on + explicit GRC(Core::System& system_) : ServiceFramework{system_, "grc:c"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "OpenContinuousRecorder"}, + FunctionInfo{2, nullptr, "OpenGameMovieTrimmer"}, + FunctionInfo{3, nullptr, "OpenOffscreenRecorder"}, + FunctionInfo{101, nullptr, "CreateMovieMaker"}, + FunctionInfo{9903, nullptr, "SetOffscreenRecordingMarker"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class GRC_D final : public ServiceFramework { public: - explicit GRC_D(Core::System& system_) : ServiceFramework{system_, "grc:d"} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "Initialize"}, - {2, nullptr, "Transfer"}, - {3, nullptr, "Cmd3"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit GRC_D(Core::System& system_) : ServiceFramework{system_, "grc:d"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "Initialize"}, + FunctionInfo{2, nullptr, "Transfer"}, + FunctionInfo{3, nullptr, "Cmd3"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/hid/active_vibration_device_list.cpp b/src/core/hle/service/hid/active_vibration_device_list.cpp index e0d6d3f2d9..7a4f4cce2c 100644 --- a/src/core/hle/service/hid/active_vibration_device_list.cpp +++ b/src/core/hle/service/hid/active_vibration_device_list.cpp @@ -14,16 +14,16 @@ namespace Service::HID { +std::optional IActiveVibrationDeviceList::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IActiveVibrationDeviceList::ActivateVibrationDevice>, "ActivateVibrationDevice"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IActiveVibrationDeviceList::IActiveVibrationDeviceList(Core::System& system_, std::shared_ptr resource) : ServiceFramework{system_, "IActiveVibrationDeviceList"}, resource_manager(resource) { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&IActiveVibrationDeviceList::ActivateVibrationDevice>, "ActivateVibrationDevice"}, - }; - // clang-format on - - RegisterHandlers(functions); } IActiveVibrationDeviceList::~IActiveVibrationDeviceList() = default; diff --git a/src/core/hle/service/hid/active_vibration_device_list.h b/src/core/hle/service/hid/active_vibration_device_list.h index beaa44d97a..57c31a8df1 100644 --- a/src/core/hle/service/hid/active_vibration_device_list.h +++ b/src/core/hle/service/hid/active_vibration_device_list.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -26,8 +29,8 @@ public: private: static constexpr std::size_t MaxVibrationDevicesHandles{0x100}; - Result ActivateVibrationDevice(Core::HID::VibrationDeviceHandle vibration_device_handle); + std::optional FindRequest(u32 key) override; mutable std::mutex mutex; std::size_t list_size{}; diff --git a/src/core/hle/service/hid/applet_resource.cpp b/src/core/hle/service/hid/applet_resource.cpp index 44ae767841..6f658fa875 100644 --- a/src/core/hle/service/hid/applet_resource.cpp +++ b/src/core/hle/service/hid/applet_resource.cpp @@ -12,14 +12,17 @@ namespace Service::HID { +std::optional IAppletResource::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IAppletResource::GetSharedMemoryHandle>, "GetSharedMemoryHandle"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAppletResource::IAppletResource(Core::System& system_, std::shared_ptr resource, u64 applet_resource_user_id) : ServiceFramework{system_, "IAppletResource"}, aruid{applet_resource_user_id}, resource_manager{resource} { - static const FunctionInfo functions[] = { - {0, C<&IAppletResource::GetSharedMemoryHandle>, "GetSharedMemoryHandle"}, - }; - RegisterHandlers(functions); } IAppletResource::~IAppletResource() { diff --git a/src/core/hle/service/hid/applet_resource.h b/src/core/hle/service/hid/applet_resource.h index d1e7db9b1e..7b5d915218 100644 --- a/src/core/hle/service/hid/applet_resource.h +++ b/src/core/hle/service/hid/applet_resource.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -29,6 +32,7 @@ public: private: Result GetSharedMemoryHandle(OutCopyHandle out_shared_memory_handle); + std::optional FindRequest(u32 key) override; u64 aruid{}; std::shared_ptr resource_manager; }; diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 25096ff36f..0ea587312b 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -16,19 +16,24 @@ #include "core/hle/service/server_manager.h" #include "hid_core/resource_manager.h" #include "hid_core/resources/hid_firmware_settings.h" +#include "core/hle/service/ipc_helpers.h" +#include "hid_core/hid_types.h" +#include "hid_core/resources/touch_screen/gesture.h" +#include "hid_core/resources/touch_screen/touch_screen.h" +#include "core/hle/service/cmif_serialization.h" namespace Service::HID { class IHidTemporaryServer final : public ServiceFramework { public: explicit IHidTemporaryServer(Core::System& system_) - : ServiceFramework{system_, "hid:tmp"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetConsoleSixAxisSensorCalibrationValues"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "hid:tmp"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetConsoleSixAxisSensorCalibrationValues"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~IHidTemporaryServer() override = default; }; @@ -36,17 +41,17 @@ public: class AHID_CD final : public ServiceFramework { public: explicit AHID_CD(Core::System& system_) - : ServiceFramework{system_, "ahid:cd"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "AcquireDevice"}, - {1, nullptr, "ReleaseDevice"}, - {2, nullptr, "GetCtrlSession"}, - {3, nullptr, "GetReadSession"}, - {4, nullptr, "GetWriteSession"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "ahid:cd"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "AcquireDevice"}, + FunctionInfo{1, nullptr, "ReleaseDevice"}, + FunctionInfo{2, nullptr, "GetCtrlSession"}, + FunctionInfo{3, nullptr, "GetReadSession"}, + FunctionInfo{4, nullptr, "GetWriteSession"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~AHID_CD() override = default; }; @@ -54,22 +59,322 @@ public: class AHID_HDR final : public ServiceFramework { public: explicit AHID_HDR(Core::System& system_) - : ServiceFramework{system_, "ahid:hdr"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetDeviceEntries"}, - {1, nullptr, "GetDeviceList"}, - {2, nullptr, "GetDeviceParameters"}, - {3, nullptr, "AttachDevice"}, - {4, nullptr, "DetachDevice"}, - {5, nullptr, "SetDeviceFilter"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "ahid:hdr"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetDeviceEntries"}, + FunctionInfo{1, nullptr, "GetDeviceList"}, + FunctionInfo{2, nullptr, "GetDeviceParameters"}, + FunctionInfo{3, nullptr, "AttachDevice"}, + FunctionInfo{4, nullptr, "DetachDevice"}, + FunctionInfo{5, nullptr, "SetDeviceFilter"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~AHID_HDR() override = default; }; +class IHidDebugServer final : public ServiceFramework { +public: + explicit IHidDebugServer(Core::System& system_, std::shared_ptr resource, + std::shared_ptr settings) + : ServiceFramework{system_, "hid:dbg"} + , resource_manager{resource} + , firmware_settings{settings} + {} + + ~IHidDebugServer() override = default; + + Result DeactivateTouchScreen() { + LOG_INFO(Service_HID, "called"); + + if (!firmware_settings->IsDeviceManaged()) { + R_RETURN(GetResourceManager()->GetTouchScreen()->Deactivate()); + } + + R_SUCCEED(); + } + + Result SetTouchScreenAutoPilotState( + InArray auto_pilot_buffer) { + AutoPilotState auto_pilot{}; + + auto_pilot.count = + static_cast((std::min)(auto_pilot_buffer.size(), auto_pilot.state.size())); + memcpy(auto_pilot.state.data(), auto_pilot_buffer.data(), + auto_pilot.count * sizeof(TouchState)); + + LOG_INFO(Service_HID, "called, auto_pilot_count={}", auto_pilot.count); + + R_RETURN(GetResourceManager()->GetTouchScreen()->SetTouchScreenAutoPilotState(auto_pilot)); + } + + Result UnsetTouchScreenAutoPilotState() { + LOG_INFO(Service_HID, "called"); + R_RETURN(GetResourceManager()->GetTouchScreen()->UnsetTouchScreenAutoPilotState()); + } + + Result GetTouchScreenConfiguration( + Out out_touchscreen_config, + ClientAppletResourceUserId aruid) { + LOG_INFO(Service_HID, "called, applet_resource_user_id={}", aruid.pid); + + R_TRY(GetResourceManager()->GetTouchScreen()->GetTouchScreenConfiguration( + *out_touchscreen_config, aruid.pid)); + + if (out_touchscreen_config->mode != Core::HID::TouchScreenModeForNx::Heat2 && + out_touchscreen_config->mode != Core::HID::TouchScreenModeForNx::Finger) { + out_touchscreen_config->mode = Core::HID::TouchScreenModeForNx::UseSystemSetting; + } + + R_SUCCEED(); + } + + Result ProcessTouchScreenAutoTune() { + LOG_INFO(Service_HID, "called"); + R_RETURN(GetResourceManager()->GetTouchScreen()->ProcessTouchScreenAutoTune()); + } + + Result ForceStopTouchScreenManagement() { + LOG_INFO(Service_HID, "called"); + + if (!firmware_settings->IsDeviceManaged()) { + R_SUCCEED(); + } + + auto touch_screen = GetResourceManager()->GetTouchScreen(); + auto gesture = GetResourceManager()->GetGesture(); + + if (firmware_settings->IsTouchI2cManaged()) { + bool is_touch_active{}; + bool is_gesture_active{}; + R_TRY(touch_screen->IsActive(is_touch_active)); + R_TRY(gesture->IsActive(is_gesture_active)); + + if (is_touch_active) { + R_TRY(touch_screen->Deactivate()); + } + if (is_gesture_active) { + R_TRY(gesture->Deactivate()); + } + } + + R_SUCCEED(); + } + + Result ForceRestartTouchScreenManagement(u32 basic_gesture_id, + ClientAppletResourceUserId aruid) { + LOG_INFO(Service_HID, "called, basic_gesture_id={}, applet_resource_user_id={}", + basic_gesture_id, aruid.pid); + + auto touch_screen = GetResourceManager()->GetTouchScreen(); + auto gesture = GetResourceManager()->GetGesture(); + + if (firmware_settings->IsDeviceManaged() && firmware_settings->IsTouchI2cManaged()) { + R_TRY(gesture->Activate()); + R_TRY(gesture->Activate(aruid.pid, basic_gesture_id)); + R_TRY(touch_screen->Activate()); + R_TRY(touch_screen->Activate(aruid.pid)); + } + + R_SUCCEED(); + } + + Result IsTouchScreenManaged(Out out_is_managed) { + LOG_INFO(Service_HID, "called"); + + bool is_touch_active{}; + bool is_gesture_active{}; + R_TRY(GetResourceManager()->GetTouchScreen()->IsActive(is_touch_active)); + R_TRY(GetResourceManager()->GetGesture()->IsActive(is_gesture_active)); + + *out_is_managed = is_touch_active || is_gesture_active; + R_SUCCEED(); + } + + Result DeactivateGesture() { + LOG_INFO(Service_HID, "called"); + + if (!firmware_settings->IsDeviceManaged()) { + R_RETURN(GetResourceManager()->GetGesture()->Deactivate()); + } + + R_SUCCEED(); + } + + std::shared_ptr GetResourceManager() { + resource_manager->Initialize(); + return resource_manager; + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "DeactivateDebugPad"}, + FunctionInfo{1, nullptr, "SetDebugPadAutoPilotState"}, + FunctionInfo{2, nullptr, "UnsetDebugPadAutoPilotState"}, + FunctionInfo{10, C<&IHidDebugServer::DeactivateTouchScreen>, "DeactivateTouchScreen"}, + FunctionInfo{11, C<&IHidDebugServer::SetTouchScreenAutoPilotState>, "SetTouchScreenAutoPilotState"}, + FunctionInfo{12, C<&IHidDebugServer::UnsetTouchScreenAutoPilotState>, "UnsetTouchScreenAutoPilotState"}, + FunctionInfo{13, C<&IHidDebugServer::GetTouchScreenConfiguration>, "GetTouchScreenConfiguration"}, + FunctionInfo{14, C<&IHidDebugServer::ProcessTouchScreenAutoTune>, "ProcessTouchScreenAutoTune"}, + FunctionInfo{15, C<&IHidDebugServer::ForceStopTouchScreenManagement>, "ForceStopTouchScreenManagement"}, + FunctionInfo{16, C<&IHidDebugServer::ForceRestartTouchScreenManagement>, "ForceRestartTouchScreenManagement"}, + FunctionInfo{17, C<&IHidDebugServer::IsTouchScreenManaged>, "IsTouchScreenManaged"}, + FunctionInfo{20, nullptr, "DeactivateMouse"}, + FunctionInfo{21, nullptr, "SetMouseAutoPilotState"}, + FunctionInfo{22, nullptr, "UnsetMouseAutoPilotState"}, + FunctionInfo{23, nullptr, "AddMouseSideWheelDelta"}, + FunctionInfo{25, nullptr, "SetDebugMouseAutoPilotState"}, + FunctionInfo{26, nullptr, "UnsetDebugMouseAutoPilotState"}, + FunctionInfo{30, nullptr, "DeactivateKeyboard"}, + FunctionInfo{31, nullptr, "SetKeyboardAutoPilotState"}, + FunctionInfo{32, nullptr, "UnsetKeyboardAutoPilotState"}, + FunctionInfo{50, nullptr, "DeactivateXpad"}, + FunctionInfo{51, nullptr, "SetXpadAutoPilotState"}, + FunctionInfo{52, nullptr, "UnsetXpadAutoPilotState"}, + FunctionInfo{53, nullptr, "DeactivateJoyXpad"}, + FunctionInfo{60, nullptr, "ClearNpadSystemCommonPolicy"}, + FunctionInfo{61, nullptr, "DeactivateNpad"}, + FunctionInfo{62, nullptr, "ForceDisconnectNpad"}, + FunctionInfo{91, C<&IHidDebugServer::DeactivateGesture>, "DeactivateGesture"}, + FunctionInfo{110, nullptr, "DeactivateHomeButton"}, + FunctionInfo{111, nullptr, "SetHomeButtonAutoPilotState"}, + FunctionInfo{112, nullptr, "UnsetHomeButtonAutoPilotState"}, + FunctionInfo{120, nullptr, "DeactivateSleepButton"}, + FunctionInfo{121, nullptr, "SetSleepButtonAutoPilotState"}, + FunctionInfo{122, nullptr, "UnsetSleepButtonAutoPilotState"}, + FunctionInfo{123, nullptr, "DeactivateInputDetector"}, + FunctionInfo{130, nullptr, "DeactivateCaptureButton"}, + FunctionInfo{131, nullptr, "SetCaptureButtonAutoPilotState"}, + FunctionInfo{132, nullptr, "UnsetCaptureButtonAutoPilotState"}, + FunctionInfo{133, nullptr, "SetShiftAccelerometerCalibrationValue"}, + FunctionInfo{134, nullptr, "GetShiftAccelerometerCalibrationValue"}, + FunctionInfo{135, nullptr, "SetShiftGyroscopeCalibrationValue"}, + FunctionInfo{136, nullptr, "GetShiftGyroscopeCalibrationValue"}, + FunctionInfo{140, nullptr, "DeactivateConsoleSixAxisSensor"}, + FunctionInfo{141, nullptr, "GetConsoleSixAxisSensorSamplingFrequency"}, + FunctionInfo{142, nullptr, "DeactivateSevenSixAxisSensor"}, + FunctionInfo{143, nullptr, "GetConsoleSixAxisSensorCountStates"}, + FunctionInfo{144, nullptr, "GetAccelerometerFsr"}, + FunctionInfo{145, nullptr, "SetAccelerometerFsr"}, + FunctionInfo{146, nullptr, "GetAccelerometerOdr"}, + FunctionInfo{147, nullptr, "SetAccelerometerOdr"}, + FunctionInfo{148, nullptr, "GetGyroscopeFsr"}, + FunctionInfo{149, nullptr, "SetGyroscopeFsr"}, + FunctionInfo{150, nullptr, "GetGyroscopeOdr"}, + FunctionInfo{151, nullptr, "SetGyroscopeOdr"}, + FunctionInfo{152, nullptr, "GetWhoAmI"}, + FunctionInfo{201, nullptr, "ActivateFirmwareUpdate"}, + FunctionInfo{202, nullptr, "DeactivateFirmwareUpdate"}, + FunctionInfo{203, nullptr, "StartFirmwareUpdate"}, + FunctionInfo{204, nullptr, "GetFirmwareUpdateStage"}, + FunctionInfo{205, nullptr, "GetFirmwareVersion"}, + FunctionInfo{206, nullptr, "GetDestinationFirmwareVersion"}, + FunctionInfo{207, nullptr, "DiscardFirmwareInfoCacheForRevert"}, + FunctionInfo{208, nullptr, "StartFirmwareUpdateForRevert"}, + FunctionInfo{209, nullptr, "GetAvailableFirmwareVersionForRevert"}, + FunctionInfo{210, nullptr, "IsFirmwareUpdatingDevice"}, + FunctionInfo{211, nullptr, "StartFirmwareUpdateIndividual"}, + FunctionInfo{212, nullptr, "GetDetailFirmwareVersion", MakeVersionGate({19,0,0})}, + FunctionInfo{215, nullptr, "SetUsbFirmwareForceUpdateEnabled"}, + FunctionInfo{216, nullptr, "SetAllKuinaDevicesToFirmwareUpdateMode"}, + FunctionInfo{221, nullptr, "UpdateControllerColor"}, + FunctionInfo{222, nullptr, "ConnectUsbPadsAsync"}, + FunctionInfo{223, nullptr, "DisconnectUsbPadsAsync"}, + FunctionInfo{224, nullptr, "UpdateDesignInfo"}, + FunctionInfo{225, nullptr, "GetUniquePadDriverState"}, + FunctionInfo{226, nullptr, "GetSixAxisSensorDriverStates"}, + FunctionInfo{227, nullptr, "GetRxPacketHistory"}, + FunctionInfo{228, nullptr, "AcquireOperationEventHandle"}, + FunctionInfo{229, nullptr, "ReadSerialFlash"}, + FunctionInfo{230, nullptr, "WriteSerialFlash"}, + FunctionInfo{231, nullptr, "GetOperationResult"}, + FunctionInfo{232, nullptr, "EnableShipmentMode"}, + FunctionInfo{233, nullptr, "ClearPairingInfo"}, + FunctionInfo{234, nullptr, "GetUniquePadDeviceTypeSetInternal"}, + FunctionInfo{235, nullptr, "EnableAnalogStickPower"}, + FunctionInfo{236, nullptr, "RequestKuinaUartClockCal"}, + FunctionInfo{237, nullptr, "GetKuinaUartClockCal"}, + FunctionInfo{238, nullptr, "SetKuinaUartClockTrim"}, + FunctionInfo{239, nullptr, "KuinaLoopbackTest"}, + FunctionInfo{240, nullptr, "RequestBatteryVoltage"}, + FunctionInfo{241, nullptr, "GetBatteryVoltage"}, + FunctionInfo{242, nullptr, "GetUniquePadPowerInfo"}, + FunctionInfo{243, nullptr, "RebootUniquePad"}, + FunctionInfo{244, nullptr, "RequestKuinaFirmwareVersion"}, + FunctionInfo{245, nullptr, "GetKuinaFirmwareVersion"}, + FunctionInfo{246, nullptr, "GetVidPid"}, + FunctionInfo{247, nullptr, "GetAnalogStickCalibrationValue"}, + FunctionInfo{248, nullptr, "GetUniquePadIdsFull"}, + FunctionInfo{249, nullptr, "ConnectUniquePad"}, + FunctionInfo{250, nullptr, "IsVirtual"}, + FunctionInfo{251, nullptr, "GetAnalogStickModuleParam"}, + FunctionInfo{253, nullptr, "ClearStorageForShipment", MakeVersionGate({19,0,0})}, + FunctionInfo{261, nullptr, "UpdateDesignInfo12", MakeVersionGate({21,0,0})}, + FunctionInfo{262, nullptr, "GetUniquePadButtonCount", MakeVersionGate({21,0,0})}, + FunctionInfo{267, nullptr, "SetAnalogStickCalibration", MakeVersionGate({21,0,0})}, + FunctionInfo{268, nullptr, "ResetAnalogStickCalibration", MakeVersionGate({21,0,0})}, + FunctionInfo{301, nullptr, "GetAbstractedPadHandles"}, + FunctionInfo{302, nullptr, "GetAbstractedPadState"}, + FunctionInfo{303, nullptr, "GetAbstractedPadsState"}, + FunctionInfo{321, nullptr, "SetAutoPilotVirtualPadState"}, + FunctionInfo{322, nullptr, "UnsetAutoPilotVirtualPadState"}, + FunctionInfo{323, nullptr, "UnsetAllAutoPilotVirtualPadState"}, + FunctionInfo{324, nullptr, "AttachHdlsWorkBuffer"}, + FunctionInfo{325, nullptr, "ReleaseHdlsWorkBuffer"}, + FunctionInfo{326, nullptr, "DumpHdlsNpadAssignmentState"}, + FunctionInfo{327, nullptr, "DumpHdlsStates"}, + FunctionInfo{328, nullptr, "ApplyHdlsNpadAssignmentState"}, + FunctionInfo{329, nullptr, "ApplyHdlsStateList"}, + FunctionInfo{330, nullptr, "AttachHdlsVirtualDevice"}, + FunctionInfo{331, nullptr, "DetachHdlsVirtualDevice"}, + FunctionInfo{332, nullptr, "SetHdlsState"}, + FunctionInfo{350, nullptr, "AddRegisteredDevice"}, + FunctionInfo{351, nullptr, "GetRegisteredDevicesCountDebug", MakeVersionGate({17,0,0}, {18,1,0})}, + FunctionInfo{352, nullptr, "DeleteRegisteredDevicesDebug", MakeVersionGate({17,0,0}, {18,1,0})}, + FunctionInfo{400, nullptr, "DisableExternalMcuOnNxDevice"}, + FunctionInfo{401, nullptr, "DisableRailDeviceFiltering"}, + FunctionInfo{402, nullptr, "EnableWiredPairing"}, + FunctionInfo{403, nullptr, "EnableShipmentModeAutoClear"}, + FunctionInfo{404, nullptr, "SetRailEnabled"}, + FunctionInfo{500, nullptr, "SetFactoryInt"}, + FunctionInfo{501, nullptr, "IsFactoryBootEnabled"}, + FunctionInfo{550, nullptr, "SetAnalogStickModelDataTemporarily"}, + FunctionInfo{551, nullptr, "GetAnalogStickModelData"}, + FunctionInfo{552, nullptr, "ResetAnalogStickModelData"}, + FunctionInfo{600, nullptr, "ConvertPadState"}, + FunctionInfo{601, nullptr, "IsButtonConfigSupported", MakeVersionGate({18,0,0})}, + FunctionInfo{602, nullptr, "IsButtonConfigEmbeddedSupported", MakeVersionGate({18,0,0})}, + FunctionInfo{603, nullptr, "DeleteButtonConfig", MakeVersionGate({18,0,0})}, + FunctionInfo{604, nullptr, "DeleteButtonConfigEmbedded", MakeVersionGate({18,0,0})}, + FunctionInfo{605, nullptr, "SetButtonConfigEnabled", MakeVersionGate({18,0,0})}, + FunctionInfo{606, nullptr, "SetButtonConfigEmbeddedEnabled", MakeVersionGate({18,0,0})}, + FunctionInfo{607, nullptr, "IsButtonConfigEnabled", MakeVersionGate({18,0,0})}, + FunctionInfo{608, nullptr, "IsButtonConfigEmbeddedEnabled", MakeVersionGate({18,0,0})}, + FunctionInfo{609, nullptr, "SetButtonConfigEmbedded", MakeVersionGate({18,0,0})}, + FunctionInfo{610, nullptr, "SetButtonConfigFull", MakeVersionGate({18,0,0})}, + FunctionInfo{611, nullptr, "SetButtonConfigLeft", MakeVersionGate({18,0,0})}, + FunctionInfo{612, nullptr, "SetButtonConfigRight", MakeVersionGate({18,0,0})}, + FunctionInfo{613, nullptr, "GetButtonConfigEmbedded", MakeVersionGate({18,0,0})}, + FunctionInfo{614, nullptr, "GetButtonConfigFull", MakeVersionGate({18,0,0})}, + FunctionInfo{615, nullptr, "GetButtonConfigLeft", MakeVersionGate({18,0,0})}, + FunctionInfo{616, nullptr, "GetButtonConfigRight", MakeVersionGate({18,0,0})}, + FunctionInfo{650, nullptr, "AddButtonPlayData"}, + FunctionInfo{651, nullptr, "StartButtonPlayData"}, + FunctionInfo{652, nullptr, "StopButtonPlayData"}, + FunctionInfo{700, nullptr, "GetRailAttachEventCount", MakeVersionGate({21,0,0})}, + FunctionInfo{2000, nullptr, "DeactivateDigitizer"}, + FunctionInfo{2001, nullptr, "SetDigitizerAutoPilotState"}, + FunctionInfo{2002, nullptr, "UnsetDigitizerAutoPilotState"}, + FunctionInfo{3000, nullptr, "ReloadFirmwareDebugSettings"} + ); + std::shared_ptr resource_manager; + std::shared_ptr firmware_settings; +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); auto firmware_settings = std::make_shared(system); diff --git a/src/core/hle/service/hid/hid_debug_server.cpp b/src/core/hle/service/hid/hid_debug_server.cpp index 43fe0f3a19..091d09dae5 100644 --- a/src/core/hle/service/hid/hid_debug_server.cpp +++ b/src/core/hle/service/hid/hid_debug_server.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project @@ -18,298 +18,4 @@ namespace Service::HID { -IHidDebugServer::IHidDebugServer(Core::System& system_, std::shared_ptr resource, - std::shared_ptr settings) - : ServiceFramework{system_, "hid:dbg"}, resource_manager{resource}, firmware_settings{ - settings} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "DeactivateDebugPad"}, - {1, nullptr, "SetDebugPadAutoPilotState"}, - {2, nullptr, "UnsetDebugPadAutoPilotState"}, - {10, C<&IHidDebugServer::DeactivateTouchScreen>, "DeactivateTouchScreen"}, - {11, C<&IHidDebugServer::SetTouchScreenAutoPilotState>, "SetTouchScreenAutoPilotState"}, - {12, C<&IHidDebugServer::UnsetTouchScreenAutoPilotState>, "UnsetTouchScreenAutoPilotState"}, - {13, C<&IHidDebugServer::GetTouchScreenConfiguration>, "GetTouchScreenConfiguration"}, - {14, C<&IHidDebugServer::ProcessTouchScreenAutoTune>, "ProcessTouchScreenAutoTune"}, - {15, C<&IHidDebugServer::ForceStopTouchScreenManagement>, "ForceStopTouchScreenManagement"}, - {16, C<&IHidDebugServer::ForceRestartTouchScreenManagement>, "ForceRestartTouchScreenManagement"}, - {17, C<&IHidDebugServer::IsTouchScreenManaged>, "IsTouchScreenManaged"}, - {20, nullptr, "DeactivateMouse"}, - {21, nullptr, "SetMouseAutoPilotState"}, - {22, nullptr, "UnsetMouseAutoPilotState"}, - {23, nullptr, "AddMouseSideWheelDelta"}, - {25, nullptr, "SetDebugMouseAutoPilotState"}, - {26, nullptr, "UnsetDebugMouseAutoPilotState"}, - {30, nullptr, "DeactivateKeyboard"}, - {31, nullptr, "SetKeyboardAutoPilotState"}, - {32, nullptr, "UnsetKeyboardAutoPilotState"}, - {50, nullptr, "DeactivateXpad"}, - {51, nullptr, "SetXpadAutoPilotState"}, - {52, nullptr, "UnsetXpadAutoPilotState"}, - {53, nullptr, "DeactivateJoyXpad"}, - {60, nullptr, "ClearNpadSystemCommonPolicy"}, - {61, nullptr, "DeactivateNpad"}, - {62, nullptr, "ForceDisconnectNpad"}, - {91, C<&IHidDebugServer::DeactivateGesture>, "DeactivateGesture"}, - {110, nullptr, "DeactivateHomeButton"}, - {111, nullptr, "SetHomeButtonAutoPilotState"}, - {112, nullptr, "UnsetHomeButtonAutoPilotState"}, - {120, nullptr, "DeactivateSleepButton"}, - {121, nullptr, "SetSleepButtonAutoPilotState"}, - {122, nullptr, "UnsetSleepButtonAutoPilotState"}, - {123, nullptr, "DeactivateInputDetector"}, - {130, nullptr, "DeactivateCaptureButton"}, - {131, nullptr, "SetCaptureButtonAutoPilotState"}, - {132, nullptr, "UnsetCaptureButtonAutoPilotState"}, - {133, nullptr, "SetShiftAccelerometerCalibrationValue"}, - {134, nullptr, "GetShiftAccelerometerCalibrationValue"}, - {135, nullptr, "SetShiftGyroscopeCalibrationValue"}, - {136, nullptr, "GetShiftGyroscopeCalibrationValue"}, - {140, nullptr, "DeactivateConsoleSixAxisSensor"}, - {141, nullptr, "GetConsoleSixAxisSensorSamplingFrequency"}, - {142, nullptr, "DeactivateSevenSixAxisSensor"}, - {143, nullptr, "GetConsoleSixAxisSensorCountStates"}, - {144, nullptr, "GetAccelerometerFsr"}, - {145, nullptr, "SetAccelerometerFsr"}, - {146, nullptr, "GetAccelerometerOdr"}, - {147, nullptr, "SetAccelerometerOdr"}, - {148, nullptr, "GetGyroscopeFsr"}, - {149, nullptr, "SetGyroscopeFsr"}, - {150, nullptr, "GetGyroscopeOdr"}, - {151, nullptr, "SetGyroscopeOdr"}, - {152, nullptr, "GetWhoAmI"}, - {201, nullptr, "ActivateFirmwareUpdate"}, - {202, nullptr, "DeactivateFirmwareUpdate"}, - {203, nullptr, "StartFirmwareUpdate"}, - {204, nullptr, "GetFirmwareUpdateStage"}, - {205, nullptr, "GetFirmwareVersion"}, - {206, nullptr, "GetDestinationFirmwareVersion"}, - {207, nullptr, "DiscardFirmwareInfoCacheForRevert"}, - {208, nullptr, "StartFirmwareUpdateForRevert"}, - {209, nullptr, "GetAvailableFirmwareVersionForRevert"}, - {210, nullptr, "IsFirmwareUpdatingDevice"}, - {211, nullptr, "StartFirmwareUpdateIndividual"}, - {212, nullptr, "GetDetailFirmwareVersion"}, // 19.0.0+ - {215, nullptr, "SetUsbFirmwareForceUpdateEnabled"}, - {216, nullptr, "SetAllKuinaDevicesToFirmwareUpdateMode"}, - {221, nullptr, "UpdateControllerColor"}, - {222, nullptr, "ConnectUsbPadsAsync"}, - {223, nullptr, "DisconnectUsbPadsAsync"}, - {224, nullptr, "UpdateDesignInfo"}, - {225, nullptr, "GetUniquePadDriverState"}, - {226, nullptr, "GetSixAxisSensorDriverStates"}, - {227, nullptr, "GetRxPacketHistory"}, - {228, nullptr, "AcquireOperationEventHandle"}, - {229, nullptr, "ReadSerialFlash"}, - {230, nullptr, "WriteSerialFlash"}, - {231, nullptr, "GetOperationResult"}, - {232, nullptr, "EnableShipmentMode"}, - {233, nullptr, "ClearPairingInfo"}, - {234, nullptr, "GetUniquePadDeviceTypeSetInternal"}, - {235, nullptr, "EnableAnalogStickPower"}, - {236, nullptr, "RequestKuinaUartClockCal"}, - {237, nullptr, "GetKuinaUartClockCal"}, - {238, nullptr, "SetKuinaUartClockTrim"}, - {239, nullptr, "KuinaLoopbackTest"}, - {240, nullptr, "RequestBatteryVoltage"}, - {241, nullptr, "GetBatteryVoltage"}, - {242, nullptr, "GetUniquePadPowerInfo"}, - {243, nullptr, "RebootUniquePad"}, - {244, nullptr, "RequestKuinaFirmwareVersion"}, - {245, nullptr, "GetKuinaFirmwareVersion"}, - {246, nullptr, "GetVidPid"}, - {247, nullptr, "GetAnalogStickCalibrationValue"}, - {248, nullptr, "GetUniquePadIdsFull"}, - {249, nullptr, "ConnectUniquePad"}, - {250, nullptr, "IsVirtual"}, - {251, nullptr, "GetAnalogStickModuleParam"}, - {253, nullptr, "ClearStorageForShipment"}, //19.0.0+ - {261, nullptr, "UpdateDesignInfo12"}, //21.0.0+ - {262, nullptr, "GetUniquePadButtonCount"}, //21.0.0+ - {267, nullptr, "SetAnalogStickCalibration"}, //21.0.0+ - {268, nullptr, "ResetAnalogStickCalibration"}, //21.0.0+ - {301, nullptr, "GetAbstractedPadHandles"}, - {302, nullptr, "GetAbstractedPadState"}, - {303, nullptr, "GetAbstractedPadsState"}, - {321, nullptr, "SetAutoPilotVirtualPadState"}, - {322, nullptr, "UnsetAutoPilotVirtualPadState"}, - {323, nullptr, "UnsetAllAutoPilotVirtualPadState"}, - {324, nullptr, "AttachHdlsWorkBuffer"}, - {325, nullptr, "ReleaseHdlsWorkBuffer"}, - {326, nullptr, "DumpHdlsNpadAssignmentState"}, - {327, nullptr, "DumpHdlsStates"}, - {328, nullptr, "ApplyHdlsNpadAssignmentState"}, - {329, nullptr, "ApplyHdlsStateList"}, - {330, nullptr, "AttachHdlsVirtualDevice"}, - {331, nullptr, "DetachHdlsVirtualDevice"}, - {332, nullptr, "SetHdlsState"}, - {350, nullptr, "AddRegisteredDevice"}, - {351, nullptr, "GetRegisteredDevicesCountDebug"}, //17.0.0-18.1.0 - {352, nullptr, "DeleteRegisteredDevicesDebug"}, //17.0.0-18.1.0 - {400, nullptr, "DisableExternalMcuOnNxDevice"}, - {401, nullptr, "DisableRailDeviceFiltering"}, - {402, nullptr, "EnableWiredPairing"}, - {403, nullptr, "EnableShipmentModeAutoClear"}, - {404, nullptr, "SetRailEnabled"}, - {500, nullptr, "SetFactoryInt"}, - {501, nullptr, "IsFactoryBootEnabled"}, - {550, nullptr, "SetAnalogStickModelDataTemporarily"}, - {551, nullptr, "GetAnalogStickModelData"}, - {552, nullptr, "ResetAnalogStickModelData"}, - {600, nullptr, "ConvertPadState"}, - {601, nullptr, "IsButtonConfigSupported"}, //18.0.0+ - {602, nullptr, "IsButtonConfigEmbeddedSupported"}, //18.0.0+ - {603, nullptr, "DeleteButtonConfig"}, //18.0.0+ - {604, nullptr, "DeleteButtonConfigEmbedded"}, //18.0.0+ - {605, nullptr, "SetButtonConfigEnabled"}, //18.0.0+ - {606, nullptr, "SetButtonConfigEmbeddedEnabled"}, //18.0.0+ - {607, nullptr, "IsButtonConfigEnabled"}, //18.0.0+ - {608, nullptr, "IsButtonConfigEmbeddedEnabled"}, //18.0.0+ - {609, nullptr, "SetButtonConfigEmbedded"}, //18.0.0+ - {610, nullptr, "SetButtonConfigFull"}, //18.0.0+ - {611, nullptr, "SetButtonConfigLeft"}, //18.0.0+ - {612, nullptr, "SetButtonConfigRight"}, //18.0.0+ - {613, nullptr, "GetButtonConfigEmbedded"}, //18.0.0+ - {614, nullptr, "GetButtonConfigFull"}, //18.0.0+ - {615, nullptr, "GetButtonConfigLeft"}, //18.0.0+ - {616, nullptr, "GetButtonConfigRight"}, //18.0.0+ - {650, nullptr, "AddButtonPlayData"}, - {651, nullptr, "StartButtonPlayData"}, - {652, nullptr, "StopButtonPlayData"}, - {700, nullptr, "GetRailAttachEventCount"}, //21.0.0+ - {2000, nullptr, "DeactivateDigitizer"}, - {2001, nullptr, "SetDigitizerAutoPilotState"}, - {2002, nullptr, "UnsetDigitizerAutoPilotState"}, - {3000, nullptr, "ReloadFirmwareDebugSettings"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IHidDebugServer::~IHidDebugServer() = default; - -Result IHidDebugServer::DeactivateTouchScreen() { - LOG_INFO(Service_HID, "called"); - - if (!firmware_settings->IsDeviceManaged()) { - R_RETURN(GetResourceManager()->GetTouchScreen()->Deactivate()); - } - - R_SUCCEED(); -} - -Result IHidDebugServer::SetTouchScreenAutoPilotState( - InArray auto_pilot_buffer) { - AutoPilotState auto_pilot{}; - - auto_pilot.count = - static_cast((std::min)(auto_pilot_buffer.size(), auto_pilot.state.size())); - memcpy(auto_pilot.state.data(), auto_pilot_buffer.data(), - auto_pilot.count * sizeof(TouchState)); - - LOG_INFO(Service_HID, "called, auto_pilot_count={}", auto_pilot.count); - - R_RETURN(GetResourceManager()->GetTouchScreen()->SetTouchScreenAutoPilotState(auto_pilot)); -} - -Result IHidDebugServer::UnsetTouchScreenAutoPilotState() { - LOG_INFO(Service_HID, "called"); - R_RETURN(GetResourceManager()->GetTouchScreen()->UnsetTouchScreenAutoPilotState()); -} - -Result IHidDebugServer::GetTouchScreenConfiguration( - Out out_touchscreen_config, - ClientAppletResourceUserId aruid) { - LOG_INFO(Service_HID, "called, applet_resource_user_id={}", aruid.pid); - - R_TRY(GetResourceManager()->GetTouchScreen()->GetTouchScreenConfiguration( - *out_touchscreen_config, aruid.pid)); - - if (out_touchscreen_config->mode != Core::HID::TouchScreenModeForNx::Heat2 && - out_touchscreen_config->mode != Core::HID::TouchScreenModeForNx::Finger) { - out_touchscreen_config->mode = Core::HID::TouchScreenModeForNx::UseSystemSetting; - } - - R_SUCCEED(); -} - -Result IHidDebugServer::ProcessTouchScreenAutoTune() { - LOG_INFO(Service_HID, "called"); - R_RETURN(GetResourceManager()->GetTouchScreen()->ProcessTouchScreenAutoTune()); -} - -Result IHidDebugServer::ForceStopTouchScreenManagement() { - LOG_INFO(Service_HID, "called"); - - if (!firmware_settings->IsDeviceManaged()) { - R_SUCCEED(); - } - - auto touch_screen = GetResourceManager()->GetTouchScreen(); - auto gesture = GetResourceManager()->GetGesture(); - - if (firmware_settings->IsTouchI2cManaged()) { - bool is_touch_active{}; - bool is_gesture_active{}; - R_TRY(touch_screen->IsActive(is_touch_active)); - R_TRY(gesture->IsActive(is_gesture_active)); - - if (is_touch_active) { - R_TRY(touch_screen->Deactivate()); - } - if (is_gesture_active) { - R_TRY(gesture->Deactivate()); - } - } - - R_SUCCEED(); -} - -Result IHidDebugServer::ForceRestartTouchScreenManagement(u32 basic_gesture_id, - ClientAppletResourceUserId aruid) { - LOG_INFO(Service_HID, "called, basic_gesture_id={}, applet_resource_user_id={}", - basic_gesture_id, aruid.pid); - - auto touch_screen = GetResourceManager()->GetTouchScreen(); - auto gesture = GetResourceManager()->GetGesture(); - - if (firmware_settings->IsDeviceManaged() && firmware_settings->IsTouchI2cManaged()) { - R_TRY(gesture->Activate()); - R_TRY(gesture->Activate(aruid.pid, basic_gesture_id)); - R_TRY(touch_screen->Activate()); - R_TRY(touch_screen->Activate(aruid.pid)); - } - - R_SUCCEED(); -} - -Result IHidDebugServer::IsTouchScreenManaged(Out out_is_managed) { - LOG_INFO(Service_HID, "called"); - - bool is_touch_active{}; - bool is_gesture_active{}; - R_TRY(GetResourceManager()->GetTouchScreen()->IsActive(is_touch_active)); - R_TRY(GetResourceManager()->GetGesture()->IsActive(is_gesture_active)); - - *out_is_managed = is_touch_active || is_gesture_active; - R_SUCCEED(); -} - -Result IHidDebugServer::DeactivateGesture() { - LOG_INFO(Service_HID, "called"); - - if (!firmware_settings->IsDeviceManaged()) { - R_RETURN(GetResourceManager()->GetGesture()->Deactivate()); - } - - R_SUCCEED(); -} - -std::shared_ptr IHidDebugServer::GetResourceManager() { - resource_manager->Initialize(); - return resource_manager; -} - } // namespace Service::HID diff --git a/src/core/hle/service/hid/hid_debug_server.h b/src/core/hle/service/hid/hid_debug_server.h index 3a483f07e5..20cc1ed541 100644 --- a/src/core/hle/service/hid/hid_debug_server.h +++ b/src/core/hle/service/hid/hid_debug_server.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -15,31 +18,5 @@ namespace Service::HID { class ResourceManager; class HidFirmwareSettings; -class IHidDebugServer final : public ServiceFramework { -public: - explicit IHidDebugServer(Core::System& system_, std::shared_ptr resource, - std::shared_ptr settings); - ~IHidDebugServer() override; - -private: - Result DeactivateTouchScreen(); - Result SetTouchScreenAutoPilotState( - InArray auto_pilot_buffer); - Result UnsetTouchScreenAutoPilotState(); - Result GetTouchScreenConfiguration( - Out out_touchscreen_config, - ClientAppletResourceUserId aruid); - Result ProcessTouchScreenAutoTune(); - Result ForceStopTouchScreenManagement(); - Result ForceRestartTouchScreenManagement(u32 basic_gesture_id, - ClientAppletResourceUserId aruid); - Result IsTouchScreenManaged(Out out_is_managed); - Result DeactivateGesture(); - - std::shared_ptr GetResourceManager(); - - std::shared_ptr resource_manager; - std::shared_ptr firmware_settings; -}; } // namespace Service::HID diff --git a/src/core/hle/service/hid/hid_server.cpp b/src/core/hle/service/hid/hid_server.cpp index 9689bce8dd..18e57628d0 100644 --- a/src/core/hle/service/hid/hid_server.cpp +++ b/src/core/hle/service/hid/hid_server.cpp @@ -42,207 +42,207 @@ namespace Service::HID { +std::optional IHidServer::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IHidServer::CreateAppletResource>, "CreateAppletResource"}, + FunctionInfo{1, C<&IHidServer::ActivateDebugPad>, "ActivateDebugPad"}, + FunctionInfo{11, C<&IHidServer::ActivateTouchScreen>, "ActivateTouchScreen"}, + FunctionInfo{21, C<&IHidServer::ActivateMouse>, "ActivateMouse"}, + FunctionInfo{26, C<&IHidServer::ActivateDebugMouse>, "ActivateDebugMouse"}, + FunctionInfo{31, C<&IHidServer::ActivateKeyboard>, "ActivateKeyboard"}, + FunctionInfo{32, C<&IHidServer::SendKeyboardLockKeyEvent>, "SendKeyboardLockKeyEvent"}, + FunctionInfo{40, C<&IHidServer::AcquireXpadIdEventHandle>, "AcquireXpadIdEventHandle"}, + FunctionInfo{41, C<&IHidServer::ReleaseXpadIdEventHandle>, "ReleaseXpadIdEventHandle"}, + FunctionInfo{51, C<&IHidServer::ActivateXpad>, "ActivateXpad"}, + FunctionInfo{55, C<&IHidServer::GetXpadIds>, "GetXpadIds"}, + FunctionInfo{56, C<&IHidServer::ActivateJoyXpad>, "ActivateJoyXpad"}, + FunctionInfo{58, C<&IHidServer::GetJoyXpadLifoHandle>, "GetJoyXpadLifoHandle"}, + FunctionInfo{59, C<&IHidServer::GetJoyXpadIds>, "GetJoyXpadIds"}, + FunctionInfo{60, C<&IHidServer::ActivateSixAxisSensor>, "ActivateSixAxisSensor"}, + FunctionInfo{61, C<&IHidServer::DeactivateSixAxisSensor>, "DeactivateSixAxisSensor"}, + FunctionInfo{62, C<&IHidServer::GetSixAxisSensorLifoHandle>, "GetSixAxisSensorLifoHandle"}, + FunctionInfo{63, C<&IHidServer::ActivateJoySixAxisSensor>, "ActivateJoySixAxisSensor"}, + FunctionInfo{64, C<&IHidServer::DeactivateJoySixAxisSensor>, "DeactivateJoySixAxisSensor"}, + FunctionInfo{65, C<&IHidServer::GetJoySixAxisSensorLifoHandle>, "GetJoySixAxisSensorLifoHandle"}, + FunctionInfo{66, C<&IHidServer::StartSixAxisSensor>, "StartSixAxisSensor"}, + FunctionInfo{67, C<&IHidServer::StopSixAxisSensor>, "StopSixAxisSensor"}, + FunctionInfo{68, C<&IHidServer::IsSixAxisSensorFusionEnabled>, "IsSixAxisSensorFusionEnabled"}, + FunctionInfo{69, C<&IHidServer::EnableSixAxisSensorFusion>, "EnableSixAxisSensorFusion"}, + FunctionInfo{70, C<&IHidServer::SetSixAxisSensorFusionParameters>, "SetSixAxisSensorFusionParameters"}, + FunctionInfo{71, C<&IHidServer::GetSixAxisSensorFusionParameters>, "GetSixAxisSensorFusionParameters"}, + FunctionInfo{72, C<&IHidServer::ResetSixAxisSensorFusionParameters>, "ResetSixAxisSensorFusionParameters"}, + FunctionInfo{73, nullptr, "SetAccelerometerParameters"}, + FunctionInfo{74, nullptr, "GetAccelerometerParameters"}, + FunctionInfo{75, nullptr, "ResetAccelerometerParameters"}, + FunctionInfo{76, nullptr, "SetAccelerometerPlayMode"}, + FunctionInfo{77, nullptr, "GetAccelerometerPlayMode"}, + FunctionInfo{78, nullptr, "ResetAccelerometerPlayMode"}, + FunctionInfo{79, C<&IHidServer::SetGyroscopeZeroDriftMode>, "SetGyroscopeZeroDriftMode"}, + FunctionInfo{80, C<&IHidServer::GetGyroscopeZeroDriftMode>, "GetGyroscopeZeroDriftMode"}, + FunctionInfo{81, C<&IHidServer::ResetGyroscopeZeroDriftMode>, "ResetGyroscopeZeroDriftMode"}, + FunctionInfo{82, C<&IHidServer::IsSixAxisSensorAtRest>, "IsSixAxisSensorAtRest"}, + FunctionInfo{83, C<&IHidServer::IsFirmwareUpdateAvailableForSixAxisSensor>, "IsFirmwareUpdateAvailableForSixAxisSensor"}, + FunctionInfo{84, C<&IHidServer::EnableSixAxisSensorUnalteredPassthrough>, "EnableSixAxisSensorUnalteredPassthrough"}, + FunctionInfo{85, C<&IHidServer::IsSixAxisSensorUnalteredPassthroughEnabled>, "IsSixAxisSensorUnalteredPassthroughEnabled"}, + FunctionInfo{86, nullptr, "StoreSixAxisSensorCalibrationParameter"}, + FunctionInfo{87, C<&IHidServer::LoadSixAxisSensorCalibrationParameter>, "LoadSixAxisSensorCalibrationParameter"}, + FunctionInfo{88, C<&IHidServer::GetSixAxisSensorIcInformation>, "GetSixAxisSensorIcInformation"}, + FunctionInfo{89, C<&IHidServer::ResetIsSixAxisSensorDeviceNewlyAssigned>, "ResetIsSixAxisSensorDeviceNewlyAssigned"}, + FunctionInfo{91, C<&IHidServer::ActivateGesture>, "ActivateGesture"}, + FunctionInfo{92, C<&IHidServer::SetGestureOutputRanges>, "SetGestureOutputRanges"}, + FunctionInfo{100, C<&IHidServer::SetSupportedNpadStyleSet>, "SetSupportedNpadStyleSet"}, + FunctionInfo{101, C<&IHidServer::GetSupportedNpadStyleSet>, "GetSupportedNpadStyleSet"}, + FunctionInfo{102, C<&IHidServer::SetSupportedNpadIdType>, "SetSupportedNpadIdType"}, + FunctionInfo{103, C<&IHidServer::ActivateNpad>, "ActivateNpad"}, + FunctionInfo{104, C<&IHidServer::DeactivateNpad>, "DeactivateNpad"}, + FunctionInfo{106, C<&IHidServer::AcquireNpadStyleSetUpdateEventHandle>, "AcquireNpadStyleSetUpdateEventHandle"}, + FunctionInfo{107, C<&IHidServer::DisconnectNpad>, "DisconnectNpad"}, + FunctionInfo{108, C<&IHidServer::GetPlayerLedPattern>, "GetPlayerLedPattern"}, + FunctionInfo{109, C<&IHidServer::ActivateNpadWithRevision>, "ActivateNpadWithRevision"}, + FunctionInfo{120, C<&IHidServer::SetNpadJoyHoldType>, "SetNpadJoyHoldType"}, + FunctionInfo{121, C<&IHidServer::GetNpadJoyHoldType>, "GetNpadJoyHoldType"}, + FunctionInfo{122, C<&IHidServer::SetNpadJoyAssignmentModeSingleByDefault>, "SetNpadJoyAssignmentModeSingleByDefault"}, + FunctionInfo{123, C<&IHidServer::SetNpadJoyAssignmentModeSingle>, "SetNpadJoyAssignmentModeSingle"}, + FunctionInfo{124, C<&IHidServer::SetNpadJoyAssignmentModeDual>, "SetNpadJoyAssignmentModeDual"}, + FunctionInfo{125, C<&IHidServer::MergeSingleJoyAsDualJoy>, "MergeSingleJoyAsDualJoy"}, + FunctionInfo{126, C<&IHidServer::StartLrAssignmentMode>, "StartLrAssignmentMode"}, + FunctionInfo{127, C<&IHidServer::StopLrAssignmentMode>, "StopLrAssignmentMode"}, + FunctionInfo{128, C<&IHidServer::SetNpadHandheldActivationMode>, "SetNpadHandheldActivationMode"}, + FunctionInfo{129, C<&IHidServer::GetNpadHandheldActivationMode>, "GetNpadHandheldActivationMode"}, + FunctionInfo{130, C<&IHidServer::SwapNpadAssignment>, "SwapNpadAssignment"}, + FunctionInfo{131, C<&IHidServer::IsUnintendedHomeButtonInputProtectionEnabled>, "IsUnintendedHomeButtonInputProtectionEnabled"}, + FunctionInfo{132, C<&IHidServer::EnableUnintendedHomeButtonInputProtection>, "EnableUnintendedHomeButtonInputProtection"}, + FunctionInfo{133, C<&IHidServer::SetNpadJoyAssignmentModeSingleWithDestination>, "SetNpadJoyAssignmentModeSingleWithDestination"}, + FunctionInfo{134, C<&IHidServer::SetNpadAnalogStickUseCenterClamp>, "SetNpadAnalogStickUseCenterClamp"}, + FunctionInfo{135, C<&IHidServer::SetNpadCaptureButtonAssignment>, "SetNpadCaptureButtonAssignment"}, + FunctionInfo{136, C<&IHidServer::ClearNpadCaptureButtonAssignment>, "ClearNpadCaptureButtonAssignment"}, + FunctionInfo{200, C<&IHidServer::GetVibrationDeviceInfo>, "GetVibrationDeviceInfo"}, + FunctionInfo{201, C<&IHidServer::SendVibrationValue>, "SendVibrationValue"}, + FunctionInfo{202, C<&IHidServer::GetActualVibrationValue>, "GetActualVibrationValue"}, + FunctionInfo{203, C<&IHidServer::CreateActiveVibrationDeviceList>, "CreateActiveVibrationDeviceList"}, + FunctionInfo{204, C<&IHidServer::PermitVibration>, "PermitVibration"}, + FunctionInfo{205, C<&IHidServer::IsVibrationPermitted>, "IsVibrationPermitted"}, + FunctionInfo{206, C<&IHidServer::SendVibrationValues>, "SendVibrationValues"}, + FunctionInfo{207, C<&IHidServer::SendVibrationGcErmCommand>, "SendVibrationGcErmCommand"}, + FunctionInfo{208, C<&IHidServer::GetActualVibrationGcErmCommand>, "GetActualVibrationGcErmCommand"}, + FunctionInfo{209, C<&IHidServer::BeginPermitVibrationSession>, "BeginPermitVibrationSession"}, + FunctionInfo{210, C<&IHidServer::EndPermitVibrationSession>, "EndPermitVibrationSession"}, + FunctionInfo{211, C<&IHidServer::IsVibrationDeviceMounted>, "IsVibrationDeviceMounted"}, + FunctionInfo{212, C<&IHidServer::SendVibrationValueInBool>, "SendVibrationValueInBool"}, + FunctionInfo{300, C<&IHidServer::ActivateConsoleSixAxisSensor>, "ActivateConsoleSixAxisSensor"}, + FunctionInfo{301, C<&IHidServer::StartConsoleSixAxisSensor>, "StartConsoleSixAxisSensor"}, + FunctionInfo{302, C<&IHidServer::StopConsoleSixAxisSensor>, "StopConsoleSixAxisSensor"}, + FunctionInfo{303, C<&IHidServer::ActivateSevenSixAxisSensor>, "ActivateSevenSixAxisSensor"}, + FunctionInfo{304, C<&IHidServer::StartSevenSixAxisSensor>, "StartSevenSixAxisSensor"}, + FunctionInfo{305, C<&IHidServer::StopSevenSixAxisSensor>, "StopSevenSixAxisSensor"}, + FunctionInfo{306, C<&IHidServer::InitializeSevenSixAxisSensor>, "InitializeSevenSixAxisSensor"}, + FunctionInfo{307, C<&IHidServer::FinalizeSevenSixAxisSensor>, "FinalizeSevenSixAxisSensor"}, + FunctionInfo{308, nullptr, "SetSevenSixAxisSensorFusionStrength"}, + FunctionInfo{309, nullptr, "GetSevenSixAxisSensorFusionStrength"}, + FunctionInfo{310, C<&IHidServer::ResetSevenSixAxisSensorTimestamp>, "ResetSevenSixAxisSensorTimestamp"}, + FunctionInfo{320, nullptr, "EnableNpadImu", MakeVersionGate({21,0,0})}, + FunctionInfo{321, nullptr, "DisableNpadImu", MakeVersionGate({21,0,0})}, + FunctionInfo{400, C<&IHidServer::IsUsbFullKeyControllerEnabled>, "IsUsbFullKeyControllerEnabled"}, + FunctionInfo{401, nullptr, "EnableUsbFullKeyController"}, + FunctionInfo{402, nullptr, "IsUsbFullKeyControllerConnected"}, + FunctionInfo{403, nullptr, "HasBattery"}, + FunctionInfo{404, nullptr, "HasLeftRightBattery"}, + FunctionInfo{405, nullptr, "GetNpadInterfaceType"}, + FunctionInfo{406, nullptr, "GetNpadLeftRightInterfaceType"}, + FunctionInfo{407, nullptr, "GetNpadOfHighestBatteryLevel"}, + FunctionInfo{408, nullptr, "GetNpadOfHighestBatteryLevelForJoyRight"}, + FunctionInfo{500, C<&IHidServer::GetPalmaConnectionHandle>, "GetPalmaConnectionHandle"}, + FunctionInfo{501, C<&IHidServer::InitializePalma>, "InitializePalma"}, + FunctionInfo{502, C<&IHidServer::AcquirePalmaOperationCompleteEvent>, "AcquirePalmaOperationCompleteEvent"}, + FunctionInfo{503, C<&IHidServer::GetPalmaOperationInfo>, "GetPalmaOperationInfo"}, + FunctionInfo{504, C<&IHidServer::PlayPalmaActivity>, "PlayPalmaActivity"}, + FunctionInfo{505, C<&IHidServer::SetPalmaFrModeType>, "SetPalmaFrModeType"}, + FunctionInfo{506, C<&IHidServer::ReadPalmaStep>, "ReadPalmaStep"}, + FunctionInfo{507, C<&IHidServer::EnablePalmaStep>, "EnablePalmaStep"}, + FunctionInfo{508, C<&IHidServer::ResetPalmaStep>, "ResetPalmaStep"}, + FunctionInfo{509, C<&IHidServer::ReadPalmaApplicationSection>, "ReadPalmaApplicationSection"}, + FunctionInfo{510, C<&IHidServer::WritePalmaApplicationSection>, "WritePalmaApplicationSection"}, + FunctionInfo{511, C<&IHidServer::ReadPalmaUniqueCode>, "ReadPalmaUniqueCode"}, + FunctionInfo{512, C<&IHidServer::SetPalmaUniqueCodeInvalid>, "SetPalmaUniqueCodeInvalid"}, + FunctionInfo{513, C<&IHidServer::WritePalmaActivityEntry>, "WritePalmaActivityEntry"}, + FunctionInfo{514, C<&IHidServer::WritePalmaRgbLedPatternEntry>, "WritePalmaRgbLedPatternEntry"}, + FunctionInfo{515, C<&IHidServer::WritePalmaWaveEntry>, "WritePalmaWaveEntry"}, + FunctionInfo{516, C<&IHidServer::SetPalmaDataBaseIdentificationVersion>, "SetPalmaDataBaseIdentificationVersion"}, + FunctionInfo{517, C<&IHidServer::GetPalmaDataBaseIdentificationVersion>, "GetPalmaDataBaseIdentificationVersion"}, + FunctionInfo{518, C<&IHidServer::SuspendPalmaFeature>, "SuspendPalmaFeature"}, + FunctionInfo{519, C<&IHidServer::GetPalmaOperationResult>, "GetPalmaOperationResult"}, + FunctionInfo{520, C<&IHidServer::ReadPalmaPlayLog>, "ReadPalmaPlayLog"}, + FunctionInfo{521, C<&IHidServer::ResetPalmaPlayLog>, "ResetPalmaPlayLog"}, + FunctionInfo{522, C<&IHidServer::SetIsPalmaAllConnectable>, "SetIsPalmaAllConnectable"}, + FunctionInfo{523, C<&IHidServer::SetIsPalmaPairedConnectable>, "SetIsPalmaPairedConnectable"}, + FunctionInfo{524, C<&IHidServer::PairPalma>, "PairPalma"}, + FunctionInfo{525, C<&IHidServer::SetPalmaBoostMode>, "SetPalmaBoostMode"}, + FunctionInfo{526, C<&IHidServer::CancelWritePalmaWaveEntry>, "CancelWritePalmaWaveEntry"}, + FunctionInfo{527, C<&IHidServer::EnablePalmaBoostMode>, "EnablePalmaBoostMode"}, + FunctionInfo{528, C<&IHidServer::GetPalmaBluetoothAddress>, "GetPalmaBluetoothAddress"}, + FunctionInfo{529, C<&IHidServer::SetDisallowedPalmaConnection>, "SetDisallowedPalmaConnection"}, + FunctionInfo{1000, C<&IHidServer::SetNpadCommunicationMode>, "SetNpadCommunicationMode"}, + FunctionInfo{1001, C<&IHidServer::GetNpadCommunicationMode>, "GetNpadCommunicationMode"}, + FunctionInfo{1002, C<&IHidServer::SetTouchScreenConfiguration>, "SetTouchScreenConfiguration"}, + FunctionInfo{1003, C<&IHidServer::IsFirmwareUpdateNeededForNotification>, "IsFirmwareUpdateNeededForNotification"}, + FunctionInfo{1004, C<&IHidServer::SetTouchScreenResolution>, "SetTouchScreenResolution"}, + FunctionInfo{1270, nullptr, "DeleteButtonConfigStorageRight"}, + FunctionInfo{1271, nullptr, "IsUsingCustomButtonConfig"}, + FunctionInfo{1272, nullptr, "IsAnyCustomButtonConfigEnabled"}, + FunctionInfo{1273, nullptr, "SetAllCustomButtonConfigEnabled"}, + FunctionInfo{1274, nullptr, "SetDefaultButtonConfig"}, + FunctionInfo{1275, nullptr, "SetAllDefaultButtonConfig"}, + FunctionInfo{1276, nullptr, "SetHidButtonConfigEmbedded"}, + FunctionInfo{1277, nullptr, "SetHidButtonConfigFull"}, + FunctionInfo{1278, nullptr, "SetHidButtonConfigLeft"}, + FunctionInfo{1279, nullptr, "SetHidButtonConfigRight"}, + FunctionInfo{1280, nullptr, "GetHidButtonConfigEmbedded"}, + FunctionInfo{1281, nullptr, "GetHidButtonConfigFull"}, + FunctionInfo{1282, nullptr, "GetHidButtonConfigLeft"}, + FunctionInfo{1283, nullptr, "GetHidButtonConfigRight"}, + FunctionInfo{1284, nullptr, "GetButtonConfigStorageEmbedded"}, + FunctionInfo{1285, nullptr, "GetButtonConfigStorageFull"}, + FunctionInfo{1286, nullptr, "GetButtonConfigStorageLeft"}, + FunctionInfo{1287, nullptr, "GetButtonConfigStorageRight"}, + FunctionInfo{1288, nullptr, "SetButtonConfigStorageEmbedded"}, + FunctionInfo{1289, nullptr, "SetButtonConfigStorageFull"}, + FunctionInfo{1290, nullptr, "SetButtonConfigStorageLeft"}, + FunctionInfo{1291, nullptr, "SetButtonConfigStorageRight"}, + FunctionInfo{1308, nullptr, "SetButtonConfigVisible"}, + FunctionInfo{1309, nullptr, "IsButtonConfigVisible"}, + FunctionInfo{1320, nullptr, "WakeTouchScreenUp"}, + FunctionInfo{1321, nullptr, "PutTouchScreenToSleep"}, + FunctionInfo{1322, nullptr, "AcquireTouchScreenAsyncWakeCompletedEvent"}, + FunctionInfo{1323, nullptr, "StartTouchScreenAutoTuneForSystemSettings"}, + FunctionInfo{1324, nullptr, "AcquireTouchScreenAutoTuneCompletedEvent"}, + FunctionInfo{1325, nullptr, "IsTouchScreenAutoTuneRequiredForRepairProviderReplacement"}, + FunctionInfo{1420, nullptr, "GetAppletResourceProperty"}, + FunctionInfo{2000, nullptr, "ActivateDigitizer"}, + FunctionInfo{3000, nullptr, "GetDebugPadGenericPadMap"}, + FunctionInfo{3001, nullptr, "SetDebugPadGenericPadMap"}, + FunctionInfo{3002, nullptr, "ResetDebugPadGenericPadMap"}, + FunctionInfo{3003, nullptr, "GetDebugPadKeyboardMap"}, + FunctionInfo{3004, nullptr, "SetDebugPadKeyboardMap"}, + FunctionInfo{3005, nullptr, "ResetDebugPadKeyboardMap"}, + FunctionInfo{3006, nullptr, "GetFullKeyGenericPadMap"}, + FunctionInfo{3007, nullptr, "SetFullKeyGenericPadMap"}, + FunctionInfo{3008, nullptr, "ResetFullKeyGenericPadMap"}, + FunctionInfo{3009, nullptr, "GetFullKeyKeyboardMap"}, + FunctionInfo{3010, nullptr, "SetFullKeyKeyboardMap"}, + FunctionInfo{3011, nullptr, "ResetFullKeyKeyboardMap"}, + FunctionInfo{3012, nullptr, "GetDebugPadGenericPadMap", MakeVersionGate({21,0,0})}, + FunctionInfo{3013, nullptr, "SetDebugPadGenericPadMap", MakeVersionGate({21,0,0})}, + FunctionInfo{3014, nullptr, "GetDebugPadKeyboardMap", MakeVersionGate({21,0,0})}, + FunctionInfo{3015, nullptr, "SetDebugPadKeyboardMap", MakeVersionGate({21,0,0})}, + FunctionInfo{3150, C<&IHidServer::SetMouseLibraryVersion>, "SetMouseLibraryVersion", MakeVersionGate({21,0,0})} + // What? -- {12010, nullptr, "SetButtonConfigLeft"}, + ); + return HandlerTableGenerateWithFind(key, functions); +} + IHidServer::IHidServer(Core::System& system_, std::shared_ptr resource, std::shared_ptr settings) : ServiceFramework{system_, "hid"}, resource_manager{resource}, firmware_settings{settings} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&IHidServer::CreateAppletResource>, "CreateAppletResource"}, - {1, C<&IHidServer::ActivateDebugPad>, "ActivateDebugPad"}, - {11, C<&IHidServer::ActivateTouchScreen>, "ActivateTouchScreen"}, - {21, C<&IHidServer::ActivateMouse>, "ActivateMouse"}, - {26, C<&IHidServer::ActivateDebugMouse>, "ActivateDebugMouse"}, - {31, C<&IHidServer::ActivateKeyboard>, "ActivateKeyboard"}, - {32, C<&IHidServer::SendKeyboardLockKeyEvent>, "SendKeyboardLockKeyEvent"}, - {40, C<&IHidServer::AcquireXpadIdEventHandle>, "AcquireXpadIdEventHandle"}, - {41, C<&IHidServer::ReleaseXpadIdEventHandle>, "ReleaseXpadIdEventHandle"}, - {51, C<&IHidServer::ActivateXpad>, "ActivateXpad"}, - {55, C<&IHidServer::GetXpadIds>, "GetXpadIds"}, - {56, C<&IHidServer::ActivateJoyXpad>, "ActivateJoyXpad"}, - {58, C<&IHidServer::GetJoyXpadLifoHandle>, "GetJoyXpadLifoHandle"}, - {59, C<&IHidServer::GetJoyXpadIds>, "GetJoyXpadIds"}, - {60, C<&IHidServer::ActivateSixAxisSensor>, "ActivateSixAxisSensor"}, - {61, C<&IHidServer::DeactivateSixAxisSensor>, "DeactivateSixAxisSensor"}, - {62, C<&IHidServer::GetSixAxisSensorLifoHandle>, "GetSixAxisSensorLifoHandle"}, - {63, C<&IHidServer::ActivateJoySixAxisSensor>, "ActivateJoySixAxisSensor"}, - {64, C<&IHidServer::DeactivateJoySixAxisSensor>, "DeactivateJoySixAxisSensor"}, - {65, C<&IHidServer::GetJoySixAxisSensorLifoHandle>, "GetJoySixAxisSensorLifoHandle"}, - {66, C<&IHidServer::StartSixAxisSensor>, "StartSixAxisSensor"}, - {67, C<&IHidServer::StopSixAxisSensor>, "StopSixAxisSensor"}, - {68, C<&IHidServer::IsSixAxisSensorFusionEnabled>, "IsSixAxisSensorFusionEnabled"}, - {69, C<&IHidServer::EnableSixAxisSensorFusion>, "EnableSixAxisSensorFusion"}, - {70, C<&IHidServer::SetSixAxisSensorFusionParameters>, "SetSixAxisSensorFusionParameters"}, - {71, C<&IHidServer::GetSixAxisSensorFusionParameters>, "GetSixAxisSensorFusionParameters"}, - {72, C<&IHidServer::ResetSixAxisSensorFusionParameters>, "ResetSixAxisSensorFusionParameters"}, - {73, nullptr, "SetAccelerometerParameters"}, - {74, nullptr, "GetAccelerometerParameters"}, - {75, nullptr, "ResetAccelerometerParameters"}, - {76, nullptr, "SetAccelerometerPlayMode"}, - {77, nullptr, "GetAccelerometerPlayMode"}, - {78, nullptr, "ResetAccelerometerPlayMode"}, - {79, C<&IHidServer::SetGyroscopeZeroDriftMode>, "SetGyroscopeZeroDriftMode"}, - {80, C<&IHidServer::GetGyroscopeZeroDriftMode>, "GetGyroscopeZeroDriftMode"}, - {81, C<&IHidServer::ResetGyroscopeZeroDriftMode>, "ResetGyroscopeZeroDriftMode"}, - {82, C<&IHidServer::IsSixAxisSensorAtRest>, "IsSixAxisSensorAtRest"}, - {83, C<&IHidServer::IsFirmwareUpdateAvailableForSixAxisSensor>, "IsFirmwareUpdateAvailableForSixAxisSensor"}, - {84, C<&IHidServer::EnableSixAxisSensorUnalteredPassthrough>, "EnableSixAxisSensorUnalteredPassthrough"}, - {85, C<&IHidServer::IsSixAxisSensorUnalteredPassthroughEnabled>, "IsSixAxisSensorUnalteredPassthroughEnabled"}, - {86, nullptr, "StoreSixAxisSensorCalibrationParameter"}, - {87, C<&IHidServer::LoadSixAxisSensorCalibrationParameter>, "LoadSixAxisSensorCalibrationParameter"}, - {88, C<&IHidServer::GetSixAxisSensorIcInformation>, "GetSixAxisSensorIcInformation"}, - {89, C<&IHidServer::ResetIsSixAxisSensorDeviceNewlyAssigned>, "ResetIsSixAxisSensorDeviceNewlyAssigned"}, - {91, C<&IHidServer::ActivateGesture>, "ActivateGesture"}, - {92, C<&IHidServer::SetGestureOutputRanges>, "SetGestureOutputRanges"}, - {100, C<&IHidServer::SetSupportedNpadStyleSet>, "SetSupportedNpadStyleSet"}, - {101, C<&IHidServer::GetSupportedNpadStyleSet>, "GetSupportedNpadStyleSet"}, - {102, C<&IHidServer::SetSupportedNpadIdType>, "SetSupportedNpadIdType"}, - {103, C<&IHidServer::ActivateNpad>, "ActivateNpad"}, - {104, C<&IHidServer::DeactivateNpad>, "DeactivateNpad"}, - {106, C<&IHidServer::AcquireNpadStyleSetUpdateEventHandle>, "AcquireNpadStyleSetUpdateEventHandle"}, - {107, C<&IHidServer::DisconnectNpad>, "DisconnectNpad"}, - {108, C<&IHidServer::GetPlayerLedPattern>, "GetPlayerLedPattern"}, - {109, C<&IHidServer::ActivateNpadWithRevision>, "ActivateNpadWithRevision"}, - {120, C<&IHidServer::SetNpadJoyHoldType>, "SetNpadJoyHoldType"}, - {121, C<&IHidServer::GetNpadJoyHoldType>, "GetNpadJoyHoldType"}, - {122, C<&IHidServer::SetNpadJoyAssignmentModeSingleByDefault>, "SetNpadJoyAssignmentModeSingleByDefault"}, - {123, C<&IHidServer::SetNpadJoyAssignmentModeSingle>, "SetNpadJoyAssignmentModeSingle"}, - {124, C<&IHidServer::SetNpadJoyAssignmentModeDual>, "SetNpadJoyAssignmentModeDual"}, - {125, C<&IHidServer::MergeSingleJoyAsDualJoy>, "MergeSingleJoyAsDualJoy"}, - {126, C<&IHidServer::StartLrAssignmentMode>, "StartLrAssignmentMode"}, - {127, C<&IHidServer::StopLrAssignmentMode>, "StopLrAssignmentMode"}, - {128, C<&IHidServer::SetNpadHandheldActivationMode>, "SetNpadHandheldActivationMode"}, - {129, C<&IHidServer::GetNpadHandheldActivationMode>, "GetNpadHandheldActivationMode"}, - {130, C<&IHidServer::SwapNpadAssignment>, "SwapNpadAssignment"}, - {131, C<&IHidServer::IsUnintendedHomeButtonInputProtectionEnabled>, "IsUnintendedHomeButtonInputProtectionEnabled"}, - {132, C<&IHidServer::EnableUnintendedHomeButtonInputProtection>, "EnableUnintendedHomeButtonInputProtection"}, - {133, C<&IHidServer::SetNpadJoyAssignmentModeSingleWithDestination>, "SetNpadJoyAssignmentModeSingleWithDestination"}, - {134, C<&IHidServer::SetNpadAnalogStickUseCenterClamp>, "SetNpadAnalogStickUseCenterClamp"}, - {135, C<&IHidServer::SetNpadCaptureButtonAssignment>, "SetNpadCaptureButtonAssignment"}, - {136, C<&IHidServer::ClearNpadCaptureButtonAssignment>, "ClearNpadCaptureButtonAssignment"}, - {200, C<&IHidServer::GetVibrationDeviceInfo>, "GetVibrationDeviceInfo"}, - {201, C<&IHidServer::SendVibrationValue>, "SendVibrationValue"}, - {202, C<&IHidServer::GetActualVibrationValue>, "GetActualVibrationValue"}, - {203, C<&IHidServer::CreateActiveVibrationDeviceList>, "CreateActiveVibrationDeviceList"}, - {204, C<&IHidServer::PermitVibration>, "PermitVibration"}, - {205, C<&IHidServer::IsVibrationPermitted>, "IsVibrationPermitted"}, - {206, C<&IHidServer::SendVibrationValues>, "SendVibrationValues"}, - {207, C<&IHidServer::SendVibrationGcErmCommand>, "SendVibrationGcErmCommand"}, - {208, C<&IHidServer::GetActualVibrationGcErmCommand>, "GetActualVibrationGcErmCommand"}, - {209, C<&IHidServer::BeginPermitVibrationSession>, "BeginPermitVibrationSession"}, - {210, C<&IHidServer::EndPermitVibrationSession>, "EndPermitVibrationSession"}, - {211, C<&IHidServer::IsVibrationDeviceMounted>, "IsVibrationDeviceMounted"}, - {212, C<&IHidServer::SendVibrationValueInBool>, "SendVibrationValueInBool"}, - {300, C<&IHidServer::ActivateConsoleSixAxisSensor>, "ActivateConsoleSixAxisSensor"}, - {301, C<&IHidServer::StartConsoleSixAxisSensor>, "StartConsoleSixAxisSensor"}, - {302, C<&IHidServer::StopConsoleSixAxisSensor>, "StopConsoleSixAxisSensor"}, - {303, C<&IHidServer::ActivateSevenSixAxisSensor>, "ActivateSevenSixAxisSensor"}, - {304, C<&IHidServer::StartSevenSixAxisSensor>, "StartSevenSixAxisSensor"}, - {305, C<&IHidServer::StopSevenSixAxisSensor>, "StopSevenSixAxisSensor"}, - {306, C<&IHidServer::InitializeSevenSixAxisSensor>, "InitializeSevenSixAxisSensor"}, - {307, C<&IHidServer::FinalizeSevenSixAxisSensor>, "FinalizeSevenSixAxisSensor"}, - {308, nullptr, "SetSevenSixAxisSensorFusionStrength"}, - {309, nullptr, "GetSevenSixAxisSensorFusionStrength"}, - {310, C<&IHidServer::ResetSevenSixAxisSensorTimestamp>, "ResetSevenSixAxisSensorTimestamp"}, - {320, nullptr, "EnableNpadImu"}, //21.0.0+ - {321, nullptr, "DisableNpadImu"}, //21.0.0+ - {400, C<&IHidServer::IsUsbFullKeyControllerEnabled>, "IsUsbFullKeyControllerEnabled"}, - {401, nullptr, "EnableUsbFullKeyController"}, - {402, nullptr, "IsUsbFullKeyControllerConnected"}, - {403, nullptr, "HasBattery"}, - {404, nullptr, "HasLeftRightBattery"}, - {405, nullptr, "GetNpadInterfaceType"}, - {406, nullptr, "GetNpadLeftRightInterfaceType"}, - {407, nullptr, "GetNpadOfHighestBatteryLevel"}, - {408, nullptr, "GetNpadOfHighestBatteryLevelForJoyRight"}, - {500, C<&IHidServer::GetPalmaConnectionHandle>, "GetPalmaConnectionHandle"}, - {501, C<&IHidServer::InitializePalma>, "InitializePalma"}, - {502, C<&IHidServer::AcquirePalmaOperationCompleteEvent>, "AcquirePalmaOperationCompleteEvent"}, - {503, C<&IHidServer::GetPalmaOperationInfo>, "GetPalmaOperationInfo"}, - {504, C<&IHidServer::PlayPalmaActivity>, "PlayPalmaActivity"}, - {505, C<&IHidServer::SetPalmaFrModeType>, "SetPalmaFrModeType"}, - {506, C<&IHidServer::ReadPalmaStep>, "ReadPalmaStep"}, - {507, C<&IHidServer::EnablePalmaStep>, "EnablePalmaStep"}, - {508, C<&IHidServer::ResetPalmaStep>, "ResetPalmaStep"}, - {509, C<&IHidServer::ReadPalmaApplicationSection>, "ReadPalmaApplicationSection"}, - {510, C<&IHidServer::WritePalmaApplicationSection>, "WritePalmaApplicationSection"}, - {511, C<&IHidServer::ReadPalmaUniqueCode>, "ReadPalmaUniqueCode"}, - {512, C<&IHidServer::SetPalmaUniqueCodeInvalid>, "SetPalmaUniqueCodeInvalid"}, - {513, C<&IHidServer::WritePalmaActivityEntry>, "WritePalmaActivityEntry"}, - {514, C<&IHidServer::WritePalmaRgbLedPatternEntry>, "WritePalmaRgbLedPatternEntry"}, - {515, C<&IHidServer::WritePalmaWaveEntry>, "WritePalmaWaveEntry"}, - {516, C<&IHidServer::SetPalmaDataBaseIdentificationVersion>, "SetPalmaDataBaseIdentificationVersion"}, - {517, C<&IHidServer::GetPalmaDataBaseIdentificationVersion>, "GetPalmaDataBaseIdentificationVersion"}, - {518, C<&IHidServer::SuspendPalmaFeature>, "SuspendPalmaFeature"}, - {519, C<&IHidServer::GetPalmaOperationResult>, "GetPalmaOperationResult"}, - {520, C<&IHidServer::ReadPalmaPlayLog>, "ReadPalmaPlayLog"}, - {521, C<&IHidServer::ResetPalmaPlayLog>, "ResetPalmaPlayLog"}, - {522, C<&IHidServer::SetIsPalmaAllConnectable>, "SetIsPalmaAllConnectable"}, - {523, C<&IHidServer::SetIsPalmaPairedConnectable>, "SetIsPalmaPairedConnectable"}, - {524, C<&IHidServer::PairPalma>, "PairPalma"}, - {525, C<&IHidServer::SetPalmaBoostMode>, "SetPalmaBoostMode"}, - {526, C<&IHidServer::CancelWritePalmaWaveEntry>, "CancelWritePalmaWaveEntry"}, - {527, C<&IHidServer::EnablePalmaBoostMode>, "EnablePalmaBoostMode"}, - {528, C<&IHidServer::GetPalmaBluetoothAddress>, "GetPalmaBluetoothAddress"}, - {529, C<&IHidServer::SetDisallowedPalmaConnection>, "SetDisallowedPalmaConnection"}, - {1000, C<&IHidServer::SetNpadCommunicationMode>, "SetNpadCommunicationMode"}, - {1001, C<&IHidServer::GetNpadCommunicationMode>, "GetNpadCommunicationMode"}, - {1002, C<&IHidServer::SetTouchScreenConfiguration>, "SetTouchScreenConfiguration"}, - {1003, C<&IHidServer::IsFirmwareUpdateNeededForNotification>, "IsFirmwareUpdateNeededForNotification"}, - {1004, C<&IHidServer::SetTouchScreenResolution>, "SetTouchScreenResolution"}, - {1270, nullptr, "DeleteButtonConfigStorageRight"}, - {1271, nullptr, "IsUsingCustomButtonConfig"}, - {1272, nullptr, "IsAnyCustomButtonConfigEnabled"}, - {1273, nullptr, "SetAllCustomButtonConfigEnabled"}, - {1274, nullptr, "SetDefaultButtonConfig"}, - {1275, nullptr, "SetAllDefaultButtonConfig"}, - {1276, nullptr, "SetHidButtonConfigEmbedded"}, - {1277, nullptr, "SetHidButtonConfigFull"}, - {1278, nullptr, "SetHidButtonConfigLeft"}, - {1279, nullptr, "SetHidButtonConfigRight"}, - {1280, nullptr, "GetHidButtonConfigEmbedded"}, - {1281, nullptr, "GetHidButtonConfigFull"}, - {1282, nullptr, "GetHidButtonConfigLeft"}, - {1283, nullptr, "GetHidButtonConfigRight"}, - {1284, nullptr, "GetButtonConfigStorageEmbedded"}, - {1285, nullptr, "GetButtonConfigStorageFull"}, - {1286, nullptr, "GetButtonConfigStorageLeft"}, - {1287, nullptr, "GetButtonConfigStorageRight"}, - {1288, nullptr, "SetButtonConfigStorageEmbedded"}, - {1289, nullptr, "SetButtonConfigStorageFull"}, - {1290, nullptr, "SetButtonConfigStorageLeft"}, - {1291, nullptr, "SetButtonConfigStorageRight"}, - {1308, nullptr, "SetButtonConfigVisible"}, - {1309, nullptr, "IsButtonConfigVisible"}, - {1320, nullptr, "WakeTouchScreenUp"}, - {1321, nullptr, "PutTouchScreenToSleep"}, - {1322, nullptr, "AcquireTouchScreenAsyncWakeCompletedEvent"}, - {1323, nullptr, "StartTouchScreenAutoTuneForSystemSettings"}, - {1324, nullptr, "AcquireTouchScreenAutoTuneCompletedEvent"}, - {1325, nullptr, "IsTouchScreenAutoTuneRequiredForRepairProviderReplacement"}, - {1420, nullptr, "GetAppletResourceProperty"}, - {2000, nullptr, "ActivateDigitizer"}, - {3000, nullptr, "GetDebugPadGenericPadMap"}, - {3001, nullptr, "SetDebugPadGenericPadMap"}, - {3002, nullptr, "ResetDebugPadGenericPadMap"}, - {3003, nullptr, "GetDebugPadKeyboardMap"}, - {3004, nullptr, "SetDebugPadKeyboardMap"}, - {3005, nullptr, "ResetDebugPadKeyboardMap"}, - {3006, nullptr, "GetFullKeyGenericPadMap"}, - {3007, nullptr, "SetFullKeyGenericPadMap"}, - {3008, nullptr, "ResetFullKeyGenericPadMap"}, - {3009, nullptr, "GetFullKeyKeyboardMap"}, - {3010, nullptr, "SetFullKeyKeyboardMap"}, - {3011, nullptr, "ResetFullKeyKeyboardMap"}, - {3012, nullptr, "GetDebugPadGenericPadMap"}, //21.0.0+ - {3013, nullptr, "SetDebugPadGenericPadMap"}, //21.0.0+ - {3014, nullptr, "GetDebugPadKeyboardMap"}, //21.0.0+ - {3015, nullptr, "SetDebugPadKeyboardMap"}, //21.0.0+ - {3150, C<&IHidServer::SetMouseLibraryVersion>, "SetMouseLibraryVersion"}, //21.0.0+ - // What? -- {12010, nullptr, "SetButtonConfigLeft"}, - }; - // clang-format on - - RegisterHandlers(functions); } IHidServer::~IHidServer() = default; diff --git a/src/core/hle/service/hid/hid_server.h b/src/core/hle/service/hid/hid_server.h index 57a1a04b9c..f2c08e9df8 100644 --- a/src/core/hle/service/hid/hid_server.h +++ b/src/core/hle/service/hid/hid_server.h @@ -265,6 +265,8 @@ private: Result SetTouchScreenResolution(u32 width, u32 height, ClientAppletResourceUserId aruid); Result SetMouseLibraryVersion(ClientAppletResourceUserId aruid); + std::optional FindRequest(u32 key) override; + std::shared_ptr resource_manager; std::shared_ptr firmware_settings; }; diff --git a/src/core/hle/service/hid/hid_system_server.cpp b/src/core/hle/service/hid/hid_system_server.cpp index e544adf03c..4df021f443 100644 --- a/src/core/hle/service/hid/hid_system_server.cpp +++ b/src/core/hle/service/hid/hid_system_server.cpp @@ -22,252 +22,6 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr settings) : ServiceFramework{system_, "hid:sys"}, service_context{system_, service_name}, resource_manager{resource}, firmware_settings{settings} { - // clang-format off - static const FunctionInfo functions[] = { - {31, nullptr, "SendKeyboardLockKeyEvent"}, - {101, nullptr, "AcquireHomeButtonEventHandle"}, - {111, nullptr, "ActivateHomeButton"}, - {121, nullptr, "AcquireSleepButtonEventHandle"}, - {131, nullptr, "ActivateSleepButton"}, - {141, nullptr, "AcquireCaptureButtonEventHandle"}, - {151, nullptr, "ActivateCaptureButton"}, - {161, &IHidSystemServer::GetPlatformConfig, "GetPlatformConfig"}, - {210, nullptr, "AcquireNfcDeviceUpdateEventHandle"}, - {211, nullptr, "GetNpadsWithNfc"}, - {212, nullptr, "AcquireNfcActivateEventHandle"}, - {213, nullptr, "ActivateNfc"}, - {214, nullptr, "GetXcdHandleForNpadWithNfc"}, - {215, nullptr, "IsNfcActivated"}, - {216, nullptr, "GetAbstractedPadIdForNpadWithNfc"}, - {217, nullptr, "SetNfcEvent"}, - {218, nullptr, "GetNfcInfo"}, - {219, nullptr, "StartNfcDiscovery"}, - {220, nullptr, "StopNfcDiscovery"}, - {221, nullptr, "StartNtagRead"}, - {222, nullptr, "StartNtagWrite"}, - {223, nullptr, "SendNfcRawData"}, - {224, nullptr, "RegisterMifareKey"}, - {225, nullptr, "ClearMifareKey"}, - {226, nullptr, "StartMifareRead"}, - {227, nullptr, "StartMifareWrite"}, - {230, nullptr, "AcquireIrSensorEventHndle" }, - {231, nullptr, "ActivateIrSensor"}, - {232, nullptr, "GetIrSensorState"}, - {233, nullptr, "GetXcdHandleForNpadWihIrSensor" }, - {234, nullptr, "GetNpadJoyHoldType"}, - {241, nullptr, "GetDataFormat"}, - {242, nullptr, "SetDataFormat"}, - {243, nullptr, "GetMcuState"}, - {244, nullptr, "SetMcuState"}, - {245, nullptr, "GetMcuVersionForNfc"}, - {246, nullptr, "CheckNfcDevicePower"}, - {247, nullptr, "SetMcuStateImmediate"}, - {301, nullptr, "ActivateNpadSystem"}, - {303, &IHidSystemServer::ApplyNpadSystemCommonPolicy, "ApplyNpadSystemCommonPolicy"}, - {304, &IHidSystemServer::EnableAssigningSingleOnSlSrPress, "EnableAssigningSingleOnSlSrPress"}, - {305, &IHidSystemServer::DisableAssigningSingleOnSlSrPress, "DisableAssigningSingleOnSlSrPress"}, - {306, &IHidSystemServer::GetLastActiveNpad, "GetLastActiveNpad"}, - {307, nullptr, "GetNpadSystemExtStyle"}, - {308, &IHidSystemServer::ApplyNpadSystemCommonPolicyFull, "ApplyNpadSystemCommonPolicyFull"}, - {309, &IHidSystemServer::GetNpadFullKeyGripColor, "GetNpadFullKeyGripColor"}, - {310, &IHidSystemServer::GetMaskedSupportedNpadStyleSet, "GetMaskedSupportedNpadStyleSet"}, - {311, nullptr, "SetNpadPlayerLedBlinkingDevice"}, - {312, &IHidSystemServer::SetSupportedNpadStyleSetAll, "SetSupportedNpadStyleSetAll"}, - {313, &IHidSystemServer::GetNpadCaptureButtonAssignment, "GetNpadCaptureButtonAssignment"}, - {314, nullptr, "GetAppletFooterUiType"}, - {315, &IHidSystemServer::GetAppletDetailedUiType, "GetAppletDetailedUiType"}, - {316, &IHidSystemServer::GetNpadInterfaceType, "GetNpadInterfaceType"}, - {317, &IHidSystemServer::GetNpadLeftRightInterfaceType, "GetNpadLeftRightInterfaceType"}, - {318, &IHidSystemServer::HasBattery, "HasBattery"}, - {319, &IHidSystemServer::HasLeftRightBattery, "HasLeftRightBattery"}, - {321, &IHidSystemServer::GetUniquePadsFromNpad, "GetUniquePadsFromNpad"}, - {322, &IHidSystemServer::SetNpadSystemExtStateEnabled, "SetNpadSystemExtStateEnabled"}, - {323, nullptr, "GetLastActiveUniquePad"}, - {324, nullptr, "GetUniquePadButtonSet"}, - {325, nullptr, "GetUniquePadColor"}, - {326, nullptr, "GetUniquePadAppletDetailedUiType"}, - {327, nullptr, "GetAbstractedPadIdDataFromNpad"}, - {328, nullptr, "AttachAbstractedPadToNpad"}, - {329, nullptr, "DetachAbstractedPadAll"}, - {330, nullptr, "CheckAbstractedPadConnection"}, - {332, nullptr, "ConvertAppletDetailedUiTypeFromPlayReportType"}, //19.0.0+ - {333, nullptr, "SetNpadUserSpgApplet"}, //20.0.0+ - {334, nullptr, "AcquireUniquePadButtonStateChangedEventHandle"}, //20.0.0+ - {501, &IHidSystemServer::RegisterAppletResourceUserId, "RegisterAppletResourceUserId"}, - {502, &IHidSystemServer::UnregisterAppletResourceUserId, "UnregisterAppletResourceUserId"}, - {503, &IHidSystemServer::EnableAppletToGetInput, "EnableAppletToGetInput"}, - {504, &IHidSystemServer::SetAruidValidForVibration, "SetAruidValidForVibration"}, - {505, &IHidSystemServer::EnableAppletToGetSixAxisSensor, "EnableAppletToGetSixAxisSensor"}, - {506, &IHidSystemServer::EnableAppletToGetPadInput, "EnableAppletToGetPadInput"}, - {507, &IHidSystemServer::EnableAppletToGetTouchScreen, "EnableAppletToGetTouchScreen"}, - {510, &IHidSystemServer::SetVibrationMasterVolume, "SetVibrationMasterVolume"}, - {511, &IHidSystemServer::GetVibrationMasterVolume, "GetVibrationMasterVolume"}, - {512, &IHidSystemServer::BeginPermitVibrationSession, "BeginPermitVibrationSession"}, - {513, &IHidSystemServer::EndPermitVibrationSession, "EndPermitVibrationSession"}, - {514, nullptr, "Unknown514"}, - {520, nullptr, "EnableHandheldHids"}, - {521, nullptr, "DisableHandheldHids"}, - {522, nullptr, "SetJoyConRailEnabled"}, - {523, &IHidSystemServer::IsJoyConRailEnabled, "IsJoyConRailEnabled"}, - {524, nullptr, "IsHandheldHidsEnabled"}, - {525, &IHidSystemServer::IsJoyConAttachedOnAllRail, "IsJoyConAttachedOnAllRail"}, - {540, nullptr, "AcquirePlayReportControllerUsageUpdateEvent"}, - {541, nullptr, "GetPlayReportControllerUsages"}, - {542, nullptr, "AcquirePlayReportRegisteredDeviceUpdateEvent"}, - {543, nullptr, "GetRegisteredDevicesOld"}, - {544, &IHidSystemServer::AcquireConnectionTriggerTimeoutEvent, "AcquireConnectionTriggerTimeoutEvent"}, - {545, nullptr, "SendConnectionTrigger"}, - {546, &IHidSystemServer::AcquireDeviceRegisteredEventForControllerSupport, "AcquireDeviceRegisteredEventForControllerSupport"}, - {547, nullptr, "GetAllowedBluetoothLinksCount"}, - {548, &IHidSystemServer::GetRegisteredDevices, "GetRegisteredDevices"}, - {549, nullptr, "GetConnectableRegisteredDevices"}, - {551, &IHidSystemServer::GetRegisteredDevices, "GetRegisteredDevicesForControllerSupport"}, //20.0.0+ //mocked via 548 for Diablo 3 (at least) - {700, nullptr, "ActivateUniquePad"}, - {702, &IHidSystemServer::AcquireUniquePadConnectionEventHandle, "AcquireUniquePadConnectionEventHandle"}, - {703, &IHidSystemServer::GetUniquePadIds, "GetUniquePadIds"}, - {711, nullptr, "AcquireUniquePadConnectionOnHandheldForNsEventHandle"}, //20.0.0+ - {712, nullptr, "GetUniquePadColor12"}, //20.0.0+ - {751, &IHidSystemServer::AcquireJoyDetachOnBluetoothOffEventHandle, "AcquireJoyDetachOnBluetoothOffEventHandle"}, - {800, nullptr, "ListSixAxisSensorHandles"}, - {801, nullptr, "IsSixAxisSensorUserCalibrationSupported"}, - {802, nullptr, "ResetSixAxisSensorCalibrationValues"}, - {803, nullptr, "StartSixAxisSensorUserCalibration"}, - {804, nullptr, "CancelSixAxisSensorUserCalibration"}, - {805, nullptr, "GetUniquePadBluetoothAddress"}, - {806, nullptr, "DisconnectUniquePad"}, - {807, nullptr, "GetUniquePadType"}, - {808, nullptr, "GetUniquePadInterface"}, - {809, nullptr, "GetUniquePadSerialNumber"}, - {810, nullptr, "GetUniquePadControllerNumber"}, - {811, nullptr, "GetSixAxisSensorUserCalibrationStage"}, - {812, nullptr, "GetConsoleUniqueSixAxisSensorHandle"}, - {813, nullptr, "GetDeviceType"}, - {821, nullptr, "StartAnalogStickManualCalibration"}, - {822, nullptr, "RetryCurrentAnalogStickManualCalibrationStage"}, - {823, nullptr, "CancelAnalogStickManualCalibration"}, - {824, nullptr, "ResetAnalogStickManualCalibration"}, - {825, nullptr, "GetAnalogStickState"}, - {826, nullptr, "GetAnalogStickManualCalibrationStage"}, - {827, nullptr, "IsAnalogStickButtonPressed"}, - {828, nullptr, "IsAnalogStickInReleasePosition"}, - {829, nullptr, "IsAnalogStickInCircumference"}, - {830, nullptr, "SetNotificationLedPattern"}, - {831, nullptr, "SetNotificationLedPatternWithTimeout"}, - {832, nullptr, "PrepareHidsForNotificationWake"}, - {850, &IHidSystemServer::IsUsbFullKeyControllerEnabled, "IsUsbFullKeyControllerEnabled"}, - {851, &IHidSystemServer::EnableUsbFullKeyController, "EnableUsbFullKeyController"}, - {852, nullptr, "IsUsbConnected"}, - {870, &IHidSystemServer::IsHandheldButtonPressedOnConsoleMode, "IsHandheldButtonPressedOnConsoleMode"}, - {900, nullptr, "ActivateInputDetector"}, - {901, nullptr, "NotifyInputDetector"}, - {1000, &IHidSystemServer::InitializeFirmwareUpdate, "InitializeFirmwareUpdate"}, - {1001, nullptr, "GetFirmwareVersion"}, - {1002, nullptr, "GetAvailableFirmwareVersion"}, - {1003, nullptr, "IsFirmwareUpdateAvailable"}, - {1004, &IHidSystemServer::CheckFirmwareUpdateRequired, "CheckFirmwareUpdateRequired"}, - {1005, nullptr, "StartFirmwareUpdate"}, - {1006, nullptr, "AbortFirmwareUpdate"}, - {1007, nullptr, "GetFirmwareUpdateState"}, - {1008, nullptr, "ActivateAudioControl"}, - {1009, nullptr, "AcquireAudioControlEventHandle"}, - {1010, nullptr, "GetAudioControlStates"}, - {1011, nullptr, "DeactivateAudioControl"}, - {1012, nullptr, "GetFirmwareVersionStringForUserSupportPage"}, - {1050, nullptr, "IsSixAxisSensorAccurateUserCalibrationSupported"}, - {1051, nullptr, "StartSixAxisSensorAccurateUserCalibration"}, - {1052, nullptr, "CancelSixAxisSensorAccurateUserCalibration"}, - {1053, nullptr, "GetSixAxisSensorAccurateUserCalibrationState"}, - {1100, nullptr, "GetHidbusSystemServiceObject"}, - {1120, &IHidSystemServer::SetFirmwareHotfixUpdateSkipEnabled, "SetFirmwareHotfixUpdateSkipEnabled"}, - {1130, &IHidSystemServer::InitializeUsbFirmwareUpdate, "InitializeUsbFirmwareUpdate"}, - {1131, &IHidSystemServer::FinalizeUsbFirmwareUpdate, "FinalizeUsbFirmwareUpdate"}, - {1132, &IHidSystemServer::CheckUsbFirmwareUpdateRequired, "CheckUsbFirmwareUpdateRequired"}, - {1133, nullptr, "StartUsbFirmwareUpdate"}, - {1134, nullptr, "GetUsbFirmwareUpdateState"}, - {1135, &IHidSystemServer::InitializeUsbFirmwareUpdateWithoutMemory, "InitializeUsbFirmwareUpdateWithoutMemory"}, - {1150, &IHidSystemServer::SetTouchScreenMagnification, "SetTouchScreenMagnification"}, - {1151, &IHidSystemServer::GetTouchScreenFirmwareVersion, "GetTouchScreenFirmwareVersion"}, - {1152, &IHidSystemServer::SetTouchScreenDefaultConfiguration, "SetTouchScreenDefaultConfiguration"}, - {1153, &IHidSystemServer::GetTouchScreenDefaultConfiguration, "GetTouchScreenDefaultConfiguration"}, - {1154, nullptr, "IsFirmwareAvailableForNotification"}, - {1155, &IHidSystemServer::SetForceHandheldStyleVibration, "SetForceHandheldStyleVibration"}, - {1156, nullptr, "SendConnectionTriggerWithoutTimeoutEvent"}, - {1157, nullptr, "CancelConnectionTrigger"}, - {1158, nullptr, "SetConnectionLimitForSplay"}, //20.1.0+ - {1159, nullptr, "ClearConnectionLimitForSplay"}, //20.1.0+ - {1200, nullptr, "IsButtonConfigSupported"}, - {1201, nullptr, "IsButtonConfigEmbeddedSupported"}, - {1202, nullptr, "DeleteButtonConfig"}, - {1203, nullptr, "DeleteButtonConfigEmbedded"}, - {1204, nullptr, "SetButtonConfigEnabled"}, - {1205, nullptr, "SetButtonConfigEmbeddedEnabled"}, - {1206, nullptr, "IsButtonConfigEnabled"}, - {1207, nullptr, "IsButtonConfigEmbeddedEnabled"}, - {1208, nullptr, "SetButtonConfigEmbedded"}, - {1209, nullptr, "SetButtonConfigFull"}, - {1210, nullptr, "SetButtonConfigLeft"}, - {1211, nullptr, "SetButtonConfigRight"}, - {1212, nullptr, "GetButtonConfigEmbedded"}, - {1213, nullptr, "GetButtonConfigFull"}, - {1214, nullptr, "GetButtonConfigLeft"}, - {1215, nullptr, "GetButtonConfigRight"}, - {1250, nullptr, "IsCustomButtonConfigSupported"}, - {1251, nullptr, "IsDefaultButtonConfigEmbedded"}, - {1252, nullptr, "IsDefaultButtonConfigFull"}, - {1253, nullptr, "IsDefaultButtonConfigLeft"}, - {1254, nullptr, "IsDefaultButtonConfigRight"}, - {1255, nullptr, "IsButtonConfigStorageEmbeddedEmpty"}, - {1256, nullptr, "IsButtonConfigStorageFullEmpty"}, - {1257, nullptr, "IsButtonConfigStorageLeftEmpty"}, - {1258, nullptr, "IsButtonConfigStorageRightEmpty"}, - {1259, nullptr, "GetButtonConfigStorageEmbeddedDeprecated"}, - {1260, nullptr, "GetButtonConfigStorageFullDeprecated"}, - {1261, nullptr, "GetButtonConfigStorageLeftDeprecated"}, - {1262, nullptr, "GetButtonConfigStorageRightDeprecated"}, - {1263, nullptr, "SetButtonConfigStorageEmbeddedDeprecated"}, - {1264, nullptr, "SetButtonConfigStorageFullDeprecated"}, - {1265, nullptr, "SetButtonConfigStorageLeftDeprecated"}, - {1266, nullptr, "SetButtonConfigStorageRightDeprecated"}, - {1267, nullptr, "DeleteButtonConfigStorageEmbedded"}, - {1268, nullptr, "DeleteButtonConfigStorageFull"}, - {1269, nullptr, "DeleteButtonConfigStorageLeft"}, - {1270, nullptr, "DeleteButtonConfigStorageRight"}, - {1271, &IHidSystemServer::IsUsingCustomButtonConfig, "IsUsingCustomButtonConfig"}, - {1272, &IHidSystemServer::IsAnyCustomButtonConfigEnabled, "IsAnyCustomButtonConfigEnabled"}, - {1273, nullptr, "SetAllCustomButtonConfigEnabled"}, - {1274, nullptr, "SetDefaultButtonConfig"}, - {1275, nullptr, "SetAllDefaultButtonConfig"}, - {1276, nullptr, "SetHidButtonConfigEmbedded"}, - {1277, nullptr, "SetHidButtonConfigFull"}, - {1278, nullptr, "SetHidButtonConfigLeft"}, - {1279, nullptr, "SetHidButtonConfigRight"}, - {1280, nullptr, "GetHidButtonConfigEmbedded"}, - {1281, nullptr, "GetHidButtonConfigFull"}, - {1282, nullptr, "GetHidButtonConfigLeft"}, - {1283, nullptr, "GetHidButtonConfigRight"}, - {1284, nullptr, "GetButtonConfigStorageEmbedded"}, - {1285, nullptr, "GetButtonConfigStorageFull"}, - {1286, nullptr, "GetButtonConfigStorageLeft"}, - {1287, nullptr, "GetButtonConfigStorageRight"}, - {1288, nullptr, "SetButtonConfigStorageEmbedded"}, - {1289, nullptr, "SetButtonConfigStorageFull"}, - {1290, nullptr, "DeleteButtonConfigStorageRight"}, - {1291, nullptr, "DeleteButtonConfigStorageRight"}, - {1308, nullptr, "SetButtonConfigVisible"}, //18.0.0+ - {1309, nullptr, "IsButtonConfigVisible"}, //18.0.0+ - {1320, nullptr, "WakeTouchScreenUp"}, //17.0.0+ - {1321, nullptr, "PutTouchScreenToSleep"}, //17.0.0+ - {1322, nullptr, "AcquireTouchScreenAsyncWakeCompletedEvent"}, //20.0.0+ - {1323, nullptr, "StartTouchScreenAutoTuneForSystemSettings"}, //21.0.0+ - {1324, nullptr, "AcquireTouchScreenAutoTuneCompletedEvent"}, //21.0.0+ - {1325, nullptr, "IsTouchScreenAutoTuneRequiredForRepairProviderReplacement"}, //21.0.0+ - {1326, nullptr, "SetTouchScreenOffset"}, //21.0.0+ - {1420, nullptr, "GetAppletResourceProperty"}, //19.0.0+ - {12010, nullptr, "SetButtonConfigLeft"} //11.0.0-17.0.1 - }; - // clang-format on - - RegisterHandlers(functions); joy_detach_event = service_context.CreateEvent("IHidSystemServer::JoyDetachEvent"); acquire_device_registered_event = diff --git a/src/core/hle/service/hid/hid_system_server.h b/src/core/hle/service/hid/hid_system_server.h index 1a4f244d72..e5da7bbdac 100644 --- a/src/core/hle/service/hid/hid_system_server.h +++ b/src/core/hle/service/hid/hid_system_server.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -81,6 +84,252 @@ private: std::shared_ptr GetResourceManager(); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{31, nullptr, "SendKeyboardLockKeyEvent"}, + FunctionInfo{101, nullptr, "AcquireHomeButtonEventHandle"}, + FunctionInfo{111, nullptr, "ActivateHomeButton"}, + FunctionInfo{121, nullptr, "AcquireSleepButtonEventHandle"}, + FunctionInfo{131, nullptr, "ActivateSleepButton"}, + FunctionInfo{141, nullptr, "AcquireCaptureButtonEventHandle"}, + FunctionInfo{151, nullptr, "ActivateCaptureButton"}, + FunctionInfo{161, &IHidSystemServer::GetPlatformConfig, "GetPlatformConfig"}, + FunctionInfo{210, nullptr, "AcquireNfcDeviceUpdateEventHandle"}, + FunctionInfo{211, nullptr, "GetNpadsWithNfc"}, + FunctionInfo{212, nullptr, "AcquireNfcActivateEventHandle"}, + FunctionInfo{213, nullptr, "ActivateNfc"}, + FunctionInfo{214, nullptr, "GetXcdHandleForNpadWithNfc"}, + FunctionInfo{215, nullptr, "IsNfcActivated"}, + FunctionInfo{216, nullptr, "GetAbstractedPadIdForNpadWithNfc"}, + FunctionInfo{217, nullptr, "SetNfcEvent"}, + FunctionInfo{218, nullptr, "GetNfcInfo"}, + FunctionInfo{219, nullptr, "StartNfcDiscovery"}, + FunctionInfo{220, nullptr, "StopNfcDiscovery"}, + FunctionInfo{221, nullptr, "StartNtagRead"}, + FunctionInfo{222, nullptr, "StartNtagWrite"}, + FunctionInfo{223, nullptr, "SendNfcRawData"}, + FunctionInfo{224, nullptr, "RegisterMifareKey"}, + FunctionInfo{225, nullptr, "ClearMifareKey"}, + FunctionInfo{226, nullptr, "StartMifareRead"}, + FunctionInfo{227, nullptr, "StartMifareWrite"}, + FunctionInfo{230, nullptr, "AcquireIrSensorEventHndle" }, + FunctionInfo{231, nullptr, "ActivateIrSensor"}, + FunctionInfo{232, nullptr, "GetIrSensorState"}, + FunctionInfo{233, nullptr, "GetXcdHandleForNpadWihIrSensor" }, + FunctionInfo{234, nullptr, "GetNpadJoyHoldType"}, + FunctionInfo{241, nullptr, "GetDataFormat"}, + FunctionInfo{242, nullptr, "SetDataFormat"}, + FunctionInfo{243, nullptr, "GetMcuState"}, + FunctionInfo{244, nullptr, "SetMcuState"}, + FunctionInfo{245, nullptr, "GetMcuVersionForNfc"}, + FunctionInfo{246, nullptr, "CheckNfcDevicePower"}, + FunctionInfo{247, nullptr, "SetMcuStateImmediate"}, + FunctionInfo{301, nullptr, "ActivateNpadSystem"}, + FunctionInfo{303, &IHidSystemServer::ApplyNpadSystemCommonPolicy, "ApplyNpadSystemCommonPolicy"}, + FunctionInfo{304, &IHidSystemServer::EnableAssigningSingleOnSlSrPress, "EnableAssigningSingleOnSlSrPress"}, + FunctionInfo{305, &IHidSystemServer::DisableAssigningSingleOnSlSrPress, "DisableAssigningSingleOnSlSrPress"}, + FunctionInfo{306, &IHidSystemServer::GetLastActiveNpad, "GetLastActiveNpad"}, + FunctionInfo{307, nullptr, "GetNpadSystemExtStyle"}, + FunctionInfo{308, &IHidSystemServer::ApplyNpadSystemCommonPolicyFull, "ApplyNpadSystemCommonPolicyFull"}, + FunctionInfo{309, &IHidSystemServer::GetNpadFullKeyGripColor, "GetNpadFullKeyGripColor"}, + FunctionInfo{310, &IHidSystemServer::GetMaskedSupportedNpadStyleSet, "GetMaskedSupportedNpadStyleSet"}, + FunctionInfo{311, nullptr, "SetNpadPlayerLedBlinkingDevice"}, + FunctionInfo{312, &IHidSystemServer::SetSupportedNpadStyleSetAll, "SetSupportedNpadStyleSetAll"}, + FunctionInfo{313, &IHidSystemServer::GetNpadCaptureButtonAssignment, "GetNpadCaptureButtonAssignment"}, + FunctionInfo{314, nullptr, "GetAppletFooterUiType"}, + FunctionInfo{315, &IHidSystemServer::GetAppletDetailedUiType, "GetAppletDetailedUiType"}, + FunctionInfo{316, &IHidSystemServer::GetNpadInterfaceType, "GetNpadInterfaceType"}, + FunctionInfo{317, &IHidSystemServer::GetNpadLeftRightInterfaceType, "GetNpadLeftRightInterfaceType"}, + FunctionInfo{318, &IHidSystemServer::HasBattery, "HasBattery"}, + FunctionInfo{319, &IHidSystemServer::HasLeftRightBattery, "HasLeftRightBattery"}, + FunctionInfo{321, &IHidSystemServer::GetUniquePadsFromNpad, "GetUniquePadsFromNpad"}, + FunctionInfo{322, &IHidSystemServer::SetNpadSystemExtStateEnabled, "SetNpadSystemExtStateEnabled"}, + FunctionInfo{323, nullptr, "GetLastActiveUniquePad"}, + FunctionInfo{324, nullptr, "GetUniquePadButtonSet"}, + FunctionInfo{325, nullptr, "GetUniquePadColor"}, + FunctionInfo{326, nullptr, "GetUniquePadAppletDetailedUiType"}, + FunctionInfo{327, nullptr, "GetAbstractedPadIdDataFromNpad"}, + FunctionInfo{328, nullptr, "AttachAbstractedPadToNpad"}, + FunctionInfo{329, nullptr, "DetachAbstractedPadAll"}, + FunctionInfo{330, nullptr, "CheckAbstractedPadConnection"}, + FunctionInfo{332, nullptr, "ConvertAppletDetailedUiTypeFromPlayReportType", MakeVersionGate({19,0,0})}, + FunctionInfo{333, nullptr, "SetNpadUserSpgApplet", MakeVersionGate({20,0,0})}, + FunctionInfo{334, nullptr, "AcquireUniquePadButtonStateChangedEventHandle", MakeVersionGate({20,0,0})}, + FunctionInfo{501, &IHidSystemServer::RegisterAppletResourceUserId, "RegisterAppletResourceUserId"}, + FunctionInfo{502, &IHidSystemServer::UnregisterAppletResourceUserId, "UnregisterAppletResourceUserId"}, + FunctionInfo{503, &IHidSystemServer::EnableAppletToGetInput, "EnableAppletToGetInput"}, + FunctionInfo{504, &IHidSystemServer::SetAruidValidForVibration, "SetAruidValidForVibration"}, + FunctionInfo{505, &IHidSystemServer::EnableAppletToGetSixAxisSensor, "EnableAppletToGetSixAxisSensor"}, + FunctionInfo{506, &IHidSystemServer::EnableAppletToGetPadInput, "EnableAppletToGetPadInput"}, + FunctionInfo{507, &IHidSystemServer::EnableAppletToGetTouchScreen, "EnableAppletToGetTouchScreen"}, + FunctionInfo{510, &IHidSystemServer::SetVibrationMasterVolume, "SetVibrationMasterVolume"}, + FunctionInfo{511, &IHidSystemServer::GetVibrationMasterVolume, "GetVibrationMasterVolume"}, + FunctionInfo{512, &IHidSystemServer::BeginPermitVibrationSession, "BeginPermitVibrationSession"}, + FunctionInfo{513, &IHidSystemServer::EndPermitVibrationSession, "EndPermitVibrationSession"}, + FunctionInfo{514, nullptr, "Unknown514"}, + FunctionInfo{520, nullptr, "EnableHandheldHids"}, + FunctionInfo{521, nullptr, "DisableHandheldHids"}, + FunctionInfo{522, nullptr, "SetJoyConRailEnabled"}, + FunctionInfo{523, &IHidSystemServer::IsJoyConRailEnabled, "IsJoyConRailEnabled"}, + FunctionInfo{524, nullptr, "IsHandheldHidsEnabled"}, + FunctionInfo{525, &IHidSystemServer::IsJoyConAttachedOnAllRail, "IsJoyConAttachedOnAllRail"}, + FunctionInfo{540, nullptr, "AcquirePlayReportControllerUsageUpdateEvent"}, + FunctionInfo{541, nullptr, "GetPlayReportControllerUsages"}, + FunctionInfo{542, nullptr, "AcquirePlayReportRegisteredDeviceUpdateEvent"}, + FunctionInfo{543, nullptr, "GetRegisteredDevicesOld"}, + FunctionInfo{544, &IHidSystemServer::AcquireConnectionTriggerTimeoutEvent, "AcquireConnectionTriggerTimeoutEvent"}, + FunctionInfo{545, nullptr, "SendConnectionTrigger"}, + FunctionInfo{546, &IHidSystemServer::AcquireDeviceRegisteredEventForControllerSupport, "AcquireDeviceRegisteredEventForControllerSupport"}, + FunctionInfo{547, nullptr, "GetAllowedBluetoothLinksCount"}, + FunctionInfo{548, &IHidSystemServer::GetRegisteredDevices, "GetRegisteredDevices"}, + FunctionInfo{549, nullptr, "GetConnectableRegisteredDevices"}, + FunctionInfo{551, &IHidSystemServer::GetRegisteredDevices, "GetRegisteredDevicesForControllerSupport", MakeVersionGate({20,0,0})}, //mocked via 548 for Diablo 3 (at least) + FunctionInfo{700, nullptr, "ActivateUniquePad"}, + FunctionInfo{702, &IHidSystemServer::AcquireUniquePadConnectionEventHandle, "AcquireUniquePadConnectionEventHandle"}, + FunctionInfo{703, &IHidSystemServer::GetUniquePadIds, "GetUniquePadIds"}, + FunctionInfo{711, nullptr, "AcquireUniquePadConnectionOnHandheldForNsEventHandle", MakeVersionGate({20,0,0})}, + FunctionInfo{712, nullptr, "GetUniquePadColor12", MakeVersionGate({20,0,0})}, + FunctionInfo{751, &IHidSystemServer::AcquireJoyDetachOnBluetoothOffEventHandle, "AcquireJoyDetachOnBluetoothOffEventHandle"}, + FunctionInfo{800, nullptr, "ListSixAxisSensorHandles"}, + FunctionInfo{801, nullptr, "IsSixAxisSensorUserCalibrationSupported"}, + FunctionInfo{802, nullptr, "ResetSixAxisSensorCalibrationValues"}, + FunctionInfo{803, nullptr, "StartSixAxisSensorUserCalibration"}, + FunctionInfo{804, nullptr, "CancelSixAxisSensorUserCalibration"}, + FunctionInfo{805, nullptr, "GetUniquePadBluetoothAddress"}, + FunctionInfo{806, nullptr, "DisconnectUniquePad"}, + FunctionInfo{807, nullptr, "GetUniquePadType"}, + FunctionInfo{808, nullptr, "GetUniquePadInterface"}, + FunctionInfo{809, nullptr, "GetUniquePadSerialNumber"}, + FunctionInfo{810, nullptr, "GetUniquePadControllerNumber"}, + FunctionInfo{811, nullptr, "GetSixAxisSensorUserCalibrationStage"}, + FunctionInfo{812, nullptr, "GetConsoleUniqueSixAxisSensorHandle"}, + FunctionInfo{813, nullptr, "GetDeviceType"}, + FunctionInfo{821, nullptr, "StartAnalogStickManualCalibration"}, + FunctionInfo{822, nullptr, "RetryCurrentAnalogStickManualCalibrationStage"}, + FunctionInfo{823, nullptr, "CancelAnalogStickManualCalibration"}, + FunctionInfo{824, nullptr, "ResetAnalogStickManualCalibration"}, + FunctionInfo{825, nullptr, "GetAnalogStickState"}, + FunctionInfo{826, nullptr, "GetAnalogStickManualCalibrationStage"}, + FunctionInfo{827, nullptr, "IsAnalogStickButtonPressed"}, + FunctionInfo{828, nullptr, "IsAnalogStickInReleasePosition"}, + FunctionInfo{829, nullptr, "IsAnalogStickInCircumference"}, + FunctionInfo{830, nullptr, "SetNotificationLedPattern"}, + FunctionInfo{831, nullptr, "SetNotificationLedPatternWithTimeout"}, + FunctionInfo{832, nullptr, "PrepareHidsForNotificationWake"}, + FunctionInfo{850, &IHidSystemServer::IsUsbFullKeyControllerEnabled, "IsUsbFullKeyControllerEnabled"}, + FunctionInfo{851, &IHidSystemServer::EnableUsbFullKeyController, "EnableUsbFullKeyController"}, + FunctionInfo{852, nullptr, "IsUsbConnected"}, + FunctionInfo{870, &IHidSystemServer::IsHandheldButtonPressedOnConsoleMode, "IsHandheldButtonPressedOnConsoleMode"}, + FunctionInfo{900, nullptr, "ActivateInputDetector"}, + FunctionInfo{901, nullptr, "NotifyInputDetector"}, + FunctionInfo{1000, &IHidSystemServer::InitializeFirmwareUpdate, "InitializeFirmwareUpdate"}, + FunctionInfo{1001, nullptr, "GetFirmwareVersion"}, + FunctionInfo{1002, nullptr, "GetAvailableFirmwareVersion"}, + FunctionInfo{1003, nullptr, "IsFirmwareUpdateAvailable"}, + FunctionInfo{1004, &IHidSystemServer::CheckFirmwareUpdateRequired, "CheckFirmwareUpdateRequired"}, + FunctionInfo{1005, nullptr, "StartFirmwareUpdate"}, + FunctionInfo{1006, nullptr, "AbortFirmwareUpdate"}, + FunctionInfo{1007, nullptr, "GetFirmwareUpdateState"}, + FunctionInfo{1008, nullptr, "ActivateAudioControl"}, + FunctionInfo{1009, nullptr, "AcquireAudioControlEventHandle"}, + FunctionInfo{1010, nullptr, "GetAudioControlStates"}, + FunctionInfo{1011, nullptr, "DeactivateAudioControl"}, + FunctionInfo{1012, nullptr, "GetFirmwareVersionStringForUserSupportPage"}, + FunctionInfo{1050, nullptr, "IsSixAxisSensorAccurateUserCalibrationSupported"}, + FunctionInfo{1051, nullptr, "StartSixAxisSensorAccurateUserCalibration"}, + FunctionInfo{1052, nullptr, "CancelSixAxisSensorAccurateUserCalibration"}, + FunctionInfo{1053, nullptr, "GetSixAxisSensorAccurateUserCalibrationState"}, + FunctionInfo{1100, nullptr, "GetHidbusSystemServiceObject"}, + FunctionInfo{1120, &IHidSystemServer::SetFirmwareHotfixUpdateSkipEnabled, "SetFirmwareHotfixUpdateSkipEnabled"}, + FunctionInfo{1130, &IHidSystemServer::InitializeUsbFirmwareUpdate, "InitializeUsbFirmwareUpdate"}, + FunctionInfo{1131, &IHidSystemServer::FinalizeUsbFirmwareUpdate, "FinalizeUsbFirmwareUpdate"}, + FunctionInfo{1132, &IHidSystemServer::CheckUsbFirmwareUpdateRequired, "CheckUsbFirmwareUpdateRequired"}, + FunctionInfo{1133, nullptr, "StartUsbFirmwareUpdate"}, + FunctionInfo{1134, nullptr, "GetUsbFirmwareUpdateState"}, + FunctionInfo{1135, &IHidSystemServer::InitializeUsbFirmwareUpdateWithoutMemory, "InitializeUsbFirmwareUpdateWithoutMemory"}, + FunctionInfo{1150, &IHidSystemServer::SetTouchScreenMagnification, "SetTouchScreenMagnification"}, + FunctionInfo{1151, &IHidSystemServer::GetTouchScreenFirmwareVersion, "GetTouchScreenFirmwareVersion"}, + FunctionInfo{1152, &IHidSystemServer::SetTouchScreenDefaultConfiguration, "SetTouchScreenDefaultConfiguration"}, + FunctionInfo{1153, &IHidSystemServer::GetTouchScreenDefaultConfiguration, "GetTouchScreenDefaultConfiguration"}, + FunctionInfo{1154, nullptr, "IsFirmwareAvailableForNotification"}, + FunctionInfo{1155, &IHidSystemServer::SetForceHandheldStyleVibration, "SetForceHandheldStyleVibration"}, + FunctionInfo{1156, nullptr, "SendConnectionTriggerWithoutTimeoutEvent"}, + FunctionInfo{1157, nullptr, "CancelConnectionTrigger"}, + FunctionInfo{1158, nullptr, "SetConnectionLimitForSplay", MakeVersionGate({20,1,0})}, + FunctionInfo{1159, nullptr, "ClearConnectionLimitForSplay", MakeVersionGate({20,1,0})}, + FunctionInfo{1200, nullptr, "IsButtonConfigSupported"}, + FunctionInfo{1201, nullptr, "IsButtonConfigEmbeddedSupported"}, + FunctionInfo{1202, nullptr, "DeleteButtonConfig"}, + FunctionInfo{1203, nullptr, "DeleteButtonConfigEmbedded"}, + FunctionInfo{1204, nullptr, "SetButtonConfigEnabled"}, + FunctionInfo{1205, nullptr, "SetButtonConfigEmbeddedEnabled"}, + FunctionInfo{1206, nullptr, "IsButtonConfigEnabled"}, + FunctionInfo{1207, nullptr, "IsButtonConfigEmbeddedEnabled"}, + FunctionInfo{1208, nullptr, "SetButtonConfigEmbedded"}, + FunctionInfo{1209, nullptr, "SetButtonConfigFull"}, + FunctionInfo{1210, nullptr, "SetButtonConfigLeft"}, + FunctionInfo{1211, nullptr, "SetButtonConfigRight"}, + FunctionInfo{1212, nullptr, "GetButtonConfigEmbedded"}, + FunctionInfo{1213, nullptr, "GetButtonConfigFull"}, + FunctionInfo{1214, nullptr, "GetButtonConfigLeft"}, + FunctionInfo{1215, nullptr, "GetButtonConfigRight"}, + FunctionInfo{1250, nullptr, "IsCustomButtonConfigSupported"}, + FunctionInfo{1251, nullptr, "IsDefaultButtonConfigEmbedded"}, + FunctionInfo{1252, nullptr, "IsDefaultButtonConfigFull"}, + FunctionInfo{1253, nullptr, "IsDefaultButtonConfigLeft"}, + FunctionInfo{1254, nullptr, "IsDefaultButtonConfigRight"}, + FunctionInfo{1255, nullptr, "IsButtonConfigStorageEmbeddedEmpty"}, + FunctionInfo{1256, nullptr, "IsButtonConfigStorageFullEmpty"}, + FunctionInfo{1257, nullptr, "IsButtonConfigStorageLeftEmpty"}, + FunctionInfo{1258, nullptr, "IsButtonConfigStorageRightEmpty"}, + FunctionInfo{1259, nullptr, "GetButtonConfigStorageEmbeddedDeprecated"}, + FunctionInfo{1260, nullptr, "GetButtonConfigStorageFullDeprecated"}, + FunctionInfo{1261, nullptr, "GetButtonConfigStorageLeftDeprecated"}, + FunctionInfo{1262, nullptr, "GetButtonConfigStorageRightDeprecated"}, + FunctionInfo{1263, nullptr, "SetButtonConfigStorageEmbeddedDeprecated"}, + FunctionInfo{1264, nullptr, "SetButtonConfigStorageFullDeprecated"}, + FunctionInfo{1265, nullptr, "SetButtonConfigStorageLeftDeprecated"}, + FunctionInfo{1266, nullptr, "SetButtonConfigStorageRightDeprecated"}, + FunctionInfo{1267, nullptr, "DeleteButtonConfigStorageEmbedded"}, + FunctionInfo{1268, nullptr, "DeleteButtonConfigStorageFull"}, + FunctionInfo{1269, nullptr, "DeleteButtonConfigStorageLeft"}, + FunctionInfo{1270, nullptr, "DeleteButtonConfigStorageRight"}, + FunctionInfo{1271, &IHidSystemServer::IsUsingCustomButtonConfig, "IsUsingCustomButtonConfig"}, + FunctionInfo{1272, &IHidSystemServer::IsAnyCustomButtonConfigEnabled, "IsAnyCustomButtonConfigEnabled"}, + FunctionInfo{1273, nullptr, "SetAllCustomButtonConfigEnabled"}, + FunctionInfo{1274, nullptr, "SetDefaultButtonConfig"}, + FunctionInfo{1275, nullptr, "SetAllDefaultButtonConfig"}, + FunctionInfo{1276, nullptr, "SetHidButtonConfigEmbedded"}, + FunctionInfo{1277, nullptr, "SetHidButtonConfigFull"}, + FunctionInfo{1278, nullptr, "SetHidButtonConfigLeft"}, + FunctionInfo{1279, nullptr, "SetHidButtonConfigRight"}, + FunctionInfo{1280, nullptr, "GetHidButtonConfigEmbedded"}, + FunctionInfo{1281, nullptr, "GetHidButtonConfigFull"}, + FunctionInfo{1282, nullptr, "GetHidButtonConfigLeft"}, + FunctionInfo{1283, nullptr, "GetHidButtonConfigRight"}, + FunctionInfo{1284, nullptr, "GetButtonConfigStorageEmbedded"}, + FunctionInfo{1285, nullptr, "GetButtonConfigStorageFull"}, + FunctionInfo{1286, nullptr, "GetButtonConfigStorageLeft"}, + FunctionInfo{1287, nullptr, "GetButtonConfigStorageRight"}, + FunctionInfo{1288, nullptr, "SetButtonConfigStorageEmbedded"}, + FunctionInfo{1289, nullptr, "SetButtonConfigStorageFull"}, + FunctionInfo{1290, nullptr, "DeleteButtonConfigStorageRight"}, + FunctionInfo{1291, nullptr, "DeleteButtonConfigStorageRight"}, + FunctionInfo{1308, nullptr, "SetButtonConfigVisible", MakeVersionGate({18,0,0})}, + FunctionInfo{1309, nullptr, "IsButtonConfigVisible", MakeVersionGate({18,0,0})}, + FunctionInfo{1320, nullptr, "WakeTouchScreenUp", MakeVersionGate({17,0,0})}, + FunctionInfo{1321, nullptr, "PutTouchScreenToSleep", MakeVersionGate({17,0,0})}, + FunctionInfo{1322, nullptr, "AcquireTouchScreenAsyncWakeCompletedEvent", MakeVersionGate({20,0,0})}, + FunctionInfo{1323, nullptr, "StartTouchScreenAutoTuneForSystemSettings", MakeVersionGate({21,0,0})}, + FunctionInfo{1324, nullptr, "AcquireTouchScreenAutoTuneCompletedEvent", MakeVersionGate({21,0,0})}, + FunctionInfo{1325, nullptr, "IsTouchScreenAutoTuneRequiredForRepairProviderReplacement", MakeVersionGate({21,0,0})}, + FunctionInfo{1326, nullptr, "SetTouchScreenOffset", MakeVersionGate({21,0,0})}, + FunctionInfo{1420, nullptr, "GetAppletResourceProperty", MakeVersionGate({19,0,0})}, + FunctionInfo{12010, nullptr, "SetButtonConfigLeft", MakeVersionGate({11,0,0}, {17,0,1})} + ); + Kernel::KEvent* acquire_connection_trigger_timeout_event; Kernel::KEvent* acquire_device_registered_event; Kernel::KEvent* joy_detach_event; diff --git a/src/core/hle/service/hid/hidbus.cpp b/src/core/hle/service/hid/hidbus.cpp index 70bb5437e3..326cfbf74b 100644 --- a/src/core/hle/service/hid/hidbus.cpp +++ b/src/core/hle/service/hid/hidbus.cpp @@ -26,30 +26,28 @@ namespace Service::HID { // (15ms, 66Hz) constexpr auto hidbus_update_ns = std::chrono::nanoseconds{15 * 1000 * 1000}; +std::optional Hidbus::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, C<&Hidbus::GetBusHandle>, "GetBusHandle"}, + FunctionInfo{2, C<&Hidbus::IsExternalDeviceConnected>, "IsExternalDeviceConnected"}, + FunctionInfo{3, C<&Hidbus::Initialize>, "Initialize"}, + FunctionInfo{4, C<&Hidbus::Finalize>, "Finalize"}, + FunctionInfo{5, C<&Hidbus::EnableExternalDevice>, "EnableExternalDevice"}, + FunctionInfo{6, C<&Hidbus::GetExternalDeviceId>, "GetExternalDeviceId"}, + FunctionInfo{7, C<&Hidbus::SendCommandAsync>, "SendCommandAsync"}, + FunctionInfo{8, C<&Hidbus::GetSendCommandAsynceResult>, "GetSendCommandAsynceResult"}, + FunctionInfo{9, C<&Hidbus::SetEventForSendCommandAsycResult>, "SetEventForSendCommandAsycResult"}, + FunctionInfo{10, C<&Hidbus::GetSharedMemoryHandle>, "GetSharedMemoryHandle"}, + FunctionInfo{11, C<&Hidbus::EnableJoyPollingReceiveMode>, "EnableJoyPollingReceiveMode"}, + FunctionInfo{12, C<&Hidbus::DisableJoyPollingReceiveMode>, "DisableJoyPollingReceiveMode"}, + FunctionInfo{13, nullptr, "GetPollingData"}, + FunctionInfo{14, C<&Hidbus::SetStatusManagerType>, "SetStatusManagerType"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + Hidbus::Hidbus(Core::System& system_) : ServiceFramework{system_, "hidbus"}, service_context{system_, service_name} { - - // clang-format off - static const FunctionInfo functions[] = { - {1, C<&Hidbus::GetBusHandle>, "GetBusHandle"}, - {2, C<&Hidbus::IsExternalDeviceConnected>, "IsExternalDeviceConnected"}, - {3, C<&Hidbus::Initialize>, "Initialize"}, - {4, C<&Hidbus::Finalize>, "Finalize"}, - {5, C<&Hidbus::EnableExternalDevice>, "EnableExternalDevice"}, - {6, C<&Hidbus::GetExternalDeviceId>, "GetExternalDeviceId"}, - {7, C<&Hidbus::SendCommandAsync>, "SendCommandAsync"}, - {8, C<&Hidbus::GetSendCommandAsynceResult>, "GetSendCommandAsynceResult"}, - {9, C<&Hidbus::SetEventForSendCommandAsycResult>, "SetEventForSendCommandAsycResult"}, - {10, C<&Hidbus::GetSharedMemoryHandle>, "GetSharedMemoryHandle"}, - {11, C<&Hidbus::EnableJoyPollingReceiveMode>, "EnableJoyPollingReceiveMode"}, - {12, C<&Hidbus::DisableJoyPollingReceiveMode>, "DisableJoyPollingReceiveMode"}, - {13, nullptr, "GetPollingData"}, - {14, C<&Hidbus::SetStatusManagerType>, "SetStatusManagerType"}, - }; - // clang-format on - - RegisterHandlers(functions); - // Register update callbacks hidbus_update_event = Core::Timing::CreateEvent( "Hidbus::UpdateCallback", diff --git a/src/core/hle/service/hid/hidbus.h b/src/core/hle/service/hid/hidbus.h index af4d956673..9ad097150e 100644 --- a/src/core/hle/service/hid/hidbus.h +++ b/src/core/hle/service/hid/hidbus.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -144,6 +147,8 @@ private: } } + std::optional FindRequest(u32 key) override; + bool is_hidbus_enabled{false}; HidbusStatusManager hidbus_status{}; std::array devices{}; diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp index 3d87e6788d..a17395b596 100644 --- a/src/core/hle/service/hid/irs.cpp +++ b/src/core/hle/service/hid/irs.cpp @@ -29,32 +29,32 @@ namespace Service::IRS { -IRS::IRS(Core::System& system_) : ServiceFramework{system_, "irs"} { - // clang-format off - static const FunctionInfo functions[] = { - {302, C<&IRS::ActivateIrsensor>, "ActivateIrsensor"}, - {303, C<&IRS::DeactivateIrsensor>, "DeactivateIrsensor"}, - {304, C<&IRS::GetIrsensorSharedMemoryHandle>, "GetIrsensorSharedMemoryHandle"}, - {305, C<&IRS::StopImageProcessor>, "StopImageProcessor"}, - {306, C<&IRS::RunMomentProcessor>, "RunMomentProcessor"}, - {307, C<&IRS::RunClusteringProcessor>, "RunClusteringProcessor"}, - {308, C<&IRS::RunImageTransferProcessor>, "RunImageTransferProcessor"}, - {309, C<&IRS::GetImageTransferProcessorState>, "GetImageTransferProcessorState"}, - {310, C<&IRS::RunTeraPluginProcessor>, "RunTeraPluginProcessor"}, - {311, C<&IRS::GetNpadIrCameraHandle>, "GetNpadIrCameraHandle"}, - {312, C<&IRS::RunPointingProcessor>, "RunPointingProcessor"}, - {313, C<&IRS::SuspendImageProcessor>, "SuspendImageProcessor"}, - {314, C<&IRS::CheckFirmwareVersion>, "CheckFirmwareVersion"}, - {315, C<&IRS::SetFunctionLevel>, "SetFunctionLevel"}, - {316, C<&IRS::RunImageTransferExProcessor>, "RunImageTransferExProcessor"}, - {317, C<&IRS::RunIrLedProcessor>, "RunIrLedProcessor"}, - {318, C<&IRS::StopImageProcessorAsync>, "StopImageProcessorAsync"}, - {319, C<&IRS::ActivateIrsensorWithFunctionLevel>, "ActivateIrsensorWithFunctionLevel"}, - }; - // clang-format on +std::optional IRS::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{302, C<&IRS::ActivateIrsensor>, "ActivateIrsensor"}, + FunctionInfo{303, C<&IRS::DeactivateIrsensor>, "DeactivateIrsensor"}, + FunctionInfo{304, C<&IRS::GetIrsensorSharedMemoryHandle>, "GetIrsensorSharedMemoryHandle"}, + FunctionInfo{305, C<&IRS::StopImageProcessor>, "StopImageProcessor"}, + FunctionInfo{306, C<&IRS::RunMomentProcessor>, "RunMomentProcessor"}, + FunctionInfo{307, C<&IRS::RunClusteringProcessor>, "RunClusteringProcessor"}, + FunctionInfo{308, C<&IRS::RunImageTransferProcessor>, "RunImageTransferProcessor"}, + FunctionInfo{309, C<&IRS::GetImageTransferProcessorState>, "GetImageTransferProcessorState"}, + FunctionInfo{310, C<&IRS::RunTeraPluginProcessor>, "RunTeraPluginProcessor"}, + FunctionInfo{311, C<&IRS::GetNpadIrCameraHandle>, "GetNpadIrCameraHandle"}, + FunctionInfo{312, C<&IRS::RunPointingProcessor>, "RunPointingProcessor"}, + FunctionInfo{313, C<&IRS::SuspendImageProcessor>, "SuspendImageProcessor"}, + FunctionInfo{314, C<&IRS::CheckFirmwareVersion>, "CheckFirmwareVersion"}, + FunctionInfo{315, C<&IRS::SetFunctionLevel>, "SetFunctionLevel"}, + FunctionInfo{316, C<&IRS::RunImageTransferExProcessor>, "RunImageTransferExProcessor"}, + FunctionInfo{317, C<&IRS::RunIrLedProcessor>, "RunIrLedProcessor"}, + FunctionInfo{318, C<&IRS::StopImageProcessorAsync>, "StopImageProcessorAsync"}, + FunctionInfo{319, C<&IRS::ActivateIrsensorWithFunctionLevel>, "ActivateIrsensorWithFunctionLevel"} + ); + return HandlerTableGenerateWithFind(key, functions); +} +IRS::IRS(Core::System& system_) : ServiceFramework{system_, "irs"} { u8* raw_shared_memory = system.Kernel().GetIrsSharedMem().GetPointer(); - RegisterHandlers(functions); shared_memory = std::construct_at(reinterpret_cast(raw_shared_memory)); npad_device = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); @@ -369,16 +369,6 @@ Core::IrSensor::DeviceFormat& IRS::GetIrCameraSharedMemoryDeviceEntry( } IRS_SYS::IRS_SYS(Core::System& system_) : ServiceFramework{system_, "irs:sys"} { - // clang-format off - static const FunctionInfo functions[] = { - {500, nullptr, "SetAppletResourceUserId"}, - {501, nullptr, "RegisterAppletResourceUserId"}, - {502, nullptr, "UnregisterAppletResourceUserId"}, - {503, nullptr, "EnableAppletToGetInput"}, - }; - // clang-format on - - RegisterHandlers(functions); } IRS_SYS::~IRS_SYS() = default; diff --git a/src/core/hle/service/hid/irs.h b/src/core/hle/service/hid/irs.h index 58dfee6c36..be81ea75a9 100644 --- a/src/core/hle/service/hid/irs.h +++ b/src/core/hle/service/hid/irs.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -154,6 +157,8 @@ private: return static_cast(*processors[index]); } + std::optional FindRequest(u32 key) override; + Core::HID::EmulatedController* npad_device = nullptr; StatusManager* shared_memory = nullptr; std::array, 9> processors{}; @@ -163,6 +168,16 @@ class IRS_SYS final : public ServiceFramework { public: explicit IRS_SYS(Core::System& system); ~IRS_SYS() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{500, nullptr, "SetAppletResourceUserId"}, + FunctionInfo{501, nullptr, "RegisterAppletResourceUserId"}, + FunctionInfo{502, nullptr, "UnregisterAppletResourceUserId"}, + FunctionInfo{503, nullptr, "EnableAppletToGetInput"} + ); }; } // namespace Service::IRS diff --git a/src/core/hle/service/hid/xcd.cpp b/src/core/hle/service/hid/xcd.cpp index 75cc266ea9..6b8ae7048c 100644 --- a/src/core/hle/service/hid/xcd.cpp +++ b/src/core/hle/service/hid/xcd.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -6,33 +9,6 @@ namespace Service::HID { XCD_SYS::XCD_SYS(Core::System& system_) : ServiceFramework{system_, "xcd:sys"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetDataFormat"}, - {1, nullptr, "SetDataFormat"}, - {2, nullptr, "GetMcuState"}, - {3, nullptr, "SetMcuState"}, - {4, nullptr, "GetMcuVersionForNfc"}, - {5, nullptr, "CheckNfcDevicePower"}, - {10, nullptr, "SetNfcEvent"}, - {11, nullptr, "GetNfcInfo"}, - {12, nullptr, "StartNfcDiscovery"}, - {13, nullptr, "StopNfcDiscovery"}, - {14, nullptr, "StartNtagRead"}, - {15, nullptr, "StartNtagWrite"}, - {16, nullptr, "SendNfcRawData"}, - {17, nullptr, "RegisterMifareKey"}, - {18, nullptr, "ClearMifareKey"}, - {19, nullptr, "StartMifareRead"}, - {20, nullptr, "StartMifareWrite"}, - {101, nullptr, "GetAwakeTriggerReasonForLeftRail"}, - {102, nullptr, "GetAwakeTriggerReasonForRightRail"}, - {103, nullptr, "GetAwakeTriggerBatteryLevelTransitionForLeftRail"}, - {104, nullptr, "GetAwakeTriggerBatteryLevelTransitionForRightRail"}, - }; - // clang-format on - - RegisterHandlers(functions); } XCD_SYS::~XCD_SYS() = default; diff --git a/src/core/hle/service/hid/xcd.h b/src/core/hle/service/hid/xcd.h index fe0b91b919..af1dd88ef7 100644 --- a/src/core/hle/service/hid/xcd.h +++ b/src/core/hle/service/hid/xcd.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,33 @@ class XCD_SYS final : public ServiceFramework { public: explicit XCD_SYS(Core::System& system_); ~XCD_SYS() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetDataFormat"}, + FunctionInfo{1, nullptr, "SetDataFormat"}, + FunctionInfo{2, nullptr, "GetMcuState"}, + FunctionInfo{3, nullptr, "SetMcuState"}, + FunctionInfo{4, nullptr, "GetMcuVersionForNfc"}, + FunctionInfo{5, nullptr, "CheckNfcDevicePower"}, + FunctionInfo{10, nullptr, "SetNfcEvent"}, + FunctionInfo{11, nullptr, "GetNfcInfo"}, + FunctionInfo{12, nullptr, "StartNfcDiscovery"}, + FunctionInfo{13, nullptr, "StopNfcDiscovery"}, + FunctionInfo{14, nullptr, "StartNtagRead"}, + FunctionInfo{15, nullptr, "StartNtagWrite"}, + FunctionInfo{16, nullptr, "SendNfcRawData"}, + FunctionInfo{17, nullptr, "RegisterMifareKey"}, + FunctionInfo{18, nullptr, "ClearMifareKey"}, + FunctionInfo{19, nullptr, "StartMifareRead"}, + FunctionInfo{20, nullptr, "StartMifareWrite"}, + FunctionInfo{101, nullptr, "GetAwakeTriggerReasonForLeftRail"}, + FunctionInfo{102, nullptr, "GetAwakeTriggerReasonForRightRail"}, + FunctionInfo{103, nullptr, "GetAwakeTriggerBatteryLevelTransitionForLeftRail"}, + FunctionInfo{104, nullptr, "GetAwakeTriggerBatteryLevelTransitionForRightRail"} + ); }; } // namespace Service::HID diff --git a/src/core/hle/service/i2c/i2c.cpp b/src/core/hle/service/i2c/i2c.cpp index 0b242768c2..d0a5e29f8c 100644 --- a/src/core/hle/service/i2c/i2c.cpp +++ b/src/core/hle/service/i2c/i2c.cpp @@ -17,25 +17,26 @@ namespace Service::I2C { class I2CSession final : public ServiceFramework { public: - explicit I2CSession(Core::System& system_) - : ServiceFramework{system_, "I2CSession"} - { - static const FunctionInfo functions[] = { - {0, nullptr, "SendOld"}, - {1, nullptr, "ReceiveOld"}, - {2, nullptr, "ExecuteCommandListOld"}, - {10, C<&I2CSession::Send>, "Send"}, - {11, nullptr, "Receive"}, - {12, nullptr, "ExecuteCommandList"}, - {13, nullptr, "SetRetryPolicy"}, - }; - RegisterHandlers(functions); - } + explicit I2CSession(Core::System& system_) : ServiceFramework{system_, "I2CSession"} {} ~I2CSession() override = default; + Result Send(InBuffer in_data, u32 transaction_option) { LOG_WARNING(Service, "(stubbed) topt={}", transaction_option); R_THROW(ResultUnknown); } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SendOld"}, + FunctionInfo{1, nullptr, "ReceiveOld"}, + FunctionInfo{2, nullptr, "ExecuteCommandListOld"}, + FunctionInfo{10, C<&I2CSession::Send>, "Send"}, + FunctionInfo{11, nullptr, "Receive"}, + FunctionInfo{12, nullptr, "ExecuteCommandList"}, + FunctionInfo{13, nullptr, "SetRetryPolicy"} + ); }; enum class I2CDevice : u32 { @@ -45,19 +46,9 @@ enum class I2CDevice : u32 { class I2C final : public ServiceFramework { public: - explicit I2C(Core::System& system_) - : ServiceFramework{system_, "i2c"} - { - static const FunctionInfo functions[] = { - {0, C<&I2C::OpenSessionForDev>, "OpenSessionForDev"}, - {1, C<&I2C::OpenSession>, "OpenSession"}, - {2, C<&I2C::HasDevice>, "HasDevice"}, - {3, C<&I2C::HasDeviceForDev>, "HasDeviceForDev"}, - {4, C<&I2C::OpenSession2>, "OpenSession2"}, - }; - RegisterHandlers(functions); - } + explicit I2C(Core::System& system_) : ServiceFramework{system_, "i2c"} {} ~I2C() override = default; + Result OpenSessionForDev(OutInterface out_session, s32 bus_idx, u32 slave_address, u32 addressing_mode, u32 speed_mode) { LOG_DEBUG(Service, "(stubbed)"); *out_session = std::make_shared(system); @@ -83,6 +74,17 @@ public: *out_session = std::make_shared(system); R_SUCCEED(); } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&I2C::OpenSessionForDev>, "OpenSessionForDev"}, + FunctionInfo{1, C<&I2C::OpenSession>, "OpenSession"}, + FunctionInfo{2, C<&I2C::HasDevice>, "HasDevice"}, + FunctionInfo{3, C<&I2C::HasDeviceForDev>, "HasDeviceForDev"}, + FunctionInfo{4, C<&I2C::OpenSession2>, "OpenSession2"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/jit/jit.cpp b/src/core/hle/service/jit/jit.cpp index ec3a3a8dcb..9059aaf518 100644 --- a/src/core/hle/service/jit/jit.cpp +++ b/src/core/hle/service/jit/jit.cpp @@ -37,18 +37,6 @@ public: , user_ro{std::move(user_ro_)} , context{process_->GetMemory()} { - - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&IJitEnvironment::GenerateCode>, "GenerateCode"}, - {1, C<&IJitEnvironment::Control>, "Control"}, - {1000, C<&IJitEnvironment::LoadPlugin>, "LoadPlugin"}, - {1001, C<&IJitEnvironment::GetCodeAddress>, "GetCodeAddress"}, - }; - // clang-format on - - RegisterHandlers(functions); - // Identity map user code range into sysmodule context configuration.user_rx_memory.size = user_rx.GetSize(); configuration.user_rx_memory.offset = user_rx.GetAddress(); @@ -59,6 +47,10 @@ public: configuration.sys_ro_memory = configuration.user_ro_memory; } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + ~IJitEnvironment() { user_rx.Finalize(system.Kernel()); user_ro.Finalize(system.Kernel()); @@ -248,6 +240,13 @@ private: return in; } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IJitEnvironment::GenerateCode>, "GenerateCode"}, + FunctionInfo{1, C<&IJitEnvironment::Control>, "Control"}, + FunctionInfo{1000, C<&IJitEnvironment::LoadPlugin>, "LoadPlugin"}, + FunctionInfo{1001, C<&IJitEnvironment::GetCodeAddress>, "GetCodeAddress"} + ); + Kernel::KScopedAutoObject process; CodeMemory user_rx; CodeMemory user_ro; @@ -258,14 +257,10 @@ private: class JITU final : public ServiceFramework { public: - explicit JITU(Core::System& system_) : ServiceFramework{system_, "jit:u"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&JITU::CreateJitEnvironment>, "CreateJitEnvironment"}, - }; - // clang-format on + explicit JITU(Core::System& system_) : ServiceFramework{system_, "jit:u"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -294,6 +289,10 @@ private: } private: + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&JITU::CreateJitEnvironment>, "CreateJitEnvironment"} + ); + std::mt19937_64 generate_random{}; }; diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp index 68a9bff2df..9b245201ff 100644 --- a/src/core/hle/service/lbl/lbl.cpp +++ b/src/core/hle/service/lbl/lbl.cpp @@ -18,43 +18,10 @@ namespace Service::LBL { class LBL final : public ServiceFramework { public: - explicit LBL(Core::System& system_) : ServiceFramework{system_, "lbl"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &LBL::SaveCurrentSetting, "SaveCurrentSetting"}, - {1, &LBL::LoadCurrentSetting, "LoadCurrentSetting"}, - {2, &LBL::SetCurrentBrightnessSetting, "SetCurrentBrightnessSetting"}, - {3, &LBL::GetCurrentBrightnessSetting, "GetCurrentBrightnessSetting"}, - {4, nullptr, "ApplyCurrentBrightnessSettingToBacklight"}, - {5, nullptr, "GetBrightnessSettingAppliedToBacklight"}, - {6, &LBL::SwitchBacklightOn, "SwitchBacklightOn"}, - {7, &LBL::SwitchBacklightOff, "SwitchBacklightOff"}, - {8, &LBL::GetBacklightSwitchStatus, "GetBacklightSwitchStatus"}, - {9, &LBL::EnableDimming, "EnableDimming"}, - {10, &LBL::DisableDimming, "DisableDimming"}, - {11, &LBL::IsDimmingEnabled, "IsDimmingEnabled"}, - {12, &LBL::EnableAutoBrightnessControl, "EnableAutoBrightnessControl"}, - {13, &LBL::DisableAutoBrightnessControl, "DisableAutoBrightnessControl"}, - {14, &LBL::IsAutoBrightnessControlEnabled, "IsAutoBrightnessControlEnabled"}, - {15, &LBL::SetAmbientLightSensorValue, "SetAmbientLightSensorValue"}, - {16, &LBL::GetAmbientLightSensorValue, "GetAmbientLightSensorValue"}, - {17, &LBL::SetBrightnessReflectionDelayLevel, "SetBrightnessReflectionDelayLevel"}, - {18, &LBL::GetBrightnessReflectionDelayLevel, "GetBrightnessReflectionDelayLevel"}, - {19, &LBL::SetCurrentBrightnessMapping, "SetCurrentBrightnessMapping"}, - {20, &LBL::GetCurrentBrightnessMapping, "GetCurrentBrightnessMapping"}, - {21, &LBL::SetCurrentAmbientLightSensorMapping, "SetCurrentAmbientLightSensorMapping"}, - {22, &LBL::GetCurrentAmbientLightSensorMapping, "GetCurrentAmbientLightSensorMapping"}, - {23, &LBL::IsAmbientLightSensorAvailable, "IsAmbientLightSensorAvailable"}, - {24, &LBL::SetCurrentBrightnessSettingForVrMode, "SetCurrentBrightnessSettingForVrMode"}, - {25, &LBL::GetCurrentBrightnessSettingForVrMode, "GetCurrentBrightnessSettingForVrMode"}, - {26, &LBL::EnableVrMode, "EnableVrMode"}, - {27, &LBL::DisableVrMode, "DisableVrMode"}, - {28, &LBL::IsVrModeEnabled, "IsVrModeEnabled"}, - {29, &LBL::IsAutoBrightnessControlSupported, "IsAutoBrightnessControlSupported"}, - }; - // clang-format on + explicit LBL(Core::System& system_) : ServiceFramework{system_, "lbl"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -335,6 +302,38 @@ private: rb.Push(auto_brightness_supported); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &LBL::SaveCurrentSetting, "SaveCurrentSetting"}, + FunctionInfo{1, &LBL::LoadCurrentSetting, "LoadCurrentSetting"}, + FunctionInfo{2, &LBL::SetCurrentBrightnessSetting, "SetCurrentBrightnessSetting"}, + FunctionInfo{3, &LBL::GetCurrentBrightnessSetting, "GetCurrentBrightnessSetting"}, + FunctionInfo{4, nullptr, "ApplyCurrentBrightnessSettingToBacklight"}, + FunctionInfo{5, nullptr, "GetBrightnessSettingAppliedToBacklight"}, + FunctionInfo{6, &LBL::SwitchBacklightOn, "SwitchBacklightOn"}, + FunctionInfo{7, &LBL::SwitchBacklightOff, "SwitchBacklightOff"}, + FunctionInfo{8, &LBL::GetBacklightSwitchStatus, "GetBacklightSwitchStatus"}, + FunctionInfo{9, &LBL::EnableDimming, "EnableDimming"}, + FunctionInfo{10, &LBL::DisableDimming, "DisableDimming"}, + FunctionInfo{11, &LBL::IsDimmingEnabled, "IsDimmingEnabled"}, + FunctionInfo{12, &LBL::EnableAutoBrightnessControl, "EnableAutoBrightnessControl"}, + FunctionInfo{13, &LBL::DisableAutoBrightnessControl, "DisableAutoBrightnessControl"}, + FunctionInfo{14, &LBL::IsAutoBrightnessControlEnabled, "IsAutoBrightnessControlEnabled"}, + FunctionInfo{15, &LBL::SetAmbientLightSensorValue, "SetAmbientLightSensorValue"}, + FunctionInfo{16, &LBL::GetAmbientLightSensorValue, "GetAmbientLightSensorValue"}, + FunctionInfo{17, &LBL::SetBrightnessReflectionDelayLevel, "SetBrightnessReflectionDelayLevel"}, + FunctionInfo{18, &LBL::GetBrightnessReflectionDelayLevel, "GetBrightnessReflectionDelayLevel"}, + FunctionInfo{19, &LBL::SetCurrentBrightnessMapping, "SetCurrentBrightnessMapping"}, + FunctionInfo{20, &LBL::GetCurrentBrightnessMapping, "GetCurrentBrightnessMapping"}, + FunctionInfo{21, &LBL::SetCurrentAmbientLightSensorMapping, "SetCurrentAmbientLightSensorMapping"}, + FunctionInfo{22, &LBL::GetCurrentAmbientLightSensorMapping, "GetCurrentAmbientLightSensorMapping"}, + FunctionInfo{23, &LBL::IsAmbientLightSensorAvailable, "IsAmbientLightSensorAvailable"}, + FunctionInfo{24, &LBL::SetCurrentBrightnessSettingForVrMode, "SetCurrentBrightnessSettingForVrMode"}, + FunctionInfo{25, &LBL::GetCurrentBrightnessSettingForVrMode, "GetCurrentBrightnessSettingForVrMode"}, + FunctionInfo{26, &LBL::EnableVrMode, "EnableVrMode"}, + FunctionInfo{27, &LBL::DisableVrMode, "DisableVrMode"}, + FunctionInfo{28, &LBL::IsVrModeEnabled, "IsVrModeEnabled"}, + FunctionInfo{29, &LBL::IsAutoBrightnessControlSupported, "IsAutoBrightnessControlSupported"} + ); bool vr_mode_enabled = false; float current_brightness = 1.0f; float ambient_light_value = 0.0f; diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp index 1a0165fd2e..838fe85f79 100644 --- a/src/core/hle/service/ldn/ldn.cpp +++ b/src/core/hle/service/ldn/ldn.cpp @@ -9,7 +9,6 @@ #include "core/hle/service/ldn/ldn.h" #include "core/hle/service/ldn/monitor_service.h" #include "core/hle/service/ldn/sf_monitor_service.h" -#include "core/hle/service/ldn/sf_service.h" #include "core/hle/service/ldn/sf_service_monitor.h" #include "core/hle/service/ldn/system_local_communication_service.h" #include "core/hle/service/ldn/user_local_communication_service.h" @@ -19,14 +18,10 @@ namespace Service::LDN { class IClientProcessMonitor final : public ServiceFramework { public: - explicit IClientProcessMonitor(Core::System& system_) - : ServiceFramework{system_, "IClientProcessMonitor"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IClientProcessMonitor::RegisterClient>, "RegisterClient"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit IClientProcessMonitor(Core::System& system_) : ServiceFramework{system_, "IClientProcessMonitor"} {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~IClientProcessMonitor() override = default; private: @@ -34,19 +29,19 @@ private: LOG_WARNING(Service_LDN, "(STUBBED) called"); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IClientProcessMonitor::RegisterClient>, "RegisterClient"} + ); }; class IMonitorServiceCreator final : public ServiceFramework { public: - explicit IMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:m"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&IMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"} - }; - // clang-format on - RegisterHandlers(functions); - } + explicit IMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:m"} {} + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } private: Result CreateMonitorService(OutInterface out_interface) { LOG_DEBUG(Service_LDN, "called"); @@ -54,21 +49,19 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"} + ); }; class ISystemServiceCreator final : public ServiceFramework { public: - explicit ISystemServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:s"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&ISystemServiceCreator::CreateSystemLocalCommunicationService>, "CreateSystemLocalCommunicationService"}, - {1, C<&ISystemServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor"} // 18.0.0+ - }; - // clang-format on + explicit ISystemServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:s"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } - private: Result CreateSystemLocalCommunicationService( OutInterface out_interface) { @@ -85,21 +78,20 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&ISystemServiceCreator::CreateSystemLocalCommunicationService>, "CreateSystemLocalCommunicationService"}, + FunctionInfo{1, C<&ISystemServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor", MakeVersionGate({18,0,0})} + ); }; class IUserServiceCreator final : public ServiceFramework { public: - explicit IUserServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:u"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IUserServiceCreator::CreateUserLocalCommunicationService>, "CreateUserLocalCommunicationService"}, - {1, D<&IUserServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor"} // 18.0.0+ - }; - // clang-format on + explicit IUserServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:u"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } - private: Result CreateUserLocalCommunicationService( OutInterface out_interface) { @@ -116,22 +108,50 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IUserServiceCreator::CreateUserLocalCommunicationService>, "CreateUserLocalCommunicationService"}, + FunctionInfo{1, D<&IUserServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor", MakeVersionGate({18,0,0})} + ); +}; + +class ISfService final : public ServiceFramework { +public: + explicit ISfService(Core::System& system_) : ServiceFramework{system_, "ISfService"} {} + ~ISfService() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, + FunctionInfo{264, nullptr, "GetNetworkInterfaceLastError"}, + FunctionInfo{272, nullptr, "GetRole"}, + FunctionInfo{280, nullptr, "GetAdvertiseData"}, + FunctionInfo{288, nullptr, "GetGroupInfo"}, + FunctionInfo{296, nullptr, "GetGroupInfo2"}, + FunctionInfo{304, nullptr, "GetGroupOwner"}, + FunctionInfo{312, nullptr, "GetIpConfig"}, + FunctionInfo{320, nullptr, "GetLinkLevel"}, + FunctionInfo{512, nullptr, "Scan"}, + FunctionInfo{768, nullptr, "CreateGroup"}, + FunctionInfo{776, nullptr, "DestroyGroup"}, + FunctionInfo{784, nullptr, "SetAdvertiseData"}, + FunctionInfo{1536, nullptr, "SendToOtherGroup"}, + FunctionInfo{1544, nullptr, "RecvFromOtherGroup"}, + FunctionInfo{1552, nullptr, "AddAcceptableGroupId"}, + FunctionInfo{1560, nullptr, "ClearAcceptableGroupId"} + ); }; class ISfServiceCreator final : public ServiceFramework { public: - explicit ISfServiceCreator(Core::System& system_, bool is_system_, const char* name_) - : ServiceFramework{system_, name_}, is_system{is_system_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&ISfServiceCreator::CreateNetworkService>, "CreateNetworkService"}, - {8, C<&ISfServiceCreator::CreateNetworkServiceMonitor>, "CreateNetworkServiceMonitor"}, - }; - // clang-format on + explicit ISfServiceCreator(Core::System& system_, bool is_system_, const char* name_) : ServiceFramework{system_, name_}, is_system{is_system_} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } - private: Result CreateNetworkService(OutInterface out_interface, u32 input, u64 reserved_input) { @@ -150,21 +170,20 @@ private: R_SUCCEED(); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&ISfServiceCreator::CreateNetworkService>, "CreateNetworkService"}, + FunctionInfo{8, C<&ISfServiceCreator::CreateNetworkServiceMonitor>, "CreateNetworkServiceMonitor"} + ); bool is_system{}; }; class ISfMonitorServiceCreator final : public ServiceFramework { public: - explicit ISfMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "lp2p:m"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&ISfMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"}, - }; - // clang-format on + explicit ISfMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "lp2p:m"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } - private: Result CreateMonitorService(OutInterface out_interface, u64 reserved_input) { LOG_INFO(Service_LDN, "called, reserved_input={}", reserved_input); @@ -172,6 +191,10 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&ISfMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"} + ); }; void LoopProcess(Core::System& system) { @@ -181,12 +204,9 @@ void LoopProcess(Core::System& system) { server_manager->RegisterNamedService("ldn:s", std::make_shared(system)); server_manager->RegisterNamedService("ldn:u", std::make_shared(system)); - server_manager->RegisterNamedService( - "lp2p:app", std::make_shared(system, false, "lp2p:app")); - server_manager->RegisterNamedService( - "lp2p:sys", std::make_shared(system, true, "lp2p:sys")); - server_manager->RegisterNamedService("lp2p:m", - std::make_shared(system)); + server_manager->RegisterNamedService("lp2p:app", std::make_shared(system, false, "lp2p:app")); + server_manager->RegisterNamedService("lp2p:sys", std::make_shared(system, true, "lp2p:sys")); + server_manager->RegisterNamedService("lp2p:m", std::make_shared(system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/ldn/monitor_service.cpp b/src/core/hle/service/ldn/monitor_service.cpp index ea6ac4d5dd..6a60b0b3d8 100644 --- a/src/core/hle/service/ldn/monitor_service.cpp +++ b/src/core/hle/service/ldn/monitor_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,22 +10,22 @@ namespace Service::LDN { +std::optional IMonitorService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IMonitorService::GetStateForMonitor>, "GetStateForMonitor"}, + FunctionInfo{1, nullptr, "GetNetworkInfoForMonitor"}, + FunctionInfo{2, nullptr, "GetIpv4AddressForMonitor"}, + FunctionInfo{3, nullptr, "GetDisconnectReasonForMonitor"}, + FunctionInfo{4, nullptr, "GetSecurityParameterForMonitor"}, + FunctionInfo{5, nullptr, "GetNetworkConfigForMonitor"}, + FunctionInfo{100, C<&IMonitorService::InitializeMonitor>, "InitializeMonitor"}, + FunctionInfo{101, C<&IMonitorService::FinalizeMonitor>, "FinalizeMonitor"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IMonitorService::IMonitorService(Core::System& system_) : ServiceFramework{system_, "IMonitorService"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&IMonitorService::GetStateForMonitor>, "GetStateForMonitor"}, - {1, nullptr, "GetNetworkInfoForMonitor"}, - {2, nullptr, "GetIpv4AddressForMonitor"}, - {3, nullptr, "GetDisconnectReasonForMonitor"}, - {4, nullptr, "GetSecurityParameterForMonitor"}, - {5, nullptr, "GetNetworkConfigForMonitor"}, - {100, C<&IMonitorService::InitializeMonitor>, "InitializeMonitor"}, - {101, C<&IMonitorService::FinalizeMonitor>, "FinalizeMonitor"}, - }; - // clang-format on - - RegisterHandlers(functions); } IMonitorService::~IMonitorService() = default; diff --git a/src/core/hle/service/ldn/monitor_service.h b/src/core/hle/service/ldn/monitor_service.h index e663145b4f..9c1acd0a1e 100644 --- a/src/core/hle/service/ldn/monitor_service.h +++ b/src/core/hle/service/ldn/monitor_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -23,6 +26,7 @@ private: Result InitializeMonitor(); Result FinalizeMonitor(); + std::optional FindRequest(u32 key) override; State state{State::None}; }; diff --git a/src/core/hle/service/ldn/sf_monitor_service.cpp b/src/core/hle/service/ldn/sf_monitor_service.cpp index 9e6736ff2c..ebe06b2059 100644 --- a/src/core/hle/service/ldn/sf_monitor_service.cpp +++ b/src/core/hle/service/ldn/sf_monitor_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,17 +10,17 @@ namespace Service::LDN { +std::optional ISfMonitorService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&ISfMonitorService::Initialize>, "Initialize"}, + FunctionInfo{288, C<&ISfMonitorService::GetGroupInfo>, "GetGroupInfo"}, + FunctionInfo{320, nullptr, "GetLinkLevel"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + ISfMonitorService::ISfMonitorService(Core::System& system_) : ServiceFramework{system_, "ISfMonitorService"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&ISfMonitorService::Initialize>, "Initialize"}, - {288, C<&ISfMonitorService::GetGroupInfo>, "GetGroupInfo"}, - {320, nullptr, "GetLinkLevel"}, - }; - // clang-format on - - RegisterHandlers(functions); } ISfMonitorService::~ISfMonitorService() = default; diff --git a/src/core/hle/service/ldn/sf_monitor_service.h b/src/core/hle/service/ldn/sf_monitor_service.h index d021152010..09ca16727d 100644 --- a/src/core/hle/service/ldn/sf_monitor_service.h +++ b/src/core/hle/service/ldn/sf_monitor_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -21,6 +24,7 @@ public: private: Result Initialize(Out out_value); Result GetGroupInfo(OutLargeData out_group_info); + std::optional FindRequest(u32 key) override; }; } // namespace Service::LDN diff --git a/src/core/hle/service/ldn/sf_service.cpp b/src/core/hle/service/ldn/sf_service.cpp deleted file mode 100644 index 61cabe219a..0000000000 --- a/src/core/hle/service/ldn/sf_service.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "core/hle/service/ldn/sf_service.h" - -namespace Service::LDN { - -ISfService::ISfService(Core::System& system_) : ServiceFramework{system_, "ISfService"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, - {264, nullptr, "GetNetworkInterfaceLastError"}, - {272, nullptr, "GetRole"}, - {280, nullptr, "GetAdvertiseData"}, - {288, nullptr, "GetGroupInfo"}, - {296, nullptr, "GetGroupInfo2"}, - {304, nullptr, "GetGroupOwner"}, - {312, nullptr, "GetIpConfig"}, - {320, nullptr, "GetLinkLevel"}, - {512, nullptr, "Scan"}, - {768, nullptr, "CreateGroup"}, - {776, nullptr, "DestroyGroup"}, - {784, nullptr, "SetAdvertiseData"}, - {1536, nullptr, "SendToOtherGroup"}, - {1544, nullptr, "RecvFromOtherGroup"}, - {1552, nullptr, "AddAcceptableGroupId"}, - {1560, nullptr, "ClearAcceptableGroupId"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -ISfService::~ISfService() = default; - -} // namespace Service::LDN diff --git a/src/core/hle/service/ldn/sf_service.h b/src/core/hle/service/ldn/sf_service.h deleted file mode 100644 index 05534b5677..0000000000 --- a/src/core/hle/service/ldn/sf_service.h +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::LDN { - -class ISfService final : public ServiceFramework { -public: - explicit ISfService(Core::System& system_); - ~ISfService() override; -}; - -} // namespace Service::LDN diff --git a/src/core/hle/service/ldn/sf_service_monitor.cpp b/src/core/hle/service/ldn/sf_service_monitor.cpp index 9a1cde6881..574ba82a0b 100644 --- a/src/core/hle/service/ldn/sf_service_monitor.cpp +++ b/src/core/hle/service/ldn/sf_service_monitor.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,27 +10,27 @@ namespace Service::LDN { +std::optional ISfServiceMonitor::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&ISfServiceMonitor::Initialize>, "Initialize"}, + FunctionInfo{256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, + FunctionInfo{264, nullptr, "GetNetworkInterfaceLastError"}, + FunctionInfo{272, nullptr, "GetRole"}, + FunctionInfo{280, nullptr, "GetAdvertiseData"}, + FunctionInfo{281, nullptr, "GetAdvertiseData2"}, + FunctionInfo{288, C<&ISfServiceMonitor::GetGroupInfo>, "GetGroupInfo"}, + FunctionInfo{296, nullptr, "GetGroupInfo2"}, + FunctionInfo{304, nullptr, "GetGroupOwner"}, + FunctionInfo{312, nullptr, "GetIpConfig"}, + FunctionInfo{320, nullptr, "GetLinkLevel"}, + FunctionInfo{328, nullptr, "AttachJoinEvent"}, + FunctionInfo{336, nullptr, "GetMembers"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + ISfServiceMonitor::ISfServiceMonitor(Core::System& system_) : ServiceFramework{system_, "ISfServiceMonitor"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&ISfServiceMonitor::Initialize>, "Initialize"}, - {256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, - {264, nullptr, "GetNetworkInterfaceLastError"}, - {272, nullptr, "GetRole"}, - {280, nullptr, "GetAdvertiseData"}, - {281, nullptr, "GetAdvertiseData2"}, - {288, C<&ISfServiceMonitor::GetGroupInfo>, "GetGroupInfo"}, - {296, nullptr, "GetGroupInfo2"}, - {304, nullptr, "GetGroupOwner"}, - {312, nullptr, "GetIpConfig"}, - {320, nullptr, "GetLinkLevel"}, - {328, nullptr, "AttachJoinEvent"}, - {336, nullptr, "GetMembers"}, - }; - // clang-format on - - RegisterHandlers(functions); } ISfServiceMonitor::~ISfServiceMonitor() = default; diff --git a/src/core/hle/service/ldn/sf_service_monitor.h b/src/core/hle/service/ldn/sf_service_monitor.h index 924cc17594..5e5e64ae6c 100644 --- a/src/core/hle/service/ldn/sf_service_monitor.h +++ b/src/core/hle/service/ldn/sf_service_monitor.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -20,8 +23,8 @@ public: private: Result Initialize(Out out_value); - Result GetGroupInfo(OutLargeData out_group_info, - GroupInfo in_group_info); + Result GetGroupInfo(OutLargeData out_group_info, GroupInfo in_group_info); + std::optional FindRequest(u32 key) override; }; } // namespace Service::LDN diff --git a/src/core/hle/service/ldn/system_local_communication_service.cpp b/src/core/hle/service/ldn/system_local_communication_service.cpp index 7b52223cdc..9d3d49aac4 100644 --- a/src/core/hle/service/ldn/system_local_communication_service.cpp +++ b/src/core/hle/service/ldn/system_local_communication_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -6,44 +9,44 @@ namespace Service::LDN { +std::optional ISystemLocalCommunicationService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetState"}, + FunctionInfo{1, nullptr, "GetNetworkInfo"}, + FunctionInfo{2, nullptr, "GetIpv4Address"}, + FunctionInfo{3, nullptr, "GetDisconnectReason"}, + FunctionInfo{4, nullptr, "GetSecurityParameter"}, + FunctionInfo{5, nullptr, "GetNetworkConfig"}, + FunctionInfo{100, nullptr, "AttachStateChangeEvent"}, + FunctionInfo{101, nullptr, "GetNetworkInfoLatestUpdate"}, + FunctionInfo{102, nullptr, "Scan"}, + FunctionInfo{103, nullptr, "ScanPrivate"}, + FunctionInfo{104, nullptr, "SetWirelessControllerRestriction"}, + FunctionInfo{200, nullptr, "OpenAccessPoint"}, + FunctionInfo{201, nullptr, "CloseAccessPoint"}, + FunctionInfo{202, nullptr, "CreateNetwork"}, + FunctionInfo{203, nullptr, "CreateNetworkPrivate"}, + FunctionInfo{204, nullptr, "DestroyNetwork"}, + FunctionInfo{205, nullptr, "Reject"}, + FunctionInfo{206, nullptr, "SetAdvertiseData"}, + FunctionInfo{207, nullptr, "SetStationAcceptPolicy"}, + FunctionInfo{208, nullptr, "AddAcceptFilterEntry"}, + FunctionInfo{209, nullptr, "ClearAcceptFilter"}, + FunctionInfo{300, nullptr, "OpenStation"}, + FunctionInfo{301, nullptr, "CloseStation"}, + FunctionInfo{302, nullptr, "Connect"}, + FunctionInfo{303, nullptr, "ConnectPrivate"}, + FunctionInfo{304, nullptr, "Disconnect"}, + FunctionInfo{400, nullptr, "InitializeSystem"}, + FunctionInfo{401, nullptr, "FinalizeSystem"}, + FunctionInfo{402, nullptr, "SetOperationMode"}, + FunctionInfo{403, C<&ISystemLocalCommunicationService::InitializeSystem2>, "InitializeSystem2"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + ISystemLocalCommunicationService::ISystemLocalCommunicationService(Core::System& system_) : ServiceFramework{system_, "ISystemLocalCommunicationService"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetState"}, - {1, nullptr, "GetNetworkInfo"}, - {2, nullptr, "GetIpv4Address"}, - {3, nullptr, "GetDisconnectReason"}, - {4, nullptr, "GetSecurityParameter"}, - {5, nullptr, "GetNetworkConfig"}, - {100, nullptr, "AttachStateChangeEvent"}, - {101, nullptr, "GetNetworkInfoLatestUpdate"}, - {102, nullptr, "Scan"}, - {103, nullptr, "ScanPrivate"}, - {104, nullptr, "SetWirelessControllerRestriction"}, - {200, nullptr, "OpenAccessPoint"}, - {201, nullptr, "CloseAccessPoint"}, - {202, nullptr, "CreateNetwork"}, - {203, nullptr, "CreateNetworkPrivate"}, - {204, nullptr, "DestroyNetwork"}, - {205, nullptr, "Reject"}, - {206, nullptr, "SetAdvertiseData"}, - {207, nullptr, "SetStationAcceptPolicy"}, - {208, nullptr, "AddAcceptFilterEntry"}, - {209, nullptr, "ClearAcceptFilter"}, - {300, nullptr, "OpenStation"}, - {301, nullptr, "CloseStation"}, - {302, nullptr, "Connect"}, - {303, nullptr, "ConnectPrivate"}, - {304, nullptr, "Disconnect"}, - {400, nullptr, "InitializeSystem"}, - {401, nullptr, "FinalizeSystem"}, - {402, nullptr, "SetOperationMode"}, - {403, C<&ISystemLocalCommunicationService::InitializeSystem2>, "InitializeSystem2"}, - }; - // clang-format on - - RegisterHandlers(functions); } ISystemLocalCommunicationService::~ISystemLocalCommunicationService() = default; diff --git a/src/core/hle/service/ldn/system_local_communication_service.h b/src/core/hle/service/ldn/system_local_communication_service.h index a02b097ea7..c7e937e3a2 100644 --- a/src/core/hle/service/ldn/system_local_communication_service.h +++ b/src/core/hle/service/ldn/system_local_communication_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -20,6 +23,7 @@ public: private: Result InitializeSystem2(); + std::optional FindRequest(u32 key) override; }; } // namespace Service::LDN diff --git a/src/core/hle/service/ldn/user_local_communication_service.cpp b/src/core/hle/service/ldn/user_local_communication_service.cpp index 572aea6314..26a742bf0b 100644 --- a/src/core/hle/service/ldn/user_local_communication_service.cpp +++ b/src/core/hle/service/ldn/user_local_communication_service.cpp @@ -21,46 +21,46 @@ namespace Service::LDN { +std::optional IUserLocalCommunicationService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IUserLocalCommunicationService::GetState>, "GetState"}, + FunctionInfo{1, D<&IUserLocalCommunicationService::GetNetworkInfo>, "GetNetworkInfo"}, + FunctionInfo{2, D<&IUserLocalCommunicationService::GetIpv4Address>, "GetIpv4Address"}, + FunctionInfo{3, D<&IUserLocalCommunicationService::GetDisconnectReason>, "GetDisconnectReason"}, + FunctionInfo{4, D<&IUserLocalCommunicationService::GetSecurityParameter>, "GetSecurityParameter"}, + FunctionInfo{5, D<&IUserLocalCommunicationService::GetNetworkConfig>, "GetNetworkConfig"}, + FunctionInfo{100, D<&IUserLocalCommunicationService::AttachStateChangeEvent>, "AttachStateChangeEvent"}, + FunctionInfo{101, D<&IUserLocalCommunicationService::GetNetworkInfoLatestUpdate>, "GetNetworkInfoLatestUpdate"}, + FunctionInfo{102, D<&IUserLocalCommunicationService::Scan>, "Scan"}, + FunctionInfo{103, D<&IUserLocalCommunicationService::ScanPrivate>, "ScanPrivate"}, + FunctionInfo{104, D<&IUserLocalCommunicationService::SetWirelessControllerRestriction>, "SetWirelessControllerRestriction"}, + FunctionInfo{106, D<&IUserLocalCommunicationService::SetProtocol>, "SetProtocol" }, + FunctionInfo{200, D<&IUserLocalCommunicationService::OpenAccessPoint>, "OpenAccessPoint"}, + FunctionInfo{201, D<&IUserLocalCommunicationService::CloseAccessPoint>, "CloseAccessPoint"}, + FunctionInfo{202, D<&IUserLocalCommunicationService::CreateNetwork>, "CreateNetwork"}, + FunctionInfo{203, D<&IUserLocalCommunicationService::CreateNetworkPrivate>, "CreateNetworkPrivate"}, + FunctionInfo{204, D<&IUserLocalCommunicationService::DestroyNetwork>, "DestroyNetwork"}, + FunctionInfo{205, nullptr, "Reject"}, + FunctionInfo{206, D<&IUserLocalCommunicationService::SetAdvertiseData>, "SetAdvertiseData"}, + FunctionInfo{207, D<&IUserLocalCommunicationService::SetStationAcceptPolicy>, "SetStationAcceptPolicy"}, + FunctionInfo{208, D<&IUserLocalCommunicationService::AddAcceptFilterEntry>, "AddAcceptFilterEntry"}, + FunctionInfo{209, nullptr, "ClearAcceptFilter"}, + FunctionInfo{300, D<&IUserLocalCommunicationService::OpenStation>, "OpenStation"}, + FunctionInfo{301, D<&IUserLocalCommunicationService::CloseStation>, "CloseStation"}, + FunctionInfo{302, D<&IUserLocalCommunicationService::Connect>, "Connect"}, + FunctionInfo{303, nullptr, "ConnectPrivate"}, + FunctionInfo{304, D<&IUserLocalCommunicationService::Disconnect>, "Disconnect"}, + FunctionInfo{400, D<&IUserLocalCommunicationService::Initialize>, "Initialize"}, + FunctionInfo{401, D<&IUserLocalCommunicationService::Finalize>, "Finalize"}, + FunctionInfo{402, D<&IUserLocalCommunicationService::Initialize2>, "Initialize2"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IUserLocalCommunicationService::IUserLocalCommunicationService(Core::System& system_) : ServiceFramework{system_, "IUserLocalCommunicationService"}, service_context{system, "IUserLocalCommunicationService"}, lan_discovery{} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IUserLocalCommunicationService::GetState>, "GetState"}, - {1, D<&IUserLocalCommunicationService::GetNetworkInfo>, "GetNetworkInfo"}, - {2, D<&IUserLocalCommunicationService::GetIpv4Address>, "GetIpv4Address"}, - {3, D<&IUserLocalCommunicationService::GetDisconnectReason>, "GetDisconnectReason"}, - {4, D<&IUserLocalCommunicationService::GetSecurityParameter>, "GetSecurityParameter"}, - {5, D<&IUserLocalCommunicationService::GetNetworkConfig>, "GetNetworkConfig"}, - {100, D<&IUserLocalCommunicationService::AttachStateChangeEvent>, "AttachStateChangeEvent"}, - {101, D<&IUserLocalCommunicationService::GetNetworkInfoLatestUpdate>, "GetNetworkInfoLatestUpdate"}, - {102, D<&IUserLocalCommunicationService::Scan>, "Scan"}, - {103, D<&IUserLocalCommunicationService::ScanPrivate>, "ScanPrivate"}, - {104, D<&IUserLocalCommunicationService::SetWirelessControllerRestriction>, "SetWirelessControllerRestriction"}, - { 106, D<&IUserLocalCommunicationService::SetProtocol>, "SetProtocol" }, - {200, D<&IUserLocalCommunicationService::OpenAccessPoint>, "OpenAccessPoint"}, - {201, D<&IUserLocalCommunicationService::CloseAccessPoint>, "CloseAccessPoint"}, - {202, D<&IUserLocalCommunicationService::CreateNetwork>, "CreateNetwork"}, - {203, D<&IUserLocalCommunicationService::CreateNetworkPrivate>, "CreateNetworkPrivate"}, - {204, D<&IUserLocalCommunicationService::DestroyNetwork>, "DestroyNetwork"}, - {205, nullptr, "Reject"}, - {206, D<&IUserLocalCommunicationService::SetAdvertiseData>, "SetAdvertiseData"}, - {207, D<&IUserLocalCommunicationService::SetStationAcceptPolicy>, "SetStationAcceptPolicy"}, - {208, D<&IUserLocalCommunicationService::AddAcceptFilterEntry>, "AddAcceptFilterEntry"}, - {209, nullptr, "ClearAcceptFilter"}, - {300, D<&IUserLocalCommunicationService::OpenStation>, "OpenStation"}, - {301, D<&IUserLocalCommunicationService::CloseStation>, "CloseStation"}, - {302, D<&IUserLocalCommunicationService::Connect>, "Connect"}, - {303, nullptr, "ConnectPrivate"}, - {304, D<&IUserLocalCommunicationService::Disconnect>, "Disconnect"}, - {400, D<&IUserLocalCommunicationService::Initialize>, "Initialize"}, - {401, D<&IUserLocalCommunicationService::Finalize>, "Finalize"}, - {402, D<&IUserLocalCommunicationService::Initialize2>, "Initialize2"}, - }; - // clang-format on - - RegisterHandlers(functions); state_change_event = service_context.CreateEvent("IUserLocalCommunicationService:StateChangeEvent"); diff --git a/src/core/hle/service/ldn/user_local_communication_service.h b/src/core/hle/service/ldn/user_local_communication_service.h index 1e725ed531..6f832b7a23 100644 --- a/src/core/hle/service/ldn/user_local_communication_service.h +++ b/src/core/hle/service/ldn/user_local_communication_service.h @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later #pragma once @@ -89,6 +89,7 @@ private: /// Callback to parse and handle a received LDN packet. void OnLDNPacketReceived(const Network::LDNPacket& packet); void OnEventFired(); + std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext service_context; Kernel::KEvent* state_change_event; diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index db4d51b49d..25ecc58fa4 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp @@ -12,47 +12,44 @@ namespace Service::LDR { class DebugMonitor final : public ServiceFramework { public: - explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "ldr:dmnt"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "SetProgramArgument"}, - {1, nullptr, "FlushArguments"}, - {2, nullptr, "GetProcessModuleInfo"}, - }; - // clang-format on + explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "ldr:dmnt"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetProgramArgument"}, + FunctionInfo{1, nullptr, "FlushArguments"}, + FunctionInfo{2, nullptr, "GetProcessModuleInfo"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class ProcessManager final : public ServiceFramework { public: - explicit ProcessManager(Core::System& system_) : ServiceFramework{system_, "ldr:pm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateProcess"}, - {1, nullptr, "GetProgramInfo"}, - {2, nullptr, "PinProgram"}, - {3, nullptr, "UnpinProgram"}, - {4, nullptr, "SetEnabledProgramVerification"}, - }; - // clang-format on + explicit ProcessManager(Core::System& system_) : ServiceFramework{system_, "ldr:pm"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateProcess"}, + FunctionInfo{1, nullptr, "GetProgramInfo"}, + FunctionInfo{2, nullptr, "PinProgram"}, + FunctionInfo{3, nullptr, "UnpinProgram"}, + FunctionInfo{4, nullptr, "SetEnabledProgramVerification"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class Shell final : public ServiceFramework { public: - explicit Shell(Core::System& system_) : ServiceFramework{system_, "ldr:shel"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "SetProgramArgument"}, - {1, nullptr, "FlushArguments"}, - }; - // clang-format on + explicit Shell(Core::System& system_) : ServiceFramework{system_, "ldr:shel"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetProgramArgument"}, + FunctionInfo{1, nullptr, "FlushArguments"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index d631a6dd80..be8cdf9aa9 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp @@ -87,16 +87,7 @@ DECLARE_ENUM_FLAG_OPERATORS(LogPacketFlags); class ILogger final : public ServiceFramework { public: - explicit ILogger(Core::System& system_) : ServiceFramework{system_, "ILogger"} { - static const FunctionInfo functions[] = { - {0, &ILogger::Log, "Log"}, - {1, &ILogger::SetDestination, "SetDestination"}, - {2, nullptr, "TransmitHashedLog"}, //20.0.0+ - {3, nullptr, "DevNotify"}, //20.0.0+ - }; - RegisterHandlers(functions); - } - + explicit ILogger(Core::System& system_) : ServiceFramework{system_, "ILogger"} {} private: void Log(HLERequestContext& ctx) { std::size_t offset{}; @@ -331,20 +322,25 @@ private: }; static_assert(sizeof(LogPacketHeader) == 0x18, "LogPacketHeader is an invalid size"); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ILogger::Log, "Log"}, + FunctionInfo{1, &ILogger::SetDestination, "SetDestination"}, + FunctionInfo{2, nullptr, "TransmitHashedLog", MakeVersionGate({20,0,0})}, + FunctionInfo{3, nullptr, "DevNotify", MakeVersionGate({20,0,0})} + ); ::Common::unordered_map> entries{}; LogDestination destination{LogDestination::All}; }; class LM final : public ServiceFramework { public: - explicit LM(Core::System& system_) : ServiceFramework{system_, "lm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &LM::OpenLogger, "OpenLogger"}, - }; - // clang-format on + explicit LM(Core::System& system_) : ServiceFramework{system_, "lm"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -355,21 +351,26 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &LM::OpenLogger, "OpenLogger"} + ); }; class LM_GET final : public ServiceFramework { public: - explicit LM_GET(Core::System& system_) - : ServiceFramework{system_, "lm:get"} - { - static const FunctionInfo functions[] = { - {0, nullptr, "StartLogging"}, - {1, nullptr, "StopLogging"}, - {2, nullptr, "GetLog"}, - {100, nullptr, "CreateDevNotificationReceiver"}, - }; - RegisterHandlers(functions); + explicit LM_GET(Core::System& system_) : ServiceFramework{system_, "lm:get"} {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "StartLogging"}, + FunctionInfo{1, nullptr, "StopLogging"}, + FunctionInfo{2, nullptr, "GetLog"}, + FunctionInfo{100, nullptr, "CreateDevNotificationReceiver"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/mig/mig.cpp b/src/core/hle/service/mig/mig.cpp index edc96506c0..2560050622 100644 --- a/src/core/hle/service/mig/mig.cpp +++ b/src/core/hle/service/mig/mig.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project @@ -14,50 +14,50 @@ namespace Service::Migration { class MIG_USR final : public ServiceFramework { public: - explicit MIG_USR(Core::System& system_) : ServiceFramework{system_, "mig:usr"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Unknown0"}, //19.0.0+ - {1, nullptr, "Unknown1"}, //20.0.0+ - {2, nullptr, "Unknown2"}, //20.0.0+ - {10, nullptr, "TryGetLastMigrationInfo"}, - {11, nullptr, "Unknown11"}, //20.0.0+ - {100, nullptr, "CreateUserMigrationServer"}, //7.0.0+ - {101, nullptr, "ResumeUserMigrationServer"}, //7.0.0+ - {200, nullptr, "CreateUserMigrationClient"}, //7.0.0+ - {201, nullptr, "ResumeUserMigrationClient"}, //7.0.0+ - {1001, nullptr, "GetSaveDataMigrationPolicyInfoAsync"}, //8.0.0-20.5.0 - {1010, nullptr, "TryGetLastSaveDataMigrationInfo"}, //7.0.0+ - {1100, nullptr, "CreateSaveDataMigrationServer"}, //7.0.0-19.0.1 - {1101, nullptr, "ResumeSaveDataMigrationServer"}, //7.0.0+ - {1110, nullptr, "Unknown1101"}, //17.0.0+ - {1200, nullptr, "CreateSaveDataMigrationClient"}, //7.0.0+ - {1201, nullptr, "ResumeSaveDataMigrationClient"}, //7.0.0+ - {2001, nullptr, "Unknown2001"}, //20.0.0+ - {2010, nullptr, "Unknown2010"}, //20.0.0+ - {2100, nullptr, "Unknown2100"}, //20.0.0+ - {2110, nullptr, "Unknown2110"}, //20.0.0+ - {2200, nullptr, "Unknown2200"}, //20.0.0+ - {2210, nullptr, "Unknown2210"}, //20.0.0+ - {2220, nullptr, "Unknown2220"}, //20.0.0+ - {2230, nullptr, "Unknown2230"}, //20.0.0+ - {2231, nullptr, "Unknown2231"}, //20.0.0+ - {2232, nullptr, "Unknown2232"}, //20.0.0+ - {2233, nullptr, "Unknown2233"}, //20.0.0+ - {2234, nullptr, "Unknown2234"}, //20.0.0+ - {2250, nullptr, "Unknown2250"}, //20.0.0+ - {2260, nullptr, "Unknown2260"}, //20.0.0+ - {2270, nullptr, "Unknown2270"}, //20.0.0+ - {2280, nullptr, "Unknown2280"}, //20.0.0+ - {2300, nullptr, "Unknown2300"}, //20.0.0+ - {2310, nullptr, "Unknown2310"}, //20.0.0+ - {2400, nullptr, "Unknown2400"}, //20.0.0+ - {2420, nullptr, "Unknown2420"}, //20.0.0+ - }; - // clang-format on + explicit MIG_USR(Core::System& system_) : ServiceFramework{system_, "mig:usr"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Unknown0", MakeVersionGate({19,0,0})}, + FunctionInfo{1, nullptr, "Unknown1", MakeVersionGate({20,0,0})}, + FunctionInfo{2, nullptr, "Unknown2", MakeVersionGate({20,0,0})}, + FunctionInfo{10, nullptr, "TryGetLastMigrationInfo"}, + FunctionInfo{11, nullptr, "Unknown11", MakeVersionGate({20,0,0})}, + FunctionInfo{100, nullptr, "CreateUserMigrationServer", MakeVersionGate({7,0,0})}, + FunctionInfo{101, nullptr, "ResumeUserMigrationServer", MakeVersionGate({7,0,0})}, + FunctionInfo{200, nullptr, "CreateUserMigrationClient", MakeVersionGate({7,0,0})}, + FunctionInfo{201, nullptr, "ResumeUserMigrationClient", MakeVersionGate({7,0,0})}, + FunctionInfo{1001, nullptr, "GetSaveDataMigrationPolicyInfoAsync", MakeVersionGate({8,0,0}, {20,5,0})}, + FunctionInfo{1010, nullptr, "TryGetLastSaveDataMigrationInfo", MakeVersionGate({7,0,0})}, + FunctionInfo{1100, nullptr, "CreateSaveDataMigrationServer", MakeVersionGate({7,0,0}, {19,0,1})}, + FunctionInfo{1101, nullptr, "ResumeSaveDataMigrationServer", MakeVersionGate({7,0,0})}, + FunctionInfo{1110, nullptr, "Unknown1101", MakeVersionGate({17,0,0})}, + FunctionInfo{1200, nullptr, "CreateSaveDataMigrationClient", MakeVersionGate({7,0,0})}, + FunctionInfo{1201, nullptr, "ResumeSaveDataMigrationClient", MakeVersionGate({7,0,0})}, + FunctionInfo{2001, nullptr, "Unknown2001", MakeVersionGate({20,0,0})}, + FunctionInfo{2010, nullptr, "Unknown2010", MakeVersionGate({20,0,0})}, + FunctionInfo{2100, nullptr, "Unknown2100", MakeVersionGate({20,0,0})}, + FunctionInfo{2110, nullptr, "Unknown2110", MakeVersionGate({20,0,0})}, + FunctionInfo{2200, nullptr, "Unknown2200", MakeVersionGate({20,0,0})}, + FunctionInfo{2210, nullptr, "Unknown2210", MakeVersionGate({20,0,0})}, + FunctionInfo{2220, nullptr, "Unknown2220", MakeVersionGate({20,0,0})}, + FunctionInfo{2230, nullptr, "Unknown2230", MakeVersionGate({20,0,0})}, + FunctionInfo{2231, nullptr, "Unknown2231", MakeVersionGate({20,0,0})}, + FunctionInfo{2232, nullptr, "Unknown2232", MakeVersionGate({20,0,0})}, + FunctionInfo{2233, nullptr, "Unknown2233", MakeVersionGate({20,0,0})}, + FunctionInfo{2234, nullptr, "Unknown2234", MakeVersionGate({20,0,0})}, + FunctionInfo{2250, nullptr, "Unknown2250", MakeVersionGate({20,0,0})}, + FunctionInfo{2260, nullptr, "Unknown2260", MakeVersionGate({20,0,0})}, + FunctionInfo{2270, nullptr, "Unknown2270", MakeVersionGate({20,0,0})}, + FunctionInfo{2280, nullptr, "Unknown2280", MakeVersionGate({20,0,0})}, + FunctionInfo{2300, nullptr, "Unknown2300", MakeVersionGate({20,0,0})}, + FunctionInfo{2310, nullptr, "Unknown2310", MakeVersionGate({20,0,0})}, + FunctionInfo{2400, nullptr, "Unknown2400", MakeVersionGate({20,0,0})}, + FunctionInfo{2420, nullptr, "Unknown2420", MakeVersionGate({20,0,0})} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/mii/mii.cpp b/src/core/hle/service/mii/mii.cpp index 513bb671f8..642a9e4907 100644 --- a/src/core/hle/service/mii/mii.cpp +++ b/src/core/hle/service/mii/mii.cpp @@ -22,51 +22,27 @@ namespace Service::Mii { +std::optional IStaticService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IStaticService::GetDatabaseService>, "GetDatabaseService"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + class IDatabaseService final : public ServiceFramework { public: - explicit IDatabaseService(Core::System& system_, std::shared_ptr mii_manager, - bool is_system_) - : ServiceFramework{system_, "IDatabaseService"}, manager{mii_manager}, is_system{ - is_system_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IDatabaseService::IsUpdated>, "IsUpdated"}, - {1, D<&IDatabaseService::IsFullDatabase>, "IsFullDatabase"}, - {2, D<&IDatabaseService::GetCount>, "GetCount"}, - {3, D<&IDatabaseService::Get>, "Get"}, - {4, D<&IDatabaseService::Get1>, "Get1"}, - {5, D<&IDatabaseService::UpdateLatest>, "UpdateLatest"}, - {6, D<&IDatabaseService::BuildRandom>, "BuildRandom"}, - {7, D<&IDatabaseService::BuildDefault>, "BuildDefault"}, - {8, D<&IDatabaseService::Get2>, "Get2"}, - {9, D<&IDatabaseService::Get3>, "Get3"}, - {10, D<&IDatabaseService::UpdateLatest1>, "UpdateLatest1"}, - {11, D<&IDatabaseService::FindIndex>, "FindIndex"}, - {12, D<&IDatabaseService::Move>, "Move"}, - {13, D<&IDatabaseService::AddOrReplace>, "AddOrReplace"}, - {14, D<&IDatabaseService::Delete>, "Delete"}, - {15, D<&IDatabaseService::DestroyFile>, "DestroyFile"}, - {16, D<&IDatabaseService::DeleteFile>, "DeleteFile"}, - {17, D<&IDatabaseService::Format>, "Format"}, - {18, nullptr, "Import"}, - {19, nullptr, "Export"}, - {20, D<&IDatabaseService::IsBrokenDatabaseWithClearFlag>, "IsBrokenDatabaseWithClearFlag"}, - {21, D<&IDatabaseService::GetIndex>, "GetIndex"}, - {22, D<&IDatabaseService::SetInterfaceVersion>, "SetInterfaceVersion"}, - {23, D<&IDatabaseService::Convert>, "Convert"}, - {24, D<&IDatabaseService::ConvertCoreDataToCharInfo>, "ConvertCoreDataToCharInfo"}, - {25, D<&IDatabaseService::ConvertCharInfoToCoreData>, "ConvertCharInfoToCoreData"}, - {26, D<&IDatabaseService::Append>, "Append"}, - }; - // clang-format on - - RegisterHandlers(functions); - - m_set_sys = system.ServiceManager().GetService( - "set:sys", true); + explicit IDatabaseService(Core::System& system_, std::shared_ptr mii_manager, bool is_system_) + : ServiceFramework{system_, "IDatabaseService"} + , manager{mii_manager} + , is_system{is_system_} { + m_set_sys = system.ServiceManager().GetService("set:sys", true); manager->Initialize(metadata); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + private: Result IsUpdated(Out out_is_updated, SourceFlag source_flag) { LOG_DEBUG(Service_Mii, "called with source_flag={}", source_flag); @@ -288,23 +264,45 @@ private: R_RETURN(manager->Append(metadata, char_info)); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IDatabaseService::IsUpdated>, "IsUpdated"}, + FunctionInfo{1, D<&IDatabaseService::IsFullDatabase>, "IsFullDatabase"}, + FunctionInfo{2, D<&IDatabaseService::GetCount>, "GetCount"}, + FunctionInfo{3, D<&IDatabaseService::Get>, "Get"}, + FunctionInfo{4, D<&IDatabaseService::Get1>, "Get1"}, + FunctionInfo{5, D<&IDatabaseService::UpdateLatest>, "UpdateLatest"}, + FunctionInfo{6, D<&IDatabaseService::BuildRandom>, "BuildRandom"}, + FunctionInfo{7, D<&IDatabaseService::BuildDefault>, "BuildDefault"}, + FunctionInfo{8, D<&IDatabaseService::Get2>, "Get2"}, + FunctionInfo{9, D<&IDatabaseService::Get3>, "Get3"}, + FunctionInfo{10, D<&IDatabaseService::UpdateLatest1>, "UpdateLatest1"}, + FunctionInfo{11, D<&IDatabaseService::FindIndex>, "FindIndex"}, + FunctionInfo{12, D<&IDatabaseService::Move>, "Move"}, + FunctionInfo{13, D<&IDatabaseService::AddOrReplace>, "AddOrReplace"}, + FunctionInfo{14, D<&IDatabaseService::Delete>, "Delete"}, + FunctionInfo{15, D<&IDatabaseService::DestroyFile>, "DestroyFile"}, + FunctionInfo{16, D<&IDatabaseService::DeleteFile>, "DeleteFile"}, + FunctionInfo{17, D<&IDatabaseService::Format>, "Format"}, + FunctionInfo{18, nullptr, "Import"}, + FunctionInfo{19, nullptr, "Export"}, + FunctionInfo{20, D<&IDatabaseService::IsBrokenDatabaseWithClearFlag>, "IsBrokenDatabaseWithClearFlag"}, + FunctionInfo{21, D<&IDatabaseService::GetIndex>, "GetIndex"}, + FunctionInfo{22, D<&IDatabaseService::SetInterfaceVersion>, "SetInterfaceVersion"}, + FunctionInfo{23, D<&IDatabaseService::Convert>, "Convert"}, + FunctionInfo{24, D<&IDatabaseService::ConvertCoreDataToCharInfo>, "ConvertCoreDataToCharInfo"}, + FunctionInfo{25, D<&IDatabaseService::ConvertCharInfoToCoreData>, "ConvertCharInfoToCoreData"}, + FunctionInfo{26, D<&IDatabaseService::Append>, "Append"} + ); + std::shared_ptr manager = nullptr; DatabaseSessionMetadata metadata{}; bool is_system{}; - std::shared_ptr m_set_sys; }; IStaticService::IStaticService(Core::System& system_, const char* name_, std::shared_ptr mii_manager, bool is_system_) : ServiceFramework{system_, name_}, manager{mii_manager}, is_system{is_system_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IStaticService::GetDatabaseService>, "GetDatabaseService"}, - }; - // clang-format on - - RegisterHandlers(functions); } IStaticService::~IStaticService() = default; @@ -324,27 +322,10 @@ std::shared_ptr IStaticService::GetMiiManager() { class IImageDatabaseService final : public ServiceFramework { public: - explicit IImageDatabaseService(Core::System& system_) : ServiceFramework{system_, "miiimg"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IImageDatabaseService::Initialize>, "Initialize"}, - {10, nullptr, "Reload"}, - {11, D<&IImageDatabaseService::GetCount>, "GetCount"}, - {12, nullptr, "IsEmpty"}, - {13, nullptr, "IsFull"}, - {14, nullptr, "GetAttribute"}, - {15, nullptr, "LoadImage"}, - {16, nullptr, "AddOrUpdateImage"}, - {17, nullptr, "DeleteImages"}, - {100, nullptr, "DeleteFile"}, - {101, nullptr, "DestroyFile"}, - {102, nullptr, "ImportFile"}, - {103, nullptr, "ExportFile"}, - {104, nullptr, "ForceInitialize"}, - }; - // clang-format on + explicit IImageDatabaseService(Core::System& system_) : ServiceFramework{system_, "miiimg"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -361,6 +342,23 @@ private: R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IImageDatabaseService::Initialize>, "Initialize"}, + FunctionInfo{10, nullptr, "Reload"}, + FunctionInfo{11, D<&IImageDatabaseService::GetCount>, "GetCount"}, + FunctionInfo{12, nullptr, "IsEmpty"}, + FunctionInfo{13, nullptr, "IsFull"}, + FunctionInfo{14, nullptr, "GetAttribute"}, + FunctionInfo{15, nullptr, "LoadImage"}, + FunctionInfo{16, nullptr, "AddOrUpdateImage"}, + FunctionInfo{17, nullptr, "DeleteImages"}, + FunctionInfo{100, nullptr, "DeleteFile"}, + FunctionInfo{101, nullptr, "DestroyFile"}, + FunctionInfo{102, nullptr, "ImportFile"}, + FunctionInfo{103, nullptr, "ExportFile"}, + FunctionInfo{104, nullptr, "ForceInitialize"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/mii/mii.h b/src/core/hle/service/mii/mii.h index 8683ac1a52..ba20db40d7 100644 --- a/src/core/hle/service/mii/mii.h +++ b/src/core/hle/service/mii/mii.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -24,6 +27,7 @@ public: private: Result GetDatabaseService(Out> out_database_service); + std::optional FindRequest(u32 key) override; std::shared_ptr manager{nullptr}; bool is_system{}; }; diff --git a/src/core/hle/service/mm/mm_u.cpp b/src/core/hle/service/mm/mm_u.cpp index e5353ee42c..0b361ecdd2 100644 --- a/src/core/hle/service/mm/mm_u.cpp +++ b/src/core/hle/service/mm/mm_u.cpp @@ -49,21 +49,10 @@ public: class MM_U final : public ServiceFramework { public: - explicit MM_U(Core::System& system_) : ServiceFramework{system_, "mm:u"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &MM_U::InitializeOld, "InitializeOld"}, - {1, &MM_U::FinalizeOld, "FinalizeOld"}, - {2, &MM_U::SetAndWaitOld, "SetAndWaitOld"}, - {3, &MM_U::GetOld, "GetOld"}, - {4, &MM_U::Initialize, "Initialize"}, - {5, &MM_U::Finalize, "Finalize"}, - {6, &MM_U::SetAndWait, "SetAndWait"}, - {7, &MM_U::Get, "Get"}, - }; - // clang-format on + explicit MM_U(Core::System& system_) : ServiceFramework{system_, "mm:u"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -212,6 +201,16 @@ private: rb.Push(0); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &MM_U::InitializeOld, "InitializeOld"}, + FunctionInfo{1, &MM_U::FinalizeOld, "FinalizeOld"}, + FunctionInfo{2, &MM_U::SetAndWaitOld, "SetAndWaitOld"}, + FunctionInfo{3, &MM_U::GetOld, "GetOld"}, + FunctionInfo{4, &MM_U::Initialize, "Initialize"}, + FunctionInfo{5, &MM_U::Finalize, "Finalize"}, + FunctionInfo{6, &MM_U::SetAndWait, "SetAndWait"}, + FunctionInfo{7, &MM_U::Get, "Get"} + ); std::vector sessions; u32 request_id{1}; }; diff --git a/src/core/hle/service/mnpp/mnpp.cpp b/src/core/hle/service/mnpp/mnpp.cpp index 11b6f3a386..c5bc306302 100644 --- a/src/core/hle/service/mnpp/mnpp.cpp +++ b/src/core/hle/service/mnpp/mnpp.cpp @@ -14,15 +14,10 @@ namespace Service::MNPP { class MNPP_APP final : public ServiceFramework { public: - explicit MNPP_APP(Core::System& system_) : ServiceFramework{system_, "mnpp:app"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &MNPP_APP::Cmd0, "Cmd0"}, - {1, &MNPP_APP::Cmd1, "Cmd1"}, - }; - // clang-format on + explicit MNPP_APP(Core::System& system_) : ServiceFramework{system_, "mnpp:app"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -39,38 +34,43 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &MNPP_APP::Cmd0, "Cmd0"}, + FunctionInfo{1, &MNPP_APP::Cmd1, "Cmd1"} + ); }; class MNPP_SYS final : public ServiceFramework { public: - explicit MNPP_SYS(Core::System& system_) : ServiceFramework{system_, "mnpp:sys"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Cmd0"}, - {10, nullptr, "Cmd10"}, - {100, nullptr, "Cmd100"}, - {200, nullptr, "Cmd200"}, - {300, nullptr, "Cmd300"}, - {400, nullptr, "Cmd400"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit MNPP_SYS(Core::System& system_) : ServiceFramework{system_, "mnpp:sys"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Cmd0"}, + FunctionInfo{10, nullptr, "Cmd10"}, + FunctionInfo{100, nullptr, "Cmd100"}, + FunctionInfo{200, nullptr, "Cmd200"}, + FunctionInfo{300, nullptr, "Cmd300"}, + FunctionInfo{400, nullptr, "Cmd400"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class MNPP_WEB final : public ServiceFramework { public: - explicit MNPP_WEB(Core::System& system_) : ServiceFramework{system_, "mnpp:web"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Cmd0"}, - {1, nullptr, "Cmd1"}, - {10, nullptr, "Cmd10"}, - {20, nullptr, "Cmd20"}, - {100, nullptr, "Cmd100"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit MNPP_WEB(Core::System& system_) : ServiceFramework{system_, "mnpp:web"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Cmd0"}, + FunctionInfo{1, nullptr, "Cmd1"}, + FunctionInfo{10, nullptr, "Cmd10"}, + FunctionInfo{20, nullptr, "Cmd20"}, + FunctionInfo{100, nullptr, "Cmd100"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp index 6c754d5567..4091eadcf9 100644 --- a/src/core/hle/service/ncm/ncm.cpp +++ b/src/core/hle/service/ncm/ncm.cpp @@ -24,33 +24,32 @@ namespace Service::NCM { class ILocationResolver final : public ServiceFramework { public: explicit ILocationResolver(Core::System& system_, FileSys::StorageId id) - : ServiceFramework{system_, "ILocationResolver"}, storage{id} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "ResolveProgramPath"}, - {1, nullptr, "RedirectProgramPath"}, - {2, nullptr, "ResolveApplicationControlPath"}, - {3, nullptr, "ResolveApplicationHtmlDocumentPath"}, - {4, nullptr, "ResolveDataPath"}, - {5, nullptr, "RedirectApplicationControlPath"}, - {6, nullptr, "RedirectApplicationHtmlDocumentPath"}, - {7, nullptr, "ResolveApplicationLegalInformationPath"}, - {8, nullptr, "RedirectApplicationLegalInformationPath"}, - {9, nullptr, "Refresh"}, - {10, nullptr, "RedirectApplicationProgramPath"}, - {11, nullptr, "ClearApplicationRedirection"}, - {12, nullptr, "EraseProgramRedirection"}, - {13, nullptr, "EraseApplicationControlRedirection"}, - {14, nullptr, "EraseApplicationHtmlDocumentRedirection"}, - {15, nullptr, "EraseApplicationLegalInformationRedirection"}, - {16, nullptr, "ResolveProgramPathForDebug"}, - {17, nullptr, "RedirectProgramPathForDebug"}, - {18, nullptr, "RedirectApplicationProgramPathForDebug"}, - {19, nullptr, "EraseProgramRedirectionForDebug"}, - }; - // clang-format on + : ServiceFramework{system_, "ILocationResolver"}, storage{id} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "ResolveProgramPath"}, + FunctionInfo{1, nullptr, "RedirectProgramPath"}, + FunctionInfo{2, nullptr, "ResolveApplicationControlPath"}, + FunctionInfo{3, nullptr, "ResolveApplicationHtmlDocumentPath"}, + FunctionInfo{4, nullptr, "ResolveDataPath"}, + FunctionInfo{5, nullptr, "RedirectApplicationControlPath"}, + FunctionInfo{6, nullptr, "RedirectApplicationHtmlDocumentPath"}, + FunctionInfo{7, nullptr, "ResolveApplicationLegalInformationPath"}, + FunctionInfo{8, nullptr, "RedirectApplicationLegalInformationPath"}, + FunctionInfo{9, nullptr, "Refresh"}, + FunctionInfo{10, nullptr, "RedirectApplicationProgramPath"}, + FunctionInfo{11, nullptr, "ClearApplicationRedirection"}, + FunctionInfo{12, nullptr, "EraseProgramRedirection"}, + FunctionInfo{13, nullptr, "EraseApplicationControlRedirection"}, + FunctionInfo{14, nullptr, "EraseApplicationHtmlDocumentRedirection"}, + FunctionInfo{15, nullptr, "EraseApplicationLegalInformationRedirection"}, + FunctionInfo{16, nullptr, "ResolveProgramPathForDebug"}, + FunctionInfo{17, nullptr, "RedirectProgramPathForDebug"}, + FunctionInfo{18, nullptr, "RedirectApplicationProgramPathForDebug"}, + FunctionInfo{19, nullptr, "EraseProgramRedirectionForDebug"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -60,60 +59,49 @@ private: class IRegisteredLocationResolver final : public ServiceFramework { public: explicit IRegisteredLocationResolver(Core::System& system_) - : ServiceFramework{system_, "IRegisteredLocationResolver"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "ResolveProgramPath"}, - {1, nullptr, "RegisterProgramPath"}, - {2, nullptr, "UnregisterProgramPath"}, - {3, nullptr, "RedirectProgramPath"}, - {4, nullptr, "ResolveHtmlDocumentPath"}, - {5, nullptr, "RegisterHtmlDocumentPath"}, - {6, nullptr, "UnregisterHtmlDocumentPath"}, - {7, nullptr, "RedirectHtmlDocumentPath"}, - {8, nullptr, "Refresh"}, - {9, nullptr, "RefreshExcluding"}, - }; - // clang-format on + : ServiceFramework{system_, "IRegisteredLocationResolver"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "ResolveProgramPath"}, + FunctionInfo{1, nullptr, "RegisterProgramPath"}, + FunctionInfo{2, nullptr, "UnregisterProgramPath"}, + FunctionInfo{3, nullptr, "RedirectProgramPath"}, + FunctionInfo{4, nullptr, "ResolveHtmlDocumentPath"}, + FunctionInfo{5, nullptr, "RegisterHtmlDocumentPath"}, + FunctionInfo{6, nullptr, "UnregisterHtmlDocumentPath"}, + FunctionInfo{7, nullptr, "RedirectHtmlDocumentPath"}, + FunctionInfo{8, nullptr, "Refresh"}, + FunctionInfo{9, nullptr, "RefreshExcluding"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IAddOnContentLocationResolver final : public ServiceFramework { public: explicit IAddOnContentLocationResolver(Core::System& system_) - : ServiceFramework{system_, "IAddOnContentLocationResolver"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "ResolveAddOnContentPath"}, - {1, nullptr, "RegisterAddOnContentStorage"}, - {2, nullptr, "UnregisterAllAddOnContentPath"}, - {3, nullptr, "RefreshApplicationAddOnContent"}, - {4, nullptr, "UnregisterApplicationAddOnContent"}, - }; - // clang-format on + : ServiceFramework{system_, "IAddOnContentLocationResolver"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "ResolveAddOnContentPath"}, + FunctionInfo{1, nullptr, "RegisterAddOnContentStorage"}, + FunctionInfo{2, nullptr, "UnregisterAllAddOnContentPath"}, + FunctionInfo{3, nullptr, "RefreshApplicationAddOnContent"}, + FunctionInfo{4, nullptr, "UnregisterApplicationAddOnContent"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IContentStorage final : public ServiceFramework { public: explicit IContentStorage(Core::System& system_, FileSys::StorageId id) - : ServiceFramework{system_, "IContentStorage"}, storage{id} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IContentStorage::GeneratePlaceHolderId, "GeneratePlaceHolderId"}, - {1, &IContentStorage::CreatePlaceHolder, "CreatePlaceHolder"}, - {2, &IContentStorage::DeletePlaceHolder, "DeletePlaceHolder"}, - {4, &IContentStorage::WritePlaceHolder, "WritePlaceHolder"}, - {5, &IContentStorage::Register, "Register"}, - {6, &IContentStorage::Delete, "Delete"}, - }; - // clang-format on + : ServiceFramework{system_, "IContentStorage"}, storage{id} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -252,23 +240,24 @@ private: rb.Push(succeeded ? ResultSuccess : ResultUnknown); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IContentStorage::GeneratePlaceHolderId, "GeneratePlaceHolderId"}, + FunctionInfo{1, &IContentStorage::CreatePlaceHolder, "CreatePlaceHolder"}, + FunctionInfo{2, &IContentStorage::DeletePlaceHolder, "DeletePlaceHolder"}, + FunctionInfo{4, &IContentStorage::WritePlaceHolder, "WritePlaceHolder"}, + FunctionInfo{5, &IContentStorage::Register, "Register"}, + FunctionInfo{6, &IContentStorage::Delete, "Delete"} + ); FileSys::StorageId storage; }; class IContentMetaDatabase final : public ServiceFramework { public: explicit IContentMetaDatabase(Core::System& system_, FileSys::StorageId id) - : ServiceFramework{system_, "IContentMetaDatabase"}, storage{id} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IContentMetaDatabase::Set, "Set"}, - {2, &IContentMetaDatabase::Remove, "Remove"}, - {8, &IContentMetaDatabase::Has, "Has"}, - {15, &IContentMetaDatabase::Commit, "Commit"}, - }; - // clang-format on + : ServiceFramework{system_, "IContentMetaDatabase"}, storage{id} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -356,51 +345,37 @@ private: rb.Push(ResultSuccess); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IContentMetaDatabase::Set, "Set"}, + FunctionInfo{2, &IContentMetaDatabase::Remove, "Remove"}, + FunctionInfo{8, &IContentMetaDatabase::Has, "Has"}, + FunctionInfo{15, &IContentMetaDatabase::Commit, "Commit"} + ); FileSys::StorageId storage; std::vector entries; }; class LR final : public ServiceFramework { public: - explicit LR(Core::System& system_) : ServiceFramework{system_, "lr"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "OpenLocationResolver"}, - {1, nullptr, "OpenRegisteredLocationResolver"}, - {2, nullptr, "RefreshLocationResolver"}, - {3, nullptr, "OpenAddOnContentLocationResolver"}, - }; - // clang-format on + explicit LR(Core::System& system_) : ServiceFramework{system_, "lr"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenLocationResolver"}, + FunctionInfo{1, nullptr, "OpenRegisteredLocationResolver"}, + FunctionInfo{2, nullptr, "RefreshLocationResolver"}, + FunctionInfo{3, nullptr, "OpenAddOnContentLocationResolver"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class NCM final : public ServiceFramework { public: - explicit NCM(Core::System& system_) : ServiceFramework{system_, "ncm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateContentStorage"}, - {1, nullptr, "CreateContentMetaDatabase"}, - {2, nullptr, "VerifyContentStorage"}, - {3, nullptr, "VerifyContentMetaDatabase"}, - {4, &NCM::OpenContentStorage, "OpenContentStorage"}, - {5, &NCM::OpenContentMetaDatabase, "OpenContentMetaDatabase"}, - {6, nullptr, "CloseContentStorageForcibly"}, - {7, nullptr, "CloseContentMetaDatabaseForcibly"}, - {8, nullptr, "CleanupContentMetaDatabase"}, - {9, nullptr, "ActivateContentStorage"}, - {10, nullptr, "InactivateContentStorage"}, - {11, nullptr, "ActivateContentMetaDatabase"}, - {12, nullptr, "InactivateContentMetaDatabase"}, - {13, nullptr, "InvalidateRightsIdCache"}, - {14, nullptr, "GetMemoryReport"}, - {15, nullptr, "ActivateFsContentStorage"}, - }; - // clang-format on + explicit NCM(Core::System& system_) : ServiceFramework{system_, "ncm"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -425,18 +400,39 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system, storage_id); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateContentStorage"}, + FunctionInfo{1, nullptr, "CreateContentMetaDatabase"}, + FunctionInfo{2, nullptr, "VerifyContentStorage"}, + FunctionInfo{3, nullptr, "VerifyContentMetaDatabase"}, + FunctionInfo{4, &NCM::OpenContentStorage, "OpenContentStorage"}, + FunctionInfo{5, &NCM::OpenContentMetaDatabase, "OpenContentMetaDatabase"}, + FunctionInfo{6, nullptr, "CloseContentStorageForcibly"}, + FunctionInfo{7, nullptr, "CloseContentMetaDatabaseForcibly"}, + FunctionInfo{8, nullptr, "CleanupContentMetaDatabase"}, + FunctionInfo{9, nullptr, "ActivateContentStorage"}, + FunctionInfo{10, nullptr, "InactivateContentStorage"}, + FunctionInfo{11, nullptr, "ActivateContentMetaDatabase"}, + FunctionInfo{12, nullptr, "InactivateContentMetaDatabase"}, + FunctionInfo{13, nullptr, "InvalidateRightsIdCache"}, + FunctionInfo{14, nullptr, "GetMemoryReport"}, + FunctionInfo{15, nullptr, "ActivateFsContentStorage"} + ); }; class NCM_V final : public ServiceFramework { public: explicit NCM_V(Core::System& system_) : ServiceFramework{system_, "ncm:v"} - { - static const FunctionInfo functions[] = { - {0, nullptr, "GetSystemVersion"}, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetSystemVersion"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp index f64445835e..d3a986faea 100644 --- a/src/core/hle/service/nfc/nfc.cpp +++ b/src/core/hle/service/nfc/nfc.cpp @@ -18,74 +18,71 @@ namespace Service::NFC { class IUser final : public NfcInterface { public: - explicit IUser(Core::System& system_) : NfcInterface(system_, "NFC::IUser", BackendType::Nfc) { - // clang-format off - static const FunctionInfo functions[] = { - {0, &NfcInterface::Initialize, "InitializeOld"}, - {1, &NfcInterface::Finalize, "FinalizeOld"}, - {2, &NfcInterface::GetState, "GetStateOld"}, - {3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"}, - {400, &NfcInterface::Initialize, "Initialize"}, - {401, &NfcInterface::Finalize, "Finalize"}, - {402, &NfcInterface::GetState, "GetState"}, - {403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"}, - {404, &NfcInterface::ListDevices, "ListDevices"}, - {405, &NfcInterface::GetDeviceState, "GetDeviceState"}, - {406, &NfcInterface::GetNpadId, "GetNpadId"}, - {407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - {408, &NfcInterface::StartDetection, "StartDetection"}, - {409, &NfcInterface::StopDetection, "StopDetection"}, - {410, &NfcInterface::GetTagInfo, "GetTagInfo"}, - {411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"}, - {412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"}, - {1000, &NfcInterface::ReadMifare, "ReadMifare"}, - {1001, &NfcInterface::WriteMifare ,"WriteMifare"}, - {1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"}, - {1301, nullptr, "KeepPassThroughSession"}, - {1302, nullptr, "ReleasePassThroughSession"}, - }; - // clang-format on + explicit IUser(Core::System& system_) : NfcInterface(system_, "NFC::IUser", BackendType::Nfc) {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMapWithClass( + FunctionInfoTyped{0, &NfcInterface::Initialize, "InitializeOld"}, + FunctionInfoTyped{1, &NfcInterface::Finalize, "FinalizeOld"}, + FunctionInfoTyped{2, &NfcInterface::GetState, "GetStateOld"}, + FunctionInfoTyped{3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"}, + FunctionInfoTyped{400, &NfcInterface::Initialize, "Initialize"}, + FunctionInfoTyped{401, &NfcInterface::Finalize, "Finalize"}, + FunctionInfoTyped{402, &NfcInterface::GetState, "GetState"}, + FunctionInfoTyped{403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"}, + FunctionInfoTyped{404, &NfcInterface::ListDevices, "ListDevices"}, + FunctionInfoTyped{405, &NfcInterface::GetDeviceState, "GetDeviceState"}, + FunctionInfoTyped{406, &NfcInterface::GetNpadId, "GetNpadId"}, + FunctionInfoTyped{407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + FunctionInfoTyped{408, &NfcInterface::StartDetection, "StartDetection"}, + FunctionInfoTyped{409, &NfcInterface::StopDetection, "StopDetection"}, + FunctionInfoTyped{410, &NfcInterface::GetTagInfo, "GetTagInfo"}, + FunctionInfoTyped{411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"}, + FunctionInfoTyped{412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"}, + FunctionInfoTyped{1000, &NfcInterface::ReadMifare, "ReadMifare"}, + FunctionInfoTyped{1001, &NfcInterface::WriteMifare ,"WriteMifare"}, + FunctionInfoTyped{1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"}, + FunctionInfoTyped{1301, nullptr, "KeepPassThroughSession"}, + FunctionInfoTyped{1302, nullptr, "ReleasePassThroughSession"} + ); }; class ISystem final : public NfcInterface { public: - explicit ISystem(Core::System& system_) - : NfcInterface{system_, "NFC::ISystem", BackendType::Nfc} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &NfcInterface::Initialize, "InitializeOld"}, - {1, &NfcInterface::Finalize, "FinalizeOld"}, - {2, &NfcInterface::GetState, "GetStateOld"}, - {3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"}, - {100, &NfcInterface::SetNfcEnabled, "SetNfcEnabledOld"}, - {400, &NfcInterface::Initialize, "Initialize"}, - {401, &NfcInterface::Finalize, "Finalize"}, - {402, &NfcInterface::GetState, "GetState"}, - {403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"}, - {404, &NfcInterface::ListDevices, "ListDevices"}, - {405, &NfcInterface::GetDeviceState, "GetDeviceState"}, - {406, &NfcInterface::GetNpadId, "GetNpadId"}, - {407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - {408, &NfcInterface::StartDetection, "StartDetection"}, - {409, &NfcInterface::StopDetection, "StopDetection"}, - {410, &NfcInterface::GetTagInfo, "GetTagInfo"}, - {411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"}, - {412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"}, - {500, &NfcInterface::SetNfcEnabled, "SetNfcEnabled"}, - {510, nullptr, "OutputTestWave"}, - {1000, &NfcInterface::ReadMifare, "ReadMifare"}, - {1001, &NfcInterface::WriteMifare, "WriteMifare"}, - {1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"}, - {1301, nullptr, "KeepPassThroughSession"}, - {1302, nullptr, "ReleasePassThroughSession"}, - }; - // clang-format on + explicit ISystem(Core::System& system_) : NfcInterface{system_, "NFC::ISystem", BackendType::Nfc} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMapWithClass( + FunctionInfoTyped{0, &NfcInterface::Initialize, "InitializeOld"}, + FunctionInfoTyped{1, &NfcInterface::Finalize, "FinalizeOld"}, + FunctionInfoTyped{2, &NfcInterface::GetState, "GetStateOld"}, + FunctionInfoTyped{3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"}, + FunctionInfoTyped{100, &NfcInterface::SetNfcEnabled, "SetNfcEnabledOld"}, + FunctionInfoTyped{400, &NfcInterface::Initialize, "Initialize"}, + FunctionInfoTyped{401, &NfcInterface::Finalize, "Finalize"}, + FunctionInfoTyped{402, &NfcInterface::GetState, "GetState"}, + FunctionInfoTyped{403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"}, + FunctionInfoTyped{404, &NfcInterface::ListDevices, "ListDevices"}, + FunctionInfoTyped{405, &NfcInterface::GetDeviceState, "GetDeviceState"}, + FunctionInfoTyped{406, &NfcInterface::GetNpadId, "GetNpadId"}, + FunctionInfoTyped{407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + FunctionInfoTyped{408, &NfcInterface::StartDetection, "StartDetection"}, + FunctionInfoTyped{409, &NfcInterface::StopDetection, "StopDetection"}, + FunctionInfoTyped{410, &NfcInterface::GetTagInfo, "GetTagInfo"}, + FunctionInfoTyped{411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"}, + FunctionInfoTyped{412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"}, + FunctionInfoTyped{500, &NfcInterface::SetNfcEnabled, "SetNfcEnabled"}, + FunctionInfoTyped{510, nullptr, "OutputTestWave"}, + FunctionInfoTyped{1000, &NfcInterface::ReadMifare, "ReadMifare"}, + FunctionInfoTyped{1001, &NfcInterface::WriteMifare, "WriteMifare"}, + FunctionInfoTyped{1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"}, + FunctionInfoTyped{1301, nullptr, "KeepPassThroughSession"}, + FunctionInfoTyped{1302, nullptr, "ReleasePassThroughSession"} + ); }; // MFInterface has an unique interface but it's identical to NfcInterface so we can keep the code @@ -93,56 +90,49 @@ public: using MFInterface = NfcInterface; class MFIUser final : public MFInterface { public: - explicit MFIUser(Core::System& system_) - : MFInterface{system_, "NFC::MFInterface", BackendType::Mifare} { - // clang-format off - static const FunctionInfoTyped functions[] = { - {0, &MFIUser::Initialize, "Initialize"}, - {1, &MFIUser::Finalize, "Finalize"}, - {2, &MFIUser::ListDevices, "ListDevices"}, - {3, &MFIUser::StartDetection, "StartDetection"}, - {4, &MFIUser::StopDetection, "StopDetection"}, - {5, &MFIUser::ReadMifare, "Read"}, - {6, &MFIUser::WriteMifare, "Write"}, - {7, &MFIUser::GetTagInfo, "GetTagInfo"}, - {8, &MFIUser::AttachActivateEvent, "GetActivateEventHandle"}, - {9, &MFIUser::AttachDeactivateEvent, "GetDeactivateEventHandle"}, - {10, &MFIUser::GetState, "GetState"}, - {11, &MFIUser::GetDeviceState, "GetDeviceState"}, - {12, &MFIUser::GetNpadId, "GetNpadId"}, - {13, &MFIUser::AttachAvailabilityChangeEvent, "GetAvailabilityChangeEventHandle"}, - }; - // clang-format on + explicit MFIUser(Core::System& system_) : MFInterface{system_, "NFC::MFInterface", BackendType::Mifare} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMapWithClass( + FunctionInfoTyped{0, &MFIUser::Initialize, "Initialize"}, + FunctionInfoTyped{1, &MFIUser::Finalize, "Finalize"}, + FunctionInfoTyped{2, &MFIUser::ListDevices, "ListDevices"}, + FunctionInfoTyped{3, &MFIUser::StartDetection, "StartDetection"}, + FunctionInfoTyped{4, &MFIUser::StopDetection, "StopDetection"}, + FunctionInfoTyped{5, &MFIUser::ReadMifare, "Read"}, + FunctionInfoTyped{6, &MFIUser::WriteMifare, "Write"}, + FunctionInfoTyped{7, &MFIUser::GetTagInfo, "GetTagInfo"}, + FunctionInfoTyped{8, &MFIUser::AttachActivateEvent, "GetActivateEventHandle"}, + FunctionInfoTyped{9, &MFIUser::AttachDeactivateEvent, "GetDeactivateEventHandle"}, + FunctionInfoTyped{10, &MFIUser::GetState, "GetState"}, + FunctionInfoTyped{11, &MFIUser::GetDeviceState, "GetDeviceState"}, + FunctionInfoTyped{12, &MFIUser::GetNpadId, "GetNpadId"}, + FunctionInfoTyped{13, &MFIUser::AttachAvailabilityChangeEvent, "GetAvailabilityChangeEventHandle"} + ); }; class IAm final : public ServiceFramework { public: - explicit IAm(Core::System& system_) : ServiceFramework{system_, "NFC::IAm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "Finalize"}, - {2, nullptr, "NotifyForegroundApplet"}, - }; - // clang-format on + explicit IAm(Core::System& system_) : ServiceFramework{system_, "NFC::IAm"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{1, nullptr, "Finalize"}, + FunctionInfo{2, nullptr, "NotifyForegroundApplet"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class NFC_AM final : public ServiceFramework { public: - explicit NFC_AM(Core::System& system_) : ServiceFramework{system_, "nfc:am"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &NFC_AM::CreateAmNfcInterface, "CreateAmNfcInterface"}, - }; - // clang-format on + explicit NFC_AM(Core::System& system_) : ServiceFramework{system_, "nfc:am"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -153,18 +143,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &NFC_AM::CreateAmNfcInterface, "CreateAmNfcInterface"} + ); }; class NFC_MF_U final : public ServiceFramework { public: - explicit NFC_MF_U(Core::System& system_) : ServiceFramework{system_, "nfc:mf:u"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &NFC_MF_U::CreateUserNfcInterface, "CreateUserNfcInterface"}, - }; - // clang-format on + explicit NFC_MF_U(Core::System& system_) : ServiceFramework{system_, "nfc:mf:u"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -175,18 +165,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &NFC_MF_U::CreateUserNfcInterface, "CreateUserNfcInterface"} + ); }; class NFC_U final : public ServiceFramework { public: - explicit NFC_U(Core::System& system_) : ServiceFramework{system_, "nfc:user"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &NFC_U::CreateUserNfcInterface, "CreateUserNfcInterface"}, - }; - // clang-format on + explicit NFC_U(Core::System& system_) : ServiceFramework{system_, "nfc:user"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -197,18 +187,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &NFC_U::CreateUserNfcInterface, "CreateUserNfcInterface"} + ); }; class NFC_SYS final : public ServiceFramework { public: - explicit NFC_SYS(Core::System& system_) : ServiceFramework{system_, "nfc:sys"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &NFC_SYS::CreateSystemNfcInterface, "CreateSystemNfcInterface"}, - }; - // clang-format on + explicit NFC_SYS(Core::System& system_) : ServiceFramework{system_, "nfc:sys"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -219,6 +209,10 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &NFC_SYS::CreateSystemNfcInterface, "CreateSystemNfcInterface"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index e0c24679ab..bfeb7d5553 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -14,145 +14,134 @@ namespace Service::NFP { class IUser final : public Interface { public: - explicit IUser(Core::System& system_) : Interface(system_, "NFP:IUser") { - // clang-format off - static const FunctionInfoTyped functions[] = { - {0, &IUser::Initialize, "Initialize"}, - {1, &IUser::Finalize, "Finalize"}, - {2, &IUser::ListDevices, "ListDevices"}, - {3, &IUser::StartDetection, "StartDetection"}, - {4, &IUser::StopDetection, "StopDetection"}, - {5, &IUser::Mount, "Mount"}, - {6, &IUser::Unmount, "Unmount"}, - {7, &IUser::OpenApplicationArea, "OpenApplicationArea"}, - {8, &IUser::GetApplicationArea, "GetApplicationArea"}, - {9, &IUser::SetApplicationArea, "SetApplicationArea"}, - {10, &IUser::Flush, "Flush"}, - {11, &IUser::Restore, "Restore"}, - {12, &IUser::CreateApplicationArea, "CreateApplicationArea"}, - {13, &IUser::GetTagInfo, "GetTagInfo"}, - {14, &IUser::GetRegisterInfo, "GetRegisterInfo"}, - {15, &IUser::GetCommonInfo, "GetCommonInfo"}, - {16, &IUser::GetModelInfo, "GetModelInfo"}, - {17, &IUser::AttachActivateEvent, "AttachActivateEvent"}, - {18, &IUser::AttachDeactivateEvent, "AttachDeactivateEvent"}, - {19, &IUser::GetState, "GetState"}, - {20, &IUser::GetDeviceState, "GetDeviceState"}, - {21, &IUser::GetNpadId, "GetNpadId"}, - {22, &IUser::GetApplicationAreaSize, "GetApplicationAreaSize"}, - {23, &IUser::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - {24, &IUser::RecreateApplicationArea, "RecreateApplicationArea"}, - {25, &IUser::StartDetection, "StartDetectionWithFilter"}, - }; - // clang-format on + explicit IUser(Core::System& system_) : Interface(system_, "NFP:IUser") {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMapWithClass( + FunctionInfoTyped{0, &IUser::Initialize, "Initialize"}, + FunctionInfoTyped{1, &IUser::Finalize, "Finalize"}, + FunctionInfoTyped{2, &IUser::ListDevices, "ListDevices"}, + FunctionInfoTyped{3, &IUser::StartDetection, "StartDetection"}, + FunctionInfoTyped{4, &IUser::StopDetection, "StopDetection"}, + FunctionInfoTyped{5, &IUser::Mount, "Mount"}, + FunctionInfoTyped{6, &IUser::Unmount, "Unmount"}, + FunctionInfoTyped{7, &IUser::OpenApplicationArea, "OpenApplicationArea"}, + FunctionInfoTyped{8, &IUser::GetApplicationArea, "GetApplicationArea"}, + FunctionInfoTyped{9, &IUser::SetApplicationArea, "SetApplicationArea"}, + FunctionInfoTyped{10, &IUser::Flush, "Flush"}, + FunctionInfoTyped{11, &IUser::Restore, "Restore"}, + FunctionInfoTyped{12, &IUser::CreateApplicationArea, "CreateApplicationArea"}, + FunctionInfoTyped{13, &IUser::GetTagInfo, "GetTagInfo"}, + FunctionInfoTyped{14, &IUser::GetRegisterInfo, "GetRegisterInfo"}, + FunctionInfoTyped{15, &IUser::GetCommonInfo, "GetCommonInfo"}, + FunctionInfoTyped{16, &IUser::GetModelInfo, "GetModelInfo"}, + FunctionInfoTyped{17, &IUser::AttachActivateEvent, "AttachActivateEvent"}, + FunctionInfoTyped{18, &IUser::AttachDeactivateEvent, "AttachDeactivateEvent"}, + FunctionInfoTyped{19, &IUser::GetState, "GetState"}, + FunctionInfoTyped{20, &IUser::GetDeviceState, "GetDeviceState"}, + FunctionInfoTyped{21, &IUser::GetNpadId, "GetNpadId"}, + FunctionInfoTyped{22, &IUser::GetApplicationAreaSize, "GetApplicationAreaSize"}, + FunctionInfoTyped{23, &IUser::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + FunctionInfoTyped{24, &IUser::RecreateApplicationArea, "RecreateApplicationArea"}, + FunctionInfoTyped{25, &IUser::StartDetection, "StartDetectionWithFilter"} + ); }; class ISystem final : public Interface { public: - explicit ISystem(Core::System& system_) : Interface(system_, "NFP:ISystem") { - // clang-format off - static const FunctionInfoTyped functions[] = { - {0, &ISystem::InitializeSystem, "InitializeSystem"}, - {1, &ISystem::FinalizeSystem, "FinalizeSystem"}, - {2, &ISystem::ListDevices, "ListDevices"}, - {3, &ISystem::StartDetection, "StartDetection"}, - {4, &ISystem::StopDetection, "StopDetection"}, - {5, &ISystem::Mount, "Mount"}, - {6, &ISystem::Unmount, "Unmount"}, - {10, &ISystem::Flush, "Flush"}, - {11, &ISystem::Restore, "Restore"}, - {12, &ISystem::CreateApplicationArea, "CreateApplicationArea"}, - {13, &ISystem::GetTagInfo, "GetTagInfo"}, - {14, &ISystem::GetRegisterInfo, "GetRegisterInfo"}, - {15, &ISystem::GetCommonInfo, "GetCommonInfo"}, - {16, &ISystem::GetModelInfo, "GetModelInfo"}, - {17, &ISystem::AttachActivateEvent, "AttachActivateEvent"}, - {18, &ISystem::AttachDeactivateEvent, "AttachDeactivateEvent"}, - {19, &ISystem::GetState, "GetState"}, - {20, &ISystem::GetDeviceState, "GetDeviceState"}, - {21, &ISystem::GetNpadId, "GetNpadId"}, - {23, &ISystem::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - {25, &ISystem::StartDetection, "StartDetectionWithFilter"}, - {100, &ISystem::Format, "Format"}, - {101, &ISystem::GetAdminInfo, "GetAdminInfo"}, - {102, &ISystem::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"}, - {103, &ISystem::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"}, - {104, &ISystem::DeleteRegisterInfo, "DeleteRegisterInfo"}, - {105, &ISystem::DeleteApplicationArea, "DeleteApplicationArea"}, - {106, &ISystem::ExistsApplicationArea, "ExistsApplicationArea"}, - }; - // clang-format on + explicit ISystem(Core::System& system_) : Interface(system_, "NFP:ISystem") {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMapWithClass( + FunctionInfoTyped{0, &ISystem::InitializeSystem, "InitializeSystem"}, + FunctionInfoTyped{1, &ISystem::FinalizeSystem, "FinalizeSystem"}, + FunctionInfoTyped{2, &ISystem::ListDevices, "ListDevices"}, + FunctionInfoTyped{3, &ISystem::StartDetection, "StartDetection"}, + FunctionInfoTyped{4, &ISystem::StopDetection, "StopDetection"}, + FunctionInfoTyped{5, &ISystem::Mount, "Mount"}, + FunctionInfoTyped{6, &ISystem::Unmount, "Unmount"}, + FunctionInfoTyped{10, &ISystem::Flush, "Flush"}, + FunctionInfoTyped{11, &ISystem::Restore, "Restore"}, + FunctionInfoTyped{12, &ISystem::CreateApplicationArea, "CreateApplicationArea"}, + FunctionInfoTyped{13, &ISystem::GetTagInfo, "GetTagInfo"}, + FunctionInfoTyped{14, &ISystem::GetRegisterInfo, "GetRegisterInfo"}, + FunctionInfoTyped{15, &ISystem::GetCommonInfo, "GetCommonInfo"}, + FunctionInfoTyped{16, &ISystem::GetModelInfo, "GetModelInfo"}, + FunctionInfoTyped{17, &ISystem::AttachActivateEvent, "AttachActivateEvent"}, + FunctionInfoTyped{18, &ISystem::AttachDeactivateEvent, "AttachDeactivateEvent"}, + FunctionInfoTyped{19, &ISystem::GetState, "GetState"}, + FunctionInfoTyped{20, &ISystem::GetDeviceState, "GetDeviceState"}, + FunctionInfoTyped{21, &ISystem::GetNpadId, "GetNpadId"}, + FunctionInfoTyped{23, &ISystem::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + FunctionInfoTyped{25, &ISystem::StartDetection, "StartDetectionWithFilter"}, + FunctionInfoTyped{100, &ISystem::Format, "Format"}, + FunctionInfoTyped{101, &ISystem::GetAdminInfo, "GetAdminInfo"}, + FunctionInfoTyped{102, &ISystem::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"}, + FunctionInfoTyped{103, &ISystem::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"}, + FunctionInfoTyped{104, &ISystem::DeleteRegisterInfo, "DeleteRegisterInfo"}, + FunctionInfoTyped{105, &ISystem::DeleteApplicationArea, "DeleteApplicationArea"}, + FunctionInfoTyped{106, &ISystem::ExistsApplicationArea, "ExistsApplicationArea"} + ); }; class IDebug final : public Interface { public: - explicit IDebug(Core::System& system_) : Interface(system_, "NFP:IDebug") { - // clang-format off - static const FunctionInfoTyped functions[] = { - {0, &IDebug::InitializeDebug, "InitializeDebug"}, - {1, &IDebug::FinalizeDebug, "FinalizeDebug"}, - {2, &IDebug::ListDevices, "ListDevices"}, - {3, &IDebug::StartDetection, "StartDetection"}, - {4, &IDebug::StopDetection, "StopDetection"}, - {5, &IDebug::Mount, "Mount"}, - {6, &IDebug::Unmount, "Unmount"}, - {7, &IDebug::OpenApplicationArea, "OpenApplicationArea"}, - {8, &IDebug::GetApplicationArea, "GetApplicationArea"}, - {9, &IDebug::SetApplicationArea, "SetApplicationArea"}, - {10, &IDebug::Flush, "Flush"}, - {11, &IDebug::Restore, "Restore"}, - {12, &IDebug::CreateApplicationArea, "CreateApplicationArea"}, - {13, &IDebug::GetTagInfo, "GetTagInfo"}, - {14, &IDebug::GetRegisterInfo, "GetRegisterInfo"}, - {15, &IDebug::GetCommonInfo, "GetCommonInfo"}, - {16, &IDebug::GetModelInfo, "GetModelInfo"}, - {17, &IDebug::AttachActivateEvent, "AttachActivateEvent"}, - {18, &IDebug::AttachDeactivateEvent, "AttachDeactivateEvent"}, - {19, &IDebug::GetState, "GetState"}, - {20, &IDebug::GetDeviceState, "GetDeviceState"}, - {21, &IDebug::GetNpadId, "GetNpadId"}, - {22, &IDebug::GetApplicationAreaSize, "GetApplicationAreaSize"}, - {23, &IDebug::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - {24, &IDebug::RecreateApplicationArea, "RecreateApplicationArea"}, - {25, &IDebug::StartDetection, "StartDetectionWithFilter"}, - {100, &IDebug::Format, "Format"}, - {101, &IDebug::GetAdminInfo, "GetAdminInfo"}, - {102, &IDebug::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"}, - {103, &IDebug::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"}, - {104, &IDebug::DeleteRegisterInfo, "DeleteRegisterInfo"}, - {105, &IDebug::DeleteApplicationArea, "DeleteApplicationArea"}, - {106, &IDebug::ExistsApplicationArea, "ExistsApplicationArea"}, - {200, &IDebug::GetAll, "GetAll"}, - {201, &IDebug::SetAll, "SetAll"}, - {202, &IDebug::FlushDebug, "FlushDebug"}, - {203, &IDebug::BreakTag, "BreakTag"}, - {204, &IDebug::ReadBackupData, "ReadBackupData"}, - {205, &IDebug::WriteBackupData, "WriteBackupData"}, - {206, &IDebug::WriteNtf, "WriteNtf"}, - }; - // clang-format on + explicit IDebug(Core::System& system_) : Interface(system_, "NFP:IDebug") {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMapWithClass( + FunctionInfoTyped{0, &IDebug::InitializeDebug, "InitializeDebug"}, + FunctionInfoTyped{1, &IDebug::FinalizeDebug, "FinalizeDebug"}, + FunctionInfoTyped{2, &IDebug::ListDevices, "ListDevices"}, + FunctionInfoTyped{3, &IDebug::StartDetection, "StartDetection"}, + FunctionInfoTyped{4, &IDebug::StopDetection, "StopDetection"}, + FunctionInfoTyped{5, &IDebug::Mount, "Mount"}, + FunctionInfoTyped{6, &IDebug::Unmount, "Unmount"}, + FunctionInfoTyped{7, &IDebug::OpenApplicationArea, "OpenApplicationArea"}, + FunctionInfoTyped{8, &IDebug::GetApplicationArea, "GetApplicationArea"}, + FunctionInfoTyped{9, &IDebug::SetApplicationArea, "SetApplicationArea"}, + FunctionInfoTyped{10, &IDebug::Flush, "Flush"}, + FunctionInfoTyped{11, &IDebug::Restore, "Restore"}, + FunctionInfoTyped{12, &IDebug::CreateApplicationArea, "CreateApplicationArea"}, + FunctionInfoTyped{13, &IDebug::GetTagInfo, "GetTagInfo"}, + FunctionInfoTyped{14, &IDebug::GetRegisterInfo, "GetRegisterInfo"}, + FunctionInfoTyped{15, &IDebug::GetCommonInfo, "GetCommonInfo"}, + FunctionInfoTyped{16, &IDebug::GetModelInfo, "GetModelInfo"}, + FunctionInfoTyped{17, &IDebug::AttachActivateEvent, "AttachActivateEvent"}, + FunctionInfoTyped{18, &IDebug::AttachDeactivateEvent, "AttachDeactivateEvent"}, + FunctionInfoTyped{19, &IDebug::GetState, "GetState"}, + FunctionInfoTyped{20, &IDebug::GetDeviceState, "GetDeviceState"}, + FunctionInfoTyped{21, &IDebug::GetNpadId, "GetNpadId"}, + FunctionInfoTyped{22, &IDebug::GetApplicationAreaSize, "GetApplicationAreaSize"}, + FunctionInfoTyped{23, &IDebug::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + FunctionInfoTyped{24, &IDebug::RecreateApplicationArea, "RecreateApplicationArea"}, + FunctionInfoTyped{25, &IDebug::StartDetection, "StartDetectionWithFilter"}, + FunctionInfoTyped{100, &IDebug::Format, "Format"}, + FunctionInfoTyped{101, &IDebug::GetAdminInfo, "GetAdminInfo"}, + FunctionInfoTyped{102, &IDebug::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"}, + FunctionInfoTyped{103, &IDebug::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"}, + FunctionInfoTyped{104, &IDebug::DeleteRegisterInfo, "DeleteRegisterInfo"}, + FunctionInfoTyped{105, &IDebug::DeleteApplicationArea, "DeleteApplicationArea"}, + FunctionInfoTyped{106, &IDebug::ExistsApplicationArea, "ExistsApplicationArea"}, + FunctionInfoTyped{200, &IDebug::GetAll, "GetAll"}, + FunctionInfoTyped{201, &IDebug::SetAll, "SetAll"}, + FunctionInfoTyped{202, &IDebug::FlushDebug, "FlushDebug"}, + FunctionInfoTyped{203, &IDebug::BreakTag, "BreakTag"}, + FunctionInfoTyped{204, &IDebug::ReadBackupData, "ReadBackupData"}, + FunctionInfoTyped{205, &IDebug::WriteBackupData, "WriteBackupData"}, + FunctionInfoTyped{206, &IDebug::WriteNtf, "WriteNtf"} + ); }; class IUserManager final : public ServiceFramework { public: - explicit IUserManager(Core::System& system_) : ServiceFramework{system_, "nfp:user"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IUserManager::CreateUserInterface, "CreateUserInterface"}, - }; - // clang-format on - - RegisterHandlers(functions); - } + explicit IUserManager(Core::System& system_) : ServiceFramework{system_, "nfp:user"} {} private: void CreateUserInterface(HLERequestContext& ctx) { @@ -162,18 +151,21 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IUserManager::CreateUserInterface, "CreateUserInterface"} + ); }; class ISystemManager final : public ServiceFramework { public: - explicit ISystemManager(Core::System& system_) : ServiceFramework{system_, "nfp:sys"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &ISystemManager::CreateSystemInterface, "CreateSystemInterface"}, - }; - // clang-format on + explicit ISystemManager(Core::System& system_) : ServiceFramework{system_, "nfp:sys"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -184,18 +176,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ISystemManager::CreateSystemInterface, "CreateSystemInterface"} + ); }; class IDebugManager final : public ServiceFramework { public: - explicit IDebugManager(Core::System& system_) : ServiceFramework{system_, "nfp:dbg"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IDebugManager::CreateDebugInterface, "CreateDebugInterface"}, - }; - // clang-format on + explicit IDebugManager(Core::System& system_) : ServiceFramework{system_, "nfp:dbg"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -206,6 +198,10 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IDebugManager::CreateDebugInterface, "CreateDebugInterface"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/ngc/ngc.cpp b/src/core/hle/service/ngc/ngc.cpp index e79108a1eb..fb3ef39093 100644 --- a/src/core/hle/service/ngc/ngc.cpp +++ b/src/core/hle/service/ngc/ngc.cpp @@ -21,15 +21,10 @@ namespace Service::NGC { class IService final : public ServiceFramework { public: - explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IService::Match, "Match"}, - {1, &IService::Filter, "Filter"}, - }; - // clang-format on + explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -61,23 +56,19 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IService::Match, "Match"}, + FunctionInfo{1, &IService::Filter, "Filter"} + ); }; class NgcServiceImpl final : public ServiceFramework { public: - explicit NgcServiceImpl(Core::System& system_) : ServiceFramework(system_, "ngc:u") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &NgcServiceImpl::GetContentVersion, "GetContentVersion"}, - {1, &NgcServiceImpl::Check, "Check"}, - {2, &NgcServiceImpl::Mask, "Mask"}, - {3, &NgcServiceImpl::Reload, "Reload"}, - {4, &NgcServiceImpl::Check, "Check2"}, - {5, &NgcServiceImpl::Mask, "Mask2"}, - }; - // clang-format on + explicit NgcServiceImpl(Core::System& system_) : ServiceFramework(system_, "ngc:u") {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -150,25 +141,34 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &NgcServiceImpl::GetContentVersion, "GetContentVersion"}, + FunctionInfo{1, &NgcServiceImpl::Check, "Check"}, + FunctionInfo{2, &NgcServiceImpl::Mask, "Mask"}, + FunctionInfo{3, &NgcServiceImpl::Reload, "Reload"}, + FunctionInfo{4, &NgcServiceImpl::Check, "Check2"}, + FunctionInfo{5, &NgcServiceImpl::Mask, "Mask2"} + ); }; class IServiceWithManagementApi final : public ServiceFramework { public: - explicit IServiceWithManagementApi(Core::System& system_) : ServiceFramework(system_, "ngct:s") { - // clang-format off - static const FunctionInfo functions[] = { - {0 , nullptr, "Match"}, - {1 , nullptr, "Filter"}, - {100, nullptr, "ConfigureAutoUpdateSetting"}, - {101, nullptr, "RequestResourceUpdateCheck"}, - {110, nullptr, "Reload"}, - {111, nullptr, "IsReloadRequired"}, - {112, nullptr, "TryAcquireReloadRequestNotifier"}, - {120, nullptr, "CalculateContentFingerprint"}, - {130, nullptr, "TryEnableTemporalPassThrough"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit IServiceWithManagementApi(Core::System& system_) : ServiceFramework(system_, "ngct:s") {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Match"}, + FunctionInfo{1, nullptr, "Filter"}, + FunctionInfo{100, nullptr, "ConfigureAutoUpdateSetting"}, + FunctionInfo{101, nullptr, "RequestResourceUpdateCheck"}, + FunctionInfo{110, nullptr, "Reload"}, + FunctionInfo{111, nullptr, "IsReloadRequired"}, + FunctionInfo{112, nullptr, "TryAcquireReloadRequestNotifier"}, + FunctionInfo{120, nullptr, "CalculateContentFingerprint"}, + FunctionInfo{130, nullptr, "TryEnableTemporalPassThrough"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; @@ -179,20 +179,10 @@ static_assert(sizeof(SaveDataHandle) == 0x08); class IUserShimScopedObject final : public ServiceFramework { public: - explicit IUserShimScopedObject(Core::System& system_) : ServiceFramework(system_, "IUserShimScopedObject") { - // clang-format off - static const FunctionInfo functions[] = { - {450, nullptr, "InitializeForSaveData"}, - {451, nullptr, "FinalizeForSaveData"}, - {452, D<&IUserShimScopedObject::OpenSaveData>, "OpenSaveData"}, - {453, nullptr, "CloseSaveData"}, - {454, D<&IUserShimScopedObject::ReadSaveSlot>, "ReadSaveSlot"}, - {455, D<&IUserShimScopedObject::WriteSaveSlot>, "WriteSaveSlot"}, - {456, nullptr, "FlushSaveSlot"}, - {457, nullptr, "CommitSaveData"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit IUserShimScopedObject(Core::System& system_) : ServiceFramework(system_, "IUserShimScopedObject") {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } Result OpenSaveData(Account::Uid unk0, Out unk1) { @@ -210,42 +200,43 @@ public: // to implement R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{450, nullptr, "InitializeForSaveData"}, + FunctionInfo{451, nullptr, "FinalizeForSaveData"}, + FunctionInfo{452, D<&IUserShimScopedObject::OpenSaveData>, "OpenSaveData"}, + FunctionInfo{453, nullptr, "CloseSaveData"}, + FunctionInfo{454, D<&IUserShimScopedObject::ReadSaveSlot>, "ReadSaveSlot"}, + FunctionInfo{455, D<&IUserShimScopedObject::WriteSaveSlot>, "WriteSaveSlot"}, + FunctionInfo{456, nullptr, "FlushSaveSlot"}, + FunctionInfo{457, nullptr, "CommitSaveData"} + ); }; class IUserService final : public ServiceFramework { public: - explicit IUserService(Core::System& system_) : ServiceFramework(system_, "stpl:u") { - // clang-format off - static const FunctionInfo functions[] = { - {0 , D<&IUserService::Cmd0>, "Cmd0"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit IUserService(Core::System& system_) : ServiceFramework(system_, "stpl:u") {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } Result Cmd0(u32 unk0, OutInterface out_interface) { LOG_WARNING(Service_NGC, "stubbed"); *out_interface = std::make_shared(system); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IUserService::Cmd0>, "Cmd0"} + ); }; class ISystemShimScopedObject final : public ServiceFramework { public: - explicit ISystemShimScopedObject(Core::System& system_) : ServiceFramework(system_, "ISystemShimScopedObject") { - // clang-format off - static const FunctionInfo functions[] = { - {106, nullptr, "Cmd106"}, - {107, nullptr, "Cmd107"}, - {108, D<&ISystemShimScopedObject::Cmd108>, "Cmd108"}, - {207, nullptr, "Cmd207"}, - {208, D<&ISystemShimScopedObject::Cmd208>, "Cmd208"}, - {209, nullptr, "Cmd209"}, - {210, nullptr, "Cmd210"}, - {211, nullptr, "Cmd211"}, - {212, nullptr, "Cmd212"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit ISystemShimScopedObject(Core::System& system_) : ServiceFramework(system_, "ISystemShimScopedObject") {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } Result Cmd108() { @@ -257,23 +248,36 @@ public: LOG_WARNING(Service_NGC, "stubbed"); R_THROW(IPC::ResultNotSupported); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{106, nullptr, "Cmd106"}, + FunctionInfo{107, nullptr, "Cmd107"}, + FunctionInfo{108, D<&ISystemShimScopedObject::Cmd108>, "Cmd108"}, + FunctionInfo{207, nullptr, "Cmd207"}, + FunctionInfo{208, D<&ISystemShimScopedObject::Cmd208>, "Cmd208"}, + FunctionInfo{209, nullptr, "Cmd209"}, + FunctionInfo{210, nullptr, "Cmd210"}, + FunctionInfo{211, nullptr, "Cmd211"}, + FunctionInfo{212, nullptr, "Cmd212"} + ); }; class ISystemService final : public ServiceFramework { public: - explicit ISystemService(Core::System& system_) : ServiceFramework(system_, "stpl:sys") { - // clang-format off - static const FunctionInfo functions[] = { - {0 , D<&ISystemService::Cmd0>, "Cmd0"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit ISystemService(Core::System& system_) : ServiceFramework(system_, "stpl:sys") {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } Result Cmd0(OutInterface out_interface) { LOG_WARNING(Service_NGC, "stubbed"); *out_interface = std::make_shared(system); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ISystemService::Cmd0>, "Cmd0"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index efada9b807..5befe8e943 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -235,15 +235,6 @@ public: explicit IScanRequest(Core::System& system_) : ServiceFramework{system_, "IScanRequest"}, svc_ctx{system_, "IScanRequest"} { - static const FunctionInfo functions[] = { - {0, &IScanRequest::Submit, "Submit"}, - {1, &IScanRequest::IsProcessing, "IsProcessing"}, - {2, &IScanRequest::GetResult, "GetResult"}, - {3, &IScanRequest::GetSystemEventReadableHandle, "GetSystemEventReadableHandle"}, - {4, &IScanRequest::SetChannels, "SetChannels"}, - }; - RegisterHandlers(functions); - evt_scan_complete = CreateKEvent(svc_ctx, "IScanRequest:Complete"); evt_processing = CreateKEvent(svc_ctx, "IScanRequest:Processing"); } @@ -257,8 +248,6 @@ public: } private: - std::vector scan_results; - void Submit(HLERequestContext& ctx) { if (state.load() == State::Finished) { @@ -329,6 +318,17 @@ private: evt_scan_complete->Signal(system.Kernel()); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IScanRequest::Submit, "Submit"}, + FunctionInfo{1, &IScanRequest::IsProcessing, "IsProcessing"}, + FunctionInfo{2, &IScanRequest::GetResult, "GetResult"}, + FunctionInfo{3, &IScanRequest::GetSystemEventReadableHandle, "GetSystemEventReadableHandle"}, + FunctionInfo{4, &IScanRequest::SetChannels, "SetChannels"} + ); + std::vector scan_results; KernelHelpers::ServiceContext svc_ctx; Kernel::KEvent* evt_scan_complete{}; @@ -342,36 +342,6 @@ class IRequest final : public ServiceFramework { public: explicit IRequest(Core::System& system_) : ServiceFramework{system_, "IRequest"}, service_context{system_, "IRequest"} { - static const FunctionInfo functions[] = { - {0, &IRequest::GetRequestState, "GetRequestState"}, - {1, &IRequest::GetResult, "GetResult"}, - {2, &IRequest::GetSystemEventReadableHandles, "GetSystemEventReadableHandles"}, - {3, &IRequest::Cancel, "Cancel"}, - {4, &IRequest::Submit, "Submit"}, - {5, nullptr, "SetRequirement"}, - {6, &IRequest::SetRequirementPreset, "SetRequirementPreset"}, - {8, nullptr, "SetPriority"}, - {9, &IRequest::SetNetworkProfileId, "SetNetworkProfileId"}, - {10, nullptr, "SetRejectable"}, - {11, &IRequest::SetConnectionConfirmationOption, "SetConnectionConfirmationOption"}, - {12, nullptr, "SetPersistent"}, - {13, nullptr, "SetInstant"}, - {14, nullptr, "SetSustainable"}, - {15, nullptr, "SetRawPriority"}, - {16, nullptr, "SetGreedy"}, - {17, nullptr, "SetSharable"}, - {18, nullptr, "SetRequirementByRevision"}, - {19, nullptr, "GetRequirement"}, - {20, nullptr, "GetRevision"}, - {21, &IRequest::GetAppletInfo, "GetAppletInfo"}, - {22, nullptr, "GetAdditionalInfo"}, - {23, nullptr, "SetKeptInSleep"}, - {24, nullptr, "RegisterSocketDescriptor"}, - {25, nullptr, "UnregisterSocketDescriptor"}, - {26, nullptr, "GetNetworkAccessStatus"}, //21.0.0+ - }; - RegisterHandlers(functions); - event1 = CreateKEvent(service_context, "IRequest:Event1"); event2 = CreateKEvent(service_context, "IRequest:Event2"); state = RequestState::NotSubmitted; @@ -494,6 +464,37 @@ private: event1->Signal(system.Kernel()); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IRequest::GetRequestState, "GetRequestState"}, + FunctionInfo{1, &IRequest::GetResult, "GetResult"}, + FunctionInfo{2, &IRequest::GetSystemEventReadableHandles, "GetSystemEventReadableHandles"}, + FunctionInfo{3, &IRequest::Cancel, "Cancel"}, + FunctionInfo{4, &IRequest::Submit, "Submit"}, + FunctionInfo{5, nullptr, "SetRequirement"}, + FunctionInfo{6, &IRequest::SetRequirementPreset, "SetRequirementPreset"}, + FunctionInfo{8, nullptr, "SetPriority"}, + FunctionInfo{9, &IRequest::SetNetworkProfileId, "SetNetworkProfileId"}, + FunctionInfo{10, nullptr, "SetRejectable"}, + FunctionInfo{11, &IRequest::SetConnectionConfirmationOption, "SetConnectionConfirmationOption"}, + FunctionInfo{12, nullptr, "SetPersistent"}, + FunctionInfo{13, nullptr, "SetInstant"}, + FunctionInfo{14, nullptr, "SetSustainable"}, + FunctionInfo{15, nullptr, "SetRawPriority"}, + FunctionInfo{16, nullptr, "SetGreedy"}, + FunctionInfo{17, nullptr, "SetSharable"}, + FunctionInfo{18, nullptr, "SetRequirementByRevision"}, + FunctionInfo{19, nullptr, "GetRequirement"}, + FunctionInfo{20, nullptr, "GetRevision"}, + FunctionInfo{21, &IRequest::GetAppletInfo, "GetAppletInfo"}, + FunctionInfo{22, nullptr, "GetAdditionalInfo"}, + FunctionInfo{23, nullptr, "SetKeptInSleep"}, + FunctionInfo{24, nullptr, "RegisterSocketDescriptor"}, + FunctionInfo{25, nullptr, "UnregisterSocketDescriptor"}, + FunctionInfo{26, nullptr, "GetNetworkAccessStatus", MakeVersionGate({21,0,0})} + ); KernelHelpers::ServiceContext service_context; RequestState state; @@ -508,14 +509,16 @@ private: class INetworkProfile final : public ServiceFramework { public: - explicit INetworkProfile(Core::System& system_) : ServiceFramework{system_, "INetworkProfile"} { - static const FunctionInfo functions[] = { - {0, nullptr, "Update"}, - {1, nullptr, "PersistOld"}, - {2, nullptr, "Persist"}, - }; - RegisterHandlers(functions); + explicit INetworkProfile(Core::System& system_) : ServiceFramework{system_, "INetworkProfile"} {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Update"}, + FunctionInfo{1, nullptr, "PersistOld"}, + FunctionInfo{2, nullptr, "Persist"} + ); }; void IGeneralService::GetClientId(HLERequestContext& ctx) { @@ -1050,78 +1053,70 @@ void IGeneralService::GetCurrentAccessPoint(HLERequestContext& ctx) { rb.Push(ResultSuccess); } +std::optional IGeneralService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, &IGeneralService::GetClientId, "GetClientId"}, + FunctionInfo{2, &IGeneralService::CreateScanRequest, "CreateScanRequest"}, + FunctionInfo{4, &IGeneralService::CreateRequest, "CreateRequest"}, + FunctionInfo{5, &IGeneralService::GetCurrentNetworkProfile, "GetCurrentNetworkProfile"}, + FunctionInfo{6, &IGeneralService::EnumerateNetworkInterfaces, "EnumerateNetworkInterfaces"}, + FunctionInfo{7, &IGeneralService::EnumerateNetworkProfiles, "EnumerateNetworkProfiles"}, + FunctionInfo{8, &IGeneralService::GetNetworkProfile, "GetNetworkProfile"}, + FunctionInfo{9, &IGeneralService::SetNetworkProfile, "SetNetworkProfile"}, + FunctionInfo{10, &IGeneralService::RemoveNetworkProfile, "RemoveNetworkProfile"}, + FunctionInfo{11, &IGeneralService::GetScanData, "GetScanDataOld"}, + FunctionInfo{12, &IGeneralService::GetCurrentIpAddress, "GetCurrentIpAddress"}, + FunctionInfo{13, nullptr, "GetCurrentAccessPointOld"}, + FunctionInfo{14, &IGeneralService::CreateTemporaryNetworkProfile, "CreateTemporaryNetworkProfile"}, + FunctionInfo{15, &IGeneralService::GetCurrentIpConfigInfo, "GetCurrentIpConfigInfo"}, + FunctionInfo{16, &IGeneralService::SetWirelessCommunicationEnabled, "SetWirelessCommunicationEnabled"}, + FunctionInfo{17, &IGeneralService::IsWirelessCommunicationEnabled, "IsWirelessCommunicationEnabled"}, + FunctionInfo{18, &IGeneralService::GetInternetConnectionStatus, "GetInternetConnectionStatus"}, + FunctionInfo{19, &IGeneralService::SetEthernetCommunicationEnabled, "SetEthernetCommunicationEnabled"}, + FunctionInfo{20, &IGeneralService::IsEthernetCommunicationEnabled, "IsEthernetCommunicationEnabled"}, + FunctionInfo{21, &IGeneralService::IsAnyInternetRequestAccepted, "IsAnyInternetRequestAccepted"}, + FunctionInfo{22, &IGeneralService::IsAnyForegroundRequestAccepted, "IsAnyForegroundRequestAccepted"}, + FunctionInfo{23, nullptr, "PutToSleep"}, + FunctionInfo{24, nullptr, "WakeUp"}, + FunctionInfo{25, &IGeneralService::GetSsidListVersion, "GetSsidListVersion"}, + FunctionInfo{26, nullptr, "SetExclusiveClient"}, + FunctionInfo{27, nullptr, "GetDefaultIpSetting"}, + FunctionInfo{28, nullptr, "SetDefaultIpSetting"}, + FunctionInfo{29, nullptr, "SetWirelessCommunicationEnabledForTest"}, + FunctionInfo{30, nullptr, "SetEthernetCommunicationEnabledForTest"}, + FunctionInfo{31, nullptr, "GetTelemetorySystemEventReadableHandle"}, + FunctionInfo{32, nullptr, "GetTelemetryInfo"}, + FunctionInfo{33, &IGeneralService::ConfirmSystemAvailability, "ConfirmSystemAvailability", MakeVersionGate({2,0,0})}, + FunctionInfo{34, &IGeneralService::SetBackgroundRequestEnabled, "SetBackgroundRequestEnabled", MakeVersionGate({4,0,0})}, + FunctionInfo{35, &IGeneralService::GetScanDataV2, "GetScanData"}, + FunctionInfo{36, &IGeneralService::GetCurrentAccessPoint, "GetCurrentAccessPoint"}, + FunctionInfo{37, nullptr, "Shutdown"}, + FunctionInfo{38, nullptr, "GetAllowedChannels"}, + FunctionInfo{39, nullptr, "NotifyApplicationSuspended"}, + FunctionInfo{40, nullptr, "SetAcceptableNetworkTypeFlag"}, + FunctionInfo{41, nullptr, "GetAcceptableNetworkTypeFlag"}, + FunctionInfo{42, nullptr, "NotifyConnectionStateChanged"}, + FunctionInfo{43, nullptr, "SetWowlDelayedWakeTime"}, + FunctionInfo{44, nullptr, "IsWiredConnectionAvailable", MakeVersionGate({18,0,0})}, + FunctionInfo{45, nullptr, "IsNetworkEmulationFeatureEnabled", MakeVersionGate({18,0,0})}, + FunctionInfo{46, nullptr, "SelectActiveNetworkEmulationProfileIdForDebug", MakeVersionGate({18,0,0})}, + FunctionInfo{47, &IGeneralService::GetScanDataV3, "GetScanData", MakeVersionGate({19,0,0})}, + FunctionInfo{50, nullptr, "IsRewriteFeatureEnabled", MakeVersionGate({18,0,0})}, + FunctionInfo{51, nullptr, "CreateRewriteRule", MakeVersionGate({18,0,0})}, + FunctionInfo{52, nullptr, "DestroyRewriteRule", MakeVersionGate({18,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IGeneralService::IGeneralService(Core::System& system_) : ServiceFramework{system_, "IGeneralService"} { - // clang-format off - - static const FunctionInfo functions[] = { - {1, &IGeneralService::GetClientId, "GetClientId"}, - {2, &IGeneralService::CreateScanRequest, "CreateScanRequest"}, - {4, &IGeneralService::CreateRequest, "CreateRequest"}, - {5, &IGeneralService::GetCurrentNetworkProfile, "GetCurrentNetworkProfile"}, - {6, &IGeneralService::EnumerateNetworkInterfaces, "EnumerateNetworkInterfaces"}, - {7, &IGeneralService::EnumerateNetworkProfiles, "EnumerateNetworkProfiles"}, - {8, &IGeneralService::GetNetworkProfile, "GetNetworkProfile"}, - {9, &IGeneralService::SetNetworkProfile, "SetNetworkProfile"}, - {10, &IGeneralService::RemoveNetworkProfile, "RemoveNetworkProfile"}, - {11, &IGeneralService::GetScanData, "GetScanDataOld"}, - {12, &IGeneralService::GetCurrentIpAddress, "GetCurrentIpAddress"}, - {13, nullptr, "GetCurrentAccessPointOld"}, - {14, &IGeneralService::CreateTemporaryNetworkProfile, "CreateTemporaryNetworkProfile"}, - {15, &IGeneralService::GetCurrentIpConfigInfo, "GetCurrentIpConfigInfo"}, - {16, &IGeneralService::SetWirelessCommunicationEnabled, "SetWirelessCommunicationEnabled"}, - {17, &IGeneralService::IsWirelessCommunicationEnabled, "IsWirelessCommunicationEnabled"}, - {18, &IGeneralService::GetInternetConnectionStatus, "GetInternetConnectionStatus"}, - {19, &IGeneralService::SetEthernetCommunicationEnabled, "SetEthernetCommunicationEnabled"}, - {20, &IGeneralService::IsEthernetCommunicationEnabled, "IsEthernetCommunicationEnabled"}, - {21, &IGeneralService::IsAnyInternetRequestAccepted, "IsAnyInternetRequestAccepted"}, - {22, &IGeneralService::IsAnyForegroundRequestAccepted, "IsAnyForegroundRequestAccepted"}, - {23, nullptr, "PutToSleep"}, - {24, nullptr, "WakeUp"}, - {25, &IGeneralService::GetSsidListVersion, "GetSsidListVersion"}, - {26, nullptr, "SetExclusiveClient"}, - {27, nullptr, "GetDefaultIpSetting"}, - {28, nullptr, "SetDefaultIpSetting"}, - {29, nullptr, "SetWirelessCommunicationEnabledForTest"}, - {30, nullptr, "SetEthernetCommunicationEnabledForTest"}, - {31, nullptr, "GetTelemetorySystemEventReadableHandle"}, - {32, nullptr, "GetTelemetryInfo"}, - {33, &IGeneralService::ConfirmSystemAvailability, "ConfirmSystemAvailability"}, // 2.0.0+ - {34, &IGeneralService::SetBackgroundRequestEnabled, "SetBackgroundRequestEnabled"}, // 4.0.0+ - {35, &IGeneralService::GetScanDataV2, "GetScanData"}, - {36, &IGeneralService::GetCurrentAccessPoint, "GetCurrentAccessPoint"}, - {37, nullptr, "Shutdown"}, - {38, nullptr, "GetAllowedChannels"}, - {39, nullptr, "NotifyApplicationSuspended"}, - {40, nullptr, "SetAcceptableNetworkTypeFlag"}, - {41, nullptr, "GetAcceptableNetworkTypeFlag"}, - {42, nullptr, "NotifyConnectionStateChanged"}, - {43, nullptr, "SetWowlDelayedWakeTime"}, - {44, nullptr, "IsWiredConnectionAvailable"}, // 18.0.0+ - {45, nullptr, "IsNetworkEmulationFeatureEnabled"}, // 18.0.0+ - {46, nullptr, "SelectActiveNetworkEmulationProfileIdForDebug"}, // 18.0.0+ - {47, &IGeneralService::GetScanDataV3, "GetScanData"}, // 19.0.0+ - {50, nullptr, "IsRewriteFeatureEnabled"}, // 18.0.0+ - {51, nullptr, "CreateRewriteRule"}, // 18.0.0+ - {52, nullptr, "DestroyRewriteRule"} // 18.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } IGeneralService::~IGeneralService() = default; class NetworkInterface final : public ServiceFramework { public: - explicit NetworkInterface(const char* name, Core::System& system_) - : ServiceFramework{system_, name} { - static const FunctionInfo functions[] = { - {4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, - {5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"}, - }; - RegisterHandlers(functions); - } + explicit NetworkInterface(const char* name, Core::System& system_) : ServiceFramework{system_, name} {} private: void CreateGeneralServiceOld(HLERequestContext& ctx) { @@ -1139,6 +1134,14 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, + FunctionInfo{5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h index 3b5a438c75..3f3535fa93 100644 --- a/src/core/hle/service/nifm/nifm.h +++ b/src/core/hle/service/nifm/nifm.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator @@ -51,6 +51,7 @@ private: void SetBackgroundRequestEnabled(HLERequestContext& ctx); void GetCurrentAccessPoint(HLERequestContext& ctx); void GetScanDataV3(HLERequestContext& ctx); + std::optional FindRequest(u32 key) override; }; } // namespace Service::NIFM diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index e5f2d85dde..c48bf54646 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -24,24 +24,15 @@ namespace Service::NIM { class IShopServiceAsync final : public ServiceFramework { public: explicit IShopServiceAsync(Core::System& system_) - : ServiceFramework{system_, "IShopServiceAsync"}, - service_context{system_, "IShopServiceAsync"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IShopServiceAsync::Cancel>, "Cancel"}, - {1, D<&IShopServiceAsync::GetSize>, "GetSize"}, - {2, D<&IShopServiceAsync::Read>, "Read"}, - {3, D<&IShopServiceAsync::GetErrorCode>, "GetErrorCode"}, - {4, D<&IShopServiceAsync::Request>, "Request"}, - {5, D<&IShopServiceAsync::Prepare>, "Prepare"}, - }; - // clang-format on - - RegisterHandlers(functions); - + : ServiceFramework{system_, "IShopServiceAsync"} + , service_context{system_, "IShopServiceAsync"} { completion_event = service_context.CreateEvent("IShopServiceAsync:Completion"); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + ~IShopServiceAsync() override { CancelImpl(); service_context.CloseEvent(completion_event); @@ -52,15 +43,6 @@ public: } private: - KernelHelpers::ServiceContext service_context; - Kernel::KEvent* completion_event; - - std::jthread worker; - std::atomic error_code{0}; - - std::mutex data_mutex; - std::vector download_data; - void CancelImpl() { worker.request_stop(); if (worker.joinable()) { @@ -136,19 +118,30 @@ private: } R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IShopServiceAsync::Cancel>, "Cancel"}, + FunctionInfo{1, D<&IShopServiceAsync::GetSize>, "GetSize"}, + FunctionInfo{2, D<&IShopServiceAsync::Read>, "Read"}, + FunctionInfo{3, D<&IShopServiceAsync::GetErrorCode>, "GetErrorCode"}, + FunctionInfo{4, D<&IShopServiceAsync::Request>, "Request"}, + FunctionInfo{5, D<&IShopServiceAsync::Prepare>, "Prepare"} + ); + KernelHelpers::ServiceContext service_context; + Kernel::KEvent* completion_event; + std::jthread worker; + std::atomic error_code{0}; + std::mutex data_mutex; + std::vector download_data; }; class IShopServiceAccessor final : public ServiceFramework { public: explicit IShopServiceAccessor(Core::System& system_) - : ServiceFramework{system_, "IShopServiceAccessor"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IShopServiceAccessor::CreateAsyncInterface, "CreateAsyncInterface"}, - }; - // clang-format on + : ServiceFramework{system_, "IShopServiceAccessor"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -160,19 +153,19 @@ private: rb.PushCopyObjects(ctx, async_interface->GetEvent()); rb.PushIpcInterface(ctx, std::move(async_interface)); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IShopServiceAccessor::CreateAsyncInterface, "CreateAsyncInterface"} + ); }; class IShopServiceAccessServer final : public ServiceFramework { public: explicit IShopServiceAccessServer(Core::System& system_) - : ServiceFramework{system_, "IShopServiceAccessServer"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IShopServiceAccessServer::CreateAccessorInterface, "CreateAccessorInterface"}, - }; - // clang-format on + : ServiceFramework{system_, "IShopServiceAccessServer"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -182,258 +175,252 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IShopServiceAccessServer::CreateAccessorInterface, "CreateAccessorInterface"} + ); }; class NIM final : public ServiceFramework { public: - explicit NIM(Core::System& system_) : ServiceFramework{system_, "nim"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateSystemUpdateTask"}, - {1, nullptr, "DestroySystemUpdateTask"}, - {2, nullptr, "ListSystemUpdateTask"}, - {3, nullptr, "RequestSystemUpdateTaskRun"}, - {4, nullptr, "GetSystemUpdateTaskInfo"}, - {5, nullptr, "CommitSystemUpdateTask"}, - {6, nullptr, "CreateNetworkInstallTask"}, - {7, nullptr, "DestroyNetworkInstallTask"}, - {8, nullptr, "ListNetworkInstallTask"}, - {9, nullptr, "RequestNetworkInstallTaskRun"}, - {10, nullptr, "GetNetworkInstallTaskInfo"}, - {11, nullptr, "CommitNetworkInstallTask"}, - {12, nullptr, "RequestLatestSystemUpdateMeta"}, - {14, nullptr, "ListApplicationNetworkInstallTask"}, - {15, nullptr, "ListNetworkInstallTaskContentMeta"}, - {16, nullptr, "RequestLatestVersion"}, - {17, nullptr, "SetNetworkInstallTaskAttribute"}, - {18, nullptr, "AddNetworkInstallTaskContentMeta"}, - {19, nullptr, "GetDownloadedSystemDataPath"}, - {20, nullptr, "CalculateNetworkInstallTaskRequiredSize"}, - {21, nullptr, "IsExFatDriverIncluded"}, - {22, nullptr, "GetBackgroundDownloadStressTaskInfo"}, - {23, nullptr, "RequestDeviceAuthenticationToken"}, - {24, nullptr, "RequestGameCardRegistrationStatus"}, - {25, nullptr, "RequestRegisterGameCard"}, - {26, nullptr, "RequestRegisterNotificationToken"}, - {27, nullptr, "RequestDownloadTaskList"}, - {28, nullptr, "RequestApplicationControl"}, - {29, nullptr, "RequestLatestApplicationControl"}, - {30, nullptr, "RequestVersionList"}, - {31, nullptr, "CreateApplyDeltaTask"}, - {32, nullptr, "DestroyApplyDeltaTask"}, - {33, nullptr, "ListApplicationApplyDeltaTask"}, - {34, nullptr, "RequestApplyDeltaTaskRun"}, - {35, nullptr, "GetApplyDeltaTaskInfo"}, - {36, nullptr, "ListApplyDeltaTask"}, - {37, nullptr, "CommitApplyDeltaTask"}, - {38, nullptr, "CalculateApplyDeltaTaskRequiredSize"}, - {39, nullptr, "PrepareShutdown"}, - {40, nullptr, "ListApplyDeltaTask"}, - {41, nullptr, "ClearNotEnoughSpaceStateOfApplyDeltaTask"}, - {42, nullptr, "CreateApplyDeltaTaskFromDownloadTask"}, - {43, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, - {44, nullptr, "GetApplyDeltaTaskRequiredStorage"}, - {45, nullptr, "CalculateNetworkInstallTaskContentsSize"}, - {46, nullptr, "PrepareShutdownForSystemUpdate"}, - {47, nullptr, "FindMaxRequiredApplicationVersionOfTask"}, - {48, nullptr, "CommitNetworkInstallTaskPartially"}, - {49, nullptr, "ListNetworkInstallTaskCommittedContentMeta"}, - {50, nullptr, "ListNetworkInstallTaskNotCommittedContentMeta"}, - {51, nullptr, "FindMaxRequiredSystemVersionOfTask"}, - {52, nullptr, "GetNetworkInstallTaskErrorContext"}, - {53, nullptr, "CreateLocalCommunicationReceiveApplicationTask"}, - {54, nullptr, "DestroyLocalCommunicationReceiveApplicationTask"}, - {55, nullptr, "ListLocalCommunicationReceiveApplicationTask"}, - {56, nullptr, "RequestLocalCommunicationReceiveApplicationTaskRun"}, - {57, nullptr, "GetLocalCommunicationReceiveApplicationTaskInfo"}, - {58, nullptr, "CommitLocalCommunicationReceiveApplicationTask"}, - {59, nullptr, "ListLocalCommunicationReceiveApplicationTaskContentMeta"}, - {60, nullptr, "CreateLocalCommunicationSendApplicationTask"}, - {61, nullptr, "RequestLocalCommunicationSendApplicationTaskRun"}, - {62, nullptr, "GetLocalCommunicationReceiveApplicationTaskErrorContext"}, - {63, nullptr, "GetLocalCommunicationSendApplicationTaskInfo"}, - {64, nullptr, "DestroyLocalCommunicationSendApplicationTask"}, - {65, nullptr, "GetLocalCommunicationSendApplicationTaskErrorContext"}, - {66, nullptr, "CalculateLocalCommunicationReceiveApplicationTaskRequiredSize"}, - {67, nullptr, "ListApplicationLocalCommunicationReceiveApplicationTask"}, - {68, nullptr, "ListApplicationLocalCommunicationSendApplicationTask"}, - {69, nullptr, "CreateLocalCommunicationReceiveSystemUpdateTask"}, - {70, nullptr, "DestroyLocalCommunicationReceiveSystemUpdateTask"}, - {71, nullptr, "ListLocalCommunicationReceiveSystemUpdateTask"}, - {72, nullptr, "RequestLocalCommunicationReceiveSystemUpdateTaskRun"}, - {73, nullptr, "GetLocalCommunicationReceiveSystemUpdateTaskInfo"}, - {74, nullptr, "CommitLocalCommunicationReceiveSystemUpdateTask"}, - {75, nullptr, "GetLocalCommunicationReceiveSystemUpdateTaskErrorContext"}, - {76, nullptr, "CreateLocalCommunicationSendSystemUpdateTask"}, - {77, nullptr, "RequestLocalCommunicationSendSystemUpdateTaskRun"}, - {78, nullptr, "GetLocalCommunicationSendSystemUpdateTaskInfo"}, - {79, nullptr, "DestroyLocalCommunicationSendSystemUpdateTask"}, - {80, nullptr, "GetLocalCommunicationSendSystemUpdateTaskErrorContext"}, - {81, nullptr, "ListLocalCommunicationSendSystemUpdateTask"}, - {82, nullptr, "GetReceivedSystemDataPath"}, - {83, nullptr, "CalculateApplyDeltaTaskOccupiedSize"}, - {84, nullptr, "ReloadErrorSimulation"}, - {85, nullptr, "ListNetworkInstallTaskContentMetaFromInstallMeta"}, - {86, nullptr, "ListNetworkInstallTaskOccupiedSize"}, - {87, nullptr, "RequestQueryAvailableELicenses"}, - {88, nullptr, "RequestAssignELicenses"}, - {89, nullptr, "RequestExtendELicenses"}, - {90, nullptr, "RequestSyncELicenses"}, - {91, nullptr, "Unknown91"}, //6.0.0-14.1.2 - {92, nullptr, "Unknown92"}, //21.0.0+ - {93, nullptr, "RequestReportActiveELicenses"}, - {94, nullptr, "RequestReportActiveELicensesPassively"}, - {95, nullptr, "RequestRegisterDynamicRightsNotificationToken"}, - {96, nullptr, "RequestAssignAllDeviceLinkedELicenses"}, - {97, nullptr, "RequestRevokeAllELicenses"}, - {98, nullptr, "RequestPrefetchForDynamicRights"}, - {99, nullptr, "CreateNetworkInstallTask"}, - {100, nullptr, "ListNetworkInstallTaskRightsIds"}, - {101, nullptr, "RequestDownloadETickets"}, - {102, nullptr, "RequestQueryDownloadableContents"}, - {103, nullptr, "DeleteNetworkInstallTaskContentMeta"}, - {104, nullptr, "RequestIssueEdgeTokenForDebug"}, - {105, nullptr, "RequestQueryAvailableELicenses2"}, - {106, nullptr, "RequestAssignELicenses2"}, - {107, nullptr, "GetNetworkInstallTaskStateCounter"}, - {108, nullptr, "InvalidateDynamicRightsNaIdTokenCacheForDebug"}, - {109, nullptr, "ListNetworkInstallTaskPartialInstallContentMeta"}, - {110, nullptr, "ListNetworkInstallTaskRightsIdsFromIndex"}, - {111, nullptr, "AddNetworkInstallTaskContentMetaForUser"}, - {112, nullptr, "RequestAssignELicensesAndDownloadETickets"}, - {113, nullptr, "RequestQueryAvailableCommonELicenses"}, - {114, nullptr, "SetNetworkInstallTaskExtendedAttribute"}, - {115, nullptr, "GetNetworkInstallTaskExtendedAttribute"}, - {116, nullptr, "GetAllocatorInfo"}, - {117, nullptr, "RequestQueryDownloadableContentsByApplicationId"}, - {118, nullptr, "MarkNoDownloadRightsErrorResolved"}, - {119, nullptr, "GetApplyDeltaTaskAllAppliedContentMeta"}, - {120, nullptr, "PrioritizeNetworkInstallTask"}, - {121, nullptr, "RequestQueryAvailableCommonELicenses2"}, - {122, nullptr, "RequestAssignCommonELicenses"}, - {123, nullptr, "RequestAssignCommonELicenses2"}, - {124, nullptr, "IsNetworkInstallTaskFrontOfQueue"}, - {125, nullptr, "PrioritizeApplyDeltaTask"}, - {126, nullptr, "RerouteDownloadingPatch"}, - {127, nullptr, "UnmarkNoDownloadRightsErrorResolved"}, - {128, nullptr, "RequestContentsSize"}, - {129, nullptr, "RequestContentsAuthorizationToken"}, - {130, nullptr, "RequestCdnVendorDiscovery"}, - {131, nullptr, "RefreshDebugAvailability"}, - {132, nullptr, "ClearResponseSimulationEntry"}, - {133, nullptr, "RegisterResponseSimulationEntry"}, - {134, nullptr, "GetProcessedCdnVendors"}, - {135, nullptr, "RefreshRuntimeBehaviorsForDebug"}, - {136, nullptr, "RequestOnlineSubscriptionFreeTrialAvailability"}, - {137, nullptr, "GetNetworkInstallTaskContentMetaCount"}, - {138, nullptr, "RequestRevokeELicenses"}, - {139, nullptr, "EnableNetworkConnectionToUseApplicationCore"}, - {140, nullptr, "DisableNetworkConnectionToUseApplicationCore"}, - {141, nullptr, "IsNetworkConnectionEnabledToUseApplicationCore"}, - {142, nullptr, "RequestCheckSafeSystemVersion"}, - {143, nullptr, "RequestApplicationIcon"}, - {144, nullptr, "RequestDownloadIdbeIconFile"}, - {147, nullptr, "Unknown147"}, //18.0.0+ - {148, nullptr, "Unknown148"}, //18.0.0+ - {150, nullptr, "Unknown150"}, //19.0.0+ - {151, nullptr, "Unknown151"}, //20.0.0+ - {152, nullptr, "Unknown152"}, //20.0.0+ - {153, nullptr, "Unknown153"}, //20.0.0+ - {154, nullptr, "Unknown154"}, //20.0.0+ - {155, nullptr, "Unknown155"}, //20.0.0+ - {156, nullptr, "Unknown156"}, //20.0.0+ - {157, nullptr, "Unknown157"}, //20.0.0+ - {158, nullptr, "Unknown158"}, //20.0.0+ - {159, nullptr, "Unknown159"}, //20.0.0+ - {160, nullptr, "Unknown160"}, //20.0.0+ - {161, nullptr, "Unknown161"}, //20.0.0+ - {162, nullptr, "Unknown162"}, //20.0.0+ - {163, nullptr, "Unknown163"}, //20.0.0+ - {164, nullptr, "Unknown164"}, //20.0.0+ - {165, nullptr, "Unknown165"}, //20.0.0+ - {166, nullptr, "Unknown166"}, //20.0.0+ - {167, nullptr, "Unknown167"}, //20.0.0+ - {168, nullptr, "Unknown168"}, //20.0.0+ - {169, nullptr, "Unknown169"}, //20.0.0+ - {170, nullptr, "Unknown170"}, //20.0.0+ - {171, nullptr, "Unknown171"}, //20.0.0+ - {172, nullptr, "Unknown172"}, //20.0.0+ - {173, nullptr, "Unknown173"}, //20.0.0+ - {174, nullptr, "Unknown174"}, //20.0.0+ - {175, nullptr, "Unknown175"}, //20.0.0+ - {176, nullptr, "Unknown176"}, //20.0.0+ - {177, nullptr, "Unknown177"}, //20.0.0+ - {2000, nullptr, "Unknown2000"}, //20.0.0+ - {2001, nullptr, "Unknown2001"}, //20.0.0+ - {2002, nullptr, "Unknown2002"}, //20.0.0+ - {2003, nullptr, "Unknown2003"}, //20.0.0+ - {2004, nullptr, "Unknown2004"}, //20.0.0+ - {2007, nullptr, "Unknown2007"}, //20.0.0+ - {2011, nullptr, "Unknown2011"}, //20.0.0+ - {2012, nullptr, "Unknown2012"}, //20.0.0+ - {2013, nullptr, "Unknown2013"}, //20.0.0+ - {2014, nullptr, "Unknown2014"}, //20.0.0+ - {2015, nullptr, "Unknown2015"}, //20.0.0+ - {2016, nullptr, "Unknown2016"}, //20.0.0+ - {2017, nullptr, "Unknown2017"}, //20.0.0+ - {2018, nullptr, "Unknown2018"}, //20.0.0+ - {2019, nullptr, "Unknown2019"}, //20.0.0+ - {2020, nullptr, "Unknown2020"}, //20.0.0+ - {2021, nullptr, "Unknown2021"}, //20.0.0+ - {2022, nullptr, "Unknown2022"}, //20.0.0+ - {2023, nullptr, "Unknown2023"}, //20.0.0+ - {2024, nullptr, "Unknown2024"}, //20.0.0+ - {2025, nullptr, "Unknown2025"}, //20.0.0+ - {2026, nullptr, "Unknown2026"}, //20.0.0+ - {2027, nullptr, "Unknown2027"}, //20.0.0+ - {2028, nullptr, "Unknown2028"}, //20.0.0+ - {2029, nullptr, "Unknown2029"}, //20.0.0+ - {2030, nullptr, "Unknown2030"}, //20.0.0+ - {2031, nullptr, "Unknown2031"}, //20.0.0+ - {2032, nullptr, "Unknown2032"}, //20.0.0+ - {2033, nullptr, "Unknown2033"}, //20.0.0+ - {2034, nullptr, "Unknown2034"}, //20.0.0+ - {2035, nullptr, "Unknown2035"}, //20.0.0+ - {2036, nullptr, "Unknown2036"}, //20.0.0+ - {2037, nullptr, "Unknown2037"}, //20.0.0+ - {2038, nullptr, "Unknown2038"}, //20.0.0+ - {2039, nullptr, "Unknown2039"}, //20.0.0+ - {2040, nullptr, "Unknown2040"}, //20.0.0+ - {2041, nullptr, "Unknown2041"}, //20.0.0+ - {2042, nullptr, "Unknown2042"}, //20.0.0+ - {2043, nullptr, "Unknown2043"}, //20.0.0+ - {2044, nullptr, "Unknown2044"}, //20.0.0+ - {2045, nullptr, "Unknown2045"}, //20.0.0+ - {2046, nullptr, "Unknown2046"}, //20.0.0+ - {2047, nullptr, "Unknown2047"}, //20.0.0+ - {2048, nullptr, "Unknown2048"}, //20.0.0+ - {2049, nullptr, "Unknown2049"}, //20.0.0+ - {2050, nullptr, "Unknown2050"}, //20.0.0+ - {2051, nullptr, "Unknown2051"}, //20.0.0+ - {3000, nullptr, "RequestLatestApplicationIcon"}, //17.0.0+ - {3001, nullptr, "RequestDownloadIdbeLatestIconFile"}, //17.0.0+ - }; - // clang-format on + explicit NIM(Core::System& system_) : ServiceFramework{system_, "nim"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateSystemUpdateTask"}, + FunctionInfo{1, nullptr, "DestroySystemUpdateTask"}, + FunctionInfo{2, nullptr, "ListSystemUpdateTask"}, + FunctionInfo{3, nullptr, "RequestSystemUpdateTaskRun"}, + FunctionInfo{4, nullptr, "GetSystemUpdateTaskInfo"}, + FunctionInfo{5, nullptr, "CommitSystemUpdateTask"}, + FunctionInfo{6, nullptr, "CreateNetworkInstallTask"}, + FunctionInfo{7, nullptr, "DestroyNetworkInstallTask"}, + FunctionInfo{8, nullptr, "ListNetworkInstallTask"}, + FunctionInfo{9, nullptr, "RequestNetworkInstallTaskRun"}, + FunctionInfo{10, nullptr, "GetNetworkInstallTaskInfo"}, + FunctionInfo{11, nullptr, "CommitNetworkInstallTask"}, + FunctionInfo{12, nullptr, "RequestLatestSystemUpdateMeta"}, + FunctionInfo{14, nullptr, "ListApplicationNetworkInstallTask"}, + FunctionInfo{15, nullptr, "ListNetworkInstallTaskContentMeta"}, + FunctionInfo{16, nullptr, "RequestLatestVersion"}, + FunctionInfo{17, nullptr, "SetNetworkInstallTaskAttribute"}, + FunctionInfo{18, nullptr, "AddNetworkInstallTaskContentMeta"}, + FunctionInfo{19, nullptr, "GetDownloadedSystemDataPath"}, + FunctionInfo{20, nullptr, "CalculateNetworkInstallTaskRequiredSize"}, + FunctionInfo{21, nullptr, "IsExFatDriverIncluded"}, + FunctionInfo{22, nullptr, "GetBackgroundDownloadStressTaskInfo"}, + FunctionInfo{23, nullptr, "RequestDeviceAuthenticationToken"}, + FunctionInfo{24, nullptr, "RequestGameCardRegistrationStatus"}, + FunctionInfo{25, nullptr, "RequestRegisterGameCard"}, + FunctionInfo{26, nullptr, "RequestRegisterNotificationToken"}, + FunctionInfo{27, nullptr, "RequestDownloadTaskList"}, + FunctionInfo{28, nullptr, "RequestApplicationControl"}, + FunctionInfo{29, nullptr, "RequestLatestApplicationControl"}, + FunctionInfo{30, nullptr, "RequestVersionList"}, + FunctionInfo{31, nullptr, "CreateApplyDeltaTask"}, + FunctionInfo{32, nullptr, "DestroyApplyDeltaTask"}, + FunctionInfo{33, nullptr, "ListApplicationApplyDeltaTask"}, + FunctionInfo{34, nullptr, "RequestApplyDeltaTaskRun"}, + FunctionInfo{35, nullptr, "GetApplyDeltaTaskInfo"}, + FunctionInfo{36, nullptr, "ListApplyDeltaTask"}, + FunctionInfo{37, nullptr, "CommitApplyDeltaTask"}, + FunctionInfo{38, nullptr, "CalculateApplyDeltaTaskRequiredSize"}, + FunctionInfo{39, nullptr, "PrepareShutdown"}, + FunctionInfo{40, nullptr, "ListApplyDeltaTask"}, + FunctionInfo{41, nullptr, "ClearNotEnoughSpaceStateOfApplyDeltaTask"}, + FunctionInfo{42, nullptr, "CreateApplyDeltaTaskFromDownloadTask"}, + FunctionInfo{43, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, + FunctionInfo{44, nullptr, "GetApplyDeltaTaskRequiredStorage"}, + FunctionInfo{45, nullptr, "CalculateNetworkInstallTaskContentsSize"}, + FunctionInfo{46, nullptr, "PrepareShutdownForSystemUpdate"}, + FunctionInfo{47, nullptr, "FindMaxRequiredApplicationVersionOfTask"}, + FunctionInfo{48, nullptr, "CommitNetworkInstallTaskPartially"}, + FunctionInfo{49, nullptr, "ListNetworkInstallTaskCommittedContentMeta"}, + FunctionInfo{50, nullptr, "ListNetworkInstallTaskNotCommittedContentMeta"}, + FunctionInfo{51, nullptr, "FindMaxRequiredSystemVersionOfTask"}, + FunctionInfo{52, nullptr, "GetNetworkInstallTaskErrorContext"}, + FunctionInfo{53, nullptr, "CreateLocalCommunicationReceiveApplicationTask"}, + FunctionInfo{54, nullptr, "DestroyLocalCommunicationReceiveApplicationTask"}, + FunctionInfo{55, nullptr, "ListLocalCommunicationReceiveApplicationTask"}, + FunctionInfo{56, nullptr, "RequestLocalCommunicationReceiveApplicationTaskRun"}, + FunctionInfo{57, nullptr, "GetLocalCommunicationReceiveApplicationTaskInfo"}, + FunctionInfo{58, nullptr, "CommitLocalCommunicationReceiveApplicationTask"}, + FunctionInfo{59, nullptr, "ListLocalCommunicationReceiveApplicationTaskContentMeta"}, + FunctionInfo{60, nullptr, "CreateLocalCommunicationSendApplicationTask"}, + FunctionInfo{61, nullptr, "RequestLocalCommunicationSendApplicationTaskRun"}, + FunctionInfo{62, nullptr, "GetLocalCommunicationReceiveApplicationTaskErrorContext"}, + FunctionInfo{63, nullptr, "GetLocalCommunicationSendApplicationTaskInfo"}, + FunctionInfo{64, nullptr, "DestroyLocalCommunicationSendApplicationTask"}, + FunctionInfo{65, nullptr, "GetLocalCommunicationSendApplicationTaskErrorContext"}, + FunctionInfo{66, nullptr, "CalculateLocalCommunicationReceiveApplicationTaskRequiredSize"}, + FunctionInfo{67, nullptr, "ListApplicationLocalCommunicationReceiveApplicationTask"}, + FunctionInfo{68, nullptr, "ListApplicationLocalCommunicationSendApplicationTask"}, + FunctionInfo{69, nullptr, "CreateLocalCommunicationReceiveSystemUpdateTask"}, + FunctionInfo{70, nullptr, "DestroyLocalCommunicationReceiveSystemUpdateTask"}, + FunctionInfo{71, nullptr, "ListLocalCommunicationReceiveSystemUpdateTask"}, + FunctionInfo{72, nullptr, "RequestLocalCommunicationReceiveSystemUpdateTaskRun"}, + FunctionInfo{73, nullptr, "GetLocalCommunicationReceiveSystemUpdateTaskInfo"}, + FunctionInfo{74, nullptr, "CommitLocalCommunicationReceiveSystemUpdateTask"}, + FunctionInfo{75, nullptr, "GetLocalCommunicationReceiveSystemUpdateTaskErrorContext"}, + FunctionInfo{76, nullptr, "CreateLocalCommunicationSendSystemUpdateTask"}, + FunctionInfo{77, nullptr, "RequestLocalCommunicationSendSystemUpdateTaskRun"}, + FunctionInfo{78, nullptr, "GetLocalCommunicationSendSystemUpdateTaskInfo"}, + FunctionInfo{79, nullptr, "DestroyLocalCommunicationSendSystemUpdateTask"}, + FunctionInfo{80, nullptr, "GetLocalCommunicationSendSystemUpdateTaskErrorContext"}, + FunctionInfo{81, nullptr, "ListLocalCommunicationSendSystemUpdateTask"}, + FunctionInfo{82, nullptr, "GetReceivedSystemDataPath"}, + FunctionInfo{83, nullptr, "CalculateApplyDeltaTaskOccupiedSize"}, + FunctionInfo{84, nullptr, "ReloadErrorSimulation"}, + FunctionInfo{85, nullptr, "ListNetworkInstallTaskContentMetaFromInstallMeta"}, + FunctionInfo{86, nullptr, "ListNetworkInstallTaskOccupiedSize"}, + FunctionInfo{87, nullptr, "RequestQueryAvailableELicenses"}, + FunctionInfo{88, nullptr, "RequestAssignELicenses"}, + FunctionInfo{89, nullptr, "RequestExtendELicenses"}, + FunctionInfo{90, nullptr, "RequestSyncELicenses"}, + FunctionInfo{91, nullptr, "Unknown91", MakeVersionGate({6,0,0}, {14,1,2})}, + FunctionInfo{92, nullptr, "Unknown92", MakeVersionGate({21,0,0})}, + FunctionInfo{93, nullptr, "RequestReportActiveELicenses"}, + FunctionInfo{94, nullptr, "RequestReportActiveELicensesPassively"}, + FunctionInfo{95, nullptr, "RequestRegisterDynamicRightsNotificationToken"}, + FunctionInfo{96, nullptr, "RequestAssignAllDeviceLinkedELicenses"}, + FunctionInfo{97, nullptr, "RequestRevokeAllELicenses"}, + FunctionInfo{98, nullptr, "RequestPrefetchForDynamicRights"}, + FunctionInfo{99, nullptr, "CreateNetworkInstallTask"}, + FunctionInfo{100, nullptr, "ListNetworkInstallTaskRightsIds"}, + FunctionInfo{101, nullptr, "RequestDownloadETickets"}, + FunctionInfo{102, nullptr, "RequestQueryDownloadableContents"}, + FunctionInfo{103, nullptr, "DeleteNetworkInstallTaskContentMeta"}, + FunctionInfo{104, nullptr, "RequestIssueEdgeTokenForDebug"}, + FunctionInfo{105, nullptr, "RequestQueryAvailableELicenses2"}, + FunctionInfo{106, nullptr, "RequestAssignELicenses2"}, + FunctionInfo{107, nullptr, "GetNetworkInstallTaskStateCounter"}, + FunctionInfo{108, nullptr, "InvalidateDynamicRightsNaIdTokenCacheForDebug"}, + FunctionInfo{109, nullptr, "ListNetworkInstallTaskPartialInstallContentMeta"}, + FunctionInfo{110, nullptr, "ListNetworkInstallTaskRightsIdsFromIndex"}, + FunctionInfo{111, nullptr, "AddNetworkInstallTaskContentMetaForUser"}, + FunctionInfo{112, nullptr, "RequestAssignELicensesAndDownloadETickets"}, + FunctionInfo{113, nullptr, "RequestQueryAvailableCommonELicenses"}, + FunctionInfo{114, nullptr, "SetNetworkInstallTaskExtendedAttribute"}, + FunctionInfo{115, nullptr, "GetNetworkInstallTaskExtendedAttribute"}, + FunctionInfo{116, nullptr, "GetAllocatorInfo"}, + FunctionInfo{117, nullptr, "RequestQueryDownloadableContentsByApplicationId"}, + FunctionInfo{118, nullptr, "MarkNoDownloadRightsErrorResolved"}, + FunctionInfo{119, nullptr, "GetApplyDeltaTaskAllAppliedContentMeta"}, + FunctionInfo{120, nullptr, "PrioritizeNetworkInstallTask"}, + FunctionInfo{121, nullptr, "RequestQueryAvailableCommonELicenses2"}, + FunctionInfo{122, nullptr, "RequestAssignCommonELicenses"}, + FunctionInfo{123, nullptr, "RequestAssignCommonELicenses2"}, + FunctionInfo{124, nullptr, "IsNetworkInstallTaskFrontOfQueue"}, + FunctionInfo{125, nullptr, "PrioritizeApplyDeltaTask"}, + FunctionInfo{126, nullptr, "RerouteDownloadingPatch"}, + FunctionInfo{127, nullptr, "UnmarkNoDownloadRightsErrorResolved"}, + FunctionInfo{128, nullptr, "RequestContentsSize"}, + FunctionInfo{129, nullptr, "RequestContentsAuthorizationToken"}, + FunctionInfo{130, nullptr, "RequestCdnVendorDiscovery"}, + FunctionInfo{131, nullptr, "RefreshDebugAvailability"}, + FunctionInfo{132, nullptr, "ClearResponseSimulationEntry"}, + FunctionInfo{133, nullptr, "RegisterResponseSimulationEntry"}, + FunctionInfo{134, nullptr, "GetProcessedCdnVendors"}, + FunctionInfo{135, nullptr, "RefreshRuntimeBehaviorsForDebug"}, + FunctionInfo{136, nullptr, "RequestOnlineSubscriptionFreeTrialAvailability"}, + FunctionInfo{137, nullptr, "GetNetworkInstallTaskContentMetaCount"}, + FunctionInfo{138, nullptr, "RequestRevokeELicenses"}, + FunctionInfo{139, nullptr, "EnableNetworkConnectionToUseApplicationCore"}, + FunctionInfo{140, nullptr, "DisableNetworkConnectionToUseApplicationCore"}, + FunctionInfo{141, nullptr, "IsNetworkConnectionEnabledToUseApplicationCore"}, + FunctionInfo{142, nullptr, "RequestCheckSafeSystemVersion"}, + FunctionInfo{143, nullptr, "RequestApplicationIcon"}, + FunctionInfo{144, nullptr, "RequestDownloadIdbeIconFile"}, + FunctionInfo{147, nullptr, "Unknown147", MakeVersionGate({18,0,0})}, + FunctionInfo{148, nullptr, "Unknown148", MakeVersionGate({18,0,0})}, + FunctionInfo{150, nullptr, "Unknown150", MakeVersionGate({19,0,0})}, + FunctionInfo{151, nullptr, "Unknown151", MakeVersionGate({20,0,0})}, + FunctionInfo{152, nullptr, "Unknown152", MakeVersionGate({20,0,0})}, + FunctionInfo{153, nullptr, "Unknown153", MakeVersionGate({20,0,0})}, + FunctionInfo{154, nullptr, "Unknown154", MakeVersionGate({20,0,0})}, + FunctionInfo{155, nullptr, "Unknown155", MakeVersionGate({20,0,0})}, + FunctionInfo{156, nullptr, "Unknown156", MakeVersionGate({20,0,0})}, + FunctionInfo{157, nullptr, "Unknown157", MakeVersionGate({20,0,0})}, + FunctionInfo{158, nullptr, "Unknown158", MakeVersionGate({20,0,0})}, + FunctionInfo{159, nullptr, "Unknown159", MakeVersionGate({20,0,0})}, + FunctionInfo{160, nullptr, "Unknown160", MakeVersionGate({20,0,0})}, + FunctionInfo{161, nullptr, "Unknown161", MakeVersionGate({20,0,0})}, + FunctionInfo{162, nullptr, "Unknown162", MakeVersionGate({20,0,0})}, + FunctionInfo{163, nullptr, "Unknown163", MakeVersionGate({20,0,0})}, + FunctionInfo{164, nullptr, "Unknown164", MakeVersionGate({20,0,0})}, + FunctionInfo{165, nullptr, "Unknown165", MakeVersionGate({20,0,0})}, + FunctionInfo{166, nullptr, "Unknown166", MakeVersionGate({20,0,0})}, + FunctionInfo{167, nullptr, "Unknown167", MakeVersionGate({20,0,0})}, + FunctionInfo{168, nullptr, "Unknown168", MakeVersionGate({20,0,0})}, + FunctionInfo{169, nullptr, "Unknown169", MakeVersionGate({20,0,0})}, + FunctionInfo{170, nullptr, "Unknown170", MakeVersionGate({20,0,0})}, + FunctionInfo{171, nullptr, "Unknown171", MakeVersionGate({20,0,0})}, + FunctionInfo{172, nullptr, "Unknown172", MakeVersionGate({20,0,0})}, + FunctionInfo{173, nullptr, "Unknown173", MakeVersionGate({20,0,0})}, + FunctionInfo{174, nullptr, "Unknown174", MakeVersionGate({20,0,0})}, + FunctionInfo{175, nullptr, "Unknown175", MakeVersionGate({20,0,0})}, + FunctionInfo{176, nullptr, "Unknown176", MakeVersionGate({20,0,0})}, + FunctionInfo{177, nullptr, "Unknown177", MakeVersionGate({20,0,0})}, + FunctionInfo{2000, nullptr, "Unknown2000", MakeVersionGate({20,0,0})}, + FunctionInfo{2001, nullptr, "Unknown2001", MakeVersionGate({20,0,0})}, + FunctionInfo{2002, nullptr, "Unknown2002", MakeVersionGate({20,0,0})}, + FunctionInfo{2003, nullptr, "Unknown2003", MakeVersionGate({20,0,0})}, + FunctionInfo{2004, nullptr, "Unknown2004", MakeVersionGate({20,0,0})}, + FunctionInfo{2007, nullptr, "Unknown2007", MakeVersionGate({20,0,0})}, + FunctionInfo{2011, nullptr, "Unknown2011", MakeVersionGate({20,0,0})}, + FunctionInfo{2012, nullptr, "Unknown2012", MakeVersionGate({20,0,0})}, + FunctionInfo{2013, nullptr, "Unknown2013", MakeVersionGate({20,0,0})}, + FunctionInfo{2014, nullptr, "Unknown2014", MakeVersionGate({20,0,0})}, + FunctionInfo{2015, nullptr, "Unknown2015", MakeVersionGate({20,0,0})}, + FunctionInfo{2016, nullptr, "Unknown2016", MakeVersionGate({20,0,0})}, + FunctionInfo{2017, nullptr, "Unknown2017", MakeVersionGate({20,0,0})}, + FunctionInfo{2018, nullptr, "Unknown2018", MakeVersionGate({20,0,0})}, + FunctionInfo{2019, nullptr, "Unknown2019", MakeVersionGate({20,0,0})}, + FunctionInfo{2020, nullptr, "Unknown2020", MakeVersionGate({20,0,0})}, + FunctionInfo{2021, nullptr, "Unknown2021", MakeVersionGate({20,0,0})}, + FunctionInfo{2022, nullptr, "Unknown2022", MakeVersionGate({20,0,0})}, + FunctionInfo{2023, nullptr, "Unknown2023", MakeVersionGate({20,0,0})}, + FunctionInfo{2024, nullptr, "Unknown2024", MakeVersionGate({20,0,0})}, + FunctionInfo{2025, nullptr, "Unknown2025", MakeVersionGate({20,0,0})}, + FunctionInfo{2026, nullptr, "Unknown2026", MakeVersionGate({20,0,0})}, + FunctionInfo{2027, nullptr, "Unknown2027", MakeVersionGate({20,0,0})}, + FunctionInfo{2028, nullptr, "Unknown2028", MakeVersionGate({20,0,0})}, + FunctionInfo{2029, nullptr, "Unknown2029", MakeVersionGate({20,0,0})}, + FunctionInfo{2030, nullptr, "Unknown2030", MakeVersionGate({20,0,0})}, + FunctionInfo{2031, nullptr, "Unknown2031", MakeVersionGate({20,0,0})}, + FunctionInfo{2032, nullptr, "Unknown2032", MakeVersionGate({20,0,0})}, + FunctionInfo{2033, nullptr, "Unknown2033", MakeVersionGate({20,0,0})}, + FunctionInfo{2034, nullptr, "Unknown2034", MakeVersionGate({20,0,0})}, + FunctionInfo{2035, nullptr, "Unknown2035", MakeVersionGate({20,0,0})}, + FunctionInfo{2036, nullptr, "Unknown2036", MakeVersionGate({20,0,0})}, + FunctionInfo{2037, nullptr, "Unknown2037", MakeVersionGate({20,0,0})}, + FunctionInfo{2038, nullptr, "Unknown2038", MakeVersionGate({20,0,0})}, + FunctionInfo{2039, nullptr, "Unknown2039", MakeVersionGate({20,0,0})}, + FunctionInfo{2040, nullptr, "Unknown2040", MakeVersionGate({20,0,0})}, + FunctionInfo{2041, nullptr, "Unknown2041", MakeVersionGate({20,0,0})}, + FunctionInfo{2042, nullptr, "Unknown2042", MakeVersionGate({20,0,0})}, + FunctionInfo{2043, nullptr, "Unknown2043", MakeVersionGate({20,0,0})}, + FunctionInfo{2044, nullptr, "Unknown2044", MakeVersionGate({20,0,0})}, + FunctionInfo{2045, nullptr, "Unknown2045", MakeVersionGate({20,0,0})}, + FunctionInfo{2046, nullptr, "Unknown2046", MakeVersionGate({20,0,0})}, + FunctionInfo{2047, nullptr, "Unknown2047", MakeVersionGate({20,0,0})}, + FunctionInfo{2048, nullptr, "Unknown2048", MakeVersionGate({20,0,0})}, + FunctionInfo{2049, nullptr, "Unknown2049", MakeVersionGate({20,0,0})}, + FunctionInfo{2050, nullptr, "Unknown2050", MakeVersionGate({20,0,0})}, + FunctionInfo{2051, nullptr, "Unknown2051", MakeVersionGate({20,0,0})}, + FunctionInfo{3000, nullptr, "RequestLatestApplicationIcon", MakeVersionGate({17,0,0})}, + FunctionInfo{3001, nullptr, "RequestDownloadIdbeLatestIconFile", MakeVersionGate({17,0,0})} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class NIM_ECA final : public ServiceFramework { public: - explicit NIM_ECA(Core::System& system_) : ServiceFramework{system_, "nim:eca"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &NIM_ECA::CreateServerInterface, "CreateServerInterface"}, - {1, nullptr, "RefreshDebugAvailability"}, - {2, nullptr, "ClearDebugResponse"}, - {3, nullptr, "RegisterDebugResponse"}, - {4, &NIM_ECA::IsLargeResourceAvailable, "IsLargeResourceAvailable"}, - {5, &NIM_ECA::CreateServerInterface2, "CreateServerInterface2"} // 17.0.0+ - }; - // clang-format on + explicit NIM_ECA(Core::System& system_) : ServiceFramework{system_, "nim:eca"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -463,45 +450,53 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &NIM_ECA::CreateServerInterface, "CreateServerInterface"}, + FunctionInfo{1, nullptr, "RefreshDebugAvailability"}, + FunctionInfo{2, nullptr, "ClearDebugResponse"}, + FunctionInfo{3, nullptr, "RegisterDebugResponse"}, + FunctionInfo{4, &NIM_ECA::IsLargeResourceAvailable, "IsLargeResourceAvailable"}, + FunctionInfo{5, &NIM_ECA::CreateServerInterface2, "CreateServerInterface2", MakeVersionGate({17,0,0})} + ); }; class NIM_SHP final : public ServiceFramework { public: - explicit NIM_SHP(Core::System& system_) : ServiceFramework{system_, "nim:shp"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestDeviceAuthenticationToken"}, - {1, nullptr, "RequestCachedDeviceAuthenticationToken"}, - {2, nullptr, "RequestEdgeToken"}, - {3, nullptr, "RequestCachedEdgeToken"}, - {100, nullptr, "RequestRegisterDeviceAccount"}, - {101, nullptr, "RequestUnregisterDeviceAccount"}, - {102, nullptr, "RequestDeviceAccountStatus"}, - {103, nullptr, "GetDeviceAccountInfo"}, - {104, nullptr, "RequestDeviceRegistrationInfo"}, - {105, nullptr, "RequestTransferDeviceAccount"}, - {106, nullptr, "RequestSyncRegistration"}, - {107, nullptr, "IsOwnDeviceId"}, - {200, nullptr, "RequestRegisterNotificationToken"}, - {300, nullptr, "RequestUnlinkDevice"}, - {301, nullptr, "RequestUnlinkDeviceIntegrated"}, - {302, nullptr, "RequestLinkDevice"}, - {303, nullptr, "HasDeviceLink"}, - {304, nullptr, "RequestUnlinkDeviceAll"}, - {305, nullptr, "RequestCreateVirtualAccount"}, - {306, nullptr, "RequestDeviceLinkStatus"}, - {400, nullptr, "GetAccountByVirtualAccount"}, - {401, nullptr, "GetVirtualAccount"}, - {500, nullptr, "RequestSyncTicketLegacy"}, - {501, nullptr, "RequestDownloadTicket"}, - {502, nullptr, "RequestDownloadTicketForPrepurchasedContents"}, - {503, nullptr, "RequestSyncTicket"}, - {504, nullptr, "RequestDownloadTicketForPrepurchasedContents2"}, - {505, nullptr, "RequestDownloadTicketForPrepurchasedContentsForAccount"}, - }; - // clang-format on + explicit NIM_SHP(Core::System& system_) : ServiceFramework{system_, "nim:shp"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestDeviceAuthenticationToken"}, + FunctionInfo{1, nullptr, "RequestCachedDeviceAuthenticationToken"}, + FunctionInfo{2, nullptr, "RequestEdgeToken"}, + FunctionInfo{3, nullptr, "RequestCachedEdgeToken"}, + FunctionInfo{100, nullptr, "RequestRegisterDeviceAccount"}, + FunctionInfo{101, nullptr, "RequestUnregisterDeviceAccount"}, + FunctionInfo{102, nullptr, "RequestDeviceAccountStatus"}, + FunctionInfo{103, nullptr, "GetDeviceAccountInfo"}, + FunctionInfo{104, nullptr, "RequestDeviceRegistrationInfo"}, + FunctionInfo{105, nullptr, "RequestTransferDeviceAccount"}, + FunctionInfo{106, nullptr, "RequestSyncRegistration"}, + FunctionInfo{107, nullptr, "IsOwnDeviceId"}, + FunctionInfo{200, nullptr, "RequestRegisterNotificationToken"}, + FunctionInfo{300, nullptr, "RequestUnlinkDevice"}, + FunctionInfo{301, nullptr, "RequestUnlinkDeviceIntegrated"}, + FunctionInfo{302, nullptr, "RequestLinkDevice"}, + FunctionInfo{303, nullptr, "HasDeviceLink"}, + FunctionInfo{304, nullptr, "RequestUnlinkDeviceAll"}, + FunctionInfo{305, nullptr, "RequestCreateVirtualAccount"}, + FunctionInfo{306, nullptr, "RequestDeviceLinkStatus"}, + FunctionInfo{400, nullptr, "GetAccountByVirtualAccount"}, + FunctionInfo{401, nullptr, "GetVirtualAccount"}, + FunctionInfo{500, nullptr, "RequestSyncTicketLegacy"}, + FunctionInfo{501, nullptr, "RequestDownloadTicket"}, + FunctionInfo{502, nullptr, "RequestDownloadTicketForPrepurchasedContents"}, + FunctionInfo{503, nullptr, "RequestSyncTicket"}, + FunctionInfo{504, nullptr, "RequestDownloadTicketForPrepurchasedContents2"}, + FunctionInfo{505, nullptr, "RequestDownloadTicketForPrepurchasedContentsForAccount"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; @@ -511,19 +506,7 @@ public: explicit IEnsureNetworkClockAvailabilityService(Core::System& system_) : ServiceFramework{system_, "IEnsureNetworkClockAvailabilityService"}, service_context{system_, "IEnsureNetworkClockAvailabilityService"} { - static const FunctionInfo functions[] = { - {0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"}, - {1, &IEnsureNetworkClockAvailabilityService::GetFinishNotificationEvent, - "GetFinishNotificationEvent"}, - {2, &IEnsureNetworkClockAvailabilityService::GetResult, "GetResult"}, - {3, &IEnsureNetworkClockAvailabilityService::Cancel, "Cancel"}, - {4, &IEnsureNetworkClockAvailabilityService::IsProcessing, "IsProcessing"}, - {5, &IEnsureNetworkClockAvailabilityService::GetServerTime, "GetServerTime"}, - }; - RegisterHandlers(functions); - - finished_event = - service_context.CreateEvent("IEnsureNetworkClockAvailabilityService:FinishEvent"); + finished_event = service_context.CreateEvent("IEnsureNetworkClockAvailabilityService:FinishEvent"); } ~IEnsureNetworkClockAvailabilityService() override { @@ -580,23 +563,27 @@ private: rb.PushRaw(server_time); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"}, + FunctionInfo{1, &IEnsureNetworkClockAvailabilityService::GetFinishNotificationEvent, "GetFinishNotificationEvent"}, + FunctionInfo{2, &IEnsureNetworkClockAvailabilityService::GetResult, "GetResult"}, + FunctionInfo{3, &IEnsureNetworkClockAvailabilityService::Cancel, "Cancel"}, + FunctionInfo{4, &IEnsureNetworkClockAvailabilityService::IsProcessing, "IsProcessing"}, + FunctionInfo{5, &IEnsureNetworkClockAvailabilityService::GetServerTime, "GetServerTime"} + ); KernelHelpers::ServiceContext service_context; - Kernel::KEvent* finished_event; }; class NTC final : public ServiceFramework { public: - explicit NTC(Core::System& system_) : ServiceFramework{system_, "ntc"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &NTC::OpenEnsureNetworkClockAvailabilityService, "OpenEnsureNetworkClockAvailabilityService"}, - {100, &NTC::SuspendAutonomicTimeCorrection, "SuspendAutonomicTimeCorrection"}, - {101, &NTC::ResumeAutonomicTimeCorrection, "ResumeAutonomicTimeCorrection"}, - }; - // clang-format on + explicit NTC(Core::System& system_) : ServiceFramework{system_, "ntc"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -622,18 +609,24 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &NTC::OpenEnsureNetworkClockAvailabilityService, "OpenEnsureNetworkClockAvailabilityService"}, + FunctionInfo{100, &NTC::SuspendAutonomicTimeCorrection, "SuspendAutonomicTimeCorrection"}, + FunctionInfo{101, &NTC::ResumeAutonomicTimeCorrection, "ResumeAutonomicTimeCorrection"} + ); }; class NIM_ECAS final : public ServiceFramework { public: - explicit NIM_ECAS(Core::System& system_) : ServiceFramework{system_, "nim:ecas"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RegisterSpecialClient"}, - {1, nullptr, "UnregisterSpecialClient"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit NIM_ECAS(Core::System& system_) : ServiceFramework{system_, "nim:ecas"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RegisterSpecialClient"}, + FunctionInfo{1, nullptr, "UnregisterSpecialClient"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/npns/npns.cpp b/src/core/hle/service/npns/npns.cpp index b0f74bef06..90bf633e8b 100644 --- a/src/core/hle/service/npns/npns.cpp +++ b/src/core/hle/service/npns/npns.cpp @@ -19,79 +19,10 @@ class INpnsSystem final : public ServiceFramework { public: explicit INpnsSystem(Core::System& system_) : ServiceFramework{system_, "npns:s"}, service_context{system, "npns:s"}, - get_receive_event{service_context}, get_request_change_state_cancel_event{service_context} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "ListenAll"}, - {2, C<&INpnsSystem::ListenTo>, "ListenTo"}, - {3, nullptr, "Receive"}, - {4, nullptr, "ReceiveRaw"}, - {5, C<&INpnsSystem::GetReceiveEvent>, "GetReceiveEvent"}, - {6, nullptr, "ListenUndelivered"}, - {7, nullptr, "GetStateChangeEvent"}, - {8, C<&INpnsSystem::ListenToByName>, "ListenToByName"}, - {11, nullptr, "SubscribeTopic"}, - {12, nullptr, "UnsubscribeTopic"}, - {13, nullptr, "QueryIsTopicExist"}, - {14, nullptr, "SubscribeTopicByAccount"}, // 18.0.0+ - {15, nullptr, "UnsubscribeTopicByAccount"}, // 18.0.0+ - {16, nullptr, "DownloadSubscriptionList"}, // 18.0.0+ - {21, nullptr, "CreateToken"}, - {22, nullptr, "CreateTokenWithApplicationId"}, - {23, nullptr, "DestroyToken"}, - {24, nullptr, "DestroyTokenWithApplicationId"}, - {25, nullptr, "QueryIsTokenValid"}, - {26, nullptr, "ListenToMyApplicationId"}, - {27, nullptr, "DestroyTokenAll"}, - {28, nullptr, "CreateTokenWithName"}, // 18.0.0+ - {29, nullptr, "DestroyTokenWithName"}, // 18.0.0+ - {31, nullptr, "UploadTokenToBaaS"}, - {32, nullptr, "DestroyTokenForBaaS"}, - {33, nullptr, "CreateTokenForBaaS"}, - {34, nullptr, "SetBaaSDeviceAccountIdList"}, - {35, nullptr, "LinkNsaId"}, // 17.0.0+ - {36, nullptr, "UnlinkNsaId"}, // 17.0.0+ - {37, nullptr, "RelinkNsaId"}, // 18.0.0+ - {40, nullptr, "GetNetworkServiceAccountIdTokenRequestEvent"}, // 17.0.0+ - {41, nullptr, "TryPopNetworkServiceAccountIdTokenRequestUid"}, // 17.0.0+ - {42, nullptr, "SetNetworkServiceAccountIdTokenSuccess"}, // 17.0.0+ - {43, nullptr, "SetNetworkServiceAccountIdTokenFailure"}, // 17.0.0+ - {44, nullptr, "SetUidList"}, // 17.0.0+ - {45, nullptr, "PutDigitalTwinKeyValue"}, // 17.0.0+ - {51, nullptr, "DeleteDigitalTwinKeyValue"}, // 18.0.0+ - {101, nullptr, "Suspend"}, - {102, nullptr, "Resume"}, - {103, C<&INpnsSystem::GetState>, "GetState"}, - {104, nullptr, "GetStatistics"}, - {105, nullptr, "GetPlayReportRequestEvent"}, - {106, C<&INpnsSystem::GetLastNotifiedTime>, "GetLastNotifiedTime"}, // 18.0.0+ - {107, nullptr, "SetLastNotifiedTime"}, // 18.0.0+ - {111, nullptr, "GetJid"}, - {112, nullptr, "CreateJid"}, - {113, nullptr, "DestroyJid"}, - {114, nullptr, "AttachJid"}, - {115, nullptr, "DetachJid"}, - {120, nullptr, "CreateNotificationReceiver"}, - {151, nullptr, "GetStateWithHandover"}, - {152, nullptr, "GetStateChangeEventWithHandover"}, - {153, nullptr, "GetDropEventWithHandover"}, - {154, nullptr, "CreateTokenAsync"}, - {155, nullptr, "CreateTokenAsyncWithApplicationId"}, - {156, nullptr, "CreateTokenWithNameAsync"}, // 18.0.0+ - {161, C<&INpnsSystem::GetRequestChangeStateCancelEvent>, "GetRequestChangeStateCancelEvent"}, // 10.0.0+ - {162, nullptr, "RequestChangeStateForceTimedWithCancelEvent"}, - {201, nullptr, "RequestChangeStateForceTimed"}, - {202, nullptr, "RequestChangeStateForceAsync"}, - {301, nullptr, "GetPassword"}, // 18.0.0+ - {302, nullptr, "GetAllImmigration"}, // 18.0.0+ - {303, nullptr, "GetNotificationHistories"}, // 18.0.0+ - {304, nullptr, "GetPersistentConnectionSummary"}, // 18.0.0+ - {305, nullptr, "GetDigitalTwinSummary"}, // 18.0.0+ - {306, nullptr, "GetDigitalTwinValue"}, // 18.0.0+ - }; - // clang-format on + get_receive_event{service_context}, get_request_change_state_cancel_event{service_context} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~INpnsSystem() override = default; @@ -140,6 +71,74 @@ private: R_SUCCEED(); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "ListenAll"}, + FunctionInfo{2, C<&INpnsSystem::ListenTo>, "ListenTo"}, + FunctionInfo{3, nullptr, "Receive"}, + FunctionInfo{4, nullptr, "ReceiveRaw"}, + FunctionInfo{5, C<&INpnsSystem::GetReceiveEvent>, "GetReceiveEvent"}, + FunctionInfo{6, nullptr, "ListenUndelivered"}, + FunctionInfo{7, nullptr, "GetStateChangeEvent"}, + FunctionInfo{8, C<&INpnsSystem::ListenToByName>, "ListenToByName"}, + FunctionInfo{11, nullptr, "SubscribeTopic"}, + FunctionInfo{12, nullptr, "UnsubscribeTopic"}, + FunctionInfo{13, nullptr, "QueryIsTopicExist"}, + FunctionInfo{14, nullptr, "SubscribeTopicByAccount", MakeVersionGate({18,0,0})}, + FunctionInfo{15, nullptr, "UnsubscribeTopicByAccount", MakeVersionGate({18,0,0})}, + FunctionInfo{16, nullptr, "DownloadSubscriptionList", MakeVersionGate({18,0,0})}, + FunctionInfo{21, nullptr, "CreateToken"}, + FunctionInfo{22, nullptr, "CreateTokenWithApplicationId"}, + FunctionInfo{23, nullptr, "DestroyToken"}, + FunctionInfo{24, nullptr, "DestroyTokenWithApplicationId"}, + FunctionInfo{25, nullptr, "QueryIsTokenValid"}, + FunctionInfo{26, nullptr, "ListenToMyApplicationId"}, + FunctionInfo{27, nullptr, "DestroyTokenAll"}, + FunctionInfo{28, nullptr, "CreateTokenWithName", MakeVersionGate({18,0,0})}, + FunctionInfo{29, nullptr, "DestroyTokenWithName", MakeVersionGate({18,0,0})}, + FunctionInfo{31, nullptr, "UploadTokenToBaaS"}, + FunctionInfo{32, nullptr, "DestroyTokenForBaaS"}, + FunctionInfo{33, nullptr, "CreateTokenForBaaS"}, + FunctionInfo{34, nullptr, "SetBaaSDeviceAccountIdList"}, + FunctionInfo{35, nullptr, "LinkNsaId", MakeVersionGate({17,0,0})}, + FunctionInfo{36, nullptr, "UnlinkNsaId", MakeVersionGate({17,0,0})}, + FunctionInfo{37, nullptr, "RelinkNsaId", MakeVersionGate({18,0,0})}, + FunctionInfo{40, nullptr, "GetNetworkServiceAccountIdTokenRequestEvent", MakeVersionGate({17,0,0})}, + FunctionInfo{41, nullptr, "TryPopNetworkServiceAccountIdTokenRequestUid", MakeVersionGate({17,0,0})}, + FunctionInfo{42, nullptr, "SetNetworkServiceAccountIdTokenSuccess", MakeVersionGate({17,0,0})}, + FunctionInfo{43, nullptr, "SetNetworkServiceAccountIdTokenFailure", MakeVersionGate({17,0,0})}, + FunctionInfo{44, nullptr, "SetUidList", MakeVersionGate({17,0,0})}, + FunctionInfo{45, nullptr, "PutDigitalTwinKeyValue", MakeVersionGate({17,0,0})}, + FunctionInfo{51, nullptr, "DeleteDigitalTwinKeyValue", MakeVersionGate({18,0,0})}, + FunctionInfo{101, nullptr, "Suspend"}, + FunctionInfo{102, nullptr, "Resume"}, + FunctionInfo{103, C<&INpnsSystem::GetState>, "GetState"}, + FunctionInfo{104, nullptr, "GetStatistics"}, + FunctionInfo{105, nullptr, "GetPlayReportRequestEvent"}, + FunctionInfo{106, C<&INpnsSystem::GetLastNotifiedTime>, "GetLastNotifiedTime", MakeVersionGate({18,0,0})}, + FunctionInfo{107, nullptr, "SetLastNotifiedTime", MakeVersionGate({18,0,0})}, + FunctionInfo{111, nullptr, "GetJid"}, + FunctionInfo{112, nullptr, "CreateJid"}, + FunctionInfo{113, nullptr, "DestroyJid"}, + FunctionInfo{114, nullptr, "AttachJid"}, + FunctionInfo{115, nullptr, "DetachJid"}, + FunctionInfo{120, nullptr, "CreateNotificationReceiver"}, + FunctionInfo{151, nullptr, "GetStateWithHandover"}, + FunctionInfo{152, nullptr, "GetStateChangeEventWithHandover"}, + FunctionInfo{153, nullptr, "GetDropEventWithHandover"}, + FunctionInfo{154, nullptr, "CreateTokenAsync"}, + FunctionInfo{155, nullptr, "CreateTokenAsyncWithApplicationId"}, + FunctionInfo{156, nullptr, "CreateTokenWithNameAsync", MakeVersionGate({18,0,0})}, + FunctionInfo{161, C<&INpnsSystem::GetRequestChangeStateCancelEvent>, "GetRequestChangeStateCancelEvent", MakeVersionGate({10,0,0})}, + FunctionInfo{162, nullptr, "RequestChangeStateForceTimedWithCancelEvent"}, + FunctionInfo{201, nullptr, "RequestChangeStateForceTimed"}, + FunctionInfo{202, nullptr, "RequestChangeStateForceAsync"}, + FunctionInfo{301, nullptr, "GetPassword", MakeVersionGate({18,0,0})}, + FunctionInfo{302, nullptr, "GetAllImmigration", MakeVersionGate({18,0,0})}, + FunctionInfo{303, nullptr, "GetNotificationHistories", MakeVersionGate({18,0,0})}, + FunctionInfo{304, nullptr, "GetPersistentConnectionSummary", MakeVersionGate({18,0,0})}, + FunctionInfo{305, nullptr, "GetDigitalTwinSummary", MakeVersionGate({18,0,0})}, + FunctionInfo{306, nullptr, "GetDigitalTwinValue", MakeVersionGate({18,0,0})} + ); KernelHelpers::ServiceContext service_context; Event get_receive_event; Event get_request_change_state_cancel_event; @@ -148,34 +147,10 @@ private: class INpnsUser final : public ServiceFramework { public: explicit INpnsUser(Core::System& system_) - : ServiceFramework{system_, "npns:u"}, service_context{system, "npns:u"}, get_receive_event{service_context} { - // clang-format off - static const FunctionInfo functions[] = { - {1, nullptr, "ListenAll"}, - {2, nullptr, "ListenTo"}, - {3, nullptr, "Receive"}, - {4, nullptr, "ReceiveRaw"}, - {5, C<&INpnsUser::GetReceiveEvent>, "GetReceiveEvent"}, - {7, nullptr, "GetStateChangeEvent"}, - {8, C<&INpnsUser::ListenToByName>, "ListenToByName"}, // 18.0.0+ - {21, nullptr, "CreateToken"}, - {23, nullptr, "DestroyToken"}, - {25, nullptr, "QueryIsTokenValid"}, - {26, nullptr, "ListenToMyApplicationId"}, - {101, nullptr, "Suspend"}, - {102, nullptr, "Resume"}, - {103, nullptr, "GetState"}, - {104, nullptr, "GetStatistics"}, - {111, nullptr, "GetJid"}, - {120, nullptr, "CreateNotificationReceiver"}, - {151, nullptr, "GetStateWithHandover"}, - {152, nullptr, "GetStateChangeEventWithHandover"}, - {153, nullptr, "GetDropEventWithHandover"}, - {154, nullptr, "CreateTokenAsync"}, - }; - // clang-format on + : ServiceFramework{system_, "npns:u"}, service_context{system, "npns:u"}, get_receive_event{service_context} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -195,6 +170,29 @@ private: R_SUCCEED(); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, nullptr, "ListenAll"}, + FunctionInfo{2, nullptr, "ListenTo"}, + FunctionInfo{3, nullptr, "Receive"}, + FunctionInfo{4, nullptr, "ReceiveRaw"}, + FunctionInfo{5, C<&INpnsUser::GetReceiveEvent>, "GetReceiveEvent"}, + FunctionInfo{7, nullptr, "GetStateChangeEvent"}, + FunctionInfo{8, C<&INpnsUser::ListenToByName>, "ListenToByName", MakeVersionGate({18,0,0})}, + FunctionInfo{21, nullptr, "CreateToken"}, + FunctionInfo{23, nullptr, "DestroyToken"}, + FunctionInfo{25, nullptr, "QueryIsTokenValid"}, + FunctionInfo{26, nullptr, "ListenToMyApplicationId"}, + FunctionInfo{101, nullptr, "Suspend"}, + FunctionInfo{102, nullptr, "Resume"}, + FunctionInfo{103, nullptr, "GetState"}, + FunctionInfo{104, nullptr, "GetStatistics"}, + FunctionInfo{111, nullptr, "GetJid"}, + FunctionInfo{120, nullptr, "CreateNotificationReceiver"}, + FunctionInfo{151, nullptr, "GetStateWithHandover"}, + FunctionInfo{152, nullptr, "GetStateChangeEventWithHandover"}, + FunctionInfo{153, nullptr, "GetDropEventWithHandover"}, + FunctionInfo{154, nullptr, "CreateTokenAsync"} + ); KernelHelpers::ServiceContext service_context; Event get_receive_event; }; diff --git a/src/core/hle/service/ns/account_proxy_interface.cpp b/src/core/hle/service/ns/account_proxy_interface.cpp index e5041af66b..0107e16b72 100644 --- a/src/core/hle/service/ns/account_proxy_interface.cpp +++ b/src/core/hle/service/ns/account_proxy_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,13 +10,6 @@ namespace Service::NS { IAccountProxyInterface::IAccountProxyInterface(Core::System& system_) : ServiceFramework{system_, "IAccountProxyInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateUserAccount"}, - }; - // clang-format on - - RegisterHandlers(functions); } IAccountProxyInterface::~IAccountProxyInterface() = default; diff --git a/src/core/hle/service/ns/account_proxy_interface.h b/src/core/hle/service/ns/account_proxy_interface.h index e944d2a75f..37248726a9 100644 --- a/src/core/hle/service/ns/account_proxy_interface.h +++ b/src/core/hle/service/ns/account_proxy_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,6 +14,13 @@ class IAccountProxyInterface final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateUserAccount"} + ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/application_manager_interface.cpp b/src/core/hle/service/ns/application_manager_interface.cpp index 348649917e..7220c52dcb 100644 --- a/src/core/hle/service/ns/application_manager_interface.cpp +++ b/src/core/hle/service/ns/application_manager_interface.cpp @@ -25,6 +25,458 @@ namespace Service::NS { +std::optional IApplicationManagerInterface::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IApplicationManagerInterface::ListApplicationRecord>, "ListApplicationRecord"}, + FunctionInfo{1, nullptr, "GenerateApplicationRecordCount"}, + FunctionInfo{2, D<&IApplicationManagerInterface::GetApplicationRecordUpdateSystemEvent>, "GetApplicationRecordUpdateSystemEvent"}, + FunctionInfo{3, nullptr, "GetApplicationViewDeprecated"}, + FunctionInfo{4, D<&IApplicationManagerInterface::DeleteApplicationEntity>, "DeleteApplicationEntity"}, + FunctionInfo{5, D<&IApplicationManagerInterface::DeleteApplicationCompletely>, "DeleteApplicationCompletely"}, + FunctionInfo{6, nullptr, "IsAnyApplicationEntityRedundant"}, + FunctionInfo{7, nullptr, "DeleteRedundantApplicationEntity"}, + FunctionInfo{8, nullptr, "IsApplicationEntityMovable"}, + FunctionInfo{9, nullptr, "MoveApplicationEntity"}, + FunctionInfo{11, nullptr, "CalculateApplicationOccupiedSize"}, + FunctionInfo{16, &IApplicationManagerInterface::PushApplicationRecord, "PushApplicationRecord"}, + FunctionInfo{17, nullptr, "ListApplicationRecordContentMeta"}, + FunctionInfo{19, nullptr, "LaunchApplicationOld"}, + FunctionInfo{21, nullptr, "GetApplicationContentPath"}, + FunctionInfo{22, nullptr, "TerminateApplication"}, + FunctionInfo{23, nullptr, "ResolveApplicationContentPath"}, + FunctionInfo{26, nullptr, "BeginInstallApplication"}, + FunctionInfo{27, nullptr, "DeleteApplicationRecord"}, + FunctionInfo{30, nullptr, "RequestApplicationUpdateInfo"}, + FunctionInfo{31, nullptr, "RequestUpdateApplication"}, + FunctionInfo{32, nullptr, "CancelApplicationDownload"}, + FunctionInfo{33, nullptr, "ResumeApplicationDownload"}, + FunctionInfo{35, nullptr, "UpdateVersionList"}, + FunctionInfo{36, nullptr, "PushLaunchVersion"}, + FunctionInfo{37, nullptr, "ListRequiredVersion"}, + FunctionInfo{38, D<&IApplicationManagerInterface::CheckApplicationLaunchVersion>, "CheckApplicationLaunchVersion"}, + FunctionInfo{39, nullptr, "CheckApplicationLaunchRights"}, + FunctionInfo{40, D<&IApplicationManagerInterface::GetApplicationLogoData>, "GetApplicationLogoData"}, + FunctionInfo{41, nullptr, "CalculateApplicationDownloadRequiredSize"}, + FunctionInfo{42, nullptr, "CleanupSdCard"}, + FunctionInfo{43, D<&IApplicationManagerInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, + FunctionInfo{44, D<&IApplicationManagerInterface::GetSdCardMountStatusChangedEvent>, "GetSdCardMountStatusChangedEvent"}, + FunctionInfo{45, nullptr, "GetGameCardAttachmentEvent"}, + FunctionInfo{46, nullptr, "GetGameCardAttachmentInfo"}, + FunctionInfo{47, D<&IApplicationManagerInterface::GetTotalSpaceSize>, "GetTotalSpaceSize"}, + FunctionInfo{48, D<&IApplicationManagerInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, + FunctionInfo{49, nullptr, "GetSdCardRemovedEvent"}, + FunctionInfo{52, D<&IApplicationManagerInterface::GetGameCardUpdateDetectionEvent>, "GetGameCardUpdateDetectionEvent"}, + FunctionInfo{53, nullptr, "DisableApplicationAutoDelete"}, + FunctionInfo{54, nullptr, "EnableApplicationAutoDelete"}, + FunctionInfo{55, D<&IApplicationManagerInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, + FunctionInfo{56, nullptr, "SetApplicationTerminateResult"}, + FunctionInfo{57, nullptr, "ClearApplicationTerminateResult"}, + FunctionInfo{58, nullptr, "GetLastSdCardMountUnexpectedResult"}, + FunctionInfo{59, D<&IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, + FunctionInfo{60, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, + FunctionInfo{61, nullptr, "GetBackgroundDownloadStressTaskInfo"}, + FunctionInfo{62, nullptr, "GetGameCardStopper"}, + FunctionInfo{63, nullptr, "IsSystemProgramInstalled"}, + FunctionInfo{64, nullptr, "StartApplyDeltaTask"}, + FunctionInfo{65, nullptr, "GetRequestServerStopper"}, + FunctionInfo{66, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, + FunctionInfo{67, nullptr, "CancelApplicationApplyDelta"}, + FunctionInfo{68, nullptr, "ResumeApplicationApplyDelta"}, + FunctionInfo{69, nullptr, "CalculateApplicationApplyDeltaRequiredSize"}, + FunctionInfo{70, D<&IApplicationManagerInterface::ResumeAll>, "ResumeAll"}, + FunctionInfo{71, D<&IApplicationManagerInterface::GetStorageSize>, "GetStorageSize"}, + FunctionInfo{80, nullptr, "RequestDownloadApplication"}, + FunctionInfo{81, nullptr, "RequestDownloadAddOnContent"}, + FunctionInfo{82, nullptr, "DownloadApplication"}, + FunctionInfo{83, nullptr, "CheckApplicationResumeRights"}, + FunctionInfo{84, nullptr, "GetDynamicCommitEvent"}, + FunctionInfo{85, nullptr, "RequestUpdateApplication2"}, + FunctionInfo{86, nullptr, "EnableApplicationCrashReport"}, + FunctionInfo{87, nullptr, "IsApplicationCrashReportEnabled"}, + FunctionInfo{90, nullptr, "BoostSystemMemoryResourceLimit"}, + FunctionInfo{91, nullptr, "DeprecatedLaunchApplication"}, + FunctionInfo{92, nullptr, "GetRunningApplicationProgramId"}, + FunctionInfo{93, nullptr, "GetMainApplicationProgramIndex"}, + FunctionInfo{94, nullptr, "LaunchApplication"}, + FunctionInfo{95, nullptr, "GetApplicationLaunchInfo"}, + FunctionInfo{96, nullptr, "AcquireApplicationLaunchInfo"}, + FunctionInfo{97, nullptr, "GetMainApplicationProgramIndexByApplicationLaunchInfo"}, + FunctionInfo{98, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, + FunctionInfo{99, nullptr, "LaunchDevMenu"}, + FunctionInfo{100, nullptr, "ResetToFactorySettings"}, + FunctionInfo{101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, + FunctionInfo{102, nullptr, "ResetToFactorySettingsForRefurbishment"}, + FunctionInfo{103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, + FunctionInfo{104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, + FunctionInfo{105, nullptr, "RequestResetToFactorySettingsSecurely"}, + FunctionInfo{106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, + FunctionInfo{200, nullptr, "CalculateUserSaveDataStatistics"}, + FunctionInfo{201, nullptr, "DeleteUserSaveDataAll"}, + FunctionInfo{210, nullptr, "DeleteUserSystemSaveData"}, + FunctionInfo{211, nullptr, "DeleteSaveData"}, + FunctionInfo{220, nullptr, "UnregisterNetworkServiceAccount"}, + FunctionInfo{221, D<&IApplicationManagerInterface::UnregisterNetworkServiceAccountWithUserSaveDataDeletion>, "UnregisterNetworkServiceAccountWithUserSaveDataDeletion"}, + FunctionInfo{300, nullptr, "GetApplicationShellEvent"}, + FunctionInfo{301, nullptr, "PopApplicationShellEventInfo"}, + FunctionInfo{302, nullptr, "LaunchLibraryApplet"}, + FunctionInfo{303, nullptr, "TerminateLibraryApplet"}, + FunctionInfo{304, nullptr, "LaunchSystemApplet"}, + FunctionInfo{305, nullptr, "TerminateSystemApplet"}, + FunctionInfo{306, nullptr, "LaunchOverlayApplet"}, + FunctionInfo{307, nullptr, "TerminateOverlayApplet"}, + FunctionInfo{400, D<&IApplicationManagerInterface::GetApplicationControlData>, "GetApplicationControlData"}, + FunctionInfo{401, nullptr, "InvalidateAllApplicationControlCache"}, + FunctionInfo{402, nullptr, "RequestDownloadApplicationControlData"}, + FunctionInfo{403, nullptr, "GetMaxApplicationControlCacheCount"}, + FunctionInfo{404, nullptr, "InvalidateApplicationControlCache"}, + FunctionInfo{405, nullptr, "ListApplicationControlCacheEntryInfo"}, + FunctionInfo{406, nullptr, "GetApplicationControlProperty"}, + FunctionInfo{407, &IApplicationManagerInterface::ListApplicationTitle, "ListApplicationTitle"}, + FunctionInfo{408, &IApplicationManagerInterface::ListApplicationIcon, "ListApplicationIcon"}, + FunctionInfo{411, nullptr, "Unknown411", MakeVersionGate({19,0,0})}, + FunctionInfo{412, nullptr, "Unknown412", MakeVersionGate({19,0,0})}, + FunctionInfo{413, nullptr, "Unknown413", MakeVersionGate({19,0,0})}, + FunctionInfo{414, nullptr, "Unknown414", MakeVersionGate({19,0,0})}, + FunctionInfo{415, nullptr, "Unknown415", MakeVersionGate({19,0,0})}, + FunctionInfo{416, nullptr, "Unknown416", MakeVersionGate({19,0,0})}, + FunctionInfo{417, nullptr, "InvalidateAllApplicationControlCacheOfTheStage", MakeVersionGate({19,0,0})}, + FunctionInfo{418, nullptr, "InvalidateApplicationControlCacheOfTheStage", MakeVersionGate({19,0,0})}, + FunctionInfo{419, D<&IApplicationManagerInterface::RequestDownloadApplicationControlDataInBackground>, "RequestDownloadApplicationControlDataInBackground"}, + FunctionInfo{420, nullptr, "CloneApplicationControlDataCacheForDebug"}, + FunctionInfo{421, nullptr, "Unknown421", MakeVersionGate({20,0,0})}, + FunctionInfo{422, nullptr, "Unknown422", MakeVersionGate({20,0,0})}, + FunctionInfo{423, nullptr, "Unknown423", MakeVersionGate({20,0,0})}, + FunctionInfo{424, nullptr, "Unknown424", MakeVersionGate({20,0,0})}, + FunctionInfo{425, nullptr, "Unknown425", MakeVersionGate({20,0,0})}, + FunctionInfo{426, nullptr, "Unknown426", MakeVersionGate({20,0,0})}, + FunctionInfo{427, nullptr, "Unknown427", MakeVersionGate({20,0,0})}, + FunctionInfo{428, nullptr, "Unknown428", MakeVersionGate({21,0,0})}, + FunctionInfo{429, nullptr, "Unknown429", MakeVersionGate({21,0,0})}, + FunctionInfo{430, nullptr, "Unknown430", MakeVersionGate({21,0,0})}, + FunctionInfo{502, nullptr, "RequestCheckGameCardRegistration"}, + FunctionInfo{503, nullptr, "RequestGameCardRegistrationGoldPoint"}, + FunctionInfo{504, nullptr, "RequestRegisterGameCard"}, + FunctionInfo{505, D<&IApplicationManagerInterface::GetGameCardMountFailureEvent>, "GetGameCardMountFailureEvent"}, + FunctionInfo{506, nullptr, "IsGameCardInserted"}, + FunctionInfo{507, nullptr, "EnsureGameCardAccess"}, + FunctionInfo{508, nullptr, "GetLastGameCardMountFailureResult"}, + FunctionInfo{509, nullptr, "ListApplicationIdOnGameCard"}, + FunctionInfo{510, nullptr, "GetGameCardPlatformRegion"}, + FunctionInfo{511, D<&IApplicationManagerInterface::GetGameCardWakenReadyEvent>, "GetGameCardWakenReadyEvent"}, + FunctionInfo{512, D<&IApplicationManagerInterface::IsGameCardApplicationRunning>, "IsGameCardApplicationRunning"}, + FunctionInfo{513, nullptr, "Unknown513", MakeVersionGate({20,0,0})}, + FunctionInfo{514, nullptr, "Unknown514", MakeVersionGate({20,0,0})}, + FunctionInfo{515, nullptr, "Unknown515", MakeVersionGate({20,0,0})}, + FunctionInfo{516, nullptr, "Unknown516", MakeVersionGate({21,0,0})}, + FunctionInfo{517, nullptr, "Unknown517", MakeVersionGate({21,0,0})}, + FunctionInfo{518, nullptr, "Unknown518", MakeVersionGate({21,0,0})}, + FunctionInfo{519, nullptr, "Unknown519", MakeVersionGate({21,0,0})}, + FunctionInfo{600, nullptr, "CountApplicationContentMeta"}, + FunctionInfo{601, nullptr, "ListApplicationContentMetaStatus"}, + FunctionInfo{602, nullptr, "ListAvailableAddOnContent"}, + FunctionInfo{603, nullptr, "GetOwnedApplicationContentMetaStatus"}, + FunctionInfo{604, nullptr, "RegisterContentsExternalKey"}, + FunctionInfo{605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, + FunctionInfo{606, nullptr, "GetContentMetaStorage"}, + FunctionInfo{607, nullptr, "ListAvailableAddOnContent"}, + FunctionInfo{609, nullptr, "ListAvailabilityAssuredAddOnContent"}, + FunctionInfo{610, nullptr, "GetInstalledContentMetaStorage"}, + FunctionInfo{611, nullptr, "PrepareAddOnContent"}, + FunctionInfo{700, nullptr, "PushDownloadTaskList"}, + FunctionInfo{701, nullptr, "ClearTaskStatusList"}, + FunctionInfo{702, nullptr, "RequestDownloadTaskList"}, + FunctionInfo{703, nullptr, "RequestEnsureDownloadTask"}, + FunctionInfo{704, nullptr, "ListDownloadTaskStatus"}, + FunctionInfo{705, nullptr, "RequestDownloadTaskListData"}, + FunctionInfo{800, nullptr, "RequestVersionList"}, + FunctionInfo{801, nullptr, "ListVersionList"}, + FunctionInfo{802, nullptr, "RequestVersionListData"}, + FunctionInfo{900, nullptr, "GetApplicationRecord"}, + FunctionInfo{901, nullptr, "GetApplicationRecordProperty"}, + FunctionInfo{902, nullptr, "EnableApplicationAutoUpdate"}, + FunctionInfo{903, nullptr, "DisableApplicationAutoUpdate"}, + FunctionInfo{904, D<&IApplicationManagerInterface::TouchApplication>, "TouchApplication"}, + FunctionInfo{905, nullptr, "RequestApplicationUpdate"}, + FunctionInfo{906, D<&IApplicationManagerInterface::IsApplicationUpdateRequested>, "IsApplicationUpdateRequested"}, + FunctionInfo{907, nullptr, "WithdrawApplicationUpdateRequest"}, + FunctionInfo{908, nullptr, "ListApplicationRecordInstalledContentMeta"}, + FunctionInfo{909, nullptr, "WithdrawCleanupAddOnContentsWithNoRightsRecommendation"}, + FunctionInfo{910, nullptr, "HasApplicationRecord"}, + FunctionInfo{911, nullptr, "SetPreInstalledApplication"}, + FunctionInfo{912, nullptr, "ClearPreInstalledApplicationFlag"}, + FunctionInfo{913, nullptr, "ListAllApplicationRecord"}, + FunctionInfo{914, nullptr, "HideApplicationRecord"}, + FunctionInfo{915, nullptr, "ShowApplicationRecord"}, + FunctionInfo{916, nullptr, "IsApplicationAutoDeleteDisabled"}, + FunctionInfo{916, nullptr, "Unknown916", MakeVersionGate({20,0,0})}, + FunctionInfo{917, nullptr, "Unknown917", MakeVersionGate({20,0,0})}, + FunctionInfo{918, nullptr, "Unknown918", MakeVersionGate({20,0,0})}, + FunctionInfo{919, nullptr, "Unknown919", MakeVersionGate({20,0,0})}, + FunctionInfo{920, nullptr, "Unknown920", MakeVersionGate({20,0,0})}, + FunctionInfo{921, nullptr, "Unknown921", MakeVersionGate({20,0,0})}, + FunctionInfo{922, nullptr, "Unknown922", MakeVersionGate({20,0,0})}, + FunctionInfo{923, nullptr, "Unknown923", MakeVersionGate({20,0,0})}, + FunctionInfo{928, nullptr, "Unknown928", MakeVersionGate({20,0,0})}, + FunctionInfo{929, nullptr, "Unknown929", MakeVersionGate({20,0,0})}, + FunctionInfo{930, nullptr, "Unknown930", MakeVersionGate({20,0,0})}, + FunctionInfo{931, nullptr, "Unknown931", MakeVersionGate({20,0,0})}, + FunctionInfo{933, nullptr, "Unknown933", MakeVersionGate({20,0,0})}, + FunctionInfo{934, nullptr, "Unknown934", MakeVersionGate({21,0,0})}, + FunctionInfo{935, nullptr, "Unknown935", MakeVersionGate({21,0,0})}, + FunctionInfo{936, D<&IApplicationManagerInterface::Unknown936>, "Unknown936", MakeVersionGate({21,0,0})}, + FunctionInfo{1000, nullptr, "RequestVerifyApplicationDeprecated"}, + FunctionInfo{1001, nullptr, "CorruptApplicationForDebug"}, + FunctionInfo{1002, nullptr, "RequestVerifyAddOnContentsRights"}, + FunctionInfo{1003, nullptr, "RequestVerifyApplication"}, + FunctionInfo{1004, nullptr, "CorruptContentForDebug"}, + FunctionInfo{1200, nullptr, "NeedsUpdateVulnerability"}, + FunctionInfo{1300, D<&IApplicationManagerInterface::IsAnyApplicationEntityInstalled>, "IsAnyApplicationEntityInstalled"}, + FunctionInfo{1301, nullptr, "DeleteApplicationContentEntities"}, + FunctionInfo{1302, nullptr, "CleanupUnrecordedApplicationEntity"}, + FunctionInfo{1303, nullptr, "CleanupAddOnContentsWithNoRights"}, + FunctionInfo{1304, nullptr, "DeleteApplicationContentEntity"}, + FunctionInfo{1305, nullptr, "TryDeleteRunningApplicationEntity"}, + FunctionInfo{1306, nullptr, "TryDeleteRunningApplicationCompletely"}, + FunctionInfo{1307, nullptr, "TryDeleteRunningApplicationContentEntities"}, + FunctionInfo{1308, nullptr, "DeleteApplicationCompletelyForDebug"}, + FunctionInfo{1309, nullptr, "CleanupUnavailableAddOnContents"}, + FunctionInfo{1310, nullptr, "RequestMoveApplicationEntity"}, + FunctionInfo{1311, nullptr, "EstimateSizeToMove"}, + FunctionInfo{1312, nullptr, "HasMovableEntity"}, + FunctionInfo{1313, nullptr, "CleanupOrphanContents"}, + FunctionInfo{1314, nullptr, "CheckPreconditionSatisfiedToMove"}, + FunctionInfo{1400, nullptr, "PrepareShutdown"}, + FunctionInfo{1500, nullptr, "FormatSdCard"}, + FunctionInfo{1501, nullptr, "NeedsSystemUpdateToFormatSdCard"}, + FunctionInfo{1502, nullptr, "GetLastSdCardFormatUnexpectedResult"}, + FunctionInfo{1504, nullptr, "InsertSdCard"}, + FunctionInfo{1505, nullptr, "RemoveSdCard"}, + FunctionInfo{1506, nullptr, "GetSdCardStartupStatus"}, + FunctionInfo{1508, nullptr, "Unknown1508", MakeVersionGate({20,0,0})}, + FunctionInfo{1509, nullptr, "Unknown1509", MakeVersionGate({20,0,0})}, + FunctionInfo{1510, nullptr, "Unknown1510", MakeVersionGate({20,0,0})}, + FunctionInfo{1511, nullptr, "Unknown1511", MakeVersionGate({20,0,0})}, + FunctionInfo{1512, nullptr, "Unknown1512", MakeVersionGate({20,0,0})}, + FunctionInfo{1600, nullptr, "GetSystemSeedForPseudoDeviceId"}, + FunctionInfo{1601, nullptr, "ResetSystemSeedForPseudoDeviceId"}, + FunctionInfo{1700, nullptr, "ListApplicationDownloadingContentMeta"}, + FunctionInfo{1701, D<&IApplicationManagerInterface::GetApplicationViewDeprecated>, "GetApplicationViewDeprecated"}, + FunctionInfo{1702, nullptr, "GetApplicationDownloadTaskStatus"}, + FunctionInfo{1703, nullptr, "GetApplicationViewDownloadErrorContext"}, + FunctionInfo{1704, D<&IApplicationManagerInterface::GetApplicationViewWithPromotionInfo>, "GetApplicationViewWithPromotionInfo"}, + FunctionInfo{1705, nullptr, "IsPatchAutoDeletableApplication"}, + FunctionInfo{1706, D<&IApplicationManagerInterface::GetApplicationView>, "GetApplicationView"}, + FunctionInfo{1800, nullptr, "IsNotificationSetupCompleted"}, + FunctionInfo{1801, nullptr, "GetLastNotificationInfoCount"}, + FunctionInfo{1802, nullptr, "ListLastNotificationInfo"}, + FunctionInfo{1803, nullptr, "ListNotificationTask"}, + FunctionInfo{1900, nullptr, "IsActiveAccount"}, + FunctionInfo{1901, nullptr, "RequestDownloadApplicationPrepurchasedRights"}, + FunctionInfo{1902, nullptr, "GetApplicationTicketInfo"}, + FunctionInfo{1903, nullptr, "RequestDownloadApplicationPrepurchasedRightsForAccount"}, + FunctionInfo{2000, nullptr, "GetSystemDeliveryInfo"}, + FunctionInfo{2001, nullptr, "SelectLatestSystemDeliveryInfo"}, + FunctionInfo{2002, nullptr, "VerifyDeliveryProtocolVersion"}, + FunctionInfo{2003, nullptr, "GetApplicationDeliveryInfo"}, + FunctionInfo{2004, nullptr, "HasAllContentsToDeliver"}, + FunctionInfo{2005, nullptr, "CompareApplicationDeliveryInfo"}, + FunctionInfo{2006, nullptr, "CanDeliverApplication"}, + FunctionInfo{2007, nullptr, "ListContentMetaKeyToDeliverApplication"}, + FunctionInfo{2008, nullptr, "NeedsSystemUpdateToDeliverApplication"}, + FunctionInfo{2009, nullptr, "EstimateRequiredSize"}, + FunctionInfo{2010, nullptr, "RequestReceiveApplication"}, + FunctionInfo{2011, nullptr, "CommitReceiveApplication"}, + FunctionInfo{2012, nullptr, "GetReceiveApplicationProgress"}, + FunctionInfo{2013, nullptr, "RequestSendApplication"}, + FunctionInfo{2014, nullptr, "GetSendApplicationProgress"}, + FunctionInfo{2015, nullptr, "CompareSystemDeliveryInfo"}, + FunctionInfo{2016, nullptr, "ListNotCommittedContentMeta"}, + FunctionInfo{2017, nullptr, "CreateDownloadTask"}, + FunctionInfo{2018, nullptr, "GetApplicationDeliveryInfoHash"}, + FunctionInfo{2019, nullptr, "Unknown2019", MakeVersionGate({20,0,0})}, + FunctionInfo{2050, D<&IApplicationManagerInterface::GetApplicationRightsOnClient>, "GetApplicationRightsOnClient"}, + FunctionInfo{2051, nullptr, "InvalidateRightsIdCache"}, + FunctionInfo{2052, nullptr, "Unknown2052", MakeVersionGate({20,0,0})}, + FunctionInfo{2053, nullptr, "Unknown2053", MakeVersionGate({20,0,0})}, + FunctionInfo{2100, D<&IApplicationManagerInterface::GetApplicationTerminateResult>, "GetApplicationTerminateResult"}, + FunctionInfo{2101, nullptr, "GetRawApplicationTerminateResult"}, + FunctionInfo{2150, nullptr, "CreateRightsEnvironment"}, + FunctionInfo{2151, nullptr, "DestroyRightsEnvironment"}, + FunctionInfo{2152, nullptr, "ActivateRightsEnvironment"}, + FunctionInfo{2153, nullptr, "DeactivateRightsEnvironment"}, + FunctionInfo{2154, nullptr, "ForceActivateRightsContextForExit"}, + FunctionInfo{2155, nullptr, "UpdateRightsEnvironmentStatus"}, + FunctionInfo{2156, nullptr, "CreateRightsEnvironmentForMicroApplication"}, + FunctionInfo{2160, nullptr, "AddTargetApplicationToRightsEnvironment"}, + FunctionInfo{2161, nullptr, "SetUsersToRightsEnvironment"}, + FunctionInfo{2170, nullptr, "GetRightsEnvironmentStatus"}, + FunctionInfo{2171, nullptr, "GetRightsEnvironmentStatusChangedEvent"}, + FunctionInfo{2180, nullptr, "RequestExtendRightsInRightsEnvironment"}, + FunctionInfo{2181, nullptr, "GetResultOfExtendRightsInRightsEnvironment"}, + FunctionInfo{2182, nullptr, "SetActiveRightsContextUsingStateToRightsEnvironment"}, + FunctionInfo{2183, nullptr, "Unknown2183", MakeVersionGate({20,1,0})}, + FunctionInfo{2190, nullptr, "GetRightsEnvironmentHandleForApplication"}, + FunctionInfo{2199, nullptr, "GetRightsEnvironmentCountForDebug"}, + FunctionInfo{2200, nullptr, "GetGameCardApplicationCopyIdentifier"}, + FunctionInfo{2201, nullptr, "GetInstalledApplicationCopyIdentifier"}, + FunctionInfo{2250, nullptr, "RequestReportActiveELicence"}, + FunctionInfo{2300, nullptr, "ListEventLog"}, + FunctionInfo{2350, nullptr, "PerformAutoUpdateByApplicationId"}, + FunctionInfo{2351, nullptr, "RequestNoDownloadRightsErrorResolution"}, + FunctionInfo{2352, nullptr, "RequestResolveNoDownloadRightsError"}, + FunctionInfo{2353, nullptr, "GetApplicationDownloadTaskInfo"}, + FunctionInfo{2354, nullptr, "PrioritizeApplicationBackgroundTask"}, + FunctionInfo{2355, nullptr, "PreferStorageEfficientUpdate"}, + FunctionInfo{2356, nullptr, "RequestStorageEfficientUpdatePreferable"}, + FunctionInfo{2357, nullptr, "EnableMultiCoreDownload"}, + FunctionInfo{2358, nullptr, "DisableMultiCoreDownload"}, + FunctionInfo{2359, nullptr, "IsMultiCoreDownloadEnabled"}, + FunctionInfo{2360, nullptr, "GetApplicationDownloadTaskCount", MakeVersionGate({19,0,0})}, + FunctionInfo{2361, nullptr, "GetMaxApplicationDownloadTaskCount", MakeVersionGate({19,0,0})}, + FunctionInfo{2362, nullptr, "Unknown2362", MakeVersionGate({20,0,0})}, + FunctionInfo{2363, nullptr, "Unknown2363", MakeVersionGate({20,0,0})}, + FunctionInfo{2364, nullptr, "Unknown2364", MakeVersionGate({20,0,0})}, + FunctionInfo{2365, nullptr, "Unknown2365", MakeVersionGate({20,0,0})}, + FunctionInfo{2366, nullptr, "Unknown2366", MakeVersionGate({20,0,0})}, + FunctionInfo{2367, nullptr, "Unknown2367", MakeVersionGate({20,0,0})}, + FunctionInfo{2368, nullptr, "Unknown2368", MakeVersionGate({20,0,0})}, + FunctionInfo{2369, nullptr, "Unknown2369", MakeVersionGate({21,0,0})}, + FunctionInfo{2400, nullptr, "GetPromotionInfo"}, + FunctionInfo{2401, nullptr, "CountPromotionInfo"}, + FunctionInfo{2402, nullptr, "ListPromotionInfo"}, + FunctionInfo{2403, nullptr, "ImportPromotionJsonForDebug"}, + FunctionInfo{2404, nullptr, "ClearPromotionInfoForDebug"}, + FunctionInfo{2500, nullptr, "ConfirmAvailableTime"}, + FunctionInfo{2510, nullptr, "CreateApplicationResource"}, + FunctionInfo{2511, nullptr, "GetApplicationResource"}, + FunctionInfo{2513, nullptr, "LaunchMicroApplication"}, + FunctionInfo{2514, nullptr, "ClearTaskOfAsyncTaskManager"}, + FunctionInfo{2515, nullptr, "CleanupAllPlaceHolderAndFragmentsIfNoTask"}, + FunctionInfo{2516, nullptr, "EnsureApplicationCertificate"}, + FunctionInfo{2517, nullptr, "CreateApplicationInstance"}, + FunctionInfo{2518, nullptr, "UpdateQualificationForDebug"}, + FunctionInfo{2519, nullptr, "IsQualificationTransitionSupported"}, + FunctionInfo{2520, D<&IApplicationManagerInterface::IsQualificationTransitionSupportedByProcessId>, "IsQualificationTransitionSupportedByProcessId"}, + FunctionInfo{2521, nullptr, "GetRightsUserChangedEvent"}, + FunctionInfo{2522, nullptr, "IsRomRedirectionAvailable"}, + FunctionInfo{2523, nullptr, "GetProgramId", MakeVersionGate({17,0,0})}, + FunctionInfo{2524, nullptr, "Unknown2524", MakeVersionGate({19,0,0})}, + FunctionInfo{2525, nullptr, "Unknown2525", MakeVersionGate({20,0,0})}, + FunctionInfo{2800, nullptr, "GetApplicationIdOfPreomia"}, + FunctionInfo{3000, nullptr, "RegisterDeviceLockKey"}, + FunctionInfo{3001, nullptr, "UnregisterDeviceLockKey"}, + FunctionInfo{3002, nullptr, "VerifyDeviceLockKey"}, + FunctionInfo{3003, nullptr, "HideApplicationIcon"}, + FunctionInfo{3004, nullptr, "ShowApplicationIcon"}, + FunctionInfo{3005, nullptr, "HideApplicationTitle"}, + FunctionInfo{3006, nullptr, "ShowApplicationTitle"}, + FunctionInfo{3007, nullptr, "EnableGameCard"}, + FunctionInfo{3008, nullptr, "DisableGameCard"}, + FunctionInfo{3009, nullptr, "EnableLocalContentShare"}, + FunctionInfo{3010, nullptr, "DisableLocalContentShare"}, + FunctionInfo{3011, nullptr, "IsApplicationIconHidden"}, + FunctionInfo{3012, nullptr, "IsApplicationTitleHidden"}, + FunctionInfo{3013, nullptr, "IsGameCardEnabled"}, + FunctionInfo{3014, nullptr, "IsLocalContentShareEnabled"}, + FunctionInfo{3050, nullptr, "ListAssignELicenseTaskResult"}, + FunctionInfo{3104, nullptr, "GetApplicationNintendoLogo", MakeVersionGate({18,0,0})}, + FunctionInfo{3105, nullptr, "GetApplicationStartupMovie", MakeVersionGate({18,0,0})}, + FunctionInfo{4000, nullptr, "Unknown4000", MakeVersionGate({20,0,0})}, + FunctionInfo{4004, nullptr, "Unknown4004", MakeVersionGate({20,0,0})}, + FunctionInfo{4006, nullptr, "Unknown4006", MakeVersionGate({20,0,0})}, + FunctionInfo{4007, nullptr, "Unknown4007", MakeVersionGate({20,0,0})}, + FunctionInfo{4008, nullptr, "Unknown4008", MakeVersionGate({20,0,0})}, + FunctionInfo{4009, nullptr, "Unknown4009", MakeVersionGate({20,0,0})}, + FunctionInfo{4010, nullptr, "Unknown4010", MakeVersionGate({20,0,0})}, + FunctionInfo{4011, nullptr, "Unknown4011", MakeVersionGate({20,0,0})}, + FunctionInfo{4012, nullptr, "Unknown4012", MakeVersionGate({20,0,0})}, + FunctionInfo{4013, nullptr, "Unknown4013", MakeVersionGate({20,0,0})}, + FunctionInfo{4015, nullptr, "Unknown4015", MakeVersionGate({20,0,0})}, + FunctionInfo{4017, nullptr, "Unknown4017", MakeVersionGate({20,0,0})}, + FunctionInfo{4019, nullptr, "Unknown4019", MakeVersionGate({20,0,0})}, + FunctionInfo{4020, nullptr, "Unknown4020", MakeVersionGate({20,0,0})}, + FunctionInfo{4021, nullptr, "Unknown4021", MakeVersionGate({20,0,0})}, + FunctionInfo{4022, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4022", MakeVersionGate({20,0,0})}, + FunctionInfo{4023, D<&IApplicationManagerInterface::Unknown4023>, "Unknown4023", MakeVersionGate({20,0,0})}, + FunctionInfo{4024, nullptr, "Unknown4024", MakeVersionGate({20,0,0})}, + FunctionInfo{4025, nullptr, "Unknown4025", MakeVersionGate({20,0,0})}, + FunctionInfo{4026, nullptr, "Unknown4026", MakeVersionGate({20,0,0})}, + FunctionInfo{4027, nullptr, "Unknown4027", MakeVersionGate({20,0,0})}, + FunctionInfo{4028, nullptr, "Unknown4028", MakeVersionGate({20,0,0})}, + FunctionInfo{4029, nullptr, "Unknown4029", MakeVersionGate({20,0,0})}, + FunctionInfo{4030, nullptr, "Unknown4030", MakeVersionGate({20,0,0})}, + FunctionInfo{4031, nullptr, "Unknown4031", MakeVersionGate({20,0,0})}, + FunctionInfo{4032, nullptr, "Unknown4032", MakeVersionGate({20,0,0})}, + FunctionInfo{4033, nullptr, "Unknown4033", MakeVersionGate({20,0,0})}, + FunctionInfo{4034, nullptr, "Unknown4034", MakeVersionGate({20,0,0})}, + FunctionInfo{4035, nullptr, "Unknown4035", MakeVersionGate({20,0,0})}, + FunctionInfo{4037, nullptr, "Unknown4037", MakeVersionGate({20,0,0})}, + FunctionInfo{4038, nullptr, "Unknown4038", MakeVersionGate({20,0,0})}, + FunctionInfo{4039, nullptr, "Unknown4039", MakeVersionGate({20,0,0})}, + FunctionInfo{4040, nullptr, "Unknown4040", MakeVersionGate({20,0,0})}, + FunctionInfo{4041, nullptr, "Unknown4041", MakeVersionGate({20,0,0})}, + FunctionInfo{4042, D<&IApplicationManagerInterface::Unknown4042>, "Unknown4042", MakeVersionGate({20,0,0})}, + FunctionInfo{4043, nullptr, "Unknown4043", MakeVersionGate({20,0,0})}, + FunctionInfo{4044, nullptr, "Unknown4044", MakeVersionGate({20,0,0})}, + FunctionInfo{4045, nullptr, "Unknown4045", MakeVersionGate({20,0,0})}, + FunctionInfo{4046, nullptr, "Unknown4046", MakeVersionGate({20,0,0})}, + FunctionInfo{4049, nullptr, "Unknown4049", MakeVersionGate({20,0,0})}, + FunctionInfo{4050, nullptr, "Unknown4050", MakeVersionGate({20,0,0})}, + FunctionInfo{4051, nullptr, "Unknown4051", MakeVersionGate({20,0,0})}, + FunctionInfo{4052, nullptr, "Unknown4052", MakeVersionGate({20,0,0})}, + FunctionInfo{4053, D<&IApplicationManagerInterface::Unknown4053>, "Unknown4053", MakeVersionGate({20,0,0})}, + FunctionInfo{4054, nullptr, "Unknown4054", MakeVersionGate({20,0,0})}, + FunctionInfo{4055, nullptr, "Unknown4055", MakeVersionGate({20,0,0})}, + FunctionInfo{4056, nullptr, "Unknown4056", MakeVersionGate({20,0,0})}, + FunctionInfo{4057, nullptr, "Unknown4057", MakeVersionGate({20,0,0})}, + FunctionInfo{4058, nullptr, "Unknown4058", MakeVersionGate({20,0,0})}, + FunctionInfo{4059, nullptr, "Unknown4059", MakeVersionGate({20,0,0})}, + FunctionInfo{4060, nullptr, "Unknown4060", MakeVersionGate({20,0,0})}, + FunctionInfo{4061, nullptr, "Unknown4061", MakeVersionGate({20,0,0})}, + FunctionInfo{4062, nullptr, "Unknown4062", MakeVersionGate({20,0,0})}, + FunctionInfo{4063, nullptr, "Unknown4063", MakeVersionGate({20,0,0})}, + FunctionInfo{4064, nullptr, "Unknown4064", MakeVersionGate({20,0,0})}, + FunctionInfo{4065, nullptr, "Unknown4065", MakeVersionGate({20,0,0})}, + FunctionInfo{4066, nullptr, "Unknown4066", MakeVersionGate({20,0,0})}, + FunctionInfo{4067, nullptr, "Unknown4067", MakeVersionGate({20,0,0})}, + FunctionInfo{4068, nullptr, "Unknown4068", MakeVersionGate({20,0,0})}, + FunctionInfo{4069, nullptr, "Unknown4069", MakeVersionGate({20,0,0})}, + FunctionInfo{4070, nullptr, "Unknown4070", MakeVersionGate({20,0,0})}, + FunctionInfo{4071, nullptr, "Unknown4071", MakeVersionGate({20,0,0})}, + FunctionInfo{4072, nullptr, "Unknown4072", MakeVersionGate({20,0,0})}, + FunctionInfo{4073, nullptr, "Unknown4073", MakeVersionGate({20,0,0})}, + FunctionInfo{4074, nullptr, "Unknown4074", MakeVersionGate({20,0,0})}, + FunctionInfo{4075, nullptr, "Unknown4075", MakeVersionGate({20,0,0})}, + FunctionInfo{4076, nullptr, "Unknown4076", MakeVersionGate({20,0,0})}, + FunctionInfo{4077, nullptr, "Unknown4077", MakeVersionGate({20,0,0})}, + FunctionInfo{4078, nullptr, "Unknown4078", MakeVersionGate({20,0,0})}, + FunctionInfo{4079, nullptr, "Unknown4079", MakeVersionGate({20,0,0})}, + FunctionInfo{4080, nullptr, "Unknown4080", MakeVersionGate({20,0,0})}, + FunctionInfo{4081, nullptr, "Unknown4081", MakeVersionGate({20,0,0})}, + FunctionInfo{4083, nullptr, "Unknown4083", MakeVersionGate({20,0,0})}, + FunctionInfo{4084, nullptr, "Unknown4084", MakeVersionGate({20,0,0})}, + FunctionInfo{4085, nullptr, "Unknown4085", MakeVersionGate({20,0,0})}, + FunctionInfo{4086, nullptr, "Unknown4086", MakeVersionGate({20,0,0})}, + FunctionInfo{4087, nullptr, "Unknown4087", MakeVersionGate({20,0,0})}, + FunctionInfo{4088, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4088", MakeVersionGate({20,0,0})}, + FunctionInfo{4089, nullptr, "Unknown4089", MakeVersionGate({20,0,0})}, + FunctionInfo{4090, nullptr, "Unknown4090", MakeVersionGate({20,0,0})}, + FunctionInfo{4091, nullptr, "Unknown4091", MakeVersionGate({20,0,0})}, + FunctionInfo{4092, nullptr, "Unknown4092", MakeVersionGate({20,0,0})}, + FunctionInfo{4093, nullptr, "Unknown4093", MakeVersionGate({20,0,0})}, + FunctionInfo{4094, nullptr, "Unknown4094", MakeVersionGate({20,0,0})}, + FunctionInfo{4095, nullptr, "Unknown4095", MakeVersionGate({20,0,0})}, + FunctionInfo{4096, nullptr, "Unknown4096", MakeVersionGate({20,0,0})}, + FunctionInfo{4097, nullptr, "Unknown4097", MakeVersionGate({20,0,0})}, + FunctionInfo{4099, nullptr, "Unknown4099", MakeVersionGate({21,0,0})}, + FunctionInfo{4105, D<&IApplicationManagerInterface::Unknown4105>, "Unknown4105", MakeVersionGate({23,0,0})}, + FunctionInfo{5000, nullptr, "Unknown5000", MakeVersionGate({18,0,0})}, + FunctionInfo{5001, nullptr, "Unknown5001", MakeVersionGate({18,0,0})}, + FunctionInfo{9999, nullptr, "GetApplicationCertificate", MakeVersionGate({10,0,0}, {10,2,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_) : ServiceFramework{system_, "IApplicationManagerInterface"}, service_context{system, "IApplicationManagerInterface"}, @@ -32,458 +484,6 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ gamecard_update_detection_event{service_context}, gamecard_mount_status_event{service_context}, gamecard_mount_failure_event{service_context}, gamecard_waken_ready_event{service_context}, unknown_event{service_context} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IApplicationManagerInterface::ListApplicationRecord>, "ListApplicationRecord"}, - {1, nullptr, "GenerateApplicationRecordCount"}, - {2, D<&IApplicationManagerInterface::GetApplicationRecordUpdateSystemEvent>, "GetApplicationRecordUpdateSystemEvent"}, - {3, nullptr, "GetApplicationViewDeprecated"}, - {4, D<&IApplicationManagerInterface::DeleteApplicationEntity>, "DeleteApplicationEntity"}, - {5, D<&IApplicationManagerInterface::DeleteApplicationCompletely>, "DeleteApplicationCompletely"}, - {6, nullptr, "IsAnyApplicationEntityRedundant"}, - {7, nullptr, "DeleteRedundantApplicationEntity"}, - {8, nullptr, "IsApplicationEntityMovable"}, - {9, nullptr, "MoveApplicationEntity"}, - {11, nullptr, "CalculateApplicationOccupiedSize"}, - {16, &IApplicationManagerInterface::PushApplicationRecord, "PushApplicationRecord"}, - {17, nullptr, "ListApplicationRecordContentMeta"}, - {19, nullptr, "LaunchApplicationOld"}, - {21, nullptr, "GetApplicationContentPath"}, - {22, nullptr, "TerminateApplication"}, - {23, nullptr, "ResolveApplicationContentPath"}, - {26, nullptr, "BeginInstallApplication"}, - {27, nullptr, "DeleteApplicationRecord"}, - {30, nullptr, "RequestApplicationUpdateInfo"}, - {31, nullptr, "RequestUpdateApplication"}, - {32, nullptr, "CancelApplicationDownload"}, - {33, nullptr, "ResumeApplicationDownload"}, - {35, nullptr, "UpdateVersionList"}, - {36, nullptr, "PushLaunchVersion"}, - {37, nullptr, "ListRequiredVersion"}, - {38, D<&IApplicationManagerInterface::CheckApplicationLaunchVersion>, "CheckApplicationLaunchVersion"}, - {39, nullptr, "CheckApplicationLaunchRights"}, - {40, D<&IApplicationManagerInterface::GetApplicationLogoData>, "GetApplicationLogoData"}, - {41, nullptr, "CalculateApplicationDownloadRequiredSize"}, - {42, nullptr, "CleanupSdCard"}, - {43, D<&IApplicationManagerInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, - {44, D<&IApplicationManagerInterface::GetSdCardMountStatusChangedEvent>, "GetSdCardMountStatusChangedEvent"}, - {45, nullptr, "GetGameCardAttachmentEvent"}, - {46, nullptr, "GetGameCardAttachmentInfo"}, - {47, D<&IApplicationManagerInterface::GetTotalSpaceSize>, "GetTotalSpaceSize"}, - {48, D<&IApplicationManagerInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, - {49, nullptr, "GetSdCardRemovedEvent"}, - {52, D<&IApplicationManagerInterface::GetGameCardUpdateDetectionEvent>, "GetGameCardUpdateDetectionEvent"}, - {53, nullptr, "DisableApplicationAutoDelete"}, - {54, nullptr, "EnableApplicationAutoDelete"}, - {55, D<&IApplicationManagerInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, - {56, nullptr, "SetApplicationTerminateResult"}, - {57, nullptr, "ClearApplicationTerminateResult"}, - {58, nullptr, "GetLastSdCardMountUnexpectedResult"}, - {59, D<&IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, - {60, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, - {61, nullptr, "GetBackgroundDownloadStressTaskInfo"}, - {62, nullptr, "GetGameCardStopper"}, - {63, nullptr, "IsSystemProgramInstalled"}, - {64, nullptr, "StartApplyDeltaTask"}, - {65, nullptr, "GetRequestServerStopper"}, - {66, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, - {67, nullptr, "CancelApplicationApplyDelta"}, - {68, nullptr, "ResumeApplicationApplyDelta"}, - {69, nullptr, "CalculateApplicationApplyDeltaRequiredSize"}, - {70, D<&IApplicationManagerInterface::ResumeAll>, "ResumeAll"}, - {71, D<&IApplicationManagerInterface::GetStorageSize>, "GetStorageSize"}, - {80, nullptr, "RequestDownloadApplication"}, - {81, nullptr, "RequestDownloadAddOnContent"}, - {82, nullptr, "DownloadApplication"}, - {83, nullptr, "CheckApplicationResumeRights"}, - {84, nullptr, "GetDynamicCommitEvent"}, - {85, nullptr, "RequestUpdateApplication2"}, - {86, nullptr, "EnableApplicationCrashReport"}, - {87, nullptr, "IsApplicationCrashReportEnabled"}, - {90, nullptr, "BoostSystemMemoryResourceLimit"}, - {91, nullptr, "DeprecatedLaunchApplication"}, - {92, nullptr, "GetRunningApplicationProgramId"}, - {93, nullptr, "GetMainApplicationProgramIndex"}, - {94, nullptr, "LaunchApplication"}, - {95, nullptr, "GetApplicationLaunchInfo"}, - {96, nullptr, "AcquireApplicationLaunchInfo"}, - {97, nullptr, "GetMainApplicationProgramIndexByApplicationLaunchInfo"}, - {98, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, - {99, nullptr, "LaunchDevMenu"}, - {100, nullptr, "ResetToFactorySettings"}, - {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, - {102, nullptr, "ResetToFactorySettingsForRefurbishment"}, - {103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, - {104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, - {105, nullptr, "RequestResetToFactorySettingsSecurely"}, - {106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, - {200, nullptr, "CalculateUserSaveDataStatistics"}, - {201, nullptr, "DeleteUserSaveDataAll"}, - {210, nullptr, "DeleteUserSystemSaveData"}, - {211, nullptr, "DeleteSaveData"}, - {220, nullptr, "UnregisterNetworkServiceAccount"}, - {221, D<&IApplicationManagerInterface::UnregisterNetworkServiceAccountWithUserSaveDataDeletion>, "UnregisterNetworkServiceAccountWithUserSaveDataDeletion"}, - {300, nullptr, "GetApplicationShellEvent"}, - {301, nullptr, "PopApplicationShellEventInfo"}, - {302, nullptr, "LaunchLibraryApplet"}, - {303, nullptr, "TerminateLibraryApplet"}, - {304, nullptr, "LaunchSystemApplet"}, - {305, nullptr, "TerminateSystemApplet"}, - {306, nullptr, "LaunchOverlayApplet"}, - {307, nullptr, "TerminateOverlayApplet"}, - {400, D<&IApplicationManagerInterface::GetApplicationControlData>, "GetApplicationControlData"}, - {401, nullptr, "InvalidateAllApplicationControlCache"}, - {402, nullptr, "RequestDownloadApplicationControlData"}, - {403, nullptr, "GetMaxApplicationControlCacheCount"}, - {404, nullptr, "InvalidateApplicationControlCache"}, - {405, nullptr, "ListApplicationControlCacheEntryInfo"}, - {406, nullptr, "GetApplicationControlProperty"}, - {407, &IApplicationManagerInterface::ListApplicationTitle, "ListApplicationTitle"}, - {408, &IApplicationManagerInterface::ListApplicationIcon, "ListApplicationIcon"}, - {411, nullptr, "Unknown411"}, //19.0.0+ - {412, nullptr, "Unknown412"}, //19.0.0+ - {413, nullptr, "Unknown413"}, //19.0.0+ - {414, nullptr, "Unknown414"}, //19.0.0+ - {415, nullptr, "Unknown415"}, //19.0.0+ - {416, nullptr, "Unknown416"}, //19.0.0+ - {417, nullptr, "InvalidateAllApplicationControlCacheOfTheStage"}, //19.0.0+ - {418, nullptr, "InvalidateApplicationControlCacheOfTheStage"}, //19.0.0+ - {419, D<&IApplicationManagerInterface::RequestDownloadApplicationControlDataInBackground>, "RequestDownloadApplicationControlDataInBackground"}, - {420, nullptr, "CloneApplicationControlDataCacheForDebug"}, - {421, nullptr, "Unknown421"}, //20.0.0+ - {422, nullptr, "Unknown422"}, //20.0.0+ - {423, nullptr, "Unknown423"}, //20.0.0+ - {424, nullptr, "Unknown424"}, //20.0.0+ - {425, nullptr, "Unknown425"}, //20.0.0+ - {426, nullptr, "Unknown426"}, //20.0.0+ - {427, nullptr, "Unknown427"}, //20.0.0+ - {428, nullptr, "Unknown428"}, //21.0.0+ - {429, nullptr, "Unknown429"}, //21.0.0+ - {430, nullptr, "Unknown430"}, //21.0.0+ - {502, nullptr, "RequestCheckGameCardRegistration"}, - {503, nullptr, "RequestGameCardRegistrationGoldPoint"}, - {504, nullptr, "RequestRegisterGameCard"}, - {505, D<&IApplicationManagerInterface::GetGameCardMountFailureEvent>, "GetGameCardMountFailureEvent"}, - {506, nullptr, "IsGameCardInserted"}, - {507, nullptr, "EnsureGameCardAccess"}, - {508, nullptr, "GetLastGameCardMountFailureResult"}, - {509, nullptr, "ListApplicationIdOnGameCard"}, - {510, nullptr, "GetGameCardPlatformRegion"}, - {511, D<&IApplicationManagerInterface::GetGameCardWakenReadyEvent>, "GetGameCardWakenReadyEvent"}, - {512, D<&IApplicationManagerInterface::IsGameCardApplicationRunning>, "IsGameCardApplicationRunning"}, - {513, nullptr, "Unknown513"}, //20.0.0+ - {514, nullptr, "Unknown514"}, //20.0.0+ - {515, nullptr, "Unknown515"}, //20.0.0+ - {516, nullptr, "Unknown516"}, //21.0.0+ - {517, nullptr, "Unknown517"}, //21.0.0+ - {518, nullptr, "Unknown518"}, //21.0.0+ - {519, nullptr, "Unknown519"}, //21.0.0+ - {600, nullptr, "CountApplicationContentMeta"}, - {601, nullptr, "ListApplicationContentMetaStatus"}, - {602, nullptr, "ListAvailableAddOnContent"}, - {603, nullptr, "GetOwnedApplicationContentMetaStatus"}, - {604, nullptr, "RegisterContentsExternalKey"}, - {605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, - {606, nullptr, "GetContentMetaStorage"}, - {607, nullptr, "ListAvailableAddOnContent"}, - {609, nullptr, "ListAvailabilityAssuredAddOnContent"}, - {610, nullptr, "GetInstalledContentMetaStorage"}, - {611, nullptr, "PrepareAddOnContent"}, - {700, nullptr, "PushDownloadTaskList"}, - {701, nullptr, "ClearTaskStatusList"}, - {702, nullptr, "RequestDownloadTaskList"}, - {703, nullptr, "RequestEnsureDownloadTask"}, - {704, nullptr, "ListDownloadTaskStatus"}, - {705, nullptr, "RequestDownloadTaskListData"}, - {800, nullptr, "RequestVersionList"}, - {801, nullptr, "ListVersionList"}, - {802, nullptr, "RequestVersionListData"}, - {900, nullptr, "GetApplicationRecord"}, - {901, nullptr, "GetApplicationRecordProperty"}, - {902, nullptr, "EnableApplicationAutoUpdate"}, - {903, nullptr, "DisableApplicationAutoUpdate"}, - {904, D<&IApplicationManagerInterface::TouchApplication>, "TouchApplication"}, - {905, nullptr, "RequestApplicationUpdate"}, - {906, D<&IApplicationManagerInterface::IsApplicationUpdateRequested>, "IsApplicationUpdateRequested"}, - {907, nullptr, "WithdrawApplicationUpdateRequest"}, - {908, nullptr, "ListApplicationRecordInstalledContentMeta"}, - {909, nullptr, "WithdrawCleanupAddOnContentsWithNoRightsRecommendation"}, - {910, nullptr, "HasApplicationRecord"}, - {911, nullptr, "SetPreInstalledApplication"}, - {912, nullptr, "ClearPreInstalledApplicationFlag"}, - {913, nullptr, "ListAllApplicationRecord"}, - {914, nullptr, "HideApplicationRecord"}, - {915, nullptr, "ShowApplicationRecord"}, - {916, nullptr, "IsApplicationAutoDeleteDisabled"}, - {916, nullptr, "Unknown916"}, //20.0.0+ - {917, nullptr, "Unknown917"}, //20.0.0+ - {918, nullptr, "Unknown918"}, //20.0.0+ - {919, nullptr, "Unknown919"}, //20.0.0+ - {920, nullptr, "Unknown920"}, //20.0.0+ - {921, nullptr, "Unknown921"}, //20.0.0+ - {922, nullptr, "Unknown922"}, //20.0.0+ - {923, nullptr, "Unknown923"}, //20.0.0+ - {928, nullptr, "Unknown928"}, //20.0.0+ - {929, nullptr, "Unknown929"}, //20.0.0+ - {930, nullptr, "Unknown930"}, //20.0.0+ - {931, nullptr, "Unknown931"}, //20.0.0+ - {933, nullptr, "Unknown933"}, //20.0.0+ - {934, nullptr, "Unknown934"}, //21.0.0+ - {935, nullptr, "Unknown935"}, //21.0.0+ - {936, D<&IApplicationManagerInterface::Unknown936>, "Unknown936"}, //21.0.0+ - {1000, nullptr, "RequestVerifyApplicationDeprecated"}, - {1001, nullptr, "CorruptApplicationForDebug"}, - {1002, nullptr, "RequestVerifyAddOnContentsRights"}, - {1003, nullptr, "RequestVerifyApplication"}, - {1004, nullptr, "CorruptContentForDebug"}, - {1200, nullptr, "NeedsUpdateVulnerability"}, - {1300, D<&IApplicationManagerInterface::IsAnyApplicationEntityInstalled>, "IsAnyApplicationEntityInstalled"}, - {1301, nullptr, "DeleteApplicationContentEntities"}, - {1302, nullptr, "CleanupUnrecordedApplicationEntity"}, - {1303, nullptr, "CleanupAddOnContentsWithNoRights"}, - {1304, nullptr, "DeleteApplicationContentEntity"}, - {1305, nullptr, "TryDeleteRunningApplicationEntity"}, - {1306, nullptr, "TryDeleteRunningApplicationCompletely"}, - {1307, nullptr, "TryDeleteRunningApplicationContentEntities"}, - {1308, nullptr, "DeleteApplicationCompletelyForDebug"}, - {1309, nullptr, "CleanupUnavailableAddOnContents"}, - {1310, nullptr, "RequestMoveApplicationEntity"}, - {1311, nullptr, "EstimateSizeToMove"}, - {1312, nullptr, "HasMovableEntity"}, - {1313, nullptr, "CleanupOrphanContents"}, - {1314, nullptr, "CheckPreconditionSatisfiedToMove"}, - {1400, nullptr, "PrepareShutdown"}, - {1500, nullptr, "FormatSdCard"}, - {1501, nullptr, "NeedsSystemUpdateToFormatSdCard"}, - {1502, nullptr, "GetLastSdCardFormatUnexpectedResult"}, - {1504, nullptr, "InsertSdCard"}, - {1505, nullptr, "RemoveSdCard"}, - {1506, nullptr, "GetSdCardStartupStatus"}, - {1508, nullptr, "Unknown1508"}, //20.0.0+ - {1509, nullptr, "Unknown1509"}, //20.0.0+ - {1510, nullptr, "Unknown1510"}, //20.0.0+ - {1511, nullptr, "Unknown1511"}, //20.0.0+ - {1512, nullptr, "Unknown1512"}, //20.0.0+ - {1600, nullptr, "GetSystemSeedForPseudoDeviceId"}, - {1601, nullptr, "ResetSystemSeedForPseudoDeviceId"}, - {1700, nullptr, "ListApplicationDownloadingContentMeta"}, - {1701, D<&IApplicationManagerInterface::GetApplicationViewDeprecated>, "GetApplicationViewDeprecated"}, - {1702, nullptr, "GetApplicationDownloadTaskStatus"}, - {1703, nullptr, "GetApplicationViewDownloadErrorContext"}, - {1704, D<&IApplicationManagerInterface::GetApplicationViewWithPromotionInfo>, "GetApplicationViewWithPromotionInfo"}, - {1705, nullptr, "IsPatchAutoDeletableApplication"}, - {1706, D<&IApplicationManagerInterface::GetApplicationView>, "GetApplicationView"}, - {1800, nullptr, "IsNotificationSetupCompleted"}, - {1801, nullptr, "GetLastNotificationInfoCount"}, - {1802, nullptr, "ListLastNotificationInfo"}, - {1803, nullptr, "ListNotificationTask"}, - {1900, nullptr, "IsActiveAccount"}, - {1901, nullptr, "RequestDownloadApplicationPrepurchasedRights"}, - {1902, nullptr, "GetApplicationTicketInfo"}, - {1903, nullptr, "RequestDownloadApplicationPrepurchasedRightsForAccount"}, - {2000, nullptr, "GetSystemDeliveryInfo"}, - {2001, nullptr, "SelectLatestSystemDeliveryInfo"}, - {2002, nullptr, "VerifyDeliveryProtocolVersion"}, - {2003, nullptr, "GetApplicationDeliveryInfo"}, - {2004, nullptr, "HasAllContentsToDeliver"}, - {2005, nullptr, "CompareApplicationDeliveryInfo"}, - {2006, nullptr, "CanDeliverApplication"}, - {2007, nullptr, "ListContentMetaKeyToDeliverApplication"}, - {2008, nullptr, "NeedsSystemUpdateToDeliverApplication"}, - {2009, nullptr, "EstimateRequiredSize"}, - {2010, nullptr, "RequestReceiveApplication"}, - {2011, nullptr, "CommitReceiveApplication"}, - {2012, nullptr, "GetReceiveApplicationProgress"}, - {2013, nullptr, "RequestSendApplication"}, - {2014, nullptr, "GetSendApplicationProgress"}, - {2015, nullptr, "CompareSystemDeliveryInfo"}, - {2016, nullptr, "ListNotCommittedContentMeta"}, - {2017, nullptr, "CreateDownloadTask"}, - {2018, nullptr, "GetApplicationDeliveryInfoHash"}, - {2019, nullptr, "Unknown2019"}, //20.0.0+ - {2050, D<&IApplicationManagerInterface::GetApplicationRightsOnClient>, "GetApplicationRightsOnClient"}, - {2051, nullptr, "InvalidateRightsIdCache"}, - {2052, nullptr, "Unknown2052"}, //20.0.0+ - {2053, nullptr, "Unknown2053"}, //20.0.0+ - {2100, D<&IApplicationManagerInterface::GetApplicationTerminateResult>, "GetApplicationTerminateResult"}, - {2101, nullptr, "GetRawApplicationTerminateResult"}, - {2150, nullptr, "CreateRightsEnvironment"}, - {2151, nullptr, "DestroyRightsEnvironment"}, - {2152, nullptr, "ActivateRightsEnvironment"}, - {2153, nullptr, "DeactivateRightsEnvironment"}, - {2154, nullptr, "ForceActivateRightsContextForExit"}, - {2155, nullptr, "UpdateRightsEnvironmentStatus"}, - {2156, nullptr, "CreateRightsEnvironmentForMicroApplication"}, - {2160, nullptr, "AddTargetApplicationToRightsEnvironment"}, - {2161, nullptr, "SetUsersToRightsEnvironment"}, - {2170, nullptr, "GetRightsEnvironmentStatus"}, - {2171, nullptr, "GetRightsEnvironmentStatusChangedEvent"}, - {2180, nullptr, "RequestExtendRightsInRightsEnvironment"}, - {2181, nullptr, "GetResultOfExtendRightsInRightsEnvironment"}, - {2182, nullptr, "SetActiveRightsContextUsingStateToRightsEnvironment"}, - {2183, nullptr, "Unknown2183"}, //20.1.0+ - {2190, nullptr, "GetRightsEnvironmentHandleForApplication"}, - {2199, nullptr, "GetRightsEnvironmentCountForDebug"}, - {2200, nullptr, "GetGameCardApplicationCopyIdentifier"}, - {2201, nullptr, "GetInstalledApplicationCopyIdentifier"}, - {2250, nullptr, "RequestReportActiveELicence"}, - {2300, nullptr, "ListEventLog"}, - {2350, nullptr, "PerformAutoUpdateByApplicationId"}, - {2351, nullptr, "RequestNoDownloadRightsErrorResolution"}, - {2352, nullptr, "RequestResolveNoDownloadRightsError"}, - {2353, nullptr, "GetApplicationDownloadTaskInfo"}, - {2354, nullptr, "PrioritizeApplicationBackgroundTask"}, - {2355, nullptr, "PreferStorageEfficientUpdate"}, - {2356, nullptr, "RequestStorageEfficientUpdatePreferable"}, - {2357, nullptr, "EnableMultiCoreDownload"}, - {2358, nullptr, "DisableMultiCoreDownload"}, - {2359, nullptr, "IsMultiCoreDownloadEnabled"}, - {2360, nullptr, "GetApplicationDownloadTaskCount"}, //19.0.0+ - {2361, nullptr, "GetMaxApplicationDownloadTaskCount"}, //19.0.0+ - {2362, nullptr, "Unknown2362"}, //20.0.0+ - {2363, nullptr, "Unknown2363"}, //20.0.0+ - {2364, nullptr, "Unknown2364"}, //20.0.0+ - {2365, nullptr, "Unknown2365"}, //20.0.0+ - {2366, nullptr, "Unknown2366"}, //20.0.0+ - {2367, nullptr, "Unknown2367"}, //20.0.0+ - {2368, nullptr, "Unknown2368"}, //20.0.0+ - {2369, nullptr, "Unknown2369"}, //21.0.0+ - {2400, nullptr, "GetPromotionInfo"}, - {2401, nullptr, "CountPromotionInfo"}, - {2402, nullptr, "ListPromotionInfo"}, - {2403, nullptr, "ImportPromotionJsonForDebug"}, - {2404, nullptr, "ClearPromotionInfoForDebug"}, - {2500, nullptr, "ConfirmAvailableTime"}, - {2510, nullptr, "CreateApplicationResource"}, - {2511, nullptr, "GetApplicationResource"}, - {2513, nullptr, "LaunchMicroApplication"}, - {2514, nullptr, "ClearTaskOfAsyncTaskManager"}, - {2515, nullptr, "CleanupAllPlaceHolderAndFragmentsIfNoTask"}, - {2516, nullptr, "EnsureApplicationCertificate"}, - {2517, nullptr, "CreateApplicationInstance"}, - {2518, nullptr, "UpdateQualificationForDebug"}, - {2519, nullptr, "IsQualificationTransitionSupported"}, - {2520, D<&IApplicationManagerInterface::IsQualificationTransitionSupportedByProcessId>, "IsQualificationTransitionSupportedByProcessId"}, - {2521, nullptr, "GetRightsUserChangedEvent"}, - {2522, nullptr, "IsRomRedirectionAvailable"}, - {2523, nullptr, "GetProgramId"}, //17.0.0+ - {2524, nullptr, "Unknown2524"}, //19.0.0+ - {2525, nullptr, "Unknown2525"}, //20.0.0+ - {2800, nullptr, "GetApplicationIdOfPreomia"}, - {3000, nullptr, "RegisterDeviceLockKey"}, - {3001, nullptr, "UnregisterDeviceLockKey"}, - {3002, nullptr, "VerifyDeviceLockKey"}, - {3003, nullptr, "HideApplicationIcon"}, - {3004, nullptr, "ShowApplicationIcon"}, - {3005, nullptr, "HideApplicationTitle"}, - {3006, nullptr, "ShowApplicationTitle"}, - {3007, nullptr, "EnableGameCard"}, - {3008, nullptr, "DisableGameCard"}, - {3009, nullptr, "EnableLocalContentShare"}, - {3010, nullptr, "DisableLocalContentShare"}, - {3011, nullptr, "IsApplicationIconHidden"}, - {3012, nullptr, "IsApplicationTitleHidden"}, - {3013, nullptr, "IsGameCardEnabled"}, - {3014, nullptr, "IsLocalContentShareEnabled"}, - {3050, nullptr, "ListAssignELicenseTaskResult"}, - {3104, nullptr, "GetApplicationNintendoLogo"}, //18.0.0+ - {3105, nullptr, "GetApplicationStartupMovie"}, //18.0.0+ - {4000, nullptr, "Unknown4000"}, //20.0.0+ - {4004, nullptr, "Unknown4004"}, //20.0.0+ - {4006, nullptr, "Unknown4006"}, //20.0.0+ - {4007, nullptr, "Unknown4007"}, //20.0.0+ - {4008, nullptr, "Unknown4008"}, //20.0.0+ - {4009, nullptr, "Unknown4009"}, //20.0.0+ - {4010, nullptr, "Unknown4010"}, //20.0.0+ - {4011, nullptr, "Unknown4011"}, //20.0.0+ - {4012, nullptr, "Unknown4012"}, //20.0.0+ - {4013, nullptr, "Unknown4013"}, //20.0.0+ - {4015, nullptr, "Unknown4015"}, //20.0.0+ - {4017, nullptr, "Unknown4017"}, //20.0.0+ - {4019, nullptr, "Unknown4019"}, //20.0.0+ - {4020, nullptr, "Unknown4020"}, //20.0.0+ - {4021, nullptr, "Unknown4021"}, //20.0.0+ - {4022, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4022"}, //20.0.0+ - {4023, D<&IApplicationManagerInterface::Unknown4023>, "Unknown4023"}, //20.0.0+ - {4024, nullptr, "Unknown4024"}, //20.0.0+ - {4025, nullptr, "Unknown4025"}, //20.0.0+ - {4026, nullptr, "Unknown4026"}, //20.0.0+ - {4027, nullptr, "Unknown4027"}, //20.0.0+ - {4028, nullptr, "Unknown4028"}, //20.0.0+ - {4029, nullptr, "Unknown4029"}, //20.0.0+ - {4030, nullptr, "Unknown4030"}, //20.0.0+ - {4031, nullptr, "Unknown4031"}, //20.0.0+ - {4032, nullptr, "Unknown4032"}, //20.0.0+ - {4033, nullptr, "Unknown4033"}, //20.0.0+ - {4034, nullptr, "Unknown4034"}, //20.0.0+ - {4035, nullptr, "Unknown4035"}, //20.0.0+ - {4037, nullptr, "Unknown4037"}, //20.0.0+ - {4038, nullptr, "Unknown4038"}, //20.0.0+ - {4039, nullptr, "Unknown4039"}, //20.0.0+ - {4040, nullptr, "Unknown4040"}, //20.0.0+ - {4041, nullptr, "Unknown4041"}, //20.0.0+ - {4042, D<&IApplicationManagerInterface::Unknown4042>, "Unknown4042"}, //20.0.0+ - {4043, nullptr, "Unknown4043"}, //20.0.0+ - {4044, nullptr, "Unknown4044"}, //20.0.0+ - {4045, nullptr, "Unknown4045"}, //20.0.0+ - {4046, nullptr, "Unknown4046"}, //20.0.0+ - {4049, nullptr, "Unknown4049"}, //20.0.0+ - {4050, nullptr, "Unknown4050"}, //20.0.0+ - {4051, nullptr, "Unknown4051"}, //20.0.0+ - {4052, nullptr, "Unknown4052"}, //20.0.0+ - {4053, D<&IApplicationManagerInterface::Unknown4053>, "Unknown4053"}, //20.0.0+ - {4054, nullptr, "Unknown4054"}, //20.0.0+ - {4055, nullptr, "Unknown4055"}, //20.0.0+ - {4056, nullptr, "Unknown4056"}, //20.0.0+ - {4057, nullptr, "Unknown4057"}, //20.0.0+ - {4058, nullptr, "Unknown4058"}, //20.0.0+ - {4059, nullptr, "Unknown4059"}, //20.0.0+ - {4060, nullptr, "Unknown4060"}, //20.0.0+ - {4061, nullptr, "Unknown4061"}, //20.0.0+ - {4062, nullptr, "Unknown4062"}, //20.0.0+ - {4063, nullptr, "Unknown4063"}, //20.0.0+ - {4064, nullptr, "Unknown4064"}, //20.0.0+ - {4065, nullptr, "Unknown4065"}, //20.0.0+ - {4066, nullptr, "Unknown4066"}, //20.0.0+ - {4067, nullptr, "Unknown4067"}, //20.0.0+ - {4068, nullptr, "Unknown4068"}, //20.0.0+ - {4069, nullptr, "Unknown4069"}, //20.0.0+ - {4070, nullptr, "Unknown4070"}, //20.0.0+ - {4071, nullptr, "Unknown4071"}, //20.0.0+ - {4072, nullptr, "Unknown4072"}, //20.0.0+ - {4073, nullptr, "Unknown4073"}, //20.0.0+ - {4074, nullptr, "Unknown4074"}, //20.0.0+ - {4075, nullptr, "Unknown4075"}, //20.0.0+ - {4076, nullptr, "Unknown4076"}, //20.0.0+ - {4077, nullptr, "Unknown4077"}, //20.0.0+ - {4078, nullptr, "Unknown4078"}, //20.0.0+ - {4079, nullptr, "Unknown4079"}, //20.0.0+ - {4080, nullptr, "Unknown4080"}, //20.0.0+ - {4081, nullptr, "Unknown4081"}, //20.0.0+ - {4083, nullptr, "Unknown4083"}, //20.0.0+ - {4084, nullptr, "Unknown4084"}, //20.0.0+ - {4085, nullptr, "Unknown4085"}, //20.0.0+ - {4086, nullptr, "Unknown4086"}, //20.0.0+ - {4087, nullptr, "Unknown4087"}, //20.0.0+ - {4088, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4088"}, //20.0.0+ - {4089, nullptr, "Unknown4089"}, //20.0.0+ - {4090, nullptr, "Unknown4090"}, //20.0.0+ - {4091, nullptr, "Unknown4091"}, //20.0.0+ - {4092, nullptr, "Unknown4092"}, //20.0.0+ - {4093, nullptr, "Unknown4093"}, //20.0.0+ - {4094, nullptr, "Unknown4094"}, //20.0.0+ - {4095, nullptr, "Unknown4095"}, //20.0.0+ - {4096, nullptr, "Unknown4096"}, //20.0.0+ - {4097, nullptr, "Unknown4097"}, //20.0.0+ - {4099, nullptr, "Unknown4099"}, //21.0.0+ - {4105, D<&IApplicationManagerInterface::Unknown4105>, "Unknown4105"}, //23.0.0+ - {5000, nullptr, "Unknown5000"}, //18.0.0+ - {5001, nullptr, "Unknown5001"}, //18.0.0+ - {9999, nullptr, "GetApplicationCertificate"}, //10.0.0-10.2.0 - }; - // clang-format on - - RegisterHandlers(functions); } IApplicationManagerInterface::~IApplicationManagerInterface() = default; diff --git a/src/core/hle/service/ns/application_manager_interface.h b/src/core/hle/service/ns/application_manager_interface.h index c4ca66f319..592068823c 100644 --- a/src/core/hle/service/ns/application_manager_interface.h +++ b/src/core/hle/service/ns/application_manager_interface.h @@ -85,6 +85,7 @@ public: void PushApplicationRecord(HLERequestContext& ctx); void ListApplicationTitle(HLERequestContext& ctx); void ListApplicationIcon(HLERequestContext& ctx); + std::optional FindRequest(u32 key) override; private: KernelHelpers::ServiceContext service_context; diff --git a/src/core/hle/service/ns/application_version_interface.cpp b/src/core/hle/service/ns/application_version_interface.cpp index b89e127dbe..e1e747f6d2 100644 --- a/src/core/hle/service/ns/application_version_interface.cpp +++ b/src/core/hle/service/ns/application_version_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,25 +10,6 @@ namespace Service::NS { IApplicationVersionInterface::IApplicationVersionInterface(Core::System& system_) : ServiceFramework{system_, "IApplicationVersionInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetLaunchRequiredVersion"}, - {1, nullptr, "UpgradeLaunchRequiredVersion"}, - {35, nullptr, "UpdateVersionList"}, - {36, nullptr, "PushLaunchVersion"}, - {37, nullptr, "ListRequiredVersion"}, - {800, nullptr, "RequestVersionList"}, - {801, nullptr, "ListVersionList"}, - {802, nullptr, "RequestVersionListData"}, - {900, nullptr, "ImportAutoUpdatePolicyJsonForDebug"}, - {901, nullptr, "ListDefaultAutoUpdatePolicy"}, - {902, nullptr, "ListAutoUpdatePolicyForSpecificApplication"}, - {1000, nullptr, "PerformAutoUpdate"}, - {1001, nullptr, "ListAutoUpdateSchedule"}, - }; - // clang-format on - - RegisterHandlers(functions); } IApplicationVersionInterface::~IApplicationVersionInterface() = default; diff --git a/src/core/hle/service/ns/application_version_interface.h b/src/core/hle/service/ns/application_version_interface.h index b288cff1be..c1f7710a00 100644 --- a/src/core/hle/service/ns/application_version_interface.h +++ b/src/core/hle/service/ns/application_version_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,6 +14,25 @@ class IApplicationVersionInterface final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetLaunchRequiredVersion"}, + FunctionInfo{1, nullptr, "UpgradeLaunchRequiredVersion"}, + FunctionInfo{35, nullptr, "UpdateVersionList"}, + FunctionInfo{36, nullptr, "PushLaunchVersion"}, + FunctionInfo{37, nullptr, "ListRequiredVersion"}, + FunctionInfo{800, nullptr, "RequestVersionList"}, + FunctionInfo{801, nullptr, "ListVersionList"}, + FunctionInfo{802, nullptr, "RequestVersionListData"}, + FunctionInfo{900, nullptr, "ImportAutoUpdatePolicyJsonForDebug"}, + FunctionInfo{901, nullptr, "ListDefaultAutoUpdatePolicy"}, + FunctionInfo{902, nullptr, "ListAutoUpdatePolicyForSpecificApplication"}, + FunctionInfo{1000, nullptr, "PerformAutoUpdate"}, + FunctionInfo{1001, nullptr, "ListAutoUpdateSchedule"} + ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/async_result.cpp b/src/core/hle/service/ns/async_result.cpp index 8617280bef..d93c510141 100644 --- a/src/core/hle/service/ns/async_result.cpp +++ b/src/core/hle/service/ns/async_result.cpp @@ -8,17 +8,17 @@ namespace Service::NS { +std::optional IAsyncResult::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Get"}, + FunctionInfo{1, D<&IAsyncResult::Cancel>, "Cancel"}, + FunctionInfo{2, nullptr, "GetErrorContext", MakeVersionGate({4,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IAsyncResult::IAsyncResult(Core::System& system_, Service::Event* event_) : ServiceFramework{system_, "nn::ns::detail::IAsyncResult"}, event{event_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Get"}, - {1, D<&IAsyncResult::Cancel>, "Cancel"}, - {2, nullptr, "GetErrorContext"}, // 4.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } IAsyncResult::~IAsyncResult() = default; diff --git a/src/core/hle/service/ns/async_result.h b/src/core/hle/service/ns/async_result.h index 914ea5a42c..1cad75bf47 100644 --- a/src/core/hle/service/ns/async_result.h +++ b/src/core/hle/service/ns/async_result.h @@ -13,6 +13,7 @@ public: private: Result Cancel(); + std::optional FindRequest(u32 key) override; Service::Event* event{}; }; diff --git a/src/core/hle/service/ns/content_management_interface.cpp b/src/core/hle/service/ns/content_management_interface.cpp index 39b9cb6f70..45922ffab3 100644 --- a/src/core/hle/service/ns/content_management_interface.cpp +++ b/src/core/hle/service/ns/content_management_interface.cpp @@ -15,22 +15,6 @@ namespace Service::NS { IContentManagementInterface::IContentManagementInterface(Core::System& system_) : ServiceFramework{system_, "IContentManagementInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {11, D<&IContentManagementInterface::CalculateApplicationOccupiedSize>, "CalculateApplicationOccupiedSize"}, - {43, D<&IContentManagementInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, - {47, D<&IContentManagementInterface::GetTotalSpaceSize>, "GetTotalSpaceSize"}, - {48, D<&IContentManagementInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, - {71, D<&IContentManagementInterface::GetUnknown71>, "Unknown71"}, - {600, nullptr, "CountApplicationContentMeta"}, - {601, nullptr, "ListApplicationContentMetaStatus"}, - {605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, - {607, nullptr, "IsAnyApplicationRunning"}, - {608, nullptr, "Unknown608"}, //21.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } IContentManagementInterface::~IContentManagementInterface() = default; diff --git a/src/core/hle/service/ns/content_management_interface.h b/src/core/hle/service/ns/content_management_interface.h index df0c51a184..bddd044b45 100644 --- a/src/core/hle/service/ns/content_management_interface.h +++ b/src/core/hle/service/ns/content_management_interface.h @@ -24,6 +24,22 @@ public: Result GetTotalSpaceSize(Out out_total_space_size, FileSys::StorageId storage_id); Result GetFreeSpaceSize(Out out_free_space_size, FileSys::StorageId storage_id); Result GetUnknown71(Out out_value_a, Out out_value_b, u8 flag); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{11, D<&IContentManagementInterface::CalculateApplicationOccupiedSize>, "CalculateApplicationOccupiedSize"}, + FunctionInfo{43, D<&IContentManagementInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, + FunctionInfo{47, D<&IContentManagementInterface::GetTotalSpaceSize>, "GetTotalSpaceSize"}, + FunctionInfo{48, D<&IContentManagementInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, + FunctionInfo{71, D<&IContentManagementInterface::GetUnknown71>, "Unknown71"}, + FunctionInfo{600, nullptr, "CountApplicationContentMeta"}, + FunctionInfo{601, nullptr, "ListApplicationContentMetaStatus"}, + FunctionInfo{605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, + FunctionInfo{607, nullptr, "IsAnyApplicationRunning"}, + FunctionInfo{608, nullptr, "Unknown608", MakeVersionGate({21,0,0})} + ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/develop_interface.cpp b/src/core/hle/service/ns/develop_interface.cpp index 880bdbebbf..2fc41cd7dd 100644 --- a/src/core/hle/service/ns/develop_interface.cpp +++ b/src/core/hle/service/ns/develop_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -6,31 +9,6 @@ namespace Service::NS { IDevelopInterface::IDevelopInterface(Core::System& system_) : ServiceFramework{system_, "ns:dev"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "LaunchProgram"}, - {1, nullptr, "TerminateProcess"}, - {2, nullptr, "TerminateProgram"}, - {4, nullptr, "GetShellEvent"}, - {5, nullptr, "GetShellEventInfo"}, - {6, nullptr, "TerminateApplication"}, - {7, nullptr, "PrepareLaunchProgramFromHost"}, - {8, nullptr, "LaunchApplicationFromHost"}, - {9, nullptr, "LaunchApplicationWithStorageIdForDevelop"}, - {10, nullptr, "IsSystemMemoryResourceLimitBoosted"}, - {11, nullptr, "GetRunningApplicationProcessIdForDevelop"}, - {12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop"}, - {13, nullptr, "CreateApplicationResourceForDevelop"}, - {14, nullptr, "IsPreomiaForDevelop"}, - {15, nullptr, "GetApplicationProgramIdFromHost"}, - {16, nullptr, "RefreshCachedDebugValues"}, - {17, nullptr, "PrepareLaunchApplicationFromHost"}, - {18, nullptr, "GetLaunchEvent"}, - {19, nullptr, "GetLaunchResult"}, - }; - // clang-format on - - RegisterHandlers(functions); } IDevelopInterface::~IDevelopInterface() = default; diff --git a/src/core/hle/service/ns/develop_interface.h b/src/core/hle/service/ns/develop_interface.h index a9f81ccd60..55e54fa38d 100644 --- a/src/core/hle/service/ns/develop_interface.h +++ b/src/core/hle/service/ns/develop_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,6 +14,31 @@ class IDevelopInterface final : public ServiceFramework { public: explicit IDevelopInterface(Core::System& system_); ~IDevelopInterface() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "LaunchProgram"}, + FunctionInfo{1, nullptr, "TerminateProcess"}, + FunctionInfo{2, nullptr, "TerminateProgram"}, + FunctionInfo{4, nullptr, "GetShellEvent"}, + FunctionInfo{5, nullptr, "GetShellEventInfo"}, + FunctionInfo{6, nullptr, "TerminateApplication"}, + FunctionInfo{7, nullptr, "PrepareLaunchProgramFromHost"}, + FunctionInfo{8, nullptr, "LaunchApplicationFromHost"}, + FunctionInfo{9, nullptr, "LaunchApplicationWithStorageIdForDevelop"}, + FunctionInfo{10, nullptr, "IsSystemMemoryResourceLimitBoosted"}, + FunctionInfo{11, nullptr, "GetRunningApplicationProcessIdForDevelop"}, + FunctionInfo{12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop"}, + FunctionInfo{13, nullptr, "CreateApplicationResourceForDevelop"}, + FunctionInfo{14, nullptr, "IsPreomiaForDevelop"}, + FunctionInfo{15, nullptr, "GetApplicationProgramIdFromHost"}, + FunctionInfo{16, nullptr, "RefreshCachedDebugValues"}, + FunctionInfo{17, nullptr, "PrepareLaunchApplicationFromHost"}, + FunctionInfo{18, nullptr, "GetLaunchEvent"}, + FunctionInfo{19, nullptr, "GetLaunchResult"} + ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/document_interface.cpp b/src/core/hle/service/ns/document_interface.cpp index 51a1e46c0d..f9a1e2267a 100644 --- a/src/core/hle/service/ns/document_interface.cpp +++ b/src/core/hle/service/ns/document_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -9,15 +12,6 @@ namespace Service::NS { IDocumentInterface::IDocumentInterface(Core::System& system_) : ServiceFramework{system_, "IDocumentInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {21, nullptr, "GetApplicationContentPath"}, - {23, D<&IDocumentInterface::ResolveApplicationContentPath>, "ResolveApplicationContentPath"}, - {92, D<&IDocumentInterface::GetRunningApplicationProgramId>, "GetRunningApplicationProgramId"}, - }; - // clang-format on - - RegisterHandlers(functions); } IDocumentInterface::~IDocumentInterface() = default; diff --git a/src/core/hle/service/ns/document_interface.h b/src/core/hle/service/ns/document_interface.h index cd461652cf..43a194c3e6 100644 --- a/src/core/hle/service/ns/document_interface.h +++ b/src/core/hle/service/ns/document_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -17,6 +20,15 @@ public: private: Result ResolveApplicationContentPath(ContentPath content_path); Result GetRunningApplicationProgramId(Out out_program_id, u64 caller_program_id); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{21, nullptr, "GetApplicationContentPath"}, + FunctionInfo{23, D<&IDocumentInterface::ResolveApplicationContentPath>, "ResolveApplicationContentPath"}, + FunctionInfo{92, D<&IDocumentInterface::GetRunningApplicationProgramId>, "GetRunningApplicationProgramId"} + ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/download_task_interface.cpp b/src/core/hle/service/ns/download_task_interface.cpp index 62dc7f1874..9fe6ca512f 100644 --- a/src/core/hle/service/ns/download_task_interface.cpp +++ b/src/core/hle/service/ns/download_task_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -8,21 +11,6 @@ namespace Service::NS { IDownloadTaskInterface::IDownloadTaskInterface(Core::System& system_) : ServiceFramework{system_, "IDownloadTaskInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {701, nullptr, "ClearTaskStatusList"}, - {702, nullptr, "RequestDownloadTaskList"}, - {703, nullptr, "RequestEnsureDownloadTask"}, - {704, nullptr, "ListDownloadTaskStatus"}, - {705, nullptr, "RequestDownloadTaskListData"}, - {706, nullptr, "TryCommitCurrentApplicationDownloadTask"}, - {707, D<&IDownloadTaskInterface::EnableAutoCommit>, "EnableAutoCommit"}, - {708, D<&IDownloadTaskInterface::DisableAutoCommit>, "DisableAutoCommit"}, - {709, nullptr, "TriggerDynamicCommitEvent"}, - }; - // clang-format on - - RegisterHandlers(functions); } IDownloadTaskInterface::~IDownloadTaskInterface() = default; diff --git a/src/core/hle/service/ns/download_task_interface.h b/src/core/hle/service/ns/download_task_interface.h index b1cb69cb86..0fd2bacd42 100644 --- a/src/core/hle/service/ns/download_task_interface.h +++ b/src/core/hle/service/ns/download_task_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,21 @@ public: private: Result EnableAutoCommit(); Result DisableAutoCommit(); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{701, nullptr, "ClearTaskStatusList"}, + FunctionInfo{702, nullptr, "RequestDownloadTaskList"}, + FunctionInfo{703, nullptr, "RequestEnsureDownloadTask"}, + FunctionInfo{704, nullptr, "ListDownloadTaskStatus"}, + FunctionInfo{705, nullptr, "RequestDownloadTaskListData"}, + FunctionInfo{706, nullptr, "TryCommitCurrentApplicationDownloadTask"}, + FunctionInfo{707, D<&IDownloadTaskInterface::EnableAutoCommit>, "EnableAutoCommit"}, + FunctionInfo{708, D<&IDownloadTaskInterface::DisableAutoCommit>, "DisableAutoCommit"}, + FunctionInfo{709, nullptr, "TriggerDynamicCommitEvent"} + ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/dynamic_rights_interface.cpp b/src/core/hle/service/ns/dynamic_rights_interface.cpp index 0301085670..951ef4c4b2 100644 --- a/src/core/hle/service/ns/dynamic_rights_interface.cpp +++ b/src/core/hle/service/ns/dynamic_rights_interface.cpp @@ -9,43 +9,43 @@ namespace Service::NS { +std::optional IDynamicRightsInterface::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestApplicationRightsOnServer"}, + FunctionInfo{1, nullptr, "RequestAssignRights"}, + FunctionInfo{4, nullptr, "DeprecatedRequestAssignRightsToResume"}, + FunctionInfo{5, D<&IDynamicRightsInterface::VerifyActivatedRightsOwners>, "VerifyActivatedRightsOwners"}, + FunctionInfo{6, nullptr, "DeprecatedGetApplicationRightsStatus"}, + FunctionInfo{7, nullptr, "RequestPrefetchForDynamicRights"}, + FunctionInfo{8, nullptr, "GetDynamicRightsState"}, + FunctionInfo{9, nullptr, "RequestApplicationRightsOnServerToResume"}, + FunctionInfo{10, nullptr, "RequestAssignRightsToResume"}, + FunctionInfo{11, nullptr, "GetActivatedRightsUsers"}, + FunctionInfo{12, nullptr, "GetApplicationRightsStatus"}, + FunctionInfo{13, D<&IDynamicRightsInterface::GetRunningApplicationStatus>, "GetRunningApplicationStatus"}, + FunctionInfo{14, nullptr, "SelectApplicationLicense"}, + FunctionInfo{15, nullptr, "RequestContentsAuthorizationToken"}, + FunctionInfo{16, nullptr, "QualifyUser"}, + FunctionInfo{17, nullptr, "QualifyUserWithProcessId"}, + FunctionInfo{18, D<&IDynamicRightsInterface::NotifyApplicationRightsCheckStart>, "NotifyApplicationRightsCheckStart"}, + FunctionInfo{19, nullptr, "UpdateUserList"}, + FunctionInfo{20, nullptr, "IsRightsLostUser"}, + FunctionInfo{21, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, + FunctionInfo{22, nullptr, "GetLimitedApplicationLicense"}, + FunctionInfo{23, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, + FunctionInfo{24, nullptr, "NotifyLimitedApplicationLicenseUpgradableEventForDebug"}, + FunctionInfo{25, nullptr, "RequestProceedDynamicRightsState"}, + FunctionInfo{26, D<&IDynamicRightsInterface::HasAccountRestrictedRightsInRunningApplications>, "HasAccountRestrictedRightsInRunningApplications"}, + FunctionInfo{27, nullptr, "Unknown27", MakeVersionGate({20,0,0})}, + FunctionInfo{28, nullptr, "Unknown28", MakeVersionGate({20,0,0})}, + FunctionInfo{29, nullptr, "Unknown29", MakeVersionGate({21,0,0})}, + FunctionInfo{30, nullptr, "Unknown30", MakeVersionGate({21,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IDynamicRightsInterface::IDynamicRightsInterface(Core::System& system_) : ServiceFramework{system_, "DynamicRightsInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestApplicationRightsOnServer"}, - {1, nullptr, "RequestAssignRights"}, - {4, nullptr, "DeprecatedRequestAssignRightsToResume"}, - {5, D<&IDynamicRightsInterface::VerifyActivatedRightsOwners>, "VerifyActivatedRightsOwners"}, - {6, nullptr, "DeprecatedGetApplicationRightsStatus"}, - {7, nullptr, "RequestPrefetchForDynamicRights"}, - {8, nullptr, "GetDynamicRightsState"}, - {9, nullptr, "RequestApplicationRightsOnServerToResume"}, - {10, nullptr, "RequestAssignRightsToResume"}, - {11, nullptr, "GetActivatedRightsUsers"}, - {12, nullptr, "GetApplicationRightsStatus"}, - {13, D<&IDynamicRightsInterface::GetRunningApplicationStatus>, "GetRunningApplicationStatus"}, - {14, nullptr, "SelectApplicationLicense"}, - {15, nullptr, "RequestContentsAuthorizationToken"}, - {16, nullptr, "QualifyUser"}, - {17, nullptr, "QualifyUserWithProcessId"}, - {18, D<&IDynamicRightsInterface::NotifyApplicationRightsCheckStart>, "NotifyApplicationRightsCheckStart"}, - {19, nullptr, "UpdateUserList"}, - {20, nullptr, "IsRightsLostUser"}, - {21, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, - {22, nullptr, "GetLimitedApplicationLicense"}, - {23, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, - {24, nullptr, "NotifyLimitedApplicationLicenseUpgradableEventForDebug"}, - {25, nullptr, "RequestProceedDynamicRightsState"}, - {26, D<&IDynamicRightsInterface::HasAccountRestrictedRightsInRunningApplications>, "HasAccountRestrictedRightsInRunningApplications"}, - {27, nullptr, "Unknown27"}, //20.0.0+ - {28, nullptr, "Unknown28"}, //20.0.0+ - {29, nullptr, "Unknown29"}, //21.0.0+ - {30, nullptr, "Unknown30"}, //21.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } IDynamicRightsInterface::~IDynamicRightsInterface() = default; diff --git a/src/core/hle/service/ns/dynamic_rights_interface.h b/src/core/hle/service/ns/dynamic_rights_interface.h index c3270aee05..e8a1d81491 100644 --- a/src/core/hle/service/ns/dynamic_rights_interface.h +++ b/src/core/hle/service/ns/dynamic_rights_interface.h @@ -21,6 +21,8 @@ private: Result GetRunningApplicationStatus(Out out_status, u64 rights_handle); Result VerifyActivatedRightsOwners(u64 rights_handle); Result HasAccountRestrictedRightsInRunningApplications(Out out_is_restricted); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/ecommerce_interface.cpp b/src/core/hle/service/ns/ecommerce_interface.cpp index 76fc425f0c..5687d09a02 100644 --- a/src/core/hle/service/ns/ecommerce_interface.cpp +++ b/src/core/hle/service/ns/ecommerce_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,19 +10,6 @@ namespace Service::NS { IECommerceInterface::IECommerceInterface(Core::System& system_) : ServiceFramework{system_, "IECommerceInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RequestLinkDevice"}, - {1, nullptr, "RequestCleanupAllPreInstalledApplications"}, - {2, nullptr, "RequestCleanupPreInstalledApplication"}, - {3, nullptr, "RequestSyncRights"}, - {4, nullptr, "RequestUnlinkDevice"}, - {5, nullptr, "RequestRevokeAllELicense"}, - {6, nullptr, "RequestSyncRightsBasedOnAssignedELicenses"}, - }; - // clang-format on - - RegisterHandlers(functions); } IECommerceInterface::~IECommerceInterface() = default; diff --git a/src/core/hle/service/ns/ecommerce_interface.h b/src/core/hle/service/ns/ecommerce_interface.h index 4352101f4a..d020ff5ef8 100644 --- a/src/core/hle/service/ns/ecommerce_interface.h +++ b/src/core/hle/service/ns/ecommerce_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,6 +14,19 @@ class IECommerceInterface final : public ServiceFramework { public: explicit IECommerceInterface(Core::System& system_); ~IECommerceInterface() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RequestLinkDevice"}, + FunctionInfo{1, nullptr, "RequestCleanupAllPreInstalledApplications"}, + FunctionInfo{2, nullptr, "RequestCleanupPreInstalledApplication"}, + FunctionInfo{3, nullptr, "RequestSyncRights"}, + FunctionInfo{4, nullptr, "RequestUnlinkDevice"}, + FunctionInfo{5, nullptr, "RequestRevokeAllELicense"}, + FunctionInfo{6, nullptr, "RequestSyncRightsBasedOnAssignedELicenses"} + ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/factory_reset_interface.cpp b/src/core/hle/service/ns/factory_reset_interface.cpp index fd5cf7e1fd..1fc6edcc9b 100644 --- a/src/core/hle/service/ns/factory_reset_interface.cpp +++ b/src/core/hle/service/ns/factory_reset_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -5,21 +8,21 @@ namespace Service::NS { +std::optional IFactoryResetInterface::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{100, nullptr, "ResetToFactorySettings"}, + FunctionInfo{101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, + FunctionInfo{102, nullptr, "ResetToFactorySettingsForRefurbishment"}, + FunctionInfo{103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, + FunctionInfo{104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, + FunctionInfo{105, nullptr, "RequestResetToFactorySettingsSecurely"}, + FunctionInfo{106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IFactoryResetInterface::IFactoryResetInterface(Core::System& system_) : ServiceFramework{system_, "IFactoryResetInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {100, nullptr, "ResetToFactorySettings"}, - {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, - {102, nullptr, "ResetToFactorySettingsForRefurbishment"}, - {103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, - {104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, - {105, nullptr, "RequestResetToFactorySettingsSecurely"}, - {106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, - }; - // clang-format on - - RegisterHandlers(functions); } IFactoryResetInterface::~IFactoryResetInterface() = default; diff --git a/src/core/hle/service/ns/factory_reset_interface.h b/src/core/hle/service/ns/factory_reset_interface.h index 50d1251239..3d5700fb71 100644 --- a/src/core/hle/service/ns/factory_reset_interface.h +++ b/src/core/hle/service/ns/factory_reset_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,6 +14,7 @@ class IFactoryResetInterface final : public ServiceFramework FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index fe057422ce..ff1654517b 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp @@ -19,25 +19,25 @@ namespace Service::NS { class INotifyService final : public ServiceFramework { public: - explicit INotifyService(Core::System& system_) : ServiceFramework{system_, "pdm:ntfy"} { - // clang-format off - static const FunctionInfo functions[] = { - { 0, nullptr, "NotifyAppletEvent" }, - { 2, nullptr, "NotifyOperationModeChangeEvent" }, - { 3, nullptr, "NotifyPowerStateChangeEvent" }, - { 4, nullptr, "NotifyClearAllEvent" }, - { 5, nullptr, "NotifyEventForDebug" }, - { 6, nullptr, "SuspendUserAccountEventService" }, - { 7, nullptr, "ResumeUserAccountEventService" }, - { 8, nullptr, "NotifyLibraryAppletEvent" }, - { 9, nullptr, "Cmd9" }, - { 20, nullptr, "Cmd20" }, - { 30, nullptr, "Cmd30" }, - { 100, nullptr, "Cmd100" }, - { 101, nullptr, "Cmd101" }, - }; - // clang-format on - RegisterHandlers(functions); + explicit INotifyService(Core::System& system_) : ServiceFramework{system_, "pdm:ntfy"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "NotifyAppletEvent" }, + FunctionInfo{2, nullptr, "NotifyOperationModeChangeEvent" }, + FunctionInfo{3, nullptr, "NotifyPowerStateChangeEvent" }, + FunctionInfo{4, nullptr, "NotifyClearAllEvent" }, + FunctionInfo{5, nullptr, "NotifyEventForDebug" }, + FunctionInfo{6, nullptr, "SuspendUserAccountEventService" }, + FunctionInfo{7, nullptr, "ResumeUserAccountEventService" }, + FunctionInfo{8, nullptr, "NotifyLibraryAppletEvent" }, + FunctionInfo{9, nullptr, "Cmd9" }, + FunctionInfo{20, nullptr, "Cmd20" }, + FunctionInfo{30, nullptr, "Cmd30" }, + FunctionInfo{100, nullptr, "Cmd100" }, + FunctionInfo{101, nullptr, "Cmd101" } + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; @@ -45,18 +45,10 @@ class IVulnerabilityManagerInterface final : public ServiceFramework { public: explicit IVulnerabilityManagerInterface(Core::System& system_) - : ServiceFramework{system_, "ns:vm"} { - // clang-format off - static const FunctionInfo functions[] = { - {1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"}, - {1201, nullptr, "UpdateSafeSystemVersionForDebug"}, - {1202, nullptr, "GetSafeSystemVersion"}, - {3100, D<&IVulnerabilityManagerInterface::GetSafeSystemVersionCheckInfo>, "GetSafeSystemVersionCheckInfo"}, - {3101, nullptr, "RequestUpdateSafeSystemVersionCheckInfo"}, - {3102, D<&IVulnerabilityManagerInterface::ResetSafeSystemVersionCheckInfo>, "ResetSafeSystemVersionCheckInfo"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "ns:vm"} {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } ~IVulnerabilityManagerInterface() override = default; @@ -76,6 +68,15 @@ public: LOG_WARNING(Service_NS, "(STUBBED)"); R_SUCCEED(); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"}, + FunctionInfo{1201, nullptr, "UpdateSafeSystemVersionForDebug"}, + FunctionInfo{1202, nullptr, "GetSafeSystemVersion"}, + FunctionInfo{3100, D<&IVulnerabilityManagerInterface::GetSafeSystemVersionCheckInfo>, "GetSafeSystemVersionCheckInfo"}, + FunctionInfo{3101, nullptr, "RequestUpdateSafeSystemVersionCheckInfo"}, + FunctionInfo{3102, D<&IVulnerabilityManagerInterface::ResetSafeSystemVersionCheckInfo>, "ResetSafeSystemVersionCheckInfo"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/ns/platform_service_manager.cpp b/src/core/hle/service/ns/platform_service_manager.cpp index bf93a2edfa..dea6cb5c16 100644 --- a/src/core/hle/service/ns/platform_service_manager.cpp +++ b/src/core/hle/service/ns/platform_service_manager.cpp @@ -27,6 +27,28 @@ namespace Service::NS { +std::optional IPlatformServiceManager::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IPlatformServiceManager::RequestLoad>, "RequestLoad"}, + FunctionInfo{1, D<&IPlatformServiceManager::GetLoadState>, "GetLoadState"}, + FunctionInfo{2, D<&IPlatformServiceManager::GetSize>, "GetSize"}, + FunctionInfo{3, D<&IPlatformServiceManager::GetSharedMemoryAddressOffset>, "GetSharedMemoryAddressOffset"}, + FunctionInfo{4, D<&IPlatformServiceManager::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, + FunctionInfo{5, D<&IPlatformServiceManager::GetSharedFontInOrderOfPriority>, "GetSharedFontInOrderOfPriority"}, + FunctionInfo{6, D<&IPlatformServiceManager::GetSharedFontInOrderOfPriority>, "GetSharedFontInOrderOfPriorityForSystem"}, + FunctionInfo{100, nullptr, "RequestApplicationFunctionAuthorization"}, + FunctionInfo{101, nullptr, "RequestApplicationFunctionAuthorizationByProcessId"}, + FunctionInfo{102, nullptr, "RequestApplicationFunctionAuthorizationByApplicationId"}, + FunctionInfo{103, nullptr, "RefreshApplicationFunctionBlackListDebugRecord"}, + FunctionInfo{104, nullptr, "RequestApplicationFunctionAuthorizationByProgramId"}, + FunctionInfo{105, nullptr, "GetFunctionBlackListSystemVersionToAuthorize"}, + FunctionInfo{106, nullptr, "GetFunctionBlackListVersion"}, + FunctionInfo{1000, nullptr, "LoadNgWordDataForPlatformRegionChina"}, + FunctionInfo{1001, nullptr, "GetNgWordDataSizeForPlatformRegionChina"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + struct FontRegion { u32 offset; u32 size; @@ -89,28 +111,6 @@ struct IPlatformServiceManager::Impl { IPlatformServiceManager::IPlatformServiceManager(Core::System& system_, const char* service_name_) : ServiceFramework{system_, service_name_}, impl{std::make_unique()} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IPlatformServiceManager::RequestLoad>, "RequestLoad"}, - {1, D<&IPlatformServiceManager::GetLoadState>, "GetLoadState"}, - {2, D<&IPlatformServiceManager::GetSize>, "GetSize"}, - {3, D<&IPlatformServiceManager::GetSharedMemoryAddressOffset>, "GetSharedMemoryAddressOffset"}, - {4, D<&IPlatformServiceManager::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, - {5, D<&IPlatformServiceManager::GetSharedFontInOrderOfPriority>, "GetSharedFontInOrderOfPriority"}, - {6, D<&IPlatformServiceManager::GetSharedFontInOrderOfPriority>, "GetSharedFontInOrderOfPriorityForSystem"}, - {100, nullptr, "RequestApplicationFunctionAuthorization"}, - {101, nullptr, "RequestApplicationFunctionAuthorizationByProcessId"}, - {102, nullptr, "RequestApplicationFunctionAuthorizationByApplicationId"}, - {103, nullptr, "RefreshApplicationFunctionBlackListDebugRecord"}, - {104, nullptr, "RequestApplicationFunctionAuthorizationByProgramId"}, - {105, nullptr, "GetFunctionBlackListSystemVersionToAuthorize"}, - {106, nullptr, "GetFunctionBlackListVersion"}, - {1000, nullptr, "LoadNgWordDataForPlatformRegionChina"}, - {1001, nullptr, "GetNgWordDataSizeForPlatformRegionChina"}, - }; - // clang-format on - RegisterHandlers(functions); - auto& fsc = system.GetFileSystemController(); // Attempt to load shared font data from disk diff --git a/src/core/hle/service/ns/platform_service_manager.h b/src/core/hle/service/ns/platform_service_manager.h index b82c385a6c..fb99a441f5 100644 --- a/src/core/hle/service/ns/platform_service_manager.h +++ b/src/core/hle/service/ns/platform_service_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -65,11 +68,12 @@ private: Result GetSharedMemoryNativeHandle( OutCopyHandle out_shared_memory_native_handle); Result GetSharedFontInOrderOfPriority(OutArray out_font_codes, - OutArray out_font_offsets, - OutArray out_font_sizes, - Out out_fonts_are_loaded, Out out_font_count, - Set::LanguageCode language_code); + OutArray out_font_offsets, + OutArray out_font_sizes, + Out out_fonts_are_loaded, Out out_font_count, + Set::LanguageCode language_code); + std::optional FindRequest(u32 key) override; struct Impl; std::unique_ptr impl; }; diff --git a/src/core/hle/service/ns/query_service.cpp b/src/core/hle/service/ns/query_service.cpp index d22de1d169..13a1f33866 100644 --- a/src/core/hle/service/ns/query_service.cpp +++ b/src/core/hle/service/ns/query_service.cpp @@ -14,40 +14,40 @@ namespace Service::NS { +std::optional IQueryService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "QueryAppletEvent"}, + FunctionInfo{1, nullptr, "QueryPlayStatistics"}, + FunctionInfo{2, nullptr, "QueryPlayStatisticsByUserAccountId"}, + FunctionInfo{3, nullptr, "QueryPlayStatisticsByNetworkServiceAccountId"}, + FunctionInfo{4, nullptr, "QueryPlayStatisticsByApplicationId"}, + FunctionInfo{5, D<&IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId>, "QueryPlayStatisticsByApplicationIdAndUserAccountId"}, + FunctionInfo{6, nullptr, "QueryPlayStatisticsByApplicationIdAndNetworkServiceAccountId"}, + FunctionInfo{7, nullptr, "QueryLastPlayTimeV0"}, + FunctionInfo{8, nullptr, "QueryPlayEvent"}, + FunctionInfo{9, nullptr, "GetAvailablePlayEventRange"}, + FunctionInfo{10, nullptr, "QueryAccountEvent"}, + FunctionInfo{11, nullptr, "QueryAccountPlayEvent"}, + FunctionInfo{12, nullptr, "GetAvailableAccountPlayEventRange"}, + FunctionInfo{13, nullptr, "QueryApplicationPlayStatisticsForSystemV0"}, + FunctionInfo{14, nullptr, "QueryRecentlyPlayedApplication"}, + FunctionInfo{15, nullptr, "GetRecentlyPlayedApplicationUpdateEvent"}, + FunctionInfo{16, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystemV0"}, + FunctionInfo{17, D<&IQueryService::QueryLastPlayTime>, "QueryLastPlayTime"}, + FunctionInfo{18, D<&IQueryService::QueryApplicationPlayStatisticsForSystem>, "QueryApplicationPlayStatisticsForSystem"}, + FunctionInfo{19, D<&IQueryService::QueryApplicationPlayStatisticsByUserAccountIdForSystem>, "QueryApplicationPlayStatisticsByUserAccountIdForSystem"}, + FunctionInfo{30, nullptr, "Cmd30" }, + FunctionInfo{31, nullptr, "Cmd31" }, + FunctionInfo{100, nullptr, "Cmd100" }, + FunctionInfo{110, nullptr, "Cmd110" }, + FunctionInfo{118, nullptr, "Cmd118" }, + FunctionInfo{119, nullptr, "Cmd119" } + ); + return HandlerTableGenerateWithFind(key, functions); +} + IQueryService::IQueryService(Core::System& system_) : ServiceFramework{system_, "pdm:qry"}, play_time_manager{std::make_unique()} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "QueryAppletEvent"}, - {1, nullptr, "QueryPlayStatistics"}, - {2, nullptr, "QueryPlayStatisticsByUserAccountId"}, - {3, nullptr, "QueryPlayStatisticsByNetworkServiceAccountId"}, - {4, nullptr, "QueryPlayStatisticsByApplicationId"}, - {5, D<&IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId>, "QueryPlayStatisticsByApplicationIdAndUserAccountId"}, - {6, nullptr, "QueryPlayStatisticsByApplicationIdAndNetworkServiceAccountId"}, - {7, nullptr, "QueryLastPlayTimeV0"}, - {8, nullptr, "QueryPlayEvent"}, - {9, nullptr, "GetAvailablePlayEventRange"}, - {10, nullptr, "QueryAccountEvent"}, - {11, nullptr, "QueryAccountPlayEvent"}, - {12, nullptr, "GetAvailableAccountPlayEventRange"}, - {13, nullptr, "QueryApplicationPlayStatisticsForSystemV0"}, - {14, nullptr, "QueryRecentlyPlayedApplication"}, - {15, nullptr, "GetRecentlyPlayedApplicationUpdateEvent"}, - {16, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystemV0"}, - {17, D<&IQueryService::QueryLastPlayTime>, "QueryLastPlayTime"}, - {18, D<&IQueryService::QueryApplicationPlayStatisticsForSystem>, "QueryApplicationPlayStatisticsForSystem"}, - {19, D<&IQueryService::QueryApplicationPlayStatisticsByUserAccountIdForSystem>, "QueryApplicationPlayStatisticsByUserAccountIdForSystem"}, - { 30, nullptr, "Cmd30" }, - { 31, nullptr, "Cmd31" }, - { 100, nullptr, "Cmd100" }, - { 110, nullptr, "Cmd110" }, - { 118, nullptr, "Cmd118" }, - { 119, nullptr, "Cmd119" }, - }; - // clang-format on - - RegisterHandlers(functions); } IQueryService::~IQueryService() = default; diff --git a/src/core/hle/service/ns/query_service.h b/src/core/hle/service/ns/query_service.h index f5c0ae1058..08267d3165 100644 --- a/src/core/hle/service/ns/query_service.h +++ b/src/core/hle/service/ns/query_service.h @@ -62,6 +62,7 @@ private: OutArray out_stats, InArray application_ids); + std::optional FindRequest(u32 key) override; std::unique_ptr play_time_manager; }; diff --git a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp index 1359cdbb95..c6cd822d24 100644 --- a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp +++ b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp @@ -73,6 +73,21 @@ void SanitizeJPEGImageSize(std::vector& image) { } // namespace +std::optional IReadOnlyApplicationControlDataInterface::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData>, "GetApplicationControlData"}, + FunctionInfo{1, D<&IReadOnlyApplicationControlDataInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, + FunctionInfo{2, D<&IReadOnlyApplicationControlDataInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, + FunctionInfo{3, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, + FunctionInfo{4, nullptr, "SelectApplicationDesiredLanguage"}, + FunctionInfo{5, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData2>, "GetApplicationControlData"}, + FunctionInfo{10, &IReadOnlyApplicationControlDataInterface::ListApplicationIcon, "ListApplicationIcon"}, + FunctionInfo{13, &IReadOnlyApplicationControlDataInterface::ListApplicationTitle, "ListApplicationTitle"}, + FunctionInfo{19, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData"}, + FunctionInfo{23, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData", MakeVersionGate({23,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} // IAsyncValue implementation for ListApplicationTitle // https://switchbrew.org/wiki/NS_services#ListApplicationTitle @@ -84,13 +99,6 @@ public: , data_offset{offset} , data_size{size} { - static const FunctionInfo functions[] = { - {0, D<&IAsyncValue::GetSize>, "GetSize"}, - {1, D<&IAsyncValue::Get>, "Get"}, - {2, D<&IAsyncValue::Cancel>, "Cancel"}, - {3, D<&IAsyncValue::GetErrorContext>, "GetErrorContext"}, - }; - RegisterHandlers(functions); completion_event = service_context.CreateEvent("IAsyncValue:Completion"); completion_event->GetReadableEvent().Signal(system.Kernel()); } @@ -122,6 +130,16 @@ private: LOG_DEBUG(Service_NS, "called"); R_SUCCEED(); } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IAsyncValue::GetSize>, "GetSize"}, + FunctionInfo{1, D<&IAsyncValue::Get>, "Get"}, + FunctionInfo{2, D<&IAsyncValue::Cancel>, "Cancel"}, + FunctionInfo{3, D<&IAsyncValue::GetErrorContext>, "GetErrorContext"} + ); KernelHelpers::ServiceContext service_context; Kernel::KEvent* completion_event{}; s32 data_offset; @@ -131,22 +149,6 @@ private: IReadOnlyApplicationControlDataInterface::IReadOnlyApplicationControlDataInterface( Core::System& system_) : ServiceFramework{system_, "IReadOnlyApplicationControlDataInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData>, "GetApplicationControlData"}, - {1, D<&IReadOnlyApplicationControlDataInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, - {2, D<&IReadOnlyApplicationControlDataInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, - {3, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, - {4, nullptr, "SelectApplicationDesiredLanguage"}, - {5, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData2>, "GetApplicationControlData"}, - {10, &IReadOnlyApplicationControlDataInterface::ListApplicationIcon, "ListApplicationIcon"}, - {13, &IReadOnlyApplicationControlDataInterface::ListApplicationTitle, "ListApplicationTitle"}, - {19, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData"}, - {23, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData"}, //23.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } IReadOnlyApplicationControlDataInterface::~IReadOnlyApplicationControlDataInterface() = default; diff --git a/src/core/hle/service/ns/read_only_application_control_data_interface.h b/src/core/hle/service/ns/read_only_application_control_data_interface.h index a4a285151a..3f68029583 100644 --- a/src/core/hle/service/ns/read_only_application_control_data_interface.h +++ b/src/core/hle/service/ns/read_only_application_control_data_interface.h @@ -45,6 +45,8 @@ public: u8 flag1, u8 flag2, u64 application_id); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/read_only_application_record_interface.cpp b/src/core/hle/service/ns/read_only_application_record_interface.cpp index 8ce7851ae2..7a7cf9ec58 100644 --- a/src/core/hle/service/ns/read_only_application_record_interface.cpp +++ b/src/core/hle/service/ns/read_only_application_record_interface.cpp @@ -11,17 +11,18 @@ namespace Service::NS { +std::optional IReadOnlyApplicationRecordInterface::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IReadOnlyApplicationRecordInterface::HasApplicationRecord>, "HasApplicationRecord"}, + FunctionInfo{1, nullptr, "NotifyApplicationFailure"}, + FunctionInfo{2, D<&IReadOnlyApplicationRecordInterface::IsDataCorruptedResult>, "IsDataCorruptedResult"}, + FunctionInfo{3, D<&IReadOnlyApplicationRecordInterface::ListApplicationRecord>, "ListApplicationRecord"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IReadOnlyApplicationRecordInterface::IReadOnlyApplicationRecordInterface(Core::System& system_) : ServiceFramework{system_, "IReadOnlyApplicationRecordInterface"} { - static const FunctionInfo functions[] = { - {0, D<&IReadOnlyApplicationRecordInterface::HasApplicationRecord>, "HasApplicationRecord"}, - {1, nullptr, "NotifyApplicationFailure"}, - {2, D<&IReadOnlyApplicationRecordInterface::IsDataCorruptedResult>, "IsDataCorruptedResult"}, - {3, D<&IReadOnlyApplicationRecordInterface::ListApplicationRecord>, "ListApplicationRecord"}, - }; - // clang-format on - - RegisterHandlers(functions); } IReadOnlyApplicationRecordInterface::~IReadOnlyApplicationRecordInterface() = default; diff --git a/src/core/hle/service/ns/read_only_application_record_interface.h b/src/core/hle/service/ns/read_only_application_record_interface.h index fc43c768ba..308e753e7d 100644 --- a/src/core/hle/service/ns/read_only_application_record_interface.h +++ b/src/core/hle/service/ns/read_only_application_record_interface.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -24,6 +24,8 @@ private: Result ListApplicationRecord( OutArray out_records, Out out_count, s32 entry_offset); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/service_getter_interface.cpp b/src/core/hle/service/ns/service_getter_interface.cpp index 1a3dd7166c..bbf30da3da 100644 --- a/src/core/hle/service/ns/service_getter_interface.cpp +++ b/src/core/hle/service/ns/service_getter_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -17,25 +20,25 @@ namespace Service::NS { +std::optional IServiceGetterInterface::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{7988, D<&IServiceGetterInterface::GetDynamicRightsInterface>, "GetDynamicRightsInterface"}, + FunctionInfo{7989, D<&IServiceGetterInterface::GetReadOnlyApplicationControlDataInterface>, "GetReadOnlyApplicationControlDataInterface"}, + FunctionInfo{7991, D<&IServiceGetterInterface::GetReadOnlyApplicationRecordInterface>, "GetReadOnlyApplicationRecordInterface"}, + FunctionInfo{7992, D<&IServiceGetterInterface::GetECommerceInterface>, "GetECommerceInterface"}, + FunctionInfo{7993, D<&IServiceGetterInterface::GetApplicationVersionInterface>, "GetApplicationVersionInterface"}, + FunctionInfo{7994, D<&IServiceGetterInterface::GetFactoryResetInterface>, "GetFactoryResetInterface"}, + FunctionInfo{7995, D<&IServiceGetterInterface::GetAccountProxyInterface>, "GetAccountProxyInterface"}, + FunctionInfo{7996, D<&IServiceGetterInterface::GetApplicationManagerInterface>, "GetApplicationManagerInterface"}, + FunctionInfo{7997, D<&IServiceGetterInterface::GetDownloadTaskInterface>, "GetDownloadTaskInterface"}, + FunctionInfo{7998, D<&IServiceGetterInterface::GetContentManagementInterface>, "GetContentManagementInterface"}, + FunctionInfo{7999, D<&IServiceGetterInterface::GetDocumentInterface>, "GetDocumentInterface"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IServiceGetterInterface::IServiceGetterInterface(Core::System& system_, const char* name) : ServiceFramework{system_, name} { - // clang-format off - static const FunctionInfo functions[] = { - {7988, D<&IServiceGetterInterface::GetDynamicRightsInterface>, "GetDynamicRightsInterface"}, - {7989, D<&IServiceGetterInterface::GetReadOnlyApplicationControlDataInterface>, "GetReadOnlyApplicationControlDataInterface"}, - {7991, D<&IServiceGetterInterface::GetReadOnlyApplicationRecordInterface>, "GetReadOnlyApplicationRecordInterface"}, - {7992, D<&IServiceGetterInterface::GetECommerceInterface>, "GetECommerceInterface"}, - {7993, D<&IServiceGetterInterface::GetApplicationVersionInterface>, "GetApplicationVersionInterface"}, - {7994, D<&IServiceGetterInterface::GetFactoryResetInterface>, "GetFactoryResetInterface"}, - {7995, D<&IServiceGetterInterface::GetAccountProxyInterface>, "GetAccountProxyInterface"}, - {7996, D<&IServiceGetterInterface::GetApplicationManagerInterface>, "GetApplicationManagerInterface"}, - {7997, D<&IServiceGetterInterface::GetDownloadTaskInterface>, "GetDownloadTaskInterface"}, - {7998, D<&IServiceGetterInterface::GetContentManagementInterface>, "GetContentManagementInterface"}, - {7999, D<&IServiceGetterInterface::GetDocumentInterface>, "GetDocumentInterface"}, - }; - // clang-format on - - RegisterHandlers(functions); } IServiceGetterInterface::~IServiceGetterInterface() = default; diff --git a/src/core/hle/service/ns/service_getter_interface.h b/src/core/hle/service/ns/service_getter_interface.h index bbc18d4445..8c33aafc27 100644 --- a/src/core/hle/service/ns/service_getter_interface.h +++ b/src/core/hle/service/ns/service_getter_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -42,6 +45,8 @@ public: Result GetContentManagementInterface( Out> out_interface); Result GetDocumentInterface(Out> out_interface); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/system_update_control.cpp b/src/core/hle/service/ns/system_update_control.cpp index f5f5cfd909..3d1911c852 100644 --- a/src/core/hle/service/ns/system_update_control.cpp +++ b/src/core/hle/service/ns/system_update_control.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -8,35 +11,6 @@ namespace Service::NS { ISystemUpdateControl::ISystemUpdateControl(Core::System& system_) : ServiceFramework{system_, "ISystemUpdateControl"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "HasDownloaded"}, - {1, nullptr, "RequestCheckLatestUpdate"}, - {2, nullptr, "RequestDownloadLatestUpdate"}, - {3, nullptr, "GetDownloadProgress"}, - {4, nullptr, "ApplyDownloadedUpdate"}, - {5, nullptr, "RequestPrepareCardUpdate"}, - {6, nullptr, "GetPrepareCardUpdateProgress"}, - {7, nullptr, "HasPreparedCardUpdate"}, - {8, nullptr, "ApplyCardUpdate"}, - {9, nullptr, "GetDownloadedEulaDataSize"}, - {10, nullptr, "GetDownloadedEulaData"}, - {11, nullptr, "SetupCardUpdate"}, - {12, nullptr, "GetPreparedCardUpdateEulaDataSize"}, - {13, nullptr, "GetPreparedCardUpdateEulaData"}, - {14, nullptr, "SetupCardUpdateViaSystemUpdater"}, - {15, nullptr, "HasReceived"}, - {16, nullptr, "RequestReceiveSystemUpdate"}, - {17, nullptr, "GetReceiveProgress"}, - {18, nullptr, "ApplyReceivedUpdate"}, - {19, nullptr, "GetReceivedEulaDataSize"}, - {20, nullptr, "GetReceivedEulaData"}, - {21, nullptr, "SetupToReceiveSystemUpdate"}, - {22, nullptr, "RequestCheckLatestUpdateIncludesRebootlessUpdate"}, - }; - // clang-format on - - RegisterHandlers(functions); } ISystemUpdateControl::~ISystemUpdateControl() = default; diff --git a/src/core/hle/service/ns/system_update_control.h b/src/core/hle/service/ns/system_update_control.h index a30a090000..acdf048e6c 100644 --- a/src/core/hle/service/ns/system_update_control.h +++ b/src/core/hle/service/ns/system_update_control.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,6 +14,35 @@ class ISystemUpdateControl final : public ServiceFramework public: explicit ISystemUpdateControl(Core::System& system_); ~ISystemUpdateControl() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "HasDownloaded"}, + FunctionInfo{1, nullptr, "RequestCheckLatestUpdate"}, + FunctionInfo{2, nullptr, "RequestDownloadLatestUpdate"}, + FunctionInfo{3, nullptr, "GetDownloadProgress"}, + FunctionInfo{4, nullptr, "ApplyDownloadedUpdate"}, + FunctionInfo{5, nullptr, "RequestPrepareCardUpdate"}, + FunctionInfo{6, nullptr, "GetPrepareCardUpdateProgress"}, + FunctionInfo{7, nullptr, "HasPreparedCardUpdate"}, + FunctionInfo{8, nullptr, "ApplyCardUpdate"}, + FunctionInfo{9, nullptr, "GetDownloadedEulaDataSize"}, + FunctionInfo{10, nullptr, "GetDownloadedEulaData"}, + FunctionInfo{11, nullptr, "SetupCardUpdate"}, + FunctionInfo{12, nullptr, "GetPreparedCardUpdateEulaDataSize"}, + FunctionInfo{13, nullptr, "GetPreparedCardUpdateEulaData"}, + FunctionInfo{14, nullptr, "SetupCardUpdateViaSystemUpdater"}, + FunctionInfo{15, nullptr, "HasReceived"}, + FunctionInfo{16, nullptr, "RequestReceiveSystemUpdate"}, + FunctionInfo{17, nullptr, "GetReceiveProgress"}, + FunctionInfo{18, nullptr, "ApplyReceivedUpdate"}, + FunctionInfo{19, nullptr, "GetReceivedEulaDataSize"}, + FunctionInfo{20, nullptr, "GetReceivedEulaData"}, + FunctionInfo{21, nullptr, "SetupToReceiveSystemUpdate"}, + FunctionInfo{22, nullptr, "RequestCheckLatestUpdateIncludesRebootlessUpdate"} + ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/system_update_interface.cpp b/src/core/hle/service/ns/system_update_interface.cpp index 7e22ca3db0..044d39835f 100644 --- a/src/core/hle/service/ns/system_update_interface.cpp +++ b/src/core/hle/service/ns/system_update_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,32 +10,32 @@ namespace Service::NS { +std::optional ISystemUpdateInterface::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ISystemUpdateInterface::GetBackgroundNetworkUpdateState>, "GetBackgroundNetworkUpdateState"}, + FunctionInfo{1, D<&ISystemUpdateInterface::OpenSystemUpdateControl>, "OpenSystemUpdateControl"}, + FunctionInfo{2, nullptr, "NotifyExFatDriverRequired"}, + FunctionInfo{3, nullptr, "ClearExFatDriverStatusForDebug"}, + FunctionInfo{4, nullptr, "RequestBackgroundNetworkUpdate"}, + FunctionInfo{5, nullptr, "NotifyBackgroundNetworkUpdate"}, + FunctionInfo{6, nullptr, "NotifyExFatDriverDownloadedForDebug"}, + FunctionInfo{9, D<&ISystemUpdateInterface::GetSystemUpdateNotificationEventForContentDelivery>, "GetSystemUpdateNotificationEventForContentDelivery"}, + FunctionInfo{10, nullptr, "NotifySystemUpdateForContentDelivery"}, + FunctionInfo{11, nullptr, "PrepareShutdown"}, + FunctionInfo{12, nullptr, "Unknown12"}, + FunctionInfo{13, nullptr, "Unknown13"}, + FunctionInfo{14, nullptr, "Unknown14"}, + FunctionInfo{15, nullptr, "Unknown15"}, + FunctionInfo{16, nullptr, "DestroySystemUpdateTask"}, + FunctionInfo{17, nullptr, "RequestSendSystemUpdate"}, + FunctionInfo{18, nullptr, "GetSendSystemUpdateProgress"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + ISystemUpdateInterface::ISystemUpdateInterface(Core::System& system_) : ServiceFramework{system_, "ns:su"}, service_context{system_, "ns:su"}, update_notification_event{service_context} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ISystemUpdateInterface::GetBackgroundNetworkUpdateState>, "GetBackgroundNetworkUpdateState"}, - {1, D<&ISystemUpdateInterface::OpenSystemUpdateControl>, "OpenSystemUpdateControl"}, - {2, nullptr, "NotifyExFatDriverRequired"}, - {3, nullptr, "ClearExFatDriverStatusForDebug"}, - {4, nullptr, "RequestBackgroundNetworkUpdate"}, - {5, nullptr, "NotifyBackgroundNetworkUpdate"}, - {6, nullptr, "NotifyExFatDriverDownloadedForDebug"}, - {9, D<&ISystemUpdateInterface::GetSystemUpdateNotificationEventForContentDelivery>, "GetSystemUpdateNotificationEventForContentDelivery"}, - {10, nullptr, "NotifySystemUpdateForContentDelivery"}, - {11, nullptr, "PrepareShutdown"}, - {12, nullptr, "Unknown12"}, - {13, nullptr, "Unknown13"}, - {14, nullptr, "Unknown14"}, - {15, nullptr, "Unknown15"}, - {16, nullptr, "DestroySystemUpdateTask"}, - {17, nullptr, "RequestSendSystemUpdate"}, - {18, nullptr, "GetSendSystemUpdateProgress"}, - }; - // clang-format on - - RegisterHandlers(functions); } ISystemUpdateInterface::~ISystemUpdateInterface() = default; diff --git a/src/core/hle/service/ns/system_update_interface.h b/src/core/hle/service/ns/system_update_interface.h index 36a2880ec9..2ea14f4f5e 100644 --- a/src/core/hle/service/ns/system_update_interface.h +++ b/src/core/hle/service/ns/system_update_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -30,7 +33,7 @@ private: Result GetSystemUpdateNotificationEventForContentDelivery( OutCopyHandle out_event); -private: + std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext service_context; Event update_notification_event; }; diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index b252a2efa5..81d8a3a63b 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp @@ -50,55 +50,61 @@ class NVGEM_C final : public ServiceFramework { public: explicit NVGEM_C(Core::System& system_) : ServiceFramework{system_, "nvgem:c"} - { - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "GetEventHandle"}, - {2, nullptr, "ControlNotification"}, - {3, nullptr, "SetNotificationPerm"}, - {4, nullptr, "SetCoreDumpPerm"}, - {5, nullptr, "GetAruid"}, - {6, nullptr, "Reset"}, - {7, nullptr, "GetAruid2"}, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{1, nullptr, "GetEventHandle"}, + FunctionInfo{2, nullptr, "ControlNotification"}, + FunctionInfo{3, nullptr, "SetNotificationPerm"}, + FunctionInfo{4, nullptr, "SetCoreDumpPerm"}, + FunctionInfo{5, nullptr, "GetAruid"}, + FunctionInfo{6, nullptr, "Reset"}, + FunctionInfo{7, nullptr, "GetAruid2"} + ); }; class NVGEM_CD final : public ServiceFramework { public: explicit NVGEM_CD(Core::System& system_) : ServiceFramework{system_, "nvgem:cd"} - { - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "GetAruid"}, - {2, nullptr, "ReadNextBlock"}, - {3, nullptr, "GetNextBlockSize"}, - {4, nullptr, "ReadNextBlock2"}, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{1, nullptr, "GetAruid"}, + FunctionInfo{2, nullptr, "ReadNextBlock"}, + FunctionInfo{3, nullptr, "GetNextBlockSize"}, + FunctionInfo{4, nullptr, "ReadNextBlock2"} + ); }; class NVDBG_D final : public ServiceFramework { public: explicit NVDBG_D(Core::System& system_) : ServiceFramework{system_, "nvdbg:d"} - { - static const FunctionInfo functions[] = { - {0, nullptr, "Open"}, - {1, nullptr, "Ioctl"}, - {2, nullptr, "Close"}, - {4, nullptr, "QueryEvent"}, - {9, nullptr, "DumpStatus"}, - {10, nullptr, "InitializeDevtools"}, - {11, nullptr, "Ioctl2"}, - {12, nullptr, "Ioctl3"}, - {13, nullptr, "SetConfiguration"}, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Open"}, + FunctionInfo{1, nullptr, "Ioctl"}, + FunctionInfo{2, nullptr, "Close"}, + FunctionInfo{4, nullptr, "QueryEvent"}, + FunctionInfo{9, nullptr, "DumpStatus"}, + FunctionInfo{10, nullptr, "InitializeDevtools"}, + FunctionInfo{11, nullptr, "Ioctl2"}, + FunctionInfo{12, nullptr, "Ioctl3"}, + FunctionInfo{13, nullptr, "SetConfiguration"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp index 5fae68adbb..db3dbd9f8e 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp +++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp @@ -245,24 +245,6 @@ void NVDRV::DumpGraphicsMemoryInfo(HLERequestContext& ctx) { NVDRV::NVDRV(Core::System& system_, std::shared_ptr nvdrv_, const char* name) : ServiceFramework{system_, name}, nvdrv{std::move(nvdrv_)} { - static const FunctionInfo functions[] = { - {0, &NVDRV::Open, "Open"}, - {1, &NVDRV::Ioctl1, "Ioctl"}, - {2, &NVDRV::Close, "Close"}, - {3, &NVDRV::Initialize, "Initialize"}, - {4, &NVDRV::QueryEvent, "QueryEvent"}, - {5, nullptr, "MapSharedMem"}, - {6, &NVDRV::GetStatus, "GetStatus"}, - {7, nullptr, "SetAruidForTest"}, - {8, &NVDRV::SetAruid, "SetAruid"}, - {9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"}, - {10, nullptr, "InitializeDevtools"}, - {11, &NVDRV::Ioctl2, "Ioctl2"}, - {12, &NVDRV::Ioctl3, "Ioctl3"}, - {13, &NVDRV::SetGraphicsFirmwareMemoryMarginEnabled, - "SetGraphicsFirmwareMemoryMarginEnabled"}, - }; - RegisterHandlers(functions); } NVDRV::~NVDRV() { diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.h b/src/core/hle/service/nvdrv/nvdrv_interface.h index c72f925979..b9b574398a 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.h +++ b/src/core/hle/service/nvdrv/nvdrv_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -35,8 +38,27 @@ private: void ServiceError(HLERequestContext& ctx, NvResult result); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &NVDRV::Open, "Open"}, + FunctionInfo{1, &NVDRV::Ioctl1, "Ioctl"}, + FunctionInfo{2, &NVDRV::Close, "Close"}, + FunctionInfo{3, &NVDRV::Initialize, "Initialize"}, + FunctionInfo{4, &NVDRV::QueryEvent, "QueryEvent"}, + FunctionInfo{5, nullptr, "MapSharedMem"}, + FunctionInfo{6, &NVDRV::GetStatus, "GetStatus"}, + FunctionInfo{7, nullptr, "SetAruidForTest"}, + FunctionInfo{8, &NVDRV::SetAruid, "SetAruid"}, + FunctionInfo{9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"}, + FunctionInfo{10, nullptr, "InitializeDevtools"}, + FunctionInfo{11, &NVDRV::Ioctl2, "Ioctl2"}, + FunctionInfo{12, &NVDRV::Ioctl3, "Ioctl3"}, + FunctionInfo{13, &NVDRV::SetGraphicsFirmwareMemoryMarginEnabled, + "SetGraphicsFirmwareMemoryMarginEnabled"} + ); std::shared_ptr nvdrv; - u64 pid{}; bool is_initialized{}; NvCore::SessionId session_id{}; diff --git a/src/core/hle/service/nvdrv/nvmemp.cpp b/src/core/hle/service/nvdrv/nvmemp.cpp index a5477faf1a..8e2e4dfacb 100644 --- a/src/core/hle/service/nvdrv/nvmemp.cpp +++ b/src/core/hle/service/nvdrv/nvmemp.cpp @@ -11,11 +11,6 @@ namespace Service::Nvidia { NVMEMP::NVMEMP(Core::System& system_) : ServiceFramework{system_, "nvmemp"} { - static const FunctionInfo functions[] = { - {0, &NVMEMP::Open, "Open"}, - {1, &NVMEMP::GetAruid, "GetAruid"}, - }; - RegisterHandlers(functions); } NVMEMP::~NVMEMP() = default; diff --git a/src/core/hle/service/nvdrv/nvmemp.h b/src/core/hle/service/nvdrv/nvmemp.h index 85e3053a8d..e98b07c494 100644 --- a/src/core/hle/service/nvdrv/nvmemp.h +++ b/src/core/hle/service/nvdrv/nvmemp.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -19,6 +22,14 @@ public: private: void Open(HLERequestContext& ctx); void GetAruid(HLERequestContext& ctx); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &NVMEMP::Open, "Open"}, + FunctionInfo{1, &NVMEMP::GetAruid, "GetAruid"} + ); }; } // namespace Service::Nvidia diff --git a/src/core/hle/service/nvnflinger/hos_binder_driver.cpp b/src/core/hle/service/nvnflinger/hos_binder_driver.cpp index d30aa3717d..c9023374c4 100644 --- a/src/core/hle/service/nvnflinger/hos_binder_driver.cpp +++ b/src/core/hle/service/nvnflinger/hos_binder_driver.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -8,18 +11,21 @@ namespace Service::Nvnflinger { +std::optional IHOSBinderDriver::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IHOSBinderDriver::TransactParcel>, "TransactParcel"}, + FunctionInfo{1, C<&IHOSBinderDriver::AdjustRefcount>, "AdjustRefcount"}, + FunctionInfo{2, C<&IHOSBinderDriver::GetNativeHandle>, "GetNativeHandle"}, + FunctionInfo{3, C<&IHOSBinderDriver::TransactParcelAuto>, "TransactParcelAuto"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IHOSBinderDriver::IHOSBinderDriver(Core::System& system_, std::shared_ptr server, std::shared_ptr surface_flinger) : ServiceFramework{system_, "IHOSBinderDriver"}, m_server(server), m_surface_flinger(surface_flinger) { - static const FunctionInfo functions[] = { - {0, C<&IHOSBinderDriver::TransactParcel>, "TransactParcel"}, - {1, C<&IHOSBinderDriver::AdjustRefcount>, "AdjustRefcount"}, - {2, C<&IHOSBinderDriver::GetNativeHandle>, "GetNativeHandle"}, - {3, C<&IHOSBinderDriver::TransactParcelAuto>, "TransactParcelAuto"}, - }; - RegisterHandlers(functions); } IHOSBinderDriver::~IHOSBinderDriver() = default; diff --git a/src/core/hle/service/nvnflinger/hos_binder_driver.h b/src/core/hle/service/nvnflinger/hos_binder_driver.h index 6b551c91d2..7d44046115 100644 --- a/src/core/hle/service/nvnflinger/hos_binder_driver.h +++ b/src/core/hle/service/nvnflinger/hos_binder_driver.h @@ -44,6 +44,7 @@ private: OutBuffer parcel_reply, u32 flags); private: + std::optional FindRequest(u32 key) override; const std::shared_ptr m_server; const std::shared_ptr m_surface_flinger; }; diff --git a/src/core/hle/service/olsc/daemon_controller.cpp b/src/core/hle/service/olsc/daemon_controller.cpp index c449c6ff31..f25888170c 100644 --- a/src/core/hle/service/olsc/daemon_controller.cpp +++ b/src/core/hle/service/olsc/daemon_controller.cpp @@ -9,27 +9,25 @@ namespace Service::OLSC { -IDaemonController::IDaemonController(Core::System& system_) - : ServiceFramework{system_, "IDaemonController"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IDaemonController::GetApplicationAutoTransferSetting>, "GetApplicationAutoTransferSetting"}, - {1, D<&IDaemonController::SetApplicationAutoTransferSetting>, "SetApplicationAutoTransferSetting"}, - {2, D<&IDaemonController::GetGlobalAutoUploadSetting>, "GetGlobalAutoUploadSetting"}, - {3, D<&IDaemonController::SetGlobalAutoUploadSetting>, "SetGlobalAutoUploadSetting"}, - {4, D<&IDaemonController::RunTransferTaskAutonomyRegistration>, "RunTransferTaskAutonomyRegistration"}, - {5, D<&IDaemonController::GetGlobalAutoDownloadSetting>, "GetGlobalAutoDownloadSetting"}, // 11.0.0+ - {6, D<&IDaemonController::SetGlobalAutoDownloadSetting>, "SetGlobalAutoDownloadSetting"}, // 11.0.0+ - {10, nullptr, "CreateForbiddenSaveDataInidication"}, - {11, D<&IDaemonController::StopAutonomyTaskExecution>, "StopAutonomyTaskExecution"}, - {12, D<&IDaemonController::GetAutonomyTaskStatus>, "GetAutonomyTaskStatus"}, - {13, nullptr, "Unknown13_20_0_0_Plus"}, // 20.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); +std::optional IDaemonController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IDaemonController::GetApplicationAutoTransferSetting>, "GetApplicationAutoTransferSetting"}, + FunctionInfo{1, D<&IDaemonController::SetApplicationAutoTransferSetting>, "SetApplicationAutoTransferSetting"}, + FunctionInfo{2, D<&IDaemonController::GetGlobalAutoUploadSetting>, "GetGlobalAutoUploadSetting"}, + FunctionInfo{3, D<&IDaemonController::SetGlobalAutoUploadSetting>, "SetGlobalAutoUploadSetting"}, + FunctionInfo{4, D<&IDaemonController::RunTransferTaskAutonomyRegistration>, "RunTransferTaskAutonomyRegistration"}, + FunctionInfo{5, D<&IDaemonController::GetGlobalAutoDownloadSetting>, "GetGlobalAutoDownloadSetting", MakeVersionGate({11,0,0})}, + FunctionInfo{6, D<&IDaemonController::SetGlobalAutoDownloadSetting>, "SetGlobalAutoDownloadSetting", MakeVersionGate({11,0,0})}, + FunctionInfo{10, nullptr, "CreateForbiddenSaveDataInidication"}, + FunctionInfo{11, D<&IDaemonController::StopAutonomyTaskExecution>, "StopAutonomyTaskExecution"}, + FunctionInfo{12, D<&IDaemonController::GetAutonomyTaskStatus>, "GetAutonomyTaskStatus"}, + FunctionInfo{13, nullptr, "Unknown13_20_0_0_Plus", MakeVersionGate({20,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); } +IDaemonController::IDaemonController(Core::System& system_) : ServiceFramework{system_, "IDaemonController"} {} + IDaemonController::~IDaemonController() = default; Result IDaemonController::GetApplicationAutoTransferSetting(Out out_is_enabled, diff --git a/src/core/hle/service/olsc/daemon_controller.h b/src/core/hle/service/olsc/daemon_controller.h index 70f3d9e235..b90d3ee778 100644 --- a/src/core/hle/service/olsc/daemon_controller.h +++ b/src/core/hle/service/olsc/daemon_controller.h @@ -38,6 +38,8 @@ private: Result GetAutonomyTaskStatus(Out out_status, Common::UUID user_id); + std::optional FindRequest(u32 key) override; + // Internal in-memory state to back the above APIs struct AppKey { Common::UUID user_id; diff --git a/src/core/hle/service/olsc/native_handle_holder.cpp b/src/core/hle/service/olsc/native_handle_holder.cpp index 1e50195539..1f6f8419fc 100644 --- a/src/core/hle/service/olsc/native_handle_holder.cpp +++ b/src/core/hle/service/olsc/native_handle_holder.cpp @@ -12,16 +12,16 @@ namespace Service::OLSC { +std::optional INativeHandleHolder::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&INativeHandleHolder::GetNativeHandle>, "GetNativeHandle"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + INativeHandleHolder::INativeHandleHolder(Core::System& system_) : ServiceFramework{system_, "INativeHandleHolder"}, service_context{system_, "OLSC"} { event = service_context.CreateEvent("OLSC::INativeHandleHolder"); - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&INativeHandleHolder::GetNativeHandle>, "GetNativeHandle"}, - }; - // clang-format on - - RegisterHandlers(functions); } INativeHandleHolder::~INativeHandleHolder() { diff --git a/src/core/hle/service/olsc/native_handle_holder.h b/src/core/hle/service/olsc/native_handle_holder.h index e0eac50c28..0ab51c7ca0 100644 --- a/src/core/hle/service/olsc/native_handle_holder.h +++ b/src/core/hle/service/olsc/native_handle_holder.h @@ -25,6 +25,7 @@ public: private: Result GetNativeHandle(OutCopyHandle out_event); + std::optional FindRequest(u32 key) override; Service::KernelHelpers::ServiceContext service_context; Kernel::KEvent* event{}; diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp index a86c525f9a..03b8a696f5 100644 --- a/src/core/hle/service/olsc/olsc.cpp +++ b/src/core/hle/service/olsc/olsc.cpp @@ -6,22 +6,179 @@ #include "core/hle/service/olsc/olsc.h" #include "core/hle/service/olsc/olsc_service_for_application.h" -#include "core/hle/service/olsc/olsc_service_for_system_service.h" +#include "core/hle/service/olsc/native_handle_holder.h" +#include "core/hle/service/olsc/stopper_object.h" +#include "core/hle/service/olsc/daemon_controller.h" +#include "core/hle/service/olsc/transfer_task_list_controller.h" +#include "core/hle/service/olsc/remote_storage_controller.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" +#include "core/hle/service/cmif_serialization.h" namespace Service::OLSC { class ISProfileBgAgentForSystemProcess final : public ServiceFramework { public: - explicit ISProfileBgAgentForSystemProcess(Core::System& system_) - : ServiceFramework{system_, "spbg:sp"} - { - static const FunctionInfo functions[] = { - { 100, nullptr, "OpenBgAgentController" }, - }; - RegisterHandlers(functions); + explicit ISProfileBgAgentForSystemProcess(Core::System& system_) : ServiceFramework{system_, "spbg:sp"} {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{100, nullptr, "OpenBgAgentController" } + ); +}; + +class IDaemonController; +class IRemoteStorageController; +class ITransferTaskListController; + +struct DataTransferPolicy { + u8 upload_policy; + u8 download_policy; +}; + +struct TransferTaskErrorInfo { + Common::UUID uid; + u64 application_id; + u8 unknown_0x18; + std::array reserved_0x19; + u64 unknown_0x20; + u32 error_code; + u32 reserved_0x2C; +}; +static_assert(sizeof(TransferTaskErrorInfo) == 0x30, "TransferTaskErrorInfo has incorrect size."); + +class IOlscServiceForSystemService final : public ServiceFramework { +public: + explicit IOlscServiceForSystemService(Core::System& system_) + : ServiceFramework{system_, "olsc:s"} { + } + + ~IOlscServiceForSystemService() override = default; + + Result GetTransferTaskListController( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared(system); + R_SUCCEED(); + } + + Result GetRemoteStorageController( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared(system); + R_SUCCEED(); + } + + Result GetDaemonController( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared(system); + R_SUCCEED(); + } + + Result GetDataTransferPolicy( + Out out_policy, u64 application_id) { + LOG_WARNING(Service_OLSC, "(STUBBED) called"); + DataTransferPolicy policy{}; + policy.upload_policy = 0; + policy.download_policy = 0; + *out_policy = policy; + R_SUCCEED(); + } + + Result GetTransferTaskErrorInfo(Out out_info, + Common::UUID uuid, u64 application_id) { + LOG_WARNING(Service_OLSC, "(STUBBED) called, uuid={} application_id={:016X}", + uuid.FormattedString(), application_id); + + TransferTaskErrorInfo info{}; + info.uid = uuid; + info.application_id = application_id; + info.unknown_0x18 = 0; + info.reserved_0x19.fill(0); + info.unknown_0x20 = 0; + info.error_code = 0; + info.reserved_0x2C = 0; + + *out_info = info; + R_SUCCEED(); + } + + Result GetOlscServiceForSystemService( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::static_pointer_cast(shared_from_this()); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IOlscServiceForSystemService::GetTransferTaskListController>, "GetTransferTaskListController"}, + FunctionInfo{1, D<&IOlscServiceForSystemService::GetRemoteStorageController>, "GetRemoteStorageController"}, + FunctionInfo{2, D<&IOlscServiceForSystemService::GetDaemonController>, "GetDaemonController"}, + FunctionInfo{10, nullptr, "PrepareDeleteUserProperty"}, + FunctionInfo{11, nullptr, "DeleteUserSaveDataProperty"}, + FunctionInfo{12, nullptr, "InvalidateMountCache"}, + FunctionInfo{13, nullptr, "DeleteDeviceSaveDataProperty"}, + FunctionInfo{100, nullptr, "ListLastTransferTaskErrorInfo"}, + FunctionInfo{101, nullptr, "GetLastErrorInfoCount"}, + FunctionInfo{102, nullptr, "RemoveLastErrorInfoOld"}, + FunctionInfo{103, nullptr, "GetLastErrorInfo"}, + FunctionInfo{104, nullptr, "GetLastErrorEventHolder"}, + FunctionInfo{105, D<&IOlscServiceForSystemService::GetTransferTaskErrorInfo>, "GetTransferTaskErrorInfo"}, + FunctionInfo{200, D<&IOlscServiceForSystemService::GetDataTransferPolicy>, "GetDataTransferPolicy"}, + FunctionInfo{201, nullptr, "DeleteDataTransferPolicyCache"}, + FunctionInfo{202, nullptr, "Unknown202"}, + FunctionInfo{203, nullptr, "RequestUpdateDataTransferPolicyCacheAsync"}, + FunctionInfo{204, nullptr, "ClearDataTransferPolicyCache"}, + FunctionInfo{205, nullptr, "RequestGetDataTransferPolicyAsync"}, + FunctionInfo{206, nullptr, "Unknown206", MakeVersionGate({21,0,0})}, + FunctionInfo{300, nullptr, "GetUserSaveDataProperty"}, + FunctionInfo{301, nullptr, "SetUserSaveDataProperty"}, + FunctionInfo{302, nullptr, "Unknown302", MakeVersionGate({21,0,0})}, + FunctionInfo{400, nullptr, "CleanupSaveDataBackupContextForSpecificApplications"}, + FunctionInfo{900, nullptr, "DeleteAllTransferTask"}, + FunctionInfo{902, nullptr, "DeleteAllSeriesInfo"}, + FunctionInfo{903, nullptr, "DeleteAllSdaInfoCache"}, + FunctionInfo{904, nullptr, "DeleteAllApplicationSetting"}, + FunctionInfo{905, nullptr, "DeleteAllTransferTaskErrorInfo"}, + FunctionInfo{906, nullptr, "RegisterTransferTaskErrorInfo"}, + FunctionInfo{907, nullptr, "AddSaveDataArchiveInfoCache"}, + FunctionInfo{908, nullptr, "DeleteSeriesInfo"}, + FunctionInfo{909, nullptr, "GetSeriesInfo"}, + FunctionInfo{910, nullptr, "RemoveTransferTaskErrorInfo"}, + FunctionInfo{911, nullptr, "DeleteAllSeriesInfoForSaveDataBackup"}, + FunctionInfo{912, nullptr, "DeleteSeriesInfoForSaveDataBackup"}, + FunctionInfo{913, nullptr, "GetSeriesInfoForSaveDataBackup"}, + FunctionInfo{914, nullptr, "Unknown914", MakeVersionGate({20,2,0})}, + FunctionInfo{1000, nullptr, "UpdateIssueOld"}, + FunctionInfo{1010, nullptr, "Unknown1010"}, + FunctionInfo{1011, nullptr, "Unknown1011"}, + FunctionInfo{1012, nullptr, "Unknown1012"}, + FunctionInfo{1013, nullptr, "Unkown1013"}, + FunctionInfo{1014, nullptr, "Unknown1014"}, + FunctionInfo{1020, nullptr, "Unknown1020"}, + FunctionInfo{1021, nullptr, "Unknown1021"}, + FunctionInfo{1022, nullptr, "Unknown1022"}, + FunctionInfo{1023, nullptr, "Unknown1023"}, + FunctionInfo{1024, nullptr, "Unknown1024"}, + FunctionInfo{1100, nullptr, "RepairUpdateIssueInfoCacheAync"}, + FunctionInfo{1110, nullptr, "RepairGetIssueInfo"}, + FunctionInfo{1111, nullptr, "RepairListIssueInfo"}, + FunctionInfo{1112, nullptr, "RepairListOperationPermissionInfo"}, + FunctionInfo{1113, nullptr, "RepairListDataInfoForRepairedSaveDataDownload"}, + FunctionInfo{1114, nullptr, "RepairListDataInfoForOriginalSaveDataDownload"}, + FunctionInfo{1120, nullptr, "RepairUploadSaveDataAsync"}, + FunctionInfo{1121, nullptr, "RepairUploadSaveDataAsync1"}, + FunctionInfo{1122, nullptr, "RepairDownloadRepairedSaveDataAsync"}, + FunctionInfo{1123, nullptr, "RepairDownloadOriginalSaveDataAsync"}, + FunctionInfo{1124, nullptr, "RepairGetOperationProgressInfo"}, + FunctionInfo{10000, D<&IOlscServiceForSystemService::GetOlscServiceForSystemService>, "GetOlscServiceForSystemService"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/olsc/olsc_service_for_application.cpp b/src/core/hle/service/olsc/olsc_service_for_application.cpp index 01360f5ef2..8d6b20d7ff 100644 --- a/src/core/hle/service/olsc/olsc_service_for_application.cpp +++ b/src/core/hle/service/olsc/olsc_service_for_application.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -6,36 +9,36 @@ namespace Service::OLSC { +std::optional IOlscServiceForApplication::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IOlscServiceForApplication::Initialize>, "Initialize"}, + FunctionInfo{10, nullptr, "VerifySaveDataBackupLicenseAsync"}, + FunctionInfo{13, D<&IOlscServiceForApplication::GetSaveDataBackupSetting>, "GetSaveDataBackupSetting"}, + FunctionInfo{14, D<&IOlscServiceForApplication::SetSaveDataBackupSettingEnabled>, "SetSaveDataBackupSettingEnabled"}, + FunctionInfo{15, nullptr, "SetCustomData"}, + FunctionInfo{16, nullptr, "DeleteSaveDataBackupSetting"}, + FunctionInfo{18, nullptr, "GetSaveDataBackupInfoCache"}, + FunctionInfo{19, nullptr, "UpdateSaveDataBackupInfoCacheAsync"}, + FunctionInfo{22, nullptr, "DeleteSaveDataBackupAsync"}, + FunctionInfo{25, nullptr, "ListDownloadableSaveDataBackupInfoAsync"}, + FunctionInfo{26, nullptr, "DownloadSaveDataBackupAsync"}, + FunctionInfo{27, nullptr, "UploadSaveDataBackupAsync"}, + FunctionInfo{9010, nullptr, "VerifySaveDataBackupLicenseAsyncForDebug"}, + FunctionInfo{9013, nullptr, "GetSaveDataBackupSettingForDebug"}, + FunctionInfo{9014, nullptr, "SetSaveDataBackupSettingEnabledForDebug"}, + FunctionInfo{9015, nullptr, "SetCustomDataForDebug"}, + FunctionInfo{9016, nullptr, "DeleteSaveDataBackupSettingForDebug"}, + FunctionInfo{9018, nullptr, "GetSaveDataBackupInfoCacheForDebug"}, + FunctionInfo{9019, nullptr, "UpdateSaveDataBackupInfoCacheAsyncForDebug"}, + FunctionInfo{9022, nullptr, "DeleteSaveDataBackupAsyncForDebug"}, + FunctionInfo{9025, nullptr, "ListDownloadableSaveDataBackupInfoAsyncForDebug"}, + FunctionInfo{9026, nullptr, "DownloadSaveDataBackupAsyncForDebug"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IOlscServiceForApplication::IOlscServiceForApplication(Core::System& system_) : ServiceFramework{system_, "olsc:u"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IOlscServiceForApplication::Initialize>, "Initialize"}, - {10, nullptr, "VerifySaveDataBackupLicenseAsync"}, - {13, D<&IOlscServiceForApplication::GetSaveDataBackupSetting>, "GetSaveDataBackupSetting"}, - {14, D<&IOlscServiceForApplication::SetSaveDataBackupSettingEnabled>, "SetSaveDataBackupSettingEnabled"}, - {15, nullptr, "SetCustomData"}, - {16, nullptr, "DeleteSaveDataBackupSetting"}, - {18, nullptr, "GetSaveDataBackupInfoCache"}, - {19, nullptr, "UpdateSaveDataBackupInfoCacheAsync"}, - {22, nullptr, "DeleteSaveDataBackupAsync"}, - {25, nullptr, "ListDownloadableSaveDataBackupInfoAsync"}, - {26, nullptr, "DownloadSaveDataBackupAsync"}, - {27, nullptr, "UploadSaveDataBackupAsync"}, - {9010, nullptr, "VerifySaveDataBackupLicenseAsyncForDebug"}, - {9013, nullptr, "GetSaveDataBackupSettingForDebug"}, - {9014, nullptr, "SetSaveDataBackupSettingEnabledForDebug"}, - {9015, nullptr, "SetCustomDataForDebug"}, - {9016, nullptr, "DeleteSaveDataBackupSettingForDebug"}, - {9018, nullptr, "GetSaveDataBackupInfoCacheForDebug"}, - {9019, nullptr, "UpdateSaveDataBackupInfoCacheAsyncForDebug"}, - {9022, nullptr, "DeleteSaveDataBackupAsyncForDebug"}, - {9025, nullptr, "ListDownloadableSaveDataBackupInfoAsyncForDebug"}, - {9026, nullptr, "DownloadSaveDataBackupAsyncForDebug"}, - }; - // clang-format on - - RegisterHandlers(functions); } IOlscServiceForApplication::~IOlscServiceForApplication() = default; diff --git a/src/core/hle/service/olsc/olsc_service_for_application.h b/src/core/hle/service/olsc/olsc_service_for_application.h index 8941659478..0d92f9ba78 100644 --- a/src/core/hle/service/olsc/olsc_service_for_application.h +++ b/src/core/hle/service/olsc/olsc_service_for_application.h @@ -22,6 +22,8 @@ private: Result GetSaveDataBackupSetting(Out out_save_data_backup_setting); Result SetSaveDataBackupSettingEnabled(bool enabled, NS::Uid account_id); + std::optional FindRequest(u32 key) override; + bool initialized{}; }; diff --git a/src/core/hle/service/olsc/olsc_service_for_system_service.cpp b/src/core/hle/service/olsc/olsc_service_for_system_service.cpp deleted file mode 100644 index 245bbd5c6b..0000000000 --- a/src/core/hle/service/olsc/olsc_service_for_system_service.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/olsc/daemon_controller.h" -#include "core/hle/service/olsc/olsc_service_for_system_service.h" -#include "core/hle/service/olsc/remote_storage_controller.h" -#include "core/hle/service/olsc/transfer_task_list_controller.h" - -namespace Service::OLSC { - -IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_) - : ServiceFramework{system_, "olsc:s"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IOlscServiceForSystemService::GetTransferTaskListController>, "GetTransferTaskListController"}, - {1, D<&IOlscServiceForSystemService::GetRemoteStorageController>, "GetRemoteStorageController"}, - {2, D<&IOlscServiceForSystemService::GetDaemonController>, "GetDaemonController"}, - {10, nullptr, "PrepareDeleteUserProperty"}, - {11, nullptr, "DeleteUserSaveDataProperty"}, - {12, nullptr, "InvalidateMountCache"}, - {13, nullptr, "DeleteDeviceSaveDataProperty"}, - {100, nullptr, "ListLastTransferTaskErrorInfo"}, - {101, nullptr, "GetLastErrorInfoCount"}, - {102, nullptr, "RemoveLastErrorInfoOld"}, - {103, nullptr, "GetLastErrorInfo"}, - {104, nullptr, "GetLastErrorEventHolder"}, - {105, D<&IOlscServiceForSystemService::GetTransferTaskErrorInfo>, "GetTransferTaskErrorInfo"}, - {200, D<&IOlscServiceForSystemService::GetDataTransferPolicy>, "GetDataTransferPolicy"}, - {201, nullptr, "DeleteDataTransferPolicyCache"}, - {202, nullptr, "Unknown202"}, - {203, nullptr, "RequestUpdateDataTransferPolicyCacheAsync"}, - {204, nullptr, "ClearDataTransferPolicyCache"}, - {205, nullptr, "RequestGetDataTransferPolicyAsync"}, - {206, nullptr, "Unknown206"}, //21.0.0+ - {300, nullptr, "GetUserSaveDataProperty"}, - {301, nullptr, "SetUserSaveDataProperty"}, - {302, nullptr, "Unknown302"}, //21.0.0+ - {400, nullptr, "CleanupSaveDataBackupContextForSpecificApplications"}, - {900, nullptr, "DeleteAllTransferTask"}, - {902, nullptr, "DeleteAllSeriesInfo"}, - {903, nullptr, "DeleteAllSdaInfoCache"}, - {904, nullptr, "DeleteAllApplicationSetting"}, - {905, nullptr, "DeleteAllTransferTaskErrorInfo"}, - {906, nullptr, "RegisterTransferTaskErrorInfo"}, - {907, nullptr, "AddSaveDataArchiveInfoCache"}, - {908, nullptr, "DeleteSeriesInfo"}, - {909, nullptr, "GetSeriesInfo"}, - {910, nullptr, "RemoveTransferTaskErrorInfo"}, - {911, nullptr, "DeleteAllSeriesInfoForSaveDataBackup"}, - {912, nullptr, "DeleteSeriesInfoForSaveDataBackup"}, - {913, nullptr, "GetSeriesInfoForSaveDataBackup"}, - {914, nullptr, "Unknown914"}, //20.2.0+ - {1000, nullptr, "UpdateIssueOld"}, - {1010, nullptr, "Unknown1010"}, - {1011, nullptr, "Unknown1011"}, - {1012, nullptr, "Unknown1012"}, - {1013, nullptr, "Unkown1013"}, - {1014, nullptr, "Unknown1014"}, - {1020, nullptr, "Unknown1020"}, - {1021, nullptr, "Unknown1021"}, - {1022, nullptr, "Unknown1022"}, - {1023, nullptr, "Unknown1023"}, - {1024, nullptr, "Unknown1024"}, - {1100, nullptr, "RepairUpdateIssueInfoCacheAync"}, - {1110, nullptr, "RepairGetIssueInfo"}, - {1111, nullptr, "RepairListIssueInfo"}, - {1112, nullptr, "RepairListOperationPermissionInfo"}, - {1113, nullptr, "RepairListDataInfoForRepairedSaveDataDownload"}, - {1114, nullptr, "RepairListDataInfoForOriginalSaveDataDownload"}, - {1120, nullptr, "RepairUploadSaveDataAsync"}, - {1121, nullptr, "RepairUploadSaveDataAsync1"}, - {1122, nullptr, "RepairDownloadRepairedSaveDataAsync"}, - {1123, nullptr, "RepairDownloadOriginalSaveDataAsync"}, - {1124, nullptr, "RepairGetOperationProgressInfo"}, - {10000, D<&IOlscServiceForSystemService::GetOlscServiceForSystemService>, "GetOlscServiceForSystemService"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IOlscServiceForSystemService::~IOlscServiceForSystemService() = default; - -Result IOlscServiceForSystemService::GetTransferTaskListController( - Out> out_interface) { - LOG_INFO(Service_OLSC, "called"); - *out_interface = std::make_shared(system); - R_SUCCEED(); -} - -Result IOlscServiceForSystemService::GetRemoteStorageController( - Out> out_interface) { - LOG_INFO(Service_OLSC, "called"); - *out_interface = std::make_shared(system); - R_SUCCEED(); -} - -Result IOlscServiceForSystemService::GetDaemonController( - Out> out_interface) { - LOG_INFO(Service_OLSC, "called"); - *out_interface = std::make_shared(system); - R_SUCCEED(); -} - -Result IOlscServiceForSystemService::GetDataTransferPolicy( - Out out_policy, u64 application_id) { - LOG_WARNING(Service_OLSC, "(STUBBED) called"); - DataTransferPolicy policy{}; - policy.upload_policy = 0; - policy.download_policy = 0; - *out_policy = policy; - R_SUCCEED(); -} - -Result IOlscServiceForSystemService::GetTransferTaskErrorInfo(Out out_info, - Common::UUID uuid, u64 application_id) { - LOG_WARNING(Service_OLSC, "(STUBBED) called, uuid={} application_id={:016X}", - uuid.FormattedString(), application_id); - - TransferTaskErrorInfo info{}; - info.uid = uuid; - info.application_id = application_id; - info.unknown_0x18 = 0; - info.reserved_0x19.fill(0); - info.unknown_0x20 = 0; - info.error_code = 0; - info.reserved_0x2C = 0; - - *out_info = info; - R_SUCCEED(); -} - -Result IOlscServiceForSystemService::GetOlscServiceForSystemService( - Out> out_interface) { - LOG_INFO(Service_OLSC, "called"); - *out_interface = std::static_pointer_cast(shared_from_this()); - R_SUCCEED(); -} - -} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/olsc_service_for_system_service.h b/src/core/hle/service/olsc/olsc_service_for_system_service.h deleted file mode 100644 index d16c8b979b..0000000000 --- a/src/core/hle/service/olsc/olsc_service_for_system_service.h +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include "common/uuid.h" -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service::OLSC { - -class IDaemonController; -class IRemoteStorageController; -class ITransferTaskListController; - -struct DataTransferPolicy { - u8 upload_policy; - u8 download_policy; -}; - -struct TransferTaskErrorInfo { - Common::UUID uid; - u64 application_id; - u8 unknown_0x18; - std::array reserved_0x19; - u64 unknown_0x20; - u32 error_code; - u32 reserved_0x2C; -}; -static_assert(sizeof(TransferTaskErrorInfo) == 0x30, "TransferTaskErrorInfo has incorrect size."); - -class IOlscServiceForSystemService final : public ServiceFramework { -public: - explicit IOlscServiceForSystemService(Core::System& system_); - ~IOlscServiceForSystemService() override; - -private: - Result GetTransferTaskListController( - Out> out_interface); - Result GetRemoteStorageController(Out> out_interface); - Result GetDaemonController(Out> out_interface); - Result GetDataTransferPolicy(Out out_policy, u64 application_id); - Result GetTransferTaskErrorInfo(Out out_info, Common::UUID uid, u64 application_id); - Result GetOlscServiceForSystemService( - Out> out_interface); -}; - -} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/remote_storage_controller.cpp b/src/core/hle/service/olsc/remote_storage_controller.cpp index 817097b426..1e7825da30 100644 --- a/src/core/hle/service/olsc/remote_storage_controller.cpp +++ b/src/core/hle/service/olsc/remote_storage_controller.cpp @@ -9,44 +9,44 @@ namespace Service::OLSC { + std::optional IRemoteStorageController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetSaveDataArchiveInfoBySaveDataId"}, + FunctionInfo{1, nullptr, "GetSaveDataArchiveInfoByApplicationId"}, + FunctionInfo{3, nullptr, "GetSaveDataArchiveCount"}, + FunctionInfo{6, nullptr, "CleanupSaveDataArchives"}, + FunctionInfo{7, nullptr, "CreateSaveDataArchiveCacheUpdationTask"}, + FunctionInfo{8, nullptr, "CreateSaveDataArchiveCacheUpdationForSpecifiedApplicationTask"}, + FunctionInfo{9, nullptr, "Delete"}, + FunctionInfo{10, nullptr, "GetSeriesInfo"}, + FunctionInfo{11, nullptr, "CreateDeleteDataTask"}, + FunctionInfo{12, nullptr, "DeleteSeriesInfo"}, + FunctionInfo{13, nullptr, "CreateRegisterNotificationTokenTask"}, + FunctionInfo{14, D<&IRemoteStorageController::GetDataNewnessByApplicationId>, "GetDataNewnessByApplicationId"}, + FunctionInfo{15, nullptr, "RegisterUploadSaveDataTransferTaskForAutonomyRegistration"}, + FunctionInfo{16, nullptr, "CreateCleanupToDeleteSaveDataArchiveInfoTask"}, + FunctionInfo{17, nullptr, "ListDataInfo"}, + FunctionInfo{18, D<&IRemoteStorageController::GetDataInfo>, "GetDataInfoV1"}, + FunctionInfo{19, nullptr, "GetDataInfoCacheUpdateNativeHandleHolder"}, + FunctionInfo{20, nullptr, "CreateSaveDataArchiveInfoCacheForSaveDataBackupUpdationTask"}, + FunctionInfo{21, nullptr, "ListSecondarySaves"}, + FunctionInfo{22, D<&IRemoteStorageController::GetSecondarySave>, "GetSecondarySave"}, + FunctionInfo{23, nullptr, "TouchSecondarySave"}, + FunctionInfo{24, nullptr, "GetSecondarySaveDataInfo"}, + FunctionInfo{25, nullptr, "RegisterDownloadSaveDataTransferTaskForAutonomyRegistration"}, + FunctionInfo{26, nullptr, "Unknown26", MakeVersionGate({20,0,0})}, + FunctionInfo{27, D<&IRemoteStorageController::GetDataInfo>, "GetDataInfoV2", MakeVersionGate({20,0,0})}, + FunctionInfo{28, nullptr, "Unknown28", MakeVersionGate({20,0,0})}, + FunctionInfo{29, nullptr, "Unknown29", MakeVersionGate({21,0,0})}, + FunctionInfo{800, nullptr, "Unknown800", MakeVersionGate({20,0,0})}, + FunctionInfo{900, nullptr, "SetLoadedDataMissing"}, + FunctionInfo{901, nullptr, "Unknown901", MakeVersionGate({20,2,0})} + ); + return HandlerTableGenerateWithFind(key, functions); + } + IRemoteStorageController::IRemoteStorageController(Core::System& system_) : ServiceFramework{system_, "IRemoteStorageController"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetSaveDataArchiveInfoBySaveDataId"}, - {1, nullptr, "GetSaveDataArchiveInfoByApplicationId"}, - {3, nullptr, "GetSaveDataArchiveCount"}, - {6, nullptr, "CleanupSaveDataArchives"}, - {7, nullptr, "CreateSaveDataArchiveCacheUpdationTask"}, - {8, nullptr, "CreateSaveDataArchiveCacheUpdationForSpecifiedApplicationTask"}, - {9, nullptr, "Delete"}, - {10, nullptr, "GetSeriesInfo"}, - {11, nullptr, "CreateDeleteDataTask"}, - {12, nullptr, "DeleteSeriesInfo"}, - {13, nullptr, "CreateRegisterNotificationTokenTask"}, - {14, D<&IRemoteStorageController::GetDataNewnessByApplicationId>, "GetDataNewnessByApplicationId"}, - {15, nullptr, "RegisterUploadSaveDataTransferTaskForAutonomyRegistration"}, - {16, nullptr, "CreateCleanupToDeleteSaveDataArchiveInfoTask"}, - {17, nullptr, "ListDataInfo"}, - {18, D<&IRemoteStorageController::GetDataInfo>, "GetDataInfoV1"}, - {19, nullptr, "GetDataInfoCacheUpdateNativeHandleHolder"}, - {20, nullptr, "CreateSaveDataArchiveInfoCacheForSaveDataBackupUpdationTask"}, - {21, nullptr, "ListSecondarySaves"}, - {22, D<&IRemoteStorageController::GetSecondarySave>, "GetSecondarySave"}, - {23, nullptr, "TouchSecondarySave"}, - {24, nullptr, "GetSecondarySaveDataInfo"}, - {25, nullptr, "RegisterDownloadSaveDataTransferTaskForAutonomyRegistration"}, - {26, nullptr, "Unknown26"}, //20.0.0+ - {27, D<&IRemoteStorageController::GetDataInfo>, "GetDataInfoV2"}, //20.0.0+ - {28, nullptr, "Unknown28"}, //20.0.0+ - {29, nullptr, "Unknown29"}, //21.0.0+ - {800, nullptr, "Unknown800"}, //20.0.0+ - {900, nullptr, "SetLoadedDataMissing"}, - {901, nullptr, "Unknown901"}, //20.2.0+ - }; - // clang-format on - - RegisterHandlers(functions); } IRemoteStorageController::~IRemoteStorageController() = default; diff --git a/src/core/hle/service/olsc/remote_storage_controller.h b/src/core/hle/service/olsc/remote_storage_controller.h index 21b439013a..20503d9800 100644 --- a/src/core/hle/service/olsc/remote_storage_controller.h +++ b/src/core/hle/service/olsc/remote_storage_controller.h @@ -21,6 +21,8 @@ private: u64 application_id); Result GetDataNewnessByApplicationId(Out out_newness, u64 application_id); Result GetDataInfo(Out> out_data, u64 application_id); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/transfer_task_list_controller.cpp b/src/core/hle/service/olsc/transfer_task_list_controller.cpp index 95e41cdb51..af090fc292 100644 --- a/src/core/hle/service/olsc/transfer_task_list_controller.cpp +++ b/src/core/hle/service/olsc/transfer_task_list_controller.cpp @@ -11,45 +11,45 @@ namespace Service::OLSC { + std::optional ITransferTaskListController::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetTransferTaskCountForOcean"}, + FunctionInfo{1, nullptr, "GetTransferTaskInfoForOcean"}, + FunctionInfo{2, nullptr, "ListTransferTaskInfoForOcean"}, + FunctionInfo{3, nullptr, "DeleteTransferTaskForOcean"}, + FunctionInfo{4, nullptr, "RaiseTransferTaskPriorityForOcean"}, + FunctionInfo{5, D<&ITransferTaskListController::GetTransferTaskEndEventNativeHandleHolder>, "GetTransferTaskEndEventNativeHandleHolder"}, + FunctionInfo{6, nullptr, "GetTransferTaskProgressForOcean"}, + FunctionInfo{7, nullptr, "GetTransferTaskLastResultForOcean"}, + FunctionInfo{8, D<&ITransferTaskListController::StopNextTransferTaskExecution>, "StopNextTransferTaskExecution"}, + FunctionInfo{9, D<&ITransferTaskListController::GetTransferTaskStartEventNativeHandleHolder>, "GetTransferTaskStartEventNativeHandleHolder"}, + FunctionInfo{10, nullptr, "SuspendTransferTaskForOcean"}, + FunctionInfo{11, nullptr, "GetCurrentTransferTaskInfoForOcean"}, + FunctionInfo{12, nullptr, "FindTransferTaskInfoForOcean"}, + FunctionInfo{13, nullptr, "CancelCurrentRepairTransferTask"}, + FunctionInfo{14, nullptr, "GetRepairTransferTaskProgress"}, + FunctionInfo{15, nullptr, "EnsureExecutableForRepairTransferTask"}, + FunctionInfo{16, D<&ITransferTaskListController::GetTransferTaskCount>, "GetTransferTaskCount"}, + FunctionInfo{17, nullptr, "GetTransferTaskInfo"}, + FunctionInfo{18, nullptr, "ListTransferTaskInfo"}, + FunctionInfo{19, nullptr, "DeleteTransferTask"}, + FunctionInfo{20, nullptr, "RaiseTransferTaskPriority"}, + FunctionInfo{21, D<&ITransferTaskListController::GetTransferTaskProgress>, "GetTransferTaskProgress", MakeVersionGate({10,1,0})}, + FunctionInfo{22, nullptr, "GetTransferTaskLastResult"}, + FunctionInfo{23, nullptr, "SuspendTransferTask"}, + FunctionInfo{24, D<&ITransferTaskListController::GetCurrentTransferTaskInfo>, "GetCurrentTransferTaskInfo"}, + FunctionInfo{25, D<&ITransferTaskListController::FindTransferTaskInfo>, "FindTransferTaskInfo"}, + FunctionInfo{26, nullptr, "Unknown26", MakeVersionGate({20,1,0})}, + FunctionInfo{27, nullptr, "Unknown27", MakeVersionGate({20,1,0})}, + FunctionInfo{28, nullptr, "Unknown28", MakeVersionGate({20,1,0})}, + FunctionInfo{29, nullptr, "Unknown29", MakeVersionGate({20,1,0})}, + FunctionInfo{30, nullptr, "Unknown30", MakeVersionGate({20,1,0})} + ); + return HandlerTableGenerateWithFind(key, functions); + } + ITransferTaskListController::ITransferTaskListController(Core::System& system_) : ServiceFramework{system_, "ITransferTaskListController"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetTransferTaskCountForOcean"}, - {1, nullptr, "GetTransferTaskInfoForOcean"}, - {2, nullptr, "ListTransferTaskInfoForOcean"}, - {3, nullptr, "DeleteTransferTaskForOcean"}, - {4, nullptr, "RaiseTransferTaskPriorityForOcean"}, - {5, D<&ITransferTaskListController::GetTransferTaskEndEventNativeHandleHolder>, "GetTransferTaskEndEventNativeHandleHolder"}, - {6, nullptr, "GetTransferTaskProgressForOcean"}, - {7, nullptr, "GetTransferTaskLastResultForOcean"}, - {8, D<&ITransferTaskListController::StopNextTransferTaskExecution>, "StopNextTransferTaskExecution"}, - {9, D<&ITransferTaskListController::GetTransferTaskStartEventNativeHandleHolder>, "GetTransferTaskStartEventNativeHandleHolder"}, - {10, nullptr, "SuspendTransferTaskForOcean"}, - {11, nullptr, "GetCurrentTransferTaskInfoForOcean"}, - {12, nullptr, "FindTransferTaskInfoForOcean"}, - {13, nullptr, "CancelCurrentRepairTransferTask"}, - {14, nullptr, "GetRepairTransferTaskProgress"}, - {15, nullptr, "EnsureExecutableForRepairTransferTask"}, - {16, D<&ITransferTaskListController::GetTransferTaskCount>, "GetTransferTaskCount"}, - {17, nullptr, "GetTransferTaskInfo"}, - {18, nullptr, "ListTransferTaskInfo"}, - {19, nullptr, "DeleteTransferTask"}, - {20, nullptr, "RaiseTransferTaskPriority"}, - {21, D<&ITransferTaskListController::GetTransferTaskProgress>, "GetTransferTaskProgress"}, //10.1.0+ - {22, nullptr, "GetTransferTaskLastResult"}, - {23, nullptr, "SuspendTransferTask"}, - {24, D<&ITransferTaskListController::GetCurrentTransferTaskInfo>, "GetCurrentTransferTaskInfo"}, - {25, D<&ITransferTaskListController::FindTransferTaskInfo>, "FindTransferTaskInfo"}, - {26, nullptr, "Unknown26"}, //20.1.0+ - {27, nullptr, "Unknown27"}, //20.1.0+ - {28, nullptr, "Unknown28"}, //20.1.0+ - {29, nullptr, "Unknown29"}, //20.1.0+ - {30, nullptr, "Unknown30"}, //20.1.0+ - }; - // clang-format on - - RegisterHandlers(functions); } ITransferTaskListController::~ITransferTaskListController() = default; diff --git a/src/core/hle/service/olsc/transfer_task_list_controller.h b/src/core/hle/service/olsc/transfer_task_list_controller.h index 5f3429879a..74c5eddee3 100644 --- a/src/core/hle/service/olsc/transfer_task_list_controller.h +++ b/src/core/hle/service/olsc/transfer_task_list_controller.h @@ -27,6 +27,8 @@ private: Result GetTransferTaskProgress(); Result GetCurrentTransferTaskInfo(Out> out_info, u8 unknown); Result FindTransferTaskInfo(Out> out_info, InBuffer in); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::OLSC diff --git a/src/core/hle/service/omm/operation_mode_manager.cpp b/src/core/hle/service/omm/operation_mode_manager.cpp index fe7ed84a7f..e36f606442 100644 --- a/src/core/hle/service/omm/operation_mode_manager.cpp +++ b/src/core/hle/service/omm/operation_mode_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,41 +10,6 @@ namespace Service::OMM { IOperationModeManager::IOperationModeManager(Core::System& system_) : ServiceFramework{system_, "omm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetOperationMode"}, - {1, nullptr, "GetOperationModeChangeEvent"}, - {2, nullptr, "EnableAudioVisual"}, - {3, nullptr, "DisableAudioVisual"}, - {4, nullptr, "EnterSleepAndWait"}, - {5, nullptr, "GetCradleStatus"}, - {6, nullptr, "FadeInDisplay"}, - {7, nullptr, "FadeOutDisplay"}, - {8, nullptr, "GetCradleFwVersion"}, - {9, nullptr, "NotifyCecSettingsChanged"}, - {10, nullptr, "SetOperationModePolicy"}, - {11, nullptr, "GetDefaultDisplayResolution"}, - {12, nullptr, "GetDefaultDisplayResolutionChangeEvent"}, - {13, nullptr, "UpdateDefaultDisplayResolution"}, - {14, nullptr, "ShouldSleepOnBoot"}, - {15, nullptr, "NotifyHdcpApplicationExecutionStarted"}, - {16, nullptr, "NotifyHdcpApplicationExecutionFinished"}, - {17, nullptr, "NotifyHdcpApplicationDrawingStarted"}, - {18, nullptr, "NotifyHdcpApplicationDrawingFinished"}, - {19, nullptr, "GetHdcpAuthenticationFailedEvent"}, - {20, nullptr, "GetHdcpAuthenticationFailedEmulationEnabled"}, - {21, nullptr, "SetHdcpAuthenticationFailedEmulation"}, - {22, nullptr, "GetHdcpStateChangeEvent"}, - {23, nullptr, "GetHdcpState"}, - {24, nullptr, "ShowCardUpdateProcessing"}, - {25, nullptr, "SetApplicationCecSettingsAndNotifyChanged"}, - {26, nullptr, "GetOperationModeSystemInfo"}, - {27, nullptr, "GetAppletFullAwakingSystemEvent"}, - {28, nullptr, "CreateCradleFirmwareUpdater"}, - }; - // clang-format on - - RegisterHandlers(functions); } IOperationModeManager::~IOperationModeManager() = default; diff --git a/src/core/hle/service/omm/operation_mode_manager.h b/src/core/hle/service/omm/operation_mode_manager.h index 32bc7b2f93..ea604c8f60 100644 --- a/src/core/hle/service/omm/operation_mode_manager.h +++ b/src/core/hle/service/omm/operation_mode_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,41 @@ class IOperationModeManager final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetOperationMode"}, + FunctionInfo{1, nullptr, "GetOperationModeChangeEvent"}, + FunctionInfo{2, nullptr, "EnableAudioVisual"}, + FunctionInfo{3, nullptr, "DisableAudioVisual"}, + FunctionInfo{4, nullptr, "EnterSleepAndWait"}, + FunctionInfo{5, nullptr, "GetCradleStatus"}, + FunctionInfo{6, nullptr, "FadeInDisplay"}, + FunctionInfo{7, nullptr, "FadeOutDisplay"}, + FunctionInfo{8, nullptr, "GetCradleFwVersion"}, + FunctionInfo{9, nullptr, "NotifyCecSettingsChanged"}, + FunctionInfo{10, nullptr, "SetOperationModePolicy"}, + FunctionInfo{11, nullptr, "GetDefaultDisplayResolution"}, + FunctionInfo{12, nullptr, "GetDefaultDisplayResolutionChangeEvent"}, + FunctionInfo{13, nullptr, "UpdateDefaultDisplayResolution"}, + FunctionInfo{14, nullptr, "ShouldSleepOnBoot"}, + FunctionInfo{15, nullptr, "NotifyHdcpApplicationExecutionStarted"}, + FunctionInfo{16, nullptr, "NotifyHdcpApplicationExecutionFinished"}, + FunctionInfo{17, nullptr, "NotifyHdcpApplicationDrawingStarted"}, + FunctionInfo{18, nullptr, "NotifyHdcpApplicationDrawingFinished"}, + FunctionInfo{19, nullptr, "GetHdcpAuthenticationFailedEvent"}, + FunctionInfo{20, nullptr, "GetHdcpAuthenticationFailedEmulationEnabled"}, + FunctionInfo{21, nullptr, "SetHdcpAuthenticationFailedEmulation"}, + FunctionInfo{22, nullptr, "GetHdcpStateChangeEvent"}, + FunctionInfo{23, nullptr, "GetHdcpState"}, + FunctionInfo{24, nullptr, "ShowCardUpdateProcessing"}, + FunctionInfo{25, nullptr, "SetApplicationCecSettingsAndNotifyChanged"}, + FunctionInfo{26, nullptr, "GetOperationModeSystemInfo"}, + FunctionInfo{27, nullptr, "GetAppletFullAwakingSystemEvent"}, + FunctionInfo{28, nullptr, "CreateCradleFirmwareUpdater"} + ); }; } // namespace Service::OMM diff --git a/src/core/hle/service/omm/policy_manager_system.cpp b/src/core/hle/service/omm/policy_manager_system.cpp index 1cd6fd807b..1d46de7f3e 100644 --- a/src/core/hle/service/omm/policy_manager_system.cpp +++ b/src/core/hle/service/omm/policy_manager_system.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,18 +10,6 @@ namespace Service::OMM { IPolicyManagerSystem::IPolicyManagerSystem(Core::System& system_) : ServiceFramework{system_, "idle:sys"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetAutoPowerDownEvent"}, - {1, nullptr, "IsAutoPowerDownRequested"}, - {2, nullptr, "Unknown2"}, - {3, nullptr, "SetHandlingContext"}, - {4, nullptr, "LoadAndApplySettings"}, - {5, nullptr, "ReportUserIsActive"}, - }; - // clang-format on - - RegisterHandlers(functions); } IPolicyManagerSystem::~IPolicyManagerSystem() = default; diff --git a/src/core/hle/service/omm/policy_manager_system.h b/src/core/hle/service/omm/policy_manager_system.h index 151ca0d2ee..c6ff451e61 100644 --- a/src/core/hle/service/omm/policy_manager_system.h +++ b/src/core/hle/service/omm/policy_manager_system.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,18 @@ class IPolicyManagerSystem final : public ServiceFramework public: explicit IPolicyManagerSystem(Core::System& system_); ~IPolicyManagerSystem() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetAutoPowerDownEvent"}, + FunctionInfo{1, nullptr, "IsAutoPowerDownRequested"}, + FunctionInfo{2, nullptr, "Unknown2"}, + FunctionInfo{3, nullptr, "SetHandlingContext"}, + FunctionInfo{4, nullptr, "LoadAndApplySettings"}, + FunctionInfo{5, nullptr, "ReportUserIsActive"} + ); }; } // namespace Service::OMM diff --git a/src/core/hle/service/omm/power_state_interface.cpp b/src/core/hle/service/omm/power_state_interface.cpp index 22cac82595..4150882695 100644 --- a/src/core/hle/service/omm/power_state_interface.cpp +++ b/src/core/hle/service/omm/power_state_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,24 +10,6 @@ namespace Service::OMM { IPowerStateInterface::IPowerStateInterface(Core::System& system_) : ServiceFramework{system_, "spsm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetState"}, - {1, nullptr, "EnterSleep"}, - {2, nullptr, "GetLastWakeReason"}, - {3, nullptr, "Shutdown"}, - {4, nullptr, "GetNotificationMessageEventHandle"}, - {5, nullptr, "ReceiveNotificationMessage"}, - {6, nullptr, "AnalyzeLogForLastSleepWakeSequence"}, - {7, nullptr, "ResetEventLog"}, - {8, nullptr, "AnalyzePerformanceLogForLastSleepWakeSequence"}, - {9, nullptr, "ChangeHomeButtonLongPressingTime"}, - {10, nullptr, "PutErrorState"}, - {11, nullptr, "InvalidateCurrentHomeButtonPressing"}, - }; - // clang-format on - - RegisterHandlers(functions); } IPowerStateInterface::~IPowerStateInterface() = default; diff --git a/src/core/hle/service/omm/power_state_interface.h b/src/core/hle/service/omm/power_state_interface.h index 825a6512d9..fed55a4361 100644 --- a/src/core/hle/service/omm/power_state_interface.h +++ b/src/core/hle/service/omm/power_state_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,24 @@ class IPowerStateInterface final : public ServiceFramework public: explicit IPowerStateInterface(Core::System& system_); ~IPowerStateInterface() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetState"}, + FunctionInfo{1, nullptr, "EnterSleep"}, + FunctionInfo{2, nullptr, "GetLastWakeReason"}, + FunctionInfo{3, nullptr, "Shutdown"}, + FunctionInfo{4, nullptr, "GetNotificationMessageEventHandle"}, + FunctionInfo{5, nullptr, "ReceiveNotificationMessage"}, + FunctionInfo{6, nullptr, "AnalyzeLogForLastSleepWakeSequence"}, + FunctionInfo{7, nullptr, "ResetEventLog"}, + FunctionInfo{8, nullptr, "AnalyzePerformanceLogForLastSleepWakeSequence"}, + FunctionInfo{9, nullptr, "ChangeHomeButtonLongPressingTime"}, + FunctionInfo{10, nullptr, "PutErrorState"}, + FunctionInfo{11, nullptr, "InvalidateCurrentHomeButtonPressing"} + ); }; } // namespace Service::OMM diff --git a/src/core/hle/service/pcie/pcie.cpp b/src/core/hle/service/pcie/pcie.cpp index d162881ecf..f9aaa2d3b8 100644 --- a/src/core/hle/service/pcie/pcie.cpp +++ b/src/core/hle/service/pcie/pcie.cpp @@ -15,64 +15,62 @@ namespace Service::PCIe { class ISession final : public ServiceFramework { public: - explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "QueryFunctions"}, - {1, nullptr, "AcquireFunction"}, - {2, nullptr, "ReleaseFunction"}, - {3, nullptr, "GetFunctionState"}, - {4, nullptr, "GetBarProfile"}, - {5, nullptr, "ReadConfig"}, - {6, nullptr, "WriteConfig"}, - {7, nullptr, "ReadBarRegion"}, - {8, nullptr, "WriteBarRegion"}, - {9, nullptr, "FindCapability"}, - {10, nullptr, "FindExtendedCapability"}, - {11, nullptr, "MapDma"}, - {12, nullptr, "UnmapDma"}, - {13, nullptr, "UnmapDmaBusAddress"}, - {14, nullptr, "GetDmaBusAddress"}, - {15, nullptr, "GetDmaBusAddressRange"}, - {16, nullptr, "SetDmaEnable"}, - {17, nullptr, "AcquireIrq"}, - {18, nullptr, "ReleaseIrq"}, - {19, nullptr, "SetIrqEnable"}, - {20, nullptr, "GetIrqEvent"}, - {21, nullptr, "SetAspmEnable"}, - {22, nullptr, "SetResetUponResumeEnable"}, - {23, nullptr, "ResetFunction"}, - }; - // clang-format on + explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "QueryFunctions"}, + FunctionInfo{1, nullptr, "AcquireFunction"}, + FunctionInfo{2, nullptr, "ReleaseFunction"}, + FunctionInfo{3, nullptr, "GetFunctionState"}, + FunctionInfo{4, nullptr, "GetBarProfile"}, + FunctionInfo{5, nullptr, "ReadConfig"}, + FunctionInfo{6, nullptr, "WriteConfig"}, + FunctionInfo{7, nullptr, "ReadBarRegion"}, + FunctionInfo{8, nullptr, "WriteBarRegion"}, + FunctionInfo{9, nullptr, "FindCapability"}, + FunctionInfo{10, nullptr, "FindExtendedCapability"}, + FunctionInfo{11, nullptr, "MapDma"}, + FunctionInfo{12, nullptr, "UnmapDma"}, + FunctionInfo{13, nullptr, "UnmapDmaBusAddress"}, + FunctionInfo{14, nullptr, "GetDmaBusAddress"}, + FunctionInfo{15, nullptr, "GetDmaBusAddressRange"}, + FunctionInfo{16, nullptr, "SetDmaEnable"}, + FunctionInfo{17, nullptr, "AcquireIrq"}, + FunctionInfo{18, nullptr, "ReleaseIrq"}, + FunctionInfo{19, nullptr, "SetIrqEnable"}, + FunctionInfo{20, nullptr, "GetIrqEvent"}, + FunctionInfo{21, nullptr, "SetAspmEnable"}, + FunctionInfo{22, nullptr, "SetResetUponResumeEnable"}, + FunctionInfo{23, nullptr, "ResetFunction"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class PCIE final : public ServiceFramework { public: - explicit PCIE(Core::System& system_) : ServiceFramework{system_, "pcie"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "RegisterClassDriver"}, - {1, nullptr, "QueryFunctionsUnregistered"}, - }; - // clang-format on + explicit PCIE(Core::System& system_) : ServiceFramework{system_, "pcie"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "RegisterClassDriver"}, + FunctionInfo{1, nullptr, "QueryFunctionsUnregistered"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class PCIE_LOG final : public ServiceFramework { public: - explicit PCIE_LOG(Core::System& system_) : ServiceFramework{system_, "pcie:log"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetLoggedState"}, - {1, nullptr, "GetLoggedStateEvent"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit PCIE_LOG(Core::System& system_) : ServiceFramework{system_, "pcie:log"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetLoggedState"}, + FunctionInfo{1, nullptr, "GetLoggedStateEvent"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/pctl/parental_control_service.cpp b/src/core/hle/service/pctl/parental_control_service.cpp deleted file mode 100644 index 51953c2657..0000000000 --- a/src/core/hle/service/pctl/parental_control_service.cpp +++ /dev/null @@ -1,498 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include - -#include "core/core.h" -#include "core/file_sys/control_metadata.h" -#include "core/file_sys/patch_manager.h" -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/pctl/parental_control_service.h" -#include "core/hle/service/pctl/pctl_results.h" - -namespace Service::PCTL { - -IParentalControlService::IParentalControlService(Core::System& system_, Capability capability_, - u64 program_id_) - : ServiceFramework{system_, "IParentalControlService"}, capability{capability_}, - program_id{program_id_}, - service_context{system_, "IParentalControlService"}, synchronization_event{service_context}, - unlinked_event{service_context}, request_suspension_event{service_context} { - // clang-format off - static const FunctionInfo functions[] = { - {1, D<&IParentalControlService::Initialize>, "Initialize"}, - {1001, D<&IParentalControlService::CheckFreeCommunicationPermission>, "CheckFreeCommunicationPermission"}, - {1002, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"}, - {1003, D<&IParentalControlService::ConfirmResumeApplicationPermission>, "ConfirmResumeApplicationPermission"}, - {1004, D<&IParentalControlService::ConfirmSnsPostPermission>, "ConfirmSnsPostPermission"}, - {1005, D<&IParentalControlService::ConfirmSystemSettingsPermission>, "ConfirmSystemSettingsPermission"}, - {1006, D<&IParentalControlService::IsRestrictionTemporaryUnlocked>, "IsRestrictionTemporaryUnlocked"}, - {1007, nullptr, "RevertRestrictionTemporaryUnlocked"}, - {1008, nullptr, "EnterRestrictedSystemSettings"}, - {1009, nullptr, "LeaveRestrictedSystemSettings"}, - {1010, D<&IParentalControlService::IsRestrictedSystemSettingsEntered>, "IsRestrictedSystemSettingsEntered"}, - {1011, nullptr, "RevertRestrictedSystemSettingsEntered"}, - {1012, nullptr, "GetRestrictedFeatures"}, - {1013, D<&IParentalControlService::ConfirmStereoVisionPermission>, "ConfirmStereoVisionPermission"}, - {1014, nullptr, "ConfirmPlayableApplicationVideoOld"}, - {1015, nullptr, "ConfirmPlayableApplicationVideo"}, - {1016, nullptr, "ConfirmShowNewsPermission"}, - {1017, D<&IParentalControlService::EndFreeCommunication>, "EndFreeCommunication"}, - {1018, D<&IParentalControlService::IsFreeCommunicationAvailable>, "IsFreeCommunicationAvailable"}, - {1019, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"}, - {1020, nullptr, "ConfirmLaunchSharedApplicationPermission"}, //20.0.0+ - {1021, nullptr, "TryBeginFreeCommunicationForStreamPlay"}, //21.0.0+ - {1022, nullptr, "EndFreeCommunicationForStreamPlay"}, //21.0.0+ - {1031, D<&IParentalControlService::IsRestrictionEnabled>, "IsRestrictionEnabled"}, - {1032, D<&IParentalControlService::GetSafetyLevel>, "GetSafetyLevel"}, - {1033, nullptr, "SetSafetyLevel"}, - {1034, nullptr, "GetSafetyLevelSettings"}, - {1035, D<&IParentalControlService::GetCurrentSettings>, "GetCurrentSettings"}, - {1036, nullptr, "SetCustomSafetyLevelSettings"}, - {1037, nullptr, "GetDefaultRatingOrganization"}, - {1038, nullptr, "SetDefaultRatingOrganization"}, - {1039, D<&IParentalControlService::GetFreeCommunicationApplicationListCount>, "GetFreeCommunicationApplicationListCount"}, - {1042, nullptr, "AddToFreeCommunicationApplicationList"}, - {1043, nullptr, "DeleteSettings"}, - {1044, nullptr, "GetFreeCommunicationApplicationList"}, - {1045, nullptr, "UpdateFreeCommunicationApplicationList"}, - {1046, nullptr, "DisableFeaturesForReset"}, - {1047, nullptr, "NotifyApplicationDownloadStarted"}, - {1048, nullptr, "NotifyNetworkProfileCreated"}, - {1049, nullptr, "ResetFreeCommunicationApplicationList"}, - {1050, nullptr, "AddToFreeCommunicationApplicationList"}, //20.0.0+ - {1051, nullptr, "NotifyApplicationDownloadStarted"}, //20.0.0+ - {1061, D<&IParentalControlService::ConfirmStereoVisionRestrictionConfigurable>, "ConfirmStereoVisionRestrictionConfigurable"}, - {1062, D<&IParentalControlService::GetStereoVisionRestriction>, "GetStereoVisionRestriction"}, - {1063, D<&IParentalControlService::SetStereoVisionRestriction>, "SetStereoVisionRestriction"}, - {1064, D<&IParentalControlService::ResetConfirmedStereoVisionPermission>, "ResetConfirmedStereoVisionPermission"}, - {1065, D<&IParentalControlService::IsStereoVisionPermitted>, "IsStereoVisionPermitted"}, - {1201, nullptr, "UnlockRestrictionTemporarily"}, - {1202, nullptr, "UnlockSystemSettingsRestriction"}, - {1203, nullptr, "SetPinCode"}, - {1204, nullptr, "GenerateInquiryCode"}, - {1205, nullptr, "CheckMasterKey"}, - {1206, D<&IParentalControlService::GetPinCodeLength>, "GetPinCodeLength"}, - {1207, nullptr, "GetPinCodeChangedEvent"}, - {1208, nullptr, "GetPinCode"}, - {1403, D<&IParentalControlService::IsPairingActive>, "IsPairingActive"}, - {1406, nullptr, "GetSettingsLastUpdated"}, - {1411, nullptr, "GetPairingAccountInfo"}, - {1421, nullptr, "GetAccountNickname"}, - {1424, nullptr, "GetAccountState"}, - {1425, nullptr, "RequestPostEvents"}, - {1426, nullptr, "GetPostEventInterval"}, - {1427, nullptr, "SetPostEventInterval"}, - {1432, D<&IParentalControlService::GetSynchronizationEvent>, "GetSynchronizationEvent"}, - {1451, D<&IParentalControlService::StartPlayTimer>, "StartPlayTimer"}, - {1452, D<&IParentalControlService::StopPlayTimer>, "StopPlayTimer"}, - {1453, D<&IParentalControlService::IsPlayTimerEnabled>, "IsPlayTimerEnabled"}, - {1454, D<&IParentalControlService::GetPlayTimerRemainingTime>, "GetPlayTimerRemainingTime"}, - {1455, D<&IParentalControlService::IsRestrictedByPlayTimer>, "IsRestrictedByPlayTimer"}, - {1456, D<&IParentalControlService::GetPlayTimerSettingsOld>, "GetPlayTimerSettingsOld"}, - {1457, D<&IParentalControlService::GetPlayTimerEventToRequestSuspension>, "GetPlayTimerEventToRequestSuspension"}, - {1458, D<&IParentalControlService::IsPlayTimerAlarmDisabled>, "IsPlayTimerAlarmDisabled"}, - {1459, D<&IParentalControlService::GetPlayTimerRemainingTimeDisplayInfo>, "GetPlayTimerRemainingTimeDisplayInfo"}, - {1460, D<&IParentalControlService::Unknown1460>, "Unknown1460"}, - {1471, nullptr, "NotifyWrongPinCodeInputManyTimes"}, - {1472, nullptr, "CancelNetworkRequest"}, - {1473, D<&IParentalControlService::GetUnlinkedEvent>, "GetUnlinkedEvent"}, - {1474, nullptr, "ClearUnlinkedEvent"}, - {1475, nullptr, "GetExtendedPlayTimerEvent"}, // 18.0.0+ - {1601, nullptr, "DisableAllFeatures"}, - {1602, nullptr, "PostEnableAllFeatures"}, - {1603, nullptr, "IsAllFeaturesDisabled"}, - {1901, nullptr, "DeleteFromFreeCommunicationApplicationListForDebug"}, - {1902, nullptr, "ClearFreeCommunicationApplicationListForDebug"}, - {1903, nullptr, "GetExemptApplicationListCountForDebug"}, - {1904, nullptr, "GetExemptApplicationListForDebug"}, - {1905, nullptr, "UpdateExemptApplicationListForDebug"}, - {1906, nullptr, "AddToExemptApplicationListForDebug"}, - {1907, nullptr, "DeleteFromExemptApplicationListForDebug"}, - {1908, nullptr, "ClearExemptApplicationListForDebug"}, - {1941, nullptr, "DeletePairing"}, - {1951, nullptr, "SetPlayTimerSettingsForDebug"}, - {1952, nullptr, "GetPlayTimerSpentTimeForTest"}, - {1953, nullptr, "SetPlayTimerAlarmDisabledForDebug"}, - {1954, nullptr, "IsBedtimeAlarmEnabled"}, // 18.0.0+ - {1955, nullptr, "GetBedtimeAlarmTime"}, // 18.0.0+ - {1956, nullptr, "GetBedtimeAlarmTimeHour"}, // 18.0.0+ - {1957, nullptr, "GetBedtimeAlarmTimeMinute"}, // 18.0.0+ - {2001, nullptr, "RequestPairingAsync"}, - {2002, nullptr, "FinishRequestPairing"}, - {2003, nullptr, "AuthorizePairingAsync"}, - {2004, nullptr, "FinishAuthorizePairing"}, - {2005, nullptr, "RetrievePairingInfoAsync"}, - {2006, nullptr, "FinishRetrievePairingInfo"}, - {2007, nullptr, "UnlinkPairingAsync"}, - {2008, nullptr, "FinishUnlinkPairing"}, - {2009, nullptr, "GetAccountMiiImageAsync"}, - {2010, nullptr, "FinishGetAccountMiiImage"}, - {2011, nullptr, "GetAccountMiiImageContentTypeAsync"}, - {2012, nullptr, "FinishGetAccountMiiImageContentType"}, - {2013, nullptr, "SynchronizeParentalControlSettingsAsync"}, - {2014, nullptr, "FinishSynchronizeParentalControlSettings"}, - {2015, nullptr, "FinishSynchronizeParentalControlSettingsWithLastUpdated"}, - {2016, nullptr, "RequestUpdateExemptionListAsync"}, //5.0.0+ - {145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings"}, // 18.0.0+ - {2017, nullptr, "AuthorizePairingAsync"}, //19.0.0+ - {2019, nullptr, "RequestUpdateDeviceUsersBackground"}, //19.0.0+ - {2021, nullptr, "RequestCopyPairingAsync"}, //20.0.0+ - {2022, nullptr, "FinishRequestCopyPairing"}, //20.0.0+ - {2023, nullptr, "IsFromPairingActiveDevice"}, //20.0.0+ - {2024, nullptr, "RollbackCopyPairing"}, //21.0.0+ - {3001, nullptr, "GetErrorContextChangedEvent"}, //20.0.0+ - {145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings"}, // 18.0.0+ - {195101, D<&IParentalControlService::SetPlayTimerSettings>, "SetPlayTimerSettingsForDebug"}, //18.0.0+ - }; - // clang-format on - RegisterHandlers(functions); -} - -IParentalControlService::~IParentalControlService() = default; - -bool IParentalControlService::CheckFreeCommunicationPermissionImpl() const { - if (states.temporary_unlocked) { - return true; - } - if ((states.application_info.parental_control_flag & 1) == 0) { - return true; - } - if (pin_code[0] == '\0') { - return true; - } - if (!settings.is_free_communication_default_on) { - return true; - } - // TODO(ogniK): Check for blacklisted/exempted applications. Return false can happen here - // but as we don't have multiproceses support yet, we can just assume our application is - // valid for the time being - return true; -} - -bool IParentalControlService::ConfirmStereoVisionPermissionImpl() const { - if (states.temporary_unlocked) { - return true; - } - if (pin_code[0] == '\0') { - return true; - } - if (!settings.is_stero_vision_restricted) { - return false; - } - return true; -} - -void IParentalControlService::SetStereoVisionRestrictionImpl(bool is_restricted) { - if (settings.disabled) { - return; - } - - if (pin_code[0] == '\0') { - return; - } - settings.is_stero_vision_restricted = is_restricted; -} - -Result IParentalControlService::Initialize() { - LOG_DEBUG(Service_PCTL, "called"); - - if (False(capability & (Capability::Application | Capability::System))) { - LOG_ERROR(Service_PCTL, "Invalid capability! capability={:X}", capability); - R_THROW(PCTL::ResultNoCapability); - } - - // TODO(ogniK): Recovery flag initialization for pctl:r - - if (program_id != 0) { - const FileSys::PatchManager pm{program_id, system.GetFileSystemController(), - system.GetContentProvider()}; - const auto control = pm.GetControlMetadata(); - if (control.first) { - states.tid_from_event = 0; - states.launch_time_valid = false; - states.is_suspended = false; - states.free_communication = false; - states.stereo_vision = false; - states.application_info = ApplicationInfo{ - .application_id = program_id, - .age_rating = control.first->GetRatingAge(), - .parental_control_flag = control.first->GetParentalControlFlag(), - .capability = capability, - }; - - if (False(capability & (Capability::System | Capability::Recovery))) { - // TODO(ogniK): Signal application launch event - } - } - } - - R_SUCCEED(); -} - -Result IParentalControlService::CheckFreeCommunicationPermission() { - LOG_DEBUG(Service_PCTL, "called"); - - if (!CheckFreeCommunicationPermissionImpl()) { - R_THROW(PCTL::ResultNoFreeCommunication); - } else { - states.free_communication = true; - R_SUCCEED(); - } -} - -Result IParentalControlService::ConfirmLaunchApplicationPermission( - InBuffer restriction_bitset, u64 nacp_flag, u64 application_id) { - LOG_WARNING(Service_PCTL, "(STUBBED) called, nacp_flag={:#x} application_id={:016X}", nacp_flag, - application_id); - R_SUCCEED(); -} - -Result IParentalControlService::ConfirmResumeApplicationPermission( - InBuffer restriction_bitset, u64 nacp_flag, u64 application_id) { - LOG_WARNING(Service_PCTL, "(STUBBED) called, nacp_flag={:#x} application_id={:016X}", nacp_flag, - application_id); - R_SUCCEED(); -} - -Result IParentalControlService::ConfirmSnsPostPermission() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_THROW(PCTL::ResultNoFreeCommunication); -} - -Result IParentalControlService::ConfirmSystemSettingsPermission() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_SUCCEED(); -} - -Result IParentalControlService::IsRestrictionTemporaryUnlocked( - Out out_is_temporary_unlocked) { - *out_is_temporary_unlocked = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, is_temporary_unlocked={}", - *out_is_temporary_unlocked); - R_SUCCEED(); -} - -Result IParentalControlService::IsRestrictedSystemSettingsEntered( - Out out_is_restricted_system_settings_entered) { - *out_is_restricted_system_settings_entered = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, is_temporary_unlocked={}", - *out_is_restricted_system_settings_entered); - R_SUCCEED(); -} - -Result IParentalControlService::ConfirmStereoVisionPermission() { - LOG_DEBUG(Service_PCTL, "called"); - states.stereo_vision = true; - R_SUCCEED(); -} - -Result IParentalControlService::EndFreeCommunication() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_SUCCEED(); -} - -Result IParentalControlService::IsFreeCommunicationAvailable() { - LOG_DEBUG(Service_PCTL, "(STUBBED) called"); - - if (!CheckFreeCommunicationPermissionImpl()) { - R_THROW(PCTL::ResultNoFreeCommunication); - } else { - R_SUCCEED(); - } -} - -Result IParentalControlService::IsRestrictionEnabled(Out out_restriction_enabled) { - LOG_DEBUG(Service_PCTL, "called"); - - if (False(capability & (Capability::Status | Capability::Recovery))) { - LOG_ERROR(Service_PCTL, "Application does not have Status or Recovery capabilities!"); - *out_restriction_enabled = false; - R_THROW(PCTL::ResultNoCapability); - } - - *out_restriction_enabled = pin_code[0] != '\0'; - R_SUCCEED(); -} - -Result IParentalControlService::GetSafetyLevel(Out out_safety_level) { - *out_safety_level = 0; - LOG_WARNING(Service_PCTL, "(STUBBED) called, safety_level={}", *out_safety_level); - R_SUCCEED(); -} - -Result IParentalControlService::GetCurrentSettings(Out out_settings) { - LOG_INFO(Service_PCTL, "called"); - *out_settings = restriction_settings; - R_SUCCEED(); -} - -Result IParentalControlService::GetFreeCommunicationApplicationListCount(Out out_count) { - *out_count = 4; - LOG_WARNING(Service_PCTL, "(STUBBED) called, count={}", *out_count); - R_SUCCEED(); -} - -Result IParentalControlService::ConfirmStereoVisionRestrictionConfigurable() { - LOG_DEBUG(Service_PCTL, "called"); - - if (False(capability & Capability::StereoVision)) { - LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); - R_THROW(PCTL::ResultNoCapability); - } - - if (pin_code[0] == '\0') { - R_THROW(PCTL::ResultNoRestrictionEnabled); - } - - R_SUCCEED(); -} - -Result IParentalControlService::IsStereoVisionPermitted(Out out_is_permitted) { - LOG_DEBUG(Service_PCTL, "called"); - - if (!ConfirmStereoVisionPermissionImpl()) { - *out_is_permitted = false; - R_THROW(PCTL::ResultStereoVisionRestricted); - } else { - *out_is_permitted = true; - R_SUCCEED(); - } -} - -Result IParentalControlService::GetPinCodeLength(Out out_length) { - *out_length = 0; - LOG_WARNING(Service_PCTL, "(STUBBED) called, length={}", *out_length); - R_SUCCEED(); -} - -Result IParentalControlService::IsPairingActive(Out out_is_pairing_active) { - *out_is_pairing_active = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, is_pairing_active={}", *out_is_pairing_active); - R_SUCCEED(); -} - -Result IParentalControlService::GetSynchronizationEvent( - OutCopyHandle out_event) { - LOG_INFO(Service_PCTL, "called"); - *out_event = synchronization_event.GetHandle(); - R_SUCCEED(); -} - -Result IParentalControlService::StartPlayTimer() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_SUCCEED(); -} - -Result IParentalControlService::StopPlayTimer() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_SUCCEED(); -} - -Result IParentalControlService::IsPlayTimerEnabled(Out out_is_play_timer_enabled) { - *out_is_play_timer_enabled = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, enabled={}", *out_is_play_timer_enabled); - R_SUCCEED(); -} - -Result IParentalControlService::GetPlayTimerRemainingTime(Out out_remaining_time) { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - *out_remaining_time = std::numeric_limits::max(); - R_SUCCEED(); -} - -Result IParentalControlService::IsRestrictedByPlayTimer(Out out_is_restricted_by_play_timer) { - *out_is_restricted_by_play_timer = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, restricted={}", *out_is_restricted_by_play_timer); - R_SUCCEED(); -} - -Result IParentalControlService::GetPlayTimerSettingsOld( - Out out_play_timer_settings) { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - *out_play_timer_settings = {}; - R_SUCCEED(); -} - -Result IParentalControlService::GetPlayTimerSettings(Out out_play_timer_settings) { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - *out_play_timer_settings = raw_play_timer_settings; - R_SUCCEED(); -} - -Result IParentalControlService::SetPlayTimerSettings(PlayTimerSettings play_timer_settings) { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - raw_play_timer_settings = play_timer_settings; - R_SUCCEED(); -} - -Result IParentalControlService::GetPlayTimerEventToRequestSuspension( - OutCopyHandle out_event) { - LOG_INFO(Service_PCTL, "called"); - *out_event = request_suspension_event.GetHandle(); - R_SUCCEED(); -} - -Result IParentalControlService::IsPlayTimerAlarmDisabled(Out out_play_timer_alarm_disabled) { - *out_play_timer_alarm_disabled = false; - LOG_INFO(Service_PCTL, "called, is_play_timer_alarm_disabled={}", - *out_play_timer_alarm_disabled); - R_SUCCEED(); -} - -Result IParentalControlService::GetPlayTimerRemainingTimeDisplayInfo(Out out_display_info) { - LOG_DEBUG(Service_PCTL, "called"); - *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; - R_SUCCEED(); -} - -Result IParentalControlService::Unknown1460(u8 in_unk, Out out_display_info) { - LOG_DEBUG(Service_PCTL, "called, in_unk={}", in_unk); - *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; - R_SUCCEED(); -} - -Result IParentalControlService::GetUnlinkedEvent(OutCopyHandle out_event) { - LOG_INFO(Service_PCTL, "called"); - *out_event = unlinked_event.GetHandle(); - R_SUCCEED(); -} - -Result IParentalControlService::GetStereoVisionRestriction( - Out out_stereo_vision_restriction) { - LOG_DEBUG(Service_PCTL, "called"); - - if (False(capability & Capability::StereoVision)) { - LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); - *out_stereo_vision_restriction = false; - R_THROW(PCTL::ResultNoCapability); - } - - *out_stereo_vision_restriction = settings.is_stero_vision_restricted; - R_SUCCEED(); -} - -Result IParentalControlService::SetStereoVisionRestriction(bool stereo_vision_restriction) { - LOG_DEBUG(Service_PCTL, "called, can_use={}", stereo_vision_restriction); - - if (False(capability & Capability::StereoVision)) { - LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); - R_THROW(PCTL::ResultNoCapability); - } - - SetStereoVisionRestrictionImpl(stereo_vision_restriction); - R_SUCCEED(); -} - -Result IParentalControlService::ResetConfirmedStereoVisionPermission() { - LOG_DEBUG(Service_PCTL, "called"); - - states.stereo_vision = false; - - R_SUCCEED(); -} - -} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/parental_control_service.h b/src/core/hle/service/pctl/parental_control_service.h deleted file mode 100644 index 9dabe3d059..0000000000 --- a/src/core/hle/service/pctl/parental_control_service.h +++ /dev/null @@ -1,99 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator -// Project// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/kernel_helpers.h" -#include "core/hle/service/os/event.h" -#include "core/hle/service/pctl/pctl_types.h" -#include "core/hle/service/service.h" - -namespace Service::PCTL { - -class IParentalControlService final : public ServiceFramework { -public: - explicit IParentalControlService(Core::System& system_, Capability capability_, - u64 program_id_); - ~IParentalControlService() override; - -private: - bool CheckFreeCommunicationPermissionImpl() const; - bool ConfirmStereoVisionPermissionImpl() const; - void SetStereoVisionRestrictionImpl(bool is_restricted); - - Result Initialize(); - Result CheckFreeCommunicationPermission(); - Result ConfirmLaunchApplicationPermission(InBuffer restriction_bitset, - u64 nacp_flag, u64 application_id); - Result ConfirmResumeApplicationPermission(InBuffer restriction_bitset, - u64 nacp_flag, u64 application_id); - Result ConfirmSnsPostPermission(); - Result ConfirmSystemSettingsPermission(); - Result IsRestrictionTemporaryUnlocked(Out out_is_temporary_unlocked); - Result IsRestrictedSystemSettingsEntered(Out out_is_restricted_system_settings_entered); - Result ConfirmStereoVisionPermission(); - Result EndFreeCommunication(); - Result IsFreeCommunicationAvailable(); - Result IsRestrictionEnabled(Out out_restriction_enabled); - Result GetSafetyLevel(Out out_safety_level); - Result GetCurrentSettings(Out out_settings); - Result GetFreeCommunicationApplicationListCount(Out out_count); - Result ConfirmStereoVisionRestrictionConfigurable(); - Result IsStereoVisionPermitted(Out out_is_permitted); - Result GetPinCodeLength(Out out_length); - Result IsPairingActive(Out out_is_pairing_active); - Result GetSynchronizationEvent(OutCopyHandle out_event); - Result StartPlayTimer(); - Result StopPlayTimer(); - Result IsPlayTimerEnabled(Out out_is_play_timer_enabled); - Result GetPlayTimerRemainingTime(Out out_remaining_time); - Result IsRestrictedByPlayTimer(Out out_is_restricted_by_play_timer); - Result GetPlayTimerSettingsOld(Out out_play_timer_settings); - Result GetPlayTimerEventToRequestSuspension(OutCopyHandle out_event); - Result IsPlayTimerAlarmDisabled(Out out_play_timer_alarm_disabled); - Result GetPlayTimerRemainingTimeDisplayInfo(Out out_display_info); - Result Unknown1460(u8 in_unk, Out out_display_info); - Result GetUnlinkedEvent(OutCopyHandle out_event); - Result GetStereoVisionRestriction(Out out_stereo_vision_restriction); - Result SetStereoVisionRestriction(bool stereo_vision_restriction); - Result ResetConfirmedStereoVisionPermission(); - Result GetPlayTimerSettings(Out out_play_timer_settings); - Result SetPlayTimerSettings(PlayTimerSettings out_play_timer_settings); - - struct States { - u64 current_tid{}; - ApplicationInfo application_info{}; - u64 tid_from_event{}; - bool launch_time_valid{}; - bool is_suspended{}; - bool temporary_unlocked{}; - bool free_communication{}; - bool stereo_vision{}; - }; - - struct ParentalControlSettings { - bool is_stero_vision_restricted{}; - bool is_free_communication_default_on{}; - bool disabled{}; - }; - - States states{}; - ParentalControlSettings settings{}; - RestrictionSettings restriction_settings{}; - std::array pin_code{}; - Capability capability{}; - u64 program_id{}; - // TODO: this is raw - PlayTimerSettings raw_play_timer_settings{}; - - KernelHelpers::ServiceContext service_context; - Event synchronization_event; - Event unlinked_event; - Event request_suspension_event; -}; - -} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/parental_control_service_factory.cpp b/src/core/hle/service/pctl/parental_control_service_factory.cpp deleted file mode 100644 index ae278a9bbc..0000000000 --- a/src/core/hle/service/pctl/parental_control_service_factory.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/core.h" -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/pctl/parental_control_service.h" -#include "core/hle/service/pctl/parental_control_service_factory.h" - -namespace Service::PCTL { - -IParentalControlServiceFactory::IParentalControlServiceFactory(Core::System& system_, - const char* name_, - Capability capability_) - : ServiceFramework{system_, name_}, capability{capability_} { - static const FunctionInfo functions[] = { - {0, D<&IParentalControlServiceFactory::CreateService>, "CreateService"}, - {1, D<&IParentalControlServiceFactory::CreateServiceWithoutInitialize>, - "CreateServiceWithoutInitialize"}, - }; - RegisterHandlers(functions); -} - -IParentalControlServiceFactory::~IParentalControlServiceFactory() = default; - -Result IParentalControlServiceFactory::CreateService( - Out> out_service, ClientProcessId process_id) { - LOG_DEBUG(Service_PCTL, "called, process_id={}", process_id.pid); - *out_service = std::make_shared( - system, capability, system.ResolveCallerProgramId(*process_id)); - R_SUCCEED(); -} - -Result IParentalControlServiceFactory::CreateServiceWithoutInitialize( - Out> out_service, ClientProcessId process_id) { - LOG_DEBUG(Service_PCTL, "called, process_id={}", process_id.pid); - *out_service = std::make_shared( - system, capability, system.ResolveCallerProgramId(*process_id)); - R_SUCCEED(); -} - -} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/parental_control_service_factory.h b/src/core/hle/service/pctl/parental_control_service_factory.h deleted file mode 100644 index 362988add1..0000000000 --- a/src/core/hle/service/pctl/parental_control_service_factory.h +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/pctl/pctl_types.h" -#include "core/hle/service/service.h" - -namespace Service::PCTL { - -class IParentalControlService; - -class IParentalControlServiceFactory : public ServiceFramework { -public: - explicit IParentalControlServiceFactory(Core::System& system_, const char* name_, - Capability capability_); - ~IParentalControlServiceFactory() override; - - Result CreateService(Out> out_service, - ClientProcessId process_id); - Result CreateServiceWithoutInitialize(Out> out_service, - ClientProcessId process_id); - -private: - Capability capability{}; -}; - -void LoopProcess(Core::System& system); - -} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/pctl.cpp b/src/core/hle/service/pctl/pctl.cpp index d92dbe2169..4f0fbbe702 100644 --- a/src/core/hle/service/pctl/pctl.cpp +++ b/src/core/hle/service/pctl/pctl.cpp @@ -1,27 +1,639 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "core/hle/service/pctl/parental_control_service_factory.h" +#include "common/common_funcs.h" +#include "core/file_sys/control_metadata.h" +#include "core/file_sys/patch_manager.h" +#include "core/hle/service/cmif_types.h" #include "core/hle/service/pctl/pctl.h" #include "core/hle/service/server_manager.h" +#include "core/hle/service/service.h" +#include "core/hle/service/cmif_serialization.h" namespace Service::PCTL { +constexpr Result ResultNoFreeCommunication{ErrorModule::PCTL, 101}; +constexpr Result ResultStereoVisionRestricted{ErrorModule::PCTL, 104}; +constexpr Result ResultNoCapability{ErrorModule::PCTL, 131}; +constexpr Result ResultNoRestrictionEnabled{ErrorModule::PCTL, 181}; + +enum class Capability : u32 { + None = 0, + Application = 1 << 0, + SnsPost = 1 << 1, + Recovery = 1 << 6, + Status = 1 << 8, + StereoVision = 1 << 9, + System = 1 << 15, +}; +DECLARE_ENUM_FLAG_OPERATORS(Capability); + +struct ApplicationInfo { + u64 application_id{}; + std::array age_rating{}; + u32 parental_control_flag{}; + Capability capability{}; +}; +static_assert(sizeof(ApplicationInfo) == 0x30, "ApplicationInfo has incorrect size."); + +// This is nn::pctl::RestrictionSettings +struct RestrictionSettings { + u8 rating_age; + bool sns_post_restriction; + bool free_communication_restriction; +}; +static_assert(sizeof(RestrictionSettings) == 0x3, "RestrictionSettings has incorrect size."); + +// This is nn::pctl::PlayTimerSettingsOld +struct PlayTimerSettingsOld { + std::array settings; +}; +static_assert(sizeof(PlayTimerSettingsOld) == 0x34, "PlayTimerSettingsOld has incorrect size."); + +// This is nn::pctl::PlayTimerSettings +struct PlayTimerSettings { + std::array settings; //21.0.0+ now takes 0x44 +}; +static_assert(sizeof(PlayTimerSettings) == 0x44, "PlayTimerSettings has incorrect size."); + +enum class PlayTimerDisplayState : u8 { + TimesUp = 0, + BedtimeAlarm = 1, + RemainingTime = 2, + Unknown3 = 3, + Unknown4 = 4, + Unknown5 = 5, + TimerDisabled = 6, + NotConfigured = 7, +}; + +// This is nn::pctl::PlayTimerRemainingTimeDisplayInfo +struct PlayTimerRemainingTimeDisplayInfo { + PlayTimerDisplayState state; + INSERT_PADDING_BYTES(0x7); + u64 unknown_08; + u64 remaining_time; +}; +static_assert(sizeof(PlayTimerRemainingTimeDisplayInfo) == 0x18, "PlayTimerRemainingTimeDisplayInfo has incorrect size."); + +class IParentalControlService final : public ServiceFramework { +public: + explicit IParentalControlService(Core::System& system_, Capability capability_, + u64 program_id_) + : ServiceFramework{system_, "IParentalControlService"}, capability{capability_}, + program_id{program_id_}, + service_context{system_, "IParentalControlService"}, synchronization_event{service_context}, + unlinked_event{service_context}, request_suspension_event{service_context} { + } + + ~IParentalControlService() override = default; + + bool CheckFreeCommunicationPermissionImpl() const { + if (states.temporary_unlocked) { + return true; + } + if ((states.application_info.parental_control_flag & 1) == 0) { + return true; + } + if (pin_code[0] == '\0') { + return true; + } + if (!settings.is_free_communication_default_on) { + return true; + } + // TODO(ogniK): Check for blacklisted/exempted applications. Return false can happen here + // but as we don't have multiproceses support yet, we can just assume our application is + // valid for the time being + return true; + } + + bool ConfirmStereoVisionPermissionImpl() const { + if (states.temporary_unlocked) { + return true; + } + if (pin_code[0] == '\0') { + return true; + } + if (!settings.is_stero_vision_restricted) { + return false; + } + return true; + } + + void SetStereoVisionRestrictionImpl(bool is_restricted) { + if (settings.disabled) { + return; + } + + if (pin_code[0] == '\0') { + return; + } + settings.is_stero_vision_restricted = is_restricted; + } + + Result Initialize() { + LOG_DEBUG(Service_PCTL, "called"); + + if (False(capability & (Capability::Application | Capability::System))) { + LOG_ERROR(Service_PCTL, "Invalid capability! capability={:X}", capability); + R_THROW(PCTL::ResultNoCapability); + } + + // TODO(ogniK): Recovery flag initialization for pctl:r + + if (program_id != 0) { + const FileSys::PatchManager pm{program_id, system.GetFileSystemController(), + system.GetContentProvider()}; + const auto control = pm.GetControlMetadata(); + if (control.first) { + states.tid_from_event = 0; + states.launch_time_valid = false; + states.is_suspended = false; + states.free_communication = false; + states.stereo_vision = false; + states.application_info = ApplicationInfo{ + .application_id = program_id, + .age_rating = control.first->GetRatingAge(), + .parental_control_flag = control.first->GetParentalControlFlag(), + .capability = capability, + }; + + if (False(capability & (Capability::System | Capability::Recovery))) { + // TODO(ogniK): Signal application launch event + } + } + } + + R_SUCCEED(); + } + + Result CheckFreeCommunicationPermission() { + LOG_DEBUG(Service_PCTL, "called"); + + if (!CheckFreeCommunicationPermissionImpl()) { + R_THROW(PCTL::ResultNoFreeCommunication); + } else { + states.free_communication = true; + R_SUCCEED(); + } + } + + Result ConfirmLaunchApplicationPermission( + InBuffer restriction_bitset, u64 nacp_flag, u64 application_id) { + LOG_WARNING(Service_PCTL, "(STUBBED) called, nacp_flag={:#x} application_id={:016X}", nacp_flag, + application_id); + R_SUCCEED(); + } + + Result ConfirmResumeApplicationPermission( + InBuffer restriction_bitset, u64 nacp_flag, u64 application_id) { + LOG_WARNING(Service_PCTL, "(STUBBED) called, nacp_flag={:#x} application_id={:016X}", nacp_flag, + application_id); + R_SUCCEED(); + } + + Result ConfirmSnsPostPermission() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_THROW(PCTL::ResultNoFreeCommunication); + } + + Result ConfirmSystemSettingsPermission() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_SUCCEED(); + } + + Result IsRestrictionTemporaryUnlocked( + Out out_is_temporary_unlocked) { + *out_is_temporary_unlocked = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, is_temporary_unlocked={}", + *out_is_temporary_unlocked); + R_SUCCEED(); + } + + Result IsRestrictedSystemSettingsEntered( + Out out_is_restricted_system_settings_entered) { + *out_is_restricted_system_settings_entered = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, is_temporary_unlocked={}", + *out_is_restricted_system_settings_entered); + R_SUCCEED(); + } + + Result ConfirmStereoVisionPermission() { + LOG_DEBUG(Service_PCTL, "called"); + states.stereo_vision = true; + R_SUCCEED(); + } + + Result EndFreeCommunication() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_SUCCEED(); + } + + Result IsFreeCommunicationAvailable() { + LOG_DEBUG(Service_PCTL, "(STUBBED) called"); + + if (!CheckFreeCommunicationPermissionImpl()) { + R_THROW(PCTL::ResultNoFreeCommunication); + } else { + R_SUCCEED(); + } + } + + Result IsRestrictionEnabled(Out out_restriction_enabled) { + LOG_DEBUG(Service_PCTL, "called"); + + if (False(capability & (Capability::Status | Capability::Recovery))) { + LOG_ERROR(Service_PCTL, "Application does not have Status or Recovery capabilities!"); + *out_restriction_enabled = false; + R_THROW(PCTL::ResultNoCapability); + } + + *out_restriction_enabled = pin_code[0] != '\0'; + R_SUCCEED(); + } + + Result GetSafetyLevel(Out out_safety_level) { + *out_safety_level = 0; + LOG_WARNING(Service_PCTL, "(STUBBED) called, safety_level={}", *out_safety_level); + R_SUCCEED(); + } + + Result GetCurrentSettings(Out out_settings) { + LOG_INFO(Service_PCTL, "called"); + *out_settings = restriction_settings; + R_SUCCEED(); + } + + Result GetFreeCommunicationApplicationListCount(Out out_count) { + *out_count = 4; + LOG_WARNING(Service_PCTL, "(STUBBED) called, count={}", *out_count); + R_SUCCEED(); + } + + Result ConfirmStereoVisionRestrictionConfigurable() { + LOG_DEBUG(Service_PCTL, "called"); + + if (False(capability & Capability::StereoVision)) { + LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); + R_THROW(PCTL::ResultNoCapability); + } + + if (pin_code[0] == '\0') { + R_THROW(PCTL::ResultNoRestrictionEnabled); + } + + R_SUCCEED(); + } + + Result IsStereoVisionPermitted(Out out_is_permitted) { + LOG_DEBUG(Service_PCTL, "called"); + + if (!ConfirmStereoVisionPermissionImpl()) { + *out_is_permitted = false; + R_THROW(PCTL::ResultStereoVisionRestricted); + } else { + *out_is_permitted = true; + R_SUCCEED(); + } + } + + Result GetPinCodeLength(Out out_length) { + *out_length = 0; + LOG_WARNING(Service_PCTL, "(STUBBED) called, length={}", *out_length); + R_SUCCEED(); + } + + Result IsPairingActive(Out out_is_pairing_active) { + *out_is_pairing_active = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, is_pairing_active={}", *out_is_pairing_active); + R_SUCCEED(); + } + + Result GetSynchronizationEvent( + OutCopyHandle out_event) { + LOG_INFO(Service_PCTL, "called"); + *out_event = synchronization_event.GetHandle(); + R_SUCCEED(); + } + + Result StartPlayTimer() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_SUCCEED(); + } + + Result StopPlayTimer() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_SUCCEED(); + } + + Result IsPlayTimerEnabled(Out out_is_play_timer_enabled) { + *out_is_play_timer_enabled = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, enabled={}", *out_is_play_timer_enabled); + R_SUCCEED(); + } + + Result GetPlayTimerRemainingTime(Out out_remaining_time) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + *out_remaining_time = std::numeric_limits::max(); + R_SUCCEED(); + } + + Result IsRestrictedByPlayTimer(Out out_is_restricted_by_play_timer) { + *out_is_restricted_by_play_timer = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, restricted={}", *out_is_restricted_by_play_timer); + R_SUCCEED(); + } + + Result GetPlayTimerSettingsOld( + Out out_play_timer_settings) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + *out_play_timer_settings = {}; + R_SUCCEED(); + } + + Result GetPlayTimerSettings(Out out_play_timer_settings) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + *out_play_timer_settings = raw_play_timer_settings; + R_SUCCEED(); + } + + Result SetPlayTimerSettings(PlayTimerSettings play_timer_settings) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + raw_play_timer_settings = play_timer_settings; + R_SUCCEED(); + } + + Result GetPlayTimerEventToRequestSuspension( + OutCopyHandle out_event) { + LOG_INFO(Service_PCTL, "called"); + *out_event = request_suspension_event.GetHandle(); + R_SUCCEED(); + } + + Result IsPlayTimerAlarmDisabled(Out out_play_timer_alarm_disabled) { + *out_play_timer_alarm_disabled = false; + LOG_INFO(Service_PCTL, "called, is_play_timer_alarm_disabled={}", + *out_play_timer_alarm_disabled); + R_SUCCEED(); + } + + Result GetPlayTimerRemainingTimeDisplayInfo(Out out_display_info) { + LOG_DEBUG(Service_PCTL, "called"); + *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; + R_SUCCEED(); + } + + Result Unknown1460(u8 in_unk, Out out_display_info) { + LOG_DEBUG(Service_PCTL, "called, in_unk={}", in_unk); + *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; + R_SUCCEED(); + } + + Result GetUnlinkedEvent(OutCopyHandle out_event) { + LOG_INFO(Service_PCTL, "called"); + *out_event = unlinked_event.GetHandle(); + R_SUCCEED(); + } + + Result GetStereoVisionRestriction( + Out out_stereo_vision_restriction) { + LOG_DEBUG(Service_PCTL, "called"); + + if (False(capability & Capability::StereoVision)) { + LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); + *out_stereo_vision_restriction = false; + R_THROW(PCTL::ResultNoCapability); + } + + *out_stereo_vision_restriction = settings.is_stero_vision_restricted; + R_SUCCEED(); + } + + Result SetStereoVisionRestriction(bool stereo_vision_restriction) { + LOG_DEBUG(Service_PCTL, "called, can_use={}", stereo_vision_restriction); + + if (False(capability & Capability::StereoVision)) { + LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); + R_THROW(PCTL::ResultNoCapability); + } + + SetStereoVisionRestrictionImpl(stereo_vision_restriction); + R_SUCCEED(); + } + + Result ResetConfirmedStereoVisionPermission() { + LOG_DEBUG(Service_PCTL, "called"); + + states.stereo_vision = false; + + R_SUCCEED(); + } + + struct States { + u64 current_tid{}; + ApplicationInfo application_info{}; + u64 tid_from_event{}; + bool launch_time_valid{}; + bool is_suspended{}; + bool temporary_unlocked{}; + bool free_communication{}; + bool stereo_vision{}; + }; + + struct ParentalControlSettings { + bool is_stero_vision_restricted{}; + bool is_free_communication_default_on{}; + bool disabled{}; + }; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, D<&IParentalControlService::Initialize>, "Initialize"}, + FunctionInfo{1001, D<&IParentalControlService::CheckFreeCommunicationPermission>, "CheckFreeCommunicationPermission"}, + FunctionInfo{1002, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"}, + FunctionInfo{1003, D<&IParentalControlService::ConfirmResumeApplicationPermission>, "ConfirmResumeApplicationPermission"}, + FunctionInfo{1004, D<&IParentalControlService::ConfirmSnsPostPermission>, "ConfirmSnsPostPermission"}, + FunctionInfo{1005, D<&IParentalControlService::ConfirmSystemSettingsPermission>, "ConfirmSystemSettingsPermission"}, + FunctionInfo{1006, D<&IParentalControlService::IsRestrictionTemporaryUnlocked>, "IsRestrictionTemporaryUnlocked"}, + FunctionInfo{1007, nullptr, "RevertRestrictionTemporaryUnlocked"}, + FunctionInfo{1008, nullptr, "EnterRestrictedSystemSettings"}, + FunctionInfo{1009, nullptr, "LeaveRestrictedSystemSettings"}, + FunctionInfo{1010, D<&IParentalControlService::IsRestrictedSystemSettingsEntered>, "IsRestrictedSystemSettingsEntered"}, + FunctionInfo{1011, nullptr, "RevertRestrictedSystemSettingsEntered"}, + FunctionInfo{1012, nullptr, "GetRestrictedFeatures"}, + FunctionInfo{1013, D<&IParentalControlService::ConfirmStereoVisionPermission>, "ConfirmStereoVisionPermission"}, + FunctionInfo{1014, nullptr, "ConfirmPlayableApplicationVideoOld"}, + FunctionInfo{1015, nullptr, "ConfirmPlayableApplicationVideo"}, + FunctionInfo{1016, nullptr, "ConfirmShowNewsPermission"}, + FunctionInfo{1017, D<&IParentalControlService::EndFreeCommunication>, "EndFreeCommunication"}, + FunctionInfo{1018, D<&IParentalControlService::IsFreeCommunicationAvailable>, "IsFreeCommunicationAvailable"}, + FunctionInfo{1019, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"}, + FunctionInfo{1020, nullptr, "ConfirmLaunchSharedApplicationPermission", MakeVersionGate({20,0,0})}, + FunctionInfo{1021, nullptr, "TryBeginFreeCommunicationForStreamPlay", MakeVersionGate({21,0,0})}, + FunctionInfo{1022, nullptr, "EndFreeCommunicationForStreamPlay", MakeVersionGate({21,0,0})}, + FunctionInfo{1031, D<&IParentalControlService::IsRestrictionEnabled>, "IsRestrictionEnabled"}, + FunctionInfo{1032, D<&IParentalControlService::GetSafetyLevel>, "GetSafetyLevel"}, + FunctionInfo{1033, nullptr, "SetSafetyLevel"}, + FunctionInfo{1034, nullptr, "GetSafetyLevelSettings"}, + FunctionInfo{1035, D<&IParentalControlService::GetCurrentSettings>, "GetCurrentSettings"}, + FunctionInfo{1036, nullptr, "SetCustomSafetyLevelSettings"}, + FunctionInfo{1037, nullptr, "GetDefaultRatingOrganization"}, + FunctionInfo{1038, nullptr, "SetDefaultRatingOrganization"}, + FunctionInfo{1039, D<&IParentalControlService::GetFreeCommunicationApplicationListCount>, "GetFreeCommunicationApplicationListCount"}, + FunctionInfo{1042, nullptr, "AddToFreeCommunicationApplicationList"}, + FunctionInfo{1043, nullptr, "DeleteSettings"}, + FunctionInfo{1044, nullptr, "GetFreeCommunicationApplicationList"}, + FunctionInfo{1045, nullptr, "UpdateFreeCommunicationApplicationList"}, + FunctionInfo{1046, nullptr, "DisableFeaturesForReset"}, + FunctionInfo{1047, nullptr, "NotifyApplicationDownloadStarted"}, + FunctionInfo{1048, nullptr, "NotifyNetworkProfileCreated"}, + FunctionInfo{1049, nullptr, "ResetFreeCommunicationApplicationList"}, + FunctionInfo{1050, nullptr, "AddToFreeCommunicationApplicationList", MakeVersionGate({20,0,0})}, + FunctionInfo{1051, nullptr, "NotifyApplicationDownloadStarted", MakeVersionGate({20,0,0})}, + FunctionInfo{1061, D<&IParentalControlService::ConfirmStereoVisionRestrictionConfigurable>, "ConfirmStereoVisionRestrictionConfigurable"}, + FunctionInfo{1062, D<&IParentalControlService::GetStereoVisionRestriction>, "GetStereoVisionRestriction"}, + FunctionInfo{1063, D<&IParentalControlService::SetStereoVisionRestriction>, "SetStereoVisionRestriction"}, + FunctionInfo{1064, D<&IParentalControlService::ResetConfirmedStereoVisionPermission>, "ResetConfirmedStereoVisionPermission"}, + FunctionInfo{1065, D<&IParentalControlService::IsStereoVisionPermitted>, "IsStereoVisionPermitted"}, + FunctionInfo{1201, nullptr, "UnlockRestrictionTemporarily"}, + FunctionInfo{1202, nullptr, "UnlockSystemSettingsRestriction"}, + FunctionInfo{1203, nullptr, "SetPinCode"}, + FunctionInfo{1204, nullptr, "GenerateInquiryCode"}, + FunctionInfo{1205, nullptr, "CheckMasterKey"}, + FunctionInfo{1206, D<&IParentalControlService::GetPinCodeLength>, "GetPinCodeLength"}, + FunctionInfo{1207, nullptr, "GetPinCodeChangedEvent"}, + FunctionInfo{1208, nullptr, "GetPinCode"}, + FunctionInfo{1403, D<&IParentalControlService::IsPairingActive>, "IsPairingActive"}, + FunctionInfo{1406, nullptr, "GetSettingsLastUpdated"}, + FunctionInfo{1411, nullptr, "GetPairingAccountInfo"}, + FunctionInfo{1421, nullptr, "GetAccountNickname"}, + FunctionInfo{1424, nullptr, "GetAccountState"}, + FunctionInfo{1425, nullptr, "RequestPostEvents"}, + FunctionInfo{1426, nullptr, "GetPostEventInterval"}, + FunctionInfo{1427, nullptr, "SetPostEventInterval"}, + FunctionInfo{1432, D<&IParentalControlService::GetSynchronizationEvent>, "GetSynchronizationEvent"}, + FunctionInfo{1451, D<&IParentalControlService::StartPlayTimer>, "StartPlayTimer"}, + FunctionInfo{1452, D<&IParentalControlService::StopPlayTimer>, "StopPlayTimer"}, + FunctionInfo{1453, D<&IParentalControlService::IsPlayTimerEnabled>, "IsPlayTimerEnabled"}, + FunctionInfo{1454, D<&IParentalControlService::GetPlayTimerRemainingTime>, "GetPlayTimerRemainingTime"}, + FunctionInfo{1455, D<&IParentalControlService::IsRestrictedByPlayTimer>, "IsRestrictedByPlayTimer"}, + FunctionInfo{1456, D<&IParentalControlService::GetPlayTimerSettingsOld>, "GetPlayTimerSettingsOld"}, + FunctionInfo{1457, D<&IParentalControlService::GetPlayTimerEventToRequestSuspension>, "GetPlayTimerEventToRequestSuspension"}, + FunctionInfo{1458, D<&IParentalControlService::IsPlayTimerAlarmDisabled>, "IsPlayTimerAlarmDisabled"}, + FunctionInfo{1459, D<&IParentalControlService::GetPlayTimerRemainingTimeDisplayInfo>, "GetPlayTimerRemainingTimeDisplayInfo"}, + FunctionInfo{1460, D<&IParentalControlService::Unknown1460>, "Unknown1460"}, + FunctionInfo{1471, nullptr, "NotifyWrongPinCodeInputManyTimes"}, + FunctionInfo{1472, nullptr, "CancelNetworkRequest"}, + FunctionInfo{1473, D<&IParentalControlService::GetUnlinkedEvent>, "GetUnlinkedEvent"}, + FunctionInfo{1474, nullptr, "ClearUnlinkedEvent"}, + FunctionInfo{1475, nullptr, "GetExtendedPlayTimerEvent", MakeVersionGate({18,0,0})}, + FunctionInfo{1601, nullptr, "DisableAllFeatures"}, + FunctionInfo{1602, nullptr, "PostEnableAllFeatures"}, + FunctionInfo{1603, nullptr, "IsAllFeaturesDisabled"}, + FunctionInfo{1901, nullptr, "DeleteFromFreeCommunicationApplicationListForDebug"}, + FunctionInfo{1902, nullptr, "ClearFreeCommunicationApplicationListForDebug"}, + FunctionInfo{1903, nullptr, "GetExemptApplicationListCountForDebug"}, + FunctionInfo{1904, nullptr, "GetExemptApplicationListForDebug"}, + FunctionInfo{1905, nullptr, "UpdateExemptApplicationListForDebug"}, + FunctionInfo{1906, nullptr, "AddToExemptApplicationListForDebug"}, + FunctionInfo{1907, nullptr, "DeleteFromExemptApplicationListForDebug"}, + FunctionInfo{1908, nullptr, "ClearExemptApplicationListForDebug"}, + FunctionInfo{1941, nullptr, "DeletePairing"}, + FunctionInfo{1951, nullptr, "SetPlayTimerSettingsForDebug"}, + FunctionInfo{1952, nullptr, "GetPlayTimerSpentTimeForTest"}, + FunctionInfo{1953, nullptr, "SetPlayTimerAlarmDisabledForDebug"}, + FunctionInfo{1954, nullptr, "IsBedtimeAlarmEnabled", MakeVersionGate({18,0,0})}, + FunctionInfo{1955, nullptr, "GetBedtimeAlarmTime", MakeVersionGate({18,0,0})}, + FunctionInfo{1956, nullptr, "GetBedtimeAlarmTimeHour", MakeVersionGate({18,0,0})}, + FunctionInfo{1957, nullptr, "GetBedtimeAlarmTimeMinute", MakeVersionGate({18,0,0})}, + FunctionInfo{2001, nullptr, "RequestPairingAsync"}, + FunctionInfo{2002, nullptr, "FinishRequestPairing"}, + FunctionInfo{2003, nullptr, "AuthorizePairingAsync"}, + FunctionInfo{2004, nullptr, "FinishAuthorizePairing"}, + FunctionInfo{2005, nullptr, "RetrievePairingInfoAsync"}, + FunctionInfo{2006, nullptr, "FinishRetrievePairingInfo"}, + FunctionInfo{2007, nullptr, "UnlinkPairingAsync"}, + FunctionInfo{2008, nullptr, "FinishUnlinkPairing"}, + FunctionInfo{2009, nullptr, "GetAccountMiiImageAsync"}, + FunctionInfo{2010, nullptr, "FinishGetAccountMiiImage"}, + FunctionInfo{2011, nullptr, "GetAccountMiiImageContentTypeAsync"}, + FunctionInfo{2012, nullptr, "FinishGetAccountMiiImageContentType"}, + FunctionInfo{2013, nullptr, "SynchronizeParentalControlSettingsAsync"}, + FunctionInfo{2014, nullptr, "FinishSynchronizeParentalControlSettings"}, + FunctionInfo{2015, nullptr, "FinishSynchronizeParentalControlSettingsWithLastUpdated"}, + FunctionInfo{2016, nullptr, "RequestUpdateExemptionListAsync", MakeVersionGate({5,0,0})}, + FunctionInfo{145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings", MakeVersionGate({18,0,0})}, + FunctionInfo{2017, nullptr, "AuthorizePairingAsync", MakeVersionGate({19,0,0})}, + FunctionInfo{2019, nullptr, "RequestUpdateDeviceUsersBackground", MakeVersionGate({19,0,0})}, + FunctionInfo{2021, nullptr, "RequestCopyPairingAsync", MakeVersionGate({20,0,0})}, + FunctionInfo{2022, nullptr, "FinishRequestCopyPairing", MakeVersionGate({20,0,0})}, + FunctionInfo{2023, nullptr, "IsFromPairingActiveDevice", MakeVersionGate({20,0,0})}, + FunctionInfo{2024, nullptr, "RollbackCopyPairing", MakeVersionGate({21,0,0})}, + FunctionInfo{3001, nullptr, "GetErrorContextChangedEvent", MakeVersionGate({20,0,0})}, + FunctionInfo{145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings", MakeVersionGate({18,0,0})}, + FunctionInfo{195101, D<&IParentalControlService::SetPlayTimerSettings>, "SetPlayTimerSettingsForDebug", MakeVersionGate({18,0,0})} + ); + States states{}; + ParentalControlSettings settings{}; + RestrictionSettings restriction_settings{}; + std::array pin_code{}; + Capability capability{}; + u64 program_id{}; + // TODO: this is raw + PlayTimerSettings raw_play_timer_settings{}; + + KernelHelpers::ServiceContext service_context; + Event synchronization_event; + Event unlinked_event; + Event request_suspension_event; +}; + +class IParentalControlServiceFactory : public ServiceFramework { +public: + explicit IParentalControlServiceFactory(Core::System& system_, const char* name_, Capability capability_) + : ServiceFramework{system_, name_}, capability{capability_} + {} + + ~IParentalControlServiceFactory() override = default; + + Result CreateService(Out> out_service, ClientProcessId process_id) { + LOG_DEBUG(Service_PCTL, "called, process_id={}", process_id.pid); + *out_service = std::make_shared( + system, capability, system.ResolveCallerProgramId(*process_id)); + R_SUCCEED(); + } + + Result CreateServiceWithoutInitialize(Out> out_service, ClientProcessId process_id) { + LOG_DEBUG(Service_PCTL, "called, process_id={}", process_id.pid); + *out_service = std::make_shared( + system, capability, system.ResolveCallerProgramId(*process_id)); + R_SUCCEED(); + } + +private: + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IParentalControlServiceFactory::CreateService>, "CreateService"}, + FunctionInfo{1, D<&IParentalControlServiceFactory::CreateServiceWithoutInitialize>, "CreateServiceWithoutInitialize"} + ); + Capability capability{}; +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); - server_manager->RegisterNamedService("pctl", - std::make_shared( - system, "pctl", - Capability::Application | Capability::SnsPost | - Capability::Status | Capability::StereoVision)); + server_manager->RegisterNamedService("pctl", std::make_shared(system, "pctl", Capability::Application | Capability::SnsPost | Capability::Status | Capability::StereoVision)); // TODO(ogniK): Implement remaining capabilities - server_manager->RegisterNamedService("pctl:a", std::make_shared( - system, "pctl:a", Capability::None)); - server_manager->RegisterNamedService("pctl:r", std::make_shared( - system, "pctl:r", Capability::None)); - server_manager->RegisterNamedService("pctl:s", std::make_shared( - system, "pctl:s", Capability::None)); + server_manager->RegisterNamedService("pctl:a", std::make_shared(system, "pctl:a", Capability::None)); + server_manager->RegisterNamedService("pctl:r", std::make_shared(system, "pctl:r", Capability::None)); + server_manager->RegisterNamedService("pctl:s", std::make_shared(system, "pctl:s", Capability::None)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/pctl/pctl_results.h b/src/core/hle/service/pctl/pctl_results.h deleted file mode 100644 index 1fc54727b7..0000000000 --- a/src/core/hle/service/pctl/pctl_results.h +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/result.h" - -namespace Service::PCTL { - -constexpr Result ResultNoFreeCommunication{ErrorModule::PCTL, 101}; -constexpr Result ResultStereoVisionRestricted{ErrorModule::PCTL, 104}; -constexpr Result ResultNoCapability{ErrorModule::PCTL, 131}; -constexpr Result ResultNoRestrictionEnabled{ErrorModule::PCTL, 181}; - -} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/pctl_types.h b/src/core/hle/service/pctl/pctl_types.h deleted file mode 100644 index 3a5a19099d..0000000000 --- a/src/core/hle/service/pctl/pctl_types.h +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/common_funcs.h" - -namespace Service::PCTL { - -enum class Capability : u32 { - None = 0, - Application = 1 << 0, - SnsPost = 1 << 1, - Recovery = 1 << 6, - Status = 1 << 8, - StereoVision = 1 << 9, - System = 1 << 15, -}; -DECLARE_ENUM_FLAG_OPERATORS(Capability); - -struct ApplicationInfo { - u64 application_id{}; - std::array age_rating{}; - u32 parental_control_flag{}; - Capability capability{}; -}; -static_assert(sizeof(ApplicationInfo) == 0x30, "ApplicationInfo has incorrect size."); - -// This is nn::pctl::RestrictionSettings -struct RestrictionSettings { - u8 rating_age; - bool sns_post_restriction; - bool free_communication_restriction; -}; -static_assert(sizeof(RestrictionSettings) == 0x3, "RestrictionSettings has incorrect size."); - -// This is nn::pctl::PlayTimerSettingsOld -struct PlayTimerSettingsOld { - std::array settings; -}; -static_assert(sizeof(PlayTimerSettingsOld) == 0x34, "PlayTimerSettingsOld has incorrect size."); - -// This is nn::pctl::PlayTimerSettings -struct PlayTimerSettings { - std::array settings; //21.0.0+ now takes 0x44 -}; -static_assert(sizeof(PlayTimerSettings) == 0x44, "PlayTimerSettings has incorrect size."); - -enum class PlayTimerDisplayState : u8 { - TimesUp = 0, - BedtimeAlarm = 1, - RemainingTime = 2, - Unknown3 = 3, - Unknown4 = 4, - Unknown5 = 5, - TimerDisabled = 6, - NotConfigured = 7, -}; - -// This is nn::pctl::PlayTimerRemainingTimeDisplayInfo -struct PlayTimerRemainingTimeDisplayInfo { - PlayTimerDisplayState state; - INSERT_PADDING_BYTES(0x7); - u64 unknown_08; - u64 remaining_time; -}; -static_assert(sizeof(PlayTimerRemainingTimeDisplayInfo) == 0x18, - "PlayTimerRemainingTimeDisplayInfo has incorrect size."); - -} // namespace Service::PCTL diff --git a/src/core/hle/service/pcv/pcv.cpp b/src/core/hle/service/pcv/pcv.cpp index 1b314f3518..bb3d748527 100644 --- a/src/core/hle/service/pcv/pcv.cpp +++ b/src/core/hle/service/pcv/pcv.cpp @@ -15,91 +15,76 @@ namespace Service::PCV { class PCV final : public ServiceFramework { public: - explicit PCV(Core::System& system_) : ServiceFramework{system_, "pcv"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "SetPowerEnabled"}, - {1, nullptr, "SetClockEnabled"}, - {2, nullptr, "SetClockRate"}, - {3, nullptr, "GetClockRate"}, - {4, nullptr, "GetState"}, - {5, nullptr, "GetPossibleClockRates"}, - {6, nullptr, "SetMinVClockRate"}, - {7, nullptr, "SetReset"}, - {8, nullptr, "SetVoltageEnabled"}, - {9, nullptr, "GetVoltageEnabled"}, - {10, nullptr, "GetVoltageRange"}, - {11, nullptr, "SetVoltageValue"}, - {12, nullptr, "GetVoltageValue"}, - {13, nullptr, "GetTemperatureThresholds"}, - {14, nullptr, "SetTemperature"}, - {15, nullptr, "Initialize"}, - {16, nullptr, "IsInitialized"}, - {17, nullptr, "Finalize"}, - {18, nullptr, "PowerOn"}, - {19, nullptr, "PowerOff"}, - {20, nullptr, "ChangeVoltage"}, - {21, nullptr, "GetPowerClockInfoEvent"}, - {22, nullptr, "GetOscillatorClock"}, - {23, nullptr, "GetDvfsTable"}, - {24, nullptr, "GetModuleStateTable"}, - {25, nullptr, "GetPowerDomainStateTable"}, - {26, nullptr, "GetFuseInfo"}, - {27, nullptr, "GetDramId"}, - {28, nullptr, "IsPoweredOn"}, - {29, nullptr, "GetVoltage"}, - }; - // clang-format on + explicit PCV(Core::System& system_) : ServiceFramework{system_, "pcv"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetPowerEnabled"}, + FunctionInfo{1, nullptr, "SetClockEnabled"}, + FunctionInfo{2, nullptr, "SetClockRate"}, + FunctionInfo{3, nullptr, "GetClockRate"}, + FunctionInfo{4, nullptr, "GetState"}, + FunctionInfo{5, nullptr, "GetPossibleClockRates"}, + FunctionInfo{6, nullptr, "SetMinVClockRate"}, + FunctionInfo{7, nullptr, "SetReset"}, + FunctionInfo{8, nullptr, "SetVoltageEnabled"}, + FunctionInfo{9, nullptr, "GetVoltageEnabled"}, + FunctionInfo{10, nullptr, "GetVoltageRange"}, + FunctionInfo{11, nullptr, "SetVoltageValue"}, + FunctionInfo{12, nullptr, "GetVoltageValue"}, + FunctionInfo{13, nullptr, "GetTemperatureThresholds"}, + FunctionInfo{14, nullptr, "SetTemperature"}, + FunctionInfo{15, nullptr, "Initialize"}, + FunctionInfo{16, nullptr, "IsInitialized"}, + FunctionInfo{17, nullptr, "Finalize"}, + FunctionInfo{18, nullptr, "PowerOn"}, + FunctionInfo{19, nullptr, "PowerOff"}, + FunctionInfo{20, nullptr, "ChangeVoltage"}, + FunctionInfo{21, nullptr, "GetPowerClockInfoEvent"}, + FunctionInfo{22, nullptr, "GetOscillatorClock"}, + FunctionInfo{23, nullptr, "GetDvfsTable"}, + FunctionInfo{24, nullptr, "GetModuleStateTable"}, + FunctionInfo{25, nullptr, "GetPowerDomainStateTable"}, + FunctionInfo{26, nullptr, "GetFuseInfo"}, + FunctionInfo{27, nullptr, "GetDramId"}, + FunctionInfo{28, nullptr, "IsPoweredOn"}, + FunctionInfo{29, nullptr, "GetVoltage"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class PCV_ARB final : public ServiceFramework { public: - explicit PCV_ARB(Core::System& system_) : ServiceFramework{system_, "pcv:arb"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "ReleaseControl"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit PCV_ARB(Core::System& system_) : ServiceFramework{system_, "pcv:arb"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "ReleaseControl"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class PCV_IMM final : public ServiceFramework { public: - explicit PCV_IMM(Core::System& system_) : ServiceFramework{system_, "pcv:imm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "SetClockRate"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit PCV_IMM(Core::System& system_) : ServiceFramework{system_, "pcv:imm"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetClockRate"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IClkrstSession final : public ServiceFramework { public: explicit IClkrstSession(Core::System& system_, DeviceCode device_code_) - : ServiceFramework{system_, "IClkrstSession"}, device_code(device_code_) { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "SetClockEnabled"}, - {1, nullptr, "SetClockDisabled"}, - {2, nullptr, "SetResetAsserted"}, - {3, nullptr, "SetResetDeasserted"}, - {4, nullptr, "SetPowerEnabled"}, - {5, nullptr, "SetPowerDisabled"}, - {6, nullptr, "GetState"}, - {7, &IClkrstSession::SetClockRate, "SetClockRate"}, - {8, &IClkrstSession::GetClockRate, "GetClockRate"}, - {9, nullptr, "SetMinVClockRate"}, - {10, nullptr, "GetPossibleClockRates"}, - {11, nullptr, "GetDvfsTable"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "IClkrstSession"}, device_code(device_code_) {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -120,25 +105,30 @@ private: rb.Push(clock_rate); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetClockEnabled"}, + FunctionInfo{1, nullptr, "SetClockDisabled"}, + FunctionInfo{2, nullptr, "SetResetAsserted"}, + FunctionInfo{3, nullptr, "SetResetDeasserted"}, + FunctionInfo{4, nullptr, "SetPowerEnabled"}, + FunctionInfo{5, nullptr, "SetPowerDisabled"}, + FunctionInfo{6, nullptr, "GetState"}, + FunctionInfo{7, &IClkrstSession::SetClockRate, "SetClockRate"}, + FunctionInfo{8, &IClkrstSession::GetClockRate, "GetClockRate"}, + FunctionInfo{9, nullptr, "SetMinVClockRate"}, + FunctionInfo{10, nullptr, "GetPossibleClockRates"}, + FunctionInfo{11, nullptr, "GetDvfsTable"} + ); DeviceCode device_code; u32 clock_rate{}; }; class CLKRST final : public ServiceFramework { public: - explicit CLKRST(Core::System& system_, const char* name) : ServiceFramework{system_, name} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &CLKRST::OpenSession, "OpenSession"}, - {1, nullptr, "GetTemperatureThresholds"}, - {2, nullptr, "SetTemperature"}, - {3, nullptr, "GetModuleStateTable"}, - {4, nullptr, "GetModuleStateTableEvent"}, - {5, nullptr, "GetModuleStateTableMaxCount"}, - }; - // clang-format on + explicit CLKRST(Core::System& system_, const char* name) : ServiceFramework{system_, name} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -153,18 +143,26 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system, device_code); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &CLKRST::OpenSession, "OpenSession"}, + FunctionInfo{1, nullptr, "GetTemperatureThresholds"}, + FunctionInfo{2, nullptr, "SetTemperature"}, + FunctionInfo{3, nullptr, "GetModuleStateTable"}, + FunctionInfo{4, nullptr, "GetModuleStateTableEvent"}, + FunctionInfo{5, nullptr, "GetModuleStateTableMaxCount"} + ); }; class CLKRST_A final : public ServiceFramework { public: - explicit CLKRST_A(Core::System& system_) : ServiceFramework{system_, "clkrst:a"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "ReleaseControl"}, - }; - // clang-format on + explicit CLKRST_A(Core::System& system_) : ServiceFramework{system_, "clkrst:a"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "ReleaseControl"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp index ff7053b690..3d431c305f 100644 --- a/src/core/hle/service/pm/pm.cpp +++ b/src/core/hle/service/pm/pm.cpp @@ -47,13 +47,7 @@ void GetApplicationPidGeneric(Kernel::KernelCore& kernel, HLERequestContext& ctx class BootMode final : public ServiceFramework { public: - explicit BootMode(Core::System& system_) : ServiceFramework{system_, "pm:bm"} { - static const FunctionInfo functions[] = { - {0, &BootMode::GetBootMode, "GetBootMode"}, - {1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"}, - }; - RegisterHandlers(functions); - } + explicit BootMode(Core::System& system_) : ServiceFramework{system_, "pm:bm"} {} private: void GetBootMode(HLERequestContext& ctx) { @@ -73,28 +67,19 @@ private: rb.Push(ResultSuccess); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &BootMode::GetBootMode, "GetBootMode"}, + FunctionInfo{1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"} + ); SystemBootMode boot_mode = SystemBootMode::Normal; }; class DebugMonitor final : public ServiceFramework { public: - explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "pm:dmnt"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetJitDebugProcessIdList"}, - {1, nullptr, "StartProcess"}, - {2, &DebugMonitor::GetProcessId, "GetProcessId"}, - {3, nullptr, "HookToCreateProcess"}, - {4, &DebugMonitor::GetApplicationProcessId, "GetApplicationProcessId"}, - {5, nullptr, "HookToCreateApplicationProgress"}, - {6, nullptr, "ClearHook"}, - {65000, &DebugMonitor::AtmosphereGetProcessInfo, "AtmosphereGetProcessInfo"}, - {65001, nullptr, "AtmosphereGetCurrentLimitInfo"}, - }; - // clang-format on - - RegisterHandlers(functions); - } + explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "pm:dmnt"} {} private: void GetProcessId(HLERequestContext& ctx) { @@ -164,19 +149,26 @@ private: rb.PushRaw(program_location); rb.PushRaw(override_status); } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetJitDebugProcessIdList"}, + FunctionInfo{1, nullptr, "StartProcess"}, + FunctionInfo{2, &DebugMonitor::GetProcessId, "GetProcessId"}, + FunctionInfo{3, nullptr, "HookToCreateProcess"}, + FunctionInfo{4, &DebugMonitor::GetApplicationProcessId, "GetApplicationProcessId"}, + FunctionInfo{5, nullptr, "HookToCreateApplicationProgress"}, + FunctionInfo{6, nullptr, "ClearHook"}, + FunctionInfo{65000, &DebugMonitor::AtmosphereGetProcessInfo, "AtmosphereGetProcessInfo"}, + FunctionInfo{65001, nullptr, "AtmosphereGetCurrentLimitInfo"} + ); }; class Info final : public ServiceFramework { public: - explicit Info(Core::System& system_) : ServiceFramework{system_, "pm:info"} { - static const FunctionInfo functions[] = { - {0, &Info::GetProgramId, "GetProgramId"}, - {65000, &Info::AtmosphereGetProcessId, "AtmosphereGetProcessId"}, - {65001, nullptr, "AtmosphereHasLaunchedProgram"}, - {65002, nullptr, "AtmosphereGetProcessInfo"}, - }; - RegisterHandlers(functions); - } + explicit Info(Core::System& system_) : ServiceFramework{system_, "pm:info"} {} private: void GetProgramId(HLERequestContext& ctx) { @@ -218,27 +210,24 @@ private: rb.Push(ResultSuccess); rb.Push(process->GetProcessId()); } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &Info::GetProgramId, "GetProgramId"}, + FunctionInfo{65000, &Info::AtmosphereGetProcessId, "AtmosphereGetProcessId"}, + FunctionInfo{65001, nullptr, "AtmosphereHasLaunchedProgram"}, + FunctionInfo{65002, nullptr, "AtmosphereGetProcessInfo"} + ); }; class Shell final : public ServiceFramework { public: - explicit Shell(Core::System& system_) : ServiceFramework{system_, "pm:shell"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "LaunchProgram"}, - {1, nullptr, "TerminateProcess"}, - {2, nullptr, "TerminateProgram"}, - {3, nullptr, "GetProcessEventHandle"}, - {4, nullptr, "GetProcessEventInfo"}, - {5, nullptr, "NotifyBootFinished"}, - {6, &Shell::GetApplicationProcessIdForShell, "GetApplicationProcessIdForShell"}, - {7, nullptr, "BoostSystemMemoryResourceLimit"}, - {8, nullptr, "BoostApplicationThreadResourceLimit"}, - {9, nullptr, "GetBootFinishedEventHandle"}, - }; - // clang-format on + explicit Shell(Core::System& system_) : ServiceFramework{system_, "pm:shell"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -247,6 +236,19 @@ private: auto list = kernel.GetProcessList(); GetApplicationPidGeneric(system.Kernel(), ctx, list); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "LaunchProgram"}, + FunctionInfo{1, nullptr, "TerminateProcess"}, + FunctionInfo{2, nullptr, "TerminateProgram"}, + FunctionInfo{3, nullptr, "GetProcessEventHandle"}, + FunctionInfo{4, nullptr, "GetProcessEventInfo"}, + FunctionInfo{5, nullptr, "NotifyBootFinished"}, + FunctionInfo{6, &Shell::GetApplicationProcessIdForShell, "GetApplicationProcessIdForShell"}, + FunctionInfo{7, nullptr, "BoostSystemMemoryResourceLimit"}, + FunctionInfo{8, nullptr, "BoostApplicationThreadResourceLimit"}, + FunctionInfo{9, nullptr, "GetBootFinishedEventHandle"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index e76c3ea93c..a199c41d2c 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp @@ -21,45 +21,10 @@ namespace Service::PlayReport { class PlayReport final : public ServiceFramework { public: - explicit PlayReport(const char* name, Core::System& system_) : ServiceFramework{system_, name} { - // clang-format off - static const FunctionInfo functions[] = { - {10100, &PlayReport::SaveReport, "SaveReportOld"}, - {10101, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld"}, - {10102, &PlayReport::SaveReport, "SaveReportOld2"}, - {10103, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld2"}, - {10104, &PlayReport::SaveReport, "SaveReportOld3"}, - {10105, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld3"}, - {10106, &PlayReport::SaveReport, "SaveReport"}, - {10107, &PlayReport::SaveReportWithUser, "SaveReportWithUser"}, - {10200, &PlayReport::RequestImmediateTransmission, "RequestImmediateTransmission"}, - {10300, &PlayReport::GetTransmissionStatus, "GetTransmissionStatus"}, - {10400, &PlayReport::GetSystemSessionId, "GetSystemSessionId"}, - {20100, &PlayReport::SaveSystemReportOld, "SaveSystemReport"}, - {20101, &PlayReport::SaveSystemReportWithUserOld, "SaveSystemReportWithUser"}, - {20102, &PlayReport::SaveSystemReport, "SaveSystemReport"}, - {20103, &PlayReport::SaveSystemReportWithUser, "SaveSystemReportWithUser"}, - {20200, nullptr, "SetOperationMode"}, - {30100, nullptr, "ClearStorage"}, - {30200, nullptr, "ClearStatistics"}, - {30300, nullptr, "GetStorageUsage"}, - {30400, nullptr, "GetStatistics"}, - {30401, nullptr, "GetThroughputHistory"}, - {30500, nullptr, "GetLastUploadError"}, - {30600, nullptr, "GetApplicationUploadSummary"}, - {40100, nullptr, "IsUserAgreementCheckEnabled"}, - {40101, nullptr, "SetUserAgreementCheckEnabled"}, - {50100, nullptr, "ReadAllApplicationReportFiles"}, - {90100, nullptr, "ReadAllReportFiles"}, - {90101, nullptr, "Unknown90101"}, - {90102, nullptr, "Unknown90102"}, - {90200, nullptr, "GetStatistics"}, - {90201, nullptr, "GetThroughputHistory"}, - {90300, nullptr, "GetLastUploadError"}, - }; - // clang-format on + explicit PlayReport(const char* name, Core::System& system_) : ServiceFramework{system_, name} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -214,21 +179,51 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{10100, &PlayReport::SaveReport, "SaveReportOld"}, + FunctionInfo{10101, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld"}, + FunctionInfo{10102, &PlayReport::SaveReport, "SaveReportOld2"}, + FunctionInfo{10103, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld2"}, + FunctionInfo{10104, &PlayReport::SaveReport, "SaveReportOld3"}, + FunctionInfo{10105, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld3"}, + FunctionInfo{10106, &PlayReport::SaveReport, "SaveReport"}, + FunctionInfo{10107, &PlayReport::SaveReportWithUser, "SaveReportWithUser"}, + FunctionInfo{10200, &PlayReport::RequestImmediateTransmission, "RequestImmediateTransmission"}, + FunctionInfo{10300, &PlayReport::GetTransmissionStatus, "GetTransmissionStatus"}, + FunctionInfo{10400, &PlayReport::GetSystemSessionId, "GetSystemSessionId"}, + FunctionInfo{20100, &PlayReport::SaveSystemReportOld, "SaveSystemReport"}, + FunctionInfo{20101, &PlayReport::SaveSystemReportWithUserOld, "SaveSystemReportWithUser"}, + FunctionInfo{20102, &PlayReport::SaveSystemReport, "SaveSystemReport"}, + FunctionInfo{20103, &PlayReport::SaveSystemReportWithUser, "SaveSystemReportWithUser"}, + FunctionInfo{20200, nullptr, "SetOperationMode"}, + FunctionInfo{30100, nullptr, "ClearStorage"}, + FunctionInfo{30200, nullptr, "ClearStatistics"}, + FunctionInfo{30300, nullptr, "GetStorageUsage"}, + FunctionInfo{30400, nullptr, "GetStatistics"}, + FunctionInfo{30401, nullptr, "GetThroughputHistory"}, + FunctionInfo{30500, nullptr, "GetLastUploadError"}, + FunctionInfo{30600, nullptr, "GetApplicationUploadSummary"}, + FunctionInfo{40100, nullptr, "IsUserAgreementCheckEnabled"}, + FunctionInfo{40101, nullptr, "SetUserAgreementCheckEnabled"}, + FunctionInfo{50100, nullptr, "ReadAllApplicationReportFiles"}, + FunctionInfo{90100, nullptr, "ReadAllReportFiles"}, + FunctionInfo{90101, nullptr, "Unknown90101"}, + FunctionInfo{90102, nullptr, "Unknown90102"}, + FunctionInfo{90200, nullptr, "GetStatistics"}, + FunctionInfo{90201, nullptr, "GetThroughputHistory"}, + FunctionInfo{90300, nullptr, "GetLastUploadError"} + ); }; void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); - server_manager->RegisterNamedService("prepo:a", - std::make_shared("prepo:a", system)); - server_manager->RegisterNamedService("prepo:a2", - std::make_shared("prepo:a2", system)); - server_manager->RegisterNamedService("prepo:m", - std::make_shared("prepo:m", system)); - server_manager->RegisterNamedService("prepo:s", - std::make_shared("prepo:s", system)); - server_manager->RegisterNamedService("prepo:u", - std::make_shared("prepo:u", system)); + server_manager->RegisterNamedService("prepo:a", std::make_shared("prepo:a", system)); + server_manager->RegisterNamedService("prepo:a2", std::make_shared("prepo:a2", system)); + server_manager->RegisterNamedService("prepo:m", std::make_shared("prepo:m", system)); + server_manager->RegisterNamedService("prepo:s", std::make_shared("prepo:s", system)); + server_manager->RegisterNamedService("prepo:u", std::make_shared("prepo:u", system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/psc/ovln/receiver.cpp b/src/core/hle/service/psc/ovln/receiver.cpp deleted file mode 100644 index f43d705126..0000000000 --- a/src/core/hle/service/psc/ovln/receiver.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/psc/ovln/receiver.h" -#include "core/hle/service/cmif_serialization.h" - -namespace Service::PSC { - -IReceiver::IReceiver(Core::System& system_) - : ServiceFramework{system_, "IReceiver"}, service_context{system_, "IReceiver"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IReceiver::AddSource>, "AddSource"}, - {1, D<&IReceiver::RemoveSource>, "RemoveSource"}, - {2, D<&IReceiver::GetReceiveEventHandle>, "GetReceiveEventHandle"}, - {3, D<&IReceiver::Receive>, "Receive"}, - {4, D<&IReceiver::ReceiveWithTick>, "ReceiveWithTick"}, - }; - // clang-format on - - RegisterHandlers(functions); - - receive_event = service_context.CreateEvent("IReceiver::ReceiveEvent"); -} - -IReceiver::~IReceiver() { - service_context.CloseEvent(receive_event); -} - -Result IReceiver::AddSource(SourceName source_name) { - const std::string name = source_name.GetString(); - LOG_INFO(Service_PSC, "called: source_name={}", name); - - // Add source if it doesn't already exist - if (message_sources.find(name) == message_sources.end()) { - message_sources[name] = {}; - } - - R_SUCCEED(); -} - -Result IReceiver::RemoveSource(SourceName source_name) { - const std::string name = source_name.GetString(); - LOG_INFO(Service_PSC, "called: source_name={}", name); - - // Remove source if it exists - message_sources.erase(name); - - R_SUCCEED(); -} - -Result IReceiver::GetReceiveEventHandle(OutCopyHandle out_event) { - LOG_INFO(Service_PSC, "called"); - *out_event = &receive_event->GetReadableEvent(); - R_SUCCEED(); -} - -Result IReceiver::Receive(Out out_notification, Out out_flags) { - u64 tick; - return ReceiveWithTick(out_notification, out_flags, Out(&tick)); -} - -Result IReceiver::ReceiveWithTick(Out out_notification, - Out out_flags, Out out_tick) { - LOG_DEBUG(Service_PSC, "called"); - - // Find the message with the lowest ID across all sources - const std::string* target_source = nullptr; - size_t target_index = 0; - - for (const auto& [source_name, messages] : message_sources) { - if (!messages.empty()) { - if (target_source == nullptr) { - target_source = &source_name; - target_index = 0; - } - // Note: In the real implementation, we would track message IDs - // For now, just use FIFO order - } - } - - if (target_source != nullptr) { - auto& messages = message_sources[*target_source]; - *out_notification = messages[target_index].first; - *out_flags = messages[target_index].second; - *out_tick = 0; // TODO: Implement tick tracking - - // Remove the message - messages.erase(messages.begin() + target_index); - - // Clear event if no more messages - bool has_messages = false; - for (const auto& [_, msgs] : message_sources) { - if (!msgs.empty()) { - has_messages = true; - break; - } - } - if (!has_messages) { - receive_event->Clear(system.Kernel()); - } - - R_SUCCEED(); - } - - // No messages available - *out_notification = {}; - *out_flags = {}; - *out_tick = 0; - - LOG_WARNING(Service_PSC, "No messages available"); - R_THROW(ResultUnknown); // TODO: Use proper OvlnResult::NoMessages when available -} - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/receiver.h b/src/core/hle/service/psc/ovln/receiver.h deleted file mode 100644 index 2b96216a1a..0000000000 --- a/src/core/hle/service/psc/ovln/receiver.h +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include -#include -#include "core/hle/result.h" -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/kernel_helpers.h" -#include "core/hle/service/service.h" -#include "core/hle/service/psc/ovln/ovln_types.h" - -namespace Kernel { -class KReadableEvent; -} - -namespace Service::PSC { - -class IReceiver final : public ServiceFramework { -public: - explicit IReceiver(Core::System& system_); - ~IReceiver() override; - - IReceiver(const IReceiver&) = delete; - IReceiver& operator=(const IReceiver&) = delete; - -private: - Result AddSource(SourceName source_name); - Result RemoveSource(SourceName source_name); - Result GetReceiveEventHandle(OutCopyHandle out_event); - Result Receive(Out out_notification, Out out_flags); - Result ReceiveWithTick(Out out_notification, Out out_flags, - Out out_tick); - - KernelHelpers::ServiceContext service_context; - Kernel::KEvent* receive_event; - - std::map>> message_sources; -}; - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/receiver_service.cpp b/src/core/hle/service/psc/ovln/receiver_service.cpp index 3b0b180725..0df9d802b9 100644 --- a/src/core/hle/service/psc/ovln/receiver_service.cpp +++ b/src/core/hle/service/psc/ovln/receiver_service.cpp @@ -5,19 +5,126 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/psc/ovln/receiver.h" +#include "core/hle/service/psc/ovln/ovln_types.h" #include "core/hle/service/psc/ovln/receiver_service.h" namespace Service::PSC { -IReceiverService::IReceiverService(Core::System& system_) : ServiceFramework{system_, "ovln:rcv"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IReceiverService::OpenReceiver>, "OpenReceiver"}, - }; - // clang-format on +class IReceiver final : public ServiceFramework { +public: + explicit IReceiver(Core::System& system_) : ServiceFramework{system_, "IReceiver"}, service_context{system_, "IReceiver"} { + receive_event = service_context.CreateEvent("IReceiver::ReceiveEvent"); + } - RegisterHandlers(functions); + ~IReceiver() override { + service_context.CloseEvent(receive_event); + } + + Result AddSource(SourceName source_name) { + const std::string name = source_name.GetString(); + LOG_INFO(Service_PSC, "called: source_name={}", name); + // Add source if it doesn't already exist + if (message_sources.find(name) == message_sources.end()) { + message_sources[name] = {}; + } + R_SUCCEED(); + } + + Result RemoveSource(SourceName source_name) { + const std::string name = source_name.GetString(); + LOG_INFO(Service_PSC, "called: source_name={}", name); + // Remove source if it exists + message_sources.erase(name); + R_SUCCEED(); + } + + Result GetReceiveEventHandle(OutCopyHandle out_event) { + LOG_INFO(Service_PSC, "called"); + *out_event = &receive_event->GetReadableEvent(); + R_SUCCEED(); + } + + Result Receive(Out out_notification, Out out_flags) { + u64 tick; + return ReceiveWithTick(out_notification, out_flags, Out(&tick)); + } + + Result ReceiveWithTick(Out out_notification, Out out_flags, Out out_tick) { + LOG_DEBUG(Service_PSC, "called"); + + // Find the message with the lowest ID across all sources + const std::string* target_source = nullptr; + size_t target_index = 0; + + for (const auto& [source_name, messages] : message_sources) { + if (!messages.empty()) { + if (target_source == nullptr) { + target_source = &source_name; + target_index = 0; + } + // Note: In the real implementation, we would track message IDs + // For now, just use FIFO order + } + } + + if (target_source != nullptr) { + auto& messages = message_sources[*target_source]; + *out_notification = messages[target_index].first; + *out_flags = messages[target_index].second; + *out_tick = 0; // TODO: Implement tick tracking + + // Remove the message + messages.erase(messages.begin() + target_index); + + // Clear event if no more messages + bool has_messages = false; + for (const auto& [_, msgs] : message_sources) { + if (!msgs.empty()) { + has_messages = true; + break; + } + } + if (!has_messages) { + receive_event->Clear(system.Kernel()); + } + + R_SUCCEED(); + } + + // No messages available + *out_notification = {}; + *out_flags = {}; + *out_tick = 0; + + LOG_WARNING(Service_PSC, "No messages available"); + R_THROW(ResultUnknown); // TODO: Use proper OvlnResult::NoMessages when available + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IReceiver::AddSource>, "AddSource"}, + FunctionInfo{1, D<&IReceiver::RemoveSource>, "RemoveSource"}, + FunctionInfo{2, D<&IReceiver::GetReceiveEventHandle>, "GetReceiveEventHandle"}, + FunctionInfo{3, D<&IReceiver::Receive>, "Receive"}, + FunctionInfo{4, D<&IReceiver::ReceiveWithTick>, "ReceiveWithTick"} + ); + + KernelHelpers::ServiceContext service_context; + Kernel::KEvent* receive_event; + + std::map>> message_sources; +}; + +std::optional IReceiverService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IReceiverService::OpenReceiver>, "OpenReceiver"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + +IReceiverService::IReceiverService(Core::System& system_) : ServiceFramework{system_, "ovln:rcv"} { } IReceiverService::~IReceiverService() = default; diff --git a/src/core/hle/service/psc/ovln/receiver_service.h b/src/core/hle/service/psc/ovln/receiver_service.h index b3b31ba4aa..bd053cd50c 100644 --- a/src/core/hle/service/psc/ovln/receiver_service.h +++ b/src/core/hle/service/psc/ovln/receiver_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -17,6 +20,8 @@ public: private: Result OpenReceiver(Out> out_receiver); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/sender.cpp b/src/core/hle/service/psc/ovln/sender.cpp deleted file mode 100644 index 3227a56f25..0000000000 --- a/src/core/hle/service/psc/ovln/sender.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/psc/ovln/sender.h" - -namespace Service::PSC { - -ISender::ISender(Core::System& system_) : ServiceFramework{system_, "ISender"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ISender::Send>, "Send"}, - {1, nullptr, "GetUnreceivedMessageCount"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -ISender::~ISender() = default; - -Result ISender::Send(const OverlayNotification& notification, MessageFlags flags) { - std::string data; - for (const auto m : notification) { - data += fmt::format("{:016X} ", m); - } - - LOG_WARNING(Service_PSC, "(STUBBED) called, flags={} notification={}", flags.raw, data); - R_SUCCEED(); -} - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/sender.h b/src/core/hle/service/psc/ovln/sender.h deleted file mode 100644 index c1575428e3..0000000000 --- a/src/core/hle/service/psc/ovln/sender.h +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/psc/ovln/ovln_types.h" -#include "core/hle/service/service.h" - -namespace Service::PSC { - -class ISender final : public ServiceFramework { -public: - explicit ISender(Core::System& system_); - ~ISender() override; - -private: - Result Send(const OverlayNotification& notification, MessageFlags flags); -}; - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/sender_service.cpp b/src/core/hle/service/psc/ovln/sender_service.cpp index 18d2c83a3d..5a36f1e1ec 100644 --- a/src/core/hle/service/psc/ovln/sender_service.cpp +++ b/src/core/hle/service/psc/ovln/sender_service.cpp @@ -1,20 +1,47 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/psc/ovln/sender.h" +#include "core/hle/service/psc/ovln/ovln_types.h" #include "core/hle/service/psc/ovln/sender_service.h" namespace Service::PSC { -ISenderService::ISenderService(Core::System& system_) : ServiceFramework{system_, "ovln:snd"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ISenderService::OpenSender>, "OpenSender"}, - }; - // clang-format on +class ISender final : public ServiceFramework { +public: + explicit ISender(Core::System& system_) : ServiceFramework{system_, "ISender"} {} + ~ISender() override = default; - RegisterHandlers(functions); + Result Send(const OverlayNotification& notification, MessageFlags flags) { + std::string data; + for (const auto m : notification) { + data += fmt::format("{:016X} ", m); + } + + LOG_WARNING(Service_PSC, "(STUBBED) called, flags={} notification={}", flags.raw, data); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ISender::Send>, "Send"}, + FunctionInfo{1, nullptr, "GetUnreceivedMessageCount"} + ); +}; + +std::optional ISenderService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ISenderService::OpenSender>, "OpenSender"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + +ISenderService::ISenderService(Core::System& system_) : ServiceFramework{system_, "ovln:snd"} { } ISenderService::~ISenderService() = default; diff --git a/src/core/hle/service/psc/ovln/sender_service.h b/src/core/hle/service/psc/ovln/sender_service.h index 10027701f4..90a9a33872 100644 --- a/src/core/hle/service/psc/ovln/sender_service.h +++ b/src/core/hle/service/psc/ovln/sender_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -16,8 +19,9 @@ public: ~ISenderService() override; private: - Result OpenSender(Out> out_sender, u32 sender_id, - std::array data); + Result OpenSender(Out> out_sender, u32 sender_id, std::array data); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_control.cpp b/src/core/hle/service/psc/pm_control.cpp deleted file mode 100644 index 7dedb76629..0000000000 --- a/src/core/hle/service/psc/pm_control.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/psc/pm_control.h" - -namespace Service::PSC { - -IPmControl::IPmControl(Core::System& system_) : ServiceFramework{system_, "psc:c"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "DispatchRequest"}, - {2, nullptr, "GetResult"}, - {3, nullptr, "GetState"}, - {4, nullptr, "Cancel"}, - {5, nullptr, "PrintModuleInformation"}, - {6, nullptr, "GetModuleInformation"}, - {10, nullptr, "AcquireStateLock"}, - {11, nullptr, "HasStateLock"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IPmControl::~IPmControl() = default; - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_control.h b/src/core/hle/service/psc/pm_control.h deleted file mode 100644 index e0ae2f39ca..0000000000 --- a/src/core/hle/service/psc/pm_control.h +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/service.h" - -namespace Service::PSC { - -class IPmControl final : public ServiceFramework { -public: - explicit IPmControl(Core::System& system_); - ~IPmControl() override; -}; - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_module.cpp b/src/core/hle/service/psc/pm_module.cpp deleted file mode 100644 index 74dc7ed4e8..0000000000 --- a/src/core/hle/service/psc/pm_module.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/psc/pm_module.h" - -namespace Service::PSC { - -IPmModule::IPmModule(Core::System& system_) : ServiceFramework{system_, "IPmModule"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "GetRequest"}, - {2, nullptr, "Acknowledge"}, - {3, nullptr, "Finalize"}, - {4, nullptr, "AcknowledgeEx"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IPmModule::~IPmModule() = default; - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_module.h b/src/core/hle/service/psc/pm_module.h deleted file mode 100644 index b3a2d25842..0000000000 --- a/src/core/hle/service/psc/pm_module.h +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/service.h" - -namespace Service::PSC { - -class IPmModule final : public ServiceFramework { -public: - explicit IPmModule(Core::System& system_); - ~IPmModule() override; -}; - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_service.cpp b/src/core/hle/service/psc/pm_service.cpp deleted file mode 100644 index c4e0ad2286..0000000000 --- a/src/core/hle/service/psc/pm_service.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/psc/pm_module.h" -#include "core/hle/service/psc/pm_service.h" - -namespace Service::PSC { - -IPmService::IPmService(Core::System& system_) : ServiceFramework{system_, "psc:m"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IPmService::GetPmModule>, "GetPmModule"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IPmService::~IPmService() = default; - -Result IPmService::GetPmModule(Out> out_module) { - LOG_DEBUG(Service_PSC, "called"); - *out_module = std::make_shared(system); - R_SUCCEED(); -} - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_service.h b/src/core/hle/service/psc/pm_service.h deleted file mode 100644 index 08e14c6f8f..0000000000 --- a/src/core/hle/service/psc/pm_service.h +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service::PSC { - -class IPmModule; - -class IPmService final : public ServiceFramework { -public: - explicit IPmService(Core::System& system_); - ~IPmService() override; - -private: - Result GetPmModule(Out> out_module); -}; - -} // namespace Service::PSC diff --git a/src/core/hle/service/psc/psc.cpp b/src/core/hle/service/psc/psc.cpp index 31fb9f0117..553c4f63a4 100644 --- a/src/core/hle/service/psc/psc.cpp +++ b/src/core/hle/service/psc/psc.cpp @@ -6,102 +6,159 @@ #include "core/hle/service/psc/ovln/receiver_service.h" #include "core/hle/service/psc/ovln/sender_service.h" -#include "core/hle/service/psc/pm_control.h" -#include "core/hle/service/psc/pm_service.h" #include "core/hle/service/psc/psc.h" #include "core/hle/service/psc/time/manager.h" #include "core/hle/service/psc/time/power_state_service.h" #include "core/hle/service/psc/time/service_manager.h" #include "core/hle/service/psc/time/static.h" #include "core/hle/service/service.h" +#include "core/hle/service/cmif_serialization.h" namespace Service::PSC { class PSC_L final : public ServiceFramework { public: - explicit PSC_L(Core::System& system_) : ServiceFramework{system_, "psc:l"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize_3"}, - {1, nullptr, "Lock"}, - {2, nullptr, "Unlock"}, - {3, nullptr, "IsLocked"}, - {4, nullptr, "GetRelatedState"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit PSC_L(Core::System& system_) : ServiceFramework{system_, "psc:l"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize_3"}, + FunctionInfo{1, nullptr, "Lock"}, + FunctionInfo{2, nullptr, "Unlock"}, + FunctionInfo{3, nullptr, "IsLocked"}, + FunctionInfo{4, nullptr, "GetRelatedState"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class INS_R final : public ServiceFramework { public: - explicit INS_R(Core::System& system_) : ServiceFramework{system_, "ins:r"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetInputSourceState"}, - {1, nullptr, "GetTriggerTargetEvent"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit INS_R(Core::System& system_) : ServiceFramework{system_, "ins:r"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetInputSourceState"}, + FunctionInfo{1, nullptr, "GetTriggerTargetEvent"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class INS_S final : public ServiceFramework { public: - explicit INS_S(Core::System& system_) : ServiceFramework{system_, "ins:s"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetNotifyEvent"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit INS_S(Core::System& system_) : ServiceFramework{system_, "ins:s"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetNotifyEvent"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class HSHL_SYS final : public ServiceFramework { public: - explicit HSHL_SYS(Core::System& system_) : ServiceFramework{system_, "hshl:sys"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetBatteryPercentage"}, - {1, nullptr, "GetChargerType"}, - {2, nullptr, "OpenChargeSession"}, - {3, nullptr, "GetRawBatteryPercentage"}, - {4, nullptr, "GetBatteryVoltageLevel"}, - {5, nullptr, "OpenThermalSession"}, - {6, nullptr, "GetAbnormalTemperatureSet"}, - {7, nullptr, "OpenClockSession"}, - {8, nullptr, "GetClockRate"}, - {9, nullptr, "OpenBridgeSession"}, - {10, nullptr, "GetBridgePowerSupply"}, - {11, nullptr, "OpenVsysVoltageSession"}, - {12, nullptr, "GetIsBatteryEnoughForFullAwake"}, - {13, nullptr, "GetIsCharging"}, - {14, nullptr, "Cmd14"}, - {15, nullptr, "Cmd15"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit HSHL_SYS(Core::System& system_) : ServiceFramework{system_, "hshl:sys"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetBatteryPercentage"}, + FunctionInfo{1, nullptr, "GetChargerType"}, + FunctionInfo{2, nullptr, "OpenChargeSession"}, + FunctionInfo{3, nullptr, "GetRawBatteryPercentage"}, + FunctionInfo{4, nullptr, "GetBatteryVoltageLevel"}, + FunctionInfo{5, nullptr, "OpenThermalSession"}, + FunctionInfo{6, nullptr, "GetAbnormalTemperatureSet"}, + FunctionInfo{7, nullptr, "OpenClockSession"}, + FunctionInfo{8, nullptr, "GetClockRate"}, + FunctionInfo{9, nullptr, "OpenBridgeSession"}, + FunctionInfo{10, nullptr, "GetBridgePowerSupply"}, + FunctionInfo{11, nullptr, "OpenVsysVoltageSession"}, + FunctionInfo{12, nullptr, "GetIsBatteryEnoughForFullAwake"}, + FunctionInfo{13, nullptr, "GetIsCharging"}, + FunctionInfo{14, nullptr, "Cmd14"}, + FunctionInfo{15, nullptr, "Cmd15"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class HSHL_SET final : public ServiceFramework { public: - explicit HSHL_SET(Core::System& system_) : ServiceFramework{system_, "hshl:set"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "OpenChargeSession_2"}, - {1, nullptr, "OpenThermalSession_2"}, - {2, nullptr, "SetClockRate"}, - {3, nullptr, "SetBridgePowerSupply"}, - {4, nullptr, "Cmd4"}, - {5, nullptr, "Cmd5"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit HSHL_SET(Core::System& system_) : ServiceFramework{system_, "hshl:set"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenChargeSession_2"}, + FunctionInfo{1, nullptr, "OpenThermalSession_2"}, + FunctionInfo{2, nullptr, "SetClockRate"}, + FunctionInfo{3, nullptr, "SetBridgePowerSupply"}, + FunctionInfo{4, nullptr, "Cmd4"}, + FunctionInfo{5, nullptr, "Cmd5"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; +class IPmModule final : public ServiceFramework { +public: + explicit IPmModule(Core::System& system_) : ServiceFramework{system_, "IPmModule"} {} + ~IPmModule() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{1, nullptr, "GetRequest"}, + FunctionInfo{2, nullptr, "Acknowledge"}, + FunctionInfo{3, nullptr, "Finalize"}, + FunctionInfo{4, nullptr, "AcknowledgeEx"} + ); +}; + +class IPmService final : public ServiceFramework { +public: + explicit IPmService(Core::System& system_) : ServiceFramework{system_, "psc:m"} {} + ~IPmService() override = default; + +private: + Result GetPmModule(Out> out_module) { + LOG_DEBUG(Service_PSC, "called"); + *out_module = std::make_shared(system); + R_SUCCEED(); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IPmService::GetPmModule>, "GetPmModule"} + ); +}; + +class IPmControl final : public ServiceFramework { +public: + explicit IPmControl(Core::System& system_) : ServiceFramework{system_, "psc:c"} {} + ~IPmControl() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{1, nullptr, "DispatchRequest"}, + FunctionInfo{2, nullptr, "GetResult"}, + FunctionInfo{3, nullptr, "GetState"}, + FunctionInfo{4, nullptr, "Cancel"}, + FunctionInfo{5, nullptr, "PrintModuleInformation"}, + FunctionInfo{6, nullptr, "GetModuleInformation"}, + FunctionInfo{10, nullptr, "AcquireStateLock"}, + FunctionInfo{11, nullptr, "HasStateLock"} + ); +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); diff --git a/src/core/hle/service/psc/time/alarms.cpp b/src/core/hle/service/psc/time/alarms.cpp index 17a795c4c5..c9070896b3 100644 --- a/src/core/hle/service/psc/time/alarms.cpp +++ b/src/core/hle/service/psc/time/alarms.cpp @@ -33,8 +33,7 @@ Alarm::~Alarm() { } Alarms::Alarms(Core::System& system, StandardSteadyClockCore& steady_clock, PowerStateRequestManager& power_state_request_manager) - : m_system{system} - , m_ctx{system, "Psc:Alarms"} + : m_ctx{system, "Psc:Alarms"} , m_steady_clock{steady_clock} , m_power_state_request_manager{power_state_request_manager} , m_event{m_ctx.CreateEvent("Psc:Alarms:Event")} @@ -136,15 +135,7 @@ Result Alarms::UpdateClosestAndSignal(Kernel::KernelCore& kernel) { IAlarmService::IAlarmService(Core::System& system_, std::shared_ptr manager) : ServiceFramework{system_, "time:al"} , m_alarms{manager->m_alarms} -{ - // clang-format off - static const FunctionInfo functions[] = { - {0, &IAlarmService::CreateWakeupAlarm, "CreateWakeupAlarm"}, - {1, &IAlarmService::CreateBackgroundTaskAlarm, "CreateBackgroundTaskAlarm"}, - }; - // clang-format on - RegisterHandlers(functions); -} +{} void IAlarmService::CreateWakeupAlarm(HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called."); @@ -165,17 +156,6 @@ void IAlarmService::CreateBackgroundTaskAlarm(HLERequestContext& ctx) { ISteadyClockAlarm::ISteadyClockAlarm(Core::System& system_, Alarms& alarms, AlarmType type) : ServiceFramework{system_, "ISteadyClockAlarm"}, m_ctx{system, "Psc:ISteadyClockAlarm"}, m_alarms{alarms}, m_alarm{system, m_ctx, type} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &ISteadyClockAlarm::GetAlarmEvent, "GetAlarmEvent"}, - {1, &ISteadyClockAlarm::Enable, "Enable"}, - {2, &ISteadyClockAlarm::Disable, "Disable"}, - {3, &ISteadyClockAlarm::IsEnabled, "IsEnabled"}, - {10, nullptr, "CreateWakeLock"}, - {11, nullptr, "DestroyWakeLock"}, - }; - // clang-format on - RegisterHandlers(functions); } void ISteadyClockAlarm::GetAlarmEvent(HLERequestContext& ctx) { diff --git a/src/core/hle/service/psc/time/alarms.h b/src/core/hle/service/psc/time/alarms.h index 0a2fa7fac5..6d916ca198 100644 --- a/src/core/hle/service/psc/time/alarms.h +++ b/src/core/hle/service/psc/time/alarms.h @@ -95,7 +95,6 @@ private: void Erase(Kernel::KernelCore& kernel, Alarm& alarm); Result UpdateClosestAndSignal(Kernel::KernelCore& kernel); - Core::System& m_system; KernelHelpers::ServiceContext m_ctx; StandardSteadyClockCore& m_steady_clock; @@ -114,6 +113,14 @@ public: private: void CreateWakeupAlarm(HLERequestContext& ctx); void CreateBackgroundTaskAlarm(HLERequestContext& ctx); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IAlarmService::CreateWakeupAlarm, "CreateWakeupAlarm"}, + FunctionInfo{1, &IAlarmService::CreateBackgroundTaskAlarm, "CreateBackgroundTaskAlarm"} + ); Alarms& m_alarms; }; @@ -128,8 +135,18 @@ private: void Disable(HLERequestContext& ctx); void IsEnabled(HLERequestContext& ctx); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ISteadyClockAlarm::GetAlarmEvent, "GetAlarmEvent"}, + FunctionInfo{1, &ISteadyClockAlarm::Enable, "Enable"}, + FunctionInfo{2, &ISteadyClockAlarm::Disable, "Disable"}, + FunctionInfo{3, &ISteadyClockAlarm::IsEnabled, "IsEnabled"}, + FunctionInfo{10, nullptr, "CreateWakeLock"}, + FunctionInfo{11, nullptr, "DestroyWakeLock"} + ); KernelHelpers::ServiceContext m_ctx; - Alarms& m_alarms; Alarm m_alarm; }; diff --git a/src/core/hle/service/psc/time/manager.h b/src/core/hle/service/psc/time/manager.h index 62ded12475..2cb8b58a2b 100644 --- a/src/core/hle/service/psc/time/manager.h +++ b/src/core/hle/service/psc/time/manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -23,20 +26,20 @@ namespace Service::PSC::Time { class TimeManager { public: explicit TimeManager(Core::System& system) - : m_system{system}, m_standard_steady_clock{system}, m_tick_based_steady_clock{m_system}, - m_standard_local_system_clock{m_standard_steady_clock}, - m_standard_network_system_clock{m_standard_steady_clock}, - m_standard_user_system_clock{m_system, m_standard_local_system_clock, - m_standard_network_system_clock}, - m_ephemeral_network_clock{m_tick_based_steady_clock}, m_shared_memory{m_system}, - m_power_state_request_manager{m_system}, m_alarms{m_system, m_standard_steady_clock, - m_power_state_request_manager}, - m_local_system_clock_context_writer{m_system, m_shared_memory}, - m_network_system_clock_context_writer{m_system, m_shared_memory, - m_standard_user_system_clock}, - m_ephemeral_network_clock_context_writer{m_system} {} - - Core::System& m_system; + : m_standard_steady_clock{system} + , m_tick_based_steady_clock{system} + , m_standard_local_system_clock{m_standard_steady_clock} + , m_standard_network_system_clock{m_standard_steady_clock} + , m_standard_user_system_clock{system, m_standard_local_system_clock + , m_standard_network_system_clock} + , m_ephemeral_network_clock{m_tick_based_steady_clock} + , m_shared_memory{system} + , m_power_state_request_manager{system} + , m_alarms{system, m_standard_steady_clock, m_power_state_request_manager} + , m_local_system_clock_context_writer{system, m_shared_memory} + , m_network_system_clock_context_writer{system, m_shared_memory, m_standard_user_system_clock} + , m_ephemeral_network_clock_context_writer{system} + {} StandardSteadyClockCore m_standard_steady_clock; TickBasedSteadyClockCore m_tick_based_steady_clock; diff --git a/src/core/hle/service/psc/time/power_state_service.cpp b/src/core/hle/service/psc/time/power_state_service.cpp index 39af16b6f1..795aeb94a8 100644 --- a/src/core/hle/service/psc/time/power_state_service.cpp +++ b/src/core/hle/service/psc/time/power_state_service.cpp @@ -9,20 +9,19 @@ namespace Service::PSC::Time { +std::optional IPowerStateRequestHandler::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&IPowerStateRequestHandler::GetPowerStateRequestEventReadableHandle>, "GetPowerStateRequestEventReadableHandle"}, + FunctionInfo{1, D<&IPowerStateRequestHandler::GetAndClearPowerStateRequest>, "GetAndClearPowerStateRequest"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IPowerStateRequestHandler::IPowerStateRequestHandler( Core::System& system_, PowerStateRequestManager& power_state_request_manager) : ServiceFramework{system_, "time:p"} , m_power_state_request_manager{power_state_request_manager} -{ - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&IPowerStateRequestHandler::GetPowerStateRequestEventReadableHandle>, "GetPowerStateRequestEventReadableHandle"}, - {1, D<&IPowerStateRequestHandler::GetAndClearPowerStateRequest>, "GetAndClearPowerStateRequest"}, - }; - // clang-format on - - RegisterHandlers(functions); -} +{} Result IPowerStateRequestHandler::GetPowerStateRequestEventReadableHandle( OutCopyHandle out_event) { diff --git a/src/core/hle/service/psc/time/power_state_service.h b/src/core/hle/service/psc/time/power_state_service.h index 81b3adf234..14d9c1a77a 100644 --- a/src/core/hle/service/psc/time/power_state_service.h +++ b/src/core/hle/service/psc/time/power_state_service.h @@ -27,6 +27,7 @@ public: Result GetAndClearPowerStateRequest(Out out_cleared, Out out_priority); private: + std::optional FindRequest(u32 key) override; PowerStateRequestManager& m_power_state_request_manager; }; diff --git a/src/core/hle/service/psc/time/service_manager.cpp b/src/core/hle/service/psc/time/service_manager.cpp index e9f1407e4d..be25ee9a70 100644 --- a/src/core/hle/service/psc/time/service_manager.cpp +++ b/src/core/hle/service/psc/time/service_manager.cpp @@ -13,6 +13,30 @@ namespace Service::PSC::Time { + std::optional ServiceManager::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ServiceManager::GetStaticServiceAsUser>, "GetStaticServiceAsUser"}, + FunctionInfo{5, D<&ServiceManager::GetStaticServiceAsAdmin>, "GetStaticServiceAsAdmin"}, + FunctionInfo{6, D<&ServiceManager::GetStaticServiceAsRepair>, "GetStaticServiceAsRepair"}, + FunctionInfo{9, D<&ServiceManager::GetStaticServiceAsServiceManager>, "GetStaticServiceAsServiceManager"}, + FunctionInfo{10, D<&ServiceManager::SetupStandardSteadyClockCore>, "SetupStandardSteadyClockCore"}, + FunctionInfo{11, D<&ServiceManager::SetupStandardLocalSystemClockCore>, "SetupStandardLocalSystemClockCore"}, + FunctionInfo{12, D<&ServiceManager::SetupStandardNetworkSystemClockCore>, "SetupStandardNetworkSystemClockCore"}, + FunctionInfo{13, D<&ServiceManager::SetupStandardUserSystemClockCore>, "SetupStandardUserSystemClockCore"}, + FunctionInfo{14, D<&ServiceManager::SetupTimeZoneServiceCore>, "SetupTimeZoneServiceCore"}, + FunctionInfo{15, D<&ServiceManager::SetupEphemeralNetworkSystemClockCore>, "SetupEphemeralNetworkSystemClockCore"}, + FunctionInfo{50, D<&ServiceManager::GetStandardLocalClockOperationEvent>, "GetStandardLocalClockOperationEvent"}, + FunctionInfo{51, D<&ServiceManager::GetStandardNetworkClockOperationEventForServiceManager>, "GetStandardNetworkClockOperationEventForServiceManager"}, + FunctionInfo{52, D<&ServiceManager::GetEphemeralNetworkClockOperationEventForServiceManager>, "GetEphemeralNetworkClockOperationEventForServiceManager"}, + FunctionInfo{60, D<&ServiceManager::GetStandardUserSystemClockAutomaticCorrectionUpdatedEvent>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedEvent"}, + FunctionInfo{100, D<&ServiceManager::SetStandardSteadyClockBaseTime>, "SetStandardSteadyClockBaseTime"}, + FunctionInfo{200, D<&ServiceManager::GetClosestAlarmUpdatedEvent>, "GetClosestAlarmUpdatedEvent"}, + FunctionInfo{201, D<&ServiceManager::CheckAndSignalAlarms>, "CheckAndSignalAlarms"}, + FunctionInfo{202, D<&ServiceManager::GetClosestAlarmInfo>, "GetClosestAlarmInfo "} + ); + return HandlerTableGenerateWithFind(key, functions); + } + ServiceManager::ServiceManager(Core::System& system_, std::shared_ptr time, ServerManager* server_manager) : ServiceFramework{system_, "time:m"}, m_time{std::move(time)}, @@ -27,30 +51,6 @@ ServiceManager::ServiceManager(Core::System& system_, std::shared_ptrm_network_system_clock_context_writer}, m_ephemeral_system_context_writer{m_time->m_ephemeral_network_clock_context_writer}, m_local_operation{system_}, m_network_operation{system_}, m_ephemeral_operation{system_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ServiceManager::GetStaticServiceAsUser>, "GetStaticServiceAsUser"}, - {5, D<&ServiceManager::GetStaticServiceAsAdmin>, "GetStaticServiceAsAdmin"}, - {6, D<&ServiceManager::GetStaticServiceAsRepair>, "GetStaticServiceAsRepair"}, - {9, D<&ServiceManager::GetStaticServiceAsServiceManager>, "GetStaticServiceAsServiceManager"}, - {10, D<&ServiceManager::SetupStandardSteadyClockCore>, "SetupStandardSteadyClockCore"}, - {11, D<&ServiceManager::SetupStandardLocalSystemClockCore>, "SetupStandardLocalSystemClockCore"}, - {12, D<&ServiceManager::SetupStandardNetworkSystemClockCore>, "SetupStandardNetworkSystemClockCore"}, - {13, D<&ServiceManager::SetupStandardUserSystemClockCore>, "SetupStandardUserSystemClockCore"}, - {14, D<&ServiceManager::SetupTimeZoneServiceCore>, "SetupTimeZoneServiceCore"}, - {15, D<&ServiceManager::SetupEphemeralNetworkSystemClockCore>, "SetupEphemeralNetworkSystemClockCore"}, - {50, D<&ServiceManager::GetStandardLocalClockOperationEvent>, "GetStandardLocalClockOperationEvent"}, - {51, D<&ServiceManager::GetStandardNetworkClockOperationEventForServiceManager>, "GetStandardNetworkClockOperationEventForServiceManager"}, - {52, D<&ServiceManager::GetEphemeralNetworkClockOperationEventForServiceManager>, "GetEphemeralNetworkClockOperationEventForServiceManager"}, - {60, D<&ServiceManager::GetStandardUserSystemClockAutomaticCorrectionUpdatedEvent>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedEvent"}, - {100, D<&ServiceManager::SetStandardSteadyClockBaseTime>, "SetStandardSteadyClockBaseTime"}, - {200, D<&ServiceManager::GetClosestAlarmUpdatedEvent>, "GetClosestAlarmUpdatedEvent"}, - {201, D<&ServiceManager::CheckAndSignalAlarms>, "CheckAndSignalAlarms"}, - {202, D<&ServiceManager::GetClosestAlarmInfo>, "GetClosestAlarmInfo "}, - }; - // clang-format on - RegisterHandlers(functions); - m_local_system_context_writer.Link(m_local_operation); m_network_system_context_writer.Link(m_network_operation); m_ephemeral_system_context_writer.Link(m_ephemeral_operation); diff --git a/src/core/hle/service/psc/time/service_manager.h b/src/core/hle/service/psc/time/service_manager.h index 09cff25038..a8b94d8939 100644 --- a/src/core/hle/service/psc/time/service_manager.h +++ b/src/core/hle/service/psc/time/service_manager.h @@ -65,6 +65,8 @@ private: void SetupSAndP(); Result GetStaticService(OutInterface out_service, StaticServiceSetupInfo setup_info, const char* name); + std::optional FindRequest(u32 key) override; + std::shared_ptr m_time; ServerManager& m_server_manager; bool m_is_s_and_p_setup{}; diff --git a/src/core/hle/service/psc/time/static.cpp b/src/core/hle/service/psc/time/static.cpp index 28cff3b764..2b2b6f1f04 100644 --- a/src/core/hle/service/psc/time/static.cpp +++ b/src/core/hle/service/psc/time/static.cpp @@ -33,6 +33,31 @@ constexpr Result GetTimeFromTimePointAndContext(s64* out_time, SteadyClockTimePo } } // namespace +std::optional StaticService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"}, + FunctionInfo{1, D<&StaticService::GetStandardNetworkSystemClock>, "GetStandardNetworkSystemClock"}, + FunctionInfo{2, D<&StaticService::GetStandardSteadyClock>, "GetStandardSteadyClock"}, + FunctionInfo{3, D<&StaticService::GetTimeZoneService>, "GetTimeZoneService"}, + FunctionInfo{4, D<&StaticService::GetStandardLocalSystemClock>, "GetStandardLocalSystemClock"}, + FunctionInfo{5, D<&StaticService::GetEphemeralNetworkSystemClock>, "GetEphemeralNetworkSystemClock"}, + FunctionInfo{20, D<&StaticService::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, + FunctionInfo{50, D<&StaticService::SetStandardSteadyClockInternalOffset>, "SetStandardSteadyClockInternalOffset"}, + FunctionInfo{51, D<&StaticService::GetStandardSteadyClockRtcValue>, "GetStandardSteadyClockRtcValue"}, + FunctionInfo{100, D<&StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled>, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, + FunctionInfo{101, D<&StaticService::SetStandardUserSystemClockAutomaticCorrectionEnabled>, "SetStandardUserSystemClockAutomaticCorrectionEnabled"}, + FunctionInfo{102, D<&StaticService::GetStandardUserSystemClockInitialYear>, "GetStandardUserSystemClockInitialYear"}, + FunctionInfo{200, D<&StaticService::IsStandardNetworkSystemClockAccuracySufficient>, "IsStandardNetworkSystemClockAccuracySufficient"}, + FunctionInfo{201, D<&StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedTime"}, + FunctionInfo{300, D<&StaticService::CalculateMonotonicSystemClockBaseTimePoint>, "CalculateMonotonicSystemClockBaseTimePoint"}, + FunctionInfo{400, D<&StaticService::GetClockSnapshot>, "GetClockSnapshot"}, + FunctionInfo{401, D<&StaticService::GetClockSnapshotFromSystemClockContext>, "GetClockSnapshotFromSystemClockContext"}, + FunctionInfo{500, D<&StaticService::CalculateStandardUserSystemClockDifferenceByUser>, "CalculateStandardUserSystemClockDifferenceByUser"}, + FunctionInfo{501, D<&StaticService::CalculateSpanBetween>, "CalculateSpanBetween"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + StaticService::StaticService(Core::System& system_, StaticServiceSetupInfo setup_info, std::shared_ptr time, const char* name) : ServiceFramework{system_, name}, m_setup_info{setup_info}, m_time{time}, @@ -42,31 +67,6 @@ StaticService::StaticService(Core::System& system_, StaticServiceSetupInfo setup m_time_zone{m_time->m_time_zone}, m_ephemeral_network_clock{m_time->m_ephemeral_network_clock}, m_shared_memory{ m_time->m_shared_memory} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"}, - {1, D<&StaticService::GetStandardNetworkSystemClock>, "GetStandardNetworkSystemClock"}, - {2, D<&StaticService::GetStandardSteadyClock>, "GetStandardSteadyClock"}, - {3, D<&StaticService::GetTimeZoneService>, "GetTimeZoneService"}, - {4, D<&StaticService::GetStandardLocalSystemClock>, "GetStandardLocalSystemClock"}, - {5, D<&StaticService::GetEphemeralNetworkSystemClock>, "GetEphemeralNetworkSystemClock"}, - {20, D<&StaticService::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, - {50, D<&StaticService::SetStandardSteadyClockInternalOffset>, "SetStandardSteadyClockInternalOffset"}, - {51, D<&StaticService::GetStandardSteadyClockRtcValue>, "GetStandardSteadyClockRtcValue"}, - {100, D<&StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled>, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, - {101, D<&StaticService::SetStandardUserSystemClockAutomaticCorrectionEnabled>, "SetStandardUserSystemClockAutomaticCorrectionEnabled"}, - {102, D<&StaticService::GetStandardUserSystemClockInitialYear>, "GetStandardUserSystemClockInitialYear"}, - {200, D<&StaticService::IsStandardNetworkSystemClockAccuracySufficient>, "IsStandardNetworkSystemClockAccuracySufficient"}, - {201, D<&StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedTime"}, - {300, D<&StaticService::CalculateMonotonicSystemClockBaseTimePoint>, "CalculateMonotonicSystemClockBaseTimePoint"}, - {400, D<&StaticService::GetClockSnapshot>, "GetClockSnapshot"}, - {401, D<&StaticService::GetClockSnapshotFromSystemClockContext>, "GetClockSnapshotFromSystemClockContext"}, - {500, D<&StaticService::CalculateStandardUserSystemClockDifferenceByUser>, "CalculateStandardUserSystemClockDifferenceByUser"}, - {501, D<&StaticService::CalculateSpanBetween>, "CalculateSpanBetween"}, - }; - // clang-format on - - RegisterHandlers(functions); } Result StaticService::GetStandardUserSystemClock(OutInterface out_service) { diff --git a/src/core/hle/service/psc/time/static.h b/src/core/hle/service/psc/time/static.h index 52659166f1..a86fec178f 100644 --- a/src/core/hle/service/psc/time/static.h +++ b/src/core/hle/service/psc/time/static.h @@ -71,6 +71,8 @@ private: Result GetClockSnapshotImpl(OutClockSnapshot out_snapshot, const SystemClockContext& user_context, const SystemClockContext& network_context, TimeType type); + std::optional FindRequest(u32 key) override; + StaticServiceSetupInfo m_setup_info; std::shared_ptr m_time; StandardLocalSystemClockCore& m_local_system_clock; diff --git a/src/core/hle/service/psc/time/steady_clock.cpp b/src/core/hle/service/psc/time/steady_clock.cpp index 1d1551acf9..3d138837d3 100644 --- a/src/core/hle/service/psc/time/steady_clock.cpp +++ b/src/core/hle/service/psc/time/steady_clock.cpp @@ -11,26 +11,26 @@ namespace Service::PSC::Time { +std::optional SteadyClock::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&SteadyClock::GetCurrentTimePoint>, "GetCurrentTimePoint"}, + FunctionInfo{2, D<&SteadyClock::GetTestOffset>, "GetTestOffset"}, + FunctionInfo{3, D<&SteadyClock::SetTestOffset>, "SetTestOffset"}, + FunctionInfo{100, D<&SteadyClock::GetRtcValue>, "GetRtcValue"}, + FunctionInfo{101, D<&SteadyClock::IsRtcResetDetected>, "IsRtcResetDetected"}, + FunctionInfo{102, D<&SteadyClock::GetSetupResultValue>, "GetSetupResultValue"}, + FunctionInfo{200, D<&SteadyClock::GetInternalOffset>, "GetInternalOffset"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + SteadyClock::SteadyClock(Core::System& system_, std::shared_ptr manager, bool can_write_steady_clock, bool can_write_uninitialized_clock) : ServiceFramework{system_, "ISteadyClock"} , m_clock_core{manager->m_standard_steady_clock} , m_can_write_steady_clock{can_write_steady_clock} , m_can_write_uninitialized_clock{can_write_uninitialized_clock} -{ - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&SteadyClock::GetCurrentTimePoint>, "GetCurrentTimePoint"}, - {2, D<&SteadyClock::GetTestOffset>, "GetTestOffset"}, - {3, D<&SteadyClock::SetTestOffset>, "SetTestOffset"}, - {100, D<&SteadyClock::GetRtcValue>, "GetRtcValue"}, - {101, D<&SteadyClock::IsRtcResetDetected>, "IsRtcResetDetected"}, - {102, D<&SteadyClock::GetSetupResultValue>, "GetSetupResultValue"}, - {200, D<&SteadyClock::GetInternalOffset>, "GetInternalOffset"}, - }; - // clang-format on - RegisterHandlers(functions); -} +{} Result SteadyClock::GetCurrentTimePoint(Out out_time_point) { SCOPE_EXIT { diff --git a/src/core/hle/service/psc/time/steady_clock.h b/src/core/hle/service/psc/time/steady_clock.h index 8d3d9a6280..e4de3e3717 100644 --- a/src/core/hle/service/psc/time/steady_clock.h +++ b/src/core/hle/service/psc/time/steady_clock.h @@ -34,6 +34,8 @@ public: Result GetSetupResultValue(Out out_result); Result GetInternalOffset(Out out_internal_offset); + std::optional FindRequest(u32 key) override; + private: StandardSteadyClockCore& m_clock_core; bool m_can_write_steady_clock; diff --git a/src/core/hle/service/psc/time/system_clock.cpp b/src/core/hle/service/psc/time/system_clock.cpp index e978ffb5e5..c08eca0b02 100644 --- a/src/core/hle/service/psc/time/system_clock.cpp +++ b/src/core/hle/service/psc/time/system_clock.cpp @@ -11,23 +11,23 @@ namespace Service::PSC::Time { +std::optional SystemClock::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&SystemClock::GetCurrentTime>, "GetCurrentTime"}, + FunctionInfo{1, D<&SystemClock::SetCurrentTime>, "SetCurrentTime"}, + FunctionInfo{2, D<&SystemClock::GetSystemClockContext>, "GetSystemClockContext"}, + FunctionInfo{3, D<&SystemClock::SetSystemClockContext>, "SetSystemClockContext"}, + FunctionInfo{4, D<&SystemClock::GetOperationEventReadableHandle>, "GetOperationEventReadableHandle"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + SystemClock::SystemClock(Core::System& system_, SystemClockCore& clock_core, bool can_write_clock, bool can_write_uninitialized_clock) : ServiceFramework{system_, "ISystemClock"} , m_clock_core{clock_core} , m_can_write_clock{can_write_clock} , m_can_write_uninitialized_clock{can_write_uninitialized_clock} -{ - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&SystemClock::GetCurrentTime>, "GetCurrentTime"}, - {1, D<&SystemClock::SetCurrentTime>, "SetCurrentTime"}, - {2, D<&SystemClock::GetSystemClockContext>, "GetSystemClockContext"}, - {3, D<&SystemClock::SetSystemClockContext>, "SetSystemClockContext"}, - {4, D<&SystemClock::GetOperationEventReadableHandle>, "GetOperationEventReadableHandle"}, - }; - // clang-format on - RegisterHandlers(functions); -} +{} Result SystemClock::GetCurrentTime(Out out_time) { SCOPE_EXIT { diff --git a/src/core/hle/service/psc/time/system_clock.h b/src/core/hle/service/psc/time/system_clock.h index 0d91aaa735..4f7d285d39 100644 --- a/src/core/hle/service/psc/time/system_clock.h +++ b/src/core/hle/service/psc/time/system_clock.h @@ -31,6 +31,7 @@ public: Result GetOperationEventReadableHandle(OutCopyHandle out_event); private: + std::optional FindRequest(u32 key) override; SystemClockCore& m_clock_core; bool m_can_write_clock; bool m_can_write_uninitialized_clock; diff --git a/src/core/hle/service/psc/time/time_zone_service.cpp b/src/core/hle/service/psc/time/time_zone_service.cpp index bd6bb3ba93..6a717846d3 100644 --- a/src/core/hle/service/psc/time/time_zone_service.cpp +++ b/src/core/hle/service/psc/time/time_zone_service.cpp @@ -13,33 +13,33 @@ namespace Service::PSC::Time { + std::optional TimeZoneService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"}, + FunctionInfo{1, D<&TimeZoneService::SetDeviceLocationName>, "SetDeviceLocationName"}, + FunctionInfo{2, D<&TimeZoneService::GetTotalLocationNameCount>, "GetTotalLocationNameCount"}, + FunctionInfo{3, D<&TimeZoneService::LoadLocationNameList>, "LoadLocationNameList"}, + FunctionInfo{4, D<&TimeZoneService::LoadTimeZoneRule>, "LoadTimeZoneRule"}, + FunctionInfo{5, D<&TimeZoneService::GetTimeZoneRuleVersion>, "GetTimeZoneRuleVersion"}, + FunctionInfo{6, D<&TimeZoneService::GetDeviceLocationNameAndUpdatedTime>, "GetDeviceLocationNameAndUpdatedTime"}, + FunctionInfo{7, D<&TimeZoneService::SetDeviceLocationNameWithTimeZoneRule>, "SetDeviceLocationNameWithTimeZoneRule"}, + FunctionInfo{8, D<&TimeZoneService::ParseTimeZoneBinary>, "ParseTimeZoneBinary"}, + FunctionInfo{20, D<&TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle>, "GetDeviceLocationNameOperationEventReadableHandle"}, + FunctionInfo{100, D<&TimeZoneService::ToCalendarTime>, "ToCalendarTime"}, + FunctionInfo{101, D<&TimeZoneService::ToCalendarTimeWithMyRule>, "ToCalendarTimeWithMyRule"}, + FunctionInfo{201, D<&TimeZoneService::ToPosixTime>, "ToPosixTime"}, + FunctionInfo{202, D<&TimeZoneService::ToPosixTimeWithMyRule>, "ToPosixTimeWithMyRule"} + ); + return HandlerTableGenerateWithFind(key, functions); + } + TimeZoneService::TimeZoneService(Core::System& system_, StandardSteadyClockCore& clock_core, TimeZone& time_zone, bool can_write_timezone_device_location) : ServiceFramework{system_, "ITimeZoneService"} , m_clock_core{clock_core} , m_time_zone{time_zone} , m_can_write_timezone_device_location{can_write_timezone_device_location} -{ - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"}, - {1, D<&TimeZoneService::SetDeviceLocationName>, "SetDeviceLocationName"}, - {2, D<&TimeZoneService::GetTotalLocationNameCount>, "GetTotalLocationNameCount"}, - {3, D<&TimeZoneService::LoadLocationNameList>, "LoadLocationNameList"}, - {4, D<&TimeZoneService::LoadTimeZoneRule>, "LoadTimeZoneRule"}, - {5, D<&TimeZoneService::GetTimeZoneRuleVersion>, "GetTimeZoneRuleVersion"}, - {6, D<&TimeZoneService::GetDeviceLocationNameAndUpdatedTime>, "GetDeviceLocationNameAndUpdatedTime"}, - {7, D<&TimeZoneService::SetDeviceLocationNameWithTimeZoneRule>, "SetDeviceLocationNameWithTimeZoneRule"}, - {8, D<&TimeZoneService::ParseTimeZoneBinary>, "ParseTimeZoneBinary"}, - {20, D<&TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle>, "GetDeviceLocationNameOperationEventReadableHandle"}, - {100, D<&TimeZoneService::ToCalendarTime>, "ToCalendarTime"}, - {101, D<&TimeZoneService::ToCalendarTimeWithMyRule>, "ToCalendarTimeWithMyRule"}, - {201, D<&TimeZoneService::ToPosixTime>, "ToPosixTime"}, - {202, D<&TimeZoneService::ToPosixTimeWithMyRule>, "ToPosixTimeWithMyRule"}, - }; - // clang-format on - RegisterHandlers(functions); -} +{} Result TimeZoneService::GetDeviceLocationName(Out out_location_name) { SCOPE_EXIT { diff --git a/src/core/hle/service/psc/time/time_zone_service.h b/src/core/hle/service/psc/time/time_zone_service.h index 0067b08258..fbb107f87c 100644 --- a/src/core/hle/service/psc/time/time_zone_service.h +++ b/src/core/hle/service/psc/time/time_zone_service.h @@ -59,6 +59,7 @@ public: const CalendarTime& calendar_time); private: + std::optional FindRequest(u32 key) override; StandardSteadyClockCore& m_clock_core; TimeZone& m_time_zone; bool m_can_write_timezone_device_location; diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp index 41d172b71b..5cad46f997 100644 --- a/src/core/hle/service/ptm/psm.cpp +++ b/src/core/hle/service/ptm/psm.cpp @@ -21,22 +21,15 @@ namespace Service::PTM { class IPsmSession final : public ServiceFramework { public: explicit IPsmSession(Core::System& system_) - : ServiceFramework{system_, "IPsmSession"}, service_context{system_, "IPsmSession"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IPsmSession::BindStateChangeEvent, "BindStateChangeEvent"}, - {1, &IPsmSession::UnbindStateChangeEvent, "UnbindStateChangeEvent"}, - {2, &IPsmSession::SetChargerTypeChangeEventEnabled, "SetChargerTypeChangeEventEnabled"}, - {3, &IPsmSession::SetPowerSupplyChangeEventEnabled, "SetPowerSupplyChangeEventEnabled"}, - {4, &IPsmSession::SetBatteryVoltageStateChangeEventEnabled, "SetBatteryVoltageStateChangeEventEnabled"}, - }; - // clang-format on - - RegisterHandlers(functions); - + : ServiceFramework{system_, "IPsmSession"} + , service_context{system_, "IPsmSession"} { state_change_event = service_context.CreateEvent("IPsmSession::state_change_event"); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + ~IPsmSession() override { service_context.CloseEvent(state_change_event); } @@ -112,8 +105,15 @@ private: rb.Push(ResultSuccess); } - KernelHelpers::ServiceContext service_context; + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IPsmSession::BindStateChangeEvent, "BindStateChangeEvent"}, + FunctionInfo{1, &IPsmSession::UnbindStateChangeEvent, "UnbindStateChangeEvent"}, + FunctionInfo{2, &IPsmSession::SetChargerTypeChangeEventEnabled, "SetChargerTypeChangeEventEnabled"}, + FunctionInfo{3, &IPsmSession::SetPowerSupplyChangeEventEnabled, "SetPowerSupplyChangeEventEnabled"}, + FunctionInfo{4, &IPsmSession::SetBatteryVoltageStateChangeEventEnabled, "SetBatteryVoltageStateChangeEventEnabled"} + ); + KernelHelpers::ServiceContext service_context; bool should_signal_charger_type{}; bool should_signal_power_supply{}; bool should_signal_battery_voltage{}; @@ -122,31 +122,6 @@ private: }; PSM::PSM(Core::System& system_) : ServiceFramework{system_, "psm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &PSM::GetBatteryChargePercentage, "GetBatteryChargePercentage"}, - {1, &PSM::GetChargerType, "GetChargerType"}, - {2, nullptr, "EnableBatteryCharging"}, - {3, nullptr, "DisableBatteryCharging"}, - {4, nullptr, "IsBatteryChargingEnabled"}, - {5, nullptr, "AcquireControllerPowerSupply"}, - {6, nullptr, "ReleaseControllerPowerSupply"}, - {7, &PSM::OpenSession, "OpenSession"}, - {8, nullptr, "EnableEnoughPowerChargeEmulation"}, - {9, nullptr, "DisableEnoughPowerChargeEmulation"}, - {10, nullptr, "EnableFastBatteryCharging"}, - {11, nullptr, "DisableFastBatteryCharging"}, - {12, &PSM::GetBatteryVoltageState, "GetBatteryVoltageState"}, - {13, nullptr, "GetRawBatteryChargePercentage"}, - {14, nullptr, "IsEnoughPowerSupplied"}, - {15, &PSM::GetBatteryAgePercentage, "GetBatteryAgePercentage"}, - {16, nullptr, "GetBatteryChargeInfoEvent"}, - {17, &PSM::GetBatteryChargeInfoFields, "GetBatteryChargeInfoFields"}, - {18, nullptr, "GetBatteryChargeCalibratedEvent"}, - }; - // clang-format on - - RegisterHandlers(functions); } PSM::~PSM() = default; diff --git a/src/core/hle/service/ptm/psm.h b/src/core/hle/service/ptm/psm.h index 77c38d1f9b..fe77b23d79 100644 --- a/src/core/hle/service/ptm/psm.h +++ b/src/core/hle/service/ptm/psm.h @@ -28,6 +28,31 @@ private: void GetBatteryVoltageState(HLERequestContext& ctx); void GetBatteryAgePercentage(HLERequestContext& ctx); void GetBatteryChargeInfoFields(HLERequestContext& ctx); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &PSM::GetBatteryChargePercentage, "GetBatteryChargePercentage"}, + FunctionInfo{1, &PSM::GetChargerType, "GetChargerType"}, + FunctionInfo{2, nullptr, "EnableBatteryCharging"}, + FunctionInfo{3, nullptr, "DisableBatteryCharging"}, + FunctionInfo{4, nullptr, "IsBatteryChargingEnabled"}, + FunctionInfo{5, nullptr, "AcquireControllerPowerSupply"}, + FunctionInfo{6, nullptr, "ReleaseControllerPowerSupply"}, + FunctionInfo{7, &PSM::OpenSession, "OpenSession"}, + FunctionInfo{8, nullptr, "EnableEnoughPowerChargeEmulation"}, + FunctionInfo{9, nullptr, "DisableEnoughPowerChargeEmulation"}, + FunctionInfo{10, nullptr, "EnableFastBatteryCharging"}, + FunctionInfo{11, nullptr, "DisableFastBatteryCharging"}, + FunctionInfo{12, &PSM::GetBatteryVoltageState, "GetBatteryVoltageState"}, + FunctionInfo{13, nullptr, "GetRawBatteryChargePercentage"}, + FunctionInfo{14, nullptr, "IsEnoughPowerSupplied"}, + FunctionInfo{15, &PSM::GetBatteryAgePercentage, "GetBatteryAgePercentage"}, + FunctionInfo{16, nullptr, "GetBatteryChargeInfoEvent"}, + FunctionInfo{17, &PSM::GetBatteryChargeInfoFields, "GetBatteryChargeInfoFields"}, + FunctionInfo{18, nullptr, "GetBatteryChargeCalibratedEvent"} + ); }; } // namespace Service::PTM diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index de1d34a688..ad474ec411 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -17,28 +17,28 @@ namespace Service::PTM { class PSM_MANU final : public ServiceFramework { public: explicit PSM_MANU(Core::System& system_) - : ServiceFramework{system_, "psm:manu"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "EnableVdd50StateControl"}, - {1, nullptr, "DisableVdd50StateControl"}, - {2, nullptr, "SetVdd50State"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "psm:manu"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "EnableVdd50StateControl"}, + FunctionInfo{1, nullptr, "DisableVdd50StateControl"}, + FunctionInfo{2, nullptr, "SetVdd50State"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class POWCTL final : public ServiceFramework { public: explicit POWCTL(Core::System& system_) - : ServiceFramework{system_, "powctl"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "OpenSession"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "powctl"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenSession"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/ptm/ts.cpp b/src/core/hle/service/ptm/ts.cpp index b1ac0c8f11..f22ff2ec69 100644 --- a/src/core/hle/service/ptm/ts.cpp +++ b/src/core/hle/service/ptm/ts.cpp @@ -19,16 +19,10 @@ enum class Location : u8 { class ISession : public ServiceFramework { public: - explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetTemperatureRange"}, - {2, nullptr, "SetMeasurementMode"}, - {4, &ISession::GetTemperature, "GetTemperature"}, - }; - // clang-format on + explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -39,20 +33,15 @@ private: rb.Push(ResultSuccess); rb.Push(temperature); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetTemperatureRange"}, + FunctionInfo{2, nullptr, "SetMeasurementMode"}, + FunctionInfo{4, &ISession::GetTemperature, "GetTemperature"} + ); }; TS::TS(Core::System& system_) : ServiceFramework{system_, "ts"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetTemperatureRange"}, - {1, &TS::GetTemperature, "GetTemperature"}, - {2, nullptr, "SetMeasurementMode"}, - {3, &TS::GetTemperatureMilliC, "GetTemperatureMilliC"}, - {4, &TS::OpenSession, "OpenSession"}, - }; - // clang-format on - - RegisterHandlers(functions); } TS::~TS() = default; diff --git a/src/core/hle/service/ptm/ts.h b/src/core/hle/service/ptm/ts.h index a10a91a64b..21f3ac2b70 100644 --- a/src/core/hle/service/ptm/ts.h +++ b/src/core/hle/service/ptm/ts.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -17,6 +20,17 @@ private: void GetTemperature(HLERequestContext& ctx); void GetTemperatureMilliC(HLERequestContext& ctx); void OpenSession(HLERequestContext& ctx); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetTemperatureRange"}, + FunctionInfo{1, &TS::GetTemperature, "GetTemperature"}, + FunctionInfo{2, nullptr, "SetMeasurementMode"}, + FunctionInfo{3, &TS::GetTemperatureMilliC, "GetTemperatureMilliC"}, + FunctionInfo{4, &TS::OpenSession, "OpenSession"} + ); }; } // namespace Service::PTM diff --git a/src/core/hle/service/ro/ro.cpp b/src/core/hle/service/ro/ro.cpp index 167bf04c9a..838ff136f6 100644 --- a/src/core/hle/service/ro/ro.cpp +++ b/src/core/hle/service/ro/ro.cpp @@ -8,21 +8,334 @@ #include #include "core/hle/kernel/k_process.h" - -#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/ro/ro.h" -#include "core/hle/service/ro/ro_nro_utils.h" -#include "core/hle/service/ro/ro_results.h" -#include "core/hle/service/ro/ro_types.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" #ifdef HAS_NCE #include "core/arm/nce/patcher.h" #include "core/hle/kernel/k_shared_memory.h" #endif +#include "core/hle/service/cmif_serialization.h" namespace Service::RO { +constexpr Result ResultOutOfAddressSpace{ErrorModule::RO, 2}; +constexpr Result ResultAlreadyLoaded{ErrorModule::RO, 3}; +constexpr Result ResultInvalidNro{ErrorModule::RO, 4}; +constexpr Result ResultInvalidNrr{ErrorModule::RO, 6}; +constexpr Result ResultTooManyNro{ErrorModule::RO, 7}; +constexpr Result ResultTooManyNrr{ErrorModule::RO, 8}; +constexpr Result ResultNotAuthorized{ErrorModule::RO, 9}; +constexpr Result ResultInvalidNrrKind{ErrorModule::RO, 10}; +constexpr Result ResultInternalError{ErrorModule::RO, 1023}; +constexpr Result ResultInvalidAddress{ErrorModule::RO, 1025}; +constexpr Result ResultInvalidSize{ErrorModule::RO, 1026}; +constexpr Result ResultNotLoaded{ErrorModule::RO, 1028}; +constexpr Result ResultNotRegistered{ErrorModule::RO, 1029}; +constexpr Result ResultInvalidSession{ErrorModule::RO, 1030}; +constexpr Result ResultInvalidProcess{ErrorModule::RO, 1031}; + +namespace { + +struct ProcessMemoryRegion { + u64 address; + u64 size; +}; + +size_t GetTotalProcessMemoryRegionSize(const ProcessMemoryRegion* regions, size_t num_regions) { + size_t total = 0; + + for (size_t i = 0; i < num_regions; ++i) { + total += regions[i].size; + } + + return total; +} + +size_t SetupNroProcessMemoryRegions(ProcessMemoryRegion* regions, u64 nro_heap_address, + u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size) { + // Reset region count. + size_t num_regions = 0; + + // We always want a region for the nro. + regions[num_regions++] = {nro_heap_address, nro_heap_size}; + + // If we have bss, create a region for bss. + if (bss_heap_size > 0) { + regions[num_regions++] = {bss_heap_address, bss_heap_size}; + } + + return num_regions; +} + +Result SetProcessMemoryPermission(Kernel::KProcess* process, u64 address, u64 size, + Kernel::Svc::MemoryPermission permission) { + auto& page_table = process->GetPageTable(); + + // Set permission. + R_RETURN(page_table.SetProcessMemoryPermission(address, size, permission)); +} + +Result UnmapProcessCodeMemory(Kernel::KProcess* process, u64 process_code_address, + const ProcessMemoryRegion* regions, size_t num_regions) { + // Get the total process memory region size. + const size_t total_size = GetTotalProcessMemoryRegionSize(regions, num_regions); + + auto& page_table = process->GetPageTable(); + + // Unmap each region in order. + size_t cur_offset = total_size; + for (size_t i = 0; i < num_regions; ++i) { + // We want to unmap in reverse order. + const auto& cur_region = regions[num_regions - 1 - i]; + + // Subtract to update the current offset. + cur_offset -= cur_region.size; + + // Unmap. + R_TRY(page_table.UnmapCodeMemory(process_code_address + cur_offset, cur_region.address, + cur_region.size)); + } + + R_SUCCEED(); +} + +Result EnsureGuardPages(Kernel::KProcessPageTable& page_table, u64 map_address, u64 map_size) { + Kernel::KMemoryInfo memory_info; + Kernel::Svc::PageInfo page_info; + + // Ensure page before mapping is unmapped. + R_TRY(page_table.QueryInfo(std::addressof(memory_info), std::addressof(page_info), + map_address - 1)); + R_UNLESS(memory_info.GetSvcState() == Kernel::Svc::MemoryState::Free, + Kernel::ResultInvalidState); + + // Ensure page after mapping is unmapped. + R_TRY(page_table.QueryInfo(std::addressof(memory_info), std::addressof(page_info), + map_address + map_size)); + R_UNLESS(memory_info.GetSvcState() == Kernel::Svc::MemoryState::Free, + Kernel::ResultInvalidState); + + // Successfully verified guard pages. + R_SUCCEED(); +} + +Result MapProcessCodeMemory(u64* out, Kernel::KProcess* process, const ProcessMemoryRegion* regions, + size_t num_regions, std::mt19937_64& generate_random) { + auto& page_table = process->GetPageTable(); + const u64 alias_code_start = + GetInteger(page_table.GetAliasCodeRegionStart()) / Kernel::PageSize; + const u64 alias_code_size = page_table.GetAliasCodeRegionSize() / Kernel::PageSize; + + for (size_t trial = 0; trial < 64; trial++) { + // Generate a new trial address. + const u64 mapped_address = + (alias_code_start + (generate_random() % alias_code_size)) * Kernel::PageSize; + + const auto MapRegions = [&] { + // Map the regions in order. + u64 mapped_size = 0; + for (size_t i = 0; i < num_regions; ++i) { + // If we fail, unmap up to where we've mapped. + ON_RESULT_FAILURE { + R_ASSERT(UnmapProcessCodeMemory(process, mapped_address, regions, i)); + }; + + // Map the current region. + R_TRY(page_table.MapCodeMemory(mapped_address + mapped_size, regions[i].address, + regions[i].size)); + + mapped_size += regions[i].size; + } + + // If we fail, unmap all mapped regions. + ON_RESULT_FAILURE { + R_ASSERT(UnmapProcessCodeMemory(process, mapped_address, regions, num_regions)); + }; + + // Ensure guard pages. + R_RETURN(EnsureGuardPages(page_table, mapped_address, mapped_size)); + }; + + if (R_SUCCEEDED(MapRegions())) { + // Set the output address. + *out = mapped_address; + R_SUCCEED(); + } + } + + // We failed to map anything. + R_THROW(RO::ResultOutOfAddressSpace); +} + +Result MapNro(u64* out_base_address, Kernel::KProcess* process, u64 nro_heap_address, + u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size, + std::mt19937_64& generate_random) { + // Set up the process memory regions. + std::array regions{}; + const size_t num_regions = SetupNroProcessMemoryRegions( + regions.data(), nro_heap_address, nro_heap_size, bss_heap_address, bss_heap_size); + + // Re-map the nro/bss as code memory in the destination process. + R_RETURN(MapProcessCodeMemory(out_base_address, process, regions.data(), num_regions, + generate_random)); +} + +Result SetNroPerms(Kernel::KProcess* process, u64 base_address, u64 rx_size, u64 ro_size, + u64 rw_size) { + const u64 rx_offset = 0; + const u64 ro_offset = rx_offset + rx_size; + const u64 rw_offset = ro_offset + ro_size; + + R_TRY(SetProcessMemoryPermission(process, base_address + rx_offset, rx_size, + Kernel::Svc::MemoryPermission::ReadExecute)); + R_TRY(SetProcessMemoryPermission(process, base_address + ro_offset, ro_size, + Kernel::Svc::MemoryPermission::Read)); + R_TRY(SetProcessMemoryPermission(process, base_address + rw_offset, rw_size, + Kernel::Svc::MemoryPermission::ReadWrite)); + + R_SUCCEED(); +} + +Result UnmapNro(Kernel::KProcess* process, u64 base_address, u64 nro_heap_address, + u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size) { + // Set up the process memory regions. + std::array regions{}; + const size_t num_regions = SetupNroProcessMemoryRegions( + regions.data(), nro_heap_address, nro_heap_size, bss_heap_address, bss_heap_size); + + // Unmap the nro/bss. + R_RETURN(UnmapProcessCodeMemory(process, base_address, regions.data(), num_regions)); +} + +} // namespace + +enum class NrrKind : u8 { + User = 0, + JitPlugin = 1, + Count, +}; + +static constexpr size_t ModuleIdSize = 0x20; +struct ModuleId { + std::array data; +}; +static_assert(sizeof(ModuleId) == ModuleIdSize); + +struct NrrCertification { + static constexpr size_t RsaKeySize = 0x100; + static constexpr size_t SignedSize = 0x120; + + u64 program_id_mask; + u64 program_id_pattern; + std::array reserved_10; + std::array modulus; + std::array signature; +}; +static_assert(sizeof(NrrCertification) == NrrCertification::RsaKeySize + NrrCertification::SignedSize); + +class NrrHeader { +public: + static constexpr u32 Magic = Common::MakeMagic('N', 'R', 'R', '0'); + +public: + bool IsMagicValid() const { + return m_magic == Magic; + } + + bool IsProgramIdValid() const { + return (m_program_id & m_certification.program_id_mask) == + m_certification.program_id_pattern; + } + + NrrKind GetNrrKind() const { + const NrrKind kind = static_cast(m_nrr_kind); + ASSERT(kind < NrrKind::Count); + return kind; + } + + u64 GetProgramId() const { + return m_program_id; + } + + u32 GetSize() const { + return m_size; + } + + u32 GetNumHashes() const { + return m_num_hashes; + } + + size_t GetHashesOffset() const { + return m_hashes_offset; + } + + u32 GetKeyGeneration() const { + return m_key_generation; + } + + const u8* GetCertificationSignature() const { + return m_certification.signature.data(); + } + + const u8* GetCertificationSignedArea() const { + return reinterpret_cast(std::addressof(m_certification)); + } + + const u8* GetCertificationModulus() const { + return m_certification.modulus.data(); + } + + const u8* GetSignature() const { + return m_signature.data(); + } + + size_t GetSignedAreaSize() const { + return m_size - GetSignedAreaOffset(); + } + + static constexpr size_t GetSignedAreaOffset() { + return offsetof(NrrHeader, m_program_id); + } + +private: + u32 m_magic; + u32 m_key_generation; + INSERT_PADDING_BYTES_NOINIT(8); + NrrCertification m_certification; + std::array m_signature; + u64 m_program_id; + u32 m_size; + u8 m_nrr_kind; // 7.0.0+ + INSERT_PADDING_BYTES_NOINIT(3); + u32 m_hashes_offset; + u32 m_num_hashes; + INSERT_PADDING_BYTES_NOINIT(8); +}; +static_assert(sizeof(NrrHeader) == 0x350, "NrrHeader has wrong size"); + +static constexpr u32 NRO_HEADER_MAGIC = Common::MakeMagic('N', 'R', 'O', '0'); +struct NroHeader { + u32 m_entrypoint_insn; + u32 m_mod_offset; + INSERT_PADDING_BYTES_NOINIT(0x8); + u32 m_magic; + INSERT_PADDING_BYTES_NOINIT(0x4); + u32 m_size; + INSERT_PADDING_BYTES_NOINIT(0x4); + u32 m_text_offset; + u32 m_text_size; + u32 m_ro_offset; + u32 m_ro_size; + u32 m_rw_offset; + u32 m_rw_size; + u32 m_bss_size; + INSERT_PADDING_BYTES_NOINIT(0x4); + ModuleId m_module_id; + INSERT_PADDING_BYTES_NOINIT(0x20); +}; +static_assert(sizeof(NroHeader) == 0x80, "NroHeader has wrong size"); + namespace { // Atmosphere defines as follows: @@ -535,29 +848,21 @@ private: class RoInterface : public ServiceFramework { public: - explicit RoInterface(Core::System& system_, const char* name_, std::shared_ptr ro, - NrrKind nrr_kind) - : ServiceFramework{system_, name_}, m_ro(ro), m_context_id(InvalidContextId), - m_nrr_kind(nrr_kind) { - - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&RoInterface::MapManualLoadModuleMemory>, "MapManualLoadModuleMemory"}, - {1, C<&RoInterface::UnmapManualLoadModuleMemory>, "UnmapManualLoadModuleMemory"}, - {2, C<&RoInterface::RegisterModuleInfo>, "RegisterModuleInfo"}, - {3, C<&RoInterface::UnregisterModuleInfo>, "UnregisterModuleInfo"}, - {4, C<&RoInterface::RegisterProcessHandle>, "RegisterProcessHandle"}, - {10, C<&RoInterface::RegisterProcessModuleInfo>, "RegisterProcessModuleInfo"}, - }; - // clang-format on - - RegisterHandlers(functions); - } + explicit RoInterface(Core::System& system_, const char* name_, std::shared_ptr ro, NrrKind nrr_kind) + : ServiceFramework{system_, name_} + , m_ro(ro) + , m_context_id(InvalidContextId) + , m_nrr_kind(nrr_kind) + {} ~RoInterface() { m_ro->UnregisterProcess(system.Kernel(), m_context_id); } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + Result MapManualLoadModuleMemory(Out out_load_address, ClientProcessId client_pid, u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size) { R_TRY(m_ro->ValidateProcess(m_context_id, *client_pid)); @@ -594,6 +899,14 @@ public: } private: + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&RoInterface::MapManualLoadModuleMemory>, "MapManualLoadModuleMemory"}, + FunctionInfo{1, C<&RoInterface::UnmapManualLoadModuleMemory>, "UnmapManualLoadModuleMemory"}, + FunctionInfo{2, C<&RoInterface::RegisterModuleInfo>, "RegisterModuleInfo"}, + FunctionInfo{3, C<&RoInterface::UnregisterModuleInfo>, "UnregisterModuleInfo"}, + FunctionInfo{4, C<&RoInterface::RegisterProcessHandle>, "RegisterProcessHandle"}, + FunctionInfo{10, C<&RoInterface::RegisterProcessModuleInfo>, "RegisterProcessModuleInfo"} + ); std::shared_ptr m_ro{}; size_t m_context_id{}; NrrKind m_nrr_kind{}; @@ -606,12 +919,14 @@ class IDebugMonitorInterface final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetProcessModuleInfo" } + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/ro/ro_nro_utils.cpp b/src/core/hle/service/ro/ro_nro_utils.cpp deleted file mode 100644 index 268c7f93e7..0000000000 --- a/src/core/hle/service/ro/ro_nro_utils.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/kernel/k_process.h" -#include "core/hle/service/ro/ro_nro_utils.h" -#include "core/hle/service/ro/ro_results.h" - -namespace Service::RO { - -namespace { - -struct ProcessMemoryRegion { - u64 address; - u64 size; -}; - -size_t GetTotalProcessMemoryRegionSize(const ProcessMemoryRegion* regions, size_t num_regions) { - size_t total = 0; - - for (size_t i = 0; i < num_regions; ++i) { - total += regions[i].size; - } - - return total; -} - -size_t SetupNroProcessMemoryRegions(ProcessMemoryRegion* regions, u64 nro_heap_address, - u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size) { - // Reset region count. - size_t num_regions = 0; - - // We always want a region for the nro. - regions[num_regions++] = {nro_heap_address, nro_heap_size}; - - // If we have bss, create a region for bss. - if (bss_heap_size > 0) { - regions[num_regions++] = {bss_heap_address, bss_heap_size}; - } - - return num_regions; -} - -Result SetProcessMemoryPermission(Kernel::KProcess* process, u64 address, u64 size, - Kernel::Svc::MemoryPermission permission) { - auto& page_table = process->GetPageTable(); - - // Set permission. - R_RETURN(page_table.SetProcessMemoryPermission(address, size, permission)); -} - -Result UnmapProcessCodeMemory(Kernel::KProcess* process, u64 process_code_address, - const ProcessMemoryRegion* regions, size_t num_regions) { - // Get the total process memory region size. - const size_t total_size = GetTotalProcessMemoryRegionSize(regions, num_regions); - - auto& page_table = process->GetPageTable(); - - // Unmap each region in order. - size_t cur_offset = total_size; - for (size_t i = 0; i < num_regions; ++i) { - // We want to unmap in reverse order. - const auto& cur_region = regions[num_regions - 1 - i]; - - // Subtract to update the current offset. - cur_offset -= cur_region.size; - - // Unmap. - R_TRY(page_table.UnmapCodeMemory(process_code_address + cur_offset, cur_region.address, - cur_region.size)); - } - - R_SUCCEED(); -} - -Result EnsureGuardPages(Kernel::KProcessPageTable& page_table, u64 map_address, u64 map_size) { - Kernel::KMemoryInfo memory_info; - Kernel::Svc::PageInfo page_info; - - // Ensure page before mapping is unmapped. - R_TRY(page_table.QueryInfo(std::addressof(memory_info), std::addressof(page_info), - map_address - 1)); - R_UNLESS(memory_info.GetSvcState() == Kernel::Svc::MemoryState::Free, - Kernel::ResultInvalidState); - - // Ensure page after mapping is unmapped. - R_TRY(page_table.QueryInfo(std::addressof(memory_info), std::addressof(page_info), - map_address + map_size)); - R_UNLESS(memory_info.GetSvcState() == Kernel::Svc::MemoryState::Free, - Kernel::ResultInvalidState); - - // Successfully verified guard pages. - R_SUCCEED(); -} - -Result MapProcessCodeMemory(u64* out, Kernel::KProcess* process, const ProcessMemoryRegion* regions, - size_t num_regions, std::mt19937_64& generate_random) { - auto& page_table = process->GetPageTable(); - const u64 alias_code_start = - GetInteger(page_table.GetAliasCodeRegionStart()) / Kernel::PageSize; - const u64 alias_code_size = page_table.GetAliasCodeRegionSize() / Kernel::PageSize; - - for (size_t trial = 0; trial < 64; trial++) { - // Generate a new trial address. - const u64 mapped_address = - (alias_code_start + (generate_random() % alias_code_size)) * Kernel::PageSize; - - const auto MapRegions = [&] { - // Map the regions in order. - u64 mapped_size = 0; - for (size_t i = 0; i < num_regions; ++i) { - // If we fail, unmap up to where we've mapped. - ON_RESULT_FAILURE { - R_ASSERT(UnmapProcessCodeMemory(process, mapped_address, regions, i)); - }; - - // Map the current region. - R_TRY(page_table.MapCodeMemory(mapped_address + mapped_size, regions[i].address, - regions[i].size)); - - mapped_size += regions[i].size; - } - - // If we fail, unmap all mapped regions. - ON_RESULT_FAILURE { - R_ASSERT(UnmapProcessCodeMemory(process, mapped_address, regions, num_regions)); - }; - - // Ensure guard pages. - R_RETURN(EnsureGuardPages(page_table, mapped_address, mapped_size)); - }; - - if (R_SUCCEEDED(MapRegions())) { - // Set the output address. - *out = mapped_address; - R_SUCCEED(); - } - } - - // We failed to map anything. - R_THROW(RO::ResultOutOfAddressSpace); -} - -} // namespace - -Result MapNro(u64* out_base_address, Kernel::KProcess* process, u64 nro_heap_address, - u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size, - std::mt19937_64& generate_random) { - // Set up the process memory regions. - std::array regions{}; - const size_t num_regions = SetupNroProcessMemoryRegions( - regions.data(), nro_heap_address, nro_heap_size, bss_heap_address, bss_heap_size); - - // Re-map the nro/bss as code memory in the destination process. - R_RETURN(MapProcessCodeMemory(out_base_address, process, regions.data(), num_regions, - generate_random)); -} - -Result SetNroPerms(Kernel::KProcess* process, u64 base_address, u64 rx_size, u64 ro_size, - u64 rw_size) { - const u64 rx_offset = 0; - const u64 ro_offset = rx_offset + rx_size; - const u64 rw_offset = ro_offset + ro_size; - - R_TRY(SetProcessMemoryPermission(process, base_address + rx_offset, rx_size, - Kernel::Svc::MemoryPermission::ReadExecute)); - R_TRY(SetProcessMemoryPermission(process, base_address + ro_offset, ro_size, - Kernel::Svc::MemoryPermission::Read)); - R_TRY(SetProcessMemoryPermission(process, base_address + rw_offset, rw_size, - Kernel::Svc::MemoryPermission::ReadWrite)); - - R_SUCCEED(); -} - -Result UnmapNro(Kernel::KProcess* process, u64 base_address, u64 nro_heap_address, - u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size) { - // Set up the process memory regions. - std::array regions{}; - const size_t num_regions = SetupNroProcessMemoryRegions( - regions.data(), nro_heap_address, nro_heap_size, bss_heap_address, bss_heap_size); - - // Unmap the nro/bss. - R_RETURN(UnmapProcessCodeMemory(process, base_address, regions.data(), num_regions)); -} - -} // namespace Service::RO diff --git a/src/core/hle/service/ro/ro_nro_utils.h b/src/core/hle/service/ro/ro_nro_utils.h deleted file mode 100644 index f7083a1ba3..0000000000 --- a/src/core/hle/service/ro/ro_nro_utils.h +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include "common/common_types.h" - -namespace Kernel { -class KProcess; -} - -union Result; - -namespace Service::RO { - -Result MapNro(u64* out_base_address, Kernel::KProcess* process, u64 nro_heap_address, - u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size, - std::mt19937_64& generate_random); -Result SetNroPerms(Kernel::KProcess* process, u64 base_address, u64 rx_size, u64 ro_size, - u64 rw_size); -Result UnmapNro(Kernel::KProcess* process, u64 base_address, u64 nro_heap_address, - u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size); - -} // namespace Service::RO diff --git a/src/core/hle/service/ro/ro_results.h b/src/core/hle/service/ro/ro_results.h deleted file mode 100644 index 906378bc7f..0000000000 --- a/src/core/hle/service/ro/ro_results.h +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/result.h" - -namespace Service::RO { - -constexpr Result ResultOutOfAddressSpace{ErrorModule::RO, 2}; -constexpr Result ResultAlreadyLoaded{ErrorModule::RO, 3}; -constexpr Result ResultInvalidNro{ErrorModule::RO, 4}; -constexpr Result ResultInvalidNrr{ErrorModule::RO, 6}; -constexpr Result ResultTooManyNro{ErrorModule::RO, 7}; -constexpr Result ResultTooManyNrr{ErrorModule::RO, 8}; -constexpr Result ResultNotAuthorized{ErrorModule::RO, 9}; -constexpr Result ResultInvalidNrrKind{ErrorModule::RO, 10}; -constexpr Result ResultInternalError{ErrorModule::RO, 1023}; -constexpr Result ResultInvalidAddress{ErrorModule::RO, 1025}; -constexpr Result ResultInvalidSize{ErrorModule::RO, 1026}; -constexpr Result ResultNotLoaded{ErrorModule::RO, 1028}; -constexpr Result ResultNotRegistered{ErrorModule::RO, 1029}; -constexpr Result ResultInvalidSession{ErrorModule::RO, 1030}; -constexpr Result ResultInvalidProcess{ErrorModule::RO, 1031}; - -} // namespace Service::RO diff --git a/src/core/hle/service/ro/ro_types.h b/src/core/hle/service/ro/ro_types.h deleted file mode 100644 index 8e88f43246..0000000000 --- a/src/core/hle/service/ro/ro_types.h +++ /dev/null @@ -1,142 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/assert.h" -#include "common/common_funcs.h" -#include "common/common_types.h" - -namespace Service::RO { - -enum class NrrKind : u8 { - User = 0, - JitPlugin = 1, - Count, -}; - -static constexpr size_t ModuleIdSize = 0x20; -struct ModuleId { - std::array data; -}; -static_assert(sizeof(ModuleId) == ModuleIdSize); - -struct NrrCertification { - static constexpr size_t RsaKeySize = 0x100; - static constexpr size_t SignedSize = 0x120; - - u64 program_id_mask; - u64 program_id_pattern; - std::array reserved_10; - std::array modulus; - std::array signature; -}; -static_assert(sizeof(NrrCertification) == - NrrCertification::RsaKeySize + NrrCertification::SignedSize); - -class NrrHeader { -public: - static constexpr u32 Magic = Common::MakeMagic('N', 'R', 'R', '0'); - -public: - bool IsMagicValid() const { - return m_magic == Magic; - } - - bool IsProgramIdValid() const { - return (m_program_id & m_certification.program_id_mask) == - m_certification.program_id_pattern; - } - - NrrKind GetNrrKind() const { - const NrrKind kind = static_cast(m_nrr_kind); - ASSERT(kind < NrrKind::Count); - return kind; - } - - u64 GetProgramId() const { - return m_program_id; - } - - u32 GetSize() const { - return m_size; - } - - u32 GetNumHashes() const { - return m_num_hashes; - } - - size_t GetHashesOffset() const { - return m_hashes_offset; - } - - u32 GetKeyGeneration() const { - return m_key_generation; - } - - const u8* GetCertificationSignature() const { - return m_certification.signature.data(); - } - - const u8* GetCertificationSignedArea() const { - return reinterpret_cast(std::addressof(m_certification)); - } - - const u8* GetCertificationModulus() const { - return m_certification.modulus.data(); - } - - const u8* GetSignature() const { - return m_signature.data(); - } - - size_t GetSignedAreaSize() const { - return m_size - GetSignedAreaOffset(); - } - - static constexpr size_t GetSignedAreaOffset() { - return offsetof(NrrHeader, m_program_id); - } - -private: - u32 m_magic; - u32 m_key_generation; - INSERT_PADDING_BYTES_NOINIT(8); - NrrCertification m_certification; - std::array m_signature; - u64 m_program_id; - u32 m_size; - u8 m_nrr_kind; // 7.0.0+ - INSERT_PADDING_BYTES_NOINIT(3); - u32 m_hashes_offset; - u32 m_num_hashes; - INSERT_PADDING_BYTES_NOINIT(8); -}; -static_assert(sizeof(NrrHeader) == 0x350, "NrrHeader has wrong size"); - -static constexpr u32 NRO_HEADER_MAGIC = Common::MakeMagic('N', 'R', 'O', '0'); -struct NroHeader { - u32 m_entrypoint_insn; - u32 m_mod_offset; - INSERT_PADDING_BYTES_NOINIT(0x8); - u32 m_magic; - INSERT_PADDING_BYTES_NOINIT(0x4); - u32 m_size; - INSERT_PADDING_BYTES_NOINIT(0x4); - u32 m_text_offset; - u32 m_text_size; - u32 m_ro_offset; - u32 m_ro_size; - u32 m_rw_offset; - u32 m_rw_size; - u32 m_bss_size; - INSERT_PADDING_BYTES_NOINIT(0x4); - ModuleId m_module_id; - INSERT_PADDING_BYTES_NOINIT(0x20); -}; -static_assert(sizeof(NroHeader) == 0x80, "NroHeader has wrong size"); - -} // namespace Service::RO diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 225b92a783..2c6e8d1c07 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -19,6 +19,7 @@ #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" #include "core/reporter.h" +#include "frontend_common/firmware_manager.h" namespace Service { @@ -47,24 +48,9 @@ ServiceFrameworkBase::~ServiceFrameworkBase() { const auto guard = ServiceFrameworkBase::LockService(); } -void ServiceFrameworkBase::RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n) { - // Usually this array is sorted by id already, so hint to insert at the end - handlers.reserve(handlers.size() + n); - for (std::size_t i = 0; i < n; ++i) - handlers.emplace_hint(handlers.cend(), functions[i].expected_header, functions[i]); -} - -void ServiceFrameworkBase::RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n) { - // Usually this array is sorted by id already, so hint to insert at the end - handlers_tipc.reserve(handlers_tipc.size() + n); - for (std::size_t i = 0; i < n; ++i) - handlers_tipc.emplace_hint(handlers_tipc.cend(), functions[i].expected_header, functions[i]); -} - -void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, - const FunctionInfoBase* info) { +void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info, bool gated) { auto cmd_buf = ctx.CommandBuffer(); - std::string function_name = info == nullptr ? "" : info->name; + std::string function_name = bool(info) ? info->name : ""; fmt::memory_buffer buf; fmt::format_to(std::back_inserter(buf), "function '{}({})': port='{}' cmd_buf={{[0]={:#x}", ctx.GetCommand(), function_name, service_name, cmd_buf[0]); @@ -73,7 +59,11 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, buf.push_back('}'); system.GetReporter().SaveUnimplementedFunctionReport(ctx, ctx.GetCommand(), function_name, service_name); - UNIMPLEMENTED_MSG("Unknown / unimplemented {}", fmt::to_string(buf)); + if (gated) { + LOG_ERROR(Service, "Version gated {}", fmt::to_string(buf)); + } else { + UNIMPLEMENTED_MSG("Unknown / unimplemented {}", fmt::to_string(buf)); + } if (Settings::values.use_auto_stub) { LOG_WARNING(Service, "Using auto stub fallback!"); IPC::ResponseBuilder rb{ctx, 2}; @@ -81,17 +71,33 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, } } +[[nodiscard]] static bool VersionGateCheck(Core::System& system, u32 vg) { + u32 const c_maj = FirmwareManager::GetFirmwareVersion(system).first.major; + u32 const c_min = FirmwareManager::GetFirmwareVersion(system).first.minor; + u32 const c_pat = FirmwareManager::GetFirmwareVersion(system).first.micro; + u32 const cg = (c_pat << 0) | (c_min << 4) | (c_maj << 8); + u32 const sg = (vg >> 16) & 0xffff; + u32 const ug = vg & 0xffff; + // feature available after current + if (sg && cg < sg) + return false; + // feature until xxx (0 = up to current) + return ug ? ug >= cg : true; +} + void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) { - const auto command = ctx.GetCommand(); - auto it = handlers.find(command); - const bool is_cmd_read = command == 0; - FunctionInfoBase const* info = it == handlers.end() ? nullptr : &it->second; - if (info == nullptr || info->handler_callback == nullptr) - return ReportUnimplementedFunction(ctx, info); + const bool is_cmd_read = ctx.GetCommand() == 0; + auto const info = FindRequest(ctx.GetCommand()); + if (!info.has_value() || info->handler_callback == nullptr) + return ReportUnimplementedFunction(ctx, &*info, false); + + if (!VersionGateCheck(system, info->version_gating)) + { + return ReportUnimplementedFunction(ctx, &*info, true); + } LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer())); handler_invoker(this, info->handler_callback, ctx); - if (is_i_storage && is_cmd_read) { const auto* const process = ctx.GetThread().GetOwnerProcess(); if (process != nullptr && system.IsNVDECActiveForProcess(process->GetId())) { @@ -101,10 +107,15 @@ void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) { } void ServiceFrameworkBase::InvokeRequestTipc(HLERequestContext& ctx) { - auto it = handlers_tipc.find(ctx.GetCommand()); - FunctionInfoBase const* info = it == handlers_tipc.end() ? nullptr : &it->second; - if (info == nullptr || info->handler_callback == nullptr) - return ReportUnimplementedFunction(ctx, info); + auto const info = FindRequestTipc(ctx.GetCommand()); + if (!info.has_value() || info->handler_callback == nullptr) + return ReportUnimplementedFunction(ctx, &*info, false); + + LOG_ERROR(Service, "check for {} version_gating: {}", info->name, info->version_gating); + if (!VersionGateCheck(system, info->version_gating)) + { + return ReportUnimplementedFunction(ctx, &*info, true); + } LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer())); handler_invoker(this, info->handler_callback, ctx); diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index ea98897e79..e8bd8683ea 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -7,7 +7,11 @@ #pragma once #include +#include #include +#include +#include +#include "frozen/map.h" #include "common/container/unordered_map.h" #include "common/common_types.h" #include "core/hle/service/hle_ipc.h" @@ -77,30 +81,35 @@ protected: [[nodiscard]] virtual std::unique_lock LockService() noexcept { return std::unique_lock{lock_service}; } + + static constexpr u32 MakeVersionGate(std::tuple since, std::tuple until = {0, 0, 0}) { + auto const [s_maj, s_min, s_pat] = since; + auto const [u_maj, u_min, u_pat] = until; + return (u_pat << 0) | (u_min << 4) | (u_maj << 8) + | (s_pat << 16) | (s_min << 20) | (s_maj << 24); + } + + struct FunctionInfoBase { + HandlerFnP handler_callback; + const char* name; + u32 version_gating; + }; + static_assert(std::is_trivially_constructible_v); private: template friend class ServiceFramework; - struct FunctionInfoBase { - u32 expected_header; - HandlerFnP handler_callback; - const char* name; - }; + using InvokerFn = void(ServiceFrameworkBase* object, HandlerFnP member, HLERequestContext& ctx); - using InvokerFn = void(ServiceFrameworkBase* object, HandlerFnP member, - HLERequestContext& ctx); - - explicit ServiceFrameworkBase(Core::System& system_, const char* service_name_, - u32 max_sessions_, InvokerFn* handler_invoker_); + explicit ServiceFrameworkBase(Core::System& system_, const char* service_name_, u32 max_sessions_, InvokerFn* handler_invoker_); ~ServiceFrameworkBase() override; - void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n); - void RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n); - void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info); + virtual std::optional FindRequest(u32 key) = 0; + virtual std::optional FindRequestTipc(u32 key) = 0; + + void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info, bool gated); protected: - ::Common::unordered_map handlers; - ::Common::unordered_map handlers_tipc; /// Used to gain exclusive access to the service members, e.g. from CoreTiming thread. std::mutex lock_service; /// System context that the service operates under. @@ -121,8 +130,7 @@ protected: /** * Framework for implementing HLE services. Dispatches on the header id of incoming SyncRequests * based on a table mapping header ids to handler functions. Service implementations should inherit - * from ServiceFramework using the CRTP (`class Foo : public ServiceFramework { ... };`) and - * populate it with handlers by calling #RegisterHandlers. + * from ServiceFramework using the CRTP (`class Foo : public ServiceFramework { ... };`) * * In order to avoid duplicating code in the binary and exposing too many implementation details in * the header, this class is split into a non-templated base (ServiceFrameworkBase) and a template @@ -143,50 +151,77 @@ protected: /// @param expected_header_ request header in the command buffer which will trigger dispatch to this handler /// @param handler_callback_ member function in this service which will be called to handle the request /// @param name_ human-friendly name for the request. Used mostly for logging purposes. - FunctionInfoTyped(u32 expected_header_, HandlerFnP handler_callback_, const char* name_) - : FunctionInfoBase{expected_header_, HandlerFnP(handler_callback_), name_} {} + explicit constexpr FunctionInfoTyped(u32 expected_header_, HandlerFnP handler_callback_, const char* name_, u32 version_gating_ = 0) + : handler_callback{handler_callback_} + , name{name_} + , version_gating{version_gating_} + , expected_header{expected_header_} + {} + HandlerFnP handler_callback; + const char* name; + u32 version_gating; + u32 expected_header; }; using FunctionInfo = FunctionInfoTyped; - /** - * Initializes the handler with no functions installed. - * - * @param system_ The system context to construct this service under. - * @param service_name_ Name of the service. - * @param max_sessions_ Maximum number of sessions that can be connected to this service at the - * same time. - */ + // expected_header serves as a key to 'address' function handlers, thus only include the minimal + template + struct FunctionValueInfo { + explicit constexpr FunctionValueInfo(HandlerFnP handler_callback_, const char* name_, u32 version_gating_) + : handler_callback{handler_callback_} + , name{name_} + , version_gating{version_gating_} + {} + HandlerFnP handler_callback; + const char* name; + u32 version_gating; + }; + + template + //requires (std::same_as && ...) + [[nodiscard]] static consteval frozen::map, sizeof...(Ts)> CreateStaticMap(Ts... args) { + return frozen::map, sizeof...(args)>{ + {args.expected_header, FunctionValueInfo{args.handler_callback, args.name, args.version_gating}}... + }; + } + + // Used exclusively by NFC + template + //requires (std::same_as> && ...) + [[nodiscard]] static consteval frozen::map, sizeof...(Ts)> CreateStaticMapWithClass(Ts... args) { + return frozen::map, sizeof...(args)>{ + {args.expected_header, FunctionValueInfo{args.handler_callback, args.name, args.version_gating}}... + }; + } + + template + [[nodiscard]] static std::optional HandlerTableGenerateWithFind(u32 key, T const& map) { + auto const it = map.find(key); + if (it != map.end()) { + auto const r = it->second; + return std::optional{{ + HandlerFnP(r.handler_callback), + r.name, + r.version_gating + }}; + } + return std::nullopt; + } + + /// @brief Initializes the handler with no functions installed. + /// @param system_ The system context to construct this service under. + /// @param service_name_ Name of the service. + /// @param max_sessions_ Maximum number of sessions that can be connected to this service at the + /// same time. explicit ServiceFramework(Core::System& system_, const char* service_name_, u32 max_sessions_ = ServerSessionCountMax) - : ServiceFrameworkBase(system_, service_name_, max_sessions_, Invoker) {} + : ServiceFrameworkBase(system_, service_name_, max_sessions_, Invoker) + {} - /// Registers handlers in the service. - template - void RegisterHandlers(const FunctionInfoTyped (&functions)[N]) { - RegisterHandlers(functions, N); + std::optional FindRequest(u32 key) override { + UNREACHABLE(); } - - /** - * Registers handlers in the service. Usually prefer using the other RegisterHandlers - * overload in order to avoid needing to specify the array size. - */ - template - void RegisterHandlers(const FunctionInfoTyped* functions, std::size_t n) { - RegisterHandlersBase(functions, n); - } - - /// Registers handlers in the service. - template - void RegisterHandlersTipc(const FunctionInfoTyped (&functions)[N]) { - RegisterHandlersTipc(functions, N); - } - - /** - * Registers handlers in the service. Usually prefer using the other RegisterHandlers - * overload in order to avoid needing to specify the array size. - */ - template - void RegisterHandlersTipc(const FunctionInfoTyped* functions, std::size_t n) { - RegisterHandlersBaseTipc(functions, n); + std::optional FindRequestTipc(u32 key) override { + UNREACHABLE(); } protected: diff --git a/src/core/hle/service/set/factory_settings_server.cpp b/src/core/hle/service/set/factory_settings_server.cpp index a8e307ae26..70d02fab3b 100644 --- a/src/core/hle/service/set/factory_settings_server.cpp +++ b/src/core/hle/service/set/factory_settings_server.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -7,55 +10,6 @@ namespace Service::Set { IFactorySettingsServer::IFactorySettingsServer(Core::System& system_) : ServiceFramework{system_, "set:cal"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetBluetoothBdAddress"}, - {1, nullptr, "GetConfigurationId1"}, - {2, nullptr, "GetAccelerometerOffset"}, - {3, nullptr, "GetAccelerometerScale"}, - {4, nullptr, "GetGyroscopeOffset"}, - {5, nullptr, "GetGyroscopeScale"}, - {6, nullptr, "GetWirelessLanMacAddress"}, - {7, nullptr, "GetWirelessLanCountryCodeCount"}, - {8, nullptr, "GetWirelessLanCountryCodes"}, - {9, nullptr, "GetSerialNumber"}, - {10, nullptr, "SetInitialSystemAppletProgramId"}, - {11, nullptr, "SetOverlayDispProgramId"}, - {12, nullptr, "GetBatteryLot"}, - {14, nullptr, "GetEciDeviceCertificate"}, - {15, nullptr, "GetEticketDeviceCertificate"}, - {16, nullptr, "GetSslKey"}, - {17, nullptr, "GetSslCertificate"}, - {18, nullptr, "GetGameCardKey"}, - {19, nullptr, "GetGameCardCertificate"}, - {20, nullptr, "GetEciDeviceKey"}, - {21, nullptr, "GetEticketDeviceKey"}, - {22, nullptr, "GetSpeakerParameter"}, - {23, nullptr, "GetLcdVendorId"}, - {24, nullptr, "GetEciDeviceCertificate2"}, - {25, nullptr, "GetEciDeviceKey2"}, - {26, nullptr, "GetAmiiboKey"}, - {27, nullptr, "GetAmiiboEcqvCertificate"}, - {28, nullptr, "GetAmiiboEcdsaCertificate"}, - {29, nullptr, "GetAmiiboEcqvBlsKey"}, - {30, nullptr, "GetAmiiboEcqvBlsCertificate"}, - {31, nullptr, "GetAmiiboEcqvBlsRootCertificate"}, - {32, nullptr, "GetUsbTypeCPowerSourceCircuitVersion"}, - {33, nullptr, "GetAnalogStickModuleTypeL"}, - {34, nullptr, "GetAnalogStickModelParameterL"}, - {35, nullptr, "GetAnalogStickFactoryCalibrationL"}, - {36, nullptr, "GetAnalogStickModuleTypeR"}, - {37, nullptr, "GetAnalogStickModelParameterR"}, - {38, nullptr, "GetAnalogStickFactoryCalibrationR"}, - {39, nullptr, "GetConsoleSixAxisSensorModuleType"}, - {40, nullptr, "GetConsoleSixAxisSensorHorizontalOffset"}, - {41, nullptr, "GetBatteryVersion"}, - {42, nullptr, "GetDeviceId"}, - {43, nullptr, "GetConsoleSixAxisSensorMountType"}, - }; - // clang-format on - - RegisterHandlers(functions); } IFactorySettingsServer::~IFactorySettingsServer() = default; diff --git a/src/core/hle/service/set/factory_settings_server.h b/src/core/hle/service/set/factory_settings_server.h index e64cd13809..dcc329f9c2 100644 --- a/src/core/hle/service/set/factory_settings_server.h +++ b/src/core/hle/service/set/factory_settings_server.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,55 @@ class IFactorySettingsServer final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetBluetoothBdAddress"}, + FunctionInfo{1, nullptr, "GetConfigurationId1"}, + FunctionInfo{2, nullptr, "GetAccelerometerOffset"}, + FunctionInfo{3, nullptr, "GetAccelerometerScale"}, + FunctionInfo{4, nullptr, "GetGyroscopeOffset"}, + FunctionInfo{5, nullptr, "GetGyroscopeScale"}, + FunctionInfo{6, nullptr, "GetWirelessLanMacAddress"}, + FunctionInfo{7, nullptr, "GetWirelessLanCountryCodeCount"}, + FunctionInfo{8, nullptr, "GetWirelessLanCountryCodes"}, + FunctionInfo{9, nullptr, "GetSerialNumber"}, + FunctionInfo{10, nullptr, "SetInitialSystemAppletProgramId"}, + FunctionInfo{11, nullptr, "SetOverlayDispProgramId"}, + FunctionInfo{12, nullptr, "GetBatteryLot"}, + FunctionInfo{14, nullptr, "GetEciDeviceCertificate"}, + FunctionInfo{15, nullptr, "GetEticketDeviceCertificate"}, + FunctionInfo{16, nullptr, "GetSslKey"}, + FunctionInfo{17, nullptr, "GetSslCertificate"}, + FunctionInfo{18, nullptr, "GetGameCardKey"}, + FunctionInfo{19, nullptr, "GetGameCardCertificate"}, + FunctionInfo{20, nullptr, "GetEciDeviceKey"}, + FunctionInfo{21, nullptr, "GetEticketDeviceKey"}, + FunctionInfo{22, nullptr, "GetSpeakerParameter"}, + FunctionInfo{23, nullptr, "GetLcdVendorId"}, + FunctionInfo{24, nullptr, "GetEciDeviceCertificate2"}, + FunctionInfo{25, nullptr, "GetEciDeviceKey2"}, + FunctionInfo{26, nullptr, "GetAmiiboKey"}, + FunctionInfo{27, nullptr, "GetAmiiboEcqvCertificate"}, + FunctionInfo{28, nullptr, "GetAmiiboEcdsaCertificate"}, + FunctionInfo{29, nullptr, "GetAmiiboEcqvBlsKey"}, + FunctionInfo{30, nullptr, "GetAmiiboEcqvBlsCertificate"}, + FunctionInfo{31, nullptr, "GetAmiiboEcqvBlsRootCertificate"}, + FunctionInfo{32, nullptr, "GetUsbTypeCPowerSourceCircuitVersion"}, + FunctionInfo{33, nullptr, "GetAnalogStickModuleTypeL"}, + FunctionInfo{34, nullptr, "GetAnalogStickModelParameterL"}, + FunctionInfo{35, nullptr, "GetAnalogStickFactoryCalibrationL"}, + FunctionInfo{36, nullptr, "GetAnalogStickModuleTypeR"}, + FunctionInfo{37, nullptr, "GetAnalogStickModelParameterR"}, + FunctionInfo{38, nullptr, "GetAnalogStickFactoryCalibrationR"}, + FunctionInfo{39, nullptr, "GetConsoleSixAxisSensorModuleType"}, + FunctionInfo{40, nullptr, "GetConsoleSixAxisSensorHorizontalOffset"}, + FunctionInfo{41, nullptr, "GetBatteryVersion"}, + FunctionInfo{42, nullptr, "GetDeviceId"}, + FunctionInfo{43, nullptr, "GetConsoleSixAxisSensorMountType"} + ); }; } // namespace Service::Set diff --git a/src/core/hle/service/set/firmware_debug_settings_server.cpp b/src/core/hle/service/set/firmware_debug_settings_server.cpp index b7c66047e6..35fb43f7e7 100644 --- a/src/core/hle/service/set/firmware_debug_settings_server.cpp +++ b/src/core/hle/service/set/firmware_debug_settings_server.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project @@ -10,23 +10,6 @@ namespace Service::Set { IFirmwareDebugSettingsServer::IFirmwareDebugSettingsServer(Core::System& system_) : ServiceFramework{system_, "set:fd"} { - // clang-format off - static const FunctionInfo functions[] = { - {2, nullptr, "SetSettingsItemValue"}, - {3, nullptr, "ResetSettingsItemValue"}, - {4, nullptr, "CreateSettingsItemKeyIterator"}, - {10, nullptr, "ReadSettings"}, - {11, nullptr, "ResetSettings"}, - {20, nullptr, "SetWebInspectorFlag"}, - {21, nullptr, "SetAllowedSslHosts"}, - {22, nullptr, "SetHostFsMountPoint"}, - {23, nullptr, "SetMemoryUsageRateFlag"}, - {24, nullptr, "CommitSettings"}, //20.0.0+ - {27, nullptr, "SetHttpAuthConfigs"}, //21.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); } IFirmwareDebugSettingsServer::~IFirmwareDebugSettingsServer() = default; diff --git a/src/core/hle/service/set/firmware_debug_settings_server.h b/src/core/hle/service/set/firmware_debug_settings_server.h index 5dae2263e9..3727a1a94c 100644 --- a/src/core/hle/service/set/firmware_debug_settings_server.h +++ b/src/core/hle/service/set/firmware_debug_settings_server.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -15,6 +18,23 @@ class IFirmwareDebugSettingsServer final : public ServiceFramework FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{2, nullptr, "SetSettingsItemValue"}, + FunctionInfo{3, nullptr, "ResetSettingsItemValue"}, + FunctionInfo{4, nullptr, "CreateSettingsItemKeyIterator"}, + FunctionInfo{10, nullptr, "ReadSettings"}, + FunctionInfo{11, nullptr, "ResetSettings"}, + FunctionInfo{20, nullptr, "SetWebInspectorFlag"}, + FunctionInfo{21, nullptr, "SetAllowedSslHosts"}, + FunctionInfo{22, nullptr, "SetHostFsMountPoint"}, + FunctionInfo{23, nullptr, "SetMemoryUsageRateFlag"}, + FunctionInfo{24, nullptr, "CommitSettings", MakeVersionGate({20,0,0})}, + FunctionInfo{27, nullptr, "SetHttpAuthConfigs", MakeVersionGate({21,0,0})} + ); }; } // namespace Service::Set diff --git a/src/core/hle/service/set/settings_server.cpp b/src/core/hle/service/set/settings_server.cpp index 942dddc9bc..4580cb723b 100644 --- a/src/core/hle/service/set/settings_server.cpp +++ b/src/core/hle/service/set/settings_server.cpp @@ -89,26 +89,26 @@ LanguageCode GetLanguageCodeFromIndex(std::size_t index) { return available_language_codes.at(index); } -ISettingsServer::ISettingsServer(Core::System& system_) : ServiceFramework{system_, "set"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&ISettingsServer::GetLanguageCode>, "GetLanguageCode"}, - {1, C<&ISettingsServer::GetAvailableLanguageCodes>, "GetAvailableLanguageCodes"}, - {2, C<&ISettingsServer::MakeLanguageCode>, "MakeLanguageCode"}, - {3, C<&ISettingsServer::GetAvailableLanguageCodeCount>, "GetAvailableLanguageCodeCount"}, - {4, C<&ISettingsServer::GetRegionCode>, "GetRegionCode"}, - {5, C<&ISettingsServer::GetAvailableLanguageCodes2>, "GetAvailableLanguageCodes2"}, - {6, C<&ISettingsServer::GetAvailableLanguageCodeCount2>, "GetAvailableLanguageCodeCount2"}, - {7, C<&ISettingsServer::GetKeyCodeMap>, "GetKeyCodeMap"}, - {8, C<&ISettingsServer::GetQuestFlag>, "GetQuestFlag"}, - {9, C<&ISettingsServer::GetKeyCodeMap2>, "GetKeyCodeMap2"}, - {10, nullptr, "GetFirmwareVersionForDebug"}, - {11, C<&ISettingsServer::GetDeviceNickName>, "GetDeviceNickName"}, - {12, C<&ISettingsServer::GetKeyCodeMapByPort>, "GetKeyCodeMapByPort"}, - }; - // clang-format on +std::optional ISettingsServer::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&ISettingsServer::GetLanguageCode>, "GetLanguageCode"}, + FunctionInfo{1, C<&ISettingsServer::GetAvailableLanguageCodes>, "GetAvailableLanguageCodes"}, + FunctionInfo{2, C<&ISettingsServer::MakeLanguageCode>, "MakeLanguageCode"}, + FunctionInfo{3, C<&ISettingsServer::GetAvailableLanguageCodeCount>, "GetAvailableLanguageCodeCount"}, + FunctionInfo{4, C<&ISettingsServer::GetRegionCode>, "GetRegionCode"}, + FunctionInfo{5, C<&ISettingsServer::GetAvailableLanguageCodes2>, "GetAvailableLanguageCodes2"}, + FunctionInfo{6, C<&ISettingsServer::GetAvailableLanguageCodeCount2>, "GetAvailableLanguageCodeCount2"}, + FunctionInfo{7, C<&ISettingsServer::GetKeyCodeMap>, "GetKeyCodeMap"}, + FunctionInfo{8, C<&ISettingsServer::GetQuestFlag>, "GetQuestFlag"}, + FunctionInfo{9, C<&ISettingsServer::GetKeyCodeMap2>, "GetKeyCodeMap2"}, + FunctionInfo{10, nullptr, "GetFirmwareVersionForDebug"}, + FunctionInfo{11, C<&ISettingsServer::GetDeviceNickName>, "GetDeviceNickName"}, + FunctionInfo{12, C<&ISettingsServer::GetKeyCodeMapByPort>, "GetKeyCodeMapByPort"} + ); + return HandlerTableGenerateWithFind(key, functions); +} - RegisterHandlers(functions); +ISettingsServer::ISettingsServer(Core::System& system_) : ServiceFramework{system_, "set"} { } ISettingsServer::~ISettingsServer() = default; diff --git a/src/core/hle/service/set/settings_server.h b/src/core/hle/service/set/settings_server.h index a9cee5f626..2aa487b8b1 100644 --- a/src/core/hle/service/set/settings_server.h +++ b/src/core/hle/service/set/settings_server.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -23,31 +26,19 @@ public: private: Result GetLanguageCode(Out out_language_code); - - Result GetAvailableLanguageCodes(Out out_count, - OutArray language_codes); - + Result GetAvailableLanguageCodes(Out out_count, OutArray language_codes); Result MakeLanguageCode(Out out_language_code, Language language); - Result GetAvailableLanguageCodeCount(Out out_count); - Result GetRegionCode(Out out_region_code); - - Result GetAvailableLanguageCodes2( - Out out_count, OutArray language_codes); - + Result GetAvailableLanguageCodes2(Out out_count, OutArray language_codes); Result GetAvailableLanguageCodeCount2(Out out_count); - Result GetKeyCodeMap(OutLargeData out_key_code_map); - Result GetQuestFlag(Out out_quest_flag); - Result GetKeyCodeMap2(OutLargeData out_key_code_map); - - Result GetDeviceNickName( - OutLargeData, BufferAttr_HipcMapAlias> out_device_name); - + Result GetDeviceNickName(OutLargeData, BufferAttr_HipcMapAlias> out_device_name); Result GetKeyCodeMapByPort(OutLargeData out_key_code_map, u32 port); + + std::optional FindRequest(u32 key) override; }; } // namespace Service::Set diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp index 52642e37f7..925207d927 100644 --- a/src/core/hle/service/set/system_settings_server.cpp +++ b/src/core/hle/service/set/system_settings_server.cpp @@ -114,240 +114,239 @@ Result GetFirmwareVersionImpl(FirmwareVersionFormat& out_firmware, Core::System& return ResultSuccess; } +std::optional ISystemSettingsServer::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&ISystemSettingsServer::SetLanguageCode>, "SetLanguageCode"}, + FunctionInfo{1, nullptr, "SetNetworkSettings"}, + FunctionInfo{2, nullptr, "GetNetworkSettings"}, + FunctionInfo{3, C<&ISystemSettingsServer::GetFirmwareVersion>, "GetFirmwareVersion"}, + FunctionInfo{4, C<&ISystemSettingsServer::GetFirmwareVersion2>, "GetFirmwareVersion2"}, + FunctionInfo{5, nullptr, "GetFirmwareVersionDigest"}, + FunctionInfo{7, C<&ISystemSettingsServer::GetLockScreenFlag>, "GetLockScreenFlag"}, + FunctionInfo{8, C<&ISystemSettingsServer::SetLockScreenFlag>, "SetLockScreenFlag"}, + FunctionInfo{9, nullptr, "GetBacklightSettings"}, + FunctionInfo{10, nullptr, "SetBacklightSettings"}, + FunctionInfo{11, nullptr, "SetBluetoothDevicesSettings"}, + FunctionInfo{12, nullptr, "GetBluetoothDevicesSettings"}, + FunctionInfo{13, C<&ISystemSettingsServer::GetExternalSteadyClockSourceId>, "GetExternalSteadyClockSourceId"}, + FunctionInfo{14, C<&ISystemSettingsServer::SetExternalSteadyClockSourceId>, "SetExternalSteadyClockSourceId"}, + FunctionInfo{15, C<&ISystemSettingsServer::GetUserSystemClockContext>, "GetUserSystemClockContext"}, + FunctionInfo{16, C<&ISystemSettingsServer::SetUserSystemClockContext>, "SetUserSystemClockContext"}, + FunctionInfo{17, C<&ISystemSettingsServer::GetAccountSettings>, "GetAccountSettings"}, + FunctionInfo{18, C<&ISystemSettingsServer::SetAccountSettings>, "SetAccountSettings"}, + FunctionInfo{19, nullptr, "GetAudioVolume"}, + FunctionInfo{20, nullptr, "SetAudioVolume"}, + FunctionInfo{21, C<&ISystemSettingsServer::GetEulaVersions>, "GetEulaVersions"}, + FunctionInfo{22, C<&ISystemSettingsServer::SetEulaVersions>, "SetEulaVersions"}, + FunctionInfo{23, C<&ISystemSettingsServer::GetColorSetId>, "GetColorSetId"}, + FunctionInfo{24, C<&ISystemSettingsServer::SetColorSetId>, "SetColorSetId"}, + FunctionInfo{25, C<&ISystemSettingsServer::GetConsoleInformationUploadFlag>, "GetConsoleInformationUploadFlag"}, + FunctionInfo{26, C<&ISystemSettingsServer::SetConsoleInformationUploadFlag>, "SetConsoleInformationUploadFlag"}, + FunctionInfo{27, C<&ISystemSettingsServer::GetAutomaticApplicationDownloadFlag>, "GetAutomaticApplicationDownloadFlag"}, + FunctionInfo{28, C<&ISystemSettingsServer::SetAutomaticApplicationDownloadFlag>, "SetAutomaticApplicationDownloadFlag"}, + FunctionInfo{29, C<&ISystemSettingsServer::GetNotificationSettings>, "GetNotificationSettings"}, + FunctionInfo{30, C<&ISystemSettingsServer::SetNotificationSettings>, "SetNotificationSettings"}, + FunctionInfo{31, C<&ISystemSettingsServer::GetAccountNotificationSettings>, "GetAccountNotificationSettings"}, + FunctionInfo{32, C<&ISystemSettingsServer::SetAccountNotificationSettings>, "SetAccountNotificationSettings"}, + FunctionInfo{35, C<&ISystemSettingsServer::GetVibrationMasterVolume>, "GetVibrationMasterVolume"}, + FunctionInfo{36, C<&ISystemSettingsServer::SetVibrationMasterVolume>, "SetVibrationMasterVolume"}, + FunctionInfo{37, C<&ISystemSettingsServer::GetSettingsItemValueSize>, "GetSettingsItemValueSize"}, + FunctionInfo{38, C<&ISystemSettingsServer::GetSettingsItemValue>, "GetSettingsItemValue"}, + FunctionInfo{39, C<&ISystemSettingsServer::GetTvSettings>, "GetTvSettings"}, + FunctionInfo{40, C<&ISystemSettingsServer::SetTvSettings>, "SetTvSettings"}, + FunctionInfo{41, nullptr, "GetEdid"}, + FunctionInfo{42, nullptr, "SetEdid"}, + FunctionInfo{43, C<&ISystemSettingsServer::GetAudioOutputMode>, "GetAudioOutputMode"}, + FunctionInfo{44, C<&ISystemSettingsServer::SetAudioOutputMode>, "SetAudioOutputMode"}, + FunctionInfo{45, C<&ISystemSettingsServer::GetSpeakerAutoMuteFlag>, "GetSpeakerAutoMuteFlag"}, + FunctionInfo{46, C<&ISystemSettingsServer::SetSpeakerAutoMuteFlag>, "SetSpeakerAutoMuteFlag"}, + FunctionInfo{47, C<&ISystemSettingsServer::GetQuestFlag>, "GetQuestFlag"}, + FunctionInfo{48, C<&ISystemSettingsServer::SetQuestFlag>, "SetQuestFlag"}, + FunctionInfo{49, nullptr, "GetDataDeletionSettings"}, + FunctionInfo{50, nullptr, "SetDataDeletionSettings"}, + FunctionInfo{51, nullptr, "GetInitialSystemAppletProgramId"}, + FunctionInfo{52, nullptr, "GetOverlayDispProgramId"}, + FunctionInfo{53, C<&ISystemSettingsServer::GetDeviceTimeZoneLocationName>, "GetDeviceTimeZoneLocationName"}, + FunctionInfo{54, C<&ISystemSettingsServer::SetDeviceTimeZoneLocationName>, "SetDeviceTimeZoneLocationName"}, + FunctionInfo{55, nullptr, "GetWirelessCertificationFileSize"}, + FunctionInfo{56, nullptr, "GetWirelessCertificationFile"}, + FunctionInfo{57, C<&ISystemSettingsServer::SetRegionCode>, "SetRegionCode"}, + FunctionInfo{58, C<&ISystemSettingsServer::GetNetworkSystemClockContext>, "GetNetworkSystemClockContext"}, + FunctionInfo{59, C<&ISystemSettingsServer::SetNetworkSystemClockContext>, "SetNetworkSystemClockContext"}, + FunctionInfo{60, C<&ISystemSettingsServer::IsUserSystemClockAutomaticCorrectionEnabled>, "IsUserSystemClockAutomaticCorrectionEnabled"}, + FunctionInfo{61, C<&ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionEnabled>, "SetUserSystemClockAutomaticCorrectionEnabled"}, + FunctionInfo{62, C<&ISystemSettingsServer::GetDebugModeFlag>, "GetDebugModeFlag"}, + FunctionInfo{63, C<&ISystemSettingsServer::GetPrimaryAlbumStorage>, "GetPrimaryAlbumStorage"}, + FunctionInfo{64, C<&ISystemSettingsServer::SetPrimaryAlbumStorage>, "SetPrimaryAlbumStorage"}, + FunctionInfo{65, C<&ISystemSettingsServer::GetUsb30EnableFlag>, "GetUsb30EnableFlag"}, + FunctionInfo{66, C<&ISystemSettingsServer::SetUsb30EnableFlag>, "SetUsb30EnableFlag"}, + FunctionInfo{67, C<&ISystemSettingsServer::GetBatteryLot>, "GetBatteryLot"}, + FunctionInfo{68, C<&ISystemSettingsServer::GetSerialNumber>, "GetSerialNumber"}, + FunctionInfo{69, C<&ISystemSettingsServer::GetNfcEnableFlag>, "GetNfcEnableFlag"}, + FunctionInfo{70, C<&ISystemSettingsServer::SetNfcEnableFlag>, "SetNfcEnableFlag"}, + FunctionInfo{71, C<&ISystemSettingsServer::GetSleepSettings>, "GetSleepSettings"}, + FunctionInfo{72, C<&ISystemSettingsServer::SetSleepSettings>, "SetSleepSettings"}, + FunctionInfo{73, C<&ISystemSettingsServer::GetWirelessLanEnableFlag>, "GetWirelessLanEnableFlag"}, + FunctionInfo{74, C<&ISystemSettingsServer::SetWirelessLanEnableFlag>, "SetWirelessLanEnableFlag"}, + FunctionInfo{75, C<&ISystemSettingsServer::GetInitialLaunchSettings>, "GetInitialLaunchSettings"}, + FunctionInfo{76, C<&ISystemSettingsServer::SetInitialLaunchSettings>, "SetInitialLaunchSettings"}, + FunctionInfo{77, C<&ISystemSettingsServer::GetDeviceNickName>, "GetDeviceNickName"}, + FunctionInfo{78, C<&ISystemSettingsServer::SetDeviceNickName>, "SetDeviceNickName"}, + FunctionInfo{79, C<&ISystemSettingsServer::GetProductModel>, "GetProductModel"}, + FunctionInfo{80, nullptr, "GetLdnChannel"}, + FunctionInfo{81, nullptr, "SetLdnChannel"}, + FunctionInfo{82, nullptr, "AcquireTelemetryDirtyFlagEventHandle"}, + FunctionInfo{83, nullptr, "GetTelemetryDirtyFlags"}, + FunctionInfo{84, nullptr, "GetPtmBatteryLot"}, + FunctionInfo{85, nullptr, "SetPtmBatteryLot"}, + FunctionInfo{86, nullptr, "GetPtmFuelGaugeParameter"}, + FunctionInfo{87, nullptr, "SetPtmFuelGaugeParameter"}, + FunctionInfo{88, C<&ISystemSettingsServer::GetBluetoothEnableFlag>, "GetBluetoothEnableFlag"}, + FunctionInfo{89, C<&ISystemSettingsServer::SetBluetoothEnableFlag>, "SetBluetoothEnableFlag"}, + FunctionInfo{90, C<&ISystemSettingsServer::GetMiiAuthorId>, "GetMiiAuthorId"}, + FunctionInfo{91, nullptr, "SetShutdownRtcValue"}, + FunctionInfo{92, nullptr, "GetShutdownRtcValue"}, + FunctionInfo{93, nullptr, "AcquireFatalDirtyFlagEventHandle"}, + FunctionInfo{94, nullptr, "GetFatalDirtyFlags"}, + FunctionInfo{95, C<&ISystemSettingsServer::GetAutoUpdateEnableFlag>, "GetAutoUpdateEnableFlag"}, + FunctionInfo{96, C<&ISystemSettingsServer::SetAutoUpdateEnableFlag>, "SetAutoUpdateEnableFlag"}, + FunctionInfo{97, nullptr, "GetNxControllerSettings"}, + FunctionInfo{98, nullptr, "SetNxControllerSettings"}, + FunctionInfo{99, C<&ISystemSettingsServer::GetBatteryPercentageFlag>, "GetBatteryPercentageFlag"}, + FunctionInfo{100, C<&ISystemSettingsServer::SetBatteryPercentageFlag>, "SetBatteryPercentageFlag"}, + FunctionInfo{101, nullptr, "GetExternalRtcResetFlag"}, + FunctionInfo{102, nullptr, "SetExternalRtcResetFlag"}, + FunctionInfo{103, nullptr, "GetUsbFullKeyEnableFlag"}, + FunctionInfo{104, nullptr, "SetUsbFullKeyEnableFlag"}, + FunctionInfo{105, C<&ISystemSettingsServer::SetExternalSteadyClockInternalOffset>, "SetExternalSteadyClockInternalOffset"}, + FunctionInfo{106, C<&ISystemSettingsServer::GetExternalSteadyClockInternalOffset>, "GetExternalSteadyClockInternalOffset"}, + FunctionInfo{107, nullptr, "GetBacklightSettingsEx"}, + FunctionInfo{108, nullptr, "SetBacklightSettingsEx"}, + FunctionInfo{109, nullptr, "GetHeadphoneVolumeWarningCount"}, + FunctionInfo{110, nullptr, "SetHeadphoneVolumeWarningCount"}, + FunctionInfo{111, nullptr, "GetBluetoothAfhEnableFlag"}, + FunctionInfo{112, nullptr, "SetBluetoothAfhEnableFlag"}, + FunctionInfo{113, nullptr, "GetBluetoothBoostEnableFlag"}, + FunctionInfo{114, nullptr, "SetBluetoothBoostEnableFlag"}, + FunctionInfo{115, nullptr, "GetInRepairProcessEnableFlag"}, + FunctionInfo{116, nullptr, "SetInRepairProcessEnableFlag"}, + FunctionInfo{117, nullptr, "GetHeadphoneVolumeUpdateFlag"}, + FunctionInfo{118, nullptr, "SetHeadphoneVolumeUpdateFlag"}, + FunctionInfo{119, nullptr, "NeedsToUpdateHeadphoneVolume"}, + FunctionInfo{120, C<&ISystemSettingsServer::GetPushNotificationActivityModeOnSleep>, "GetPushNotificationActivityModeOnSleep"}, + FunctionInfo{121, C<&ISystemSettingsServer::SetPushNotificationActivityModeOnSleep>, "SetPushNotificationActivityModeOnSleep"}, + FunctionInfo{122, nullptr, "GetServiceDiscoveryControlSettings"}, + FunctionInfo{123, nullptr, "SetServiceDiscoveryControlSettings"}, + FunctionInfo{124, C<&ISystemSettingsServer::GetErrorReportSharePermission>, "GetErrorReportSharePermission"}, + FunctionInfo{125, C<&ISystemSettingsServer::SetErrorReportSharePermission>, "SetErrorReportSharePermission"}, + FunctionInfo{126, C<&ISystemSettingsServer::GetAppletLaunchFlags>, "GetAppletLaunchFlags"}, + FunctionInfo{127, C<&ISystemSettingsServer::SetAppletLaunchFlags>, "SetAppletLaunchFlags"}, + FunctionInfo{128, nullptr, "GetConsoleSixAxisSensorAccelerationBias"}, + FunctionInfo{129, nullptr, "SetConsoleSixAxisSensorAccelerationBias"}, + FunctionInfo{130, nullptr, "GetConsoleSixAxisSensorAngularVelocityBias"}, + FunctionInfo{131, nullptr, "SetConsoleSixAxisSensorAngularVelocityBias"}, + FunctionInfo{132, nullptr, "GetConsoleSixAxisSensorAccelerationGain"}, + FunctionInfo{133, nullptr, "SetConsoleSixAxisSensorAccelerationGain"}, + FunctionInfo{134, nullptr, "GetConsoleSixAxisSensorAngularVelocityGain"}, + FunctionInfo{135, nullptr, "SetConsoleSixAxisSensorAngularVelocityGain"}, + FunctionInfo{136, C<&ISystemSettingsServer::GetKeyboardLayout>, "GetKeyboardLayout"}, + FunctionInfo{137, C<&ISystemSettingsServer::SetKeyboardLayout>, "SetKeyboardLayout"}, + FunctionInfo{138, nullptr, "GetWebInspectorFlag"}, + FunctionInfo{139, nullptr, "GetAllowedSslHosts"}, + FunctionInfo{140, nullptr, "GetHostFsMountPoint"}, + FunctionInfo{141, nullptr, "GetRequiresRunRepairTimeReviser"}, + FunctionInfo{142, nullptr, "SetRequiresRunRepairTimeReviser"}, + FunctionInfo{143, nullptr, "SetBlePairingSettings"}, + FunctionInfo{144, nullptr, "GetBlePairingSettings"}, + FunctionInfo{145, nullptr, "GetConsoleSixAxisSensorAngularVelocityTimeBias"}, + FunctionInfo{146, nullptr, "SetConsoleSixAxisSensorAngularVelocityTimeBias"}, + FunctionInfo{147, nullptr, "GetConsoleSixAxisSensorAngularAcceleration"}, + FunctionInfo{148, nullptr, "SetConsoleSixAxisSensorAngularAcceleration"}, + FunctionInfo{149, C<&ISystemSettingsServer::GetRebootlessSystemUpdateVersion>, "GetRebootlessSystemUpdateVersion"}, + FunctionInfo{150, C<&ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime>, "GetDeviceTimeZoneLocationUpdatedTime"}, + FunctionInfo{151, C<&ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime>, "SetDeviceTimeZoneLocationUpdatedTime"}, + FunctionInfo{152, C<&ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime>, "GetUserSystemClockAutomaticCorrectionUpdatedTime"}, + FunctionInfo{153, C<&ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime>, "SetUserSystemClockAutomaticCorrectionUpdatedTime"}, + FunctionInfo{154, nullptr, "GetAccountOnlineStorageSettings"}, + FunctionInfo{155, nullptr, "SetAccountOnlineStorageSettings"}, + FunctionInfo{156, nullptr, "GetPctlReadyFlag"}, + FunctionInfo{157, nullptr, "SetPctlReadyFlag"}, + FunctionInfo{158, nullptr, "GetAnalogStickUserCalibrationL"}, + FunctionInfo{159, nullptr, "SetAnalogStickUserCalibrationL"}, + FunctionInfo{160, nullptr, "GetAnalogStickUserCalibrationR"}, + FunctionInfo{161, nullptr, "SetAnalogStickUserCalibrationR"}, + FunctionInfo{162, nullptr, "GetPtmBatteryVersion"}, + FunctionInfo{163, nullptr, "SetPtmBatteryVersion"}, + FunctionInfo{164, nullptr, "GetUsb30HostEnableFlag"}, + FunctionInfo{165, nullptr, "SetUsb30HostEnableFlag"}, + FunctionInfo{166, nullptr, "GetUsb30DeviceEnableFlag"}, + FunctionInfo{167, nullptr, "SetUsb30DeviceEnableFlag"}, + FunctionInfo{168, nullptr, "GetThemeId"}, + FunctionInfo{169, nullptr, "SetThemeId"}, + FunctionInfo{170, C<&ISystemSettingsServer::GetChineseTraditionalInputMethod>, "GetChineseTraditionalInputMethod"}, + FunctionInfo{171, nullptr, "SetChineseTraditionalInputMethod"}, + FunctionInfo{172, nullptr, "GetPtmCycleCountReliability"}, + FunctionInfo{173, nullptr, "SetPtmCycleCountReliability"}, + FunctionInfo{174, C<&ISystemSettingsServer::GetHomeMenuScheme>, "GetHomeMenuScheme"}, + FunctionInfo{175, nullptr, "GetThemeSettings"}, + FunctionInfo{176, nullptr, "SetThemeSettings"}, + FunctionInfo{177, nullptr, "GetThemeKey"}, + FunctionInfo{178, nullptr, "SetThemeKey"}, + FunctionInfo{179, nullptr, "GetZoomFlag"}, + FunctionInfo{180, nullptr, "SetZoomFlag"}, + FunctionInfo{181, nullptr, "GetT"}, + FunctionInfo{182, nullptr, "SetT"}, + FunctionInfo{183, C<&ISystemSettingsServer::GetPlatformRegion>, "GetPlatformRegion"}, + FunctionInfo{184, C<&ISystemSettingsServer::SetPlatformRegion>, "SetPlatformRegion"}, + FunctionInfo{185, C<&ISystemSettingsServer::GetHomeMenuSchemeModel>, "GetHomeMenuSchemeModel"}, + FunctionInfo{186, nullptr, "GetMemoryUsageRateFlag"}, + FunctionInfo{187, C<&ISystemSettingsServer::GetTouchScreenMode>, "GetTouchScreenMode"}, + FunctionInfo{188, C<&ISystemSettingsServer::SetTouchScreenMode>, "SetTouchScreenMode"}, + FunctionInfo{189, nullptr, "GetButtonConfigSettingsFull"}, + FunctionInfo{190, nullptr, "SetButtonConfigSettingsFull"}, + FunctionInfo{191, nullptr, "GetButtonConfigSettingsEmbedded"}, + FunctionInfo{192, nullptr, "SetButtonConfigSettingsEmbedded"}, + FunctionInfo{193, nullptr, "GetButtonConfigSettingsLeft"}, + FunctionInfo{194, nullptr, "SetButtonConfigSettingsLeft"}, + FunctionInfo{195, nullptr, "GetButtonConfigSettingsRight"}, + FunctionInfo{196, nullptr, "SetButtonConfigSettingsRight"}, + FunctionInfo{197, nullptr, "GetButtonConfigRegisteredSettingsEmbedded"}, + FunctionInfo{198, nullptr, "SetButtonConfigRegisteredSettingsEmbedded"}, + FunctionInfo{199, nullptr, "GetButtonConfigRegisteredSettings"}, + FunctionInfo{200, nullptr, "SetButtonConfigRegisteredSettings"}, + FunctionInfo{201, C<&ISystemSettingsServer::GetFieldTestingFlag>, "GetFieldTestingFlag"}, + FunctionInfo{202, nullptr, "SetFieldTestingFlag"}, + FunctionInfo{203, C<&ISystemSettingsServer::GetPanelCrcMode>, "GetPanelCrcMode"}, + FunctionInfo{204, C<&ISystemSettingsServer::SetPanelCrcMode>, "SetPanelCrcMode"}, + FunctionInfo{205, nullptr, "GetNxControllerSettingsEx"}, + FunctionInfo{206, nullptr, "SetNxControllerSettingsEx"}, + FunctionInfo{207, nullptr, "GetHearingProtectionSafeguardFlag"}, + FunctionInfo{208, nullptr, "SetHearingProtectionSafeguardFlag"}, + FunctionInfo{209, nullptr, "GetHearingProtectionSafeguardRemainingTime"}, + FunctionInfo{210, nullptr, "SetHearingProtectionSafeguardRemainingTime"}, + FunctionInfo{221, nullptr, "GetForceMonauralOutputFlag", MakeVersionGate({17,0,0})}, + FunctionInfo{222, nullptr, "SetForceMonauralOutputFlag", MakeVersionGate({17,0,0})}, + FunctionInfo{251, nullptr, "GetAccountIdentificationSettings", MakeVersionGate({18,0,0})}, + FunctionInfo{252, nullptr, "SetAccountIdentificationSettings", MakeVersionGate({18,0,0})}, + FunctionInfo{263, nullptr, "AcquireVphymDirtyFlagEventHandle", MakeVersionGate({20,0,0})}, + FunctionInfo{264, nullptr, "GetVphymDirtyFlags", MakeVersionGate({20,0,0})}, + FunctionInfo{282, nullptr, "ConvertToProductModel", MakeVersionGate({20,0,0})}, + FunctionInfo{283, nullptr, "ConvertToProductModelName", MakeVersionGate({20,0,0})}, + FunctionInfo{289, nullptr, "GetDefaultAccountIdentificationFlagSet", MakeVersionGate({20,0,0})}, + FunctionInfo{300, nullptr, "AcquirePushNotificationDirtyFlagEventHandle", MakeVersionGate({20,0,0})}, + FunctionInfo{301, nullptr, "GetPushNotificationDirtyFlags", MakeVersionGate({20,0,0})}, + FunctionInfo{306, nullptr, "GetPinCodeReregistrationGuideAccounts", MakeVersionGate({20,0,0})}, + FunctionInfo{307, nullptr, "SetPinCodeReregistrationGuideAccounts", MakeVersionGate({20,0,0})}, + FunctionInfo{315, C<&ISystemSettingsServer::GetHttpAuthConfigs>, "GetHttpAuthConfigs", MakeVersionGate({21,0,0})}, + FunctionInfo{319, C<&ISystemSettingsServer::GetAccountUserSettings>, "GetAccountUserSettings", MakeVersionGate({21,0,0})}, + FunctionInfo{320, nullptr, "SetAccountUserSettings", MakeVersionGate({21,0,0})}, + FunctionInfo{321, C<&ISystemSettingsServer::GetDefaultAccountUserSettings>, "GetDefaultAccountUserSettings", MakeVersionGate({21,0,0})} + ); + return HandlerTableGenerateWithFind(key, functions); +} + ISystemSettingsServer::ISystemSettingsServer(Core::System& system_) - : ServiceFramework{system_, "set:sys"}, m_system{system} { - // clang-format off - static const FunctionInfo functions[] = { - {0, C<&ISystemSettingsServer::SetLanguageCode>, "SetLanguageCode"}, - {1, nullptr, "SetNetworkSettings"}, - {2, nullptr, "GetNetworkSettings"}, - {3, C<&ISystemSettingsServer::GetFirmwareVersion>, "GetFirmwareVersion"}, - {4, C<&ISystemSettingsServer::GetFirmwareVersion2>, "GetFirmwareVersion2"}, - {5, nullptr, "GetFirmwareVersionDigest"}, - {7, C<&ISystemSettingsServer::GetLockScreenFlag>, "GetLockScreenFlag"}, - {8, C<&ISystemSettingsServer::SetLockScreenFlag>, "SetLockScreenFlag"}, - {9, nullptr, "GetBacklightSettings"}, - {10, nullptr, "SetBacklightSettings"}, - {11, nullptr, "SetBluetoothDevicesSettings"}, - {12, nullptr, "GetBluetoothDevicesSettings"}, - {13, C<&ISystemSettingsServer::GetExternalSteadyClockSourceId>, "GetExternalSteadyClockSourceId"}, - {14, C<&ISystemSettingsServer::SetExternalSteadyClockSourceId>, "SetExternalSteadyClockSourceId"}, - {15, C<&ISystemSettingsServer::GetUserSystemClockContext>, "GetUserSystemClockContext"}, - {16, C<&ISystemSettingsServer::SetUserSystemClockContext>, "SetUserSystemClockContext"}, - {17, C<&ISystemSettingsServer::GetAccountSettings>, "GetAccountSettings"}, - {18, C<&ISystemSettingsServer::SetAccountSettings>, "SetAccountSettings"}, - {19, nullptr, "GetAudioVolume"}, - {20, nullptr, "SetAudioVolume"}, - {21, C<&ISystemSettingsServer::GetEulaVersions>, "GetEulaVersions"}, - {22, C<&ISystemSettingsServer::SetEulaVersions>, "SetEulaVersions"}, - {23, C<&ISystemSettingsServer::GetColorSetId>, "GetColorSetId"}, - {24, C<&ISystemSettingsServer::SetColorSetId>, "SetColorSetId"}, - {25, C<&ISystemSettingsServer::GetConsoleInformationUploadFlag>, "GetConsoleInformationUploadFlag"}, - {26, C<&ISystemSettingsServer::SetConsoleInformationUploadFlag>, "SetConsoleInformationUploadFlag"}, - {27, C<&ISystemSettingsServer::GetAutomaticApplicationDownloadFlag>, "GetAutomaticApplicationDownloadFlag"}, - {28, C<&ISystemSettingsServer::SetAutomaticApplicationDownloadFlag>, "SetAutomaticApplicationDownloadFlag"}, - {29, C<&ISystemSettingsServer::GetNotificationSettings>, "GetNotificationSettings"}, - {30, C<&ISystemSettingsServer::SetNotificationSettings>, "SetNotificationSettings"}, - {31, C<&ISystemSettingsServer::GetAccountNotificationSettings>, "GetAccountNotificationSettings"}, - {32, C<&ISystemSettingsServer::SetAccountNotificationSettings>, "SetAccountNotificationSettings"}, - {35, C<&ISystemSettingsServer::GetVibrationMasterVolume>, "GetVibrationMasterVolume"}, - {36, C<&ISystemSettingsServer::SetVibrationMasterVolume>, "SetVibrationMasterVolume"}, - {37, C<&ISystemSettingsServer::GetSettingsItemValueSize>, "GetSettingsItemValueSize"}, - {38, C<&ISystemSettingsServer::GetSettingsItemValue>, "GetSettingsItemValue"}, - {39, C<&ISystemSettingsServer::GetTvSettings>, "GetTvSettings"}, - {40, C<&ISystemSettingsServer::SetTvSettings>, "SetTvSettings"}, - {41, nullptr, "GetEdid"}, - {42, nullptr, "SetEdid"}, - {43, C<&ISystemSettingsServer::GetAudioOutputMode>, "GetAudioOutputMode"}, - {44, C<&ISystemSettingsServer::SetAudioOutputMode>, "SetAudioOutputMode"}, - {45, C<&ISystemSettingsServer::GetSpeakerAutoMuteFlag>, "GetSpeakerAutoMuteFlag"}, - {46, C<&ISystemSettingsServer::SetSpeakerAutoMuteFlag>, "SetSpeakerAutoMuteFlag"}, - {47, C<&ISystemSettingsServer::GetQuestFlag>, "GetQuestFlag"}, - {48, C<&ISystemSettingsServer::SetQuestFlag>, "SetQuestFlag"}, - {49, nullptr, "GetDataDeletionSettings"}, - {50, nullptr, "SetDataDeletionSettings"}, - {51, nullptr, "GetInitialSystemAppletProgramId"}, - {52, nullptr, "GetOverlayDispProgramId"}, - {53, C<&ISystemSettingsServer::GetDeviceTimeZoneLocationName>, "GetDeviceTimeZoneLocationName"}, - {54, C<&ISystemSettingsServer::SetDeviceTimeZoneLocationName>, "SetDeviceTimeZoneLocationName"}, - {55, nullptr, "GetWirelessCertificationFileSize"}, - {56, nullptr, "GetWirelessCertificationFile"}, - {57, C<&ISystemSettingsServer::SetRegionCode>, "SetRegionCode"}, - {58, C<&ISystemSettingsServer::GetNetworkSystemClockContext>, "GetNetworkSystemClockContext"}, - {59, C<&ISystemSettingsServer::SetNetworkSystemClockContext>, "SetNetworkSystemClockContext"}, - {60, C<&ISystemSettingsServer::IsUserSystemClockAutomaticCorrectionEnabled>, "IsUserSystemClockAutomaticCorrectionEnabled"}, - {61, C<&ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionEnabled>, "SetUserSystemClockAutomaticCorrectionEnabled"}, - {62, C<&ISystemSettingsServer::GetDebugModeFlag>, "GetDebugModeFlag"}, - {63, C<&ISystemSettingsServer::GetPrimaryAlbumStorage>, "GetPrimaryAlbumStorage"}, - {64, C<&ISystemSettingsServer::SetPrimaryAlbumStorage>, "SetPrimaryAlbumStorage"}, - {65, C<&ISystemSettingsServer::GetUsb30EnableFlag>, "GetUsb30EnableFlag"}, - {66, C<&ISystemSettingsServer::SetUsb30EnableFlag>, "SetUsb30EnableFlag"}, - {67, C<&ISystemSettingsServer::GetBatteryLot>, "GetBatteryLot"}, - {68, C<&ISystemSettingsServer::GetSerialNumber>, "GetSerialNumber"}, - {69, C<&ISystemSettingsServer::GetNfcEnableFlag>, "GetNfcEnableFlag"}, - {70, C<&ISystemSettingsServer::SetNfcEnableFlag>, "SetNfcEnableFlag"}, - {71, C<&ISystemSettingsServer::GetSleepSettings>, "GetSleepSettings"}, - {72, C<&ISystemSettingsServer::SetSleepSettings>, "SetSleepSettings"}, - {73, C<&ISystemSettingsServer::GetWirelessLanEnableFlag>, "GetWirelessLanEnableFlag"}, - {74, C<&ISystemSettingsServer::SetWirelessLanEnableFlag>, "SetWirelessLanEnableFlag"}, - {75, C<&ISystemSettingsServer::GetInitialLaunchSettings>, "GetInitialLaunchSettings"}, - {76, C<&ISystemSettingsServer::SetInitialLaunchSettings>, "SetInitialLaunchSettings"}, - {77, C<&ISystemSettingsServer::GetDeviceNickName>, "GetDeviceNickName"}, - {78, C<&ISystemSettingsServer::SetDeviceNickName>, "SetDeviceNickName"}, - {79, C<&ISystemSettingsServer::GetProductModel>, "GetProductModel"}, - {80, nullptr, "GetLdnChannel"}, - {81, nullptr, "SetLdnChannel"}, - {82, nullptr, "AcquireTelemetryDirtyFlagEventHandle"}, - {83, nullptr, "GetTelemetryDirtyFlags"}, - {84, nullptr, "GetPtmBatteryLot"}, - {85, nullptr, "SetPtmBatteryLot"}, - {86, nullptr, "GetPtmFuelGaugeParameter"}, - {87, nullptr, "SetPtmFuelGaugeParameter"}, - {88, C<&ISystemSettingsServer::GetBluetoothEnableFlag>, "GetBluetoothEnableFlag"}, - {89, C<&ISystemSettingsServer::SetBluetoothEnableFlag>, "SetBluetoothEnableFlag"}, - {90, C<&ISystemSettingsServer::GetMiiAuthorId>, "GetMiiAuthorId"}, - {91, nullptr, "SetShutdownRtcValue"}, - {92, nullptr, "GetShutdownRtcValue"}, - {93, nullptr, "AcquireFatalDirtyFlagEventHandle"}, - {94, nullptr, "GetFatalDirtyFlags"}, - {95, C<&ISystemSettingsServer::GetAutoUpdateEnableFlag>, "GetAutoUpdateEnableFlag"}, - {96, C<&ISystemSettingsServer::SetAutoUpdateEnableFlag>, "SetAutoUpdateEnableFlag"}, - {97, nullptr, "GetNxControllerSettings"}, - {98, nullptr, "SetNxControllerSettings"}, - {99, C<&ISystemSettingsServer::GetBatteryPercentageFlag>, "GetBatteryPercentageFlag"}, - {100, C<&ISystemSettingsServer::SetBatteryPercentageFlag>, "SetBatteryPercentageFlag"}, - {101, nullptr, "GetExternalRtcResetFlag"}, - {102, nullptr, "SetExternalRtcResetFlag"}, - {103, nullptr, "GetUsbFullKeyEnableFlag"}, - {104, nullptr, "SetUsbFullKeyEnableFlag"}, - {105, C<&ISystemSettingsServer::SetExternalSteadyClockInternalOffset>, "SetExternalSteadyClockInternalOffset"}, - {106, C<&ISystemSettingsServer::GetExternalSteadyClockInternalOffset>, "GetExternalSteadyClockInternalOffset"}, - {107, nullptr, "GetBacklightSettingsEx"}, - {108, nullptr, "SetBacklightSettingsEx"}, - {109, nullptr, "GetHeadphoneVolumeWarningCount"}, - {110, nullptr, "SetHeadphoneVolumeWarningCount"}, - {111, nullptr, "GetBluetoothAfhEnableFlag"}, - {112, nullptr, "SetBluetoothAfhEnableFlag"}, - {113, nullptr, "GetBluetoothBoostEnableFlag"}, - {114, nullptr, "SetBluetoothBoostEnableFlag"}, - {115, nullptr, "GetInRepairProcessEnableFlag"}, - {116, nullptr, "SetInRepairProcessEnableFlag"}, - {117, nullptr, "GetHeadphoneVolumeUpdateFlag"}, - {118, nullptr, "SetHeadphoneVolumeUpdateFlag"}, - {119, nullptr, "NeedsToUpdateHeadphoneVolume"}, - {120, C<&ISystemSettingsServer::GetPushNotificationActivityModeOnSleep>, "GetPushNotificationActivityModeOnSleep"}, - {121, C<&ISystemSettingsServer::SetPushNotificationActivityModeOnSleep>, "SetPushNotificationActivityModeOnSleep"}, - {122, nullptr, "GetServiceDiscoveryControlSettings"}, - {123, nullptr, "SetServiceDiscoveryControlSettings"}, - {124, C<&ISystemSettingsServer::GetErrorReportSharePermission>, "GetErrorReportSharePermission"}, - {125, C<&ISystemSettingsServer::SetErrorReportSharePermission>, "SetErrorReportSharePermission"}, - {126, C<&ISystemSettingsServer::GetAppletLaunchFlags>, "GetAppletLaunchFlags"}, - {127, C<&ISystemSettingsServer::SetAppletLaunchFlags>, "SetAppletLaunchFlags"}, - {128, nullptr, "GetConsoleSixAxisSensorAccelerationBias"}, - {129, nullptr, "SetConsoleSixAxisSensorAccelerationBias"}, - {130, nullptr, "GetConsoleSixAxisSensorAngularVelocityBias"}, - {131, nullptr, "SetConsoleSixAxisSensorAngularVelocityBias"}, - {132, nullptr, "GetConsoleSixAxisSensorAccelerationGain"}, - {133, nullptr, "SetConsoleSixAxisSensorAccelerationGain"}, - {134, nullptr, "GetConsoleSixAxisSensorAngularVelocityGain"}, - {135, nullptr, "SetConsoleSixAxisSensorAngularVelocityGain"}, - {136, C<&ISystemSettingsServer::GetKeyboardLayout>, "GetKeyboardLayout"}, - {137, C<&ISystemSettingsServer::SetKeyboardLayout>, "SetKeyboardLayout"}, - {138, nullptr, "GetWebInspectorFlag"}, - {139, nullptr, "GetAllowedSslHosts"}, - {140, nullptr, "GetHostFsMountPoint"}, - {141, nullptr, "GetRequiresRunRepairTimeReviser"}, - {142, nullptr, "SetRequiresRunRepairTimeReviser"}, - {143, nullptr, "SetBlePairingSettings"}, - {144, nullptr, "GetBlePairingSettings"}, - {145, nullptr, "GetConsoleSixAxisSensorAngularVelocityTimeBias"}, - {146, nullptr, "SetConsoleSixAxisSensorAngularVelocityTimeBias"}, - {147, nullptr, "GetConsoleSixAxisSensorAngularAcceleration"}, - {148, nullptr, "SetConsoleSixAxisSensorAngularAcceleration"}, - {149, C<&ISystemSettingsServer::GetRebootlessSystemUpdateVersion>, "GetRebootlessSystemUpdateVersion"}, - {150, C<&ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime>, "GetDeviceTimeZoneLocationUpdatedTime"}, - {151, C<&ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime>, "SetDeviceTimeZoneLocationUpdatedTime"}, - {152, C<&ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime>, "GetUserSystemClockAutomaticCorrectionUpdatedTime"}, - {153, C<&ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime>, "SetUserSystemClockAutomaticCorrectionUpdatedTime"}, - {154, nullptr, "GetAccountOnlineStorageSettings"}, - {155, nullptr, "SetAccountOnlineStorageSettings"}, - {156, nullptr, "GetPctlReadyFlag"}, - {157, nullptr, "SetPctlReadyFlag"}, - {158, nullptr, "GetAnalogStickUserCalibrationL"}, - {159, nullptr, "SetAnalogStickUserCalibrationL"}, - {160, nullptr, "GetAnalogStickUserCalibrationR"}, - {161, nullptr, "SetAnalogStickUserCalibrationR"}, - {162, nullptr, "GetPtmBatteryVersion"}, - {163, nullptr, "SetPtmBatteryVersion"}, - {164, nullptr, "GetUsb30HostEnableFlag"}, - {165, nullptr, "SetUsb30HostEnableFlag"}, - {166, nullptr, "GetUsb30DeviceEnableFlag"}, - {167, nullptr, "SetUsb30DeviceEnableFlag"}, - {168, nullptr, "GetThemeId"}, - {169, nullptr, "SetThemeId"}, - {170, C<&ISystemSettingsServer::GetChineseTraditionalInputMethod>, "GetChineseTraditionalInputMethod"}, - {171, nullptr, "SetChineseTraditionalInputMethod"}, - {172, nullptr, "GetPtmCycleCountReliability"}, - {173, nullptr, "SetPtmCycleCountReliability"}, - {174, C<&ISystemSettingsServer::GetHomeMenuScheme>, "GetHomeMenuScheme"}, - {175, nullptr, "GetThemeSettings"}, - {176, nullptr, "SetThemeSettings"}, - {177, nullptr, "GetThemeKey"}, - {178, nullptr, "SetThemeKey"}, - {179, nullptr, "GetZoomFlag"}, - {180, nullptr, "SetZoomFlag"}, - {181, nullptr, "GetT"}, - {182, nullptr, "SetT"}, - {183, C<&ISystemSettingsServer::GetPlatformRegion>, "GetPlatformRegion"}, - {184, C<&ISystemSettingsServer::SetPlatformRegion>, "SetPlatformRegion"}, - {185, C<&ISystemSettingsServer::GetHomeMenuSchemeModel>, "GetHomeMenuSchemeModel"}, - {186, nullptr, "GetMemoryUsageRateFlag"}, - {187, C<&ISystemSettingsServer::GetTouchScreenMode>, "GetTouchScreenMode"}, - {188, C<&ISystemSettingsServer::SetTouchScreenMode>, "SetTouchScreenMode"}, - {189, nullptr, "GetButtonConfigSettingsFull"}, - {190, nullptr, "SetButtonConfigSettingsFull"}, - {191, nullptr, "GetButtonConfigSettingsEmbedded"}, - {192, nullptr, "SetButtonConfigSettingsEmbedded"}, - {193, nullptr, "GetButtonConfigSettingsLeft"}, - {194, nullptr, "SetButtonConfigSettingsLeft"}, - {195, nullptr, "GetButtonConfigSettingsRight"}, - {196, nullptr, "SetButtonConfigSettingsRight"}, - {197, nullptr, "GetButtonConfigRegisteredSettingsEmbedded"}, - {198, nullptr, "SetButtonConfigRegisteredSettingsEmbedded"}, - {199, nullptr, "GetButtonConfigRegisteredSettings"}, - {200, nullptr, "SetButtonConfigRegisteredSettings"}, - {201, C<&ISystemSettingsServer::GetFieldTestingFlag>, "GetFieldTestingFlag"}, - {202, nullptr, "SetFieldTestingFlag"}, - {203, C<&ISystemSettingsServer::GetPanelCrcMode>, "GetPanelCrcMode"}, - {204, C<&ISystemSettingsServer::SetPanelCrcMode>, "SetPanelCrcMode"}, - {205, nullptr, "GetNxControllerSettingsEx"}, - {206, nullptr, "SetNxControllerSettingsEx"}, - {207, nullptr, "GetHearingProtectionSafeguardFlag"}, - {208, nullptr, "SetHearingProtectionSafeguardFlag"}, - {209, nullptr, "GetHearingProtectionSafeguardRemainingTime"}, - {210, nullptr, "SetHearingProtectionSafeguardRemainingTime"}, - {221, nullptr, "GetForceMonauralOutputFlag"}, //17.0.0+ - {222, nullptr, "SetForceMonauralOutputFlag"}, //17.0.0+ - {251, nullptr, "GetAccountIdentificationSettings"}, //18.0.0+ - {252, nullptr, "SetAccountIdentificationSettings"}, //18.0.0+ - {263, nullptr, "AcquireVphymDirtyFlagEventHandle"}, //20.0.0+ - {264, nullptr, "GetVphymDirtyFlags"}, //20.0.0+ - {282, nullptr, "ConvertToProductModel"}, //20.0.0+ - {283, nullptr, "ConvertToProductModelName"}, //20.0.0+ - {289, nullptr, "GetDefaultAccountIdentificationFlagSet"}, //20.0.0+ - {300, nullptr, "AcquirePushNotificationDirtyFlagEventHandle"}, //20.0.0+ - {301, nullptr, "GetPushNotificationDirtyFlags"}, //20.0.0+ - {306, nullptr, "GetPinCodeReregistrationGuideAccounts"}, //20.0.0+ - {307, nullptr, "SetPinCodeReregistrationGuideAccounts"}, //20.0.0+ - {315, C<&ISystemSettingsServer::GetHttpAuthConfigs>, "GetHttpAuthConfigs"}, //21.0.0+ - {319, C<&ISystemSettingsServer::GetAccountUserSettings>, "GetAccountUserSettings"}, //21.0.0+ - {320, nullptr, "SetAccountUserSettings"}, //21.0.0+ - {321, C<&ISystemSettingsServer::GetDefaultAccountUserSettings>, "GetDefaultAccountUserSettings"}, //21.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); - + : ServiceFramework{system_, "set:sys"} { SetupSettings(); m_system_settings.region_code = diff --git a/src/core/hle/service/set/system_settings_server.h b/src/core/hle/service/set/system_settings_server.h index 1d56e61f88..471ed61176 100644 --- a/src/core/hle/service/set/system_settings_server.h +++ b/src/core/hle/service/set/system_settings_server.h @@ -179,7 +179,7 @@ private: void StoreSettings(); void SetSaveNeeded(); - Core::System& m_system; + std::optional FindRequest(u32 key) override; SystemSettings m_system_settings{}; PrivateSettings m_private_settings{}; DeviceSettings m_device_settings{}; diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index c75c5437df..5c196b3218 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -18,7 +18,16 @@ #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/sm/sm.h" -#include "core/hle/service/sm/sm_controller.h" +#include "common/assert.h" +#include "common/logging.h" +#include "core/core.h" +#include "core/hle/kernel/k_client_port.h" +#include "core/hle/kernel/k_port.h" +#include "core/hle/kernel/k_scoped_resource_reservation.h" +#include "core/hle/kernel/k_server_session.h" +#include "core/hle/kernel/k_session.h" +#include "core/hle/service/ipc_helpers.h" +#include "core/hle/service/server_manager.h" namespace Service::SM { @@ -27,6 +36,116 @@ constexpr Result ResultAlreadyRegistered(ErrorModule::SM, 4); constexpr Result ResultInvalidServiceName(ErrorModule::SM, 6); constexpr Result ResultNotRegistered(ErrorModule::SM, 7); +class Controller final : public ServiceFramework { +public: + // https://switchbrew.org/wiki/IPC_Marshalling + explicit Controller(Core::System& system_) : ServiceFramework{system_, "IpcController"} {} + ~Controller() override = default; + + void ConvertCurrentObjectToDomain(HLERequestContext& ctx) { + ASSERT_MSG(!ctx.GetManager()->IsDomain(), "Session is already a domain"); + LOG_DEBUG(Service, "called, server_session={}", ctx.Session()->GetId()); + ctx.GetManager()->ConvertToDomainOnRequestEnd(); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(1); // Converted sessions start with 1 request handler + } + + void CloneCurrentObject(HLERequestContext& ctx) { + LOG_DEBUG(Service, "called"); + + auto session_manager = ctx.GetManager(); + + // FIXME: this is duplicated from the SVC, it should just call it instead + // once this is a proper process + + // Reserve a new session from the process resource limit. + Kernel::KScopedResourceReservation session_reservation(system.Kernel(), Kernel::GetCurrentProcessPointer(kernel), Kernel::LimitableResource::SessionCountMax); + ASSERT(session_reservation.Succeeded()); + + // Create the session. + Kernel::KSession* session = Kernel::KSession::Create(kernel); + ASSERT(session != nullptr); + + // Initialize the session. + session->Initialize(kernel, nullptr, 0); + + // Commit the session reservation. + session_reservation.Commit(); + + // Register the session. + Kernel::KSession::Register(kernel, session); + + // Register with server manager. + session_manager->GetServerManager().RegisterSession(&session->GetServerSession(), + session_manager); + + // We succeeded. + IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; + rb.Push(ResultSuccess); + rb.PushMoveObjects(ctx, session->GetClientSession()); + } + + void CloneCurrentObjectEx(HLERequestContext& ctx) { + LOG_DEBUG(Service, "called"); + + CloneCurrentObject(ctx); + } + + void QueryPointerBufferSize(HLERequestContext& ctx) { + LOG_DEBUG(Service, "called"); + + auto* process = Kernel::GetCurrentProcessPointer(kernel); + ASSERT(process != nullptr); + + u32 buffer_size = process->GetPointerBufferSize(); + if (buffer_size > (std::numeric_limits::max)()) { + LOG_WARNING(Service, "Pointer buffer size exceeds u16 max, clamping"); + buffer_size = (std::numeric_limits::max)(); + } + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(static_cast(buffer_size)); + } + + void SetPointerBufferSize(HLERequestContext& ctx) { + LOG_DEBUG(Service, "called"); + + auto* process = Kernel::GetCurrentProcessPointer(kernel); + ASSERT(process != nullptr); + + IPC::RequestParser rp{ctx}; + + u32 requested_size = rp.PopRaw(); + + if (requested_size > (std::numeric_limits::max)()) { + LOG_WARNING(Service, "Requested pointer buffer size too large, clamping to 0xFFFF"); + requested_size = (std::numeric_limits::max)(); + } + + process->SetPointerBufferSize(requested_size); + + LOG_INFO(Service, "Pointer buffer size dynamically updated to {:#x} bytes by process", requested_size); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &Controller::ConvertCurrentObjectToDomain, "ConvertCurrentObjectToDomain"}, + FunctionInfo{1, nullptr, "CopyFromCurrentDomain"}, + FunctionInfo{2, &Controller::CloneCurrentObject, "CloneCurrentObject"}, + FunctionInfo{3, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"}, + FunctionInfo{4, &Controller::CloneCurrentObjectEx, "CloneCurrentObjectEx"}, + FunctionInfo{5, &Controller::SetPointerBufferSize, "SetPointerBufferSize"} //TODO: where does this come from + ); +}; + ServiceManager::ServiceManager(Kernel::KernelCore& kernel_) : kernel{kernel_} { controller_interface = std::make_unique(kernel.System()); } @@ -112,6 +231,51 @@ Result ServiceManager::GetServicePort(Kernel::KClientPort** out_client_port, return ResultSuccess; } +/// Interface to "sm:" service +class SM final : public ServiceFramework { +public: + explicit SM(ServiceManager& service_manager_, Core::System& system_); + ~SM() override; + +private: + void Initialize(HLERequestContext& ctx); + void GetServiceCmif(HLERequestContext& ctx); + void GetServiceTipc(HLERequestContext& ctx); + void RegisterServiceCmif(HLERequestContext& ctx); + void RegisterServiceTipc(HLERequestContext& ctx); + void UnregisterService(HLERequestContext& ctx); + void AtmosphereHasService(HLERequestContext& ctx); + + Result GetServiceImpl(Kernel::KClientSession** out_client_session, HLERequestContext& ctx); + void RegisterServiceImpl(HLERequestContext& ctx, std::string name, u32 max_session_count, bool is_light); + + // TODO: We reuse function list for both TIPC and non-TIPC + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + std::optional FindRequestTipc(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &SM::Initialize, "Initialize"}, + FunctionInfo{1, &SM::GetServiceTipc, "GetService"}, + FunctionInfo{2, &SM::RegisterServiceTipc, "RegisterService"}, + FunctionInfo{3, &SM::UnregisterService, "UnregisterService"}, + FunctionInfo{4, nullptr, "DetachClient"}, + FunctionInfo{65000, nullptr, "AtmosphereInstallMitm"}, + FunctionInfo{65001, nullptr, "AtmosphereUninstallMitm"}, + FunctionInfo{65002, nullptr, "Deprecated_AtmosphereAssociatePidTidForMitm"}, + FunctionInfo{65003, nullptr, "AtmosphereAcknowledgeMitmSession"}, + FunctionInfo{65004, nullptr, "AtmosphereHasMitm"}, + FunctionInfo{65005, nullptr, "AtmosphereWaitMitm"}, + FunctionInfo{65006, nullptr, "AtmosphereDeclareFutureMitm"}, + FunctionInfo{65100, &SM::AtmosphereHasService, "AtmosphereHasService"}, + FunctionInfo{65101, nullptr, "AtmosphereWaitService"} + ); + + ServiceManager& service_manager; +}; + /** * SM::Initialize service function * Inputs: @@ -194,7 +358,7 @@ Result SM::GetServiceImpl(Kernel::KClientSession** out_client_session, HLEReques // Create a new session. Kernel::KClientSession* session{}; - if (const auto result = client_port->CreateSession(kernel, &session); result.IsError()) { + if (const auto result = client_port->CreateSession(system.Kernel(), &session); result.IsError()) { LOG_ERROR(Service_SM, "called service={} -> error {:#08x}", name, result.raw); return result; } @@ -265,42 +429,7 @@ void SM::AtmosphereHasService(HLERequestContext& ctx) { SM::SM(ServiceManager& service_manager_, Core::System& system_) : ServiceFramework{system_, "sm:", 64} , service_manager{service_manager_} - , kernel{system_.Kernel()} -{ - RegisterHandlers({ - {0, &SM::Initialize, "Initialize"}, - {1, &SM::GetServiceCmif, "GetService"}, - {2, &SM::RegisterServiceCmif, "RegisterService"}, - {3, &SM::UnregisterService, "UnregisterService"}, - {4, nullptr, "DetachClient"}, - // TODO: are these non-TIPC as well? - {65000, nullptr, "AtmosphereInstallMitm"}, - {65001, nullptr, "AtmosphereUninstallMitm"}, - {65002, nullptr, "Deprecated_AtmosphereAssociatePidTidForMitm"}, - {65003, nullptr, "AtmosphereAcknowledgeMitmSession"}, - {65004, nullptr, "AtmosphereHasMitm"}, - {65005, nullptr, "AtmosphereWaitMitm"}, - {65006, nullptr, "AtmosphereDeclareFutureMitm"}, - {65100, &SM::AtmosphereHasService, "AtmosphereHasService"}, - {65101, nullptr, "AtmosphereWaitService"}, - }); - RegisterHandlersTipc({ - {0, &SM::Initialize, "Initialize"}, - {1, &SM::GetServiceTipc, "GetService"}, - {2, &SM::RegisterServiceTipc, "RegisterService"}, - {3, &SM::UnregisterService, "UnregisterService"}, - {4, nullptr, "DetachClient"}, - {65000, nullptr, "AtmosphereInstallMitm"}, - {65001, nullptr, "AtmosphereUninstallMitm"}, - {65002, nullptr, "Deprecated_AtmosphereAssociatePidTidForMitm"}, - {65003, nullptr, "AtmosphereAcknowledgeMitmSession"}, - {65004, nullptr, "AtmosphereHasMitm"}, - {65005, nullptr, "AtmosphereWaitMitm"}, - {65006, nullptr, "AtmosphereDeclareFutureMitm"}, - {65100, &SM::AtmosphereHasService, "AtmosphereHasService"}, - {65101, nullptr, "AtmosphereWaitService"}, - }); -} +{} SM::~SM() = default; diff --git a/src/core/hle/service/sm/sm.h b/src/core/hle/service/sm/sm.h index c520a46fb2..f17fc60080 100644 --- a/src/core/hle/service/sm/sm.h +++ b/src/core/hle/service/sm/sm.h @@ -33,29 +33,7 @@ class SessionRequestHandler; namespace Service::SM { class Controller; - -/// Interface to "sm:" service -class SM final : public ServiceFramework { -public: - explicit SM(ServiceManager& service_manager_, Core::System& system_); - ~SM() override; - -private: - void Initialize(HLERequestContext& ctx); - void GetServiceCmif(HLERequestContext& ctx); - void GetServiceTipc(HLERequestContext& ctx); - void RegisterServiceCmif(HLERequestContext& ctx); - void RegisterServiceTipc(HLERequestContext& ctx); - void UnregisterService(HLERequestContext& ctx); - void AtmosphereHasService(HLERequestContext& ctx); - - Result GetServiceImpl(Kernel::KClientSession** out_client_session, HLERequestContext& ctx); - void RegisterServiceImpl(HLERequestContext& ctx, std::string name, u32 max_session_count, - bool is_light); - - ServiceManager& service_manager; - Kernel::KernelCore& kernel; -}; +class SM; class ServiceManager { public: diff --git a/src/core/hle/service/sm/sm_controller.cpp b/src/core/hle/service/sm/sm_controller.cpp deleted file mode 100644 index 125eb4a247..0000000000 --- a/src/core/hle/service/sm/sm_controller.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/assert.h" -#include "common/logging.h" -#include "core/core.h" -#include "core/hle/kernel/k_client_port.h" -#include "core/hle/kernel/k_port.h" -#include "core/hle/kernel/k_scoped_resource_reservation.h" -#include "core/hle/kernel/k_server_session.h" -#include "core/hle/kernel/k_session.h" -#include "core/hle/service/ipc_helpers.h" -#include "core/hle/service/server_manager.h" -#include "core/hle/service/sm/sm_controller.h" - -namespace Service::SM { - -void Controller::ConvertCurrentObjectToDomain(HLERequestContext& ctx) { - ASSERT_MSG(!ctx.GetManager()->IsDomain(), "Session is already a domain"); - LOG_DEBUG(Service, "called, server_session={}", ctx.Session()->GetId()); - ctx.GetManager()->ConvertToDomainOnRequestEnd(); - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(1); // Converted sessions start with 1 request handler -} - -void Controller::CloneCurrentObject(HLERequestContext& ctx) { - LOG_DEBUG(Service, "called"); - - auto session_manager = ctx.GetManager(); - - // FIXME: this is duplicated from the SVC, it should just call it instead - // once this is a proper process - - // Reserve a new session from the process resource limit. - Kernel::KScopedResourceReservation session_reservation(system.Kernel(), Kernel::GetCurrentProcessPointer(kernel), Kernel::LimitableResource::SessionCountMax); - ASSERT(session_reservation.Succeeded()); - - // Create the session. - Kernel::KSession* session = Kernel::KSession::Create(kernel); - ASSERT(session != nullptr); - - // Initialize the session. - session->Initialize(kernel, nullptr, 0); - - // Commit the session reservation. - session_reservation.Commit(); - - // Register the session. - Kernel::KSession::Register(kernel, session); - - // Register with server manager. - session_manager->GetServerManager().RegisterSession(&session->GetServerSession(), - session_manager); - - // We succeeded. - IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; - rb.Push(ResultSuccess); - rb.PushMoveObjects(ctx, session->GetClientSession()); -} - -void Controller::CloneCurrentObjectEx(HLERequestContext& ctx) { - LOG_DEBUG(Service, "called"); - - CloneCurrentObject(ctx); -} - -void Controller::QueryPointerBufferSize(HLERequestContext& ctx) { - LOG_DEBUG(Service, "called"); - - auto* process = Kernel::GetCurrentProcessPointer(kernel); - ASSERT(process != nullptr); - - u32 buffer_size = process->GetPointerBufferSize(); - if (buffer_size > (std::numeric_limits::max)()) { - LOG_WARNING(Service, "Pointer buffer size exceeds u16 max, clamping"); - buffer_size = (std::numeric_limits::max)(); - } - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(static_cast(buffer_size)); -} - -void Controller::SetPointerBufferSize(HLERequestContext& ctx) { - LOG_DEBUG(Service, "called"); - - auto* process = Kernel::GetCurrentProcessPointer(kernel); - ASSERT(process != nullptr); - - IPC::RequestParser rp{ctx}; - - u32 requested_size = rp.PopRaw(); - - if (requested_size > (std::numeric_limits::max)()) { - LOG_WARNING(Service, "Requested pointer buffer size too large, clamping to 0xFFFF"); - requested_size = (std::numeric_limits::max)(); - } - - process->SetPointerBufferSize(requested_size); - - LOG_INFO(Service, "Pointer buffer size dynamically updated to {:#x} bytes by process", requested_size); - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); -} - - -// https://switchbrew.org/wiki/IPC_Marshalling -Controller::Controller(Core::System& system_) : ServiceFramework{system_, "IpcController"} { - static const FunctionInfo functions[] = { - {0, &Controller::ConvertCurrentObjectToDomain, "ConvertCurrentObjectToDomain"}, - {1, nullptr, "CopyFromCurrentDomain"}, - {2, &Controller::CloneCurrentObject, "CloneCurrentObject"}, - {3, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"}, - {4, &Controller::CloneCurrentObjectEx, "CloneCurrentObjectEx"}, - {5, &Controller::SetPointerBufferSize, "SetPointerBufferSize"}, //TODO: where does this come from - }; - RegisterHandlers(functions); -} - -Controller::~Controller() = default; - -} // namespace Service::SM diff --git a/src/core/hle/service/sm/sm_controller.h b/src/core/hle/service/sm/sm_controller.h deleted file mode 100644 index f7e529a269..0000000000 --- a/src/core/hle/service/sm/sm_controller.h +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::SM { - -class Controller final : public ServiceFramework { -public: - explicit Controller(Core::System& system_); - ~Controller() override; - -private: - void ConvertCurrentObjectToDomain(HLERequestContext& ctx); - void CloneCurrentObject(HLERequestContext& ctx); - void CloneCurrentObjectEx(HLERequestContext& ctx); - void QueryPointerBufferSize(HLERequestContext& ctx); - void SetPointerBufferSize(HLERequestContext& ctx); -}; - -} // namespace Service::SM diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 0137a3be66..63bd7051ca 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -1083,59 +1083,6 @@ void BSD_USA::OnProxyPacketReceived(const Network::ProxyPacket& packet) { BSD_USA::BSD_USA(Core::System& system_, const char* name, bool is_user_) : ServiceFramework{system_, name} , is_user{is_user_} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &BSD_USA::RegisterClient, "RegisterClient"}, - {1, &BSD_USA::StartMonitoring, "StartMonitoring"}, - {2, &BSD_USA::Socket, "Socket"}, - {3, &BSD_USA::SocketExempt, "SocketExempt"}, - {4, nullptr, "Open"}, - {5, &BSD_USA::Select, "Select"}, - {6, &BSD_USA::Poll, "Poll"}, - {7, nullptr, "Sysctl"}, - {8, &BSD_USA::Recv, "Recv"}, - {9, &BSD_USA::RecvFrom, "RecvFrom"}, - {10, &BSD_USA::Send, "Send"}, - {11, &BSD_USA::SendTo, "SendTo"}, - {12, &BSD_USA::Accept, "Accept"}, - {13, &BSD_USA::Bind, "Bind"}, - {14, &BSD_USA::Connect, "Connect"}, - {15, &BSD_USA::GetPeerName, "GetPeerName"}, - {16, &BSD_USA::GetSockName, "GetSockName"}, - {17, &BSD_USA::GetSockOpt, "GetSockOpt"}, - {18, &BSD_USA::Listen, "Listen"}, - {19, nullptr, "Ioctl"}, - {20, &BSD_USA::Fcntl, "Fcntl"}, - {21, &BSD_USA::SetSockOpt, "SetSockOpt"}, - {22, &BSD_USA::Shutdown, "Shutdown"}, - {23, nullptr, "ShutdownAllSockets"}, - {24, &BSD_USA::Write, "Write"}, - {25, &BSD_USA::Read, "Read"}, - {26, &BSD_USA::Close, "Close"}, - {27, &BSD_USA::DuplicateSocket, "DuplicateSocket"}, - {28, nullptr, "GetResourceStatistics"}, - {29, nullptr, "RecvMMsg"}, //3.0.0+ - {30, nullptr, "SendMMsg"}, //3.0.0+ - {31, &BSD_USA::EventFd, "EventFd"}, //7.0.0+ - {32, nullptr, "RegisterResourceStatisticsName"}, //7.0.0+ - {33, nullptr, "RegisterClientShared"}, //10.0.0+ - {34, nullptr, "GetSocketStatistics"}, //15.0.0+ - {35, nullptr, "NifIoctl"}, //17.0.0+ - {36, nullptr, "Unknown36"}, //18.0.0+ - {37, nullptr, "Unknown37"}, //18.0.0+ - {38, nullptr, "Unknown38"}, //18.0.0+ - {39, nullptr, "Unknown39"}, //20.0.0+ - {40, nullptr, "Unknown40"}, //20.0.0+ - {41, nullptr, "Unknown41"}, //21.0.0+ - {42, nullptr, "Unknown42"}, //21.0.0+ - {43, nullptr, "Unknown43"}, //21.0.0+ - {200, nullptr, "SetThreadCoreMask"}, //15.0.0+ - {201, nullptr, "GetThreadCoreMask"}, //15.0.0+ - }; - // clang-format on - - RegisterHandlers(functions); - if (auto room_member = Network::GetRoomMember().lock()) { proxy_packet_received = room_member->BindOnProxyPacketReceived( [this](const Network::ProxyPacket& packet) { OnProxyPacketReceived(packet); }); @@ -1156,40 +1103,12 @@ std::unique_lock BSD_USA::LockService() noexcept { BSDCFG::BSDCFG(Core::System& system_, const char *name) : ServiceFramework{system_, name} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "SetIfUp"}, - {1, nullptr, "SetIfUpWithEvent"}, - {2, nullptr, "CancelIf"}, - {3, nullptr, "SetIfDown"}, - {4, nullptr, "GetIfState"}, - {5, nullptr, "DhcpRenew"}, - {6, nullptr, "AddStaticArpEntry"}, - {7, nullptr, "RemoveArpEntry"}, - {8, nullptr, "LookupArpEntry"}, - {9, nullptr, "LookupArpEntry2"}, - {10, nullptr, "ClearArpEntries"}, - {11, nullptr, "ClearArpEntries2"}, - {12, nullptr, "PrintArpEntries"}, - {13, nullptr, "Unknown13"}, - {14, nullptr, "Unknown14"}, - {15, nullptr, "Unknown15"}, - }; - // clang-format on - - RegisterHandlers(functions); } BSDCFG::~BSDCFG() = default; BSD_NU::BSD_NU(Core::System& system_) : ServiceFramework{system_, "bsd:nu"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateUserService"}, - }; - // clang-format on - RegisterHandlers(functions); } BSD_NU::~BSD_NU() = default; diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h index b542e196f0..c2aa343d51 100644 --- a/src/core/hle/service/sockets/bsd.h +++ b/src/core/hle/service/sockets/bsd.h @@ -189,6 +189,58 @@ private: protected: std::unique_lock LockService() noexcept override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &BSD_USA::RegisterClient, "RegisterClient"}, + FunctionInfo{1, &BSD_USA::StartMonitoring, "StartMonitoring"}, + FunctionInfo{2, &BSD_USA::Socket, "Socket"}, + FunctionInfo{3, &BSD_USA::SocketExempt, "SocketExempt"}, + FunctionInfo{4, nullptr, "Open"}, + FunctionInfo{5, &BSD_USA::Select, "Select"}, + FunctionInfo{6, &BSD_USA::Poll, "Poll"}, + FunctionInfo{7, nullptr, "Sysctl"}, + FunctionInfo{8, &BSD_USA::Recv, "Recv"}, + FunctionInfo{9, &BSD_USA::RecvFrom, "RecvFrom"}, + FunctionInfo{10, &BSD_USA::Send, "Send"}, + FunctionInfo{11, &BSD_USA::SendTo, "SendTo"}, + FunctionInfo{12, &BSD_USA::Accept, "Accept"}, + FunctionInfo{13, &BSD_USA::Bind, "Bind"}, + FunctionInfo{14, &BSD_USA::Connect, "Connect"}, + FunctionInfo{15, &BSD_USA::GetPeerName, "GetPeerName"}, + FunctionInfo{16, &BSD_USA::GetSockName, "GetSockName"}, + FunctionInfo{17, &BSD_USA::GetSockOpt, "GetSockOpt"}, + FunctionInfo{18, &BSD_USA::Listen, "Listen"}, + FunctionInfo{19, nullptr, "Ioctl"}, + FunctionInfo{20, &BSD_USA::Fcntl, "Fcntl"}, + FunctionInfo{21, &BSD_USA::SetSockOpt, "SetSockOpt"}, + FunctionInfo{22, &BSD_USA::Shutdown, "Shutdown"}, + FunctionInfo{23, nullptr, "ShutdownAllSockets"}, + FunctionInfo{24, &BSD_USA::Write, "Write"}, + FunctionInfo{25, &BSD_USA::Read, "Read"}, + FunctionInfo{26, &BSD_USA::Close, "Close"}, + FunctionInfo{27, &BSD_USA::DuplicateSocket, "DuplicateSocket"}, + FunctionInfo{28, nullptr, "GetResourceStatistics"}, + FunctionInfo{29, nullptr, "RecvMMsg", MakeVersionGate({3,0,0})}, + FunctionInfo{30, nullptr, "SendMMsg", MakeVersionGate({3,0,0})}, + FunctionInfo{31, &BSD_USA::EventFd, "EventFd", MakeVersionGate({7,0,0})}, + FunctionInfo{32, nullptr, "RegisterResourceStatisticsName", MakeVersionGate({7,0,0})}, + FunctionInfo{33, nullptr, "RegisterClientShared", MakeVersionGate({10,0,0})}, + FunctionInfo{34, nullptr, "GetSocketStatistics", MakeVersionGate({15,0,0})}, + FunctionInfo{35, nullptr, "NifIoctl", MakeVersionGate({17,0,0})}, + FunctionInfo{36, nullptr, "Unknown36", MakeVersionGate({18,0,0})}, + FunctionInfo{37, nullptr, "Unknown37", MakeVersionGate({18,0,0})}, + FunctionInfo{38, nullptr, "Unknown38", MakeVersionGate({18,0,0})}, + FunctionInfo{39, nullptr, "Unknown39", MakeVersionGate({20,0,0})}, + FunctionInfo{40, nullptr, "Unknown40", MakeVersionGate({20,0,0})}, + FunctionInfo{41, nullptr, "Unknown41", MakeVersionGate({21,0,0})}, + FunctionInfo{42, nullptr, "Unknown42", MakeVersionGate({21,0,0})}, + FunctionInfo{43, nullptr, "Unknown43", MakeVersionGate({21,0,0})}, + FunctionInfo{200, nullptr, "SetThreadCoreMask", MakeVersionGate({15,0,0})}, + FunctionInfo{201, nullptr, "GetThreadCoreMask", MakeVersionGate({15,0,0})} + ); bool is_user = false; }; @@ -196,12 +248,41 @@ class BSDCFG final : public ServiceFramework { public: explicit BSDCFG(Core::System& system_, const char *name); ~BSDCFG() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetIfUp"}, + FunctionInfo{1, nullptr, "SetIfUpWithEvent"}, + FunctionInfo{2, nullptr, "CancelIf"}, + FunctionInfo{3, nullptr, "SetIfDown"}, + FunctionInfo{4, nullptr, "GetIfState"}, + FunctionInfo{5, nullptr, "DhcpRenew"}, + FunctionInfo{6, nullptr, "AddStaticArpEntry"}, + FunctionInfo{7, nullptr, "RemoveArpEntry"}, + FunctionInfo{8, nullptr, "LookupArpEntry"}, + FunctionInfo{9, nullptr, "LookupArpEntry2"}, + FunctionInfo{10, nullptr, "ClearArpEntries"}, + FunctionInfo{11, nullptr, "ClearArpEntries2"}, + FunctionInfo{12, nullptr, "PrintArpEntries"}, + FunctionInfo{13, nullptr, "Unknown13"}, + FunctionInfo{14, nullptr, "Unknown14"}, + FunctionInfo{15, nullptr, "Unknown15"} + ); }; class BSD_NU final : public ServiceFramework { public: explicit BSD_NU(Core::System& system_); ~BSD_NU() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateUserService"} + ); }; } // namespace Service::Sockets diff --git a/src/core/hle/service/sockets/nsd.cpp b/src/core/hle/service/sockets/nsd.cpp index 241f2971ca..8f042aee75 100644 --- a/src/core/hle/service/sockets/nsd.cpp +++ b/src/core/hle/service/sockets/nsd.cpp @@ -29,38 +29,6 @@ struct EnvironmentIdentifier { static_assert(sizeof(EnvironmentIdentifier) == 0x8); NSD::NSD(Core::System& system_, const char* name) : ServiceFramework{system_, name} { - // clang-format off - static const FunctionInfo functions[] = { - {5, nullptr, "GetSettingUrl"}, - {10, nullptr, "GetSettingName"}, - {11, &NSD::GetEnvironmentIdentifier, "GetEnvironmentIdentifier"}, - {12, nullptr, "GetDeviceId"}, - {13, nullptr, "DeleteSettings"}, - {14, nullptr, "ImportSettings"}, - {15, &NSD::SetChangeEnvironmentIdentifierDisabled, "SetChangeEnvironmentIdentifierDisabled"}, - {20, &NSD::Resolve, "Resolve"}, - {21, &NSD::ResolveEx, "ResolveEx"}, - {30, nullptr, "GetNasServiceSetting"}, - {31, nullptr, "GetNasServiceSettingEx"}, - {40, nullptr, "GetNasRequestFqdn"}, - {41, nullptr, "GetNasRequestFqdnEx"}, - {42, nullptr, "GetNasApiFqdn"}, - {43, nullptr, "GetNasApiFqdnEx"}, - {50, nullptr, "GetCurrentSetting"}, - {51, nullptr, "WriteTestParameter"}, - {52, nullptr, "ReadTestParameter"}, - {60, nullptr, "ReadSaveDataFromFsForTest"}, - {61, nullptr, "WriteSaveDataToFsForTest"}, - {62, nullptr, "DeleteSaveDataOfFsForTest"}, - {63, nullptr, "IsChangeEnvironmentIdentifierDisabled"}, - {64, nullptr, "SetWithoutDomainExchangeFqdns"}, - {100, &NSD::GetApplicationServerEnvironmentType, "GetApplicationServerEnvironmentType"}, - {101, nullptr, "SetApplicationServerEnvironmentType"}, - {102, nullptr, "DeleteApplicationServerEnvironmentType"}, - }; - // clang-format on - - RegisterHandlers(functions); } static std::string ResolveImpl(const std::string& fqdn_in) { diff --git a/src/core/hle/service/sockets/nsd.h b/src/core/hle/service/sockets/nsd.h index e4a4588467..f3e4d48aff 100644 --- a/src/core/hle/service/sockets/nsd.h +++ b/src/core/hle/service/sockets/nsd.h @@ -25,6 +25,38 @@ private: void ResolveEx(HLERequestContext& ctx); void GetEnvironmentIdentifier(HLERequestContext& ctx); void GetApplicationServerEnvironmentType(HLERequestContext& ctx); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{5, nullptr, "GetSettingUrl"}, + FunctionInfo{10, nullptr, "GetSettingName"}, + FunctionInfo{11, &NSD::GetEnvironmentIdentifier, "GetEnvironmentIdentifier"}, + FunctionInfo{12, nullptr, "GetDeviceId"}, + FunctionInfo{13, nullptr, "DeleteSettings"}, + FunctionInfo{14, nullptr, "ImportSettings"}, + FunctionInfo{15, &NSD::SetChangeEnvironmentIdentifierDisabled, "SetChangeEnvironmentIdentifierDisabled"}, + FunctionInfo{20, &NSD::Resolve, "Resolve"}, + FunctionInfo{21, &NSD::ResolveEx, "ResolveEx"}, + FunctionInfo{30, nullptr, "GetNasServiceSetting"}, + FunctionInfo{31, nullptr, "GetNasServiceSettingEx"}, + FunctionInfo{40, nullptr, "GetNasRequestFqdn"}, + FunctionInfo{41, nullptr, "GetNasRequestFqdnEx"}, + FunctionInfo{42, nullptr, "GetNasApiFqdn"}, + FunctionInfo{43, nullptr, "GetNasApiFqdnEx"}, + FunctionInfo{50, nullptr, "GetCurrentSetting"}, + FunctionInfo{51, nullptr, "WriteTestParameter"}, + FunctionInfo{52, nullptr, "ReadTestParameter"}, + FunctionInfo{60, nullptr, "ReadSaveDataFromFsForTest"}, + FunctionInfo{61, nullptr, "WriteSaveDataToFsForTest"}, + FunctionInfo{62, nullptr, "DeleteSaveDataOfFsForTest"}, + FunctionInfo{63, nullptr, "IsChangeEnvironmentIdentifierDisabled"}, + FunctionInfo{64, nullptr, "SetWithoutDomainExchangeFqdns"}, + FunctionInfo{100, &NSD::GetApplicationServerEnvironmentType, "GetApplicationServerEnvironmentType"}, + FunctionInfo{101, nullptr, "SetApplicationServerEnvironmentType"}, + FunctionInfo{102, nullptr, "DeleteApplicationServerEnvironmentType"} + ); }; } // namespace Service::Sockets diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp index 93c01bf786..c89705356e 100644 --- a/src/core/hle/service/sockets/sfdnsres.cpp +++ b/src/core/hle/service/sockets/sfdnsres.cpp @@ -21,25 +21,6 @@ namespace Service::Sockets { SFDNSRES::SFDNSRES(Core::System& system_) : ServiceFramework{system_, "sfdnsres"} { - static const FunctionInfo functions[] = { - {0, nullptr, "SetDnsAddressesPrivateRequest"}, - {1, nullptr, "GetDnsAddressPrivateRequest"}, - {2, &SFDNSRES::GetHostByNameRequest, "GetHostByNameRequest"}, - {3, nullptr, "GetHostByAddrRequest"}, - {4, nullptr, "GetHostStringErrorRequest"}, - {5, &SFDNSRES::GetGaiStringErrorRequest, "GetGaiStringErrorRequest"}, - {6, &SFDNSRES::GetAddrInfoRequest, "GetAddrInfoRequest"}, - {7, nullptr, "GetNameInfoRequest"}, - {8, nullptr, "RequestCancelHandleRequest"}, - {9, nullptr, "CancelRequest"}, - {10, &SFDNSRES::GetHostByNameRequestWithOptions, "GetHostByNameRequestWithOptions"}, - {11, nullptr, "GetHostByAddrRequestWithOptions"}, - {12, &SFDNSRES::GetAddrInfoRequestWithOptions, "GetAddrInfoRequestWithOptions"}, - {13, nullptr, "GetNameInfoRequestWithOptions"}, - {14, &SFDNSRES::ResolverSetOptionRequest, "ResolverSetOptionRequest"}, - {15, nullptr, "ResolverGetOptionRequest"}, - }; - RegisterHandlers(functions); } SFDNSRES::~SFDNSRES() = default; @@ -410,14 +391,6 @@ void SFDNSRES::ResolverSetOptionRequest(HLERequestContext& ctx) { DNS_PRIV::DNS_PRIV(Core::System& system_) : ServiceFramework{system_, "dns:priv"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Cmd0"}, - {1, nullptr, "Cmd1"}, - {2, nullptr, "Cmd2"}, - }; - // clang-format on - RegisterHandlers(functions); } DNS_PRIV::~DNS_PRIV() = default; diff --git a/src/core/hle/service/sockets/sfdnsres.h b/src/core/hle/service/sockets/sfdnsres.h index 4302edc43e..b365d03b2d 100644 --- a/src/core/hle/service/sockets/sfdnsres.h +++ b/src/core/hle/service/sockets/sfdnsres.h @@ -26,12 +26,43 @@ private: void GetAddrInfoRequest(HLERequestContext& ctx); void GetAddrInfoRequestWithOptions(HLERequestContext& ctx); void ResolverSetOptionRequest(HLERequestContext& ctx); + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetDnsAddressesPrivateRequest"}, + FunctionInfo{1, nullptr, "GetDnsAddressPrivateRequest"}, + FunctionInfo{2, &SFDNSRES::GetHostByNameRequest, "GetHostByNameRequest"}, + FunctionInfo{3, nullptr, "GetHostByAddrRequest"}, + FunctionInfo{4, nullptr, "GetHostStringErrorRequest"}, + FunctionInfo{5, &SFDNSRES::GetGaiStringErrorRequest, "GetGaiStringErrorRequest"}, + FunctionInfo{6, &SFDNSRES::GetAddrInfoRequest, "GetAddrInfoRequest"}, + FunctionInfo{7, nullptr, "GetNameInfoRequest"}, + FunctionInfo{8, nullptr, "RequestCancelHandleRequest"}, + FunctionInfo{9, nullptr, "CancelRequest"}, + FunctionInfo{10, &SFDNSRES::GetHostByNameRequestWithOptions, "GetHostByNameRequestWithOptions"}, + FunctionInfo{11, nullptr, "GetHostByAddrRequestWithOptions"}, + FunctionInfo{12, &SFDNSRES::GetAddrInfoRequestWithOptions, "GetAddrInfoRequestWithOptions"}, + FunctionInfo{13, nullptr, "GetNameInfoRequestWithOptions"}, + FunctionInfo{14, &SFDNSRES::ResolverSetOptionRequest, "ResolverSetOptionRequest"}, + FunctionInfo{15, nullptr, "ResolverGetOptionRequest"} + ); }; class DNS_PRIV final : public ServiceFramework { public: explicit DNS_PRIV(Core::System& system_); ~DNS_PRIV() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Cmd0"}, + FunctionInfo{1, nullptr, "Cmd1"}, + FunctionInfo{2, nullptr, "Cmd2"} + ); }; } // namespace Service::Sockets diff --git a/src/core/hle/service/sockets/sockets.cpp b/src/core/hle/service/sockets/sockets.cpp index e96d7c5638..1c723e96a6 100644 --- a/src/core/hle/service/sockets/sockets.cpp +++ b/src/core/hle/service/sockets/sockets.cpp @@ -15,49 +15,49 @@ namespace Service::Sockets { class ETHC_C final : public ServiceFramework { public: explicit ETHC_C(Core::System& system_) - : ServiceFramework{system_, "ethc:c"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Initialize"}, - {1, nullptr, "Cancel"}, - {2, nullptr, "GetResult"}, - {3, nullptr, "GetMediaList"}, - {4, nullptr, "SetMediaType"}, - {5, nullptr, "GetMediaType"}, - {6, nullptr, "GetMacAddress"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "ethc:c"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Initialize"}, + FunctionInfo{1, nullptr, "Cancel"}, + FunctionInfo{2, nullptr, "GetResult"}, + FunctionInfo{3, nullptr, "GetMediaList"}, + FunctionInfo{4, nullptr, "SetMediaType"}, + FunctionInfo{5, nullptr, "GetMediaType"}, + FunctionInfo{6, nullptr, "GetMacAddress"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class ETHC_I final : public ServiceFramework { public: explicit ETHC_I(Core::System& system_) - : ServiceFramework{system_, "ethc:i"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetReadableHandle"}, - {1, nullptr, "Cancel"}, - {2, nullptr, "GetResult"}, - {3, nullptr, "GetInterfaceList"}, - {4, nullptr, "GetInterfaceCount"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "ethc:i"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetReadableHandle"}, + FunctionInfo{1, nullptr, "Cancel"}, + FunctionInfo{2, nullptr, "GetResult"}, + FunctionInfo{3, nullptr, "GetInterfaceList"}, + FunctionInfo{4, nullptr, "GetInterfaceCount"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class ISfDriverServiceCreator final : public ServiceFramework { public: explicit ISfDriverServiceCreator(Core::System& system_) - : ServiceFramework{system_, "eth:nd"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateDriverService"}, - }; - // clang-format on - RegisterHandlers(functions); + : ServiceFramework{system_, "eth:nd"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateDriverService"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/spl/spl.cpp b/src/core/hle/service/spl/spl.cpp index 81be99c360..ad0251fac5 100644 --- a/src/core/hle/service/spl/spl.cpp +++ b/src/core/hle/service/spl/spl.cpp @@ -8,181 +8,22 @@ namespace Service::SPL { -SPL::SPL(Core::System& system_, std::shared_ptr module_) - : Interface(system_, std::move(module_), "spl:") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &SPL::GetConfig, "GetConfig"}, - {1, &SPL::ModularExponentiate, "ModularExponentiate"}, - {5, &SPL::SetConfig, "SetConfig"}, - {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - {11, &SPL::IsDevelopment, "IsDevelopment"}, - {24, &SPL::SetBootReason, "SetBootReason"}, - {25, &SPL::GetBootReason, "GetBootReason"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - +SPL::SPL(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:") {} SPL::~SPL() = default; -SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr module_) - : Interface(system_, std::move(module_), "spl:mig") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &SPL::GetConfig, "GetConfig"}, - {1, &SPL::ModularExponentiate, "ModularExponentiate"}, - {2, &SPL::GenerateAesKek, "GenerateAesKek"}, - {3, nullptr, "LoadAesKey"}, - {4, &SPL::GenerateAesKey, "GenerateAesKey"}, - {5, &SPL::SetConfig, "SetConfig"}, - {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - {11, &SPL::IsDevelopment, "IsDevelopment"}, - {14, nullptr, "DecryptAesKey"}, - {15, nullptr, "CryptAesCtr"}, - {16, nullptr, "ComputeCmac"}, - {21, nullptr, "AllocateAesKeyslot"}, - {22, nullptr, "DeallocateAesKeySlot"}, - {23, nullptr, "GetAesKeyslotAvailableEvent"}, - {24, &SPL::SetBootReason, "SetBootReason"}, - {25, &SPL::GetBootReason, "GetBootReason"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - +SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:mig") {} SPL_MIG::~SPL_MIG() = default; -SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr module_) - : Interface(system_, std::move(module_), "spl:fs") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &SPL::GetConfig, "GetConfig"}, - {1, &SPL::ModularExponentiate, "ModularExponentiate"}, - {2, nullptr, "GenerateAesKek"}, - {3, nullptr, "LoadAesKey"}, - {4, nullptr, "GenerateAesKey"}, - {5, &SPL::SetConfig, "SetConfig"}, - {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - {9, nullptr, "ImportLotusKey"}, - {10, nullptr, "DecryptLotusMessage"}, - {11, &SPL::IsDevelopment, "IsDevelopment"}, - {12, nullptr, "GenerateSpecificAesKey"}, - {14, nullptr, "DecryptAesKey"}, - {15, nullptr, "CryptAesCtr"}, - {16, nullptr, "ComputeCmac"}, - {19, nullptr, "LoadTitleKey"}, - {21, nullptr, "AllocateAesKeyslot"}, - {22, nullptr, "DeallocateAesKeySlot"}, - {23, nullptr, "GetAesKeyslotAvailableEvent"}, - {24, &SPL::SetBootReason, "SetBootReason"}, - {25, &SPL::GetBootReason, "GetBootReason"}, - {31, nullptr, "GetPackage2Hash"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - +SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:fs") {} SPL_FS::~SPL_FS() = default; -SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr module_) - : Interface(system_, std::move(module_), "spl:ssl") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &SPL::GetConfig, "GetConfig"}, - {1, &SPL::ModularExponentiate, "ModularExponentiate"}, - {2, nullptr, "GenerateAesKek"}, - {3, nullptr, "LoadAesKey"}, - {4, nullptr, "GenerateAesKey"}, - {5, &SPL::SetConfig, "SetConfig"}, - {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - {11, &SPL::IsDevelopment, "IsDevelopment"}, - {13, nullptr, "DecryptDeviceUniqueData"}, - {14, nullptr, "DecryptAesKey"}, - {15, nullptr, "CryptAesCtr"}, - {16, nullptr, "ComputeCmac"}, - {21, nullptr, "AllocateAesKeyslot"}, - {22, nullptr, "DeallocateAesKeySlot"}, - {23, nullptr, "GetAesKeyslotAvailableEvent"}, - {24, &SPL::SetBootReason, "SetBootReason"}, - {25, &SPL::GetBootReason, "GetBootReason"}, - {26, nullptr, "DecryptAndStoreSslClientCertKey"}, - {27, nullptr, "ModularExponentiateWithSslClientCertKey"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - +SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:ssl") {} SPL_SSL::~SPL_SSL() = default; -SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr module_) - : Interface(system_, std::move(module_), "spl:es") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &SPL::GetConfig, "GetConfig"}, - {1, &SPL::ModularExponentiate, "ModularExponentiate"}, - {2, nullptr, "GenerateAesKek"}, - {3, nullptr, "LoadAesKey"}, - {4, nullptr, "GenerateAesKey"}, - {5, &SPL::SetConfig, "SetConfig"}, - {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - {11, &SPL::IsDevelopment, "IsDevelopment"}, - {13, nullptr, "DecryptDeviceUniqueData"}, - {14, nullptr, "DecryptAesKey"}, - {15, nullptr, "CryptAesCtr"}, - {16, nullptr, "ComputeCmac"}, - {17, nullptr, "ImportEsKey"}, - {18, nullptr, "UnwrapTitleKey"}, - {20, nullptr, "PrepareEsCommonKey"}, - {21, nullptr, "AllocateAesKeyslot"}, - {22, nullptr, "DeallocateAesKeySlot"}, - {23, nullptr, "GetAesKeyslotAvailableEvent"}, - {24, &SPL::SetBootReason, "SetBootReason"}, - {25, &SPL::GetBootReason, "GetBootReason"}, - {28, nullptr, "DecryptAndStoreDrmDeviceCertKey"}, - {29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"}, - {31, nullptr, "PrepareEsArchiveKey"}, - {32, nullptr, "LoadPreparedAesKey"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - +SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:es") {} SPL_ES::~SPL_ES() = default; -SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr module_) - : Interface(system_, std::move(module_), "spl:manu") { - // clang-format off - static const FunctionInfo functions[] = { - {0, &SPL::GetConfig, "GetConfig"}, - {1, &SPL::ModularExponentiate, "ModularExponentiate"}, - {2, nullptr, "GenerateAesKek"}, - {3, nullptr, "LoadAesKey"}, - {4, nullptr, "GenerateAesKey"}, - {5, &SPL::SetConfig, "SetConfig"}, - {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - {11, &SPL::IsDevelopment, "IsDevelopment"}, - {13, nullptr, "DecryptDeviceUniqueData"}, - {14, nullptr, "DecryptAesKey"}, - {15, nullptr, "CryptAesCtr"}, - {16, nullptr, "ComputeCmac"}, - {21, nullptr, "AllocateAesKeyslot"}, - {22, nullptr, "DeallocateAesKeySlot"}, - {23, nullptr, "GetAesKeyslotAvailableEvent"}, - {24, &SPL::SetBootReason, "SetBootReason"}, - {25, &SPL::GetBootReason, "GetBootReason"}, - {30, nullptr, "ReencryptDeviceUniqueData"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - +SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:manu") {} SPL_MANU::~SPL_MANU() = default; } // namespace Service::SPL diff --git a/src/core/hle/service/spl/spl.h b/src/core/hle/service/spl/spl.h index 83a3cda539..8f84d2a3d3 100644 --- a/src/core/hle/service/spl/spl.h +++ b/src/core/hle/service/spl/spl.h @@ -18,36 +18,177 @@ class SPL final : public Module::Interface { public: explicit SPL(Core::System& system_, std::shared_ptr module_); ~SPL() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, + FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, + FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, + FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, + FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, + FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"} + ); }; class SPL_MIG final : public Module::Interface { public: explicit SPL_MIG(Core::System& system_, std::shared_ptr module_); ~SPL_MIG() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, + FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, + FunctionInfo{2, &SPL::GenerateAesKek, "GenerateAesKek"}, + FunctionInfo{3, nullptr, "LoadAesKey"}, + FunctionInfo{4, &SPL::GenerateAesKey, "GenerateAesKey"}, + FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, + FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, + FunctionInfo{14, nullptr, "DecryptAesKey"}, + FunctionInfo{15, nullptr, "CryptAesCtr"}, + FunctionInfo{16, nullptr, "ComputeCmac"}, + FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, + FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, + FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, + FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, + FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"} + ); }; class SPL_FS final : public Module::Interface { public: explicit SPL_FS(Core::System& system_, std::shared_ptr module_); ~SPL_FS() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, + FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, + FunctionInfo{2, nullptr, "GenerateAesKek"}, + FunctionInfo{3, nullptr, "LoadAesKey"}, + FunctionInfo{4, nullptr, "GenerateAesKey"}, + FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, + FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + FunctionInfo{9, nullptr, "ImportLotusKey"}, + FunctionInfo{10, nullptr, "DecryptLotusMessage"}, + FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, + FunctionInfo{12, nullptr, "GenerateSpecificAesKey"}, + FunctionInfo{14, nullptr, "DecryptAesKey"}, + FunctionInfo{15, nullptr, "CryptAesCtr"}, + FunctionInfo{16, nullptr, "ComputeCmac"}, + FunctionInfo{19, nullptr, "LoadTitleKey"}, + FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, + FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, + FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, + FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, + FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}, + FunctionInfo{31, nullptr, "GetPackage2Hash"} + ); }; class SPL_SSL final : public Module::Interface { public: explicit SPL_SSL(Core::System& system_, std::shared_ptr module_); ~SPL_SSL() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, + FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, + FunctionInfo{2, nullptr, "GenerateAesKek"}, + FunctionInfo{3, nullptr, "LoadAesKey"}, + FunctionInfo{4, nullptr, "GenerateAesKey"}, + FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, + FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, + FunctionInfo{13, nullptr, "DecryptDeviceUniqueData"}, + FunctionInfo{14, nullptr, "DecryptAesKey"}, + FunctionInfo{15, nullptr, "CryptAesCtr"}, + FunctionInfo{16, nullptr, "ComputeCmac"}, + FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, + FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, + FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, + FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, + FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}, + FunctionInfo{26, nullptr, "DecryptAndStoreSslClientCertKey"}, + FunctionInfo{27, nullptr, "ModularExponentiateWithSslClientCertKey"} + ); }; class SPL_ES final : public Module::Interface { public: explicit SPL_ES(Core::System& system_, std::shared_ptr module_); ~SPL_ES() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, + FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, + FunctionInfo{2, nullptr, "GenerateAesKek"}, + FunctionInfo{3, nullptr, "LoadAesKey"}, + FunctionInfo{4, nullptr, "GenerateAesKey"}, + FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, + FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, + FunctionInfo{13, nullptr, "DecryptDeviceUniqueData"}, + FunctionInfo{14, nullptr, "DecryptAesKey"}, + FunctionInfo{15, nullptr, "CryptAesCtr"}, + FunctionInfo{16, nullptr, "ComputeCmac"}, + FunctionInfo{17, nullptr, "ImportEsKey"}, + FunctionInfo{18, nullptr, "UnwrapTitleKey"}, + FunctionInfo{20, nullptr, "PrepareEsCommonKey"}, + FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, + FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, + FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, + FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, + FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}, + FunctionInfo{28, nullptr, "DecryptAndStoreDrmDeviceCertKey"}, + FunctionInfo{29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"}, + FunctionInfo{31, nullptr, "PrepareEsArchiveKey"}, + FunctionInfo{32, nullptr, "LoadPreparedAesKey"} + ); }; class SPL_MANU final : public Module::Interface { public: explicit SPL_MANU(Core::System& system_, std::shared_ptr module_); ~SPL_MANU() override; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, + FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, + FunctionInfo{2, nullptr, "GenerateAesKek"}, + FunctionInfo{3, nullptr, "LoadAesKey"}, + FunctionInfo{4, nullptr, "GenerateAesKey"}, + FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, + FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, + FunctionInfo{13, nullptr, "DecryptDeviceUniqueData"}, + FunctionInfo{14, nullptr, "DecryptAesKey"}, + FunctionInfo{15, nullptr, "CryptAesCtr"}, + FunctionInfo{16, nullptr, "ComputeCmac"}, + FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, + FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, + FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, + FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, + FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}, + FunctionInfo{30, nullptr, "ReencryptDeviceUniqueData"} + ); }; } // namespace Service::SPL diff --git a/src/core/hle/service/spl/spl_module.cpp b/src/core/hle/service/spl/spl_module.cpp index 520cb1860b..594575d9a0 100644 --- a/src/core/hle/service/spl/spl_module.cpp +++ b/src/core/hle/service/spl/spl_module.cpp @@ -204,14 +204,15 @@ Result Module::Interface::GetConfigImpl(u64* out_config, ConfigItem config_item) class CSRNG final : public Module::Interface { public: - explicit CSRNG(Core::System& system_, std::shared_ptr module_) - : Interface(system_, std::move(module_), "csrng") { - static const FunctionInfo functions[] = { - {0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"}, - }; - RegisterHandlers(functions); - } + explicit CSRNG(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "csrng") {} ~CSRNG() override = default; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 999efd4295..c5902079ee 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -74,59 +74,19 @@ struct SslContextSharedData { class ISslConnection final : public ServiceFramework { public: - explicit ISslConnection(Core::System& system_in, SslVersion ssl_version_in, - std::shared_ptr& shared_data_in, - std::unique_ptr&& backend_in) - : ServiceFramework{system_in, "ISslConnection"}, ssl_version{ssl_version_in}, - shared_data{shared_data_in}, backend{std::move(backend_in)} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ISslConnection::SetSocketDescriptor>, "SetSocketDescriptor"}, - {1, D<&ISslConnection::SetHostName>, "SetHostName"}, - {2, D<&ISslConnection::SetVerifyOption>, "SetVerifyOption"}, - {3, D<&ISslConnection::SetIoMode>, "SetIoMode"}, - {4, D<&ISslConnection::GetSocketDescriptor>, "GetSocketDescriptor"}, - {5, D<&ISslConnection::GetHostName>, "GetHostName"}, - {6, nullptr, "GetVerifyOption"}, - {7, D<&ISslConnection::GetIoMode>, "GetIoMode"}, - {8, D<&ISslConnection::DoHandshake>, "DoHandshake"}, - {9, &ISslConnection::DoHandshakeGetServerCert, "DoHandshakeGetServerCert"}, - {10, D<&ISslConnection::Read>, "Read"}, - {11, D<&ISslConnection::Write>, "Write"}, - {12, D<&ISslConnection::Pending>, "Pending"}, - {13, D<&ISslConnection::Peek>, "Peek"}, - {14, D<&ISslConnection::Poll>, "Poll"}, - {15, D<&ISslConnection::GetVerifyCertError>, "GetVerifyCertError"}, - {16, D<&ISslConnection::GetNeededServerCertBufferSize>, "GetNeededServerCertBufferSize"}, - {17, D<&ISslConnection::SetSessionCacheMode>, "SetSessionCacheMode"}, - {18, D<&ISslConnection::GetSessionCacheMode>, "GetSessionCacheMode"}, - {19, D<&ISslConnection::FlushSessionCache>, "FlushSessionCache"}, - {20, D<&ISslConnection::SetRenegotiationMode>, "SetRenegotiationMode"}, - {21, D<&ISslConnection::GetRenegotiationMode>, "GetRenegotiationMode"}, - {22, D<&ISslConnection::SetOption>, "SetOption"}, - {23, D<&ISslConnection::GetOption>, "GetOption"}, - {24, nullptr, "GetVerifyCertErrors"}, - {25, nullptr, "GetCipherInfo"}, - {26, D<&ISslConnection::SetNextAlpnProto>, "SetNextAlpnProto"}, - {27, D<&ISslConnection::GetNextAlpnProto>, "GetNextAlpnProto"}, - {28, nullptr, "SetDtlsSocketDescriptor"}, - {29, nullptr, "GetDtlsHandshakeTimeout"}, - {30, nullptr, "SetPrivateOption"}, - {31, nullptr, "SetSrtpCiphers"}, - {32, nullptr, "GetSrtpCipher"}, - {33, nullptr, "ExportKeyingMaterial"}, - {34, nullptr, "SetIoTimeout"}, - {35, nullptr, "GetIoTimeout"}, - }; - // clang-format on - - RegisterHandlers(functions); - + explicit ISslConnection(Core::System& system_in, SslVersion ssl_version_in, std::shared_ptr& shared_data_in, std::unique_ptr&& backend_in) + : ServiceFramework{system_in, "ISslConnection"} + , ssl_version{ssl_version_in} + , shared_data{shared_data_in} + , backend{std::move(backend_in)} { backend->SetVerifyOption(verify_option); - shared_data->connection_count++; } + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + ~ISslConnection() { shared_data->connection_count--; if (fd_to_close.has_value()) { @@ -432,6 +392,44 @@ private: R_SUCCEED(); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ISslConnection::SetSocketDescriptor>, "SetSocketDescriptor"}, + FunctionInfo{1, D<&ISslConnection::SetHostName>, "SetHostName"}, + FunctionInfo{2, D<&ISslConnection::SetVerifyOption>, "SetVerifyOption"}, + FunctionInfo{3, D<&ISslConnection::SetIoMode>, "SetIoMode"}, + FunctionInfo{4, D<&ISslConnection::GetSocketDescriptor>, "GetSocketDescriptor"}, + FunctionInfo{5, D<&ISslConnection::GetHostName>, "GetHostName"}, + FunctionInfo{6, nullptr, "GetVerifyOption"}, + FunctionInfo{7, D<&ISslConnection::GetIoMode>, "GetIoMode"}, + FunctionInfo{8, D<&ISslConnection::DoHandshake>, "DoHandshake"}, + FunctionInfo{9, &ISslConnection::DoHandshakeGetServerCert, "DoHandshakeGetServerCert"}, + FunctionInfo{10, D<&ISslConnection::Read>, "Read"}, + FunctionInfo{11, D<&ISslConnection::Write>, "Write"}, + FunctionInfo{12, D<&ISslConnection::Pending>, "Pending"}, + FunctionInfo{13, D<&ISslConnection::Peek>, "Peek"}, + FunctionInfo{14, D<&ISslConnection::Poll>, "Poll"}, + FunctionInfo{15, D<&ISslConnection::GetVerifyCertError>, "GetVerifyCertError"}, + FunctionInfo{16, D<&ISslConnection::GetNeededServerCertBufferSize>, "GetNeededServerCertBufferSize"}, + FunctionInfo{17, D<&ISslConnection::SetSessionCacheMode>, "SetSessionCacheMode"}, + FunctionInfo{18, D<&ISslConnection::GetSessionCacheMode>, "GetSessionCacheMode"}, + FunctionInfo{19, D<&ISslConnection::FlushSessionCache>, "FlushSessionCache"}, + FunctionInfo{20, D<&ISslConnection::SetRenegotiationMode>, "SetRenegotiationMode"}, + FunctionInfo{21, D<&ISslConnection::GetRenegotiationMode>, "GetRenegotiationMode"}, + FunctionInfo{22, D<&ISslConnection::SetOption>, "SetOption"}, + FunctionInfo{23, D<&ISslConnection::GetOption>, "GetOption"}, + FunctionInfo{24, nullptr, "GetVerifyCertErrors"}, + FunctionInfo{25, nullptr, "GetCipherInfo"}, + FunctionInfo{26, D<&ISslConnection::SetNextAlpnProto>, "SetNextAlpnProto"}, + FunctionInfo{27, D<&ISslConnection::GetNextAlpnProto>, "GetNextAlpnProto"}, + FunctionInfo{28, nullptr, "SetDtlsSocketDescriptor"}, + FunctionInfo{29, nullptr, "GetDtlsHandshakeTimeout"}, + FunctionInfo{30, nullptr, "SetPrivateOption"}, + FunctionInfo{31, nullptr, "SetSrtpCiphers"}, + FunctionInfo{32, nullptr, "GetSrtpCipher"}, + FunctionInfo{33, nullptr, "ExportKeyingMaterial"}, + FunctionInfo{34, nullptr, "SetIoTimeout"}, + FunctionInfo{35, nullptr, "GetIoTimeout"} + ); SslVersion ssl_version; std::shared_ptr shared_data; std::unique_ptr backend; @@ -452,29 +450,9 @@ public: explicit ISslContext(Core::System& system_, SslVersion version) : ServiceFramework{system_, "ISslContext"}, ssl_version{version}, shared_data{std::make_shared()} { - static const FunctionInfo functions[] = { - {0, &ISslContext::SetOption, "SetOption"}, - {1, &ISslContext::GetOption, "GetOption"}, - {2, &ISslContext::CreateConnection, "CreateConnection"}, - {3, &ISslContext::GetConnectionCount, "GetConnectionCount"}, - {4, &ISslContext::ImportServerPki, "ImportServerPki"}, - {5, &ISslContext::ImportClientPki, "ImportClientPki"}, - {6, nullptr, "RemoveServerPki"}, - {7, nullptr, "RemoveClientPki"}, - {8, D<&ISslContext::RegisterInternalPki>, "RegisterInternalPki"}, - {9, nullptr, "AddPolicyOid"}, - {10, nullptr, "ImportCrl"}, - {11, nullptr, "RemoveCrl"}, - {12, nullptr, "ImportClientCertKeyPki"}, - {13, nullptr, "GeneratePrivateKeyAndCert"}, - }; - RegisterHandlers(functions); } private: - SslVersion ssl_version; - std::shared_ptr shared_data; - void SetOption(HLERequestContext& ctx) { struct Parameters { ContextOption option; @@ -561,28 +539,36 @@ private: LOG_WARNING(Service_SSL, "(STUBBED) called"); R_SUCCEED(); } + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ISslContext::SetOption, "SetOption"}, + FunctionInfo{1, &ISslContext::GetOption, "GetOption"}, + FunctionInfo{2, &ISslContext::CreateConnection, "CreateConnection"}, + FunctionInfo{3, &ISslContext::GetConnectionCount, "GetConnectionCount"}, + FunctionInfo{4, &ISslContext::ImportServerPki, "ImportServerPki"}, + FunctionInfo{5, &ISslContext::ImportClientPki, "ImportClientPki"}, + FunctionInfo{6, nullptr, "RemoveServerPki"}, + FunctionInfo{7, nullptr, "RemoveClientPki"}, + FunctionInfo{8, D<&ISslContext::RegisterInternalPki>, "RegisterInternalPki"}, + FunctionInfo{9, nullptr, "AddPolicyOid"}, + FunctionInfo{10, nullptr, "ImportCrl"}, + FunctionInfo{11, nullptr, "RemoveCrl"}, + FunctionInfo{12, nullptr, "ImportClientCertKeyPki"}, + FunctionInfo{13, nullptr, "GeneratePrivateKeyAndCert"} + ); + SslVersion ssl_version; + std::shared_ptr shared_data; }; class ISslService final : public ServiceFramework { public: - explicit ISslService(Core::System& system_) - : ServiceFramework{system_, "ssl"}, cert_store{system} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &ISslService::CreateContext, "CreateContext"}, - {1, nullptr, "GetContextCount"}, - {2, D<&ISslService::GetCertificates>, "GetCertificates"}, - {3, D<&ISslService::GetCertificateBufSize>, "GetCertificateBufSize"}, - {4, nullptr, "DebugIoctl"}, - {5, &ISslService::SetInterfaceVersion, "SetInterfaceVersion"}, - {6, nullptr, "FlushSessionCache"}, - {7, nullptr, "SetDebugOption"}, - {8, nullptr, "GetDebugOption"}, - {8, nullptr, "ClearTls12FallbackFlag"}, - }; - // clang-format on + explicit ISslService(Core::System& system_) : ServiceFramework{system_, "ssl"}, cert_store{system} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -628,147 +614,116 @@ private: } private: + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &ISslService::CreateContext, "CreateContext"}, + FunctionInfo{1, nullptr, "GetContextCount"}, + FunctionInfo{2, D<&ISslService::GetCertificates>, "GetCertificates"}, + FunctionInfo{3, D<&ISslService::GetCertificateBufSize>, "GetCertificateBufSize"}, + FunctionInfo{4, nullptr, "DebugIoctl"}, + FunctionInfo{5, &ISslService::SetInterfaceVersion, "SetInterfaceVersion"}, + FunctionInfo{6, nullptr, "FlushSessionCache"}, + FunctionInfo{7, nullptr, "SetDebugOption"}, + FunctionInfo{8, nullptr, "GetDebugOption"}, + FunctionInfo{8, nullptr, "ClearTls12FallbackFlag"} + ); CertStore cert_store; }; class ISslServiceForSystem final : public ServiceFramework { - public: - explicit ISslServiceForSystem(Core::System& system_) : ServiceFramework{system_, "ssl:s"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, D<&ISslServiceForSystem::CreateContext>, "CreateContext"}, - {1, D<&ISslServiceForSystem::GetContextCount>, "GetContextCount"}, - {2, D<&ISslServiceForSystem::GetCertificates>, "GetCertificates"}, - {3, D<&ISslServiceForSystem::GetCertificateBufSize>, "GetCertificateBufSize"}, - {4, D<&ISslServiceForSystem::DebugIoctl>, "DebugIoctl"}, - {5, D<&ISslServiceForSystem::SetInterfaceVersion>, "SetInterfaceVersion"}, - {6, D<&ISslServiceForSystem::FlushSessionCache>, "FlushSessionCache"}, - {7, D<&ISslServiceForSystem::SetDebugOption>, "SetDebugOption"}, - {8, D<&ISslServiceForSystem::GetDebugOption>, "GetDebugOption"}, - {9, D<&ISslServiceForSystem::ClearTls12FallbackFlag>, "ClearTls12FallbackFlag"}, - {100, D<&ISslServiceForSystem::CreateContextForSystem>, "CreateContextForSystem"}, - {101, D<&ISslServiceForSystem::SetThreadCoreMask>, "SetThreadCoreMask"}, - {102, D<&ISslServiceForSystem::GetThreadCoreMask>, "GetThreadCoreMask"}, - {103, D<&ISslServiceForSystem::VerifySignature>, "VerifySignature"} - }; - // clang-format on +public: + explicit ISslServiceForSystem(Core::System& system_) : ServiceFramework{system_, "ssl:s"} {} - RegisterHandlers(functions); - }; - - Result CreateContext() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result GetContextCount() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result GetCertificates() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result GetCertificateBufSize() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result DebugIoctl() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result SetInterfaceVersion() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result FlushSessionCache() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result SetDebugOption() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result GetDebugOption() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result ClearTls12FallbackFlag() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result CreateContextForSystem() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result SetThreadCoreMask() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result GetThreadCoreMask() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; - - Result VerifySignature() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - - return ResultSuccess; - }; + Result CreateContext() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); }; + Result GetContextCount() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result GetCertificates() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result GetCertificateBufSize() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result DebugIoctl() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result SetInterfaceVersion() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result FlushSessionCache() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result SetDebugOption() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result GetDebugOption() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result ClearTls12FallbackFlag() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result CreateContextForSystem() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result SetThreadCoreMask() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result GetThreadCoreMask() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + Result VerifySignature() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + R_SUCCEED(); + }; + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, D<&ISslServiceForSystem::CreateContext>, "CreateContext"}, + FunctionInfo{1, D<&ISslServiceForSystem::GetContextCount>, "GetContextCount"}, + FunctionInfo{2, D<&ISslServiceForSystem::GetCertificates>, "GetCertificates"}, + FunctionInfo{3, D<&ISslServiceForSystem::GetCertificateBufSize>, "GetCertificateBufSize"}, + FunctionInfo{4, D<&ISslServiceForSystem::DebugIoctl>, "DebugIoctl"}, + FunctionInfo{5, D<&ISslServiceForSystem::SetInterfaceVersion>, "SetInterfaceVersion"}, + FunctionInfo{6, D<&ISslServiceForSystem::FlushSessionCache>, "FlushSessionCache"}, + FunctionInfo{7, D<&ISslServiceForSystem::SetDebugOption>, "SetDebugOption"}, + FunctionInfo{8, D<&ISslServiceForSystem::GetDebugOption>, "GetDebugOption"}, + FunctionInfo{9, D<&ISslServiceForSystem::ClearTls12FallbackFlag>, "ClearTls12FallbackFlag"}, + FunctionInfo{100, D<&ISslServiceForSystem::CreateContextForSystem>, "CreateContextForSystem"}, + FunctionInfo{101, D<&ISslServiceForSystem::SetThreadCoreMask>, "SetThreadCoreMask"}, + FunctionInfo{102, D<&ISslServiceForSystem::GetThreadCoreMask>, "GetThreadCoreMask"}, + FunctionInfo{103, D<&ISslServiceForSystem::VerifySignature>, "VerifySignature"} + ); +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); diff --git a/src/core/hle/service/tma/tma.cpp b/src/core/hle/service/tma/tma.cpp index c2fb33cd16..e9198eea64 100644 --- a/src/core/hle/service/tma/tma.cpp +++ b/src/core/hle/service/tma/tma.cpp @@ -19,12 +19,14 @@ class HTC_TENV final : public ServiceFramework { public: explicit HTC_TENV(Core::System& system_) : ServiceFramework{system_, "htc:tenv"} - { - static const FunctionInfo functions[] = { - {0, nullptr, "GetServiceInterface"}, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetServiceInterface"} + ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp index ff2a377172..f7dc15e3db 100644 --- a/src/core/hle/service/usb/usb.cpp +++ b/src/core/hle/service/usb/usb.cpp @@ -17,137 +17,127 @@ namespace Service::USB { class IDsInterface final : public ServiceFramework { public: - explicit IDsInterface(Core::System& system_) : ServiceFramework{system_, "IDsInterface"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "AddEndpoint"}, - {1, nullptr, "GetSetupEvent"}, - {2, nullptr, "GetSetupPacket"}, - {3, nullptr, "Enable"}, - {4, nullptr, "Disable"}, - {5, nullptr, "CtrlIn"}, - {6, nullptr, "CtrlOut"}, - {7, nullptr, "GetCtrlInCompletionEvent"}, - {8, nullptr, "GetCtrlInUrbReport"}, - {9, nullptr, "GetCtrlOutCompletionEvent"}, - {10, nullptr, "GetCtrlOutUrbReport"}, - {11, nullptr, "CtrlStall"}, - {12, nullptr, "AppendConfigurationData"}, - }; - // clang-format on + explicit IDsInterface(Core::System& system_) : ServiceFramework{system_, "IDsInterface"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "AddEndpoint"}, + FunctionInfo{1, nullptr, "GetSetupEvent"}, + FunctionInfo{2, nullptr, "GetSetupPacket"}, + FunctionInfo{3, nullptr, "Enable"}, + FunctionInfo{4, nullptr, "Disable"}, + FunctionInfo{5, nullptr, "CtrlIn"}, + FunctionInfo{6, nullptr, "CtrlOut"}, + FunctionInfo{7, nullptr, "GetCtrlInCompletionEvent"}, + FunctionInfo{8, nullptr, "GetCtrlInUrbReport"}, + FunctionInfo{9, nullptr, "GetCtrlOutCompletionEvent"}, + FunctionInfo{10, nullptr, "GetCtrlOutUrbReport"}, + FunctionInfo{11, nullptr, "CtrlStall"}, + FunctionInfo{12, nullptr, "AppendConfigurationData"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IDsRootSession final : public ServiceFramework { public: - explicit IDsRootSession(Core::System& system_) : ServiceFramework{system_, "usb:ds"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "OpenDsService"}, - }; - // clang-format on + explicit IDsRootSession(Core::System& system_) : ServiceFramework{system_, "usb:ds"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenDsService"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IClientEpSession final : public ServiceFramework { public: explicit IClientEpSession(Core::System& system_) - : ServiceFramework{system_, "IClientEpSession"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "ReOpen"}, - {1, nullptr, "Close"}, - {2, nullptr, "GetCompletionEvent"}, - {3, nullptr, "PopulateRing"}, - {4, nullptr, "PostBufferAsync"}, - {5, nullptr, "GetXferReport"}, - {6, nullptr, "PostBufferMultiAsync"}, - {7, nullptr, "CreateSmmuSpace"}, - {8, nullptr, "ShareReportRing"}, - }; - // clang-format on + : ServiceFramework{system_, "IClientEpSession"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "ReOpen"}, + FunctionInfo{1, nullptr, "Close"}, + FunctionInfo{2, nullptr, "GetCompletionEvent"}, + FunctionInfo{3, nullptr, "PopulateRing"}, + FunctionInfo{4, nullptr, "PostBufferAsync"}, + FunctionInfo{5, nullptr, "GetXferReport"}, + FunctionInfo{6, nullptr, "PostBufferMultiAsync"}, + FunctionInfo{7, nullptr, "CreateSmmuSpace"}, + FunctionInfo{8, nullptr, "ShareReportRing"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IClientIfSession final : public ServiceFramework { public: explicit IClientIfSession(Core::System& system_) - : ServiceFramework{system_, "IClientIfSession"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetStateChangeEvent"}, - {1, nullptr, "SetInterface"}, - {2, nullptr, "GetInterface"}, - {3, nullptr, "GetAlternateInterface"}, - {4, nullptr, "GetCurrentFrame"}, - {5, nullptr, "CtrlXferAsync"}, - {6, nullptr, "GetCtrlXferCompletionEvent"}, - {7, nullptr, "GetCtrlXferReport"}, - {8, nullptr, "ResetDevice"}, - {9, nullptr, "OpenUsbEp"}, - }; - // clang-format on + : ServiceFramework{system_, "IClientIfSession"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetStateChangeEvent"}, + FunctionInfo{1, nullptr, "SetInterface"}, + FunctionInfo{2, nullptr, "GetInterface"}, + FunctionInfo{3, nullptr, "GetAlternateInterface"}, + FunctionInfo{4, nullptr, "GetCurrentFrame"}, + FunctionInfo{5, nullptr, "CtrlXferAsync"}, + FunctionInfo{6, nullptr, "GetCtrlXferCompletionEvent"}, + FunctionInfo{7, nullptr, "GetCtrlXferReport"}, + FunctionInfo{8, nullptr, "ResetDevice"}, + FunctionInfo{9, nullptr, "OpenUsbEp"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IClientRootSession final : public ServiceFramework { public: - explicit IClientRootSession(Core::System& system_) : ServiceFramework{system_, "usb:hs"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "BindClientProcess"}, - {1, nullptr, "QueryAllInterfaces"}, - {2, nullptr, "QueryAvailableInterfaces"}, - {3, nullptr, "QueryAcquiredInterfaces"}, - {4, nullptr, "CreateInterfaceAvailableEvent"}, - {5, nullptr, "DestroyInterfaceAvailableEvent"}, - {6, nullptr, "GetInterfaceStateChangeEvent"}, - {7, nullptr, "AcquireUsbIf"}, - {8, nullptr, "SetTestMode"}, - }; - // clang-format on + explicit IClientRootSession(Core::System& system_) : ServiceFramework{system_, "usb:hs"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "BindClientProcess"}, + FunctionInfo{1, nullptr, "QueryAllInterfaces"}, + FunctionInfo{2, nullptr, "QueryAvailableInterfaces"}, + FunctionInfo{3, nullptr, "QueryAcquiredInterfaces"}, + FunctionInfo{4, nullptr, "CreateInterfaceAvailableEvent"}, + FunctionInfo{5, nullptr, "DestroyInterfaceAvailableEvent"}, + FunctionInfo{6, nullptr, "GetInterfaceStateChangeEvent"}, + FunctionInfo{7, nullptr, "AcquireUsbIf"}, + FunctionInfo{8, nullptr, "SetTestMode"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IPdSession final : public ServiceFramework { public: - explicit IPdSession(Core::System& system_) : ServiceFramework{system_, "IPdSession"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "BindNoticeEvent"}, - {1, nullptr, "UnbindNoticeEvent"}, - {2, nullptr, "GetStatus"}, - {3, nullptr, "GetNotice"}, - {4, nullptr, "EnablePowerRequestNotice"}, - {5, nullptr, "DisablePowerRequestNotice"}, - {6, nullptr, "ReplyPowerRequest"}, - }; - // clang-format on + explicit IPdSession(Core::System& system_) : ServiceFramework{system_, "IPdSession"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "BindNoticeEvent"}, + FunctionInfo{1, nullptr, "UnbindNoticeEvent"}, + FunctionInfo{2, nullptr, "GetStatus"}, + FunctionInfo{3, nullptr, "GetNotice"}, + FunctionInfo{4, nullptr, "EnablePowerRequestNotice"}, + FunctionInfo{5, nullptr, "DisablePowerRequestNotice"}, + FunctionInfo{6, nullptr, "ReplyPowerRequest"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IPdManager final : public ServiceFramework { public: - explicit IPdManager(Core::System& system_) : ServiceFramework{system_, "usb:pd"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IPdManager::OpenSession, "OpenSession"}, - }; - // clang-format on + explicit IPdManager(Core::System& system_) : ServiceFramework{system_, "usb:pd"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -158,40 +148,39 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IPdManager::OpenSession, "OpenSession"} + ); }; class IPdCradleSession final : public ServiceFramework { public: explicit IPdCradleSession(Core::System& system_) - : ServiceFramework{system_, "IPdCradleSession"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "SetCradleVdo"}, - {1, nullptr, "GetCradleVdo"}, - {2, nullptr, "ResetCradleUsbHub"}, - {3, nullptr, "GetHostPdcFirmwareType"}, - {4, nullptr, "GetHostPdcFirmwareRevision"}, - {5, nullptr, "GetHostPdcManufactureId"}, - {6, nullptr, "GetHostPdcDeviceId"}, - {7, nullptr, "EnableCradleRecovery"}, - {8, nullptr, "DisableCradleRecovery"}, - }; - // clang-format on + : ServiceFramework{system_, "IPdCradleSession"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "SetCradleVdo"}, + FunctionInfo{1, nullptr, "GetCradleVdo"}, + FunctionInfo{2, nullptr, "ResetCradleUsbHub"}, + FunctionInfo{3, nullptr, "GetHostPdcFirmwareType"}, + FunctionInfo{4, nullptr, "GetHostPdcFirmwareRevision"}, + FunctionInfo{5, nullptr, "GetHostPdcManufactureId"}, + FunctionInfo{6, nullptr, "GetHostPdcDeviceId"}, + FunctionInfo{7, nullptr, "EnableCradleRecovery"}, + FunctionInfo{8, nullptr, "DisableCradleRecovery"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IPdCradleManager final : public ServiceFramework { public: - explicit IPdCradleManager(Core::System& system_) : ServiceFramework{system_, "usb:pd:c"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IPdCradleManager::OpenCradleSession, "OpenCradleSession"}, - }; - // clang-format on + explicit IPdCradleManager(Core::System& system_) : ServiceFramework{system_, "usb:pd:c"} {} - RegisterHandlers(functions); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } private: @@ -202,61 +191,64 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, &IPdCradleManager::OpenCradleSession, "OpenCradleSession"} + ); }; class IPmMainService final : public ServiceFramework { public: - explicit IPmMainService(Core::System& system_) : ServiceFramework{system_, "usb:pm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetPowerEvent"}, - {1, nullptr, "GetPowerState"}, - {2, nullptr, "GetDataEvent"}, - {3, nullptr, "GetDataRole"}, - {4, nullptr, "SetDiagData"}, - {5, nullptr, "GetDiagData"}, - }; - // clang-format on + explicit IPmMainService(Core::System& system_) : ServiceFramework{system_, "usb:pm"} {} - RegisterHandlers(functions); + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetPowerEvent"}, + FunctionInfo{1, nullptr, "GetPowerState"}, + FunctionInfo{2, nullptr, "GetDataEvent"}, + FunctionInfo{3, nullptr, "GetDataRole"}, + FunctionInfo{4, nullptr, "SetDiagData"}, + FunctionInfo{5, nullptr, "GetDiagData"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IPdManufactureManager final : public ServiceFramework { public: - explicit IPdManufactureManager(Core::System& system_) : ServiceFramework{system_, "usb:pd:m"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "OpenManufactureSession"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit IPdManufactureManager(Core::System& system_) : ServiceFramework{system_, "usb:pd:m"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenManufactureSession"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IQdbManager final : public ServiceFramework { public: - explicit IQdbManager(Core::System& system_) : ServiceFramework{system_, "usb:qdb"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "ImportQuirkDevices"}, - {1, nullptr, "HasQuirk"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit IQdbManager(Core::System& system_) : ServiceFramework{system_, "usb:qdb"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "ImportQuirkDevices"}, + FunctionInfo{1, nullptr, "HasQuirk"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; class IPmObserverService final : public ServiceFramework { public: - explicit IPmObserverService(Core::System& system_) : ServiceFramework{system_, "usb:obsv"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetTopologyChangeEvent"}, - {1, nullptr, "GetFlattenedTopology"}, - }; - // clang-format on - RegisterHandlers(functions); + explicit IPmObserverService(Core::System& system_) : ServiceFramework{system_, "usb:obsv"} {} + + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetTopologyChangeEvent"}, + FunctionInfo{1, nullptr, "GetFlattenedTopology"} + ); + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } }; diff --git a/src/core/hle/service/vi/application_display_service.cpp b/src/core/hle/service/vi/application_display_service.cpp index f179ba676a..dcebb2eba9 100644 --- a/src/core/hle/service/vi/application_display_service.cpp +++ b/src/core/hle/service/vi/application_display_service.cpp @@ -17,38 +17,38 @@ namespace Service::VI { +std::optional IApplicationDisplayService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{100, C<&IApplicationDisplayService::GetRelayService>, "GetRelayService"}, + FunctionInfo{101, C<&IApplicationDisplayService::GetSystemDisplayService>, "GetSystemDisplayService"}, + FunctionInfo{102, C<&IApplicationDisplayService::GetManagerDisplayService>, "GetManagerDisplayService"}, + FunctionInfo{103, C<&IApplicationDisplayService::GetIndirectDisplayTransactionService>, "GetIndirectDisplayTransactionService"}, + FunctionInfo{1000, C<&IApplicationDisplayService::ListDisplays>, "ListDisplays"}, + FunctionInfo{1010, C<&IApplicationDisplayService::OpenDisplay>, "OpenDisplay"}, + FunctionInfo{1011, C<&IApplicationDisplayService::OpenDefaultDisplay>, "OpenDefaultDisplay"}, + FunctionInfo{1020, C<&IApplicationDisplayService::CloseDisplay>, "CloseDisplay"}, + FunctionInfo{1101, C<&IApplicationDisplayService::SetDisplayEnabled>, "SetDisplayEnabled"}, + FunctionInfo{1102, C<&IApplicationDisplayService::GetDisplayResolution>, "GetDisplayResolution"}, + FunctionInfo{2020, C<&IApplicationDisplayService::OpenLayer>, "OpenLayer"}, + FunctionInfo{2021, C<&IApplicationDisplayService::CloseLayer>, "CloseLayer"}, + FunctionInfo{2030, C<&IApplicationDisplayService::CreateStrayLayer>, "CreateStrayLayer"}, + FunctionInfo{2031, C<&IApplicationDisplayService::DestroyStrayLayer>, "DestroyStrayLayer"}, + FunctionInfo{2101, C<&IApplicationDisplayService::SetLayerScalingMode>, "SetLayerScalingMode"}, + FunctionInfo{2102, C<&IApplicationDisplayService::ConvertScalingMode>, "ConvertScalingMode"}, + FunctionInfo{2103, C<&IApplicationDisplayService::Cmd2103>, "Cmd2103"}, + FunctionInfo{2450, C<&IApplicationDisplayService::GetIndirectLayerImageMap>, "GetIndirectLayerImageMap"}, + FunctionInfo{2451, nullptr, "GetIndirectLayerImageCropMap"}, + FunctionInfo{2460, C<&IApplicationDisplayService::GetIndirectLayerImageRequiredMemoryInfo>, "GetIndirectLayerImageRequiredMemoryInfo"}, + FunctionInfo{5202, C<&IApplicationDisplayService::GetDisplayVsyncEvent>, "GetDisplayVsyncEvent"}, + FunctionInfo{5203, nullptr, "GetDisplayVsyncEventForDebug"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IApplicationDisplayService::IApplicationDisplayService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "IApplicationDisplayService"}, m_container{std::move(container)}, m_context{system, "IApplicationDisplayService"} { - // clang-format off - static const FunctionInfo functions[] = { - {100, C<&IApplicationDisplayService::GetRelayService>, "GetRelayService"}, - {101, C<&IApplicationDisplayService::GetSystemDisplayService>, "GetSystemDisplayService"}, - {102, C<&IApplicationDisplayService::GetManagerDisplayService>, "GetManagerDisplayService"}, - {103, C<&IApplicationDisplayService::GetIndirectDisplayTransactionService>, "GetIndirectDisplayTransactionService"}, - {1000, C<&IApplicationDisplayService::ListDisplays>, "ListDisplays"}, - {1010, C<&IApplicationDisplayService::OpenDisplay>, "OpenDisplay"}, - {1011, C<&IApplicationDisplayService::OpenDefaultDisplay>, "OpenDefaultDisplay"}, - {1020, C<&IApplicationDisplayService::CloseDisplay>, "CloseDisplay"}, - {1101, C<&IApplicationDisplayService::SetDisplayEnabled>, "SetDisplayEnabled"}, - {1102, C<&IApplicationDisplayService::GetDisplayResolution>, "GetDisplayResolution"}, - {2020, C<&IApplicationDisplayService::OpenLayer>, "OpenLayer"}, - {2021, C<&IApplicationDisplayService::CloseLayer>, "CloseLayer"}, - {2030, C<&IApplicationDisplayService::CreateStrayLayer>, "CreateStrayLayer"}, - {2031, C<&IApplicationDisplayService::DestroyStrayLayer>, "DestroyStrayLayer"}, - {2101, C<&IApplicationDisplayService::SetLayerScalingMode>, "SetLayerScalingMode"}, - {2102, C<&IApplicationDisplayService::ConvertScalingMode>, "ConvertScalingMode"}, - {2103, C<&IApplicationDisplayService::Cmd2103>, "Cmd2103"}, - {2450, C<&IApplicationDisplayService::GetIndirectLayerImageMap>, "GetIndirectLayerImageMap"}, - {2451, nullptr, "GetIndirectLayerImageCropMap"}, - {2460, C<&IApplicationDisplayService::GetIndirectLayerImageRequiredMemoryInfo>, "GetIndirectLayerImageRequiredMemoryInfo"}, - {5202, C<&IApplicationDisplayService::GetDisplayVsyncEvent>, "GetDisplayVsyncEvent"}, - {5203, nullptr, "GetDisplayVsyncEventForDebug"}, - }; - // clang-format on - - RegisterHandlers(functions); } IApplicationDisplayService::~IApplicationDisplayService() { diff --git a/src/core/hle/service/vi/application_display_service.h b/src/core/hle/service/vi/application_display_service.h index d2db391efd..0b5898ee56 100644 --- a/src/core/hle/service/vi/application_display_service.h +++ b/src/core/hle/service/vi/application_display_service.h @@ -74,8 +74,8 @@ public: s64 width, s64 height); private: + std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; - KernelHelpers::ServiceContext m_context; std::mutex m_lock{}; std::set m_open_layer_ids{}; diff --git a/src/core/hle/service/vi/application_root_service.cpp b/src/core/hle/service/vi/application_root_service.cpp index 7f35a048da..f12c564277 100644 --- a/src/core/hle/service/vi/application_root_service.cpp +++ b/src/core/hle/service/vi/application_root_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,14 +14,17 @@ namespace Service::VI { +std::optional IApplicationRootService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, C<&IApplicationRootService::GetDisplayService>, "GetDisplayService"}, + FunctionInfo{1, nullptr, "GetDisplayServiceWithProxyNameExchange"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IApplicationRootService::IApplicationRootService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "vi:u"}, m_container{std::move(container)} { - static const FunctionInfo functions[] = { - {0, C<&IApplicationRootService::GetDisplayService>, "GetDisplayService"}, - {1, nullptr, "GetDisplayServiceWithProxyNameExchange"}, - }; - RegisterHandlers(functions); } IApplicationRootService::~IApplicationRootService() = default; diff --git a/src/core/hle/service/vi/application_root_service.h b/src/core/hle/service/vi/application_root_service.h index 15aa4483d6..4deaa04f4c 100644 --- a/src/core/hle/service/vi/application_root_service.h +++ b/src/core/hle/service/vi/application_root_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -27,6 +30,7 @@ private: Policy policy); private: + std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/manager_display_service.cpp b/src/core/hle/service/vi/manager_display_service.cpp index e4d22ca11c..1b3b0f3379 100644 --- a/src/core/hle/service/vi/manager_display_service.cpp +++ b/src/core/hle/service/vi/manager_display_service.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -10,96 +10,96 @@ namespace Service::VI { +std::optional IManagerDisplayService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{200, nullptr, "AllocateProcessHeapBlock"}, + FunctionInfo{201, nullptr, "FreeProcessHeapBlock"}, + FunctionInfo{1102, nullptr, "GetDisplayResolution"}, + FunctionInfo{2010, C<&IManagerDisplayService::CreateManagedLayer>, "CreateManagedLayer"}, + FunctionInfo{2011, C<&IManagerDisplayService::DestroyManagedLayer>, "DestroyManagedLayer"}, + FunctionInfo{2012, nullptr, "CreateStrayLayer"}, + FunctionInfo{2050, nullptr, "CreateIndirectLayer"}, + FunctionInfo{2051, nullptr, "DestroyIndirectLayer"}, + FunctionInfo{2052, nullptr, "CreateIndirectProducerEndPoint"}, + FunctionInfo{2053, nullptr, "DestroyIndirectProducerEndPoint"}, + FunctionInfo{2054, nullptr, "CreateIndirectConsumerEndPoint"}, + FunctionInfo{2055, nullptr, "DestroyIndirectConsumerEndPoint"}, + FunctionInfo{2060, nullptr, "CreateWatermarkCompositor"}, + FunctionInfo{2062, nullptr, "SetWatermarkText"}, + FunctionInfo{2063, nullptr, "SetWatermarkLayerStacks"}, + FunctionInfo{2300, nullptr, "AcquireLayerTexturePresentingEvent"}, + FunctionInfo{2301, nullptr, "ReleaseLayerTexturePresentingEvent"}, + FunctionInfo{2302, nullptr, "GetDisplayHotplugEvent"}, + FunctionInfo{2303, nullptr, "GetDisplayModeChangedEvent"}, + FunctionInfo{2402, nullptr, "GetDisplayHotplugState"}, + FunctionInfo{2501, nullptr, "GetCompositorErrorInfo"}, + FunctionInfo{2601, nullptr, "GetDisplayErrorEvent"}, + FunctionInfo{2701, nullptr, "GetDisplayFatalErrorEvent"}, + FunctionInfo{4201, nullptr, "SetDisplayAlpha"}, + FunctionInfo{4203, nullptr, "SetDisplayLayerStack"}, + FunctionInfo{4205, nullptr, "SetDisplayPowerState"}, + FunctionInfo{4206, nullptr, "SetDefaultDisplay"}, + FunctionInfo{4207, nullptr, "ResetDisplayPanel"}, + FunctionInfo{4208, nullptr, "SetDisplayFatalErrorEnabled"}, + FunctionInfo{4209, nullptr, "IsDisplayPanelOn"}, + FunctionInfo{4300, nullptr, "GetInternalPanelId"}, + FunctionInfo{6000, C<&IManagerDisplayService::AddToLayerStack>, "AddToLayerStack"}, + FunctionInfo{6001, nullptr, "RemoveFromLayerStack"}, + FunctionInfo{6002, C<&IManagerDisplayService::SetLayerVisibility>, "SetLayerVisibility"}, + FunctionInfo{6003, nullptr, "SetLayerConfig"}, + FunctionInfo{6004, nullptr, "AttachLayerPresentationTracer"}, + FunctionInfo{6005, nullptr, "DetachLayerPresentationTracer"}, + FunctionInfo{6006, nullptr, "StartLayerPresentationRecording"}, + FunctionInfo{6007, nullptr, "StopLayerPresentationRecording"}, + FunctionInfo{6008, nullptr, "StartLayerPresentationFenceWait"}, + FunctionInfo{6009, nullptr, "StopLayerPresentationFenceWait"}, + FunctionInfo{6010, nullptr, "GetLayerPresentationAllFencesExpiredEvent"}, + FunctionInfo{6011, nullptr, "EnableLayerAutoClearTransitionBuffer"}, + FunctionInfo{6012, nullptr, "DisableLayerAutoClearTransitionBuffer"}, + FunctionInfo{6013, nullptr, "SetLayerOpacity"}, + FunctionInfo{6014, nullptr, "AttachLayerWatermarkCompositor"}, + FunctionInfo{6015, nullptr, "DetachLayerWatermarkCompositor"}, + FunctionInfo{7000, nullptr, "SetContentVisibility"}, + FunctionInfo{8000, nullptr, "SetConductorLayer"}, + FunctionInfo{8001, nullptr, "SetTimestampTracking"}, + FunctionInfo{8100, nullptr, "SetIndirectProducerFlipOffset"}, + FunctionInfo{8200, nullptr, "CreateSharedBufferStaticStorage"}, + FunctionInfo{8201, nullptr, "CreateSharedBufferTransferMemory"}, + FunctionInfo{8202, nullptr, "DestroySharedBuffer"}, + FunctionInfo{8203, nullptr, "BindSharedLowLevelLayerToManagedLayer"}, + FunctionInfo{8204, nullptr, "BindSharedLowLevelLayerToIndirectLayer"}, + FunctionInfo{8207, nullptr, "UnbindSharedLowLevelLayer"}, + FunctionInfo{8208, nullptr, "ConnectSharedLowLevelLayerToSharedBuffer"}, + FunctionInfo{8209, nullptr, "DisconnectSharedLowLevelLayerFromSharedBuffer"}, + FunctionInfo{8210, nullptr, "CreateSharedLayer"}, + FunctionInfo{8211, nullptr, "DestroySharedLayer"}, + FunctionInfo{8216, nullptr, "AttachSharedLayerToLowLevelLayer"}, + FunctionInfo{8217, nullptr, "ForceDetachSharedLayerFromLowLevelLayer"}, + FunctionInfo{8218, nullptr, "StartDetachSharedLayerFromLowLevelLayer"}, + FunctionInfo{8219, nullptr, "FinishDetachSharedLayerFromLowLevelLayer"}, + FunctionInfo{8220, nullptr, "GetSharedLayerDetachReadyEvent"}, + FunctionInfo{8221, nullptr, "GetSharedLowLevelLayerSynchronizedEvent"}, + FunctionInfo{8222, nullptr, "CheckSharedLowLevelLayerSynchronized"}, + FunctionInfo{8223, nullptr, "RegisterSharedBufferImporterAruid"}, + FunctionInfo{8224, nullptr, "UnregisterSharedBufferImporterAruid"}, + FunctionInfo{8227, nullptr, "CreateSharedBufferProcessHeap"}, + FunctionInfo{8228, nullptr, "GetSharedLayerLayerStacks"}, + FunctionInfo{8229, nullptr, "SetSharedLayerLayerStacks"}, + FunctionInfo{8291, nullptr, "PresentDetachedSharedFrameBufferToLowLevelLayer"}, + FunctionInfo{8292, nullptr, "FillDetachedSharedFrameBufferColor"}, + FunctionInfo{8293, nullptr, "GetDetachedSharedFrameBufferImage"}, + FunctionInfo{8294, nullptr, "SetDetachedSharedFrameBufferImage"}, + FunctionInfo{8295, nullptr, "CopyDetachedSharedFrameBufferImage"}, + FunctionInfo{8296, nullptr, "SetDetachedSharedFrameBufferSubImage"}, + FunctionInfo{8297, nullptr, "GetSharedFrameBufferContentParameter"}, + FunctionInfo{8298, nullptr, "ExpandStartupLogoOnSharedFrameBuffer"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IManagerDisplayService::IManagerDisplayService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "IManagerDisplayService"}, m_container{std::move(container)} { - // clang-format off - static const FunctionInfo functions[] = { - {200, nullptr, "AllocateProcessHeapBlock"}, - {201, nullptr, "FreeProcessHeapBlock"}, - {1102, nullptr, "GetDisplayResolution"}, - {2010, C<&IManagerDisplayService::CreateManagedLayer>, "CreateManagedLayer"}, - {2011, C<&IManagerDisplayService::DestroyManagedLayer>, "DestroyManagedLayer"}, - {2012, nullptr, "CreateStrayLayer"}, - {2050, nullptr, "CreateIndirectLayer"}, - {2051, nullptr, "DestroyIndirectLayer"}, - {2052, nullptr, "CreateIndirectProducerEndPoint"}, - {2053, nullptr, "DestroyIndirectProducerEndPoint"}, - {2054, nullptr, "CreateIndirectConsumerEndPoint"}, - {2055, nullptr, "DestroyIndirectConsumerEndPoint"}, - {2060, nullptr, "CreateWatermarkCompositor"}, - {2062, nullptr, "SetWatermarkText"}, - {2063, nullptr, "SetWatermarkLayerStacks"}, - {2300, nullptr, "AcquireLayerTexturePresentingEvent"}, - {2301, nullptr, "ReleaseLayerTexturePresentingEvent"}, - {2302, nullptr, "GetDisplayHotplugEvent"}, - {2303, nullptr, "GetDisplayModeChangedEvent"}, - {2402, nullptr, "GetDisplayHotplugState"}, - {2501, nullptr, "GetCompositorErrorInfo"}, - {2601, nullptr, "GetDisplayErrorEvent"}, - {2701, nullptr, "GetDisplayFatalErrorEvent"}, - {4201, nullptr, "SetDisplayAlpha"}, - {4203, nullptr, "SetDisplayLayerStack"}, - {4205, nullptr, "SetDisplayPowerState"}, - {4206, nullptr, "SetDefaultDisplay"}, - {4207, nullptr, "ResetDisplayPanel"}, - {4208, nullptr, "SetDisplayFatalErrorEnabled"}, - {4209, nullptr, "IsDisplayPanelOn"}, - {4300, nullptr, "GetInternalPanelId"}, - {6000, C<&IManagerDisplayService::AddToLayerStack>, "AddToLayerStack"}, - {6001, nullptr, "RemoveFromLayerStack"}, - {6002, C<&IManagerDisplayService::SetLayerVisibility>, "SetLayerVisibility"}, - {6003, nullptr, "SetLayerConfig"}, - {6004, nullptr, "AttachLayerPresentationTracer"}, - {6005, nullptr, "DetachLayerPresentationTracer"}, - {6006, nullptr, "StartLayerPresentationRecording"}, - {6007, nullptr, "StopLayerPresentationRecording"}, - {6008, nullptr, "StartLayerPresentationFenceWait"}, - {6009, nullptr, "StopLayerPresentationFenceWait"}, - {6010, nullptr, "GetLayerPresentationAllFencesExpiredEvent"}, - {6011, nullptr, "EnableLayerAutoClearTransitionBuffer"}, - {6012, nullptr, "DisableLayerAutoClearTransitionBuffer"}, - {6013, nullptr, "SetLayerOpacity"}, - {6014, nullptr, "AttachLayerWatermarkCompositor"}, - {6015, nullptr, "DetachLayerWatermarkCompositor"}, - {7000, nullptr, "SetContentVisibility"}, - {8000, nullptr, "SetConductorLayer"}, - {8001, nullptr, "SetTimestampTracking"}, - {8100, nullptr, "SetIndirectProducerFlipOffset"}, - {8200, nullptr, "CreateSharedBufferStaticStorage"}, - {8201, nullptr, "CreateSharedBufferTransferMemory"}, - {8202, nullptr, "DestroySharedBuffer"}, - {8203, nullptr, "BindSharedLowLevelLayerToManagedLayer"}, - {8204, nullptr, "BindSharedLowLevelLayerToIndirectLayer"}, - {8207, nullptr, "UnbindSharedLowLevelLayer"}, - {8208, nullptr, "ConnectSharedLowLevelLayerToSharedBuffer"}, - {8209, nullptr, "DisconnectSharedLowLevelLayerFromSharedBuffer"}, - {8210, nullptr, "CreateSharedLayer"}, - {8211, nullptr, "DestroySharedLayer"}, - {8216, nullptr, "AttachSharedLayerToLowLevelLayer"}, - {8217, nullptr, "ForceDetachSharedLayerFromLowLevelLayer"}, - {8218, nullptr, "StartDetachSharedLayerFromLowLevelLayer"}, - {8219, nullptr, "FinishDetachSharedLayerFromLowLevelLayer"}, - {8220, nullptr, "GetSharedLayerDetachReadyEvent"}, - {8221, nullptr, "GetSharedLowLevelLayerSynchronizedEvent"}, - {8222, nullptr, "CheckSharedLowLevelLayerSynchronized"}, - {8223, nullptr, "RegisterSharedBufferImporterAruid"}, - {8224, nullptr, "UnregisterSharedBufferImporterAruid"}, - {8227, nullptr, "CreateSharedBufferProcessHeap"}, - {8228, nullptr, "GetSharedLayerLayerStacks"}, - {8229, nullptr, "SetSharedLayerLayerStacks"}, - {8291, nullptr, "PresentDetachedSharedFrameBufferToLowLevelLayer"}, - {8292, nullptr, "FillDetachedSharedFrameBufferColor"}, - {8293, nullptr, "GetDetachedSharedFrameBufferImage"}, - {8294, nullptr, "SetDetachedSharedFrameBufferImage"}, - {8295, nullptr, "CopyDetachedSharedFrameBufferImage"}, - {8296, nullptr, "SetDetachedSharedFrameBufferSubImage"}, - {8297, nullptr, "GetSharedFrameBufferContentParameter"}, - {8298, nullptr, "ExpandStartupLogoOnSharedFrameBuffer"}, - }; - // clang-format on - - RegisterHandlers(functions); } IManagerDisplayService::~IManagerDisplayService() = default; diff --git a/src/core/hle/service/vi/manager_display_service.h b/src/core/hle/service/vi/manager_display_service.h index 14a107cb43..1c7a79f337 100644 --- a/src/core/hle/service/vi/manager_display_service.h +++ b/src/core/hle/service/vi/manager_display_service.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -37,6 +37,7 @@ public: Result SetLayerVisibility(bool visible, u64 layer_id); private: + std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/manager_root_service.cpp b/src/core/hle/service/vi/manager_root_service.cpp index 0f16a15b4a..0cc98bc2c0 100644 --- a/src/core/hle/service/vi/manager_root_service.cpp +++ b/src/core/hle/service/vi/manager_root_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -12,18 +15,21 @@ namespace Service::VI { +std::optional IManagerRootService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{2, C<&IManagerRootService::GetDisplayService>, "GetDisplayService"}, + FunctionInfo{3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, + FunctionInfo{100, nullptr, "PrepareFatal"}, + FunctionInfo{101, nullptr, "ShowFatal"}, + FunctionInfo{102, nullptr, "DrawFatalRectangle"}, + FunctionInfo{103, nullptr, "DrawFatalText32"} + ); + return HandlerTableGenerateWithFind(key, functions); +} + IManagerRootService::IManagerRootService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "vi:m"}, m_container{std::move(container)} { - static const FunctionInfo functions[] = { - {2, C<&IManagerRootService::GetDisplayService>, "GetDisplayService"}, - {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, - {100, nullptr, "PrepareFatal"}, - {101, nullptr, "ShowFatal"}, - {102, nullptr, "DrawFatalRectangle"}, - {103, nullptr, "DrawFatalText32"}, - }; - RegisterHandlers(functions); } IManagerRootService::~IManagerRootService() = default; diff --git a/src/core/hle/service/vi/manager_root_service.h b/src/core/hle/service/vi/manager_root_service.h index 77cd328699..78c0d1f80d 100644 --- a/src/core/hle/service/vi/manager_root_service.h +++ b/src/core/hle/service/vi/manager_root_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -26,6 +29,7 @@ public: Policy policy); private: + std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/shared_buffer_manager.h b/src/core/hle/service/vi/shared_buffer_manager.h index 807db10f31..d1ce57ee27 100644 --- a/src/core/hle/service/vi/shared_buffer_manager.h +++ b/src/core/hle/service/vi/shared_buffer_manager.h @@ -18,6 +18,10 @@ class KPageGroup; class KReadableEvent; } // namespace Kernel +namespace Core { +class System; +} + namespace Service::android { class BufferQueueProducer; } diff --git a/src/core/hle/service/vi/system_display_service.cpp b/src/core/hle/service/vi/system_display_service.cpp index 0956053dcf..997f0a51fc 100644 --- a/src/core/hle/service/vi/system_display_service.cpp +++ b/src/core/hle/service/vi/system_display_service.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project @@ -12,63 +12,63 @@ namespace Service::VI { -ISystemDisplayService::ISystemDisplayService(Core::System& system_, - std::shared_ptr container) - : ServiceFramework{system_, "ISystemDisplayService"}, m_container{std::move(container)} { - // clang-format off - static const FunctionInfo functions[] = { - {1200, nullptr, "GetZOrderCountMin"}, - {1202, nullptr, "GetZOrderCountMax"}, - {1203, nullptr, "GetDisplayLogicalResolution"}, - {1204, nullptr, "SetDisplayMagnification"}, - {2201, nullptr, "SetLayerPosition"}, - {2203, nullptr, "SetLayerSize"}, - {2204, C<&ISystemDisplayService::GetLayerZ>, "GetLayerZ"}, - {2205, C<&ISystemDisplayService::SetLayerZ>, "SetLayerZ"}, - {2207, C<&ISystemDisplayService::SetLayerVisibility>, "SetLayerVisibility"}, - {2209, nullptr, "SetLayerAlpha"}, - {2210, nullptr, "SetLayerPositionAndSize"}, - {2312, nullptr, "CreateStrayLayer"}, - {2400, nullptr, "OpenIndirectLayer"}, - {2401, nullptr, "CloseIndirectLayer"}, - {2402, nullptr, "FlipIndirectLayer"}, - {3000, C<&ISystemDisplayService::ListDisplayModes>, "ListDisplayModes"}, - {3001, nullptr, "ListDisplayRgbRanges"}, - {3002, nullptr, "ListDisplayContentTypes"}, - {3200, C<&ISystemDisplayService::GetDisplayMode>, "GetDisplayMode"}, - {3201, nullptr, "SetDisplayMode"}, - {3202, nullptr, "GetDisplayUnderscan"}, - {3203, nullptr, "SetDisplayUnderscan"}, - {3204, nullptr, "GetDisplayContentType"}, - {3205, nullptr, "SetDisplayContentType"}, - {3206, nullptr, "GetDisplayRgbRange"}, - {3207, nullptr, "SetDisplayRgbRange"}, - {3208, nullptr, "GetDisplayCmuMode"}, - {3209, nullptr, "SetDisplayCmuMode"}, - {3210, nullptr, "GetDisplayContrastRatio"}, - {3211, nullptr, "SetDisplayContrastRatio"}, - {3214, nullptr, "GetDisplayGamma"}, - {3215, nullptr, "SetDisplayGamma"}, - {3216, nullptr, "GetDisplayCmuLuma"}, - {3217, nullptr, "SetDisplayCmuLuma"}, - {3218, nullptr, "SetDisplayCrcMode"}, - {6013, nullptr, "GetLayerPresentationSubmissionTimestamps"}, - {8225, C<&ISystemDisplayService::GetSharedBufferMemoryHandleId>, "GetSharedBufferMemoryHandleId"}, - {8250, C<&ISystemDisplayService::OpenSharedLayer>, "OpenSharedLayer"}, - {8251, nullptr, "CloseSharedLayer"}, - {8252, C<&ISystemDisplayService::ConnectSharedLayer>, "ConnectSharedLayer"}, - {8253, nullptr, "DisconnectSharedLayer"}, - {8254, C<&ISystemDisplayService::AcquireSharedFrameBuffer>, "AcquireSharedFrameBuffer"}, - {8255, C<&ISystemDisplayService::PresentSharedFrameBuffer>, "PresentSharedFrameBuffer"}, - {8256, C<&ISystemDisplayService::GetSharedFrameBufferAcquirableEvent>, "GetSharedFrameBufferAcquirableEvent"}, - {8257, nullptr, "FillSharedFrameBufferColor"}, - {8258, C<&ISystemDisplayService::CancelSharedFrameBuffer>, "CancelSharedFrameBuffer"}, - {9000, nullptr, "GetDp2hdmiController"}, - }; - // clang-format on - RegisterHandlers(functions); +std::optional ISystemDisplayService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1200, nullptr, "GetZOrderCountMin"}, + FunctionInfo{1202, nullptr, "GetZOrderCountMax"}, + FunctionInfo{1203, nullptr, "GetDisplayLogicalResolution"}, + FunctionInfo{1204, nullptr, "SetDisplayMagnification"}, + FunctionInfo{2201, nullptr, "SetLayerPosition"}, + FunctionInfo{2203, nullptr, "SetLayerSize"}, + FunctionInfo{2204, C<&ISystemDisplayService::GetLayerZ>, "GetLayerZ"}, + FunctionInfo{2205, C<&ISystemDisplayService::SetLayerZ>, "SetLayerZ"}, + FunctionInfo{2207, C<&ISystemDisplayService::SetLayerVisibility>, "SetLayerVisibility"}, + FunctionInfo{2209, nullptr, "SetLayerAlpha"}, + FunctionInfo{2210, nullptr, "SetLayerPositionAndSize"}, + FunctionInfo{2312, nullptr, "CreateStrayLayer"}, + FunctionInfo{2400, nullptr, "OpenIndirectLayer"}, + FunctionInfo{2401, nullptr, "CloseIndirectLayer"}, + FunctionInfo{2402, nullptr, "FlipIndirectLayer"}, + FunctionInfo{3000, C<&ISystemDisplayService::ListDisplayModes>, "ListDisplayModes"}, + FunctionInfo{3001, nullptr, "ListDisplayRgbRanges"}, + FunctionInfo{3002, nullptr, "ListDisplayContentTypes"}, + FunctionInfo{3200, C<&ISystemDisplayService::GetDisplayMode>, "GetDisplayMode"}, + FunctionInfo{3201, nullptr, "SetDisplayMode"}, + FunctionInfo{3202, nullptr, "GetDisplayUnderscan"}, + FunctionInfo{3203, nullptr, "SetDisplayUnderscan"}, + FunctionInfo{3204, nullptr, "GetDisplayContentType"}, + FunctionInfo{3205, nullptr, "SetDisplayContentType"}, + FunctionInfo{3206, nullptr, "GetDisplayRgbRange"}, + FunctionInfo{3207, nullptr, "SetDisplayRgbRange"}, + FunctionInfo{3208, nullptr, "GetDisplayCmuMode"}, + FunctionInfo{3209, nullptr, "SetDisplayCmuMode"}, + FunctionInfo{3210, nullptr, "GetDisplayContrastRatio"}, + FunctionInfo{3211, nullptr, "SetDisplayContrastRatio"}, + FunctionInfo{3214, nullptr, "GetDisplayGamma"}, + FunctionInfo{3215, nullptr, "SetDisplayGamma"}, + FunctionInfo{3216, nullptr, "GetDisplayCmuLuma"}, + FunctionInfo{3217, nullptr, "SetDisplayCmuLuma"}, + FunctionInfo{3218, nullptr, "SetDisplayCrcMode"}, + FunctionInfo{6013, nullptr, "GetLayerPresentationSubmissionTimestamps"}, + FunctionInfo{8225, C<&ISystemDisplayService::GetSharedBufferMemoryHandleId>, "GetSharedBufferMemoryHandleId"}, + FunctionInfo{8250, C<&ISystemDisplayService::OpenSharedLayer>, "OpenSharedLayer"}, + FunctionInfo{8251, nullptr, "CloseSharedLayer"}, + FunctionInfo{8252, C<&ISystemDisplayService::ConnectSharedLayer>, "ConnectSharedLayer"}, + FunctionInfo{8253, nullptr, "DisconnectSharedLayer"}, + FunctionInfo{8254, C<&ISystemDisplayService::AcquireSharedFrameBuffer>, "AcquireSharedFrameBuffer"}, + FunctionInfo{8255, C<&ISystemDisplayService::PresentSharedFrameBuffer>, "PresentSharedFrameBuffer"}, + FunctionInfo{8256, C<&ISystemDisplayService::GetSharedFrameBufferAcquirableEvent>, "GetSharedFrameBufferAcquirableEvent"}, + FunctionInfo{8257, nullptr, "FillSharedFrameBufferColor"}, + FunctionInfo{8258, C<&ISystemDisplayService::CancelSharedFrameBuffer>, "CancelSharedFrameBuffer"}, + FunctionInfo{9000, nullptr, "GetDp2hdmiController"} + ); + return HandlerTableGenerateWithFind(key, functions); } +ISystemDisplayService::ISystemDisplayService(Core::System& system_, std::shared_ptr container) + : ServiceFramework{system_, "ISystemDisplayService"}, m_container{std::move(container)} +{} + ISystemDisplayService::~ISystemDisplayService() = default; Result ISystemDisplayService::GetLayerZ(Out out_z_value, u64 layer_id) { diff --git a/src/core/hle/service/vi/system_display_service.h b/src/core/hle/service/vi/system_display_service.h index a3b88c519d..04c9f0977e 100644 --- a/src/core/hle/service/vi/system_display_service.h +++ b/src/core/hle/service/vi/system_display_service.h @@ -47,6 +47,7 @@ private: Result CancelSharedFrameBuffer(u64 layer_id, s64 slot); private: + std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/system_root_service.cpp b/src/core/hle/service/vi/system_root_service.cpp index 3489727d81..c078be37a3 100644 --- a/src/core/hle/service/vi/system_root_service.cpp +++ b/src/core/hle/service/vi/system_root_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,15 +14,18 @@ namespace Service::VI { -ISystemRootService::ISystemRootService(Core::System& system_, std::shared_ptr container) - : ServiceFramework{system_, "vi:s"}, m_container{std::move(container)} { - static const FunctionInfo functions[] = { - {1, C<&ISystemRootService::GetDisplayService>, "GetDisplayService"}, - {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, - }; - RegisterHandlers(functions); +std::optional ISystemRootService::FindRequest(u32 key) { + static constexpr auto functions = CreateStaticMap( + FunctionInfo{1, C<&ISystemRootService::GetDisplayService>, "GetDisplayService"}, + FunctionInfo{3, nullptr, "GetDisplayServiceWithProxyNameExchange"} + ); + return HandlerTableGenerateWithFind(key, functions); } +ISystemRootService::ISystemRootService(Core::System& system_, std::shared_ptr container) + : ServiceFramework{system_, "vi:s"}, m_container{std::move(container)} +{} + ISystemRootService::~ISystemRootService() = default; Result ISystemRootService::GetDisplayService( diff --git a/src/core/hle/service/vi/system_root_service.h b/src/core/hle/service/vi/system_root_service.h index 9d5aa53d38..baf516fec5 100644 --- a/src/core/hle/service/vi/system_root_service.h +++ b/src/core/hle/service/vi/system_root_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -26,6 +29,7 @@ private: Out> out_application_display_service, Policy policy); + std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/wlan/wlan.cpp b/src/core/hle/service/wlan/wlan.cpp index bcd357d57a..fa68ff51ba 100644 --- a/src/core/hle/service/wlan/wlan.cpp +++ b/src/core/hle/service/wlan/wlan.cpp @@ -16,232 +16,248 @@ class ILocalManager final : public ServiceFramework { public: explicit ILocalManager(Core::System& system_) : ServiceFramework{system_, "wlan:lcl"} - { - static const FunctionInfo functions[] = { - { 0, nullptr, "OpenMasterMode" }, - { 0, nullptr, "OpenMode_2" }, - { 1, nullptr, "CloseMasterMode" }, - { 1, nullptr, "CloseMode_2" }, - { 2, nullptr, "OpenClientMode" }, - { 2, nullptr, "GetMacAddress_2" }, - { 3, nullptr, "CloseClientMode" }, - { 3, nullptr, "CreateBss" }, - { 4, nullptr, "OpenSpectatorMode" }, - { 4, nullptr, "DestroyBss" }, - { 5, nullptr, "CloseSpectatorMode" }, - { 5, nullptr, "StartScan_2" }, - { 6, nullptr, "GetMacAddress_2" }, - { 6, nullptr, "StopScan_2" }, - { 7, nullptr, "CreateBss" }, - { 7, nullptr, "Connect_2" }, - { 8, nullptr, "DestroyBss" }, - { 8, nullptr, "CancelConnect_2" }, - { 9, nullptr, "StartScan_2" }, - { 9, nullptr, "Join" }, - { 10, nullptr, "StopScan_2" }, - { 10, nullptr, "CancelJoin" }, - { 11, nullptr, "Connect_2" }, - { 11, nullptr, "Disconnect_2" }, - { 12, nullptr, "CancelConnect_2" }, - { 12, nullptr, "SetBeaconLostCount" }, - { 13, nullptr, "Join" }, - { 13, nullptr, "GetSystemEvent_2" }, - { 14, nullptr, "CancelJoin" }, - { 14, nullptr, "GetConnectionStatus_2" }, - { 15, nullptr, "Disconnect_2" }, - { 15, nullptr, "GetClientStatus" }, - { 16, nullptr, "SetBeaconLostCount" }, - { 16, nullptr, "GetBssIndicationEvent" }, - { 17, nullptr, "GetSystemEvent_2" }, - { 17, nullptr, "GetBssIndicationInfo" }, - { 18, nullptr, "GetConnectionStatus_2" }, - { 18, nullptr, "GetState_2" }, - { 19, nullptr, "GetClientStatus" }, - { 19, nullptr, "GetAllowedChannels" }, - { 20, nullptr, "GetBssIndicationEvent" }, - { 20, nullptr, "AddIe" }, - { 21, nullptr, "GetBssIndicationInfo" }, - { 21, nullptr, "DeleteIe" }, - { 22, nullptr, "GetState_2" }, - { 22, nullptr, "PutFrameRaw" }, - { 23, nullptr, "GetAllowedChannels" }, - { 23, nullptr, "CancelGetFrame" }, - { 24, nullptr, "AddIe" }, - { 24, nullptr, "CreateRxEntry" }, - { 25, nullptr, "DeleteIe" }, - { 25, nullptr, "DeleteRxEntry" }, - { 26, nullptr, "PutFrameRaw" }, - { 26, nullptr, "AddEthertypeToRxEntry" }, - { 27, nullptr, "CancelGetFrame" }, - { 27, nullptr, "DeleteEthertypeFromRxEntry" }, - { 28, nullptr, "CreateRxEntry" }, - { 28, nullptr, "AddMatchingDataToRxEntry" }, - { 29, nullptr, "DeleteRxEntry" }, - { 29, nullptr, "RemoveMatchingDataFromRxEntry" }, - { 30, nullptr, "AddEthertypeToRxEntry" }, - { 30, nullptr, "GetScanResult_2" }, - { 31, nullptr, "DeleteEthertypeFromRxEntry" }, - { 31, nullptr, "PutActionFrameOneShot" }, - { 32, nullptr, "AddMatchingDataToRxEntry" }, - { 32, nullptr, "SetActionFrameWithBeacon" }, - { 33, nullptr, "RemoveMatchingDataFromRxEntry" }, - { 33, nullptr, "CancelActionFrameWithBeacon" }, - { 34, nullptr, "GetScanResult_2" }, - { 34, nullptr, "CreateRxEntryForActionFrame" }, - { 35, nullptr, "PutActionFrameOneShot" }, - { 35, nullptr, "DeleteRxEntryForActionFrame" }, - { 36, nullptr, "SetActionFrameWithBeacon" }, - { 36, nullptr, "AddSubtypeToRxEntryForActionFrame" }, - { 37, nullptr, "CancelActionFrameWithBeacon" }, - { 37, nullptr, "DeleteSubtypeFromRxEntryForActionFrame" }, - { 38, nullptr, "CreateRxEntryForActionFrame" }, - { 38, nullptr, "CancelGetActionFrame" }, - { 39, nullptr, "DeleteRxEntryForActionFrame" }, - { 39, nullptr, "GetRssi_2" }, - { 40, nullptr, "AddSubtypeToRxEntryForActionFrame" }, - { 40, nullptr, "SetMaxAssociationNumber" }, - { 41, nullptr, "DeleteSubtypeFromRxEntryForActionFrame" }, - { 41, nullptr, "Cmd41" }, - { 42, nullptr, "CancelGetActionFrame" }, - { 42, nullptr, "Cmd42" }, - { 43, nullptr, "GetRssi_2" }, - { 43, nullptr, "Cmd43" }, - { 44, nullptr, "SetMaxAssociationNumber" }, - { 45, nullptr, "OpenLcsMasterMode" }, - { 46, nullptr, "CloseLcsMasterMode" }, - { 47, nullptr, "OpenLcsClientMode" }, - { 48, nullptr, "CloseLcsClientMode" }, - { 49, nullptr, "GetChannelStats" }, - { 50, nullptr, "Cmd50" }, - { 51, nullptr, "Cmd51" }, - { 52, nullptr, "Cmd52" }, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "OpenMasterMode"}, + FunctionInfo{0, nullptr, "OpenMode_2"}, + FunctionInfo{1, nullptr, "CloseMasterMode"}, + FunctionInfo{1, nullptr, "CloseMode_2"}, + FunctionInfo{2, nullptr, "OpenClientMode"}, + FunctionInfo{2, nullptr, "GetMacAddress_2"}, + FunctionInfo{3, nullptr, "CloseClientMode"}, + FunctionInfo{3, nullptr, "CreateBss"}, + FunctionInfo{4, nullptr, "OpenSpectatorMode"}, + FunctionInfo{4, nullptr, "DestroyBss"}, + FunctionInfo{5, nullptr, "CloseSpectatorMode"}, + FunctionInfo{5, nullptr, "StartScan_2"}, + FunctionInfo{6, nullptr, "GetMacAddress_2"}, + FunctionInfo{6, nullptr, "StopScan_2"}, + FunctionInfo{7, nullptr, "CreateBss"}, + FunctionInfo{7, nullptr, "Connect_2"}, + FunctionInfo{8, nullptr, "DestroyBss"}, + FunctionInfo{8, nullptr, "CancelConnect_2"}, + FunctionInfo{9, nullptr, "StartScan_2"}, + FunctionInfo{9, nullptr, "Join"}, + FunctionInfo{10, nullptr, "StopScan_2"}, + FunctionInfo{10, nullptr, "CancelJoin"}, + FunctionInfo{11, nullptr, "Connect_2"}, + FunctionInfo{11, nullptr, "Disconnect_2"}, + FunctionInfo{12, nullptr, "CancelConnect_2"}, + FunctionInfo{12, nullptr, "SetBeaconLostCount"}, + FunctionInfo{13, nullptr, "Join"}, + FunctionInfo{13, nullptr, "GetSystemEvent_2"}, + FunctionInfo{14, nullptr, "CancelJoin"}, + FunctionInfo{14, nullptr, "GetConnectionStatus_2"}, + FunctionInfo{15, nullptr, "Disconnect_2"}, + FunctionInfo{15, nullptr, "GetClientStatus"}, + FunctionInfo{16, nullptr, "SetBeaconLostCount"}, + FunctionInfo{16, nullptr, "GetBssIndicationEvent"}, + FunctionInfo{17, nullptr, "GetSystemEvent_2"}, + FunctionInfo{17, nullptr, "GetBssIndicationInfo"}, + FunctionInfo{18, nullptr, "GetConnectionStatus_2"}, + FunctionInfo{18, nullptr, "GetState_2"}, + FunctionInfo{19, nullptr, "GetClientStatus"}, + FunctionInfo{19, nullptr, "GetAllowedChannels"}, + FunctionInfo{20, nullptr, "GetBssIndicationEvent"}, + FunctionInfo{20, nullptr, "AddIe"}, + FunctionInfo{21, nullptr, "GetBssIndicationInfo"}, + FunctionInfo{21, nullptr, "DeleteIe"}, + FunctionInfo{22, nullptr, "GetState_2"}, + FunctionInfo{22, nullptr, "PutFrameRaw"}, + FunctionInfo{23, nullptr, "GetAllowedChannels"}, + FunctionInfo{23, nullptr, "CancelGetFrame"}, + FunctionInfo{24, nullptr, "AddIe"}, + FunctionInfo{24, nullptr, "CreateRxEntry"}, + FunctionInfo{25, nullptr, "DeleteIe"}, + FunctionInfo{25, nullptr, "DeleteRxEntry"}, + FunctionInfo{26, nullptr, "PutFrameRaw"}, + FunctionInfo{26, nullptr, "AddEthertypeToRxEntry"}, + FunctionInfo{27, nullptr, "CancelGetFrame"}, + FunctionInfo{27, nullptr, "DeleteEthertypeFromRxEntry"}, + FunctionInfo{28, nullptr, "CreateRxEntry"}, + FunctionInfo{28, nullptr, "AddMatchingDataToRxEntry"}, + FunctionInfo{29, nullptr, "DeleteRxEntry"}, + FunctionInfo{29, nullptr, "RemoveMatchingDataFromRxEntry"}, + FunctionInfo{30, nullptr, "AddEthertypeToRxEntry"}, + FunctionInfo{30, nullptr, "GetScanResult_2"}, + FunctionInfo{31, nullptr, "DeleteEthertypeFromRxEntry"}, + FunctionInfo{31, nullptr, "PutActionFrameOneShot"}, + FunctionInfo{32, nullptr, "AddMatchingDataToRxEntry"}, + FunctionInfo{32, nullptr, "SetActionFrameWithBeacon"}, + FunctionInfo{33, nullptr, "RemoveMatchingDataFromRxEntry"}, + FunctionInfo{33, nullptr, "CancelActionFrameWithBeacon"}, + FunctionInfo{34, nullptr, "GetScanResult_2"}, + FunctionInfo{34, nullptr, "CreateRxEntryForActionFrame"}, + FunctionInfo{35, nullptr, "PutActionFrameOneShot"}, + FunctionInfo{35, nullptr, "DeleteRxEntryForActionFrame"}, + FunctionInfo{36, nullptr, "SetActionFrameWithBeacon"}, + FunctionInfo{36, nullptr, "AddSubtypeToRxEntryForActionFrame"}, + FunctionInfo{37, nullptr, "CancelActionFrameWithBeacon"}, + FunctionInfo{37, nullptr, "DeleteSubtypeFromRxEntryForActionFrame"}, + FunctionInfo{38, nullptr, "CreateRxEntryForActionFrame"}, + FunctionInfo{38, nullptr, "CancelGetActionFrame"}, + FunctionInfo{39, nullptr, "DeleteRxEntryForActionFrame"}, + FunctionInfo{39, nullptr, "GetRssi_2"}, + FunctionInfo{40, nullptr, "AddSubtypeToRxEntryForActionFrame"}, + FunctionInfo{40, nullptr, "SetMaxAssociationNumber"}, + FunctionInfo{41, nullptr, "DeleteSubtypeFromRxEntryForActionFrame"}, + FunctionInfo{41, nullptr, "Cmd41"}, + FunctionInfo{42, nullptr, "CancelGetActionFrame"}, + FunctionInfo{42, nullptr, "Cmd42"}, + FunctionInfo{43, nullptr, "GetRssi_2"}, + FunctionInfo{43, nullptr, "Cmd43"}, + FunctionInfo{44, nullptr, "SetMaxAssociationNumber"}, + FunctionInfo{45, nullptr, "OpenLcsMasterMode"}, + FunctionInfo{46, nullptr, "CloseLcsMasterMode"}, + FunctionInfo{47, nullptr, "OpenLcsClientMode"}, + FunctionInfo{48, nullptr, "CloseLcsClientMode"}, + FunctionInfo{49, nullptr, "GetChannelStats"}, + FunctionInfo{50, nullptr, "Cmd50"}, + FunctionInfo{51, nullptr, "Cmd51"}, + FunctionInfo{52, nullptr, "Cmd52"} + ); }; class ILocalGetFrame final : public ServiceFramework { public: explicit ILocalGetFrame(Core::System& system_) : ServiceFramework{system_, "wlan:lg"} - { - static const FunctionInfo functions[] = { - { 0, nullptr, "GetFrameRaw" }, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetFrameRaw" } + ); }; class ILocalGetActionFrame final : public ServiceFramework { public: explicit ILocalGetActionFrame(Core::System& system_) : ServiceFramework{system_, "wlan:lga"} - { - static const FunctionInfo functions[] = { - { 0, nullptr, "GetActionFrame" }, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetActionFrame" } + ); }; class ISocketGetFrame final : public ServiceFramework { public: explicit ISocketGetFrame(Core::System& system_) : ServiceFramework{system_, "wlan:sg"} - { - static const FunctionInfo functions[] = { - { 0, nullptr, "GetFrameRaw" }, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "GetFrameRaw" } + ); }; class ISocketManager final : public ServiceFramework { public: explicit ISocketManager(Core::System& system_) : ServiceFramework{system_, "wlan:soc"} - { - static const FunctionInfo functions[] = { - { 0, nullptr, "PutFrameRaw_2" }, - { 1, nullptr, "CancelGetFrame_2" }, - { 2, nullptr, "CreateRxEntry_2" }, - { 3, nullptr, "DeleteRxEntry_2" }, - { 4, nullptr, "AddEthertypeToRxEntry_2" }, - { 5, nullptr, "DeleteEthertypeFromRxEntry_2" }, - { 6, nullptr, "GetMacAddress_3" }, - { 7, nullptr, "SwitchTsfTimerFunction" }, - { 8, nullptr, "GetDeltaTimeBetweenSystemAndTsf" }, - { 9, nullptr, "RegisterSharedMemory" }, - { 10, nullptr, "UnregisterSharedMemory" }, - { 11, nullptr, "EnableSharedMemory" }, - { 12, nullptr, "SetMulticastFilter" }, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "PutFrameRaw_2"}, + FunctionInfo{1, nullptr, "CancelGetFrame_2"}, + FunctionInfo{2, nullptr, "CreateRxEntry_2"}, + FunctionInfo{3, nullptr, "DeleteRxEntry_2"}, + FunctionInfo{4, nullptr, "AddEthertypeToRxEntry_2"}, + FunctionInfo{5, nullptr, "DeleteEthertypeFromRxEntry_2"}, + FunctionInfo{6, nullptr, "GetMacAddress_3"}, + FunctionInfo{7, nullptr, "SwitchTsfTimerFunction"}, + FunctionInfo{8, nullptr, "GetDeltaTimeBetweenSystemAndTsf"}, + FunctionInfo{9, nullptr, "RegisterSharedMemory"}, + FunctionInfo{10, nullptr, "UnregisterSharedMemory"}, + FunctionInfo{11, nullptr, "EnableSharedMemory"}, + FunctionInfo{12, nullptr, "SetMulticastFilter"} + ); }; class IDetectManager final : public ServiceFramework { public: explicit IDetectManager(Core::System& system_) : ServiceFramework{system_, "wlan:dtc"} - { - static const FunctionInfo functions[] = { - { 0, nullptr, "Cmd0" }, - { 1, nullptr, "Cmd1" }, - { 2, nullptr, "Cmd2" }, - { 3, nullptr, "Cmd3" }, - { 4, nullptr, "Cmd4" }, - { 5, nullptr, "Cmd5" }, - { 6, nullptr, "Cmd6" }, - { 7, nullptr, "Cmd7" }, - { 8, nullptr, "Cmd8" }, - { 9, nullptr, "Cmd9" }, - { 10, nullptr, "Cmd10" }, - { 11, nullptr, "Cmd11" }, - { 12, nullptr, "Cmd12" }, - { 13, nullptr, "Cmd13" }, - { 14, nullptr, "Cmd14" }, - { 15, nullptr, "Cmd15" }, - { 16, nullptr, "Cmd16" }, - { 17, nullptr, "Cmd17" }, - { 18, nullptr, "Cmd18" }, - { 19, nullptr, "Cmd19" }, - { 20, nullptr, "Cmd20" }, - { 21, nullptr, "Cmd21" }, - { 22, nullptr, "Cmd22" }, - { 23, nullptr, "Cmd23" }, - { 24, nullptr, "Cmd24" }, - { 25, nullptr, "Cmd25" }, - { 26, nullptr, "Cmd26" }, - { 27, nullptr, "Cmd27" }, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "Cmd0"}, + FunctionInfo{1, nullptr, "Cmd1"}, + FunctionInfo{2, nullptr, "Cmd2"}, + FunctionInfo{3, nullptr, "Cmd3"}, + FunctionInfo{4, nullptr, "Cmd4"}, + FunctionInfo{5, nullptr, "Cmd5"}, + FunctionInfo{6, nullptr, "Cmd6"}, + FunctionInfo{7, nullptr, "Cmd7"}, + FunctionInfo{8, nullptr, "Cmd8"}, + FunctionInfo{9, nullptr, "Cmd9"}, + FunctionInfo{10, nullptr, "Cmd10"}, + FunctionInfo{11, nullptr, "Cmd11"}, + FunctionInfo{12, nullptr, "Cmd12"}, + FunctionInfo{13, nullptr, "Cmd13"}, + FunctionInfo{14, nullptr, "Cmd14"}, + FunctionInfo{15, nullptr, "Cmd15"}, + FunctionInfo{16, nullptr, "Cmd16"}, + FunctionInfo{17, nullptr, "Cmd17"}, + FunctionInfo{18, nullptr, "Cmd18"}, + FunctionInfo{19, nullptr, "Cmd19"}, + FunctionInfo{20, nullptr, "Cmd20"}, + FunctionInfo{21, nullptr, "Cmd21"}, + FunctionInfo{22, nullptr, "Cmd22"}, + FunctionInfo{23, nullptr, "Cmd23"}, + FunctionInfo{24, nullptr, "Cmd24"}, + FunctionInfo{25, nullptr, "Cmd25"}, + FunctionInfo{26, nullptr, "Cmd26"}, + FunctionInfo{27, nullptr, "Cmd27"} + ); }; class IPrivateServiceCreator final : public ServiceFramework { public: explicit IPrivateServiceCreator(Core::System& system_) : ServiceFramework{system_, "wlan:p"} - { - static const FunctionInfo functions[] = { - { 0, nullptr, "CreateWirelessCommunicationService" }, - { 1, nullptr, "CreatePrivateWirelessCommunicationService" }, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateWirelessCommunicationService"}, + FunctionInfo{1, nullptr, "CreatePrivateWirelessCommunicationService"} + ); }; class ISfDriverServiceCreator final : public ServiceFramework { public: explicit ISfDriverServiceCreator(Core::System& system_) : ServiceFramework{system_, "wlan:nd"} - { - static const FunctionInfo functions[] = { - { 0, nullptr, "CreateDriverService" }, - }; - RegisterHandlers(functions); + {} + + std::optional FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); } + static constexpr auto functions = CreateStaticMap( + FunctionInfo{0, nullptr, "CreateDriverService" } + ); }; void LoopProcess(Core::System& system) { diff --git a/tools/README.md b/tools/README.md index cde6a21464..f6a520a69c 100644 --- a/tools/README.md +++ b/tools/README.md @@ -8,7 +8,7 @@ Tools for Eden and other subprojects. When adding new scripts please use `#!/bin ## Binaries -- `maxwell-spirv`: Converts Maxwell shaders (dumped from `.ash` files) into SPIR-V code (emitted into STDOUT). +- `maxwell-spirv`: Converts Maxwell shaders (dumped from `.ash` files) into SPIR-V code sent to stdout. - `maxwell-disas`: Dumb raw Maxwell disassembler. - `maxwell-ir`: Dump generated IR of Maxwell shaders. From 6b3cb5772b6e4875f088e5b48e089a3b3fda7f0d Mon Sep 17 00:00:00 2001 From: crueter Date: Tue, 13 Oct 2026 23:54:51 +0200 Subject: [PATCH 176/198] [docs] revise AI policy (#4522) spent 2 hours on a document award This is a revised version of our original AI policy that is cautiously permissive to skilled developers using AI responsibly, while hopefully keeping out the script kiddies spamming their mom's credit card on Claude tokens. This will be trialed for at least a week once merged, any revisions/changes should be made within the next few months Signed-off-by: crueter - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4522 Reviewed-by: lizzie Reviewed-by: MaranBr --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- AGENTS.md | 8 +- CLAUDE.md | 1 - CONTRIBUTING.md | 7 +- docs/policies/AI.md | 199 ++++++++++++++++++++++--------- 5 files changed, 152 insertions(+), 65 deletions(-) delete mode 100644 CLAUDE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8d42a0ab27..422efb5fdc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ - [ ] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). -- [ ] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) +- [ ] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [ ] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- diff --git a/AGENTS.md b/AGENTS.md index aabea77170..05ab7f1160 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1 +1,7 @@ -AI and LLM use is *strictly* prohibited within our codebase and surrounding community, including issues and comments. This includes using AI or LLMs to write docs/commit messages, debug issues, brainstorm ideas, research concepts, or search the codebase. +# AGENTS + +Read and follow the AI policy found in `docs/policies/AI.md`, and the coding policies found in `docs/policies/Coding.md`. + +Do not, under any circumstances, ever submit PRs or push commits on behalf of the user. + +Keep comments to a reasonable level. Do not overexplain or add/remove comments from unrelated parts of the codebase. diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index aabea77170..0000000000 --- a/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -AI and LLM use is *strictly* prohibited within our codebase and surrounding community, including issues and comments. This includes using AI or LLMs to write docs/commit messages, debug issues, brainstorm ideas, research concepts, or search the codebase. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c09b1c3679..8c16de9ddb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,5 @@ # Contributing - - Eden has lots of different ways that you can contribute to its efforts, even without knowing how to write code: - Donate! This will help us live our lives, pay for infrastructure/testing hardware, and more @@ -20,8 +16,7 @@ Eden is free, open-source, copyleft software, licensed under the terms of the [G ### Policies -- No LLM or AI usage, *period*, for patches, pull requests, issues, comments, debugging, brainstorming, etc. - - For details on why, see the [detailed AI policy](docs/policies/AI.md). +- We are trialing a slightly relaxed AI policy to allow high-quality contributors to use AI *responsibly*. Please read our [detailed AI policy](docs/policies/AI.md) for more info. - Usage of any form of profanity or otherwise unsavory language is generally discouraged. - This is primarily because it rarely helps to actually understand what's going on. - Remember that your comments should be focused and actually address what's happening. With very few exceptions, expletives are actively detrimental at best. diff --git a/docs/policies/AI.md b/docs/policies/AI.md index 554a805331..dd4b4a7fb2 100644 --- a/docs/policies/AI.md +++ b/docs/policies/AI.md @@ -1,65 +1,159 @@ # AI Policy -AI and LLM use is *strictly* prohibited within our codebase and surrounding community, including issues and comments. This includes using AI or LLMs to write docs/commit messages, debug issues, brainstorm ideas, research concepts, or search the codebase. +> [!WARNING] +> We are trialing a slightly relaxed AI policy to allow high-quality contributors to use AI *responsibly*. +> This policy is subject to change at any point in time, so check back frequently. +> +> This banner will be removed once we have finalized our revised policy. - [AI Policy](#ai-policy) - - [Low-quality code](#low-quality-code) - - [Licensing concerns](#licensing-concerns) - - [Vibe-coding](#vibe-coding) - - [Commit messages](#commit-messages) - - [Miscellaneous concerns](#miscellaneous-concerns) - - [Unacceptable Use Examples](#unacceptable-use-examples) - - [Addendum: Commit Messages](#addendum-commit-messages) + - [TL;DR](#tldr) + - [Definitions](#definitions) + - [Scope](#scope) + - [Introduction](#introduction) + - [Requirements](#requirements) + - [Sign-off, Authorship, and Copyright](#sign-off-authorship-and-copyright) + - [Permitted Usage](#permitted-usage) + - [Recommended Prior Discussion](#recommended-prior-discussion) + - [Forbidden Usage](#forbidden-usage) + - [Human Effort Denial of Service](#human-effort-denial-of-service) + - [Disclosure](#disclosure) + - [Codebase Ingestion](#codebase-ingestion) + - [Enforcement](#enforcement) + - [Addendum: AI Commit Messages](#addendum-ai-commit-messages) + - [References](#references) -## Low-quality code +## TL;DR -AI is notorious for producing low-quality code; be it: +AI-assisted contributions are welcome, provided you take responsibility for them. -- nonfunctional, -- verbose/inefficient, -- breaking other parts of the codebase, -- or writing/architecting in a completely different style +- You **must** disclose any AI or LLM usage in your pull request description *and* commit message. +- You **must** be able to explain, defend, and revise every line of code you submit. +- Commit messages, PR descriptions, issues, and comments **must** be written by you. Verbatim AI output is not acceptable. +- Undisclosed AI usage will result in your contribution being rejected. +- Low-quality contributions, disclosed or not, will be reworked or rejected. +- Spamming automated PRs, comments, or issues is treated as a Denial of Service (DoS) attack on our reviewers; see [Human Effort Denial of Service](#human-effort-denial-of-service). -All code, AI or not, is held under a **strict standard of excellence**. AI/LLM-generated code will fail this test 10 times out of 10. +## Definitions -## Licensing concerns +An *AI or LLM-based tool* is any piece of software that generates code, text, or other content through machine learning models. This includes, but is not limited to: chat assistants, agentic coding tools/harnesses, inline code completion suggestions you have accepted into the code, and AI-driven explanation/refactoring features. -This is an area of ongoing litigation, and as such, is still very iffy. For the time being, know that allowing AI to ingest the codebase may end up with its copyleft code regurgitated into incompatibly-licensed proprietary or permissive software. For you, this means to **not** feed code into LLMs. +For the purposes of this policy, basic deterministic/static development tools (such as clang-tidy, git, compilers, etc.) are not considered AI tools. -AI models may have also ingested AGPLv3 code, which is license-incompatible with our codebase. +Terms such as "substantially", "large-scale", "majority", and "low-quality" are intentionally left vague, and will be interpreted at the maintainers' discretion. When in doubt, ask first. -## Vibe-coding +## Scope -Just don't. If you're not going to put the effort in to understand every line of code you wrote, neither will we, and your patch or pull request will be ignored. +This policy applies to all code contributions, alongside issues and pull requests surrounding this codebase. This includes: -## Commit messages +- Commit messages +- PR descriptions +- Code review comments +- Issue/PR comments +- Patches submitted via e-mail -AI-generated commit messages are absolutely terrible, and your pull request or patch will immediately be rejected if you choose to do this. They are, quite simply, actively detrimental to our understanding of your changes, and if you're not willing to summarize the intent behind your changes, then we're not going to bother reading the code you wrote. +Areas that are not directly related to code--such as our surrounding communities--are not covered by the terms of this policy. Additionally, spelling/grammar checking via AI or LLM-based tools is not covered under this document. -Write concise, simple, and descriptive commit messages that actually convey the proper intent behind what your change is trying to do. +## Introduction -See the [Addendum](#addendum-commit-messages) for an instance of how bad AI models are at commit messages. +In the right hands, AI and LLM-based tools are incredibly useful for getting features and bugfixes out the door as fast as possible. At the same time, reviewer bandwidth is a scarce resource. We are therefore open to AI-assisted contributions, provided they are produced and disclosed properly. -## Miscellaneous concerns +The goal of this document is *not* to set arbitrary restrictions, but rather to keep our development healthy and stable, while still allowing contributors to use the tools they find helpful. A contribution must be worth more to the project than the time it takes to review it. -- While many environmental concerns about AI are typically blown out of proportion, it *is* a legitimate issue, and should be taken into account. -- Many people have significant concerns over the ethics of AI usage due to inhumane and predatory behavior by large AI companies, particularly Anthropic and OpenAI. This can technically be avoided through the usage of local LLMs. -- LLMs have a tendency to add unicode characters (such as the arrow → and the em-dash — symbols) to their output, which can make viewing code or documents harder on command-line editors and viewers. -- Dedicated coding models--namely Claude--also like to add a lot of comments to overexplain every individual line of code it produces. This actually makes it *harder* to understand the code! +Throughout this document, **must** and **must not** are inflexible, binding requirements. Refusal to follow these is treated as a violation of the terms outlined in this document. -## Unacceptable Use Examples +## Requirements -Here are a few examples of unacceptable use: +These apply to all contributions, whether AI-assisted or not. AI-assisted contributions also carry additional disclosure requirements as outlined in [Disclosure](#disclosure). -- Solving problems - - Slapping a few files and a "please fix bug XYZ" into an LLM is a recipe for disaster that will pretty much never work. -- Fully AI-generated code, aka "vibecoding" -- Writing code based on pseudo-instructions - - If you don't know how to write code, don't. If you've figured out the root cause (preferably without feeding random files into an LLM) and actively know what's going on, provide information to other developers or friends of yours who have knowledge of the language and/or the codebase. +1. *Disclosure*. Any and all usage of AI or LLM-based tools within any contribution **must** be explicitly marked and disclosed as appropriate. +2. *Responsibility*. The human submitter of any contribution is held wholly responsible for the accuracy, completeness, and intent of what is submitted. You **must** be able to explain, defend, and revise your code during review. +3. *Review*. All code **must** be thoroughly reviewed by the author before opening a PR or marking it ready for review. +4. *Testing*. All code changes **must** be tested directly by the human author. +5. *Quality*. All submitted code is held to a strict standard of excellence. Low-quality AI-generated content does not uphold this standard. +6. *Licensing*. All code **must** be compatible with the GPLv3 or later. You **must** warrant that you have the right to submit it under those terms, and that it was not copied from work published under an incompatible license. -## Addendum: Commit Messages +## Sign-off, Authorship, and Copyright -The patchset for pull request [#3422](https://git.eden-emu.dev/eden-emu/eden/pulls/3422) was fed into several LLMs to generate a commit message. One LLM produced the following: +AI agents **must not** add `Signed-off-by:` tags. The human submitter **must** sign off on all changes. + +Similarly, AI agents cannot hold authorship or copyright over code, and **must not** add `Co-authored-by:` or `Co-developed-by:` tags. The human submitter **must** author all changes. + +## Permitted Usage + +This is a non-exhaustive list of permitted uses of AI and LLM-based tools, provided they are disclosed properly. + +- Drafting issues and pull requests, provided the final text and submitted code are substantially your own. +- Debugging issues, bugs, glitches, and crashes, whether pre-existing or introduced by your own changes. +- Reviewing your own changes before submitting a PR. +- Research, brainstorming, and codebase searching/understanding. +- Applying tedious but not particularly large changes, such as mass-migrating specific classes to polyfills or abstractions. + +## Recommended Prior Discussion + +Some usage cases are not necessarily forbidden nor permitted. These should be discussed with maintainers in an issue or e-mail *before* submission. Maintainers and reviewers may also comment on this during the review/submission phase. + +- Generating boilerplate/scaffolding for new code. +- Writing unit tests. +- Large-scale refactors primarily driven by an AI agent. +- Any contribution where an AI agent or model was responsible for the majority of the implementation. + +## Forbidden Usage + +This is a non-exhaustive list of strictly forbidden uses of AI and LLM-based tools. + +- Vibecoding, or changes entirely authored by AI agents without human intervention or understanding. + - If you don't choose to put in the necessary effort to understand every line of code you submitted, neither will we. +- Fully AI-generated commit messages, PR descriptions, issues, or comments. See [Addendum: AI Commit Messages](#addendum-ai-commit-messages). +- Submission of AI-assisted work that is not disclosed per the [Disclosure](#disclosure) requirements. +- Low-quality submissions that fail to satisfy our standard of code excellence. +- Submitting secrets, credentials, private user data, or unpublished security reports to third-party AI services. + - This includes console keys, encryption material, and private vulnerability disclosures. +- Verbatim AI code reviews (e.g. Codex/Copilot reviews). + +## Human Effort Denial of Service + +Using automated tools and AI to submit PRs, issues, and comments that we have to carefully review and handle is considered a [Denial-of-service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) on our human effort. + +It takes very little effort on your side (an LLM prompt) to generate a large amount of effort on ours (careful and thorough code review). Please respect our time and don't do that. + +## Disclosure + +How you disclose AI usage is up to you. However, it **must** be explicit, easy to identify, and placed both within the commit message *and* the surrounding PR description. For patches submitted by e-mail, the cover letter counts as the PR description. We recommend an `Assisted-by:` footer: + +```txt +Assisted-by: () +``` + +For instance: + +```txt +Assisted-by: Claude Opus 5.5 (initial draft and code review) +``` + +Contributions without a commit message (e.g. issues/comments) should instead use a plain sentence in the text body such as `I used to help with `. PRs and commit messages may opt to use this format as well. + +Multi-commit series/squashes **must** maintain the trailer. Maintainers will handle this for merges to master, but you are responsible for ensuring the disclosure survives into the final commit/PR body of squashes within your branches. + +Regardless, what matters is that reviewers can tell *at a glance* where and how AI was involved in your contribution. + +## Codebase Ingestion + +Ingestion of this codebase by LLMs for any purpose--such as training or prompt context--is permitted *for now*. This may change at any point as litigation and court rulings around AI and code copyright proceed. + +AI models may have ingested AGPLv3 or otherwise copyleft-incompatible code and may regurgitate it. You remain responsible for ensuring that all code you submit is compatible with the GPLv3 or later. + +## Enforcement + +- If we suspect undisclosed AI usage in a contribution, we will ask for disclosure. +- Refusal to provide disclosure will result in rejection of the contribution, and your PR or issue will be closed. Maintainers may choose to rework it themselves if the change is worth having. +- Accounts that spam us with repeated automated PRs or comments will be blocked or permanently suspended from our Git instance. +- Maintainers reserve the right to close your issues and pull requests if you don't follow the guidelines and procedures outlined in this document, and refuse or fail to make changes as necessary to comply. +- Repeated failures to comply may result in loss of contribution privileges. + +## Addendum: AI Commit Messages + +The patchset for pull request [#3422](https://git.eden-emu.dev/eden-emu/eden/pulls/3422) was fed into a dedicated code AI model, and it produced the following: ```txt profile_manager: Refactor user deletion to use index instead of UUID @@ -89,28 +183,21 @@ These changes eliminate redundant code, reduce the risk of UUID → index mismat Fixes: potential inconsistency when user order changes between UI and backend ``` -This is: +This: -- Needlessly verbose (nobody cares about most of these details) +- Is needlessly verbose (nobody cares about most of these details) - Doesn't address the actual purpose of the PR (fixing a double-deletion bug in the profile manager) - Has unicode arrows (this is bad for command-line editors) -- Uses corporate and word-salad language +- Uses corporate and word-salad language that pads out the message to make it look like a lot changed -Another (code-oriented) LLM output the following: +A good commit message should be concise, descriptive, and convey the *intent* behind the change, such as the bug being fixed or the feature being added. It should *not* be a detailed changelog of every individual byte that's changed. -```txt -profile(manager/ui): switch to index-based deletion and unify removal logic +## References -- Make ConfigureProfileManagerDeleteDialog emit a deleteUser(int) signal instead of taking a callback. Store the target index in the dialog (m_index) and emit it on acceptance. -- Change ConfigureProfileManager to pass an index to SetInfo and to accept an index in DeleteUser. Wire the dialog signal to the new DeleteUser slot. -- Update headers: add the signal and m_index, add TODO to move dialog to a .ui file, and update slot/signature declarations. -- Add ProfileManager::RemoveProfileAtIndex(std::size_t) and refactor RemoveUser(UUID) to call RemoveProfileAtIndex to avoid duplicated removal logic. Ensure the removal path marks saves as needed and writes the user save file. -- Ensure the profile list updates immediately after deletes by calling profile_manager.ResetUserSaveFile() when populating the user list (qlaunch fix). -- Misc: update SPDX copyright year and fix build breakages caused by the API changes. +This policy document has been adapted from the AI policies of numerous other free and open-source projects, whether restrictive or permissive. -This consolidates profile removal behavior, fixes potential race conditions in the profile dialog, and removes duplicated removal code. -``` - -This has all of the same problems as the other one. Needlessly verbose, doesn't address *what* it actually fixes ("consolidates profile removal behavior"... okay, why? What does it fix?), etc. It even has the bonus of totally hallucinating the addition of a method! - -On a more "philosophical" note, LLMs tend to be geared towards *corporate language*, as that's what they're trained on. This is why AI-generated commit messages feel like "word salad", and typically pad out the commit message to make it *look* like a lot of things were changed (trust me, it's like that in the corporate world). They typically also drift towards unneeded buzzwords and useless implementation details. +- [Gitea](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#ai-contribution-policy) +- The [Linux kernel](https://kernel.org/doc/html/next/process/coding-assistants.html) +- [Gentoo Linux](https://wiki.gentoo.org/wiki/Project:Council/AI_policy) +- [cURL](https://curl.se/dev/contribute.html#on-ai-use-in-curl) +- [FastAPI](https://tiangolo.com/open-source/contributing/#automated-code-and-ai) From a594c8d60ef79280adc046760561912207e16e17 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 14 Oct 2026 00:04:16 +0200 Subject: [PATCH 177/198] [shader_recompiler, vulkan, qcom, tu] Provide handling to missing shader subgroups on QCOM (#4508) This works provides better emulation on certain GS missing for shader invocation data + geometry pass fallback in qcom/turnip drivers, some of those were provided as community patch by @a.kamaltdinov; which was refined to address the requirements on forced gpu reads; which used to kill some performance on low end devices; now, the stability with some of the graphical problems have been addressed and balanced. Shuffle shaders (SHFFL) are not actually provided on QCOM and turnip drivers, so any game that previously required this stage draw, will now avoid being ignored and tax some performance based on the complexity of the stage draw from now on. This will also address partially some tessellation problems as well. _Special Thanks:_ 1.- @a.kamaltdinov (for the initial patch "early fix for nier" provided for #4325) 2.- @PavelBARABANOV (because the making the cherry-pick easier for a new PR) Co-authored-by: PavelBARABANOV Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4508 Reviewed-by: lizzie Reviewed-by: crueter --- src/shader_recompiler/CMakeLists.txt | 1 + .../backend/spirv/emit_spirv.cpp | 33 ++++- .../backend/spirv/emit_spirv_warp.cpp | 127 ++++++++++++----- .../backend/spirv/spirv_emit_context.h | 1 + .../frontend/maxwell/translate_program.cpp | 110 ++++++++++++++- src/shader_recompiler/host_translate_info.h | 2 + .../ir_opt/constant_propagation_pass.cpp | 48 +++++-- .../ir_opt/geometry_compaction_pass.cpp | 129 ++++++++++++++++++ src/shader_recompiler/ir_opt/passes.h | 1 + src/shader_recompiler/profile.h | 3 + .../renderer_vulkan/vk_pipeline_cache.cpp | 17 ++- src/video_core/vulkan_common/vulkan_device.h | 5 + 12 files changed, 417 insertions(+), 60 deletions(-) create mode 100644 src/shader_recompiler/ir_opt/geometry_compaction_pass.cpp diff --git a/src/shader_recompiler/CMakeLists.txt b/src/shader_recompiler/CMakeLists.txt index 957ed5fb55..cc9ce95d92 100644 --- a/src/shader_recompiler/CMakeLists.txt +++ b/src/shader_recompiler/CMakeLists.txt @@ -172,6 +172,7 @@ add_library(shader_recompiler STATIC ir_opt/constant_propagation_pass.cpp ir_opt/dead_code_elimination_pass.cpp ir_opt/dual_vertex_pass.cpp + ir_opt/geometry_compaction_pass.cpp ir_opt/global_memory_to_storage_buffer_pass.cpp ir_opt/identity_removal_pass.cpp ir_opt/layer_pass.cpp diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index c221888c09..a903480c78 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp @@ -4,6 +4,7 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include #include #include @@ -439,10 +440,13 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct ctx.AddCapability(spv::Capability::DrawParameters); } if ((info.uses_subgroup_vote || info.uses_subgroup_invocation_id || - info.uses_subgroup_shuffles) && + info.uses_subgroup_shuffles || info.uses_subgroup_mask) && profile.support_vote && profile.SupportsSubgroupStage(ctx.stage)) { ctx.AddCapability(spv::Capability::GroupNonUniformBallot); ctx.AddCapability(spv::Capability::GroupNonUniformShuffle); + if (info.uses_subgroup_shuffles && profile.support_shuffle_relative) { + ctx.AddCapability(spv::Capability::GroupNonUniformShuffleRelative); + } if (!profile.warp_size_potentially_larger_than_guest) { // vote ops are only used when not taking the long path ctx.AddCapability(spv::Capability::GroupNonUniformVote); @@ -521,6 +525,29 @@ void PatchPhiNodes(IR::Program& program, EmitContext& ctx) { return { ctx.Def(phi->Arg(phi_arg)), parent }; }); } + +void RewriteOpcodes(std::vector& code, std::span> rewrites) { + if (rewrites.empty()) { + return; + } + size_t offset = 5; + while (offset + 2 < code.size()) { + const u32 word_count{code[offset] >> 16}; + const auto opcode{static_cast(code[offset] & 0xFFFFu)}; + if (word_count == 0) { + return; + } + if (opcode == spv::Op::OpGroupNonUniformShuffleXor || + opcode == spv::Op::OpGroupNonUniformQuadBroadcast) { + const auto it{std::ranges::find(rewrites, code[offset + 2], + &std::pair::first)}; + if (it != rewrites.end()) { + code[offset] = (code[offset] & 0xFFFF0000u) | static_cast(it->second); + } + } + offset += word_count; + } +} } // Anonymous namespace std::vector EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info, IR::Program& program, Bindings& bindings) { @@ -535,7 +562,9 @@ std::vector EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_in SetupCapabilities(profile, program.info, ctx); SetupTransformFeedbackCapabilities(ctx, main); PatchPhiNodes(program, ctx); - return ctx.Assemble(); + std::vector code{ctx.Assemble()}; + RewriteOpcodes(code, ctx.opcode_rewrites); + return code; } Id EmitPhi(EmitContext& ctx, IR::Inst* inst) { diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp index ffd5d9c29f..8d83509961 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp @@ -77,20 +77,57 @@ Id GetMaxThreadId(EmitContext& ctx, Id thread_id, Id clamp, Id segmentation_mask return ComputeMaxThreadId(ctx, min_thread_id, clamp, not_seg_mask); } -Id SelectValue(EmitContext& ctx, Id in_range, Id value, Id src_thread_id) { - if (!StageSupportsSubgroups(ctx)) { - return value; +Id HostThreadId(EmitContext& ctx, Id thread_id) { + if (!ctx.profile.warp_size_potentially_larger_than_guest) { + return thread_id; } - return ctx.OpSelect( - ctx.U32[1], in_range, - ctx.OpGroupNonUniformShuffle(ctx.U32[1], SubgroupScope(ctx), value, src_thread_id), value); -} - -Id AddPartitionBase(EmitContext& ctx, Id thread_id) { const Id partition_idx{ctx.OpShiftRightLogical(ctx.U32[1], GetThreadId(ctx), ctx.Const(5u))}; const Id partition_base{ctx.OpShiftLeftLogical(ctx.U32[1], partition_idx, ctx.Const(5u))}; return ctx.OpIAdd(ctx.U32[1], thread_id, partition_base); } + +Id GuestLane(EmitContext& ctx, Id index) { + return ctx.OpBitwiseAnd(ctx.U32[1], index, ctx.Const(31U)); +} + +Id ShuffleAbsolute(EmitContext& ctx, Id value, Id src_thread_id) { + if (!ctx.profile.has_broken_spirv_subgroup_shuffle) { + return ctx.OpGroupNonUniformShuffle(ctx.U32[1], SubgroupScope(ctx), value, src_thread_id); + } + Id result{ctx.u32_zero_value}; + for (u32 lane = 0; lane < ctx.profile.max_subgroup_size; ++lane) { + const Id read{ + ctx.OpGroupNonUniformBroadcast(ctx.U32[1], SubgroupScope(ctx), value, ctx.Const(lane))}; + const Id matches{ctx.OpIEqual(ctx.U1, src_thread_id, ctx.Const(lane))}; + result = ctx.OpSelect(ctx.U32[1], matches, read, result); + } + return result; +} + +Id ShuffleRelative(EmitContext& ctx, Id value, Id delta, Id src_thread_id, spv::Op op) { + if (!ctx.profile.support_shuffle_relative) { + return ShuffleAbsolute(ctx, value, HostThreadId(ctx, src_thread_id)); + } + const Id result{ctx.OpGroupNonUniformShuffleXor(ctx.U32[1], SubgroupScope(ctx), value, delta)}; + ctx.opcode_rewrites.emplace_back(result.value, op); + return result; +} + +Id BroadcastLane(EmitContext& ctx, Id value, u32 lane) { + Id result{ + ctx.OpGroupNonUniformBroadcast(ctx.U32[1], SubgroupScope(ctx), value, ctx.Const(lane))}; + if (!ctx.profile.warp_size_potentially_larger_than_guest) { + return result; + } + const Id partition_idx{ctx.OpShiftRightLogical(ctx.U32[1], GetThreadId(ctx), ctx.Const(5u))}; + for (u32 base = 32; base < ctx.profile.max_subgroup_size; base += 32) { + const Id read{ctx.OpGroupNonUniformBroadcast(ctx.U32[1], SubgroupScope(ctx), value, + ctx.Const(base + lane))}; + const Id matches{ctx.OpIEqual(ctx.U1, partition_idx, ctx.Const(base >> 5))}; + result = ctx.OpSelect(ctx.U32[1], matches, read, result); + } + return result; +} } // Anonymous namespace Id EmitLaneId(EmitContext& ctx) { @@ -203,61 +240,75 @@ Id EmitShuffleIndex(EmitContext& ctx, IR::Inst* inst, Id value, Id index, Id cla const Id min_thread_id{ComputeMinThreadId(ctx, thread_id, segmentation_mask)}; const Id max_thread_id{ComputeMaxThreadId(ctx, min_thread_id, clamp, not_seg_mask)}; - const Id lhs{ctx.OpBitwiseAnd(ctx.U32[1], index, not_seg_mask)}; - Id src_thread_id{ctx.OpBitwiseOr(ctx.U32[1], lhs, min_thread_id)}; + const Id lhs{ctx.OpBitwiseAnd(ctx.U32[1], GuestLane(ctx, index), not_seg_mask)}; + const Id src_thread_id{ctx.OpBitwiseOr(ctx.U32[1], lhs, min_thread_id)}; const Id in_range{ctx.OpSLessThanEqual(ctx.U1, src_thread_id, max_thread_id)}; - if (ctx.profile.warp_size_potentially_larger_than_guest) { - src_thread_id = AddPartitionBase(ctx, src_thread_id); - } - SetInBoundsFlag(inst, in_range); - return SelectValue(ctx, in_range, value, src_thread_id); + if (!StageSupportsSubgroups(ctx)) { + return value; + } + const IR::Value lane{inst->Arg(1).Resolve()}; + const IR::Value segment{inst->Arg(3).Resolve()}; + if (lane.IsImmediate() && segment.IsImmediate() && segment.U32() == 0) { + return ctx.OpSelect(ctx.U32[1], in_range, BroadcastLane(ctx, value, lane.U32() & 31), + value); + } + const Id shuffled{ShuffleAbsolute(ctx, value, HostThreadId(ctx, src_thread_id))}; + return ctx.OpSelect(ctx.U32[1], in_range, shuffled, value); } Id EmitShuffleUp(EmitContext& ctx, IR::Inst* inst, Id value, Id index, Id clamp, Id segmentation_mask) { + if (!StageSupportsSubgroups(ctx)) { + SetInBoundsFlag(inst, ctx.false_value); + return value; + } + const Id delta{GuestLane(ctx, index)}; const Id thread_id{EmitLaneId(ctx)}; const Id max_thread_id{GetMaxThreadId(ctx, thread_id, clamp, segmentation_mask)}; - Id src_thread_id{ctx.OpISub(ctx.U32[1], thread_id, index)}; + const Id src_thread_id{ctx.OpISub(ctx.U32[1], thread_id, delta)}; const Id in_range{ctx.OpSGreaterThanEqual(ctx.U1, src_thread_id, max_thread_id)}; - if (ctx.profile.warp_size_potentially_larger_than_guest) { - src_thread_id = AddPartitionBase(ctx, src_thread_id); - } - SetInBoundsFlag(inst, in_range); - return SelectValue(ctx, in_range, value, src_thread_id); + const Id shuffled{ShuffleRelative(ctx, value, delta, src_thread_id, + spv::Op::OpGroupNonUniformShuffleUp)}; + return ctx.OpSelect(ctx.U32[1], in_range, shuffled, value); } Id EmitShuffleDown(EmitContext& ctx, IR::Inst* inst, Id value, Id index, Id clamp, Id segmentation_mask) { + if (!StageSupportsSubgroups(ctx)) { + SetInBoundsFlag(inst, ctx.false_value); + return value; + } + const Id delta{GuestLane(ctx, index)}; const Id thread_id{EmitLaneId(ctx)}; const Id max_thread_id{GetMaxThreadId(ctx, thread_id, clamp, segmentation_mask)}; - Id src_thread_id{ctx.OpIAdd(ctx.U32[1], thread_id, index)}; + const Id src_thread_id{ctx.OpIAdd(ctx.U32[1], thread_id, delta)}; const Id in_range{ctx.OpSLessThanEqual(ctx.U1, src_thread_id, max_thread_id)}; - if (ctx.profile.warp_size_potentially_larger_than_guest) { - src_thread_id = AddPartitionBase(ctx, src_thread_id); - } - SetInBoundsFlag(inst, in_range); - return SelectValue(ctx, in_range, value, src_thread_id); + const Id shuffled{ShuffleRelative(ctx, value, delta, src_thread_id, + spv::Op::OpGroupNonUniformShuffleDown)}; + return ctx.OpSelect(ctx.U32[1], in_range, shuffled, value); } Id EmitShuffleButterfly(EmitContext& ctx, IR::Inst* inst, Id value, Id index, Id clamp, Id segmentation_mask) { + if (!StageSupportsSubgroups(ctx)) { + SetInBoundsFlag(inst, ctx.false_value); + return value; + } + const Id mask{GuestLane(ctx, index)}; const Id thread_id{EmitLaneId(ctx)}; const Id max_thread_id{GetMaxThreadId(ctx, thread_id, clamp, segmentation_mask)}; - Id src_thread_id{ctx.OpBitwiseXor(ctx.U32[1], thread_id, index)}; + const Id src_thread_id{ctx.OpBitwiseXor(ctx.U32[1], thread_id, mask)}; const Id in_range{ctx.OpSLessThanEqual(ctx.U1, src_thread_id, max_thread_id)}; - if (ctx.profile.warp_size_potentially_larger_than_guest) { - src_thread_id = AddPartitionBase(ctx, src_thread_id); - } - SetInBoundsFlag(inst, in_range); - return SelectValue(ctx, in_range, value, src_thread_id); + const Id shuffled{ctx.OpGroupNonUniformShuffleXor(ctx.U32[1], SubgroupScope(ctx), value, mask)}; + return ctx.OpSelect(ctx.U32[1], in_range, shuffled, value); } Id EmitQuadBroadcast(EmitContext& ctx, Id value, Id lane) { @@ -267,10 +318,16 @@ Id EmitQuadBroadcast(EmitContext& ctx, Id value, Id lane) { const Id base{ctx.OpBitwiseAnd(ctx.U32[1], GetThreadId(ctx), ctx.Const(~3u))}; const Id local_lane{ctx.OpBitwiseAnd(ctx.U32[1], lane, ctx.Const(3u))}; const Id src_thread_id{ctx.OpBitwiseOr(ctx.U32[1], base, local_lane)}; - return ctx.OpGroupNonUniformShuffle(ctx.U32[1], SubgroupScope(ctx), value, src_thread_id); + return ShuffleAbsolute(ctx, value, src_thread_id); } Id EmitQuadSwap(EmitContext& ctx, Id value, Id direction) { + if (ctx.profile.support_quad_shuffles) { + const Id result{ + ctx.OpGroupNonUniformQuadBroadcast(ctx.U32[1], SubgroupScope(ctx), value, direction)}; + ctx.opcode_rewrites.emplace_back(result.value, spv::Op::OpGroupNonUniformQuadSwap); + return result; + } const Id xor_mask{ctx.OpIAdd(ctx.U32[1], direction, ctx.Const(1u))}; return ctx.OpGroupNonUniformShuffleXor(ctx.U32[1], SubgroupScope(ctx), value, xor_mask); } diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index 7edc104708..a5821e9e93 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -361,6 +361,7 @@ public: Id frag_depth{}; std::vector interfaces; + std::vector> opcode_rewrites; Id load_const_func_u8{}; Id load_const_func_u16{}; diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp index 1b2ec5502d..0cc4b3b844 100644 --- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp @@ -5,7 +5,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include +#include #include +#include #include #include @@ -172,7 +175,17 @@ std::map GenerateLegacyToGenericMappings( void EmitGeometryPassthrough(IR::IREmitter& ir, const IR::Program& program, const Shader::VaryingState& passthrough_mask, bool passthrough_position, - std::optional passthrough_layer_attr) { + std::optional passthrough_layer_attr, + std::optional viewport_mask_reg) { + constexpr std::array CULLED_POSITION{2.0f, 2.0f, 2.0f, 1.0f}; + IR::U1 culled{ir.Imm1(false)}; + IR::U32 viewport{ir.Imm32(0)}; + if (viewport_mask_reg) { + const IR::U32 mask{ir.GetReg(*viewport_mask_reg)}; + const IR::U32 lowest_bit{ir.BitwiseAnd(mask, IR::U32{ir.INeg(mask)})}; + culled = ir.IEqual(mask, ir.Imm32(0)); + viewport = IR::U32{ir.Select(culled, ir.Imm32(0), ir.FindUMsb(lowest_bit))}; + } for (u32 i = 0; i < program.output_vertices; i++) { // Assign generics from input for (u32 j = 0; j < 32; j++) { @@ -190,10 +203,19 @@ void EmitGeometryPassthrough(IR::IREmitter& ir, const IR::Program& program, if (passthrough_position) { // Assign position from input const IR::Attribute attr = IR::Attribute::PositionX; - ir.SetAttribute(attr + 0, ir.GetAttribute(attr + 0, ir.Imm32(i)), ir.Imm32(0)); - ir.SetAttribute(attr + 1, ir.GetAttribute(attr + 1, ir.Imm32(i)), ir.Imm32(0)); - ir.SetAttribute(attr + 2, ir.GetAttribute(attr + 2, ir.Imm32(i)), ir.Imm32(0)); - ir.SetAttribute(attr + 3, ir.GetAttribute(attr + 3, ir.Imm32(i)), ir.Imm32(0)); + for (u32 component = 0; component < 4; ++component) { + IR::F32 value{ir.GetAttribute(attr + component, ir.Imm32(i))}; + if (viewport_mask_reg) { + value = IR::F32{ + ir.Select(culled, ir.Imm32(CULLED_POSITION[component]), value)}; + } + ir.SetAttribute(attr + component, value, ir.Imm32(0)); + } + } + + if (viewport_mask_reg) { + ir.SetAttribute(IR::Attribute::ViewportIndex, ir.BitCast(viewport), + ir.Imm32(0)); } if (passthrough_layer_attr) { @@ -219,19 +241,91 @@ u32 GetOutputTopologyVertices(OutputTopology output_topology) { } } +std::optional FindFreeRegister(const IR::Program& program) { + std::bitset used; + for (IR::Block* const block : program.blocks) { + for (const IR::Inst& inst : block->Instructions()) { + const IR::Opcode opcode{inst.GetOpcode()}; + if (opcode == IR::Opcode::GetRegister || opcode == IR::Opcode::SetRegister) { + used.set(IR::RegIndex(inst.Arg(0).Reg())); + } + } + } + for (size_t index = IR::NUM_USER_REGS; index-- > 0;) { + if (!used.test(index)) { + return static_cast(index); + } + } + return std::nullopt; +} + +std::optional LowerViewportMask(const IR::Program& program) { + const std::optional reg{FindFreeRegister(program)}; + if (!reg || program.blocks.empty()) { + return std::nullopt; + } + bool stores_mask{}; + for (IR::Block* const block : program.blocks) { + for (IR::Inst& inst : block->Instructions()) { + if (inst.GetOpcode() != IR::Opcode::SetAttribute || + inst.Arg(0).Attribute() != IR::Attribute::ViewportMask) { + continue; + } + IR::IREmitter ir{*block, IR::Block::InstructionList::s_iterator_to(inst)}; + ir.SetReg(*reg, ir.BitCast(IR::F32{inst.Arg(1)})); + inst.Invalidate(); + stores_mask = true; + } + } + if (!stores_mask) { + return std::nullopt; + } + IR::Block& entry{*program.blocks.front()}; + IR::IREmitter ir{entry, entry.begin()}; + ir.SetReg(*reg, ir.Imm32(1)); + return reg; +} + void LowerGeometryPassthrough(const IR::Program& program, const HostTranslateInfo& host_info) { + std::optional viewport_mask_reg; + if (!host_info.support_viewport_mask) { + viewport_mask_reg = LowerViewportMask(program); + } for (IR::Block* const block : program.blocks) { for (IR::Inst& inst : block->Instructions()) { if (inst.GetOpcode() == IR::Opcode::Epilogue) { IR::IREmitter ir{*block, IR::Block::InstructionList::s_iterator_to(inst)}; EmitGeometryPassthrough( ir, program, program.info.passthrough, - program.info.passthrough.AnyComponent(IR::Attribute::PositionX), {}); + program.info.passthrough.AnyComponent(IR::Attribute::PositionX), {}, + viewport_mask_reg); } } } } +void TightenOutputVertices(IR::Program& program) { + if (program.stage != Stage::Geometry || program.is_geometry_passthrough) { + return; + } + const bool has_loops = std::ranges::any_of(program.syntax_list, [](const auto& node) { + return node.type == IR::AbstractSyntaxNode::Type::Loop; + }); + if (has_loops) { + return; + } + u32 num_emits = 0; + for (IR::Block* const block : program.blocks) { + for (const IR::Inst& inst : block->Instructions()) { + if (inst.GetOpcode() == IR::Opcode::EmitVertex) { + ++num_emits; + } + } + } + if (num_emits != 0) { + program.output_vertices = (std::min)(program.output_vertices, num_emits); + } +} } // Anonymous namespace IR::Program TranslateProgram(ObjectPool& inst_pool, ObjectPool& block_pool, @@ -299,12 +393,14 @@ IR::Program TranslateProgram(ObjectPool& inst_pool, ObjectPool& inst_pool, IR::IREmitter ir{*current_block}; EmitGeometryPassthrough(ir, program, program.info.stores, true, - source_program.info.emulated_layer); + source_program.info.emulated_layer, std::nullopt); IR::Block* return_block{block_pool.Create(inst_pool)}; IR::IREmitter{*return_block}.Epilogue(); diff --git a/src/shader_recompiler/host_translate_info.h b/src/shader_recompiler/host_translate_info.h index 93ce881c2d..44df85ccb2 100644 --- a/src/shader_recompiler/host_translate_info.h +++ b/src/shader_recompiler/host_translate_info.h @@ -34,10 +34,12 @@ struct HostTranslateInfo { bool needs_demote_reorder{}; ///< True when the device needs DemoteToHelperInvocation reordered bool support_snorm_render_buffer{}; ///< True when the device supports SNORM render buffers bool support_viewport_index_layer{}; ///< True when the device supports gl_Layer in VS + bool support_viewport_mask{}; bool support_geometry_shader_passthrough{}; ///< True when the device supports geometry ///< passthrough shaders bool support_conditional_barrier{}; ///< True when the device supports barriers in conditional ///< control flow + bool single_lane_geometry_subgroups{}; void ApplyDescriptorLimitPolicy() noexcept { if (min_ssbo_alignment == 0) { diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp index 57c08588fb..6285fef16f 100644 --- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp +++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project @@ -651,6 +651,29 @@ IR::Value GetThroughCast(IR::Value value, IR::Opcode expected_cast) { return value; } +u32 QuadButterflyMask(const IR::Inst& inst) { + if (inst.GetOpcode() == IR::Opcode::QuadSwap) { + const IR::Value direction{inst.Arg(1)}; + if (!direction.IsImmediate()) { + return 0; + } + return direction.U32() + 1; + } + if (inst.GetOpcode() != IR::Opcode::ShuffleButterfly) { + return 0; + } + const IR::Value index{inst.Arg(1)}; + const IR::Value clamp{inst.Arg(2)}; + const IR::Value segmentation_mask{inst.Arg(3)}; + if (!index.IsImmediate() || !clamp.IsImmediate() || !segmentation_mask.IsImmediate()) { + return 0; + } + if (clamp.U32() != 3 || segmentation_mask.U32() != 28) { + return 0; + } + return index.U32(); +} + void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) { const IR::Value swizzle{inst.Arg(2)}; if (!swizzle.IsImmediate()) { @@ -666,7 +689,8 @@ void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) { return; } IR::Inst* const inst2{value_1.InstRecursive()}; - if (inst2->GetOpcode() != IR::Opcode::ShuffleButterfly) { + const u32 lane_mask{QuadButterflyMask(*inst2)}; + if (lane_mask == 0) { return; } const IR::Value value_3{GetThroughCast(inst2->Arg(0).Resolve(), IR::Opcode::BitCastU32F32)}; @@ -678,24 +702,15 @@ void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) { return; } } - const IR::Value index{inst2->Arg(1)}; - const IR::Value clamp{inst2->Arg(2)}; - const IR::Value segmentation_mask{inst2->Arg(3)}; - if (!index.IsImmediate() || !clamp.IsImmediate() || !segmentation_mask.IsImmediate()) { - return; - } - if (clamp.U32() != 3 || segmentation_mask.U32() != 28) { - return; - } if (swizzle_value == 0x99) { // DPdxFine - if (index.U32() == 1) { + if (lane_mask == 1) { IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; inst.ReplaceUsesWith(ir.DPdxFine(IR::F32{inst.Arg(1)})); } } else if (swizzle_value == 0xA5) { // DPdyFine - if (index.U32() == 2) { + if (lane_mask == 2) { IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; inst.ReplaceUsesWith(ir.DPdyFine(IR::F32{inst.Arg(1)})); } @@ -709,6 +724,13 @@ bool FindGradient3DDerivatives(std::array& results, IR::Value coor const auto check_through_shuffle = [](IR::Value input, IR::Value& result) { const IR::Value value_1{GetThroughCast(input.Resolve(), IR::Opcode::BitCastF32U32)}; IR::Inst* const inst2{value_1.InstRecursive()}; + if (inst2->GetOpcode() == IR::Opcode::QuadBroadcast) { + if (!inst2->Arg(1).Resolve().IsImmediate()) { + return false; + } + result = GetThroughCast(inst2->Arg(0).Resolve(), IR::Opcode::BitCastU32F32); + return true; + } if (inst2->GetOpcode() != IR::Opcode::ShuffleIndex) { return false; } diff --git a/src/shader_recompiler/ir_opt/geometry_compaction_pass.cpp b/src/shader_recompiler/ir_opt/geometry_compaction_pass.cpp new file mode 100644 index 0000000000..98cfa47401 --- /dev/null +++ b/src/shader_recompiler/ir_opt/geometry_compaction_pass.cpp @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include + +#include "shader_recompiler/frontend/ir/ir_emitter.h" +#include "shader_recompiler/host_translate_info.h" +#include "shader_recompiler/ir_opt/passes.h" + +namespace Shader::Optimization { +namespace { +constexpr int MAX_BALLOT_DEPTH = 8; + +struct SlotAtomic { + IR::Block* block; + IR::Inst* atomic; + IR::Inst* ballot; +}; + +IR::Inst* FindBallot(const IR::Value& value, int depth) { + if (depth > MAX_BALLOT_DEPTH || value.IsImmediate()) { + return nullptr; + } + IR::Inst* const inst{value.InstRecursive()}; + if (inst->GetOpcode() == IR::Opcode::SubgroupBallot) { + return inst; + } + if (inst->GetOpcode() == IR::Opcode::Phi) { + return nullptr; + } + for (size_t index = 0; index < inst->NumArgs(); ++index) { + if (IR::Inst* const ballot{FindBallot(inst->Arg(index), depth + 1)}) { + return ballot; + } + } + return nullptr; +} + +bool IsShuffle(IR::Opcode opcode) { + switch (opcode) { + case IR::Opcode::ShuffleIndex: + case IR::Opcode::ShuffleUp: + case IR::Opcode::ShuffleDown: + case IR::Opcode::ShuffleButterfly: + return true; + default: + return false; + } +} + +IR::U32 PrimitiveSlot(IR::IREmitter& ir, u32 invocations, const IR::U32& amount) { + IR::U32 key{ir.GetAttributeU32(IR::Attribute::PrimitiveId)}; + if (invocations > 1) { + key = ir.IAdd(ir.IMul(key, ir.Imm32(invocations)), ir.InvocationId()); + } + return ir.IMul(key, amount); +} + +bool MergesAtomic(const IR::Inst& phi, const IR::Block& block, const IR::Inst& atomic) { + for (size_t index = 0; index < phi.NumArgs(); ++index) { + const IR::Value arg{phi.Arg(index)}; + if (phi.PhiBlock(index) == &block && !arg.IsImmediate() && + arg.InstRecursive() == &atomic) { + return true; + } + } + return false; +} + +void RewriteMergedSlots(IR::Block& block, IR::Inst& atomic, u32 invocations) { + for (IR::Block* const successor : block.ImmSuccessors()) { + for (IR::Inst& phi : successor->Instructions()) { + if (phi.GetOpcode() != IR::Opcode::Phi || !MergesAtomic(phi, block, atomic)) { + continue; + } + for (size_t index = 0; index < phi.NumArgs(); ++index) { + const IR::Value arg{phi.Arg(index)}; + if (arg.IsImmediate() || !IsShuffle(arg.InstRecursive()->GetOpcode())) { + continue; + } + IR::IREmitter ir{*phi.PhiBlock(index)}; + const IR::U32 amount{arg.InstRecursive()->Arg(0)}; + phi.SetArg(index, PrimitiveSlot(ir, invocations, amount)); + } + } + } +} + +void RewriteAtomic(IR::Block& block, IR::Inst& atomic, u32 invocations) { + const auto insert_point{IR::Block::InstructionList::s_iterator_to(atomic)}; + IR::IREmitter ir{block, insert_point}; + const IR::U32 amount{atomic.Arg(2)}; + const IR::U32 slot{PrimitiveSlot(ir, invocations, amount)}; + block.PrependNewInst(insert_point, IR::Opcode::StorageAtomicUMax32, + {atomic.Arg(0), atomic.Arg(1), ir.IAdd(slot, amount)}); + atomic.ReplaceUsesWith(slot); +} + +void NeutralizePredicate(IR::Inst& ballot) { + const IR::Value pred{ballot.Arg(0)}; + if (!pred.IsImmediate()) { + pred.InstRecursive()->ReplaceUsesWith(IR::Value{true}); + } +} +} + +void GeometryCompactionPass(IR::Program& program, const HostTranslateInfo& host_info) { + if (program.stage != Stage::Geometry || !host_info.single_lane_geometry_subgroups) { + return; + } + boost::container::small_vector slot_atomics; + for (IR::Block* const block : program.post_order_blocks) { + for (IR::Inst& inst : block->Instructions()) { + if (inst.GetOpcode() != IR::Opcode::StorageAtomicIAdd32) { + continue; + } + if (IR::Inst* const ballot{FindBallot(inst.Arg(2), 0)}) { + slot_atomics.push_back({block, &inst, ballot}); + } + } + } + for (const SlotAtomic& slot_atomic : slot_atomics) { + RewriteMergedSlots(*slot_atomic.block, *slot_atomic.atomic, program.invocations); + RewriteAtomic(*slot_atomic.block, *slot_atomic.atomic, program.invocations); + NeutralizePredicate(*slot_atomic.ballot); + } +} + +} diff --git a/src/shader_recompiler/ir_opt/passes.h b/src/shader_recompiler/ir_opt/passes.h index 068d7fdfe8..bf325a4cd9 100644 --- a/src/shader_recompiler/ir_opt/passes.h +++ b/src/shader_recompiler/ir_opt/passes.h @@ -19,6 +19,7 @@ void CollectShaderInfoPass(Environment& env, IR::Program& program); void ConditionalBarrierPass(IR::Program& program); void ConstantPropagationPass(Environment& env, IR::Program& program); void DeadCodeEliminationPass(IR::Program& program); +void GeometryCompactionPass(IR::Program& program, const HostTranslateInfo& host_info); void GlobalMemoryToStorageBufferPass(IR::Program& program, const HostTranslateInfo& host_info); void IdentityRemovalPass(IR::Program& program); void LowerFp64ToFp32(IR::Program& program); diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index d2ac480ab8..8e9c83f888 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h @@ -40,6 +40,7 @@ struct Profile { bool support_shader_quad_control{}; bool support_quad_shuffles{}; bool support_vote{}; + bool support_shuffle_relative{}; u32 supported_subgroup_stages{0x7F}; bool support_viewport_index_layer_non_geometry{}; bool support_viewport_mask{}; @@ -102,6 +103,8 @@ struct Profile { bool ignore_nan_fp_comparisons{}; /// Some drivers have broken support for OpVectorExtractDynamic on subgroup mask inputs bool has_broken_spirv_subgroup_mask_vector_extract_dynamic{}; + bool has_broken_spirv_subgroup_shuffle{}; + u32 max_subgroup_size{}; u32 gl_max_compute_smem_size{}; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 5e057dd4cf..a85e2811a3 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -363,7 +363,7 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, const auto subgroup_stage_bit{[subgroup_stages](VkShaderStageFlags flag, Shader::Stage stage) { return (subgroup_stages & flag) != 0 ? (1u << static_cast(stage)) : 0u; }}; - const u32 supported_subgroup_stages{ + u32 supported_subgroup_stages{ subgroup_stage_bit(VK_SHADER_STAGE_VERTEX_BIT, Shader::Stage::VertexA) | subgroup_stage_bit(VK_SHADER_STAGE_VERTEX_BIT, Shader::Stage::VertexB) | subgroup_stage_bit(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, @@ -373,6 +373,9 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, subgroup_stage_bit(VK_SHADER_STAGE_GEOMETRY_BIT, Shader::Stage::Geometry) | subgroup_stage_bit(VK_SHADER_STAGE_FRAGMENT_BIT, Shader::Stage::Fragment) | subgroup_stage_bit(VK_SHADER_STAGE_COMPUTE_BIT, Shader::Stage::Compute)}; + if (driver_id == VK_DRIVER_ID_MESA_TURNIP) { + supported_subgroup_stages &= ~(1u << static_cast(Shader::Stage::Geometry)); + } profile = Shader::Profile{ .supported_spirv = device.SupportedSpirvVersion(), .unified_descriptor_binding = true, @@ -410,6 +413,8 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, .support_shader_quad_control = device.IsKhrShaderQuadControlSupported(), .support_quad_shuffles = device.IsSubgroupFeatureSupported(VK_SUBGROUP_FEATURE_QUAD_BIT), .support_vote = device.IsSubgroupFeatureSupported(VK_SUBGROUP_FEATURE_VOTE_BIT), + .support_shuffle_relative = + device.IsSubgroupFeatureSupported(VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT), .supported_subgroup_stages = supported_subgroup_stages, .support_viewport_index_layer_non_geometry = device.IsExtShaderViewportIndexLayerSupported(), @@ -445,13 +450,17 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA, .has_broken_spirv_clamp = driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, - .has_broken_spirv_position_input = driver_id == false, + .has_broken_spirv_position_input = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, .has_broken_unsigned_image_offsets = false, .has_broken_signed_operations = false, .has_broken_fp16_float_controls = driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY, .has_broken_fp32_denorm_flush = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, .ignore_nan_fp_comparisons = false, - .has_broken_spirv_subgroup_mask_vector_extract_dynamic = false, + .has_broken_spirv_subgroup_mask_vector_extract_dynamic = + driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY && + device.GetDriverVersion() < VK_MAKE_VERSION(512, 672, 0), + .has_broken_spirv_subgroup_shuffle = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, + .max_subgroup_size = device.GetMaxSubgroupSize(), .has_broken_robust = device.IsNvidia() && device.GetNvidiaArch() <= NvidiaArchitecture::Arch_Pascal, .min_ssbo_alignment = device.GetStorageBufferAlignment(), @@ -478,8 +487,10 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, driver_id == VK_DRIVER_ID_SAMSUNG_PROPRIETARY, .support_snorm_render_buffer = true, .support_viewport_index_layer = device.IsExtShaderViewportIndexLayerSupported(), + .support_viewport_mask = device.IsNvViewportArray2Supported(), .support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(), .support_conditional_barrier = device.SupportsConditionalBarriers(), + .single_lane_geometry_subgroups = !profile.SupportsSubgroupStage(Shader::Stage::Geometry), }; host_info.ApplyDescriptorLimitPolicy(); diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 077b1c3e23..bbf3754e39 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -483,6 +483,11 @@ FN_MAX_LIMIT_LIST return properties.subgroup_properties.supportedStages; } + u32 GetMaxSubgroupSize() const { + return (std::max)(properties.subgroup_properties.subgroupSize, + properties.subgroup_size_control.maxSubgroupSize); + } + /// Returns the maximum number of push descriptors. u32 MaxPushDescriptors() const { return properties.push_descriptor.maxPushDescriptors; From fb51a1253447a2655382d3cf952c4c470a1d96c6 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 14 Oct 2026 21:24:35 +0200 Subject: [PATCH 178/198] [input/sdl] nuke SDL_Vibration thread (#4299) Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- isn't it net faster to just...send things, serially? especially since vibration occurs so non-often... i dont think it would cause any issues TEST: if this causes ANY sort of perf regression on games when the thing vibrates WITH AN SDL CONFIGURED GAMEPAD OR WHATEVER Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4299 Reviewed-by: Maufeat Reviewed-by: CamilleLaVey --- src/input_common/drivers/sdl_driver.cpp | 41 +------------------------ src/input_common/drivers/sdl_driver.h | 7 +---- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index 91589063b5..c3e9a066b3 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -697,16 +697,6 @@ SDLDriver::SDLDriver(std::string input_engine_) : InputEngine(std::move(input_en SDL_AddEventWatch(&SDLEventWatcher, this); initialized = true; - if (start_thread) { - vibration_thread = std::thread([this] { - Common::SetCurrentThreadName("SDL_Vibration"); - using namespace std::chrono_literals; - while (initialized) { - SendVibrations(); - std::this_thread::sleep_for(250ms); // 4 TPS - } - }); - } // Because the events for joystick connection happens before we have our event watcher added, we // can just open all the joysticks right here int joystick_count = 0; @@ -725,7 +715,6 @@ SDLDriver::~SDLDriver() { initialized = false; if (start_thread) { - vibration_thread.join(); SDL_QuitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_GAMEPAD); } } @@ -805,10 +794,7 @@ Common::Input::DriverResult SDLDriver::SetVibration( .type = Common::Input::VibrationAmplificationType::Exponential, }; - vibration_queue.Push(VibrationRequest{ - .identifier = identifier, - .vibration = new_vibration, - }); + joystick->RumblePlay(new_vibration); return Common::Input::DriverResult::Success; } @@ -852,31 +838,6 @@ bool SDLDriver::IsVibrationEnabled(const PadIdentifier& identifier) { return true; } -void SDLDriver::SendVibrations() { - std::vector filtered_vibrations{}; - while (!vibration_queue.Empty()) { - VibrationRequest request; - vibration_queue.Pop(request); - const auto joystick = GetSDLJoystickByGUID(request.identifier.guid.RawString(), - static_cast(request.identifier.port)); - const auto it = std::find_if(filtered_vibrations.begin(), filtered_vibrations.end(), - [request](VibrationRequest vibration) { - return vibration.identifier == request.identifier; - }); - if (it == filtered_vibrations.end()) { - filtered_vibrations.push_back(std::move(request)); - continue; - } - *it = request; - } - - for (const auto& vibration : filtered_vibrations) { - const auto joystick = GetSDLJoystickByGUID(vibration.identifier.guid.RawString(), - static_cast(vibration.identifier.port)); - joystick->RumblePlay(vibration.vibration); - } -} - Common::ParamPackage SDLDriver::BuildAnalogParamPackageForButton(int port, const Common::UUID& guid, s32 axis, float value) const { Common::ParamPackage params{}; diff --git a/src/input_common/drivers/sdl_driver.h b/src/input_common/drivers/sdl_driver.h index 9a279e926f..e6751b6688 100644 --- a/src/input_common/drivers/sdl_driver.h +++ b/src/input_common/drivers/sdl_driver.h @@ -113,16 +113,11 @@ private: /// Returns true if the button is on the left joycon bool IsButtonOnLeftSide(Settings::NativeButton::Values button) const; - /// Queue of vibration request to controllers - Common::SPSCQueue vibration_queue; - /// Map of GUID of a list of corresponding virtual Joysticks ::Common::unordered_map>> joystick_map; std::mutex joystick_map_mutex; - bool start_thread = false; std::atomic initialized = false; - - std::thread vibration_thread; + bool start_thread; }; } // namespace InputCommon From 14da4482a4668928bad43bb67ef12f96b9c9d972 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 14 Oct 2026 21:24:58 +0200 Subject: [PATCH 179/198] [input_common/joycon] Enumerate SDL devices iff SDL signals change (#4486) As per SDL documentation this is the "desired" loop. > Enumerating the HID devices is an expensive operation, so you can call this to see if there have been any system device changes since the last call to this function. A change in the counter returned doesn't necessarily mean that anything has changed, but you can call SDL_hid_enumerate() to get an updated device list. https://wiki.libsdl.org/SDL3/SDL_hid_device_change_count Signed-off-by: lizzie - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4486 Reviewed-by: Maufeat Reviewed-by: CamilleLaVey --- src/input_common/drivers/joycon.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/input_common/drivers/joycon.cpp b/src/input_common/drivers/joycon.cpp index fb2d75e384..047e7eb6d8 100644 --- a/src/input_common/drivers/joycon.cpp +++ b/src/input_common/drivers/joycon.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project @@ -83,20 +83,21 @@ void Joycons::ScanThread(std::stop_token stop_token) { constexpr u16 nintendo_vendor_id = 0x057e; Common::SetCurrentThreadName("JoyconScanThread"); + auto last_ret = 0u; do { - SDL_hid_device_info* devs = SDL_hid_enumerate(nintendo_vendor_id, 0x0); - SDL_hid_device_info* cur_dev = devs; - - while (cur_dev) { - if (IsDeviceNew(cur_dev)) { - LOG_DEBUG(Input, "Device Found,type : {:04X} {:04X}", cur_dev->vendor_id, - cur_dev->product_id); - RegisterNewDevice(cur_dev); + auto ret = SDL_hid_device_change_count(); + if (last_ret == 0u || last_ret != ret) { + last_ret = ret; + SDL_hid_device_info* devs = SDL_hid_enumerate(nintendo_vendor_id, 0x0); + for (auto* cur_dev = devs; cur_dev; cur_dev = cur_dev->next) { + if (IsDeviceNew(cur_dev)) { + LOG_DEBUG(Input, "Device Found,type : {:04X} {:04X}", cur_dev->vendor_id, cur_dev->product_id); + RegisterNewDevice(cur_dev); + } + cur_dev = cur_dev->next; } - cur_dev = cur_dev->next; + SDL_hid_free_enumeration(devs); } - - SDL_hid_free_enumeration(devs); } while (Common::StoppableTimedWait(stop_token, std::chrono::seconds{5})); } From e255c20db4111485d228c10478bda63aabcfdde5 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Thu, 15 Oct 2026 08:45:15 +0200 Subject: [PATCH 180/198] Revert "[hle] constexpr handler dispatch maps, introduce version gating (#4480)" (#4532) This reverts commit 218c6705d950635bc18f8458d738a1996fb592b6. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4532 Reviewed-by: lizzie Reviewed-by: CamilleLaVey Reviewed-by: Maufeat --- docs/DesignOverview.md | 2 +- docs/{SubsystemHLE.md => HosKernel.md} | 53 +- docs/README.md | 2 +- src/core/CMakeLists.txt | 70 +- src/core/hle/service/acc/acc.cpp | 2027 ++++++++--------- src/core/hle/service/acc/acc.h | 64 + src/core/hle/service/acc/async_context.cpp | 11 + src/core/hle/service/acc/async_context.h | 10 - src/core/hle/service/acc/errors.h | 3 + src/core/hle/service/am/am.cpp | 1338 +---------- src/core/hle/service/am/am.h | 3 + src/core/hle/service/am/applet_manager.h | 2 +- .../hle/service/am/frontend/applet_cabinet.h | 3 + .../service/am/frontend/applet_controller.h | 2 +- .../hle/service/am/frontend/applet_error.h | 3 + .../hle/service/am/frontend/applet_general.h | 3 + .../hle/service/am/frontend/applet_mii_edit.h | 3 + .../am/frontend/applet_mii_edit_types.h | 3 + .../service/am/frontend/applet_net_connect.h | 2 +- .../am/frontend/applet_profile_select.cpp | 3 + .../am/frontend/applet_profile_select.h | 3 + .../frontend/applet_software_keyboard_types.h | 3 + .../service/am/frontend/applet_web_browser.h | 2 +- src/core/hle/service/am/frontend/applets.h | 2 +- src/core/hle/service/am/process_holder.cpp | 3 + src/core/hle/service/am/process_holder.h | 3 + .../all_system_applet_proxies_service.cpp | 135 ++ .../all_system_applet_proxies_service.h | 56 + .../am/service/applet_common_functions.cpp | 98 + .../am/service/applet_common_functions.h | 33 + .../am/service/application_accessor.cpp | 64 +- .../service/am/service/application_accessor.h | 1 - .../am/service/application_creator.cpp | 20 +- .../service/am/service/application_creator.h | 1 - .../am/service/application_functions.cpp | 153 +- .../am/service/application_functions.h | 1 - .../service/am/service/application_proxy.cpp | 109 + .../service/am/service/application_proxy.h | 52 + .../am/service/application_proxy_service.cpp | 47 + .../am/service/application_proxy_service.h | 36 + .../service/am/service/audio_controller.cpp | 24 +- .../hle/service/am/service/audio_controller.h | 1 - .../am/service/common_state_getter.cpp | 209 +- .../service/am/service/common_state_getter.h | 1 - .../am/service/cradle_firmware_updater.cpp | 25 +- .../am/service/cradle_firmware_updater.h | 1 - .../service/am/service/debug_functions.cpp | 46 + .../hle/service/am/service/debug_functions.h | 19 + .../service/am/service/display_controller.cpp | 68 +- .../service/am/service/display_controller.h | 1 - .../am/service/global_state_controller.cpp | 38 +- .../am/service/global_state_controller.h | 4 +- .../am/service/home_menu_functions.cpp | 42 +- .../service/am/service/home_menu_functions.h | 1 - .../am/service/library_applet_accessor.cpp | 64 +- .../am/service/library_applet_accessor.h | 22 +- .../am/service/library_applet_creator.cpp | 287 +++ .../am/service/library_applet_creator.h | 44 + .../am/service/library_applet_proxy.cpp | 137 ++ .../service/am/service/library_applet_proxy.h | 59 + .../service/library_applet_self_accessor.cpp | 332 +++ .../am/service/library_applet_self_accessor.h | 87 + .../hle/service/am/service/lock_accessor.cpp | 78 + .../hle/service/am/service/lock_accessor.h | 35 + .../am/service/overlay_applet_proxy.cpp | 120 + .../service/am/service/overlay_applet_proxy.h | 55 + .../service/am/service/overlay_functions.cpp | 52 +- .../service/am/service/overlay_functions.h | 35 +- .../am/service/process_winding_controller.cpp | 28 +- .../am/service/process_winding_controller.h | 1 - .../service/am/service/self_controller.cpp | 113 +- .../hle/service/am/service/self_controller.h | 1 - src/core/hle/service/am/service/storage.cpp | 78 +- src/core/hle/service/am/service/storage.h | 1 - .../service/am/service/storage_accessor.cpp | 71 + .../hle/service/am/service/storage_accessor.h | 41 + .../am/service/system_applet_proxy.cpp | 136 ++ .../service/am/service/system_applet_proxy.h | 58 + .../service/am/service/window_controller.cpp | 28 +- .../service/am/service/window_controller.h | 1 - .../hle/service/aoc/addon_content_manager.cpp | 57 +- .../hle/service/aoc/addon_content_manager.h | 2 +- .../service/aoc/purchase_event_manager.cpp | 27 +- .../hle/service/aoc/purchase_event_manager.h | 2 - src/core/hle/service/apm/apm.h | 3 + src/core/hle/service/apm/apm_controller.h | 3 + src/core/hle/service/apm/apm_interface.cpp | 38 +- src/core/hle/service/apm/apm_interface.h | 21 - src/core/hle/service/audio/audio.cpp | 208 +- src/core/hle/service/audio/audio.h | 3 + .../hle/service/audio/audio_controller.cpp | 139 +- src/core/hle/service/audio/audio_controller.h | 2 +- src/core/hle/service/audio/audio_device.cpp | 52 +- src/core/hle/service/audio/audio_device.h | 1 - src/core/hle/service/audio/audio_in.cpp | 50 +- src/core/hle/service/audio/audio_in.h | 1 - .../hle/service/audio/audio_in_manager.cpp | 30 +- src/core/hle/service/audio/audio_in_manager.h | 1 - src/core/hle/service/audio/audio_out.cpp | 40 +- src/core/hle/service/audio/audio_out.h | 2 - .../hle/service/audio/audio_out_manager.cpp | 20 +- .../hle/service/audio/audio_out_manager.h | 1 - src/core/hle/service/audio/audio_renderer.cpp | 51 +- src/core/hle/service/audio/audio_renderer.h | 1 - .../service/audio/audio_renderer_manager.cpp | 22 +- .../service/audio/audio_renderer_manager.h | 1 - .../audio/final_output_recorder_manager.cpp | 39 +- .../audio/final_output_recorder_manager.h | 7 - ...nal_output_recorder_manager_for_applet.cpp | 8 + ...final_output_recorder_manager_for_applet.h | 8 - .../service/audio/hardware_opus_decoder.cpp | 32 +- .../hle/service/audio/hardware_opus_decoder.h | 1 - .../audio/hardware_opus_decoder_manager.cpp | 31 +- .../audio/hardware_opus_decoder_manager.h | 1 - src/core/hle/service/bcat/bcat.h | 3 + src/core/hle/service/bcat/bcat_result.h | 3 + src/core/hle/service/bcat/bcat_service.cpp | 75 +- src/core/hle/service/bcat/bcat_service.h | 1 - .../bcat/delivery_cache_directory_service.cpp | 18 +- .../bcat/delivery_cache_directory_service.h | 1 - .../bcat/delivery_cache_file_service.cpp | 20 +- .../bcat/delivery_cache_file_service.h | 1 - .../bcat/delivery_cache_progress_service.cpp | 16 +- .../bcat/delivery_cache_progress_service.h | 1 - .../bcat/delivery_cache_storage_service.cpp | 18 +- .../bcat/delivery_cache_storage_service.h | 1 - src/core/hle/service/bcat/news/builtin_news.h | 2 +- src/core/hle/service/bcat/news/msgpack.cpp | 2 +- src/core/hle/service/bcat/news/msgpack.h | 2 +- .../bcat/news/newly_arrived_event_holder.cpp | 19 +- .../bcat/news/newly_arrived_event_holder.h | 1 - .../service/bcat/news/news_data_service.cpp | 19 +- .../hle/service/bcat/news/news_data_service.h | 1 - .../bcat/news/news_database_service.cpp | 23 +- .../service/bcat/news/news_database_service.h | 2 - .../hle/service/bcat/news/news_service.cpp | 50 +- src/core/hle/service/bcat/news/news_service.h | 9 +- .../hle/service/bcat/news/news_storage.cpp | 2 +- .../bcat/news/overwrite_event_holder.cpp | 18 +- .../bcat/news/overwrite_event_holder.h | 1 - .../hle/service/bcat/news/service_creator.cpp | 22 +- .../hle/service/bcat/news/service_creator.h | 1 - src/core/hle/service/bcat/service_creator.cpp | 26 +- src/core/hle/service/bcat/service_creator.h | 1 - src/core/hle/service/bpc/bpc.cpp | 138 +- src/core/hle/service/bpc/bpc.h | 3 + src/core/hle/service/btdrv/btdrv.cpp | 310 +-- src/core/hle/service/btdrv/btdrv.h | 3 + src/core/hle/service/btm/btm.cpp | 495 +--- src/core/hle/service/btm/btm.h | 3 + src/core/hle/service/btm/btm_debug.cpp | 40 + src/core/hle/service/btm/btm_debug.h | 24 + src/core/hle/service/btm/btm_system.cpp | 34 + src/core/hle/service/btm/btm_system.h | 28 + src/core/hle/service/btm/btm_system_core.cpp | 135 ++ src/core/hle/service/btm/btm_system_core.h | 62 + src/core/hle/service/btm/btm_user.cpp | 33 + src/core/hle/service/btm/btm_user.h | 28 + src/core/hle/service/btm/btm_user_core.cpp | 106 + src/core/hle/service/btm/btm_user_core.h | 50 + src/core/hle/service/caps/caps.cpp | 218 +- src/core/hle/service/caps/caps.h | 3 + src/core/hle/service/caps/caps_a.cpp | 211 ++ src/core/hle/service/caps/caps_a.h | 63 + src/core/hle/service/caps/caps_c.cpp | 50 +- src/core/hle/service/caps/caps_c.h | 9 +- src/core/hle/service/caps/caps_result.h | 3 + src/core/hle/service/caps/caps_sc.cpp | 26 + src/core/hle/service/caps/caps_sc.h | 26 - src/core/hle/service/caps/caps_ss.cpp | 26 +- src/core/hle/service/caps/caps_ss.h | 1 - src/core/hle/service/caps/caps_su.cpp | 22 +- src/core/hle/service/caps/caps_su.h | 2 +- src/core/hle/service/caps/caps_u.cpp | 40 +- src/core/hle/service/caps/caps_u.h | 1 - src/core/hle/service/cmif_types.h | 3 + src/core/hle/service/erpt/erpt.cpp | 64 +- src/core/hle/service/erpt/erpt.h | 3 + src/core/hle/service/es/es.cpp | 342 +-- src/core/hle/service/es/es.h | 3 + src/core/hle/service/eupld/eupld.cpp | 44 +- src/core/hle/service/eupld/eupld.h | 3 + src/core/hle/service/fatal/fatal.cpp | 31 +- src/core/hle/service/fatal/fatal.h | 3 + src/core/hle/service/fatal/fatal_p.cpp | 22 + src/core/hle/service/fatal/fatal_p.h | 19 + src/core/hle/service/fatal/fatal_u.cpp | 23 + src/core/hle/service/fatal/fatal_u.h | 19 + src/core/hle/service/fgm/fgm.cpp | 52 +- src/core/hle/service/fgm/fgm.h | 3 + .../service/filesystem/fsp/fs_i_directory.cpp | 13 +- .../service/filesystem/fsp/fs_i_directory.h | 2 - .../hle/service/filesystem/fsp/fs_i_file.cpp | 12 + .../hle/service/filesystem/fsp/fs_i_file.h | 13 - .../filesystem/fsp/fs_i_filesystem.cpp | 43 +- .../service/filesystem/fsp/fs_i_filesystem.h | 1 - .../fsp/fs_i_multi_commit_manager.cpp | 5 + .../fsp/fs_i_multi_commit_manager.h | 7 - .../fsp/fs_i_save_data_info_reader.cpp | 5 + .../fsp/fs_i_save_data_info_reader.h | 6 - .../service/filesystem/fsp/fs_i_storage.cpp | 9 + .../hle/service/filesystem/fsp/fs_i_storage.h | 15 +- .../hle/service/filesystem/fsp/fsp_ldr.cpp | 9 + src/core/hle/service/filesystem/fsp/fsp_ldr.h | 9 - .../hle/service/filesystem/fsp/fsp_pr.cpp | 10 + src/core/hle/service/filesystem/fsp/fsp_pr.h | 10 - .../hle/service/filesystem/fsp/fsp_srv.cpp | 271 +-- src/core/hle/service/filesystem/fsp/fsp_srv.h | 1 - .../hle/service/filesystem/fsp/fsp_types.h | 3 + .../fsp/save_data_transfer_prohibiter.cpp | 3 + .../fsp/save_data_transfer_prohibiter.h | 3 + .../service/filesystem/romfs_controller.cpp | 3 + .../hle/service/filesystem/romfs_controller.h | 3 + .../filesystem/save_data_controller.cpp | 2 +- .../service/filesystem/save_data_controller.h | 3 + src/core/hle/service/friend/friend.cpp | 378 ++- src/core/hle/service/friend/friend.h | 3 + .../hle/service/friend/friend_interface.cpp | 23 + .../hle/service/friend/friend_interface.h | 19 + src/core/hle/service/glue/arp.cpp | 42 +- src/core/hle/service/glue/arp.h | 23 - src/core/hle/service/glue/bgtc.cpp | 43 +- src/core/hle/service/glue/bgtc.h | 39 - src/core/hle/service/glue/ectx.cpp | 38 +- src/core/hle/service/glue/ectx.h | 26 - src/core/hle/service/glue/errors.h | 3 + src/core/hle/service/glue/glue.h | 3 + src/core/hle/service/glue/glue_manager.cpp | 3 + src/core/hle/service/glue/glue_manager.h | 3 + src/core/hle/service/glue/notif.cpp | 96 +- src/core/hle/service/glue/notif.h | 2 - src/core/hle/service/glue/time/alarm_worker.h | 3 + .../glue/time/file_timestamp_worker.cpp | 3 + .../service/glue/time/file_timestamp_worker.h | 3 + src/core/hle/service/glue/time/manager.cpp | 2 +- src/core/hle/service/glue/time/manager.h | 3 + .../glue/time/pm_state_change_handler.cpp | 3 + .../glue/time/pm_state_change_handler.h | 3 + .../time/standard_steady_clock_resource.cpp | 3 + .../time/standard_steady_clock_resource.h | 3 + src/core/hle/service/glue/time/static.cpp | 56 +- src/core/hle/service/glue/time/static.h | 3 +- src/core/hle/service/glue/time/time_zone.cpp | 40 +- src/core/hle/service/glue/time/time_zone.h | 1 - .../service/glue/time/time_zone_binary.cpp | 3 + .../hle/service/glue/time/time_zone_binary.h | 3 + src/core/hle/service/glue/time/worker.h | 3 + src/core/hle/service/gpio/gpio.cpp | 16 +- src/core/hle/service/grc/grc.cpp | 39 +- src/core/hle/service/grc/grc.h | 3 + .../hid/active_vibration_device_list.cpp | 14 +- .../hid/active_vibration_device_list.h | 2 +- src/core/hle/service/hid/applet_resource.cpp | 11 +- src/core/hle/service/hid/applet_resource.h | 1 - src/core/hle/service/hid/hid.cpp | 365 +-- src/core/hle/service/hid/hid.h | 3 + src/core/hle/service/hid/hid_debug_server.cpp | 294 +++ src/core/hle/service/hid/hid_debug_server.h | 26 + src/core/hle/service/hid/hid_server.cpp | 396 ++-- src/core/hle/service/hid/hid_server.h | 2 - .../hle/service/hid/hid_system_server.cpp | 246 ++ src/core/hle/service/hid/hid_system_server.h | 246 -- src/core/hle/service/hid/hidbus.cpp | 42 +- src/core/hle/service/hid/hidbus.h | 2 - src/core/hle/service/hid/irs.cpp | 58 +- src/core/hle/service/hid/irs.h | 12 - src/core/hle/service/hid/xcd.cpp | 27 + src/core/hle/service/hid/xcd.h | 27 - src/core/hle/service/i2c/i2c.cpp | 54 +- src/core/hle/service/jit/jit.cpp | 37 +- src/core/hle/service/jit/jit.h | 3 + src/core/hle/service/jit/jit_context.h | 3 + src/core/hle/service/lbl/lbl.cpp | 71 +- src/core/hle/service/lbl/lbl.h | 3 + src/core/hle/service/ldn/lan_discovery.cpp | 3 +- src/core/hle/service/ldn/lan_discovery.h | 3 + src/core/hle/service/ldn/ldn.cpp | 138 +- src/core/hle/service/ldn/ldn.h | 3 + src/core/hle/service/ldn/ldn_results.h | 3 + src/core/hle/service/ldn/monitor_service.cpp | 28 +- src/core/hle/service/ldn/monitor_service.h | 1 - .../hle/service/ldn/sf_monitor_service.cpp | 18 +- src/core/hle/service/ldn/sf_monitor_service.h | 1 - src/core/hle/service/ldn/sf_service.cpp | 40 + src/core/hle/service/ldn/sf_service.h | 24 + .../hle/service/ldn/sf_service_monitor.cpp | 38 +- src/core/hle/service/ldn/sf_service_monitor.h | 4 +- .../system_local_communication_service.cpp | 72 +- .../ldn/system_local_communication_service.h | 1 - .../ldn/user_local_communication_service.cpp | 73 +- .../ldn/user_local_communication_service.h | 5 +- src/core/hle/service/ldr/ldr.cpp | 53 +- src/core/hle/service/ldr/ldr.h | 3 + src/core/hle/service/lm/lm.cpp | 55 +- src/core/hle/service/lm/lm.h | 3 + src/core/hle/service/mig/mig.cpp | 84 +- src/core/hle/service/mig/mig.h | 3 + src/core/hle/service/mii/mii.cpp | 134 +- src/core/hle/service/mii/mii.h | 1 - src/core/hle/service/mii/mii_database.cpp | 2 +- src/core/hle/service/mii/mii_database.h | 3 + .../hle/service/mii/mii_database_manager.h | 3 + src/core/hle/service/mii/mii_manager.h | 3 + src/core/hle/service/mii/mii_result.h | 3 + src/core/hle/service/mii/mii_types.h | 3 + src/core/hle/service/mii/types/char_info.cpp | 3 + src/core/hle/service/mii/types/char_info.h | 3 + src/core/hle/service/mii/types/core_data.cpp | 3 + src/core/hle/service/mii/types/core_data.h | 3 + src/core/hle/service/mii/types/raw_data.h | 3 + src/core/hle/service/mii/types/store_data.cpp | 3 + src/core/hle/service/mii/types/store_data.h | 3 + .../hle/service/mii/types/ver3_store_data.cpp | 3 + .../hle/service/mii/types/ver3_store_data.h | 3 + src/core/hle/service/mm/mm_u.cpp | 27 +- src/core/hle/service/mm/mm_u.h | 3 + src/core/hle/service/mnpp/mnpp.cpp | 62 +- src/core/hle/service/ncm/ncm.cpp | 220 +- src/core/hle/service/ncm/ncm.h | 3 + src/core/hle/service/nfc/common/device.h | 3 + .../hle/service/nfc/common/device_manager.h | 3 + src/core/hle/service/nfc/mifare_result.h | 3 + src/core/hle/service/nfc/mifare_types.h | 3 + src/core/hle/service/nfc/nfc.cpp | 230 +- src/core/hle/service/nfc/nfc.h | 3 + src/core/hle/service/nfc/nfc_interface.h | 3 + src/core/hle/service/nfc/nfc_result.h | 3 + src/core/hle/service/nfc/nfc_types.h | 2 +- src/core/hle/service/nfp/nfp.cpp | 266 +-- src/core/hle/service/nfp/nfp.h | 3 + src/core/hle/service/nfp/nfp_interface.h | 3 + src/core/hle/service/nfp/nfp_result.h | 3 + src/core/hle/service/nfp/nfp_types.h | 2 +- src/core/hle/service/ngc/ngc.cpp | 160 +- src/core/hle/service/ngc/ngc.h | 3 + src/core/hle/service/nifm/nifm.cpp | 227 +- src/core/hle/service/nifm/nifm.h | 1 - src/core/hle/service/nim/nim.cpp | 681 +++--- src/core/hle/service/nim/nim.h | 3 + src/core/hle/service/npns/npns.cpp | 196 +- src/core/hle/service/npns/npns.h | 3 + .../service/ns/account_proxy_interface.cpp | 7 + .../hle/service/ns/account_proxy_interface.h | 7 - .../ns/application_manager_interface.cpp | 904 ++++---- .../ns/application_manager_interface.h | 1 - .../ns/application_version_interface.cpp | 19 + .../ns/application_version_interface.h | 19 - src/core/hle/service/ns/async_result.cpp | 18 +- src/core/hle/service/ns/async_result.h | 1 - .../ns/content_management_interface.cpp | 16 + .../service/ns/content_management_interface.h | 16 - src/core/hle/service/ns/develop_interface.cpp | 25 + src/core/hle/service/ns/develop_interface.h | 25 - .../hle/service/ns/document_interface.cpp | 9 + src/core/hle/service/ns/document_interface.h | 9 - .../service/ns/download_task_interface.cpp | 15 + .../hle/service/ns/download_task_interface.h | 15 - .../service/ns/dynamic_rights_interface.cpp | 70 +- .../hle/service/ns/dynamic_rights_interface.h | 2 - .../hle/service/ns/ecommerce_interface.cpp | 13 + src/core/hle/service/ns/ecommerce_interface.h | 13 - .../service/ns/factory_reset_interface.cpp | 26 +- .../hle/service/ns/factory_reset_interface.h | 1 - src/core/hle/service/ns/ns.cpp | 63 +- src/core/hle/service/ns/ns.h | 3 + src/core/hle/service/ns/ns_results.h | 3 + .../service/ns/platform_service_manager.cpp | 44 +- .../hle/service/ns/platform_service_manager.h | 9 +- src/core/hle/service/ns/query_service.cpp | 64 +- src/core/hle/service/ns/query_service.h | 1 - ...nly_application_control_data_interface.cpp | 48 +- ..._only_application_control_data_interface.h | 2 - ...read_only_application_record_interface.cpp | 19 +- .../read_only_application_record_interface.h | 2 - .../service/ns/service_getter_interface.cpp | 34 +- .../hle/service/ns/service_getter_interface.h | 2 - .../hle/service/ns/system_update_control.cpp | 29 + .../hle/service/ns/system_update_control.h | 29 - .../service/ns/system_update_interface.cpp | 46 +- .../hle/service/ns/system_update_interface.h | 2 +- .../nvdrv/devices/ioctl_serialization.h | 2 +- src/core/hle/service/nvdrv/devices/nvdevice.h | 3 + .../hle/service/nvdrv/devices/nvhost_gpu.cpp | 2 +- .../hle/service/nvdrv/devices/nvhost_nvdec.h | 3 + .../hle/service/nvdrv/devices/nvhost_nvjpg.h | 3 + .../hle/service/nvdrv/devices/nvhost_vic.h | 3 + src/core/hle/service/nvdrv/nvdrv.cpp | 74 +- .../hle/service/nvdrv/nvdrv_interface.cpp | 18 + src/core/hle/service/nvdrv/nvdrv_interface.h | 21 +- src/core/hle/service/nvdrv/nvmemp.cpp | 5 + src/core/hle/service/nvdrv/nvmemp.h | 8 - src/core/hle/service/nvnflinger/binder.h | 3 + src/core/hle/service/nvnflinger/buffer_item.h | 3 + .../service/nvnflinger/buffer_item_consumer.h | 3 + .../nvnflinger/buffer_queue_consumer.h | 3 + .../service/nvnflinger/buffer_queue_defs.h | 3 + .../nvnflinger/buffer_transform_flags.h | 3 + .../hle/service/nvnflinger/consumer_base.h | 3 + .../service/nvnflinger/consumer_listener.h | 3 + .../nvnflinger/graphic_buffer_producer.cpp | 3 + .../nvnflinger/graphic_buffer_producer.h | 3 + .../service/nvnflinger/hos_binder_driver.cpp | 17 +- .../service/nvnflinger/hos_binder_driver.h | 1 - .../hle/service/nvnflinger/nvnflinger.cpp | 3 + src/core/hle/service/nvnflinger/nvnflinger.h | 3 + src/core/hle/service/nvnflinger/parcel.h | 2 +- .../hle/service/nvnflinger/pixel_format.h | 3 + .../service/nvnflinger/producer_listener.h | 3 + src/core/hle/service/nvnflinger/status.h | 3 + .../service/nvnflinger/ui/graphic_buffer.cpp | 3 + .../service/nvnflinger/ui/graphic_buffer.h | 3 + src/core/hle/service/nvnflinger/window.h | 3 + .../hle/service/olsc/daemon_controller.cpp | 36 +- src/core/hle/service/olsc/daemon_controller.h | 2 - .../hle/service/olsc/native_handle_holder.cpp | 14 +- .../hle/service/olsc/native_handle_holder.h | 1 - src/core/hle/service/olsc/olsc.cpp | 173 +- src/core/hle/service/olsc/olsc.h | 3 + .../olsc/olsc_service_for_application.cpp | 56 +- .../olsc/olsc_service_for_application.h | 2 - .../olsc/olsc_service_for_system_service.cpp | 144 ++ .../olsc/olsc_service_for_system_service.h | 53 + .../olsc/remote_storage_controller.cpp | 72 +- .../service/olsc/remote_storage_controller.h | 2 - .../olsc/transfer_task_list_controller.cpp | 74 +- .../olsc/transfer_task_list_controller.h | 2 - src/core/hle/service/omm/omm.cpp | 3 + src/core/hle/service/omm/omm.h | 3 + .../service/omm/operation_mode_manager.cpp | 35 + .../hle/service/omm/operation_mode_manager.h | 35 - .../hle/service/omm/policy_manager_system.cpp | 12 + .../hle/service/omm/policy_manager_system.h | 12 - .../hle/service/omm/power_state_interface.cpp | 18 + .../hle/service/omm/power_state_interface.h | 18 - src/core/hle/service/os/multi_wait.cpp | 3 + src/core/hle/service/os/multi_wait.h | 3 + src/core/hle/service/os/multi_wait_holder.cpp | 3 + src/core/hle/service/os/multi_wait_holder.h | 3 + src/core/hle/service/os/multi_wait_utils.h | 3 + src/core/hle/service/os/mutex.h | 3 + src/core/hle/service/pcie/pcie.cpp | 90 +- src/core/hle/service/pcie/pcie.h | 3 + .../service/pctl/parental_control_service.cpp | 498 ++++ .../service/pctl/parental_control_service.h | 99 + .../pctl/parental_control_service_factory.cpp | 44 + .../pctl/parental_control_service_factory.h | 34 + src/core/hle/service/pctl/pctl.cpp | 633 +---- src/core/hle/service/pctl/pctl.h | 3 + src/core/hle/service/pctl/pctl_results.h | 18 + src/core/hle/service/pctl/pctl_types.h | 73 + src/core/hle/service/pcv/pcv.cpp | 172 +- src/core/hle/service/pcv/pcv.h | 3 + src/core/hle/service/pm/pm.cpp | 100 +- src/core/hle/service/pm/pm.h | 3 + src/core/hle/service/prepo/prepo.cpp | 91 +- src/core/hle/service/prepo/prepo.h | 3 + src/core/hle/service/psc/ovln/ovln_types.h | 2 +- src/core/hle/service/psc/ovln/receiver.cpp | 118 + src/core/hle/service/psc/ovln/receiver.h | 46 + .../hle/service/psc/ovln/receiver_service.cpp | 123 +- .../hle/service/psc/ovln/receiver_service.h | 2 - src/core/hle/service/psc/ovln/sender.cpp | 35 + src/core/hle/service/psc/ovln/sender.h | 24 + .../hle/service/psc/ovln/sender_service.cpp | 40 +- .../hle/service/psc/ovln/sender_service.h | 5 +- src/core/hle/service/psc/pm_control.cpp | 31 + src/core/hle/service/psc/pm_control.h | 19 + src/core/hle/service/psc/pm_module.cpp | 27 + src/core/hle/service/psc/pm_module.h | 19 + src/core/hle/service/psc/pm_service.cpp | 31 + src/core/hle/service/psc/pm_service.h | 25 + src/core/hle/service/psc/psc.cpp | 181 +- src/core/hle/service/psc/psc.h | 3 + src/core/hle/service/psc/time/alarms.cpp | 24 +- src/core/hle/service/psc/time/alarms.h | 21 +- .../ephemeral_network_system_clock_core.h | 3 + .../standard_local_system_clock_core.cpp | 3 + .../clocks/standard_local_system_clock_core.h | 3 + .../standard_network_system_clock_core.cpp | 3 + .../standard_network_system_clock_core.h | 3 + .../clocks/standard_steady_clock_core.cpp | 3 + .../time/clocks/standard_steady_clock_core.h | 3 + .../clocks/standard_user_system_clock_core.h | 3 + .../psc/time/clocks/steady_clock_core.h | 3 + .../psc/time/clocks/system_clock_core.cpp | 3 + .../psc/time/clocks/system_clock_core.h | 3 + .../clocks/tick_based_steady_clock_core.cpp | 3 + .../clocks/tick_based_steady_clock_core.h | 3 + src/core/hle/service/psc/time/common.cpp | 3 + src/core/hle/service/psc/time/manager.h | 28 +- .../psc/time/power_state_request_manager.h | 3 + .../service/psc/time/power_state_service.cpp | 19 +- .../service/psc/time/power_state_service.h | 1 - .../hle/service/psc/time/service_manager.cpp | 48 +- .../hle/service/psc/time/service_manager.h | 2 - .../hle/service/psc/time/shared_memory.cpp | 3 + src/core/hle/service/psc/time/static.cpp | 50 +- src/core/hle/service/psc/time/static.h | 2 - .../hle/service/psc/time/steady_clock.cpp | 28 +- src/core/hle/service/psc/time/steady_clock.h | 2 - .../hle/service/psc/time/system_clock.cpp | 24 +- src/core/hle/service/psc/time/system_clock.h | 1 - src/core/hle/service/psc/time/time_zone.cpp | 3 + src/core/hle/service/psc/time/time_zone.h | 3 + .../service/psc/time/time_zone_service.cpp | 42 +- .../hle/service/psc/time/time_zone_service.h | 1 - src/core/hle/service/ptm/psm.cpp | 53 +- src/core/hle/service/ptm/psm.h | 25 - src/core/hle/service/ptm/ptm.cpp | 32 +- src/core/hle/service/ptm/ptm.h | 3 + src/core/hle/service/ptm/ts.cpp | 29 +- src/core/hle/service/ptm/ts.h | 11 - src/core/hle/service/ro/ro.cpp | 371 +-- src/core/hle/service/ro/ro.h | 3 + src/core/hle/service/ro/ro_nro_utils.cpp | 188 ++ src/core/hle/service/ro/ro_nro_utils.h | 29 + src/core/hle/service/ro/ro_results.h | 29 + src/core/hle/service/ro/ro_types.h | 142 ++ src/core/hle/service/server_manager.h | 3 + src/core/hle/service/service.cpp | 69 +- src/core/hle/service/service.h | 145 +- src/core/hle/service/services.h | 2 +- .../service/set/factory_settings_server.cpp | 49 + .../hle/service/set/factory_settings_server.h | 49 - .../set/firmware_debug_settings_server.cpp | 17 + .../set/firmware_debug_settings_server.h | 17 - src/core/hle/service/set/key_code_map.h | 3 + .../set/setting_formats/appln_settings.cpp | 3 + .../set/setting_formats/appln_settings.h | 3 + .../set/setting_formats/device_settings.cpp | 3 + .../set/setting_formats/private_settings.cpp | 3 + .../set/setting_formats/private_settings.h | 3 + .../set/setting_formats/system_settings.cpp | 2 +- src/core/hle/service/set/settings.h | 3 + src/core/hle/service/set/settings_server.cpp | 38 +- src/core/hle/service/set/settings_server.h | 36 +- .../service/set/system_settings_server.cpp | 465 ++-- .../hle/service/set/system_settings_server.h | 2 +- src/core/hle/service/sm/sm.cpp | 205 +- src/core/hle/service/sm/sm.h | 24 +- src/core/hle/service/sm/sm_controller.cpp | 128 ++ src/core/hle/service/sm/sm_controller.h | 30 + src/core/hle/service/sockets/bsd.cpp | 81 + src/core/hle/service/sockets/bsd.h | 82 +- src/core/hle/service/sockets/nsd.cpp | 32 + src/core/hle/service/sockets/nsd.h | 32 - src/core/hle/service/sockets/sfdnsres.cpp | 27 + src/core/hle/service/sockets/sfdnsres.h | 31 - src/core/hle/service/sockets/sockets.cpp | 62 +- .../hle/service/sockets/sockets_translate.h | 3 + src/core/hle/service/spl/spl.cpp | 171 +- src/core/hle/service/spl/spl.h | 141 -- src/core/hle/service/spl/spl_module.cpp | 15 +- src/core/hle/service/spl/spl_results.h | 3 + src/core/hle/service/spl/spl_types.h | 3 + src/core/hle/service/ssl/cert_store.cpp | 3 + src/core/hle/service/ssl/cert_store.h | 3 + src/core/hle/service/ssl/ssl.cpp | 397 ++-- src/core/hle/service/ssl/ssl.h | 3 + src/core/hle/service/ssl/ssl_types.h | 3 + src/core/hle/service/tma/tma.cpp | 12 +- src/core/hle/service/usb/usb.cpp | 290 +-- src/core/hle/service/usb/usb.h | 3 + .../vi/application_display_service.cpp | 56 +- .../service/vi/application_display_service.h | 2 +- .../service/vi/application_root_service.cpp | 13 +- .../hle/service/vi/application_root_service.h | 1 - src/core/hle/service/vi/display.h | 3 + src/core/hle/service/vi/display_list.h | 3 + src/core/hle/service/vi/layer.h | 3 + src/core/hle/service/vi/layer_list.h | 3 + .../service/vi/manager_display_service.cpp | 174 +- .../hle/service/vi/manager_display_service.h | 1 - .../hle/service/vi/manager_root_service.cpp | 21 +- .../hle/service/vi/manager_root_service.h | 1 - src/core/hle/service/vi/service_creator.cpp | 3 + src/core/hle/service/vi/service_creator.h | 3 + .../hle/service/vi/shared_buffer_manager.h | 4 - .../hle/service/vi/system_display_service.cpp | 110 +- .../hle/service/vi/system_display_service.h | 1 - .../hle/service/vi/system_root_service.cpp | 17 +- src/core/hle/service/vi/system_root_service.h | 1 - src/core/hle/service/vi/vi.cpp | 3 + src/core/hle/service/vi/vi.h | 3 + src/core/hle/service/vi/vi_results.h | 3 + src/core/hle/service/vi/vi_types.h | 3 + src/core/hle/service/wlan/wlan.cpp | 368 ++- tools/README.md | 2 +- 588 files changed, 14723 insertions(+), 12534 deletions(-) rename docs/{SubsystemHLE.md => HosKernel.md} (55%) create mode 100644 src/core/hle/service/am/service/all_system_applet_proxies_service.cpp create mode 100644 src/core/hle/service/am/service/all_system_applet_proxies_service.h create mode 100644 src/core/hle/service/am/service/applet_common_functions.cpp create mode 100644 src/core/hle/service/am/service/applet_common_functions.h create mode 100644 src/core/hle/service/am/service/application_proxy.cpp create mode 100644 src/core/hle/service/am/service/application_proxy.h create mode 100644 src/core/hle/service/am/service/application_proxy_service.cpp create mode 100644 src/core/hle/service/am/service/application_proxy_service.h create mode 100644 src/core/hle/service/am/service/debug_functions.cpp create mode 100644 src/core/hle/service/am/service/debug_functions.h create mode 100644 src/core/hle/service/am/service/library_applet_creator.cpp create mode 100644 src/core/hle/service/am/service/library_applet_creator.h create mode 100644 src/core/hle/service/am/service/library_applet_proxy.cpp create mode 100644 src/core/hle/service/am/service/library_applet_proxy.h create mode 100644 src/core/hle/service/am/service/library_applet_self_accessor.cpp create mode 100644 src/core/hle/service/am/service/library_applet_self_accessor.h create mode 100644 src/core/hle/service/am/service/lock_accessor.cpp create mode 100644 src/core/hle/service/am/service/lock_accessor.h create mode 100644 src/core/hle/service/am/service/overlay_applet_proxy.cpp create mode 100644 src/core/hle/service/am/service/overlay_applet_proxy.h create mode 100644 src/core/hle/service/am/service/storage_accessor.cpp create mode 100644 src/core/hle/service/am/service/storage_accessor.h create mode 100644 src/core/hle/service/am/service/system_applet_proxy.cpp create mode 100644 src/core/hle/service/am/service/system_applet_proxy.h create mode 100644 src/core/hle/service/btm/btm_debug.cpp create mode 100644 src/core/hle/service/btm/btm_debug.h create mode 100644 src/core/hle/service/btm/btm_system.cpp create mode 100644 src/core/hle/service/btm/btm_system.h create mode 100644 src/core/hle/service/btm/btm_system_core.cpp create mode 100644 src/core/hle/service/btm/btm_system_core.h create mode 100644 src/core/hle/service/btm/btm_user.cpp create mode 100644 src/core/hle/service/btm/btm_user.h create mode 100644 src/core/hle/service/btm/btm_user_core.cpp create mode 100644 src/core/hle/service/btm/btm_user_core.h create mode 100644 src/core/hle/service/caps/caps_a.cpp create mode 100644 src/core/hle/service/caps/caps_a.h create mode 100644 src/core/hle/service/fatal/fatal_p.cpp create mode 100644 src/core/hle/service/fatal/fatal_p.h create mode 100644 src/core/hle/service/fatal/fatal_u.cpp create mode 100644 src/core/hle/service/fatal/fatal_u.h create mode 100644 src/core/hle/service/friend/friend_interface.cpp create mode 100644 src/core/hle/service/friend/friend_interface.h create mode 100644 src/core/hle/service/ldn/sf_service.cpp create mode 100644 src/core/hle/service/ldn/sf_service.h create mode 100644 src/core/hle/service/olsc/olsc_service_for_system_service.cpp create mode 100644 src/core/hle/service/olsc/olsc_service_for_system_service.h create mode 100644 src/core/hle/service/pctl/parental_control_service.cpp create mode 100644 src/core/hle/service/pctl/parental_control_service.h create mode 100644 src/core/hle/service/pctl/parental_control_service_factory.cpp create mode 100644 src/core/hle/service/pctl/parental_control_service_factory.h create mode 100644 src/core/hle/service/pctl/pctl_results.h create mode 100644 src/core/hle/service/pctl/pctl_types.h create mode 100644 src/core/hle/service/psc/ovln/receiver.cpp create mode 100644 src/core/hle/service/psc/ovln/receiver.h create mode 100644 src/core/hle/service/psc/ovln/sender.cpp create mode 100644 src/core/hle/service/psc/ovln/sender.h create mode 100644 src/core/hle/service/psc/pm_control.cpp create mode 100644 src/core/hle/service/psc/pm_control.h create mode 100644 src/core/hle/service/psc/pm_module.cpp create mode 100644 src/core/hle/service/psc/pm_module.h create mode 100644 src/core/hle/service/psc/pm_service.cpp create mode 100644 src/core/hle/service/psc/pm_service.h create mode 100644 src/core/hle/service/ro/ro_nro_utils.cpp create mode 100644 src/core/hle/service/ro/ro_nro_utils.h create mode 100644 src/core/hle/service/ro/ro_results.h create mode 100644 src/core/hle/service/ro/ro_types.h create mode 100644 src/core/hle/service/sm/sm_controller.cpp create mode 100644 src/core/hle/service/sm/sm_controller.h diff --git a/docs/DesignOverview.md b/docs/DesignOverview.md index 959fbfdbb2..c6a328cb9c 100644 --- a/docs/DesignOverview.md +++ b/docs/DesignOverview.md @@ -1,6 +1,6 @@ # Design Overview -Modern game consoles require heavy power to emulate. This is why the emulator uses an approach known as HLE (High-Level-Emulation), in a nutshell: Instead of accurately emulating every subsystem that forms part of a component, emulate the resulting visible output of said interface instead. +Modern game consoles require heavy power to be emulated appropriately. This is why the emulator uses an approach known as HLE (High-Level-Emulation), in a nutshell: Instead of accurately emulating every subsystem that forms part of a component, emulate the resulting visible I/O interface instead. For example, take a disk write, instead of emulating a proper SD card we instead use the C++ standard library for I/O. Additionally we use the abstractions provided by the `fs` service to "lie" to programs about certain SD card properties. Notably this includes making up sizes for the fake SD card, giving "realistic" values or expected outputs for a given card, and so on. And instead of writing to an actual SD card, the emulator simply writes to a file. diff --git a/docs/SubsystemHLE.md b/docs/HosKernel.md similarity index 55% rename from docs/SubsystemHLE.md rename to docs/HosKernel.md index 7a59fef9fa..87df2072a5 100644 --- a/docs/SubsystemHLE.md +++ b/docs/HosKernel.md @@ -1,6 +1,4 @@ -# Subsystem: HLE - -## HOS Kernel +# HOS Kernel In brief, the HOS kernel is a microkernel, all services and programs run in userspace, the primary way to do communication between these is via `HIPC` (not covered here); otherwise most of the primitives reside in the forms of syscalls invoked via `svc #imm`. The kernel supports both 32-bit and 64-bit programs, and has the capacity to use 32, 36 and 39 bits of address space for spawned processes. Most of the networking stack is based off FreeBSD's network stack. @@ -31,52 +29,3 @@ Every process keeps it's own tracking of the following structures: The emulator willingly restricts itself to only use 4 threads (to emulate 4 cores), this is because most existing applications do not benefit greatly from the added core count, and in fact can be detrimental due to extra contention. This translates equitatively to about 4 `ArmInterface` slots for each process, these are then redirected to whatever is the last `pc` of the last thread running on the core is meant to be; proceed to run it, then when returning (due to halt or interruption), proceed to reschedule the thread. The scheduler as-is isn't 100% faithful to the original (for example the original is cooperative and not preemptive), and has great timing variance (especially due to the fact the emulator can run in systems with wildly different timings). - -## Services - -Consult [SwitchBrew](https://switchbrew.org/) for per-service methods, and implementation details. - -All services are instatiated implicitly using `ServiceFramework`. To register a new interface or service, you can inherit from said class, providing additionally a template parameter that references `Self`, for example: - -```c++ -// Follows as: -// class MyInterface [final] : public ServiceFramework { ... }; -// [final] is optional, but should be used whenever there is no intention of this class itself being inherited. -class IFloatingRegistrationRequest final : public ServiceFramework { -public: - // ctor, you can pass extra parameters here (if so required) - explicit IFloatingRegistrationRequest(Core::System& system_) - : ServiceFramework{system_, "IFloatingRegistrationRequest"} - {} - - // Must be placed after all methods are defined (or declared). - // Define here your functions and methods, please order them. - // Use FindRequestTipc for TIPC handlers. - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetSessionId"}, - FunctionInfo{12, nullptr, "GetAccountId"}, - FunctionInfo{13, nullptr, "GetLinkedNintendoAccountId"}, - FunctionInfo{14, nullptr, "GetNickname"}, - FunctionInfo{15, nullptr, "GetProfileImage"}, - FunctionInfo{16, nullptr, "GetProfileLargeImage", MakeVersionGate({18,0,0})}, - FunctionInfo{21, nullptr, "LoadIdTokenCache"}, - FunctionInfo{100, nullptr, "RegisterUser"}, - FunctionInfo{101, nullptr, "RegisterUserWithUid"}, - FunctionInfo{102, nullptr, "RegisterNetworkServiceAccountAsync", MakeVersionGate({4,0,0})}, - FunctionInfo{103, nullptr, "RegisterNetworkServiceAccountWithUidAsync", MakeVersionGate({4,0,0})}, - FunctionInfo{110, nullptr, "SetSystemProgramIdentification"}, - FunctionInfo{111, nullptr, "EnsureIdTokenCacheAsync"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } -}; -``` - -Try to keep service structures local, that is, don't place them on header files if they're only going to be used by a specific service. - -In each `.cpp` file that uses `D<...>/C<...>` CMIF wrapper helpers, remember to include the corresponding instancer, so you don't face linker errors: -```c++ -#include "core/hle/service/cmif_serialization.h" -``` -This will properly instatiate the corresponding wrappers and decompose the provided arguments in the wiring order. diff --git a/docs/README.md b/docs/README.md index f7568e16f3..5bcaf30239 100644 --- a/docs/README.md +++ b/docs/README.md @@ -21,7 +21,7 @@ This contains documentation created by developers, build instructions, guideline - Subsystems: - **[Design Overview](./DesignOverview.md)** - **[Dynarmic](./dynarmic/README.md)** - - **[Subsystem: HLE](./SubsystemHLE.md)** + - **[HOS Kernel](./HosKernel.md)** - **[Settings](./Settings.md)** ## Policies diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index f1d4bdae42..31f9931d3a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -444,18 +444,28 @@ add_library(core STATIC hle/service/am/process_creation.h hle/service/am/process_holder.cpp hle/service/am/process_holder.h + hle/service/am/service/all_system_applet_proxies_service.cpp + hle/service/am/service/all_system_applet_proxies_service.h + hle/service/am/service/applet_common_functions.cpp + hle/service/am/service/applet_common_functions.h hle/service/am/service/application_accessor.cpp hle/service/am/service/application_accessor.h hle/service/am/service/application_creator.cpp hle/service/am/service/application_creator.h hle/service/am/service/application_functions.cpp hle/service/am/service/application_functions.h + hle/service/am/service/application_proxy.cpp + hle/service/am/service/application_proxy.h + hle/service/am/service/application_proxy_service.cpp + hle/service/am/service/application_proxy_service.h hle/service/am/service/audio_controller.cpp hle/service/am/service/audio_controller.h hle/service/am/service/common_state_getter.cpp hle/service/am/service/common_state_getter.h hle/service/am/service/cradle_firmware_updater.cpp hle/service/am/service/cradle_firmware_updater.h + hle/service/am/service/debug_functions.cpp + hle/service/am/service/debug_functions.h hle/service/am/service/display_controller.cpp hle/service/am/service/display_controller.h hle/service/am/service/global_state_controller.cpp @@ -464,14 +474,28 @@ add_library(core STATIC hle/service/am/service/home_menu_functions.h hle/service/am/service/library_applet_accessor.cpp hle/service/am/service/library_applet_accessor.h + hle/service/am/service/library_applet_creator.cpp + hle/service/am/service/library_applet_creator.h + hle/service/am/service/library_applet_proxy.cpp + hle/service/am/service/library_applet_proxy.h + hle/service/am/service/library_applet_self_accessor.cpp + hle/service/am/service/library_applet_self_accessor.h + hle/service/am/service/lock_accessor.cpp + hle/service/am/service/lock_accessor.h hle/service/am/service/overlay_functions.cpp hle/service/am/service/overlay_functions.h + hle/service/am/service/overlay_applet_proxy.cpp + hle/service/am/service/overlay_applet_proxy.h hle/service/am/service/process_winding_controller.cpp hle/service/am/service/process_winding_controller.h hle/service/am/service/self_controller.cpp hle/service/am/service/self_controller.h hle/service/am/service/storage.cpp hle/service/am/service/storage.h + hle/service/am/service/storage_accessor.cpp + hle/service/am/service/storage_accessor.h + hle/service/am/service/system_applet_proxy.cpp + hle/service/am/service/system_applet_proxy.h hle/service/am/service/window_controller.cpp hle/service/am/service/window_controller.h hle/service/am/window_system.cpp @@ -556,8 +580,20 @@ add_library(core STATIC hle/service/btdrv/btdrv.h hle/service/btm/btm.cpp hle/service/btm/btm.h + hle/service/btm/btm_debug.cpp + hle/service/btm/btm_debug.h + hle/service/btm/btm_system.cpp + hle/service/btm/btm_system.h + hle/service/btm/btm_system_core.cpp + hle/service/btm/btm_system_core.h + hle/service/btm/btm_user.cpp + hle/service/btm/btm_user.h + hle/service/btm/btm_user_core.cpp + hle/service/btm/btm_user_core.h hle/service/caps/caps.cpp hle/service/caps/caps.h + hle/service/caps/caps_a.cpp + hle/service/caps/caps_a.h hle/service/caps/caps_c.cpp hle/service/caps/caps_c.h hle/service/caps/caps_manager.cpp @@ -582,6 +618,10 @@ add_library(core STATIC hle/service/eupld/eupld.h hle/service/fatal/fatal.cpp hle/service/fatal/fatal.h + hle/service/fatal/fatal_p.cpp + hle/service/fatal/fatal_p.h + hle/service/fatal/fatal_u.cpp + hle/service/fatal/fatal_u.h hle/service/fgm/fgm.cpp hle/service/fgm/fgm.h hle/service/filesystem/filesystem.cpp @@ -613,6 +653,8 @@ add_library(core STATIC hle/service/filesystem/save_data_controller.h hle/service/friend/friend.cpp hle/service/friend/friend.h + hle/service/friend/friend_interface.cpp + hle/service/friend/friend_interface.h hle/service/glue/arp.cpp hle/service/glue/arp.h hle/service/glue/bgtc.cpp @@ -681,6 +723,8 @@ add_library(core STATIC hle/service/ldn/monitor_service.h hle/service/ldn/sf_monitor_service.cpp hle/service/ldn/sf_monitor_service.h + hle/service/ldn/sf_service.cpp + hle/service/ldn/sf_service.h hle/service/ldn/sf_service_monitor.cpp hle/service/ldn/sf_service_monitor.h hle/service/ldn/system_local_communication_service.cpp @@ -869,6 +913,8 @@ add_library(core STATIC hle/service/olsc/native_handle_holder.h hle/service/olsc/olsc_service_for_application.cpp hle/service/olsc/olsc_service_for_application.h + hle/service/olsc/olsc_service_for_system_service.cpp + hle/service/olsc/olsc_service_for_system_service.h hle/service/olsc/olsc.cpp hle/service/olsc/olsc.h hle/service/olsc/remote_storage_controller.cpp @@ -898,8 +944,14 @@ add_library(core STATIC hle/service/os/process.h hle/service/pcie/pcie.cpp hle/service/pcie/pcie.h + hle/service/pctl/parental_control_service_factory.cpp + hle/service/pctl/parental_control_service_factory.h + hle/service/pctl/parental_control_service.cpp + hle/service/pctl/parental_control_service.h hle/service/pctl/pctl.cpp hle/service/pctl/pctl.h + hle/service/pctl/pctl_results.h + hle/service/pctl/pctl_types.h hle/service/pcv/pcv.cpp hle/service/pcv/pcv.h hle/service/pm/pm.cpp @@ -909,8 +961,18 @@ add_library(core STATIC hle/service/psc/ovln/ovln_types.h hle/service/psc/ovln/receiver_service.cpp hle/service/psc/ovln/receiver_service.h + hle/service/psc/ovln/receiver.cpp + hle/service/psc/ovln/receiver.h hle/service/psc/ovln/sender_service.cpp hle/service/psc/ovln/sender_service.h + hle/service/psc/ovln/sender.cpp + hle/service/psc/ovln/sender.h + hle/service/psc/pm_control.cpp + hle/service/psc/pm_control.h + hle/service/psc/pm_module.cpp + hle/service/psc/pm_module.h + hle/service/psc/pm_service.cpp + hle/service/psc/pm_service.h hle/service/psc/psc.cpp hle/service/psc/psc.h hle/service/psc/time/alarms.cpp @@ -961,6 +1023,10 @@ add_library(core STATIC hle/service/ptm/ts.h hle/service/ro/ro.cpp hle/service/ro/ro.h + hle/service/ro/ro_nro_utils.cpp + hle/service/ro/ro_nro_utils.h + hle/service/ro/ro_results.h + hle/service/ro/ro_types.h hle/service/server_manager.cpp hle/service/server_manager.h hle/service/service.cpp @@ -989,6 +1055,8 @@ add_library(core STATIC hle/service/set/system_settings_server.h hle/service/sm/sm.cpp hle/service/sm/sm.h + hle/service/sm/sm_controller.cpp + hle/service/sm/sm_controller.h hle/service/sockets/bsd.cpp hle/service/sockets/bsd.h hle/service/sockets/nsd.cpp @@ -1154,7 +1222,7 @@ target_link_libraries(core PRIVATE RenderDoc::API ZLIB::ZLIB) -target_link_libraries(core PUBLIC httplib::httplib zstd::zstd frozen::frozen-headers) +target_link_libraries(core PUBLIC httplib::httplib zstd::zstd) if (ENABLE_WEB_SERVICE) target_compile_definitions(core PUBLIC ENABLE_WEB_SERVICE) diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 9b29a7773c..d68b6bde0d 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -75,6 +75,41 @@ class IManagerForSystemService final : public ServiceFramework, "CheckAvailability"}, + {1, D<&IManagerForSystemService::GetAccountId>, "GetAccountId"}, + {2, nullptr, "EnsureIdTokenCacheAsync"}, + {3, D<&IManagerForSystemService::LoadIdTokenCacheDeprecated>, "LoadIdTokenCacheDeprecated"}, // 19.0.0+ + {4, D<&IManagerForSystemService::LoadIdTokenCache>, "LoadIdTokenCache"}, // 19.0.0+ + {100, nullptr, "SetSystemProgramIdentification"}, + {101, nullptr, "RefreshNotificationTokenAsync"}, // 7.0.0+ + {110, nullptr, "GetServiceEntryRequirementCache"}, // 4.0.0+ + {111, nullptr, "InvalidateServiceEntryRequirementCache"}, // 4.0.0+ + {112, nullptr, "InvalidateTokenCache"}, // 4.0.0 - 6.2.0 + {113, nullptr, "GetServiceEntryRequirementCacheForOnlinePlay"}, // 6.1.0+ + {120, nullptr, "GetNintendoAccountId"}, + {121, nullptr, "CalculateNintendoAccountAuthenticationFingerprint"}, // 9.0.0+ + {130, nullptr, "GetNintendoAccountUserResourceCache"}, + {131, nullptr, "RefreshNintendoAccountUserResourceCacheAsync"}, + {132, nullptr, "RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed"}, + {133, nullptr, "GetNintendoAccountVerificationUrlCache"}, // 9.0.0+ + {134, nullptr, "RefreshNintendoAccountVerificationUrlCache"}, // 9.0.0+ + {135, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed"}, // 9.0.0+ + {136, nullptr, "GetNintendoAccountUserResourceCache"}, // 19.0.0+ + {140, nullptr, "GetNetworkServiceLicenseCache"}, // 5.0.0+ + {141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+ + {142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+ + {143, D<&IManagerForSystemService::GetNetworkServiceLicenseCacheEx>, "GetNetworkServiceLicenseCacheEx"}, // 15.0.0+ + {150, nullptr, "CreateAuthorizationRequest"}, + {160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, + {161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, + {170, nullptr, "CreateDeviceHistoryRequest"}, // 17.0.0+ + {180, nullptr, "GetRequestForNintendoAccountReauthentication"} // 18.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } private: @@ -108,40 +143,6 @@ private: R_SUCCEED(); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IManagerForSystemService::CheckAvailability>, "CheckAvailability"}, - FunctionInfo{1, D<&IManagerForSystemService::GetAccountId>, "GetAccountId"}, - FunctionInfo{2, nullptr, "EnsureIdTokenCacheAsync"}, - FunctionInfo{3, D<&IManagerForSystemService::LoadIdTokenCacheDeprecated>, "LoadIdTokenCacheDeprecated", MakeVersionGate({19,0,0})}, - FunctionInfo{4, D<&IManagerForSystemService::LoadIdTokenCache>, "LoadIdTokenCache", MakeVersionGate({19,0,0})}, - FunctionInfo{100, nullptr, "SetSystemProgramIdentification"}, - FunctionInfo{101, nullptr, "RefreshNotificationTokenAsync", MakeVersionGate({7,0,0})}, - FunctionInfo{110, nullptr, "GetServiceEntryRequirementCache", MakeVersionGate({4,0,0})}, - FunctionInfo{111, nullptr, "InvalidateServiceEntryRequirementCache", MakeVersionGate({4,0,0})}, - FunctionInfo{112, nullptr, "InvalidateTokenCache", MakeVersionGate({4,0,0}, {6,2,0})}, - FunctionInfo{113, nullptr, "GetServiceEntryRequirementCacheForOnlinePlay", MakeVersionGate({6,1,0})}, - FunctionInfo{120, nullptr, "GetNintendoAccountId"}, - FunctionInfo{121, nullptr, "CalculateNintendoAccountAuthenticationFingerprint", MakeVersionGate({9,0,0})}, - FunctionInfo{130, nullptr, "GetNintendoAccountUserResourceCache"}, - FunctionInfo{131, nullptr, "RefreshNintendoAccountUserResourceCacheAsync"}, - FunctionInfo{132, nullptr, "RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed"}, - FunctionInfo{133, nullptr, "GetNintendoAccountVerificationUrlCache", MakeVersionGate({9,0,0})}, - FunctionInfo{134, nullptr, "RefreshNintendoAccountVerificationUrlCache", MakeVersionGate({9,0,0})}, - FunctionInfo{135, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed", MakeVersionGate({9,0,0})}, - FunctionInfo{136, nullptr, "GetNintendoAccountUserResourceCache", MakeVersionGate({19,0,0})}, - FunctionInfo{140, nullptr, "GetNetworkServiceLicenseCache", MakeVersionGate({5,0,0})}, - FunctionInfo{141, nullptr, "RefreshNetworkServiceLicenseCacheAsync", MakeVersionGate({5,0,0})}, - FunctionInfo{142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed", MakeVersionGate({5,0,0})}, - FunctionInfo{143, D<&IManagerForSystemService::GetNetworkServiceLicenseCacheEx>, "GetNetworkServiceLicenseCacheEx", MakeVersionGate({15,0,0})}, - FunctionInfo{150, nullptr, "CreateAuthorizationRequest"}, - FunctionInfo{160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, - FunctionInfo{161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, - FunctionInfo{170, nullptr, "CreateDeviceHistoryRequest", MakeVersionGate({17,0,0})}, - FunctionInfo{180, nullptr, "GetRequestForNintendoAccountReauthentication", MakeVersionGate({18,0,0})} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } Common::UUID account_id; }; @@ -150,25 +151,25 @@ class IFloatingRegistrationRequest final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; @@ -176,6 +177,62 @@ class IAdministrator final : public ServiceFramework { public: explicit IAdministrator(Core::System& system_, Common::UUID) : ServiceFramework{system_, "IAdministrator"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CheckAvailability"}, + {1, nullptr, "GetAccountId"}, + {2, nullptr, "EnsureIdTokenCacheAsync"}, + {3, nullptr, "LoadIdTokenCache"}, + {100, nullptr, "SetSystemProgramIdentification"}, + {101, nullptr, "RefreshNotificationTokenAsync"}, // 7.0.0+ + {110, nullptr, "GetServiceEntryRequirementCache"}, // 4.0.0+ + {111, nullptr, "InvalidateServiceEntryRequirementCache"}, // 4.0.0+ + {112, nullptr, "InvalidateTokenCache"}, // 4.0.0 - 6.2.0 + {113, nullptr, "GetServiceEntryRequirementCacheForOnlinePlay"}, // 6.1.0+ + {120, nullptr, "GetNintendoAccountId"}, + {121, nullptr, "CalculateNintendoAccountAuthenticationFingerprint"}, // 9.0.0+ + {130, nullptr, "GetNintendoAccountUserResourceCache"}, + {131, nullptr, "RefreshNintendoAccountUserResourceCacheAsync"}, + {132, nullptr, "RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed"}, + {133, nullptr, "GetNintendoAccountVerificationUrlCache"}, // 9.0.0+ + {134, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsync"}, // 9.0.0+ + {135, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed"}, // 9.0.0+ + {140, nullptr, "GetNetworkServiceLicenseCache"}, // 5.0.0+ + {141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+ + {142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+ + {143, nullptr, "GetNetworkServiceLicenseCacheEx"}, + {150, nullptr, "CreateAuthorizationRequest"}, + {160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, + {161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, + {170, nullptr, "CreateDeviceHistoryRequest"}, // 17.0.0+ + {180, nullptr, "GetRequestForNintendoAccountReauthentication"}, // 18.0.0+ + {200, nullptr, "IsRegistered"}, + {201, nullptr, "RegisterAsync"}, + {202, nullptr, "UnregisterAsync"}, + {203, nullptr, "DeleteRegistrationInfoLocally"}, + {220, nullptr, "SynchronizeProfileAsync"}, + {221, nullptr, "UploadProfileAsync"}, + {222, nullptr, "SynchronizaProfileAsyncIfSecondsElapsed"}, + {250, &IAdministrator::IsLinkedWithNintendoAccount, "IsLinkedWithNintendoAccount"}, + {251, nullptr, "CreateProcedureToLinkWithNintendoAccount"}, + {252, nullptr, "ResumeProcedureToLinkWithNintendoAccount"}, + {255, nullptr, "CreateProcedureToUpdateLinkageStateOfNintendoAccount"}, + {256, nullptr, "ResumeProcedureToUpdateLinkageStateOfNintendoAccount"}, + {260, nullptr, "CreateProcedureToLinkNnidWithNintendoAccount"}, // 3.0.0+ + {261, nullptr, "ResumeProcedureToLinkNnidWithNintendoAccount"}, // 3.0.0+ + {280, nullptr, "ProxyProcedureToAcquireApplicationAuthorizationForNintendoAccount"}, + {290, nullptr, "GetRequestForNintendoAccountUserResourceView"}, // 8.0.0+ + {300, nullptr, "TryRecoverNintendoAccountUserStateAsync"}, // 6.0.0+ + {400, nullptr, "IsServiceEntryRequirementCacheRefreshRequiredForOnlinePlay"}, // 6.1.0+ + {401, nullptr, "RefreshServiceEntryRequirementCacheForOnlinePlayAsync"}, // 6.1.0+ + {900, nullptr, "GetAuthenticationInfoForWin"}, // 9.0.0+ + {901, nullptr, "ImportAsyncForWin"}, // 9.0.0+ + {997, nullptr, "DebugUnlinkNintendoAccountAsync"}, + {998, nullptr, "DebugSetAvailabilityErrorDetail"}, + }; + // clang-format on + + RegisterHandlers(functions); } private: @@ -184,97 +241,42 @@ private: rb.Push(ResultSuccess); rb.Push(false); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CheckAvailability"}, - FunctionInfo{1, nullptr, "GetAccountId"}, - FunctionInfo{2, nullptr, "EnsureIdTokenCacheAsync"}, - FunctionInfo{3, nullptr, "LoadIdTokenCache"}, - FunctionInfo{100, nullptr, "SetSystemProgramIdentification"}, - FunctionInfo{101, nullptr, "RefreshNotificationTokenAsync", MakeVersionGate({7,0,0})}, - FunctionInfo{110, nullptr, "GetServiceEntryRequirementCache", MakeVersionGate({4,0,0})}, - FunctionInfo{111, nullptr, "InvalidateServiceEntryRequirementCache", MakeVersionGate({4,0,0})}, - FunctionInfo{112, nullptr, "InvalidateTokenCache", MakeVersionGate({4,0,0}, {6,2,0})}, - FunctionInfo{113, nullptr, "GetServiceEntryRequirementCacheForOnlinePlay", MakeVersionGate({6,1,0})}, - FunctionInfo{120, nullptr, "GetNintendoAccountId"}, - FunctionInfo{121, nullptr, "CalculateNintendoAccountAuthenticationFingerprint", MakeVersionGate({9,0,0})}, - FunctionInfo{130, nullptr, "GetNintendoAccountUserResourceCache"}, - FunctionInfo{131, nullptr, "RefreshNintendoAccountUserResourceCacheAsync"}, - FunctionInfo{132, nullptr, "RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed"}, - FunctionInfo{133, nullptr, "GetNintendoAccountVerificationUrlCache", MakeVersionGate({9,0,0})}, - FunctionInfo{134, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsync", MakeVersionGate({9,0,0})}, - FunctionInfo{135, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed", MakeVersionGate({9,0,0})}, - FunctionInfo{140, nullptr, "GetNetworkServiceLicenseCache", MakeVersionGate({5,0,0})}, - FunctionInfo{141, nullptr, "RefreshNetworkServiceLicenseCacheAsync", MakeVersionGate({5,0,0})}, - FunctionInfo{142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed", MakeVersionGate({5,0,0})}, - FunctionInfo{143, nullptr, "GetNetworkServiceLicenseCacheEx"}, - FunctionInfo{150, nullptr, "CreateAuthorizationRequest"}, - FunctionInfo{160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, - FunctionInfo{161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, - FunctionInfo{170, nullptr, "CreateDeviceHistoryRequest", MakeVersionGate({17,0,0})}, - FunctionInfo{180, nullptr, "GetRequestForNintendoAccountReauthentication", MakeVersionGate({18,0,0})}, - FunctionInfo{200, nullptr, "IsRegistered"}, - FunctionInfo{201, nullptr, "RegisterAsync"}, - FunctionInfo{202, nullptr, "UnregisterAsync"}, - FunctionInfo{203, nullptr, "DeleteRegistrationInfoLocally"}, - FunctionInfo{220, nullptr, "SynchronizeProfileAsync"}, - FunctionInfo{221, nullptr, "UploadProfileAsync"}, - FunctionInfo{222, nullptr, "SynchronizaProfileAsyncIfSecondsElapsed"}, - FunctionInfo{250, &IAdministrator::IsLinkedWithNintendoAccount, "IsLinkedWithNintendoAccount"}, - FunctionInfo{251, nullptr, "CreateProcedureToLinkWithNintendoAccount"}, - FunctionInfo{252, nullptr, "ResumeProcedureToLinkWithNintendoAccount"}, - FunctionInfo{255, nullptr, "CreateProcedureToUpdateLinkageStateOfNintendoAccount"}, - FunctionInfo{256, nullptr, "ResumeProcedureToUpdateLinkageStateOfNintendoAccount"}, - FunctionInfo{260, nullptr, "CreateProcedureToLinkNnidWithNintendoAccount", MakeVersionGate({3,0,0})}, - FunctionInfo{261, nullptr, "ResumeProcedureToLinkNnidWithNintendoAccount", MakeVersionGate({3,0,0})}, - FunctionInfo{280, nullptr, "ProxyProcedureToAcquireApplicationAuthorizationForNintendoAccount"}, - FunctionInfo{290, nullptr, "GetRequestForNintendoAccountUserResourceView", MakeVersionGate({8,0,0})}, - FunctionInfo{300, nullptr, "TryRecoverNintendoAccountUserStateAsync", MakeVersionGate({6,0,0})}, - FunctionInfo{400, nullptr, "IsServiceEntryRequirementCacheRefreshRequiredForOnlinePlay", MakeVersionGate({6,1,0})}, - FunctionInfo{401, nullptr, "RefreshServiceEntryRequirementCacheForOnlinePlayAsync", MakeVersionGate({6,1,0})}, - FunctionInfo{900, nullptr, "GetAuthenticationInfoForWin", MakeVersionGate({9,0,0})}, - FunctionInfo{901, nullptr, "ImportAsyncForWin", MakeVersionGate({9,0,0})}, - FunctionInfo{997, nullptr, "DebugUnlinkNintendoAccountAsync"}, - FunctionInfo{998, nullptr, "DebugSetAvailabilityErrorDetail"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } }; class IAuthorizationRequest final : public ServiceFramework { public: explicit IAuthorizationRequest(Core::System& system_, Common::UUID) : ServiceFramework{system_, "IAuthorizationRequest"} { - } + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetSessionId"}, + {10, nullptr, "InvokeWithoutInteractionAsync"}, + {19, nullptr, "IsAuthorized"}, + {20, nullptr, "GetAuthorizationCode"}, + {21, nullptr, "GetIdToken"}, + {22, nullptr, "GetState"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetSessionId"}, - FunctionInfo{10, nullptr, "InvokeWithoutInteractionAsync"}, - FunctionInfo{19, nullptr, "IsAuthorized"}, - FunctionInfo{20, nullptr, "GetAuthorizationCode"}, - FunctionInfo{21, nullptr, "GetIdToken"}, - FunctionInfo{22, nullptr, "GetState"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IOAuthProcedure final : public ServiceFramework { public: explicit IOAuthProcedure(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IOAuthProcedure"} {} + : ServiceFramework{system_, "IOAuthProcedure"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "PrepareAsync"}, + {1, nullptr, "GetRequest"}, + {2, nullptr, "ApplyResponse"}, + {3, nullptr, "ApplyResponseAsync"}, + {10, nullptr, "Suspend"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "PrepareAsync"}, - FunctionInfo{1, nullptr, "GetRequest"}, - FunctionInfo{2, nullptr, "ApplyResponse"}, - FunctionInfo{3, nullptr, "ApplyResponseAsync"}, - FunctionInfo{10, nullptr, "Suspend"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; @@ -282,69 +284,96 @@ public: class IOAuthProcedureForExternalNsa final : public ServiceFramework { public: explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} - {} + : ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "PrepareAsync"}, + {1, nullptr, "GetRequest"}, + {2, nullptr, "ApplyResponse"}, + {3, nullptr, "ApplyResponseAsync"}, + {10, nullptr, "Suspend"}, + {100, nullptr, "GetAccountId"}, + {101, nullptr, "GetLinkedNintendoAccountId"}, + {102, nullptr, "GetNickname"}, + {103, nullptr, "GetProfileImage"}, + {104, nullptr, "GetProfileLargeImage"} // 18.0.0+ + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "PrepareAsync"}, - FunctionInfo{1, nullptr, "GetRequest"}, - FunctionInfo{2, nullptr, "ApplyResponse"}, - FunctionInfo{3, nullptr, "ApplyResponseAsync"}, - FunctionInfo{10, nullptr, "Suspend"}, - FunctionInfo{100, nullptr, "GetAccountId"}, - FunctionInfo{101, nullptr, "GetLinkedNintendoAccountId"}, - FunctionInfo{102, nullptr, "GetNickname"}, - FunctionInfo{103, nullptr, "GetProfileImage"}, - FunctionInfo{104, nullptr, "GetProfileLargeImage", MakeVersionGate({18,0,0})} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; -class IOAuthProcedureForNintendoAccountLinkage final : public ServiceFramework { +class IOAuthProcedureForNintendoAccountLinkage final + : public ServiceFramework { public: explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} - {} + : ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "PrepareAsync"}, + {1, nullptr, "GetRequest"}, + {2, nullptr, "ApplyResponse"}, + {3, nullptr, "ApplyResponseAsync"}, + {10, nullptr, "Suspend"}, + {100, nullptr, "GetRequestWithTheme"}, + {101, nullptr, "IsNetworkServiceAccountReplaced"}, + {199, nullptr, "GetUrlForIntroductionOfExtraMembership"}, // 2.0.0 - 5.1.0 + {200, nullptr, "ApplyAsyncWithAuthorizedToken"}, + {210, nullptr, "IsProfileAvailable"}, // 17.0.0+ + {220, nullptr, "RegisterUserAsyncWithoutProfile"}, // 17.0.0+ + {221, nullptr, "RegisterUserWithProfileAsync"}, // 17.0.0+ + {230, nullptr, "RegisterUserWithLargeImageProfileAsync"}, // 18.0.0+ + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "PrepareAsync"}, - FunctionInfo{1, nullptr, "GetRequest"}, - FunctionInfo{2, nullptr, "ApplyResponse"}, - FunctionInfo{3, nullptr, "ApplyResponseAsync"}, - FunctionInfo{10, nullptr, "Suspend"}, - FunctionInfo{100, nullptr, "GetRequestWithTheme"}, - FunctionInfo{101, nullptr, "IsNetworkServiceAccountReplaced"}, - FunctionInfo{199, nullptr, "GetUrlForIntroductionOfExtraMembership", MakeVersionGate({2,0,0}, {5,1,0})}, - FunctionInfo{200, nullptr, "ApplyAsyncWithAuthorizedToken"}, - FunctionInfo{210, nullptr, "IsProfileAvailable", MakeVersionGate({17,0,0})}, - FunctionInfo{220, nullptr, "RegisterUserAsyncWithoutProfile", MakeVersionGate({17,0,0})}, - FunctionInfo{221, nullptr, "RegisterUserWithProfileAsync", MakeVersionGate({17,0,0})}, - FunctionInfo{230, nullptr, "RegisterUserWithLargeImageProfileAsync", MakeVersionGate({18,0,0})} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class INotifier final : public ServiceFramework { public: explicit INotifier(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "INotifier"} {} + : ServiceFramework{system_, "INotifier"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetSystemEvent"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetSystemEvent"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IProfileCommon : public ServiceFramework { public: - explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands, Common::UUID user_id_, ProfileManager& profile_manager_) + explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands, + Common::UUID user_id_, ProfileManager& profile_manager_) : ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IProfileCommon::Get, "Get"}, + {1, &IProfileCommon::GetBase, "GetBase"}, + {10, &IProfileCommon::GetImageSize, "GetImageSize"}, + {11, &IProfileCommon::LoadImage, "LoadImage"}, + {20, &IProfileCommon::Unknown20, "Unknown20"}, + {21, &IProfileCommon::Unknown21, "Unknown21"}, + {30, &IProfileCommon::Unknown30, "Unknown30"} + }; + // clang-format on + RegisterHandlers(functions); + + if (editor_commands) { + // clang-format off + static const FunctionInfo editor_functions[] = { + {100, &IProfileCommon::Store, "Store"}, + {101, &IProfileCommon::StoreWithImage, "StoreWithImage"}, + {110, &IProfileCommon::Unknown110, "Unknown110"} + }; + // clang-format on + + RegisterHandlers(editor_functions); + } } protected: @@ -571,22 +600,6 @@ protected: rb.Push(ResultSuccess); } - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IProfileCommon::Get, "Get"}, - FunctionInfo{1, &IProfileCommon::GetBase, "GetBase"}, - FunctionInfo{10, &IProfileCommon::GetImageSize, "GetImageSize"}, - FunctionInfo{11, &IProfileCommon::LoadImage, "LoadImage"}, - FunctionInfo{20, &IProfileCommon::Unknown20, "Unknown20"}, - FunctionInfo{21, &IProfileCommon::Unknown21, "Unknown21"}, - FunctionInfo{30, &IProfileCommon::Unknown30, "Unknown30"}, - // Editor commands - FunctionInfo{100, &IProfileCommon::Store, "Store"}, - FunctionInfo{101, &IProfileCommon::StoreWithImage, "StoreWithImage"}, - FunctionInfo{110, &IProfileCommon::Unknown110, "Unknown110"} - ); ProfileManager& profile_manager; Common::UUID user_id{}; ///< The user id this profile refers to. }; @@ -608,33 +621,35 @@ public: class ISessionObject final : public ServiceFramework { public: explicit ISessionObject(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "ISessionObject"} {} + : ServiceFramework{system_, "ISessionObject"} { + // clang-format off + static const FunctionInfo functions[] = { + {999, nullptr, "Dummy"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{999, nullptr, "Dummy"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IGuestLoginRequest final : public ServiceFramework { public: explicit IGuestLoginRequest(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IGuestLoginRequest"} {} + : ServiceFramework{system_, "IGuestLoginRequest"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetSessionId"}, + {11, nullptr, "Unknown"}, // 1.0.0 - 2.3.0 (the name is blank on Switchbrew) + {12, nullptr, "GetAccountId"}, + {13, nullptr, "GetLinkedNintendoAccountId"}, + {14, nullptr, "GetNickname"}, + {15, nullptr, "GetProfileImage"}, + {16, nullptr, "GetProfileLargeImage"}, // 18.0.0+ + {21, nullptr, "LoadIdTokenCache"}, // 3.0.0+ + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetSessionId"}, - FunctionInfo{11, nullptr, "Unknown", MakeVersionGate({1,0,0}, {2,3,0})}, // the name is blank on Switchbrew - FunctionInfo{12, nullptr, "GetAccountId"}, - FunctionInfo{13, nullptr, "GetLinkedNintendoAccountId"}, - FunctionInfo{14, nullptr, "GetNickname"}, - FunctionInfo{15, nullptr, "GetProfileImage"}, - FunctionInfo{16, nullptr, "GetProfileLargeImage", MakeVersionGate({18,0,0})}, - FunctionInfo{21, nullptr, "LoadIdTokenCache", MakeVersionGate({3,0,0})} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; @@ -671,10 +686,23 @@ public: const std::shared_ptr& profile_manager_) : ServiceFramework{system_, "IManagerForApplication"}, ensure_token_id{std::make_shared(system)}, - profile_manager{profile_manager_} {} + profile_manager{profile_manager_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, + {1, &IManagerForApplication::GetAccountId, "GetAccountId"}, + {2, &IManagerForApplication::EnsureIdTokenCacheAsync, "EnsureIdTokenCacheAsync"}, + {3, &IManagerForApplication::LoadIdTokenCacheDeprecated, "LoadIdTokenCacheDeprecated"}, + {4, &IManagerForApplication::LoadIdTokenCache, "LoadIdTokenCache"}, + {130, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCacheForApplication"}, + {136, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCache"}, // 19.0.0+ + {150, nullptr, "CreateAuthorizationRequest"}, + {160, &IManagerForApplication::StoreOpenContext, "StoreOpenContext"}, + {170, nullptr, "LoadNetworkServiceLicenseKindAsync"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -744,18 +772,6 @@ private: rb.Push(ResultSuccess); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, - FunctionInfo{1, &IManagerForApplication::GetAccountId, "GetAccountId"}, - FunctionInfo{2, &IManagerForApplication::EnsureIdTokenCacheAsync, "EnsureIdTokenCacheAsync"}, - FunctionInfo{3, &IManagerForApplication::LoadIdTokenCacheDeprecated, "LoadIdTokenCacheDeprecated"}, - FunctionInfo{4, &IManagerForApplication::LoadIdTokenCache, "LoadIdTokenCache"}, - FunctionInfo{130, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCacheForApplication"}, - FunctionInfo{136, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCache", MakeVersionGate({19,0,0})}, - FunctionInfo{150, nullptr, "CreateAuthorizationRequest"}, - FunctionInfo{160, &IManagerForApplication::StoreOpenContext, "StoreOpenContext"}, - FunctionInfo{170, nullptr, "LoadNetworkServiceLicenseKindAsync"} - ); std::shared_ptr ensure_token_id{}; std::shared_ptr profile_manager; }; @@ -765,17 +781,18 @@ class IAsyncNetworkServiceLicenseKindContext final : public ServiceFramework { public: explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} {} + : ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetSystemEvent"}, + {1, nullptr, "Cancel"}, + {2, nullptr, "HasDone"}, + {3, nullptr, "GetResult"}, + {4, nullptr, "GetNetworkServiceLicenseKind"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetSystemEvent"}, - FunctionInfo{1, nullptr, "Cancel"}, - FunctionInfo{2, nullptr, "HasDone"}, - FunctionInfo{3, nullptr, "GetResult"}, - FunctionInfo{4, nullptr, "GetNetworkServiceLicenseKind"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; @@ -784,54 +801,56 @@ class IOAuthProcedureForUserRegistration final : public ServiceFramework { public: explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} {} + : ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "PrepareAsync"}, + {1, nullptr, "GetRequest"}, + {2, nullptr, "ApplyResponse"}, + {3, nullptr, "ApplyResponseAsync"}, + {10, nullptr, "Suspend"}, + {100, nullptr, "GetAccountId"}, + {101, nullptr, "GetLinkedNintendoAccountId"}, + {102, nullptr, "GetNickname"}, + {103, nullptr, "GetProfileImage"}, + {104, nullptr, "GetProfileLargeImage"}, // 18.0.0+ + {110, nullptr, "RegisterUserAsync"}, + {111, nullptr, "GetUid"}, + {200, nullptr, "ApplyResponseForUserCreationAsync"}, // 17.0.0+ + {205, nullptr, "SuspendAfterApplyResponse"}, // 17.0.0+ + {210, nullptr, "IsProfileAvailable"}, // 17.0.0+ + {220, nullptr, "RegisterUserAsyncWithoutProfile"}, // 17.0.0+ + {221, nullptr, "RegisterUserWithProfileAsync"}, // 17.0.0+ + {230, nullptr, "RegisterUserWithLargeImageProfileAsync"} // 18.0.0+ + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "PrepareAsync"}, - FunctionInfo{1, nullptr, "GetRequest"}, - FunctionInfo{2, nullptr, "ApplyResponse"}, - FunctionInfo{3, nullptr, "ApplyResponseAsync"}, - FunctionInfo{10, nullptr, "Suspend"}, - FunctionInfo{100, nullptr, "GetAccountId"}, - FunctionInfo{101, nullptr, "GetLinkedNintendoAccountId"}, - FunctionInfo{102, nullptr, "GetNickname"}, - FunctionInfo{103, nullptr, "GetProfileImage"}, - FunctionInfo{104, nullptr, "GetProfileLargeImage", MakeVersionGate({18,0,0})}, - FunctionInfo{110, nullptr, "RegisterUserAsync"}, - FunctionInfo{111, nullptr, "GetUid"}, - FunctionInfo{200, nullptr, "ApplyResponseForUserCreationAsync", MakeVersionGate({17,0,0})}, - FunctionInfo{205, nullptr, "SuspendAfterApplyResponse", MakeVersionGate({17,0,0})}, - FunctionInfo{210, nullptr, "IsProfileAvailable", MakeVersionGate({17,0,0})}, - FunctionInfo{220, nullptr, "RegisterUserAsyncWithoutProfile", MakeVersionGate({17,0,0})}, - FunctionInfo{221, nullptr, "RegisterUserWithProfileAsync", MakeVersionGate({17,0,0})}, - FunctionInfo{230, nullptr, "RegisterUserWithLargeImageProfileAsync", MakeVersionGate({18,0,0})} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class DAUTH_O final : public ServiceFramework { public: - explicit DAUTH_O(Core::System& system_, Common::UUID) : ServiceFramework{system_, "dauth:o"} {} + explicit DAUTH_O(Core::System& system_, Common::UUID) : ServiceFramework{system_, "dauth:o"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, + {1, nullptr, "LoadAuthenticationTokenCache"}, + {2, nullptr, "InvalidateAuthenticationTokenCache"}, + {3, nullptr, "IsDeviceAuthenticationTokenCacheAvailable"}, + {10, nullptr, "EnsureEdgeTokenCacheAsync"}, + {11, nullptr, "LoadEdgeTokenCache"}, + {12, nullptr, "InvalidateEdgeTokenCache"}, + {13, nullptr, "IsEdgeTokenCacheAvailable"}, + {20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, + {21, nullptr, "LoadApplicationAuthenticationTokenCache"}, + {22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, + {23, nullptr, "IsApplicationAuthenticationCacheAvailable"}, + {24, nullptr, "InvalidateApplicationAuthenticationCache"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, - FunctionInfo{1, nullptr, "LoadAuthenticationTokenCache"}, - FunctionInfo{2, nullptr, "InvalidateAuthenticationTokenCache"}, - FunctionInfo{3, nullptr, "IsDeviceAuthenticationTokenCacheAvailable"}, - FunctionInfo{10, nullptr, "EnsureEdgeTokenCacheAsync"}, - FunctionInfo{11, nullptr, "LoadEdgeTokenCache"}, - FunctionInfo{12, nullptr, "InvalidateEdgeTokenCache"}, - FunctionInfo{13, nullptr, "IsEdgeTokenCacheAvailable"}, - FunctionInfo{20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, - FunctionInfo{21, nullptr, "LoadApplicationAuthenticationTokenCache"}, - FunctionInfo{22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, - FunctionInfo{23, nullptr, "IsApplicationAuthenticationCacheAvailable"}, - FunctionInfo{24, nullptr, "InvalidateApplicationAuthenticationCache"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; @@ -839,809 +858,781 @@ public: class IAsyncResult final : public ServiceFramework { public: explicit IAsyncResult(Core::System& system_, Common::UUID) - : ServiceFramework{system_, "IAsyncResult"} {} + : ServiceFramework{system_, "IAsyncResult"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetResult"}, + {1, nullptr, "Cancel"}, + {2, nullptr, "IsAvailable"}, + {3, nullptr, "GetSystemEvent"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetResult"}, - FunctionInfo{1, nullptr, "Cancel"}, - FunctionInfo{2, nullptr, "IsAvailable"}, - FunctionInfo{3, nullptr, "GetSystemEvent"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; -class Module final { -public: - class Interface : public ServiceFramework { - public: - explicit Interface(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_, const char* name) - : ServiceFramework{system_, name} - , module{std::move(module_)} - , profile_manager{std::move(profile_manager_)} - {} - ~Interface() override = default; +void Module::Interface::GetUserCount(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(static_cast(profile_manager->GetUserCount())); +} - void GetUserCount(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(static_cast(profile_manager->GetUserCount())); +void Module::Interface::GetUserExistence(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); + LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(profile_manager->UserExists(user_id)); +} + +void Module::Interface::ListAllUsers(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + ctx.WriteBuffer(profile_manager->GetAllUsers()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void Module::Interface::ListOpenUsers(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + ctx.WriteBuffer(profile_manager->GetOpenUsers()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void Module::Interface::GetLastOpenedUser(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 6}; + rb.Push(ResultSuccess); + rb.PushRaw(profile_manager->GetLastOpenedUser()); +} + +void Module::Interface::GetProfile(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); + LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, user_id, *profile_manager); +} + +void Module::Interface::IsUserRegistrationRequestPermitted(HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(profile_manager->CanSystemRegisterUser()); +} + +void Module::Interface::InitializeApplicationInfo(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(InitializeApplicationInfoBase()); +} + +void Module::Interface::InitializeApplicationInfoRestricted(HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(Partial implementation) called"); + + // TODO(ogniK): We require checking if the user actually owns the title and what not. As of + // currently, we assume the user owns the title. InitializeApplicationInfoBase SHOULD be called + // first then we do extra checks if the game is a digital copy. + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(InitializeApplicationInfoBase()); +} + +Result Module::Interface::InitializeApplicationInfoBase() { + if (application_info) { + LOG_ERROR(Service_ACC, "Application already initialized"); + return Account::ResultApplicationInfoAlreadyInitialized; + } + + // TODO(ogniK): This should be changed to reflect the target process for when we have multiple + // processes emulated. As we don't actually have pid support we should assume we're just using + // our own process + Glue::ApplicationLaunchProperty launch_property{}; + const auto result = system.GetARPManager().GetLaunchProperty( + &launch_property, system.GetApplicationProcessProgramID()); + + if (result != ResultSuccess) { + LOG_ERROR(Service_ACC, "Failed to get launch property"); + return Account::ResultInvalidApplication; + } + + switch (launch_property.base_game_storage_id) { + case FileSys::StorageId::GameCard: + application_info.application_type = ApplicationType::GameCard; + break; + case FileSys::StorageId::Host: + case FileSys::StorageId::NandSystem: + case FileSys::StorageId::NandUser: + case FileSys::StorageId::SdCard: + case FileSys::StorageId::None: // Yuzu specific, differs from hardware + application_info.application_type = ApplicationType::Digital; + break; + default: + LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}", + launch_property.base_game_storage_id); + return Account::ResultInvalidApplication; + } + + LOG_WARNING(Service_ACC, "ApplicationInfo init required"); + // TODO(ogniK): Actual initialization here + + return ResultSuccess; +} + +void Module::Interface::GetBaasAccountManagerForApplication(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, profile_manager); +} + +void Module::Interface::IsUserAccountSwitchLocked(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + FileSys::NACP nacp; + const auto res = system.GetAppLoader().ReadControlData(nacp); + + bool is_locked = false; + + if (res != Loader::ResultStatus::Success) { + const FileSys::PatchManager pm{system.GetApplicationProcessProgramID(), + system.GetFileSystemController(), + system.GetContentProvider()}; + const auto nacp_unique = pm.GetControlMetadata().first; + + if (nacp_unique != nullptr) { + is_locked = nacp_unique->GetUserAccountSwitchLock(); + } else { + LOG_ERROR(Service_ACC, "nacp_unique is null!"); } + } else { + is_locked = nacp.GetUserAccountSwitchLock(); + } - void GetUserExistence(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); - LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(profile_manager->UserExists(user_id)); - } - - void ListAllUsers(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - ctx.WriteBuffer(profile_manager->GetAllUsers()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - void ListOpenUsers(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - ctx.WriteBuffer(profile_manager->GetOpenUsers()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - void GetLastOpenedUser(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - IPC::ResponseBuilder rb{ctx, 6}; - rb.Push(ResultSuccess); - rb.PushRaw(profile_manager->GetLastOpenedUser()); - } - - void GetProfile(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); - LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); - - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, user_id, *profile_manager); - } - - void IsUserRegistrationRequestPermitted(HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(profile_manager->CanSystemRegisterUser()); - } - - void InitializeApplicationInfo(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(InitializeApplicationInfoBase()); - } - - void InitializeApplicationInfoRestricted(HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(Partial implementation) called"); - - // TODO(ogniK): We require checking if the user actually owns the title and what not. As of - // currently, we assume the user owns the title. InitializeApplicationInfoBase SHOULD be called - // first then we do extra checks if the game is a digital copy. - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(InitializeApplicationInfoBase()); - } - - void GetBaasAccountManagerForApplication(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, profile_manager); - } - - void IsUserAccountSwitchLocked(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - FileSys::NACP nacp; - const auto res = system.GetAppLoader().ReadControlData(nacp); - - bool is_locked = false; - - if (res != Loader::ResultStatus::Success) { - const FileSys::PatchManager pm{system.GetApplicationProcessProgramID(), - system.GetFileSystemController(), - system.GetContentProvider()}; - const auto nacp_unique = pm.GetControlMetadata().first; - - if (nacp_unique != nullptr) { - is_locked = nacp_unique->GetUserAccountSwitchLock(); - } else { - LOG_ERROR(Service_ACC, "nacp_unique is null!"); - } - } else { - is_locked = nacp.GetUserAccountSwitchLock(); - } - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(is_locked); - } - - void InitializeApplicationInfoV2(HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - void BeginUserRegistration(HLERequestContext& ctx) { - const auto user_id = Common::UUID::MakeRandom(); - profile_manager->CreateNewUser(user_id, "Eden"); - - LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); - - IPC::ResponseBuilder rb{ctx, 6}; - rb.Push(ResultSuccess); - rb.PushRaw(user_id); - } - - void CompleteUserRegistration(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); - - LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); - - profile_manager->WriteUserSaveFile(); - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - void DeleteUser(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); - LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); - if (!profile_manager->RemoveUser(user_id)) { - LOG_ERROR(Service_ACC, "Failed to delete user with uuid={}", user_id.RawString()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(1U); - return; - } - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - void SetUserPosition(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - - u64 position = rp.Pop(); - Common::UUID user_id = rp.PopRaw(); - - LOG_DEBUG(Service_ACC, "called, position={} user_id={}", position, user_id.FormattedString()); - - profile_manager->SetUserPosition(position, user_id); - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - void GetProfileEditor(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - Common::UUID user_id = rp.PopRaw(); - - LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString()); - - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, user_id, *profile_manager); - } - - void GetBaasAccountAdministrator(HLERequestContext &ctx) { - IPC::RequestParser rp{ctx}; - const auto uuid = rp.PopRaw(); - - LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString()); - - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, uuid); - } - - void ListQualifiedUsers(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - - // All users should be qualified. We don't actually have parental control or anything to do with - // nintendo online currently. We're just going to assume the user running the game has access to - // the game regardless of parental control settings. - ctx.WriteBuffer(profile_manager->GetAllUsers()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - void ListOpenContextStoredUsers(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - - ctx.WriteBuffer(profile_manager->GetStoredOpenedUsers()); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - void StoreSaveDataThumbnailApplication(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const auto uuid = rp.PopRaw(); - - LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString()); - - // TODO(ogniK): Check if application ID is zero on acc initialize. As we don't have a reliable - // way of confirming things like the TID, we're going to assume a non zero value for the time - // being. - constexpr u64 tid{1}; - StoreSaveDataThumbnail(ctx, uuid, tid); - } - - void GetBaasAccountManagerForSystemService(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const auto uuid = rp.PopRaw(); - - LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString()); - - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(ctx, system, uuid); - } - - void StoreSaveDataThumbnailSystem(HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const auto uuid = rp.PopRaw(); - const auto tid = rp.Pop(); - - LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid); - StoreSaveDataThumbnail(ctx, uuid, tid); - } - - void GetPinCodeLength(HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(0); - } - - void TrySelectUserWithoutInteractionDeprecated(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - // A u8 is passed into this function which we can safely ignore. It's to determine if we have - // access to use the network or not by the looks of it - IPC::ResponseBuilder rb{ctx, 6}; - if (profile_manager->GetUserCount() != 1) { - rb.Push(ResultSuccess); - rb.PushRaw(Common::InvalidUUID); - return; - } - - const auto user_list = profile_manager->GetAllUsers(); - if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { - rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code - rb.PushRaw(Common::InvalidUUID); - return; - } - - // Select the first user we have - rb.Push(ResultSuccess); - rb.PushRaw(profile_manager->GetUser(0)->uuid); - } - - void TrySelectUserWithoutInteraction(HLERequestContext& ctx) { - LOG_DEBUG(Service_ACC, "called"); - // A u8 is passed into this function which we can safely ignore. It's to determine if we have - // access to use the network or not by the looks of it - IPC::ResponseBuilder rb{ctx, 6}; - if (profile_manager->GetUserCount() != 1) { - rb.Push(ResultSuccess); - rb.PushRaw(Common::InvalidUUID); - return; - } - - const auto user_list = profile_manager->GetAllUsers(); - if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { - rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code - rb.PushRaw(Common::InvalidUUID); - return; - } - - // Select the first user we have - rb.Push(ResultSuccess); - rb.PushRaw(profile_manager->GetUser(0)->uuid); - } - - private: - Result InitializeApplicationInfoBase() { - if (application_info) { - LOG_ERROR(Service_ACC, "Application already initialized"); - return Account::ResultApplicationInfoAlreadyInitialized; - } - - // TODO(ogniK): This should be changed to reflect the target process for when we have multiple - // processes emulated. As we don't actually have pid support we should assume we're just using - // our own process - Glue::ApplicationLaunchProperty launch_property{}; - const auto result = system.GetARPManager().GetLaunchProperty( - &launch_property, system.GetApplicationProcessProgramID()); - - if (result != ResultSuccess) { - LOG_ERROR(Service_ACC, "Failed to get launch property"); - return Account::ResultInvalidApplication; - } - - switch (launch_property.base_game_storage_id) { - case FileSys::StorageId::GameCard: - application_info.application_type = ApplicationType::GameCard; - break; - case FileSys::StorageId::Host: - case FileSys::StorageId::NandSystem: - case FileSys::StorageId::NandUser: - case FileSys::StorageId::SdCard: - case FileSys::StorageId::None: // Yuzu specific, differs from hardware - application_info.application_type = ApplicationType::Digital; - break; - default: - LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}", - launch_property.base_game_storage_id); - return Account::ResultInvalidApplication; - } - - LOG_WARNING(Service_ACC, "ApplicationInfo init required"); - // TODO(ogniK): Actual initialization here - - return ResultSuccess; - } - - void StoreSaveDataThumbnail(HLERequestContext& ctx, const Common::UUID& uuid, - const u64 tid) { - IPC::ResponseBuilder rb{ctx, 2}; - - if (tid == 0) { - LOG_ERROR(Service_ACC, "TitleID is not valid!"); - rb.Push(Account::ResultInvalidApplication); - return; - } - - if (uuid.IsInvalid()) { - LOG_ERROR(Service_ACC, "User ID is not valid!"); - rb.Push(Account::ResultInvalidUserId); - return; - } - const auto thumbnail_size = ctx.GetReadBufferSize(); - if (thumbnail_size != THUMBNAIL_SIZE) { - LOG_ERROR(Service_ACC, "Buffer size is empty! size={:X} expecting {:X}", thumbnail_size, - THUMBNAIL_SIZE); - rb.Push(Account::ResultInvalidArrayLength); - return; - } - - // TODO(ogniK): Construct save data thumbnail - rb.Push(ResultSuccess); - } - - enum class ApplicationType : u32_le { - GameCard = 0, - Digital = 1, - Unknown = 3, - }; - - struct ApplicationInfo { - Service::Glue::ApplicationLaunchProperty launch_property; - ApplicationType application_type; - - constexpr explicit operator bool() const { - return launch_property.title_id != 0x0; - } - }; - - ApplicationInfo application_info{}; - protected: - std::shared_ptr module; - std::shared_ptr profile_manager; - }; -}; + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(is_locked); +} + +void Module::Interface::InitializeApplicationInfoV2(HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void Module::Interface::BeginUserRegistration(HLERequestContext& ctx) { + const auto user_id = Common::UUID::MakeRandom(); + profile_manager->CreateNewUser(user_id, "Eden"); + + LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); + + IPC::ResponseBuilder rb{ctx, 6}; + rb.Push(ResultSuccess); + rb.PushRaw(user_id); +} + +void Module::Interface::CompleteUserRegistration(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); + + LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); + + profile_manager->WriteUserSaveFile(); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void Module::Interface::DeleteUser(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); + LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString()); + if (!profile_manager->RemoveUser(user_id)) { + LOG_ERROR(Service_ACC, "Failed to delete user with uuid={}", user_id.RawString()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(1U); + return; + } + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void Module::Interface::SetUserPosition(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + + u64 position = rp.Pop(); + Common::UUID user_id = rp.PopRaw(); + + LOG_DEBUG(Service_ACC, "called, position={} user_id={}", position, user_id.FormattedString()); + + profile_manager->SetUserPosition(position, user_id); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void Module::Interface::GetProfileEditor(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + Common::UUID user_id = rp.PopRaw(); + + LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString()); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, user_id, *profile_manager); +} + +void Module::Interface::GetBaasAccountAdministrator(HLERequestContext &ctx) { + IPC::RequestParser rp{ctx}; + const auto uuid = rp.PopRaw(); + + LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString()); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, uuid); +} + +void Module::Interface::ListQualifiedUsers(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + + // All users should be qualified. We don't actually have parental control or anything to do with + // nintendo online currently. We're just going to assume the user running the game has access to + // the game regardless of parental control settings. + ctx.WriteBuffer(profile_manager->GetAllUsers()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void Module::Interface::ListOpenContextStoredUsers(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + + ctx.WriteBuffer(profile_manager->GetStoredOpenedUsers()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void Module::Interface::StoreSaveDataThumbnailApplication(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto uuid = rp.PopRaw(); + + LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString()); + + // TODO(ogniK): Check if application ID is zero on acc initialize. As we don't have a reliable + // way of confirming things like the TID, we're going to assume a non zero value for the time + // being. + constexpr u64 tid{1}; + StoreSaveDataThumbnail(ctx, uuid, tid); +} + +void Module::Interface::GetBaasAccountManagerForSystemService(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto uuid = rp.PopRaw(); + + LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString()); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(ctx, system, uuid); +} + +void Module::Interface::StoreSaveDataThumbnailSystem(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto uuid = rp.PopRaw(); + const auto tid = rp.Pop(); + + LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid); + StoreSaveDataThumbnail(ctx, uuid, tid); +} + +void Module::Interface::GetPinCodeLength(HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(0); +} + +void Module::Interface::StoreSaveDataThumbnail(HLERequestContext& ctx, const Common::UUID& uuid, + const u64 tid) { + IPC::ResponseBuilder rb{ctx, 2}; + + if (tid == 0) { + LOG_ERROR(Service_ACC, "TitleID is not valid!"); + rb.Push(Account::ResultInvalidApplication); + return; + } + + if (uuid.IsInvalid()) { + LOG_ERROR(Service_ACC, "User ID is not valid!"); + rb.Push(Account::ResultInvalidUserId); + return; + } + const auto thumbnail_size = ctx.GetReadBufferSize(); + if (thumbnail_size != THUMBNAIL_SIZE) { + LOG_ERROR(Service_ACC, "Buffer size is empty! size={:X} expecting {:X}", thumbnail_size, + THUMBNAIL_SIZE); + rb.Push(Account::ResultInvalidArrayLength); + return; + } + + // TODO(ogniK): Construct save data thumbnail + rb.Push(ResultSuccess); +} + +void Module::Interface::TrySelectUserWithoutInteractionDeprecated(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + // A u8 is passed into this function which we can safely ignore. It's to determine if we have + // access to use the network or not by the looks of it + IPC::ResponseBuilder rb{ctx, 6}; + if (profile_manager->GetUserCount() != 1) { + rb.Push(ResultSuccess); + rb.PushRaw(Common::InvalidUUID); + return; + } + + const auto user_list = profile_manager->GetAllUsers(); + if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { + rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code + rb.PushRaw(Common::InvalidUUID); + return; + } + + // Select the first user we have + rb.Push(ResultSuccess); + rb.PushRaw(profile_manager->GetUser(0)->uuid); +} + +void Module::Interface::TrySelectUserWithoutInteraction(HLERequestContext& ctx) { + LOG_DEBUG(Service_ACC, "called"); + // A u8 is passed into this function which we can safely ignore. It's to determine if we have + // access to use the network or not by the looks of it + IPC::ResponseBuilder rb{ctx, 6}; + if (profile_manager->GetUserCount() != 1) { + rb.Push(ResultSuccess); + rb.PushRaw(Common::InvalidUUID); + return; + } + + const auto user_list = profile_manager->GetAllUsers(); + if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { + rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code + rb.PushRaw(Common::InvalidUUID); + return; + } + + // Select the first user we have + rb.Push(ResultSuccess); + rb.PushRaw(profile_manager->GetUser(0)->uuid); +} + +Module::Interface::Interface(std::shared_ptr module_, + std::shared_ptr profile_manager_, + Core::System& system_, const char* name) + : ServiceFramework{system_, name}, module{std::move(module_)}, + profile_manager{std::move(profile_manager_)} {} + +Module::Interface::~Interface() = default; class ACC_AA final : public Module::Interface { public: explicit ACC_AA(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:aa") {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:aa") { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "EnsureCacheAsync"}, + {1, nullptr, "LoadCache"}, + {2, nullptr, "GetDeviceAccountId"}, + {50, nullptr, "RegisterNotificationTokenAsync"}, // 1.0.0 - 6.2.0 + {51, nullptr, "UnregisterNotificationTokenAsync"}, // 1.0.0 - 6.2.0 + }; + // clang-format on + RegisterHandlers(functions); } ~ACC_AA() override = default; - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "EnsureCacheAsync"}, - FunctionInfo{1, nullptr, "LoadCache"}, - FunctionInfo{2, nullptr, "GetDeviceAccountId"}, - FunctionInfo{50, nullptr, "RegisterNotificationTokenAsync", MakeVersionGate({1,0,0}, {6,2,0})}, - FunctionInfo{51, nullptr, "UnregisterNotificationTokenAsync", MakeVersionGate({1,0,0}, {6,2,0})} - ); }; class ACC_SU final : public Module::Interface { public: explicit ACC_SU(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:su") {} + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:su") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &ACC_SU::GetUserCount, "GetUserCount"}, + {1, &ACC_SU::GetUserExistence, "GetUserExistence"}, + {2, &ACC_SU::ListAllUsers, "ListAllUsers"}, + {3, &ACC_SU::ListOpenUsers, "ListOpenUsers"}, + {4, &ACC_SU::GetLastOpenedUser, "GetLastOpenedUser"}, + {5, &ACC_SU::GetProfile, "GetProfile"}, + {6, nullptr, "GetProfileDigest"}, + {50, &ACC_SU::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, + {51, &ACC_SU::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, + {52, &ACC_SU::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, // 19.0.0+ + {60, &ACC_SU::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, + {99, nullptr, "DebugActivateOpenContextRetention"}, + {100, nullptr, "GetUserRegistrationNotifier"}, + {101, nullptr, "GetUserStateChangeNotifier"}, + {102, &ACC_SU::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, + {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + {104, nullptr, "GetProfileUpdateNotifier"}, + {105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + {106, nullptr, "GetProfileSyncNotifier"}, + {110, &ACC_SU::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"}, + {111, nullptr, "ClearSaveDataThumbnail"}, + {112, nullptr, "LoadSaveDataThumbnail"}, + {113, nullptr, "GetSaveDataThumbnailExistence"}, + {120, nullptr, "ListOpenUsersInApplication"}, + {130, nullptr, "ActivateOpenContextRetention"}, + {140, &ACC_SU::ListQualifiedUsers, "ListQualifiedUsers"}, + {150, nullptr, "AuthenticateApplicationAsync"}, + {151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + {152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + {190, nullptr, "GetUserLastOpenedApplication"}, + {191, nullptr, "ActivateOpenContextHolder"}, + {200, &ACC_SU::BeginUserRegistration, "BeginUserRegistration"}, + {201, &ACC_SU::CompleteUserRegistration, "CompleteUserRegistration"}, + {202, nullptr, "CancelUserRegistration"}, + {203, &ACC_SU::DeleteUser, "DeleteUser"}, + {204, &ACC_SU::SetUserPosition, "SetUserPosition"}, + {205, &ACC_SU::GetProfileEditor, "GetProfileEditor"}, + {206, nullptr, "CompleteUserRegistrationForcibly"}, + {210, nullptr, "CreateFloatingRegistrationRequest"}, + {211, nullptr, "CreateProcedureToRegisterUserWithNintendoAccount"}, + {212, nullptr, "ResumeProcedureToRegisterUserWithNintendoAccount"}, + {230, nullptr, "AuthenticateServiceAsync"}, + {250, &ACC_SU::GetBaasAccountAdministrator, "GetBaasAccountAdministrator"}, + {290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, + {291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, + {299, nullptr, "SuspendBackgroundDaemon"}, + {400, nullptr, "SetPinCode"}, // 18.0.0+ + {401, &ACC_SU::GetPinCodeLength, "GetPinCodeLength"}, // 18.0.0+ + {402, nullptr, "GetPinCode"}, // 18.0.0+ + {403, nullptr, "GetPinCodeParity"}, + {404, nullptr, "VerifyPinCode"}, + {405, nullptr, "IsPinCodeVerificationForbidden"}, + {410, nullptr, "GetPinCodeErrorCount"}, // 18.0.0+ + {411, nullptr, "ResetPinCodeErrorCount"}, // 18.0.0+ + {412, nullptr, "IncrementPinCodeErrorCount"}, // 18.0.0+ + {900, nullptr, "SetUserUnqualifiedForDebug"}, + {901, nullptr, "UnsetUserUnqualifiedForDebug"}, + {902, nullptr, "ListUsersUnqualifiedForDebug"}, + {910, nullptr, "RefreshFirmwareSettingsForDebug"}, + {997, nullptr, "DebugInvalidateTokenCacheForUser"}, + {998, nullptr, "DebugSetUserStateClose"}, + {999, nullptr, "DebugSetUserStateOpen"}, + }; + // clang-format on - ~ACC_SU() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ACC_SU::GetUserCount, "GetUserCount"}, - FunctionInfo{1, &ACC_SU::GetUserExistence, "GetUserExistence"}, - FunctionInfo{2, &ACC_SU::ListAllUsers, "ListAllUsers"}, - FunctionInfo{3, &ACC_SU::ListOpenUsers, "ListOpenUsers"}, - FunctionInfo{4, &ACC_SU::GetLastOpenedUser, "GetLastOpenedUser"}, - FunctionInfo{5, &ACC_SU::GetProfile, "GetProfile"}, - FunctionInfo{6, nullptr, "GetProfileDigest"}, - FunctionInfo{50, &ACC_SU::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, - FunctionInfo{51, &ACC_SU::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, - FunctionInfo{52, &ACC_SU::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction", MakeVersionGate({19,0,0})}, - FunctionInfo{60, &ACC_SU::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, - FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, - FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, - FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, - FunctionInfo{102, &ACC_SU::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, - FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, - FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, - FunctionInfo{110, &ACC_SU::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"}, - FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, - FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, - FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, - FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, - FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, - FunctionInfo{140, &ACC_SU::ListQualifiedUsers, "ListQualifiedUsers"}, - FunctionInfo{150, nullptr, "AuthenticateApplicationAsync"}, - FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - FunctionInfo{190, nullptr, "GetUserLastOpenedApplication"}, - FunctionInfo{191, nullptr, "ActivateOpenContextHolder"}, - FunctionInfo{200, &ACC_SU::BeginUserRegistration, "BeginUserRegistration"}, - FunctionInfo{201, &ACC_SU::CompleteUserRegistration, "CompleteUserRegistration"}, - FunctionInfo{202, nullptr, "CancelUserRegistration"}, - FunctionInfo{203, &ACC_SU::DeleteUser, "DeleteUser"}, - FunctionInfo{204, &ACC_SU::SetUserPosition, "SetUserPosition"}, - FunctionInfo{205, &ACC_SU::GetProfileEditor, "GetProfileEditor"}, - FunctionInfo{206, nullptr, "CompleteUserRegistrationForcibly"}, - FunctionInfo{210, nullptr, "CreateFloatingRegistrationRequest"}, - FunctionInfo{211, nullptr, "CreateProcedureToRegisterUserWithNintendoAccount"}, - FunctionInfo{212, nullptr, "ResumeProcedureToRegisterUserWithNintendoAccount"}, - FunctionInfo{230, nullptr, "AuthenticateServiceAsync"}, - FunctionInfo{250, &ACC_SU::GetBaasAccountAdministrator, "GetBaasAccountAdministrator"}, - FunctionInfo{290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, - FunctionInfo{291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, - FunctionInfo{299, nullptr, "SuspendBackgroundDaemon"}, - FunctionInfo{400, nullptr, "SetPinCode", MakeVersionGate({18,0,0})}, - FunctionInfo{401, &ACC_SU::GetPinCodeLength, "GetPinCodeLength", MakeVersionGate({18,0,0})}, - FunctionInfo{402, nullptr, "GetPinCode", MakeVersionGate({18,0,0})}, - FunctionInfo{403, nullptr, "GetPinCodeParity"}, - FunctionInfo{404, nullptr, "VerifyPinCode"}, - FunctionInfo{405, nullptr, "IsPinCodeVerificationForbidden"}, - FunctionInfo{410, nullptr, "GetPinCodeErrorCount", MakeVersionGate({18,0,0})}, - FunctionInfo{411, nullptr, "ResetPinCodeErrorCount", MakeVersionGate({18,0,0})}, - FunctionInfo{412, nullptr, "IncrementPinCodeErrorCount", MakeVersionGate({18,0,0})}, - FunctionInfo{900, nullptr, "SetUserUnqualifiedForDebug"}, - FunctionInfo{901, nullptr, "UnsetUserUnqualifiedForDebug"}, - FunctionInfo{902, nullptr, "ListUsersUnqualifiedForDebug"}, - FunctionInfo{910, nullptr, "RefreshFirmwareSettingsForDebug"}, - FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, - FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, - FunctionInfo{999, nullptr, "DebugSetUserStateOpen"} - ); + ~ACC_SU() override = default; }; class ACC_U0 final : public Module::Interface { public: ACC_U0(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:u0") {} + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:u0") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &ACC_U0::GetUserCount, "GetUserCount"}, + {1, &ACC_U0::GetUserExistence, "GetUserExistence"}, + {2, &ACC_U0::ListAllUsers, "ListAllUsers"}, + {3, &ACC_U0::ListOpenUsers, "ListOpenUsers"}, + {4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"}, + {5, &ACC_U0::GetProfile, "GetProfile"}, + {6, nullptr, "GetProfileDigest"}, // 3.0.0+ + {50, &ACC_U0::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, + {51, &ACC_U0::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, + {52, &ACC_U0::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, + {60, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 5.0.0 - 5.1.0 + {99, nullptr, "DebugActivateOpenContextRetention"}, // 6.0.0+ + {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, + {101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"}, + {102, nullptr, "AuthenticateApplicationAsync"}, + {103, nullptr, "CheckNetworkServiceAvailabilityAsync"}, // 4.0.0+ + {110, &ACC_U0::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, + {111, nullptr, "ClearSaveDataThumbnail"}, + {120, nullptr, "CreateGuestLoginRequest"}, + {130, nullptr, "LoadOpenContext"}, // 5.0.0+ + {131, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 6.0.0+ + {140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted"}, // 6.0.0+ + {141, &ACC_U0::ListQualifiedUsers, "ListQualifiedUsers"}, // 6.0.0+ + {150, &ACC_U0::IsUserAccountSwitchLocked, "IsUserAccountSwitchLocked"}, // 6.0.0+ + {160, &ACC_U0::InitializeApplicationInfoV2, "InitializeApplicationInfoV2"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } ~ACC_U0() override = default; - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ACC_U0::GetUserCount, "GetUserCount"}, - FunctionInfo{1, &ACC_U0::GetUserExistence, "GetUserExistence"}, - FunctionInfo{2, &ACC_U0::ListAllUsers, "ListAllUsers"}, - FunctionInfo{3, &ACC_U0::ListOpenUsers, "ListOpenUsers"}, - FunctionInfo{4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"}, - FunctionInfo{5, &ACC_U0::GetProfile, "GetProfile"}, - FunctionInfo{6, nullptr, "GetProfileDigest", MakeVersionGate({3,0,0})}, - FunctionInfo{50, &ACC_U0::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, - FunctionInfo{51, &ACC_U0::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, - FunctionInfo{52, &ACC_U0::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, - FunctionInfo{60, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers", MakeVersionGate({5,0,0}, {5,1,0})}, - FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention", MakeVersionGate({6,0,0})}, - FunctionInfo{100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, - FunctionInfo{101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"}, - FunctionInfo{102, nullptr, "AuthenticateApplicationAsync"}, - FunctionInfo{103, nullptr, "CheckNetworkServiceAvailabilityAsync", MakeVersionGate({4,0,0})}, - FunctionInfo{110, &ACC_U0::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, - FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, - FunctionInfo{120, nullptr, "CreateGuestLoginRequest"}, - FunctionInfo{130, nullptr, "LoadOpenContext", MakeVersionGate({5,0,0})}, - FunctionInfo{131, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers", MakeVersionGate({6,0,0})}, - FunctionInfo{140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted", MakeVersionGate({6,0,0})}, - FunctionInfo{141, &ACC_U0::ListQualifiedUsers, "ListQualifiedUsers", MakeVersionGate({6,0,0})}, - FunctionInfo{150, &ACC_U0::IsUserAccountSwitchLocked, "IsUserAccountSwitchLocked", MakeVersionGate({6,0,0})}, - FunctionInfo{160, &ACC_U0::InitializeApplicationInfoV2, "InitializeApplicationInfoV2"} - ); }; class ACC_U1 final : public Module::Interface { public: ACC_U1(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:u1") {} + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:u1") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &ACC_U1::GetUserCount, "GetUserCount"}, + {1, &ACC_U1::GetUserExistence, "GetUserExistence"}, + {2, &ACC_U1::ListAllUsers, "ListAllUsers"}, + {3, &ACC_U1::ListOpenUsers, "ListOpenUsers"}, + {4, &ACC_U1::GetLastOpenedUser, "GetLastOpenedUser"}, + {5, &ACC_U1::GetProfile, "GetProfile"}, + {6, nullptr, "GetProfileDigest"}, + {50, &ACC_U1::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, + {51, &ACC_U1::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, + {52, &ACC_U1::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, + {60, &ACC_U1::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, + {99, nullptr, "DebugActivateOpenContextRetention"}, + {100, nullptr, "GetUserRegistrationNotifier"}, + {101, nullptr, "GetUserStateChangeNotifier"}, + {102, &ACC_U1::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, + {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + {104, nullptr, "GetProfileUpdateNotifier"}, + {105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + {106, nullptr, "GetProfileSyncNotifier"}, + {110, &ACC_U1::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, + {111, nullptr, "ClearSaveDataThumbnail"}, + {112, nullptr, "LoadSaveDataThumbnail"}, + {113, nullptr, "GetSaveDataThumbnailExistence"}, + {120, nullptr, "ListOpenUsersInApplication"}, + {130, nullptr, "ActivateOpenContextRetention"}, + {140, &ACC_U1::ListQualifiedUsers, "ListQualifiedUsers"}, + {150, nullptr, "AuthenticateApplicationAsync"}, + {151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + {152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + {190, nullptr, "GetUserLastOpenedApplication"}, + {191, nullptr, "ActivateOpenContextHolder"}, + {401, &ACC_U1::GetPinCodeLength, "GetPinCodeLength"}, // 18.0.0+ + {402, nullptr, "GetPinCode"}, // 18.0.0+ + {997, nullptr, "DebugInvalidateTokenCacheForUser"}, + {998, nullptr, "DebugSetUserStateClose"}, + {999, nullptr, "DebugSetUserStateOpen"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } ~ACC_U1() override = default; - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ACC_U1::GetUserCount, "GetUserCount"}, - FunctionInfo{1, &ACC_U1::GetUserExistence, "GetUserExistence"}, - FunctionInfo{2, &ACC_U1::ListAllUsers, "ListAllUsers"}, - FunctionInfo{3, &ACC_U1::ListOpenUsers, "ListOpenUsers"}, - FunctionInfo{4, &ACC_U1::GetLastOpenedUser, "GetLastOpenedUser"}, - FunctionInfo{5, &ACC_U1::GetProfile, "GetProfile"}, - FunctionInfo{6, nullptr, "GetProfileDigest"}, - FunctionInfo{50, &ACC_U1::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, - FunctionInfo{51, &ACC_U1::TrySelectUserWithoutInteractionDeprecated, "TrySelectUserWithoutInteractionDeprecated"}, - FunctionInfo{52, &ACC_U1::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, - FunctionInfo{60, &ACC_U1::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, - FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, - FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, - FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, - FunctionInfo{102, &ACC_U1::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, - FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, - FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, - FunctionInfo{110, &ACC_U1::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, - FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, - FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, - FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, - FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, - FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, - FunctionInfo{140, &ACC_U1::ListQualifiedUsers, "ListQualifiedUsers"}, - FunctionInfo{150, nullptr, "AuthenticateApplicationAsync"}, - FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - FunctionInfo{190, nullptr, "GetUserLastOpenedApplication"}, - FunctionInfo{191, nullptr, "ActivateOpenContextHolder"}, - FunctionInfo{401, &ACC_U1::GetPinCodeLength, "GetPinCodeLength", MakeVersionGate({18,0,0})}, - FunctionInfo{402, nullptr, "GetPinCode", MakeVersionGate({18,0,0})}, - FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, - FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, - FunctionInfo{999, nullptr, "DebugSetUserStateOpen"} - ); }; class DAUTH_0 final : public ServiceFramework { public: - explicit DAUTH_0(Core::System& system_) : ServiceFramework{system_, "dauth:0"} {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit DAUTH_0(Core::System& system_) : ServiceFramework{system_, "dauth:0"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, + {1, nullptr, "LoadAuthenticationTokenCache"}, + {2, nullptr, "InvalidateAuthenticationTokenCache"}, + {3, nullptr, "IsDeviceAuthenticationTokenCacheAvailable"}, + {10, nullptr, "EnsureEdgeTokenCacheAsync"}, + {11, nullptr, "LoadEdgeTokenCache"}, + {12, nullptr, "InvalidateEdgeTokenCache"}, + {13, nullptr, "IsEdgeTokenCacheAvailable"}, + {20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, + {21, nullptr, "LoadApplicationAuthenticationTokenCache"}, + {22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, + {23, nullptr, "IsApplicationAuthenticationCacheAvailable"}, + {24, nullptr, "InvalidateApplicationAuthenticationCache"}, + {30, nullptr, "EnsureGameCardAuthenticationCacheAsync"}, + {31, nullptr, "LoadGameCardAuthenticationTokenCache"}, + {32, nullptr, "IsGameCardAuthenticationCacheAvailable"}, + {33, nullptr, "InvalidateGameCardAuthenticationCache"}, + {1000, nullptr, "GetInactiveElicenseUsedEvent"}, + {9000, nullptr, "ImportVirtualClientCertificate"}, + {9010, nullptr, "DeleteVirtualClientCertificate"}, + }; + // clang-format on + RegisterHandlers(functions); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, - FunctionInfo{1, nullptr, "LoadAuthenticationTokenCache"}, - FunctionInfo{2, nullptr, "InvalidateAuthenticationTokenCache"}, - FunctionInfo{3, nullptr, "IsDeviceAuthenticationTokenCacheAvailable"}, - FunctionInfo{10, nullptr, "EnsureEdgeTokenCacheAsync"}, - FunctionInfo{11, nullptr, "LoadEdgeTokenCache"}, - FunctionInfo{12, nullptr, "InvalidateEdgeTokenCache"}, - FunctionInfo{13, nullptr, "IsEdgeTokenCacheAvailable"}, - FunctionInfo{20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, - FunctionInfo{21, nullptr, "LoadApplicationAuthenticationTokenCache"}, - FunctionInfo{22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, - FunctionInfo{23, nullptr, "IsApplicationAuthenticationCacheAvailable"}, - FunctionInfo{24, nullptr, "InvalidateApplicationAuthenticationCache"}, - FunctionInfo{30, nullptr, "EnsureGameCardAuthenticationCacheAsync"}, - FunctionInfo{31, nullptr, "LoadGameCardAuthenticationTokenCache"}, - FunctionInfo{32, nullptr, "IsGameCardAuthenticationCacheAvailable"}, - FunctionInfo{33, nullptr, "InvalidateGameCardAuthenticationCache"}, - FunctionInfo{1000, nullptr, "GetInactiveElicenseUsedEvent"}, - FunctionInfo{9000, nullptr, "ImportVirtualClientCertificate"}, - FunctionInfo{9010, nullptr, "DeleteVirtualClientCertificate"} - ); }; class ACC_E final : public Module::Interface { public: explicit ACC_E(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e") {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetUserCount"}, - FunctionInfo{1, nullptr, "GetUserExistence"}, - FunctionInfo{2, nullptr, "ListAllUsers"}, - FunctionInfo{3, nullptr, "ListOpenUsers"}, - FunctionInfo{4, nullptr, "GetLastOpenedUser"}, - FunctionInfo{5, nullptr, "GetProfile"}, - FunctionInfo{6, nullptr, "GetProfileDigest"}, - FunctionInfo{50, nullptr, "IsUserRegistrationRequestPermitted"}, - FunctionInfo{51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, - FunctionInfo{52, nullptr, "TrySelectUserWithoutInteraction"}, - FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, - FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, - FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, - FunctionInfo{102, nullptr, "GetBaasAccountManagerForSystemService"}, - FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, - FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, - FunctionInfo{110, nullptr, "StoreSaveDataThumbnail"}, - FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, - FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, - FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, - FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, - FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, - FunctionInfo{140, nullptr, "ListQualifiedUsers"}, - FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - FunctionInfo{170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, - FunctionInfo{191, nullptr, "UpdateNotificationReceiverInfo"}, - FunctionInfo{200, nullptr, "BeginUserRegistration"}, - FunctionInfo{201, nullptr, "CompleteUserRegistration"}, - FunctionInfo{202, nullptr, "CancelUserRegistration"}, - FunctionInfo{203, nullptr, "DeleteUser"}, - FunctionInfo{204, nullptr, "SetUserPosition"}, - FunctionInfo{205, nullptr, "GetProfileEditor"}, - FunctionInfo{206, nullptr, "CompleteUserRegistrationForcibly"}, - FunctionInfo{210, nullptr, "CreateFloatingRegistrationRequest"}, - FunctionInfo{211, nullptr, "CreateProcedureToRegisterUserWithNintendoAccount"}, - FunctionInfo{212, nullptr, "ResumeProcedureToRegisterUserWithNintendoAccount"}, - FunctionInfo{213, nullptr, "CreateProcedureToCreateUserWithNintendoAccount"}, - FunctionInfo{214, nullptr, "ResumeProcedureToCreateUserWithNintendoAccount"}, - FunctionInfo{215, nullptr, "ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse"}, - FunctionInfo{230, nullptr, "AuthenticateServiceAsync"}, - FunctionInfo{250, nullptr, "GetBaasAccountAdministrator"}, - FunctionInfo{251, nullptr, "SynchronizeNetworkServiceAccountsSnapshotAsync"}, - FunctionInfo{290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, - FunctionInfo{291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, - FunctionInfo{292, nullptr, "ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser"}, - FunctionInfo{293, nullptr, "ProxyProcedureForDeviceMigrationDownload"}, - FunctionInfo{299, nullptr, "SuspendBackgroundDaemon"}, - FunctionInfo{350, nullptr, "CreateDeviceMigrationUserExportRequest"}, - FunctionInfo{351, nullptr, "UploadNasCredential"}, - FunctionInfo{352, nullptr, "CreateDeviceMigrationUserImportRequest"}, - FunctionInfo{353, nullptr, "DeleteUserMigrationSaveData"}, - FunctionInfo{400, nullptr, "SetPinCode"}, - FunctionInfo{401, nullptr, "GetPinCodeLength"}, - FunctionInfo{402, nullptr, "GetPinCode"}, - FunctionInfo{403, nullptr, "GetPinCodeParity"}, - FunctionInfo{404, nullptr, "VerifyPinCode"}, - FunctionInfo{405, nullptr, "IsPinCodeVerificationForbidden"}, - FunctionInfo{410, nullptr, "GetPinCodeErrorCount"}, - FunctionInfo{411, nullptr, "ResetPinCodeErrorCount"}, - FunctionInfo{412, nullptr, "IncrementPinCodeErrorCount"}, - FunctionInfo{413, nullptr, "SetPinCodeErrorCount"}, - FunctionInfo{420, nullptr, "SetStartPenaltyTime"}, - FunctionInfo{421, nullptr, "GetStartPenaltyTime"}, - FunctionInfo{900, nullptr, "SetUserUnqualifiedForDebug"}, - FunctionInfo{901, nullptr, "UnsetUserUnqualifiedForDebug"}, - FunctionInfo{902, nullptr, "ListUsersUnqualifiedForDebug"}, - FunctionInfo{910, nullptr, "RefreshFirmwareSettingsForDebug"}, - FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, - FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, - FunctionInfo{999, nullptr, "DebugSetUserStateOpen"}, - FunctionInfo{1000, nullptr, "CreateIAccountEntityServiceForApplication"}, - FunctionInfo{1100, nullptr, "CreateIUserStateManager"}, - FunctionInfo{10050, nullptr, "IsUserRegistrationRequestPermittedForAccountPolicy"}, - FunctionInfo{10105, nullptr, "CheckNetworkServiceAvailabilityAsyncForAccountPolicy"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e") { + // clang-format off + static const FunctionInfo functions[] = { + { 0, nullptr, "GetUserCount"}, + { 1, nullptr, "GetUserExistence"}, + { 2, nullptr, "ListAllUsers"}, + { 3, nullptr, "ListOpenUsers"}, + { 4, nullptr, "GetLastOpenedUser"}, + { 5, nullptr, "GetProfile"}, + { 6, nullptr, "GetProfileDigest"}, + { 50, nullptr, "IsUserRegistrationRequestPermitted"}, + { 51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, + { 52, nullptr, "TrySelectUserWithoutInteraction"}, + { 99, nullptr, "DebugActivateOpenContextRetention"}, + { 100, nullptr, "GetUserRegistrationNotifier"}, + { 101, nullptr, "GetUserStateChangeNotifier"}, + { 102, nullptr, "GetBaasAccountManagerForSystemService"}, + { 103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + { 104, nullptr, "GetProfileUpdateNotifier"}, + { 105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + { 106, nullptr, "GetProfileSyncNotifier"}, + { 110, nullptr, "StoreSaveDataThumbnail"}, + { 111, nullptr, "ClearSaveDataThumbnail"}, + { 112, nullptr, "LoadSaveDataThumbnail"}, + { 113, nullptr, "GetSaveDataThumbnailExistence"}, + { 120, nullptr, "ListOpenUsersInApplication"}, + { 130, nullptr, "ActivateOpenContextRetention"}, + { 140, nullptr, "ListQualifiedUsers"}, + { 151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + { 152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + { 170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, + { 191, nullptr, "UpdateNotificationReceiverInfo"}, + { 200, nullptr, "BeginUserRegistration"}, + { 201, nullptr, "CompleteUserRegistration"}, + { 202, nullptr, "CancelUserRegistration"}, + { 203, nullptr, "DeleteUser"}, + { 204, nullptr, "SetUserPosition"}, + { 205, nullptr, "GetProfileEditor"}, + { 206, nullptr, "CompleteUserRegistrationForcibly"}, + { 210, nullptr, "CreateFloatingRegistrationRequest"}, + { 211, nullptr, "CreateProcedureToRegisterUserWithNintendoAccount"}, + { 212, nullptr, "ResumeProcedureToRegisterUserWithNintendoAccount"}, + { 213, nullptr, "CreateProcedureToCreateUserWithNintendoAccount"}, + { 214, nullptr, "ResumeProcedureToCreateUserWithNintendoAccount"}, + { 215, nullptr, "ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse"}, + { 230, nullptr, "AuthenticateServiceAsync"}, + { 250, nullptr, "GetBaasAccountAdministrator"}, + { 251, nullptr, "SynchronizeNetworkServiceAccountsSnapshotAsync"}, + { 290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, + { 291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, + { 292, nullptr, "ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser"}, + { 293, nullptr, "ProxyProcedureForDeviceMigrationDownload"}, + { 299, nullptr, "SuspendBackgroundDaemon"}, + { 350, nullptr, "CreateDeviceMigrationUserExportRequest"}, + { 351, nullptr, "UploadNasCredential"}, + { 352, nullptr, "CreateDeviceMigrationUserImportRequest"}, + { 353, nullptr, "DeleteUserMigrationSaveData"}, + { 400, nullptr, "SetPinCode"}, + { 401, nullptr, "GetPinCodeLength"}, + { 402, nullptr, "GetPinCode"}, + { 403, nullptr, "GetPinCodeParity"}, + { 404, nullptr, "VerifyPinCode"}, + { 405, nullptr, "IsPinCodeVerificationForbidden"}, + { 410, nullptr, "GetPinCodeErrorCount"}, + { 411, nullptr, "ResetPinCodeErrorCount"}, + { 412, nullptr, "IncrementPinCodeErrorCount"}, + { 413, nullptr, "SetPinCodeErrorCount"}, + { 420, nullptr, "SetStartPenaltyTime"}, + { 421, nullptr, "GetStartPenaltyTime"}, + { 900, nullptr, "SetUserUnqualifiedForDebug"}, + { 901, nullptr, "UnsetUserUnqualifiedForDebug"}, + { 902, nullptr, "ListUsersUnqualifiedForDebug"}, + { 910, nullptr, "RefreshFirmwareSettingsForDebug"}, + { 997, nullptr, "DebugInvalidateTokenCacheForUser"}, + { 998, nullptr, "DebugSetUserStateClose"}, + { 999, nullptr, "DebugSetUserStateOpen"}, + { 1000, nullptr, "CreateIAccountEntityServiceForApplication"}, + { 1100, nullptr, "CreateIUserStateManager"}, + { 10050, nullptr, "IsUserRegistrationRequestPermittedForAccountPolicy"}, + { 10105, nullptr, "CheckNetworkServiceAvailabilityAsyncForAccountPolicy"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class ACC_E_U1 final : public Module::Interface { public: explicit ACC_E_U1(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e:u1") {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetUserCount"}, - FunctionInfo{1, nullptr, "GetUserExistence"}, - FunctionInfo{2, nullptr, "ListAllUsers"}, - FunctionInfo{3, nullptr, "ListOpenUsers"}, - FunctionInfo{4, nullptr, "GetLastOpenedUser"}, - FunctionInfo{5, nullptr, "GetProfile"}, - FunctionInfo{6, nullptr, "GetProfileDigest"}, - FunctionInfo{50, nullptr, "IsUserRegistrationRequestPermitted"}, - FunctionInfo{51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, - FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, - FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, - FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, - FunctionInfo{102, nullptr, "GetBaasAccountManagerForSystemService"}, - FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, - FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, - FunctionInfo{110, nullptr, "StoreSaveDataThumbnail"}, - FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, - FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, - FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, - FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, - FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, - FunctionInfo{140, nullptr, "ListQualifiedUsers"}, - FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - FunctionInfo{170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, - FunctionInfo{191, nullptr, "UpdateNotificationReceiverInfo"}, - FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, - FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, - FunctionInfo{999, nullptr, "DebugSetUserStateOpen"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e:u1") { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetUserCount"}, + {1, nullptr, "GetUserExistence"}, + {2, nullptr, "ListAllUsers"}, + {3, nullptr, "ListOpenUsers"}, + {4, nullptr, "GetLastOpenedUser"}, + {5, nullptr, "GetProfile"}, + {6, nullptr, "GetProfileDigest"}, + {50, nullptr, "IsUserRegistrationRequestPermitted"}, + {51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, + {99, nullptr, "DebugActivateOpenContextRetention"}, + {100, nullptr, "GetUserRegistrationNotifier"}, + {101, nullptr, "GetUserStateChangeNotifier"}, + {102, nullptr, "GetBaasAccountManagerForSystemService"}, + {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + {104, nullptr, "GetProfileUpdateNotifier"}, + {105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + {106, nullptr, "GetProfileSyncNotifier"}, + {110, nullptr, "StoreSaveDataThumbnail"}, + {111, nullptr, "ClearSaveDataThumbnail"}, + {112, nullptr, "LoadSaveDataThumbnail"}, + {113, nullptr, "GetSaveDataThumbnailExistence"}, + {120, nullptr, "ListOpenUsersInApplication"}, + {130, nullptr, "ActivateOpenContextRetention"}, + {140, nullptr, "ListQualifiedUsers"}, + {151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + {152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + {170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, + {191, nullptr, "UpdateNotificationReceiverInfo"}, + {997, nullptr, "DebugInvalidateTokenCacheForUser"}, + {998, nullptr, "DebugSetUserStateClose"}, + {999, nullptr, "DebugSetUserStateOpen"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class ACC_E_U2 final : public Module::Interface { public: explicit ACC_E_U2(std::shared_ptr module_, std::shared_ptr profile_manager_, Core::System& system_) - : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e:u2") {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetUserCount"}, - FunctionInfo{1, nullptr, "GetUserExistence"}, - FunctionInfo{2, nullptr, "ListAllUsers"}, - FunctionInfo{3, nullptr, "ListOpenUsers"}, - FunctionInfo{4, nullptr, "GetLastOpenedUser"}, - FunctionInfo{5, nullptr, "GetProfile"}, - FunctionInfo{6, nullptr, "GetProfileDigest"}, - FunctionInfo{50, nullptr, "IsUserRegistrationRequestPermitted"}, - FunctionInfo{51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, - FunctionInfo{52, nullptr, "TrySelectUserWithoutInteraction"}, - FunctionInfo{99, nullptr, "DebugActivateOpenContextRetention"}, - FunctionInfo{100, nullptr, "GetUserRegistrationNotifier"}, - FunctionInfo{101, nullptr, "GetUserStateChangeNotifier"}, - FunctionInfo{102, nullptr, "GetBaasAccountManagerForSystemService"}, - FunctionInfo{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, - FunctionInfo{104, nullptr, "GetProfileUpdateNotifier"}, - FunctionInfo{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, - FunctionInfo{106, nullptr, "GetProfileSyncNotifier"}, - FunctionInfo{110, nullptr, "StoreSaveDataThumbnail"}, - FunctionInfo{111, nullptr, "ClearSaveDataThumbnail"}, - FunctionInfo{112, nullptr, "LoadSaveDataThumbnail"}, - FunctionInfo{113, nullptr, "GetSaveDataThumbnailExistence"}, - FunctionInfo{120, nullptr, "ListOpenUsersInApplication"}, - FunctionInfo{130, nullptr, "ActivateOpenContextRetention"}, - FunctionInfo{140, nullptr, "ListQualifiedUsers"}, - FunctionInfo{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, - FunctionInfo{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, - FunctionInfo{170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, - FunctionInfo{191, nullptr, "UpdateNotificationReceiverInfo"}, - FunctionInfo{205, nullptr, "GetProfileEditor"}, - FunctionInfo{401, nullptr, "GetPinCodeLength"}, - FunctionInfo{402, nullptr, "GetPinCode"}, - FunctionInfo{403, nullptr, "GetPinCodeParity"}, - FunctionInfo{404, nullptr, "VerifyPinCode"}, - FunctionInfo{405, nullptr, "IsPinCodeVerificationForbidden"}, - FunctionInfo{997, nullptr, "DebugInvalidateTokenCacheForUser"}, - FunctionInfo{998, nullptr, "DebugSetUserStateClose"}, - FunctionInfo{999, nullptr, "DebugSetUserStateOpen"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : Interface(std::move(module_), std::move(profile_manager_), system_, "acc:e:u2") { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetUserCount"}, + {1, nullptr, "GetUserExistence"}, + {2, nullptr, "ListAllUsers"}, + {3, nullptr, "ListOpenUsers"}, + {4, nullptr, "GetLastOpenedUser"}, + {5, nullptr, "GetProfile"}, + {6, nullptr, "GetProfileDigest"}, + {50, nullptr, "#IsUserRegistrationRequestPermitted"}, + {51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, + {52, nullptr, "TrySelectUserWithoutInteraction"}, + {99, nullptr, "DebugActivateOpenContextRetention"}, + {100, nullptr, "GetUserRegistrationNotifier"}, + {101, nullptr, "GetUserStateChangeNotifier"}, + {102, nullptr, "GetBaasAccountManagerForSystemService"}, + {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, + {104, nullptr, "GetProfileUpdateNotifier"}, + {105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, + {106, nullptr, "GetProfileSyncNotifier"}, + {110, nullptr, "StoreSaveDataThumbnail"}, + {111, nullptr, "ClearSaveDataThumbnail"}, + {112, nullptr, "LoadSaveDataThumbnail"}, + {113, nullptr, "GetSaveDataThumbnailExistence"}, + {120, nullptr, "ListOpenUsersInApplication"}, + {130, nullptr, "ActivateOpenContextRetention"}, + {140, nullptr, "ListQualifiedUsers"}, + {151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, + {152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, + {170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, + {191, nullptr, "UpdateNotificationReceiverInfo"}, + {205, nullptr, "GetProfileEditor"}, + {401, nullptr, "GetPinCodeLength"}, + {402, nullptr, "GetPinCode"}, + {403, nullptr, "GetPinCodeParity"}, + {404, nullptr, "VerifyPinCode"}, + {405, nullptr, "IsPinCodeVerificationForbidden"}, + {997, nullptr, "DebugInvalidateTokenCacheForUser"}, + {998, nullptr, "DebugSetUserStateClose"}, + {999, nullptr, "DebugSetUserStateOpen"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h index 9c2c96acdb..19af7c74c9 100644 --- a/src/core/hle/service/acc/acc.h +++ b/src/core/hle/service/acc/acc.h @@ -14,6 +14,70 @@ namespace Service::Account { class ProfileManager; +class Module final { +public: + class Interface : public ServiceFramework { + public: + explicit Interface(std::shared_ptr module_, + std::shared_ptr profile_manager_, Core::System& system_, + const char* name); + ~Interface() override; + + void GetUserCount(HLERequestContext& ctx); + void GetUserExistence(HLERequestContext& ctx); + void ListAllUsers(HLERequestContext& ctx); + void ListOpenUsers(HLERequestContext& ctx); + void GetLastOpenedUser(HLERequestContext& ctx); + void GetProfile(HLERequestContext& ctx); + void InitializeApplicationInfo(HLERequestContext& ctx); + void InitializeApplicationInfoRestricted(HLERequestContext& ctx); + void GetBaasAccountManagerForApplication(HLERequestContext& ctx); + void IsUserRegistrationRequestPermitted(HLERequestContext& ctx); + void TrySelectUserWithoutInteractionDeprecated(HLERequestContext& ctx); + void TrySelectUserWithoutInteraction(HLERequestContext& ctx); + void IsUserAccountSwitchLocked(HLERequestContext& ctx); + void InitializeApplicationInfoV2(HLERequestContext& ctx); + void BeginUserRegistration(HLERequestContext& ctx); + void CompleteUserRegistration(HLERequestContext& ctx); + void DeleteUser(HLERequestContext& ctx); + void SetUserPosition(HLERequestContext& ctx); + void GetProfileEditor(HLERequestContext& ctx); + void GetBaasAccountAdministrator(HLERequestContext &ctx); + void ListQualifiedUsers(HLERequestContext& ctx); + void ListOpenContextStoredUsers(HLERequestContext& ctx); + void StoreSaveDataThumbnailApplication(HLERequestContext& ctx); + void GetBaasAccountManagerForSystemService(HLERequestContext& ctx); + void StoreSaveDataThumbnailSystem(HLERequestContext& ctx); + void GetPinCodeLength(HLERequestContext& ctx); + + private: + Result InitializeApplicationInfoBase(); + void StoreSaveDataThumbnail(HLERequestContext& ctx, const Common::UUID& uuid, + const u64 tid); + + enum class ApplicationType : u32_le { + GameCard = 0, + Digital = 1, + Unknown = 3, + }; + + struct ApplicationInfo { + Service::Glue::ApplicationLaunchProperty launch_property; + ApplicationType application_type; + + constexpr explicit operator bool() const { + return launch_property.title_id != 0x0; + } + }; + + ApplicationInfo application_info{}; + + protected: + std::shared_ptr module; + std::shared_ptr profile_manager; + }; +}; + void LoopProcess(Core::System& system); } // namespace Service::Account diff --git a/src/core/hle/service/acc/async_context.cpp b/src/core/hle/service/acc/async_context.cpp index a7f751d756..8dec886ad7 100644 --- a/src/core/hle/service/acc/async_context.cpp +++ b/src/core/hle/service/acc/async_context.cpp @@ -12,6 +12,17 @@ namespace Service::Account { IAsyncContext::IAsyncContext(Core::System& system_) : ServiceFramework{system_, "IAsyncContext"}, service_context{system_, "IAsyncContext"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IAsyncContext::GetSystemEvent, "GetSystemEvent"}, + {1, &IAsyncContext::Cancel, "Cancel"}, + {2, &IAsyncContext::HasDone, "HasDone"}, + {3, &IAsyncContext::GetResult, "GetResult"}, + }; + // clang-format on + + RegisterHandlers(functions); + completion_event = service_context.CreateEvent("IAsyncContext:CompletionEvent"); } diff --git a/src/core/hle/service/acc/async_context.h b/src/core/hle/service/acc/async_context.h index 0137567d11..c50537d4ae 100644 --- a/src/core/hle/service/acc/async_context.h +++ b/src/core/hle/service/acc/async_context.h @@ -33,16 +33,6 @@ protected: void MarkComplete(); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IAsyncContext::GetSystemEvent, "GetSystemEvent"}, - FunctionInfo{1, &IAsyncContext::Cancel, "Cancel"}, - FunctionInfo{2, &IAsyncContext::HasDone, "HasDone"}, - FunctionInfo{3, &IAsyncContext::GetResult, "GetResult"} - ); - KernelHelpers::ServiceContext service_context; std::atomic is_complete{false}; diff --git a/src/core/hle/service/acc/errors.h b/src/core/hle/service/acc/errors.h index 433ebfe9d6..b7cf8b5f93 100644 --- a/src/core/hle/service/acc/errors.h +++ b/src/core/hle/service/acc/errors.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 472be8f0f0..86d9d52e34 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -4,1340 +4,16 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "common/settings.h" -#include "core/core.h" -#include "core/file_sys/common_funcs.h" -#include "core/file_sys/patch_manager.h" -#include "core/file_sys/romfs_factory.h" -#include "core/file_sys/control_metadata.h" -#include "core/hle/api_version.h" -#include "core/hle/kernel/k_transfer_memory.h" -#include "core/hle/service/server_manager.h" -#include "core/hle/service/am/applet_manager.h" -#include "core/hle/service/am/window_system.h" #include "core/hle/service/am/am.h" #include "core/hle/service/am/button_poller.h" #include "core/hle/service/am/event_observer.h" -#include "core/hle/service/am/service/application_creator.h" -#include "core/hle/service/am/service/audio_controller.h" -#include "core/hle/service/am/service/common_state_getter.h" -#include "core/hle/service/am/service/display_controller.h" -#include "core/hle/service/am/service/global_state_controller.h" -#include "core/hle/service/am/service/home_menu_functions.h" -#include "core/hle/service/am/service/process_winding_controller.h" -#include "core/hle/service/am/service/self_controller.h" -#include "core/hle/service/am/service/window_controller.h" -#include "core/hle/service/am/service/application_functions.h" -#include "core/hle/service/am/applet_data_broker.h" -#include "core/hle/service/am/frontend/applets.h" -#include "core/hle/service/am/library_applet_storage.h" -#include "core/hle/service/am/process_creation.h" -#include "core/hle/service/am/service/library_applet_accessor.h" -#include "core/hle/service/am/service/overlay_functions.h" -#include "core/hle/service/am/service/storage.h" -#include "core/hle/service/ns/language.h" -#include "core/hle/service/ns/application_manager_interface.h" -#include "core/hle/service/ns/service_getter_interface.h" -#include "core/hle/service/glue/glue_manager.h" -#include "core/hle/service/sm/sm.h" -#include "core/hle/service/acc/profile_manager.h" -#include "core/hle/service/am/frontend/applet_profile_select.h" -#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/am/service/all_system_applet_proxies_service.h" +#include "core/hle/service/am/service/application_proxy_service.h" +#include "core/hle/service/am/window_system.h" +#include "core/hle/service/server_manager.h" namespace Service::AM { -struct Applet; -class IAppletCommonFunctions; -class IApplicationCreator; -class IAudioController; -class ICommonStateGetter; -class IDebugFunctions; -class IDisplayController; -class IHomeMenuFunctions; -class IGlobalStateController; -class ILibraryAppletCreator; -class IProcessWindingController; -class ISelfController; -class IWindowController; -class WindowSystem; - -class IDebugFunctions final : public ServiceFramework { -public: - explicit IDebugFunctions(Core::System& system_) : ServiceFramework{system_, "IDebugFunctions"} {} - ~IDebugFunctions() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "NotifyMessageToHomeMenuForDebug"}, - FunctionInfo{1, nullptr, "OpenMainApplication"}, - FunctionInfo{10, nullptr, "PerformSystemButtonPressing"}, - FunctionInfo{20, nullptr, "InvalidateTransitionLayer"}, - FunctionInfo{30, nullptr, "RequestLaunchApplicationWithUserAndArgumentForDebug"}, - FunctionInfo{31, nullptr, "RequestLaunchApplicationByApplicationLaunchInfoForDebug"}, - FunctionInfo{40, nullptr, "GetAppletResourceUsageInfo"}, - FunctionInfo{50, nullptr, "AddSystemProgramIdAndAppletIdForDebug"}, - FunctionInfo{51, nullptr, "AddOperationConfirmedLibraryAppletIdForDebug"}, - FunctionInfo{100, nullptr, "SetCpuBoostModeForApplet"}, - FunctionInfo{101, nullptr, "CancelCpuBoostModeForApplet"}, - FunctionInfo{110, nullptr, "PushToAppletBoundChannelForDebug"}, - FunctionInfo{111, nullptr, "TryPopFromAppletBoundChannelForDebug"}, - FunctionInfo{120, nullptr, "AlarmSettingNotificationEnableAppEventReserve"}, - FunctionInfo{121, nullptr, "AlarmSettingNotificationDisableAppEventReserve"}, - FunctionInfo{122, nullptr, "AlarmSettingNotificationPushAppEventNotify"}, - FunctionInfo{130, nullptr, "FriendInvitationSetApplicationParameter"}, - FunctionInfo{131, nullptr, "FriendInvitationClearApplicationParameter"}, - FunctionInfo{132, nullptr, "FriendInvitationPushApplicationParameter"}, - FunctionInfo{140, nullptr, "RestrictPowerOperationForSecureLaunchModeForDebug"}, - FunctionInfo{200, nullptr, "CreateFloatingLibraryAppletAccepterForDebug"}, - FunctionInfo{300, nullptr, "TerminateAllRunningApplicationsForDebug"}, - FunctionInfo{900, nullptr, "GetGrcProcessLaunchedSystemEvent"} - ); -}; - -class IApplicationProxy final : public ServiceFramework { -public: - explicit IApplicationProxy(Core::System& system_, std::shared_ptr applet, - Kernel::KProcess* process, WindowSystem& window_system) - : ServiceFramework{system_, "IApplicationProxy"}, - m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { - } - - ~IApplicationProxy() override = default; - - Result GetAudioController( - Out> out_audio_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_audio_controller = std::make_shared(system); - R_SUCCEED(); - } - - Result GetDisplayController( - Out> out_display_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_display_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetProcessWindingController( - Out> out_process_winding_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_process_winding_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetDebugFunctions( - Out> out_debug_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_debug_functions = std::make_shared(system); - R_SUCCEED(); - } - - Result GetWindowController( - Out> out_window_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_window_controller = std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result GetSelfController( - Out> out_self_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_self_controller = std::make_shared(system, m_applet, m_process); - R_SUCCEED(); - } - - Result GetCommonStateGetter( - Out> out_common_state_getter) { - LOG_DEBUG(Service_AM, "called"); - *out_common_state_getter = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetLibraryAppletCreator( - Out> out_library_applet_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_creator = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result GetApplicationFunctions( - Out> out_application_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_application_functions = std::make_shared(system, m_applet); - R_SUCCEED(); - } - -private: - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IApplicationProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, - FunctionInfo{1, D<&IApplicationProxy::GetSelfController>, "GetSelfController"}, - FunctionInfo{2, D<&IApplicationProxy::GetWindowController>, "GetWindowController"}, - FunctionInfo{3, D<&IApplicationProxy::GetAudioController>, "GetAudioController"}, - FunctionInfo{4, D<&IApplicationProxy::GetDisplayController>, "GetDisplayController"}, - FunctionInfo{10, D<&IApplicationProxy::GetProcessWindingController>, "GetProcessWindingController"}, - FunctionInfo{11, D<&IApplicationProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, - FunctionInfo{20, D<&IApplicationProxy::GetApplicationFunctions>, "GetApplicationFunctions"}, - FunctionInfo{1000, D<&IApplicationProxy::GetDebugFunctions>, "GetDebugFunctions"} - ); - WindowSystem& m_window_system; - Kernel::KProcess* const m_process; - const std::shared_ptr m_applet; -}; - -class IApplicationProxyService final : public ServiceFramework { -public: - explicit IApplicationProxyService(Core::System& system_, - WindowSystem& window_system) - : ServiceFramework{system_, "appletOE"}, m_window_system{window_system} { - } - - ~IApplicationProxyService() override = default; - - Result OpenApplicationProxy( - Out> out_application_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_DEBUG(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid)) { - *out_application_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } - } - - std::shared_ptr GetAppletFromProcessId(ProcessId process_id) { - return m_window_system.GetByAppletResourceUserId(process_id.pid); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IApplicationProxyService::OpenApplicationProxy>, "OpenApplicationProxy"} - ); - WindowSystem& m_window_system; -}; - -class IAppletCommonFunctions final : public ServiceFramework { -public: - explicit IAppletCommonFunctions(Core::System& system_, std::shared_ptr applet_) : ServiceFramework{system_, "IAppletCommonFunctions"}, applet{std::move(applet_)} {} - ~IAppletCommonFunctions() override = default; - - Result SetHomeButtonDoubleClickEnabled( - bool home_button_double_click_enabled) { - LOG_WARNING(Service_AM, "(STUBBED) called, home_button_double_click_enabled={}", home_button_double_click_enabled); - R_SUCCEED(); - } - - Result GetHomeButtonDoubleClickEnabled( - Out out_home_button_double_click_enabled) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_home_button_double_click_enabled = false; - R_SUCCEED(); - } - - Result SetDisplayMagnification(f32 x, f32 y, f32 width, f32 height) { - LOG_DEBUG(Service_AM, "(STUBBED) called, x={}, y={}, width={}, height={}", x, y, width, height); - std::scoped_lock lk{applet->lock}; - applet->display_magnification = Common::Rectangle{x, y, x + width, y + height}; - R_SUCCEED(); - } - - Result SetCpuBoostRequestPriority(s32 priority) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - std::scoped_lock lk{applet->lock}; - applet->cpu_boost_request_priority = priority; - R_SUCCEED(); - } - - Result GetCurrentApplicationId(Out out_application_id) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_application_id = FileSys::GetBaseTitleID(system.GetApplicationProcessProgramID()); - R_SUCCEED(); - } - - Result SetGpuTimeSliceBoost(s64 time_span) { - LOG_WARNING(Service_AM, "(STUBBED) called, time_span={}", time_span); - R_SUCCEED(); - } - - Result Unknown350(Out out_unknown) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_unknown = 0; - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetTerminateResult"}, - FunctionInfo{10, nullptr, "ReadThemeStorage"}, - FunctionInfo{11, nullptr, "WriteThemeStorage"}, - FunctionInfo{20, nullptr, "PushToAppletBoundChannel"}, - FunctionInfo{21, nullptr, "TryPopFromAppletBoundChannel"}, - FunctionInfo{40, nullptr, "GetDisplayLogicalResolution"}, - FunctionInfo{42, D<&IAppletCommonFunctions::SetDisplayMagnification>, "SetDisplayMagnification"}, - FunctionInfo{50, D<&IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled>, "SetHomeButtonDoubleClickEnabled"}, - FunctionInfo{51, D<&IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled>, "GetHomeButtonDoubleClickEnabled"}, - FunctionInfo{52, nullptr, "IsHomeButtonShortPressedBlocked"}, - FunctionInfo{60, nullptr, "IsVrModeCurtainRequired"}, - FunctionInfo{61, nullptr, "IsSleepRequiredByHighTemperature"}, - FunctionInfo{62, nullptr, "IsSleepRequiredByLowBattery"}, - FunctionInfo{70, D<&IAppletCommonFunctions::SetCpuBoostRequestPriority>, "SetCpuBoostRequestPriority"}, - FunctionInfo{80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"}, - FunctionInfo{81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"}, - FunctionInfo{90, nullptr, "OpenNamedChannelAsParent"}, - FunctionInfo{91, nullptr, "OpenNamedChannelAsChild"}, - FunctionInfo{100, nullptr, "SetApplicationCoreUsageMode"}, - FunctionInfo{300, D<&IAppletCommonFunctions::GetCurrentApplicationId>, "GetCurrentApplicationId"}, - FunctionInfo{310, nullptr, "IsSystemAppletHomeMenu", MakeVersionGate({19,0,0})}, - FunctionInfo{320, D<&IAppletCommonFunctions::SetGpuTimeSliceBoost>, "SetGpuTimeSliceBoost", MakeVersionGate({19,0,0})}, - FunctionInfo{321, nullptr, "SetGpuTimeSliceBoostDueToApplication", MakeVersionGate({19,0,0})}, - FunctionInfo{350, D<&IAppletCommonFunctions::Unknown350>, "Unknown350", MakeVersionGate({20,0,0})} - ); - const std::shared_ptr applet; -}; - -class ISystemAppletProxy final : public ServiceFramework { -public: - explicit ISystemAppletProxy(Core::System& system_, std::shared_ptr applet, Kernel::KProcess* process, WindowSystem& window_system) - : ServiceFramework{system_, "ISystemAppletProxy"}, - m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { - } - - ~ISystemAppletProxy() override = default; - - Result GetAudioController( - Out> out_audio_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_audio_controller = std::make_shared(system); - R_SUCCEED(); - } - - Result GetDisplayController( - Out> out_display_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_display_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetProcessWindingController( - Out> out_process_winding_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_process_winding_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetDebugFunctions( - Out> out_debug_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_debug_functions = std::make_shared(system); - R_SUCCEED(); - } - - Result GetWindowController( - Out> out_window_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_window_controller = std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result GetSelfController( - Out> out_self_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_self_controller = std::make_shared(system, m_applet, m_process); - R_SUCCEED(); - } - - Result GetCommonStateGetter( - Out> out_common_state_getter) { - LOG_DEBUG(Service_AM, "called"); - *out_common_state_getter = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetLibraryAppletCreator( - Out> out_library_applet_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_creator = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result GetApplicationCreator( - Out> out_application_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_application_creator = std::make_shared(system, m_window_system); - R_SUCCEED(); - } - - Result GetAppletCommonFunctions( - Out> out_applet_common_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_applet_common_functions = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetHomeMenuFunctions( - Out> out_home_menu_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_home_menu_functions = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result GetGlobalStateController( - Out> out_global_state_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_global_state_controller = std::make_shared(system); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ISystemAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, - FunctionInfo{1, D<&ISystemAppletProxy::GetSelfController>, "GetSelfController"}, - FunctionInfo{2, D<&ISystemAppletProxy::GetWindowController>, "GetWindowController"}, - FunctionInfo{3, D<&ISystemAppletProxy::GetAudioController>, "GetAudioController"}, - FunctionInfo{4, D<&ISystemAppletProxy::GetDisplayController>, "GetDisplayController"}, - FunctionInfo{10, D<&ISystemAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, - FunctionInfo{11, D<&ISystemAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, - FunctionInfo{20, D<&ISystemAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"}, - FunctionInfo{21, D<&ISystemAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, - FunctionInfo{22, D<&ISystemAppletProxy::GetApplicationCreator>, "GetApplicationCreator"}, - FunctionInfo{23, D<&ISystemAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, - FunctionInfo{1000, D<&ISystemAppletProxy::GetDebugFunctions>, "GetDebugFunctions"} - ); - WindowSystem& m_window_system; - Kernel::KProcess* const m_process; - const std::shared_ptr m_applet; -}; - -static AppletIdentityInfo GetCallerIdentity(Applet& applet) { - if (const auto caller_applet = applet.caller_applet.lock(); caller_applet) { - // TODO: is this actually the application ID? - return { - .applet_id = caller_applet->applet_id, - .application_id = caller_applet->program_id, - }; - } else { - return { - .applet_id = AppletId::QLaunch, - .application_id = 0x0100000000001000ull, - }; - } -} - -class ILibraryAppletSelfAccessor final : public ServiceFramework { -public: - ILibraryAppletSelfAccessor(Core::System& system_, - std::shared_ptr applet) - : ServiceFramework{system_, "ILibraryAppletSelfAccessor"}, m_applet{std::move(applet)}, - m_broker{m_applet->caller_applet_broker} { - } - - ~ILibraryAppletSelfAccessor() = default; - - Result PopInData(Out> out_storage) { - LOG_INFO(Service_AM, "called"); - R_RETURN(m_broker->GetInData().Pop(system.Kernel(), out_storage)); - } - - Result PushOutData(SharedPointer storage) { - LOG_INFO(Service_AM, "called"); - m_broker->GetOutData().Push(system.Kernel(), storage); - R_SUCCEED(); - } - - Result PopInteractiveInData(Out> out_storage) { - LOG_INFO(Service_AM, "called"); - R_RETURN(m_broker->GetInteractiveInData().Pop(system.Kernel(), out_storage)); - } - - Result PushInteractiveOutData(SharedPointer storage) { - LOG_INFO(Service_AM, "called"); - m_broker->GetInteractiveOutData().Push(system.Kernel(), storage); - R_SUCCEED(); - } - - Result GetPopInDataEvent( - OutCopyHandle out_event) { - LOG_INFO(Service_AM, "called"); - *out_event = m_broker->GetInData().GetEvent(); - R_SUCCEED(); - } - - Result GetPopInteractiveInDataEvent( - OutCopyHandle out_event) { - LOG_INFO(Service_AM, "called"); - *out_event = m_broker->GetInteractiveInData().GetEvent(); - R_SUCCEED(); - } - - Result GetLibraryAppletInfo( - Out out_library_applet_info) { - LOG_INFO(Service_AM, "called"); - *out_library_applet_info = { - .applet_id = m_applet->applet_id, - .library_applet_mode = m_applet->library_applet_mode, - }; - R_SUCCEED(); - } - - Result GetMainAppletIdentityInfo( - Out out_identity_info) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_identity_info = { - .applet_id = AppletId::QLaunch, - .application_id = 0x0100000000001000ull, - }; - R_SUCCEED(); - } - - Result CanUseApplicationCore(Out out_can_use_application_core) { - // TODO: This appears to read the NPDM from state and check the core mask of the applet. - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_can_use_application_core = false; - R_SUCCEED(); - } - - Result GetMainAppletApplicationControlProperty( - OutLargeData, BufferAttr_HipcMapAlias> out_nacp) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - - // TODO: this should be the main applet, not the caller applet - const auto application = GetCallerIdentity(*m_applet); - std::vector nacp; - const auto result = - system.GetARPManager().GetControlProperty(&nacp, application.application_id); - - if (R_SUCCEEDED(result)) { - std::memcpy(out_nacp->data(), nacp.data(), (std::min)(nacp.size(), out_nacp->size())); - } - - R_RETURN(result); - } - - Result GetMainAppletStorageId(Out out_storage_id) { - LOG_INFO(Service_AM, "(STUBBED) called"); - *out_storage_id = FileSys::StorageId::NandUser; - R_SUCCEED(); - } - - Result ExitProcessAndReturn() { - LOG_INFO(Service_AM, "called"); - - if (const auto caller_applet = m_applet->caller_applet.lock(); caller_applet) { - m_applet->process->Terminate(); - } else { - system.GetUserChannel() = m_applet->user_channel_launch_parameter; - system.ExecuteProgram(0); - } - - R_SUCCEED(); - } - - Result GetCallerAppletIdentityInfo( - Out out_identity_info) { - LOG_INFO(Service_AM, "called"); - *out_identity_info = GetCallerIdentity(*m_applet); - R_SUCCEED(); - } - - Result GetCallerAppletIdentityInfoStack( - Out out_count, OutArray out_identity_info) { - LOG_INFO(Service_AM, "called"); - - std::shared_ptr applet = m_applet; - *out_count = 0; - - do { - if (*out_count >= static_cast(out_identity_info.size())) { - break; - } - out_identity_info[(*out_count)++] = GetCallerIdentity(*applet); - } while ((applet = applet->caller_applet.lock())); - - R_SUCCEED(); - } - - Result GetDesirableKeyboardLayout(Out out_desirable_layout) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - *out_desirable_layout = 0; - R_SUCCEED(); - } - - Result ReportVisibleError(ErrorCode error_code) { - LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category, - error_code.number); - R_SUCCEED(); - } - - Result ReportVisibleErrorWithErrorContext( - ErrorCode error_code, InLargeData error_context) { - LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category, - error_code.number); - R_SUCCEED(); - } - - Result UnpopInData(SharedPointer storage) { - LOG_INFO(Service_AM, "called"); - m_broker->GetInData().Unpop(system.Kernel(), storage); - R_SUCCEED(); - } - - Result GetMainAppletApplicationDesiredLanguage( - Out out_desired_language) { - // FIXME: this is copied from IApplicationFunctions::GetDesiredLanguage - // FIXME: all of this stuff belongs to ns - auto identity = GetCallerIdentity(*m_applet); - - // TODO(bunnei): This should be configurable - LOG_DEBUG(Service_AM, "called"); - - // Get supported languages from NACP, if possible - // Default to 0 (all languages supported) - u32 supported_languages = 0; - - const auto res = FileSys::PatchManager::GetMetadataFromBaseOrUpdate(system, identity.application_id); - - if (res.first != nullptr) { - supported_languages = res.first->GetSupportedLanguages(); - } - - // Call IApplicationManagerInterface implementation. - auto& service_manager = system.ServiceManager(); - auto ns_am2 = service_manager.GetService("ns:am2"); - - std::shared_ptr app_man; - R_TRY(ns_am2->GetApplicationManagerInterface(&app_man)); - - // Get desired application language - NS::ApplicationLanguage desired_language{}; - R_TRY(app_man->GetApplicationDesiredLanguage(&desired_language, supported_languages)); - - // Convert to settings language code. - u64 language_code{}; - R_TRY(app_man->ConvertApplicationLanguageToLanguageCode(&language_code, desired_language)); - - LOG_DEBUG(Service_AM, "got desired_language={:016X}", language_code); - - *out_desired_language = language_code; - R_SUCCEED(); - } - - Result GetCurrentApplicationId(Out out_application_id) { - LOG_WARNING(Service_AM, "(STUBBED) called"); - - // TODO: this should be the main applet, not the caller applet - const auto main_applet = GetCallerIdentity(*m_applet); - *out_application_id = main_applet.application_id; - - R_SUCCEED(); - } - - Result GetMainAppletAvailableUsers( - Out out_can_select_any_user, Out out_users_count, - OutArray out_users) { - const Service::Account::ProfileManager manager{}; - - *out_can_select_any_user = false; - *out_users_count = -1; - - LOG_INFO(Service_AM, "called"); - - if (manager.GetUserCount() > 0) { - *out_can_select_any_user = true; - *out_users_count = static_cast(manager.GetUserCount()); - - const auto users = manager.GetAllUsers(); - for (size_t i = 0; i < users.size() && i < out_users.size(); i++) { - out_users[i] = users[i]; - } - } - - R_SUCCEED(); - } - - Result ShouldSetGpuTimeSliceManually( - Out out_should_set_gpu_time_slice_manually) { - LOG_INFO(Service_AM, "(STUBBED) called"); - *out_should_set_gpu_time_slice_manually = false; - R_SUCCEED(); - } - - Result GetLibraryAppletInfoEx( - Out out_library_applet_info) { - LOG_INFO(Service_AM, "called"); - *out_library_applet_info = { - .applet_id = m_applet->applet_id, - .library_applet_mode = m_applet->library_applet_mode, - }; - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ILibraryAppletSelfAccessor::PopInData>, "PopInData"}, - FunctionInfo{1, D<&ILibraryAppletSelfAccessor::PushOutData>, "PushOutData"}, - FunctionInfo{2, D<&ILibraryAppletSelfAccessor::PopInteractiveInData>, "PopInteractiveInData"}, - FunctionInfo{3, D<&ILibraryAppletSelfAccessor::PushInteractiveOutData>, "PushInteractiveOutData"}, - FunctionInfo{5, D<&ILibraryAppletSelfAccessor::GetPopInDataEvent>, "GetPopInDataEvent"}, - FunctionInfo{6, D<&ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent>, "GetPopInteractiveInDataEvent"}, - FunctionInfo{10, D<&ILibraryAppletSelfAccessor::ExitProcessAndReturn>, "ExitProcessAndReturn"}, - FunctionInfo{11, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"}, - FunctionInfo{12, D<&ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo>, "GetMainAppletIdentityInfo"}, - FunctionInfo{13, D<&ILibraryAppletSelfAccessor::CanUseApplicationCore>, "CanUseApplicationCore"}, - FunctionInfo{14, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo>, "GetCallerAppletIdentityInfo"}, - FunctionInfo{15, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty>, "GetMainAppletApplicationControlProperty"}, - FunctionInfo{16, D<&ILibraryAppletSelfAccessor::GetMainAppletStorageId>, "GetMainAppletStorageId"}, - FunctionInfo{17, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack>, "GetCallerAppletIdentityInfoStack"}, - FunctionInfo{18, nullptr, "GetNextReturnDestinationAppletIdentityInfo"}, - FunctionInfo{19, D<&ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout>, "GetDesirableKeyboardLayout"}, - FunctionInfo{20, nullptr, "PopExtraStorage"}, - FunctionInfo{25, nullptr, "GetPopExtraStorageEvent"}, - FunctionInfo{30, D<&ILibraryAppletSelfAccessor::UnpopInData>, "UnpopInData"}, - FunctionInfo{31, nullptr, "UnpopExtraStorage"}, - FunctionInfo{40, nullptr, "GetIndirectLayerProducerHandle"}, - FunctionInfo{50, D<&ILibraryAppletSelfAccessor::ReportVisibleError>, "ReportVisibleError"}, - FunctionInfo{51, D<&ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext>, "ReportVisibleErrorWithErrorContext"}, - FunctionInfo{60, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage>, "GetMainAppletApplicationDesiredLanguage"}, - FunctionInfo{70, D<&ILibraryAppletSelfAccessor::GetCurrentApplicationId>, "GetCurrentApplicationId"}, - FunctionInfo{80, nullptr, "RequestExitToSelf"}, - FunctionInfo{90, nullptr, "CreateApplicationAndPushAndRequestToLaunch"}, - FunctionInfo{100, nullptr, "CreateGameMovieTrimmer"}, - FunctionInfo{101, nullptr, "ReserveResourceForMovieOperation"}, - FunctionInfo{102, nullptr, "UnreserveResourceForMovieOperation"}, - FunctionInfo{110, D<&ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers>, "GetMainAppletAvailableUsers"}, - FunctionInfo{120, nullptr, "GetLaunchStorageInfoForDebug"}, - FunctionInfo{130, nullptr, "GetGpuErrorDetectedSystemEvent"}, - FunctionInfo{140, nullptr, "SetApplicationMemoryReservation"}, - FunctionInfo{150, D<&ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually>, "ShouldSetGpuTimeSliceManually"}, - FunctionInfo{160, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx>, "GetLibraryAppletInfoEx"} - ); - const std::shared_ptr m_applet; - const std::shared_ptr m_broker; -}; - -class ILibraryAppletProxy final : public ServiceFramework { -public: - explicit ILibraryAppletProxy(Core::System& system_, std::shared_ptr applet, - Kernel::KProcess* process, WindowSystem& window_system) - : ServiceFramework{system_, "ILibraryAppletProxy"}, - m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { - } - ~ILibraryAppletProxy() override = default; - - Result GetAudioController( - Out> out_audio_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_audio_controller = std::make_shared(system); - R_SUCCEED(); - } - - Result GetDisplayController( - Out> out_display_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_display_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetProcessWindingController( - Out> out_process_winding_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_process_winding_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetDebugFunctions( - Out> out_debug_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_debug_functions = std::make_shared(system); - R_SUCCEED(); - } - - Result GetWindowController( - Out> out_window_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_window_controller = std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result GetSelfController( - Out> out_self_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_self_controller = std::make_shared(system, m_applet, m_process); - R_SUCCEED(); - } - - Result GetCommonStateGetter( - Out> out_common_state_getter) { - LOG_DEBUG(Service_AM, "called"); - *out_common_state_getter = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetLibraryAppletCreator( - Out> out_library_applet_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_creator = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result OpenLibraryAppletSelfAccessor( - Out> out_library_applet_self_accessor) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_self_accessor = - std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetAppletCommonFunctions( - Out> out_applet_common_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_applet_common_functions = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetHomeMenuFunctions( - Out> out_home_menu_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_home_menu_functions = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result GetGlobalStateController( - Out> out_global_state_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_global_state_controller = std::make_shared(system); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ILibraryAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, - FunctionInfo{1, D<&ILibraryAppletProxy::GetSelfController>, "GetSelfController"}, - FunctionInfo{2, D<&ILibraryAppletProxy::GetWindowController>, "GetWindowController"}, - FunctionInfo{3, D<&ILibraryAppletProxy::GetAudioController>, "GetAudioController"}, - FunctionInfo{4, D<&ILibraryAppletProxy::GetDisplayController>, "GetDisplayController"}, - FunctionInfo{10, D<&ILibraryAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, - FunctionInfo{11, D<&ILibraryAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, - FunctionInfo{20, D<&ILibraryAppletProxy::OpenLibraryAppletSelfAccessor>, "OpenLibraryAppletSelfAccessor"}, - FunctionInfo{21, D<&ILibraryAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, - FunctionInfo{22, D<&ILibraryAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"}, - FunctionInfo{23, D<&ILibraryAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, - FunctionInfo{1000, D<&ILibraryAppletProxy::GetDebugFunctions>, "GetDebugFunctions"} - ); - WindowSystem& m_window_system; - Kernel::KProcess* const m_process; - const std::shared_ptr m_applet; -}; - -class IOverlayAppletProxy final : public ServiceFramework { -public: - explicit IOverlayAppletProxy(Core::System &system_, std::shared_ptr applet, - Kernel::KProcess *process, WindowSystem &window_system) - : ServiceFramework{system_, "IOverlayAppletProxy"}, - m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { - } - - ~IOverlayAppletProxy() override = default; - - Result GetCommonStateGetter( - Out > out_common_state_getter) { - LOG_DEBUG(Service_AM, "called"); - *out_common_state_getter = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetSelfController( - Out > out_self_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_self_controller = std::make_shared(system, m_applet, m_process); - R_SUCCEED(); - } - - Result GetWindowController( - Out > out_window_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_window_controller = std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result GetAudioController( - Out > out_audio_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_audio_controller = std::make_shared(system); - R_SUCCEED(); - } - - Result GetDisplayController( - Out > out_display_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_display_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetProcessWindingController( - Out > out_process_winding_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_process_winding_controller = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetLibraryAppletCreator( - Out > out_library_applet_creator) { - LOG_DEBUG(Service_AM, "called"); - *out_library_applet_creator = - std::make_shared(system, m_applet, m_window_system); - R_SUCCEED(); - } - - Result GetOverlayFunctions( - Out > out_overlay_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_overlay_functions = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetAppletCommonFunctions( - Out > out_applet_common_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_applet_common_functions = std::make_shared(system, m_applet); - R_SUCCEED(); - } - - Result GetGlobalStateController( - Out > out_global_state_controller) { - LOG_DEBUG(Service_AM, "called"); - *out_global_state_controller = std::make_shared(system); - R_SUCCEED(); - } - - Result GetDebugFunctions( - Out > out_debug_functions) { - LOG_DEBUG(Service_AM, "called"); - *out_debug_functions = std::make_shared(system); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IOverlayAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, - FunctionInfo{1, D<&IOverlayAppletProxy::GetSelfController>, "GetSelfController"}, - FunctionInfo{2, D<&IOverlayAppletProxy::GetWindowController>, "GetWindowController"}, - FunctionInfo{3, D<&IOverlayAppletProxy::GetAudioController>, "GetAudioController"}, - FunctionInfo{4, D<&IOverlayAppletProxy::GetDisplayController>, "GetDisplayController"}, - FunctionInfo{10, D<&IOverlayAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, - FunctionInfo{11, D<&IOverlayAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, - FunctionInfo{20, D<&IOverlayAppletProxy::GetOverlayFunctions>, "GetOverlayFunctions"}, - FunctionInfo{21, D<&IOverlayAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, - FunctionInfo{23, D<&IOverlayAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, - FunctionInfo{1000, D<&IOverlayAppletProxy::GetDebugFunctions>, "GetDebugFunctions"} - ); - WindowSystem& m_window_system; - Kernel::KProcess* const m_process; - const std::shared_ptr m_applet; -}; - -static bool ShouldCreateGuestApplet(AppletId applet_id) { -#define X(Name, name) \ - if (applet_id == AppletId::Name && \ - Settings::values.name##_applet_mode.GetValue() != Settings::AppletMode::LLE) { \ - return false; \ - } - - X(Cabinet, cabinet) - X(Controller, controller) - X(DataErase, data_erase) - X(Error, error) - X(NetConnect, net_connect) - X(ProfileSelect, player_select) - X(SoftwareKeyboard, swkbd) - X(MiiEdit, mii_edit) - X(Web, web) - X(Shop, shop) - X(PhotoViewer, photo_viewer) - X(OfflineWeb, offline_web) - X(LoginShare, login_share) - X(WebAuth, wifi_web_auth) - X(MyPage, my_page) - -#undef X - - return true; -} - -static AppletProgramId AppletIdToProgramId(AppletId applet_id) { - switch (applet_id) { - case AppletId::OverlayDisplay: - return AppletProgramId::OverlayDisplay; - case AppletId::QLaunch: - return AppletProgramId::QLaunch; - case AppletId::Starter: - return AppletProgramId::Starter; - case AppletId::Auth: - return AppletProgramId::Auth; - case AppletId::Cabinet: - return AppletProgramId::Cabinet; - case AppletId::Controller: - return AppletProgramId::Controller; - case AppletId::DataErase: - return AppletProgramId::DataErase; - case AppletId::Error: - return AppletProgramId::Error; - case AppletId::NetConnect: - return AppletProgramId::NetConnect; - case AppletId::ProfileSelect: - return AppletProgramId::ProfileSelect; - case AppletId::SoftwareKeyboard: - return AppletProgramId::SoftwareKeyboard; - case AppletId::MiiEdit: - return AppletProgramId::MiiEdit; - case AppletId::Web: - return AppletProgramId::Web; - case AppletId::Shop: - return AppletProgramId::Shop; - case AppletId::PhotoViewer: - return AppletProgramId::PhotoViewer; - case AppletId::Settings: - return AppletProgramId::Settings; - case AppletId::OfflineWeb: - return AppletProgramId::OfflineWeb; - case AppletId::LoginShare: - return AppletProgramId::LoginShare; - case AppletId::WebAuth: - return AppletProgramId::WebAuth; - case AppletId::MyPage: - return AppletProgramId::MyPage; - default: - return static_cast(0); - } -} - -static std::shared_ptr CreateGuestApplet(Core::System& system, - WindowSystem& window_system, - std::shared_ptr caller_applet, - AppletId applet_id, - LibraryAppletMode mode) { - const auto program_id = static_cast(AppletIdToProgramId(applet_id)); - if (program_id == 0) { - // Unknown applet - return {}; - } - - auto process = CreateProcess(system, program_id, 1, HLE::ApiVersion::HOS_VERSION_MAJOR); - if (process) { - const auto applet = std::make_shared(system, std::move(process), false); - applet->program_id = program_id; - applet->applet_id = applet_id; - applet->type = AppletType::LibraryApplet; - applet->library_applet_mode = mode; - applet->window_visible = mode != LibraryAppletMode::AllForegroundInitiallyHidden; - - auto broker = std::make_shared(system); - applet->caller_applet = caller_applet; - applet->caller_applet_broker = broker; - { - std::scoped_lock lk{caller_applet->lock}; - caller_applet->child_applets.push_back(applet); - } - window_system.TrackApplet(applet, false); - return std::make_shared(system, broker, applet); - } - // Couldn't initialize the guest process - return {}; -} - -static std::shared_ptr CreateFrontendApplet(Core::System& system, - WindowSystem& window_system, - std::shared_ptr caller_applet, - AppletId applet_id, - LibraryAppletMode mode) { - const auto program_id = static_cast(AppletIdToProgramId(applet_id)); - - auto process = std::make_unique(system); - auto applet = std::make_shared(system, std::move(process), false); - applet->program_id = program_id; - applet->applet_id = applet_id; - applet->type = AppletType::LibraryApplet; - applet->library_applet_mode = mode; - - auto storage = std::make_shared(system); - applet->caller_applet = caller_applet; - applet->caller_applet_broker = storage; - applet->frontend = system.GetFrontendAppletHolder().GetApplet(applet, applet_id, mode); - { - std::scoped_lock lk{caller_applet->lock}; - caller_applet->child_applets.push_back(applet); - } - return std::make_shared(system, storage, applet); -} - -class ILibraryAppletCreator final : public ServiceFramework { -public: - explicit ILibraryAppletCreator(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) - : ServiceFramework{system_, "ILibraryAppletCreator"} - , m_window_system{window_system}, m_applet{std::move(applet)} { - } - ~ILibraryAppletCreator() override = default; - - Result CreateLibraryApplet( - Out> out_library_applet_accessor, AppletId applet_id, - LibraryAppletMode library_applet_mode) { - LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={}", applet_id, - library_applet_mode); - - std::shared_ptr library_applet; - if (ShouldCreateGuestApplet(applet_id)) { - library_applet = - CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); - } - if (!library_applet) { - library_applet = - CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); - } - if (!library_applet) { - LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); - R_THROW(ResultUnknown); - } - - // Applet is created, can now be launched. - m_applet->library_applet_launchable_event.Signal(system.Kernel()); - *out_library_applet_accessor = library_applet; - R_SUCCEED(); - } - - Result CreateLibraryAppletEx( - Out> out_library_applet_accessor, AppletId applet_id, - LibraryAppletMode library_applet_mode, u64 thread_id) { - LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={} thread_id={}", applet_id, - library_applet_mode, thread_id); - - std::shared_ptr library_applet; - if (ShouldCreateGuestApplet(applet_id)) { - library_applet = - CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); - } - if (!library_applet) { - library_applet = - CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); - } - if (!library_applet) { - LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); - R_THROW(ResultUnknown); - } - - // Applet is created, can now be launched. - m_applet->library_applet_launchable_event.Signal(system.Kernel()); - *out_library_applet_accessor = library_applet; - R_SUCCEED(); - } - - Result CreateStorage(Out> out_storage, s64 size) { - LOG_DEBUG(Service_AM, "called, size={}", size); - - if (size <= 0) { - LOG_ERROR(Service_AM, "size is less than or equal to 0"); - R_THROW(ResultUnknown); - } - - *out_storage = std::make_shared(system, AM::CreateStorage(std::vector(size))); - R_SUCCEED(); - } - - Result CreateTransferMemoryStorage( - Out> out_storage, bool is_writable, s64 size, - InCopyHandle transfer_memory_handle) { - LOG_DEBUG(Service_AM, "called, is_writable={} size={}", is_writable, size); - - if (size <= 0) { - LOG_ERROR(Service_AM, "size is less than or equal to 0"); - R_THROW(ResultUnknown); - } - - if (!transfer_memory_handle) { - LOG_ERROR(Service_AM, "transfer_memory_handle is null"); - R_THROW(ResultUnknown); - } - - *out_storage = std::make_shared( - system, AM::CreateTransferMemoryStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(), - transfer_memory_handle.Get(), is_writable, size)); - R_SUCCEED(); - } - - Result CreateHandleStorage( - Out> out_storage, s64 size, - InCopyHandle transfer_memory_handle) { - LOG_DEBUG(Service_AM, "called, size={}", size); - - if (size <= 0) { - LOG_ERROR(Service_AM, "size is less than or equal to 0"); - R_THROW(ResultUnknown); - } - - if (!transfer_memory_handle) { - LOG_ERROR(Service_AM, "transfer_memory_handle is null"); - R_THROW(ResultUnknown); - } - - *out_storage = std::make_shared( - system, AM::CreateHandleStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(), - transfer_memory_handle.Get(), size)); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"}, - FunctionInfo{1, nullptr, "TerminateAllLibraryApplets"}, - FunctionInfo{2, nullptr, "AreAnyLibraryAppletsLeft"}, - FunctionInfo{3, D<&ILibraryAppletCreator::CreateLibraryAppletEx>, "CreateLibraryAppletEx"}, - FunctionInfo{10, D<&ILibraryAppletCreator::CreateStorage>, "CreateStorage"}, - FunctionInfo{11, D<&ILibraryAppletCreator::CreateTransferMemoryStorage>, "CreateTransferMemoryStorage"}, - FunctionInfo{12, D<&ILibraryAppletCreator::CreateHandleStorage>, "CreateHandleStorage"} - ); - WindowSystem& m_window_system; - const std::shared_ptr m_applet; -}; - -class IAllSystemAppletProxiesService final - : public ServiceFramework { -public: - explicit IAllSystemAppletProxiesService(Core::System& system_, WindowSystem& window_system) - : ServiceFramework{system_, "appletAE"}, m_window_system{window_system} { - } - - ~IAllSystemAppletProxiesService() override = default; - - Result OpenSystemAppletProxy( - Out> out_system_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_DEBUG(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid); applet) { - *out_system_applet_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } - } - - Result OpenLibraryAppletProxy( - Out> out_library_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle, - InLargeData attribute) { - LOG_DEBUG(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid); applet) { - *out_library_applet_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } - } - - Result OpenOverlayAppletProxy( - Out> out_overlay_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_WARNING(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid); applet) { - *out_overlay_applet_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } - } - - Result OpenSystemApplicationProxy( - Out> out_system_application_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_DEBUG(Service_AM, "called"); - - if (const auto applet = this->GetAppletFromProcessId(pid); applet) { - *out_system_application_proxy = std::make_shared( - system, applet, process_handle.Get(), m_window_system); - R_SUCCEED(); - } else { - UNIMPLEMENTED(); - R_THROW(ResultUnknown); - } - } - - Result OpenLibraryAppletProxyOld( - Out> out_library_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle) { - LOG_DEBUG(Service_AM, "called"); - - AppletAttribute attribute{}; - R_RETURN(this->OpenLibraryAppletProxy(out_library_applet_proxy, pid, process_handle, attribute)); - } - - Result GetSystemProcessCommonFunctions() { - LOG_DEBUG(Service_AM, "(STUBBED) called."); - // TODO (jarrodnorwell) - R_SUCCEED(); - } - - Result GetAppletAlternativeFunctions() { - LOG_DEBUG(Service_AM, "(STUBBED) called."); - // TODO (maufeat) - R_SUCCEED(); - } - - std::shared_ptr GetAppletFromProcessId(ProcessId process_id) { - return m_window_system.GetByAppletResourceUserId(process_id.pid); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{100, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxy"}, - FunctionInfo{110, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxyEx"}, - FunctionInfo{200, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld>, "OpenLibraryAppletProxyOld"}, - FunctionInfo{201, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxy>, "OpenLibraryAppletProxy"}, - FunctionInfo{300, D<&IAllSystemAppletProxiesService::OpenOverlayAppletProxy>, "OpenOverlayAppletProxy"}, - FunctionInfo{350, D<&IAllSystemAppletProxiesService::OpenSystemApplicationProxy>, "OpenSystemApplicationProxy"}, - FunctionInfo{400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"}, - FunctionInfo{410, nullptr, "GetSystemAppletControllerForDebug"}, - FunctionInfo{450, D<&IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions>, "GetSystemProcessCommonFunctions", MakeVersionGate({19,0,0})}, - FunctionInfo{460, D<&IAllSystemAppletProxiesService::GetAppletAlternativeFunctions>, "GetAppletAlternativeFunctions", MakeVersionGate({20,0,0})}, - FunctionInfo{1000, nullptr, "GetDebugFunctions"} - ); - WindowSystem& m_window_system; -}; - void LoopProcess(Core::System& system) { WindowSystem window_system(system); ButtonPoller button_poller(system, window_system); @@ -1345,8 +21,10 @@ void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); - server_manager->RegisterNamedService("appletAE", std::make_shared(system, window_system)); - server_manager->RegisterNamedService("appletOE", std::make_shared(system, window_system)); + server_manager->RegisterNamedService( + "appletAE", std::make_shared(system, window_system)); + server_manager->RegisterNamedService( + "appletOE", std::make_shared(system, window_system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 1afe253aed..0bf5880f30 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/applet_manager.h b/src/core/hle/service/am/applet_manager.h index 2b0714adf7..cd3035de31 100644 --- a/src/core/hle/service/am/applet_manager.h +++ b/src/core/hle/service/am/applet_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project diff --git a/src/core/hle/service/am/frontend/applet_cabinet.h b/src/core/hle/service/am/frontend/applet_cabinet.h index 3a211ed372..a74f233569 100644 --- a/src/core/hle/service/am/frontend/applet_cabinet.h +++ b/src/core/hle/service/am/frontend/applet_cabinet.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/frontend/applet_controller.h b/src/core/hle/service/am/frontend/applet_controller.h index 341ebed234..3877a7b02e 100644 --- a/src/core/hle/service/am/frontend/applet_controller.h +++ b/src/core/hle/service/am/frontend/applet_controller.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project diff --git a/src/core/hle/service/am/frontend/applet_error.h b/src/core/hle/service/am/frontend/applet_error.h index 678bf33fac..af3e2134a5 100644 --- a/src/core/hle/service/am/frontend/applet_error.h +++ b/src/core/hle/service/am/frontend/applet_error.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/frontend/applet_general.h b/src/core/hle/service/am/frontend/applet_general.h index eaa7ae25fe..ceb0537119 100644 --- a/src/core/hle/service/am/frontend/applet_general.h +++ b/src/core/hle/service/am/frontend/applet_general.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/frontend/applet_mii_edit.h b/src/core/hle/service/am/frontend/applet_mii_edit.h index 5db792f7d2..8654426431 100644 --- a/src/core/hle/service/am/frontend/applet_mii_edit.h +++ b/src/core/hle/service/am/frontend/applet_mii_edit.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/frontend/applet_mii_edit_types.h b/src/core/hle/service/am/frontend/applet_mii_edit_types.h index 23d9d7a69b..9c354bd947 100644 --- a/src/core/hle/service/am/frontend/applet_mii_edit_types.h +++ b/src/core/hle/service/am/frontend/applet_mii_edit_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/frontend/applet_net_connect.h b/src/core/hle/service/am/frontend/applet_net_connect.h index d5d503ed41..0986b63c60 100644 --- a/src/core/hle/service/am/frontend/applet_net_connect.h +++ b/src/core/hle/service/am/frontend/applet_net_connect.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later #pragma once diff --git a/src/core/hle/service/am/frontend/applet_profile_select.cpp b/src/core/hle/service/am/frontend/applet_profile_select.cpp index 89b5a1eabe..0f46ee6232 100644 --- a/src/core/hle/service/am/frontend/applet_profile_select.cpp +++ b/src/core/hle/service/am/frontend/applet_profile_select.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/frontend/applet_profile_select.h b/src/core/hle/service/am/frontend/applet_profile_select.h index 674e7afe17..4feba73a37 100644 --- a/src/core/hle/service/am/frontend/applet_profile_select.h +++ b/src/core/hle/service/am/frontend/applet_profile_select.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/frontend/applet_software_keyboard_types.h b/src/core/hle/service/am/frontend/applet_software_keyboard_types.h index a25ff2a6d2..6bb8f437d3 100644 --- a/src/core/hle/service/am/frontend/applet_software_keyboard_types.h +++ b/src/core/hle/service/am/frontend/applet_software_keyboard_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/frontend/applet_web_browser.h b/src/core/hle/service/am/frontend/applet_web_browser.h index ae62389f13..41461a93d0 100644 --- a/src/core/hle/service/am/frontend/applet_web_browser.h +++ b/src/core/hle/service/am/frontend/applet_web_browser.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project diff --git a/src/core/hle/service/am/frontend/applets.h b/src/core/hle/service/am/frontend/applets.h index 8eb08ea77b..6259a5668a 100644 --- a/src/core/hle/service/am/frontend/applets.h +++ b/src/core/hle/service/am/frontend/applets.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project diff --git a/src/core/hle/service/am/process_holder.cpp b/src/core/hle/service/am/process_holder.cpp index 21ef5bf838..8ad6599fd6 100644 --- a/src/core/hle/service/am/process_holder.cpp +++ b/src/core/hle/service/am/process_holder.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/process_holder.h b/src/core/hle/service/am/process_holder.h index 3a9b81dfb4..dbf04668dc 100644 --- a/src/core/hle/service/am/process_holder.h +++ b/src/core/hle/service/am/process_holder.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp b/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp new file mode 100644 index 0000000000..437032c2f4 --- /dev/null +++ b/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp @@ -0,0 +1,135 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/core.h" +#include "core/hle/service/am/applet_manager.h" +#include "core/hle/service/am/service/all_system_applet_proxies_service.h" +#include "core/hle/service/am/service/application_proxy.h" +#include "core/hle/service/am/service/library_applet_proxy.h" +#include "core/hle/service/am/service/system_applet_proxy.h" +#include "core/hle/service/am/service/overlay_applet_proxy.h" +#include "core/hle/service/am/window_system.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + +IAllSystemAppletProxiesService::IAllSystemAppletProxiesService(Core::System& system_, + WindowSystem& window_system) + : ServiceFramework{system_, "appletAE"}, m_window_system{window_system} { + // clang-format off + static const FunctionInfo functions[] = { + {100, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxy"}, + {110, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxyEx"}, + {200, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld>, "OpenLibraryAppletProxyOld"}, + {201, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxy>, "OpenLibraryAppletProxy"}, + {300, D<&IAllSystemAppletProxiesService::OpenOverlayAppletProxy>, "OpenOverlayAppletProxy"}, + {350, D<&IAllSystemAppletProxiesService::OpenSystemApplicationProxy>, "OpenSystemApplicationProxy"}, + {400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"}, + {410, nullptr, "GetSystemAppletControllerForDebug"}, + {450, D<&IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions>, "GetSystemProcessCommonFunctions"}, // 19.0.0+ + {460, D<&IAllSystemAppletProxiesService::GetAppletAlternativeFunctions>, "GetAppletAlternativeFunctions"}, // 20.0.0+ + {1000, nullptr, "GetDebugFunctions"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IAllSystemAppletProxiesService::~IAllSystemAppletProxiesService() = default; + +Result IAllSystemAppletProxiesService::OpenSystemAppletProxy( + Out> out_system_applet_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_DEBUG(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid); applet) { + *out_system_applet_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } +} + +Result IAllSystemAppletProxiesService::OpenLibraryAppletProxy( + Out> out_library_applet_proxy, ClientProcessId pid, + InCopyHandle process_handle, + InLargeData attribute) { + LOG_DEBUG(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid); applet) { + *out_library_applet_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } +} + +Result IAllSystemAppletProxiesService::OpenOverlayAppletProxy( + Out> out_overlay_applet_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_WARNING(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid); applet) { + *out_overlay_applet_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } +} + +Result IAllSystemAppletProxiesService::OpenSystemApplicationProxy( + Out> out_system_application_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_DEBUG(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid); applet) { + *out_system_application_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } +} + +Result IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld( + Out> out_library_applet_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_DEBUG(Service_AM, "called"); + + AppletAttribute attribute{}; + R_RETURN( + this->OpenLibraryAppletProxy(out_library_applet_proxy, pid, process_handle, attribute)); +} + +Result IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions() { + LOG_DEBUG(Service_AM, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + R_SUCCEED(); +} + +Result IAllSystemAppletProxiesService::GetAppletAlternativeFunctions() { + LOG_DEBUG(Service_AM, "(STUBBED) called."); + + // TODO (maufeat) + + R_SUCCEED(); +} + +std::shared_ptr IAllSystemAppletProxiesService::GetAppletFromProcessId( + ProcessId process_id) { + return m_window_system.GetByAppletResourceUserId(process_id.pid); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/all_system_applet_proxies_service.h b/src/core/hle/service/am/service/all_system_applet_proxies_service.h new file mode 100644 index 0000000000..73cb8a09ac --- /dev/null +++ b/src/core/hle/service/am/service/all_system_applet_proxies_service.h @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" +#include "core/hle/service/am/service/overlay_applet_proxy.h" + +namespace Service { + +namespace AM { + +struct Applet; +struct AppletAttribute; +class IApplicationProxy; +class ILibraryAppletProxy; +class ISystemAppletProxy; +class WindowSystem; + +class IAllSystemAppletProxiesService final + : public ServiceFramework { +public: + explicit IAllSystemAppletProxiesService(Core::System& system_, WindowSystem& window_system); + ~IAllSystemAppletProxiesService() override; + +private: + Result OpenSystemAppletProxy(Out> out_system_applet_proxy, + ClientProcessId pid, + InCopyHandle process_handle); + Result OpenLibraryAppletProxy(Out> out_library_applet_proxy, + ClientProcessId pid, + InCopyHandle process_handle, + InLargeData attribute); + Result OpenOverlayAppletProxy(Out> out_overlay_applet_proxy, + ClientProcessId pid, InCopyHandle process_handle); + Result OpenLibraryAppletProxyOld( + Out> out_library_applet_proxy, ClientProcessId pid, + InCopyHandle process_handle); + Result OpenSystemApplicationProxy( + Out> out_system_application_proxy, ClientProcessId pid, + InCopyHandle process_handle); + Result GetSystemProcessCommonFunctions(); + Result GetAppletAlternativeFunctions(); + +private: + std::shared_ptr GetAppletFromProcessId(ProcessId pid); + + WindowSystem& m_window_system; +}; + +} // namespace AM +} // namespace Service diff --git a/src/core/hle/service/am/service/applet_common_functions.cpp b/src/core/hle/service/am/service/applet_common_functions.cpp new file mode 100644 index 0000000000..5ffec23b3e --- /dev/null +++ b/src/core/hle/service/am/service/applet_common_functions.cpp @@ -0,0 +1,98 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/core.h" +#include "core/file_sys/common_funcs.h" +#include "core/hle/service/am/applet.h" +#include "core/hle/service/am/service/applet_common_functions.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + +IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_, + std::shared_ptr applet_) + : ServiceFramework{system_, "IAppletCommonFunctions"}, applet{std::move(applet_)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetTerminateResult"}, + {10, nullptr, "ReadThemeStorage"}, + {11, nullptr, "WriteThemeStorage"}, + {20, nullptr, "PushToAppletBoundChannel"}, + {21, nullptr, "TryPopFromAppletBoundChannel"}, + {40, nullptr, "GetDisplayLogicalResolution"}, + {42, D<&IAppletCommonFunctions::SetDisplayMagnification>, "SetDisplayMagnification"}, + {50, D<&IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled>, "SetHomeButtonDoubleClickEnabled"}, + {51, D<&IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled>, "GetHomeButtonDoubleClickEnabled"}, + {52, nullptr, "IsHomeButtonShortPressedBlocked"}, + {60, nullptr, "IsVrModeCurtainRequired"}, + {61, nullptr, "IsSleepRequiredByHighTemperature"}, + {62, nullptr, "IsSleepRequiredByLowBattery"}, + {70, D<&IAppletCommonFunctions::SetCpuBoostRequestPriority>, "SetCpuBoostRequestPriority"}, + {80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"}, + {81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"}, + {90, nullptr, "OpenNamedChannelAsParent"}, + {91, nullptr, "OpenNamedChannelAsChild"}, + {100, nullptr, "SetApplicationCoreUsageMode"}, + {300, D<&IAppletCommonFunctions::GetCurrentApplicationId>, "GetCurrentApplicationId"}, + {310, nullptr, "IsSystemAppletHomeMenu"}, //19.0.0+ + {320, D<&IAppletCommonFunctions::SetGpuTimeSliceBoost>, "SetGpuTimeSliceBoost"}, //19.0.0+ + {321, nullptr, "SetGpuTimeSliceBoostDueToApplication"}, //19.0.0+ + {350, D<&IAppletCommonFunctions::Unknown350>, "Unknown350"} //20.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); +} + +IAppletCommonFunctions::~IAppletCommonFunctions() = default; + +Result IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled( + bool home_button_double_click_enabled) { + LOG_WARNING(Service_AM, "(STUBBED) called, home_button_double_click_enabled={}", + home_button_double_click_enabled); + R_SUCCEED(); +} + +Result IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled( + Out out_home_button_double_click_enabled) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_home_button_double_click_enabled = false; + R_SUCCEED(); +} + +Result IAppletCommonFunctions::SetDisplayMagnification(f32 x, f32 y, f32 width, f32 height) { + LOG_DEBUG(Service_AM, "(STUBBED) called, x={}, y={}, width={}, height={}", x, y, width, + height); + std::scoped_lock lk{applet->lock}; + applet->display_magnification = Common::Rectangle{x, y, x + width, y + height}; + R_SUCCEED(); +} + +Result IAppletCommonFunctions::SetCpuBoostRequestPriority(s32 priority) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + std::scoped_lock lk{applet->lock}; + applet->cpu_boost_request_priority = priority; + R_SUCCEED(); +} + +Result IAppletCommonFunctions::GetCurrentApplicationId(Out out_application_id) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_application_id = FileSys::GetBaseTitleID(system.GetApplicationProcessProgramID()); + R_SUCCEED(); +} + +Result IAppletCommonFunctions::SetGpuTimeSliceBoost(s64 time_span) { + LOG_WARNING(Service_AM, "(STUBBED) called, time_span={}", time_span); + R_SUCCEED(); +} + +Result IAppletCommonFunctions::Unknown350(Out out_unknown) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_unknown = 0; + R_SUCCEED(); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/applet_common_functions.h b/src/core/hle/service/am/service/applet_common_functions.h new file mode 100644 index 0000000000..696fcd5bd1 --- /dev/null +++ b/src/core/hle/service/am/service/applet_common_functions.h @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::AM { + +struct Applet; + +class IAppletCommonFunctions final : public ServiceFramework { +public: + explicit IAppletCommonFunctions(Core::System& system_, std::shared_ptr applet_); + ~IAppletCommonFunctions() override; + +private: + Result SetHomeButtonDoubleClickEnabled(bool home_button_double_click_enabled); + Result GetHomeButtonDoubleClickEnabled(Out out_home_button_double_click_enabled); + Result SetDisplayMagnification(f32 x, f32 y, f32 width, f32 height); + Result SetCpuBoostRequestPriority(s32 priority); + Result GetCurrentApplicationId(Out out_application_id); + Result SetGpuTimeSliceBoost(s64 time_span); + Result Unknown350(Out out_unknown); + + const std::shared_ptr applet; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_accessor.cpp b/src/core/hle/service/am/service/application_accessor.cpp index d24c2616dc..f357871706 100644 --- a/src/core/hle/service/am/service/application_accessor.cpp +++ b/src/core/hle/service/am/service/application_accessor.cpp @@ -18,42 +18,42 @@ namespace Service::AM { -std::optional IApplicationAccessor::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IApplicationAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"}, - FunctionInfo{1, nullptr, "IsCompleted"}, - FunctionInfo{10, D<&IApplicationAccessor::Start>, "Start"}, - FunctionInfo{20, D<&IApplicationAccessor::RequestExit>, "RequestExit"}, - FunctionInfo{25, D<&IApplicationAccessor::Terminate>, "Terminate"}, - FunctionInfo{30, D<&IApplicationAccessor::GetResult>, "GetResult"}, - FunctionInfo{101, D<&IApplicationAccessor::RequestForApplicationToGetForeground>, "RequestForApplicationToGetForeground"}, - FunctionInfo{110, nullptr, "TerminateAllLibraryApplets"}, - FunctionInfo{111, nullptr, "AreAnyLibraryAppletsLeft"}, - FunctionInfo{112, D<&IApplicationAccessor::GetCurrentLibraryApplet>, "GetCurrentLibraryApplet"}, - FunctionInfo{120, nullptr, "GetApplicationId"}, - FunctionInfo{121, D<&IApplicationAccessor::PushLaunchParameter>, "PushLaunchParameter"}, - FunctionInfo{122, D<&IApplicationAccessor::GetApplicationControlProperty>, "GetApplicationControlProperty"}, - FunctionInfo{123, nullptr, "GetApplicationLaunchProperty"}, - FunctionInfo{124, nullptr, "GetApplicationLaunchRequestInfo"}, - FunctionInfo{130, D<&IApplicationAccessor::SetUsers>, "SetUsers"}, - FunctionInfo{131, D<&IApplicationAccessor::CheckRightsEnvironmentAvailable>, "CheckRightsEnvironmentAvailable"}, - FunctionInfo{132, D<&IApplicationAccessor::GetNsRightsEnvironmentHandle>, "GetNsRightsEnvironmentHandle"}, - FunctionInfo{140, nullptr, "GetDesirableUids"}, - FunctionInfo{150, D<&IApplicationAccessor::ReportApplicationExitTimeout>, "ReportApplicationExitTimeout"}, - FunctionInfo{160, nullptr, "SetApplicationAttribute"}, - FunctionInfo{170, nullptr, "HasSaveDataAccessPermission"}, - FunctionInfo{180, nullptr, "PushToFriendInvitationStorageChannel"}, - FunctionInfo{190, nullptr, "PushToNotificationStorageChannel"}, - FunctionInfo{200, nullptr, "RequestApplicationSoftReset"}, - FunctionInfo{201, nullptr, "RestartApplicationTimer"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IApplicationAccessor::IApplicationAccessor(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) : ServiceFramework{system_, "IApplicationAccessor"}, m_window_system(window_system), m_applet(std::move(applet)) { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IApplicationAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"}, + {1, nullptr, "IsCompleted"}, + {10, D<&IApplicationAccessor::Start>, "Start"}, + {20, D<&IApplicationAccessor::RequestExit>, "RequestExit"}, + {25, D<&IApplicationAccessor::Terminate>, "Terminate"}, + {30, D<&IApplicationAccessor::GetResult>, "GetResult"}, + {101, D<&IApplicationAccessor::RequestForApplicationToGetForeground>, "RequestForApplicationToGetForeground"}, + {110, nullptr, "TerminateAllLibraryApplets"}, + {111, nullptr, "AreAnyLibraryAppletsLeft"}, + {112, D<&IApplicationAccessor::GetCurrentLibraryApplet>, "GetCurrentLibraryApplet"}, + {120, nullptr, "GetApplicationId"}, + {121, D<&IApplicationAccessor::PushLaunchParameter>, "PushLaunchParameter"}, + {122, D<&IApplicationAccessor::GetApplicationControlProperty>, "GetApplicationControlProperty"}, + {123, nullptr, "GetApplicationLaunchProperty"}, + {124, nullptr, "GetApplicationLaunchRequestInfo"}, + {130, D<&IApplicationAccessor::SetUsers>, "SetUsers"}, + {131, D<&IApplicationAccessor::CheckRightsEnvironmentAvailable>, "CheckRightsEnvironmentAvailable"}, + {132, D<&IApplicationAccessor::GetNsRightsEnvironmentHandle>, "GetNsRightsEnvironmentHandle"}, + {140, nullptr, "GetDesirableUids"}, + {150, D<&IApplicationAccessor::ReportApplicationExitTimeout>, "ReportApplicationExitTimeout"}, + {160, nullptr, "SetApplicationAttribute"}, + {170, nullptr, "HasSaveDataAccessPermission"}, + {180, nullptr, "PushToFriendInvitationStorageChannel"}, + {190, nullptr, "PushToNotificationStorageChannel"}, + {200, nullptr, "RequestApplicationSoftReset"}, + {201, nullptr, "RestartApplicationTimer"}, + }; + // clang-format on + + RegisterHandlers(functions); } IApplicationAccessor::~IApplicationAccessor() = default; diff --git a/src/core/hle/service/am/service/application_accessor.h b/src/core/hle/service/am/service/application_accessor.h index 57b222fc19..7908099916 100644 --- a/src/core/hle/service/am/service/application_accessor.h +++ b/src/core/hle/service/am/service/application_accessor.h @@ -39,7 +39,6 @@ private: Result GetNsRightsEnvironmentHandle(Out out_handle); Result ReportApplicationExitTimeout(); - std::optional FindRequest(u32 key) override; WindowSystem& m_window_system; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/application_creator.cpp b/src/core/hle/service/am/service/application_creator.cpp index 8d57f917fb..4eb2f29e22 100644 --- a/src/core/hle/service/am/service/application_creator.cpp +++ b/src/core/hle/service/am/service/application_creator.cpp @@ -20,16 +20,6 @@ namespace Service::AM { -std::optional IApplicationCreator::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"}, - FunctionInfo{1, nullptr, "PopLaunchRequestedApplication"}, - FunctionInfo{10, D<&IApplicationCreator::CreateSystemApplication>, "CreateSystemApplication"}, - FunctionInfo{100, nullptr, "PopFloatingApplicationForDevelopment"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - namespace { Result CreateGuestApplication(SharedPointer* out_application_accessor, Core::System& system, WindowSystem& window_system, u64 program_id) { @@ -64,6 +54,16 @@ Result CreateGuestApplication(SharedPointer* out_applicati IApplicationCreator::IApplicationCreator(Core::System& system_, WindowSystem& window_system) : ServiceFramework{system_, "IApplicationCreator"}, m_window_system{window_system} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"}, + {1, nullptr, "PopLaunchRequestedApplication"}, + {10, D<&IApplicationCreator::CreateSystemApplication>, "CreateSystemApplication"}, + {100, nullptr, "PopFloatingApplicationForDevelopment"}, + }; + // clang-format on + + RegisterHandlers(functions); } IApplicationCreator::~IApplicationCreator() = default; diff --git a/src/core/hle/service/am/service/application_creator.h b/src/core/hle/service/am/service/application_creator.h index 64434af542..59ae924131 100644 --- a/src/core/hle/service/am/service/application_creator.h +++ b/src/core/hle/service/am/service/application_creator.h @@ -24,7 +24,6 @@ private: Result CreateApplication(Out>, u64 application_id); Result CreateSystemApplication(Out>, u64 application_id); - std::optional FindRequest(u32 key) override; WindowSystem& m_window_system; }; diff --git a/src/core/hle/service/am/service/application_functions.cpp b/src/core/hle/service/am/service/application_functions.cpp index 4fda5eedd6..90d292c4a2 100644 --- a/src/core/hle/service/am/service/application_functions.cpp +++ b/src/core/hle/service/am/service/application_functions.cpp @@ -51,84 +51,83 @@ FileSys::PatchManager::Metadata GetApplicationMetadata(Core::System& system, u64 } // Anonymous namespace -std::optional IApplicationFunctions::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, D<&IApplicationFunctions::PopLaunchParameter>, "PopLaunchParameter"}, - FunctionInfo{10, nullptr, "CreateApplicationAndPushAndRequestToStart"}, - FunctionInfo{11, nullptr, "CreateApplicationAndPushAndRequestToStartForQuest"}, - FunctionInfo{12, D<&IApplicationFunctions::CreateApplicationAndRequestToStart>, "CreateApplicationAndRequestToStart"}, - FunctionInfo{13, nullptr, "CreateApplicationAndRequestToStartForQuest"}, - FunctionInfo{14, nullptr, "CreateApplicationWithAttributeAndPushAndRequestToStartForQuest"}, - FunctionInfo{15, nullptr, "CreateApplicationWithAttributeAndRequestToStartForQuest"}, - FunctionInfo{20, D<&IApplicationFunctions::EnsureSaveData>, "EnsureSaveData"}, - FunctionInfo{21, D<&IApplicationFunctions::GetDesiredLanguage>, "GetDesiredLanguage"}, - FunctionInfo{22, D<&IApplicationFunctions::SetTerminateResult>, "SetTerminateResult"}, - FunctionInfo{23, D<&IApplicationFunctions::GetDisplayVersion>, "GetDisplayVersion"}, - FunctionInfo{24, nullptr, "GetLaunchStorageInfoForDebug"}, - FunctionInfo{25, D<&IApplicationFunctions::ExtendSaveData>, "ExtendSaveData"}, - FunctionInfo{26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"}, - FunctionInfo{27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"}, - FunctionInfo{28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"}, - FunctionInfo{29, D<&IApplicationFunctions::GetCacheStorageMax>, "GetCacheStorageMax"}, - FunctionInfo{30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"}, - FunctionInfo{31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"}, - FunctionInfo{32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"}, - FunctionInfo{33, D<&IApplicationFunctions::EndBlockingHomeButton>, "EndBlockingHomeButton"}, - FunctionInfo{34, nullptr, "SelectApplicationLicense"}, - FunctionInfo{35, nullptr, "GetDeviceSaveDataSizeMax"}, - FunctionInfo{36, nullptr, "GetLimitedApplicationLicense"}, - FunctionInfo{37, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, - FunctionInfo{40, D<&IApplicationFunctions::NotifyRunning>, "NotifyRunning"}, - FunctionInfo{50, D<&IApplicationFunctions::GetPseudoDeviceId>, "GetPseudoDeviceId"}, - FunctionInfo{60, D<&IApplicationFunctions::SetMediaPlaybackStateForApplication>, "SetMediaPlaybackStateForApplication"}, - FunctionInfo{65, D<&IApplicationFunctions::IsGamePlayRecordingSupported>, "IsGamePlayRecordingSupported"}, - FunctionInfo{66, D<&IApplicationFunctions::InitializeGamePlayRecording>, "InitializeGamePlayRecording"}, - FunctionInfo{67, D<&IApplicationFunctions::SetGamePlayRecordingState>, "SetGamePlayRecordingState"}, - FunctionInfo{68, nullptr, "RequestFlushGamePlayingMovieForDebug"}, - FunctionInfo{70, nullptr, "RequestToShutdown"}, - FunctionInfo{71, nullptr, "RequestToReboot"}, - FunctionInfo{72, nullptr, "RequestToSleep"}, - FunctionInfo{80, nullptr, "ExitAndRequestToShowThanksMessage"}, - FunctionInfo{90, D<&IApplicationFunctions::EnableApplicationCrashReport>, "EnableApplicationCrashReport"}, - FunctionInfo{100, D<&IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer>, "InitializeApplicationCopyrightFrameBuffer"}, - FunctionInfo{101, D<&IApplicationFunctions::SetApplicationCopyrightImage>, "SetApplicationCopyrightImage"}, - FunctionInfo{102, D<&IApplicationFunctions::SetApplicationCopyrightVisibility>, "SetApplicationCopyrightVisibility"}, - FunctionInfo{110, D<&IApplicationFunctions::QueryApplicationPlayStatistics>, "QueryApplicationPlayStatistics"}, - FunctionInfo{111, D<&IApplicationFunctions::QueryApplicationPlayStatisticsByUid>, "QueryApplicationPlayStatisticsByUid"}, - FunctionInfo{120, D<&IApplicationFunctions::ExecuteProgram>, "ExecuteProgram"}, - FunctionInfo{121, D<&IApplicationFunctions::ClearUserChannel>, "ClearUserChannel"}, - FunctionInfo{122, D<&IApplicationFunctions::UnpopToUserChannel>, "UnpopToUserChannel"}, - FunctionInfo{123, D<&IApplicationFunctions::GetPreviousProgramIndex>, "GetPreviousProgramIndex"}, - FunctionInfo{124, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, - FunctionInfo{130, D<&IApplicationFunctions::GetGpuErrorDetectedSystemEvent>, "GetGpuErrorDetectedSystemEvent"}, - FunctionInfo{131, nullptr, "SetDelayTimeToAbortOnGpuError"}, - FunctionInfo{140, D<&IApplicationFunctions::GetFriendInvitationStorageChannelEvent>, "GetFriendInvitationStorageChannelEvent"}, - FunctionInfo{141, D<&IApplicationFunctions::TryPopFromFriendInvitationStorageChannel>, "TryPopFromFriendInvitationStorageChannel"}, - FunctionInfo{150, D<&IApplicationFunctions::GetNotificationStorageChannelEvent>, "GetNotificationStorageChannelEvent"}, - FunctionInfo{151, nullptr, "TryPopFromNotificationStorageChannel"}, - FunctionInfo{160, D<&IApplicationFunctions::GetHealthWarningDisappearedSystemEvent>, "GetHealthWarningDisappearedSystemEvent"}, - FunctionInfo{170, nullptr, "SetHdcpAuthenticationActivated"}, - FunctionInfo{180, nullptr, "GetLaunchRequiredVersion"}, - FunctionInfo{181, nullptr, "UpgradeLaunchRequiredVersion"}, - FunctionInfo{190, nullptr, "SendServerMaintenanceOverlayNotification"}, - FunctionInfo{200, nullptr, "GetLastApplicationExitReason"}, - FunctionInfo{210, D<&IApplicationFunctions::GetUnknownEvent210>, "Unknown210"}, - FunctionInfo{220, nullptr, "Unknown220"}, // [20.0.0+] - FunctionInfo{300, nullptr, "CreateMovieWriter"}, // [19.0.0+] - FunctionInfo{310, nullptr, "Unknown310"}, // [20.0.0+] - FunctionInfo{320, nullptr, "Unknown320"}, // [20.0.0+] - FunctionInfo{330, D<&IApplicationFunctions::Unknown330>, "Unknown330"}, // [20.0.0+] - FunctionInfo{500, nullptr, "StartContinuousRecordingFlushForDebug"}, - FunctionInfo{1000, nullptr, "CreateMovieMaker"}, - FunctionInfo{1001, D<&IApplicationFunctions::PrepareForJit>, "PrepareForJit"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_ptr applet) - : ServiceFramework{system_, "IApplicationFunctions"} - , m_applet{std::move(applet)} -{} + : ServiceFramework{system_, "IApplicationFunctions"}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {1, D<&IApplicationFunctions::PopLaunchParameter>, "PopLaunchParameter"}, + {10, nullptr, "CreateApplicationAndPushAndRequestToStart"}, + {11, nullptr, "CreateApplicationAndPushAndRequestToStartForQuest"}, + {12, D<&IApplicationFunctions::CreateApplicationAndRequestToStart>, "CreateApplicationAndRequestToStart"}, + {13, nullptr, "CreateApplicationAndRequestToStartForQuest"}, + {14, nullptr, "CreateApplicationWithAttributeAndPushAndRequestToStartForQuest"}, + {15, nullptr, "CreateApplicationWithAttributeAndRequestToStartForQuest"}, + {20, D<&IApplicationFunctions::EnsureSaveData>, "EnsureSaveData"}, + {21, D<&IApplicationFunctions::GetDesiredLanguage>, "GetDesiredLanguage"}, + {22, D<&IApplicationFunctions::SetTerminateResult>, "SetTerminateResult"}, + {23, D<&IApplicationFunctions::GetDisplayVersion>, "GetDisplayVersion"}, + {24, nullptr, "GetLaunchStorageInfoForDebug"}, + {25, D<&IApplicationFunctions::ExtendSaveData>, "ExtendSaveData"}, + {26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"}, + {27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"}, + {28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"}, + {29, D<&IApplicationFunctions::GetCacheStorageMax>, "GetCacheStorageMax"}, + {30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"}, + {31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"}, + {32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"}, + {33, D<&IApplicationFunctions::EndBlockingHomeButton>, "EndBlockingHomeButton"}, + {34, nullptr, "SelectApplicationLicense"}, + {35, nullptr, "GetDeviceSaveDataSizeMax"}, + {36, nullptr, "GetLimitedApplicationLicense"}, + {37, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, + {40, D<&IApplicationFunctions::NotifyRunning>, "NotifyRunning"}, + {50, D<&IApplicationFunctions::GetPseudoDeviceId>, "GetPseudoDeviceId"}, + {60, D<&IApplicationFunctions::SetMediaPlaybackStateForApplication>, "SetMediaPlaybackStateForApplication"}, + {65, D<&IApplicationFunctions::IsGamePlayRecordingSupported>, "IsGamePlayRecordingSupported"}, + {66, D<&IApplicationFunctions::InitializeGamePlayRecording>, "InitializeGamePlayRecording"}, + {67, D<&IApplicationFunctions::SetGamePlayRecordingState>, "SetGamePlayRecordingState"}, + {68, nullptr, "RequestFlushGamePlayingMovieForDebug"}, + {70, nullptr, "RequestToShutdown"}, + {71, nullptr, "RequestToReboot"}, + {72, nullptr, "RequestToSleep"}, + {80, nullptr, "ExitAndRequestToShowThanksMessage"}, + {90, D<&IApplicationFunctions::EnableApplicationCrashReport>, "EnableApplicationCrashReport"}, + {100, D<&IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer>, "InitializeApplicationCopyrightFrameBuffer"}, + {101, D<&IApplicationFunctions::SetApplicationCopyrightImage>, "SetApplicationCopyrightImage"}, + {102, D<&IApplicationFunctions::SetApplicationCopyrightVisibility>, "SetApplicationCopyrightVisibility"}, + {110, D<&IApplicationFunctions::QueryApplicationPlayStatistics>, "QueryApplicationPlayStatistics"}, + {111, D<&IApplicationFunctions::QueryApplicationPlayStatisticsByUid>, "QueryApplicationPlayStatisticsByUid"}, + {120, D<&IApplicationFunctions::ExecuteProgram>, "ExecuteProgram"}, + {121, D<&IApplicationFunctions::ClearUserChannel>, "ClearUserChannel"}, + {122, D<&IApplicationFunctions::UnpopToUserChannel>, "UnpopToUserChannel"}, + {123, D<&IApplicationFunctions::GetPreviousProgramIndex>, "GetPreviousProgramIndex"}, + {124, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, + {130, D<&IApplicationFunctions::GetGpuErrorDetectedSystemEvent>, "GetGpuErrorDetectedSystemEvent"}, + {131, nullptr, "SetDelayTimeToAbortOnGpuError"}, + {140, D<&IApplicationFunctions::GetFriendInvitationStorageChannelEvent>, "GetFriendInvitationStorageChannelEvent"}, + {141, D<&IApplicationFunctions::TryPopFromFriendInvitationStorageChannel>, "TryPopFromFriendInvitationStorageChannel"}, + {150, D<&IApplicationFunctions::GetNotificationStorageChannelEvent>, "GetNotificationStorageChannelEvent"}, + {151, nullptr, "TryPopFromNotificationStorageChannel"}, + {160, D<&IApplicationFunctions::GetHealthWarningDisappearedSystemEvent>, "GetHealthWarningDisappearedSystemEvent"}, + {170, nullptr, "SetHdcpAuthenticationActivated"}, + {180, nullptr, "GetLaunchRequiredVersion"}, + {181, nullptr, "UpgradeLaunchRequiredVersion"}, + {190, nullptr, "SendServerMaintenanceOverlayNotification"}, + {200, nullptr, "GetLastApplicationExitReason"}, + {210, D<&IApplicationFunctions::GetUnknownEvent210>, "Unknown210"}, + {220, nullptr, "Unknown220"}, // [20.0.0+] + {300, nullptr, "CreateMovieWriter"}, // [19.0.0+] + {310, nullptr, "Unknown310"}, // [20.0.0+] + {320, nullptr, "Unknown320"}, // [20.0.0+] + {330, D<&IApplicationFunctions::Unknown330>, "Unknown330"}, // [20.0.0+] + {500, nullptr, "StartContinuousRecordingFlushForDebug"}, + {1000, nullptr, "CreateMovieMaker"}, + {1001, D<&IApplicationFunctions::PrepareForJit>, "PrepareForJit"}, + }; + // clang-format on + + RegisterHandlers(functions); +} IApplicationFunctions::~IApplicationFunctions() = default; diff --git a/src/core/hle/service/am/service/application_functions.h b/src/core/hle/service/am/service/application_functions.h index 7093d13f82..b97ed7e25e 100644 --- a/src/core/hle/service/am/service/application_functions.h +++ b/src/core/hle/service/am/service/application_functions.h @@ -84,7 +84,6 @@ private: Result GetUnknownEvent210(OutCopyHandle out_event); Result Unknown330(Out out); Result PrepareForJit(); - std::optional FindRequest(u32 key) override; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/application_proxy.cpp b/src/core/hle/service/am/service/application_proxy.cpp new file mode 100644 index 0000000000..df438e1e17 --- /dev/null +++ b/src/core/hle/service/am/service/application_proxy.cpp @@ -0,0 +1,109 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/am/service/applet_common_functions.h" +#include "core/hle/service/am/service/application_functions.h" +#include "core/hle/service/am/service/application_proxy.h" +#include "core/hle/service/am/service/audio_controller.h" +#include "core/hle/service/am/service/common_state_getter.h" +#include "core/hle/service/am/service/debug_functions.h" +#include "core/hle/service/am/service/display_controller.h" +#include "core/hle/service/am/service/library_applet_creator.h" +#include "core/hle/service/am/service/process_winding_controller.h" +#include "core/hle/service/am/service/self_controller.h" +#include "core/hle/service/am/service/window_controller.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + +IApplicationProxy::IApplicationProxy(Core::System& system_, std::shared_ptr applet, + Kernel::KProcess* process, WindowSystem& window_system) + : ServiceFramework{system_, "IApplicationProxy"}, + m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IApplicationProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, + {1, D<&IApplicationProxy::GetSelfController>, "GetSelfController"}, + {2, D<&IApplicationProxy::GetWindowController>, "GetWindowController"}, + {3, D<&IApplicationProxy::GetAudioController>, "GetAudioController"}, + {4, D<&IApplicationProxy::GetDisplayController>, "GetDisplayController"}, + {10, D<&IApplicationProxy::GetProcessWindingController>, "GetProcessWindingController"}, + {11, D<&IApplicationProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, + {20, D<&IApplicationProxy::GetApplicationFunctions>, "GetApplicationFunctions"}, + {1000, D<&IApplicationProxy::GetDebugFunctions>, "GetDebugFunctions"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IApplicationProxy::~IApplicationProxy() = default; + +Result IApplicationProxy::GetAudioController( + Out> out_audio_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_audio_controller = std::make_shared(system); + R_SUCCEED(); +} + +Result IApplicationProxy::GetDisplayController( + Out> out_display_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_display_controller = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result IApplicationProxy::GetProcessWindingController( + Out> out_process_winding_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_process_winding_controller = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result IApplicationProxy::GetDebugFunctions( + Out> out_debug_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_debug_functions = std::make_shared(system); + R_SUCCEED(); +} + +Result IApplicationProxy::GetWindowController( + Out> out_window_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_window_controller = std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); +} + +Result IApplicationProxy::GetSelfController( + Out> out_self_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_self_controller = std::make_shared(system, m_applet, m_process); + R_SUCCEED(); +} + +Result IApplicationProxy::GetCommonStateGetter( + Out> out_common_state_getter) { + LOG_DEBUG(Service_AM, "called"); + *out_common_state_getter = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result IApplicationProxy::GetLibraryAppletCreator( + Out> out_library_applet_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_creator = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); +} + +Result IApplicationProxy::GetApplicationFunctions( + Out> out_application_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_application_functions = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_proxy.h b/src/core/hle/service/am/service/application_proxy.h new file mode 100644 index 0000000000..b56f597605 --- /dev/null +++ b/src/core/hle/service/am/service/application_proxy.h @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::AM { + +struct Applet; +class IAudioController; +class IApplicationFunctions; +class ICommonStateGetter; +class IDebugFunctions; +class IDisplayController; +class ILibraryAppletCreator; +class IProcessWindingController; +class ISelfController; +class IWindowController; +class WindowSystem; + +class IApplicationProxy final : public ServiceFramework { +public: + explicit IApplicationProxy(Core::System& system_, std::shared_ptr applet, + Kernel::KProcess* process, WindowSystem& window_system); + ~IApplicationProxy(); + +private: + Result GetAudioController(Out> out_audio_controller); + Result GetDisplayController(Out> out_display_controller); + Result GetProcessWindingController( + Out> out_process_winding_controller); + Result GetDebugFunctions(Out> out_debug_functions); + Result GetWindowController(Out> out_window_controller); + Result GetSelfController(Out> out_self_controller); + Result GetCommonStateGetter(Out> out_common_state_getter); + Result GetLibraryAppletCreator( + Out> out_library_applet_creator); + Result GetApplicationFunctions( + Out> out_application_functions); + +private: + WindowSystem& m_window_system; + Kernel::KProcess* const m_process; + const std::shared_ptr m_applet; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_proxy_service.cpp b/src/core/hle/service/am/service/application_proxy_service.cpp new file mode 100644 index 0000000000..7727951d8c --- /dev/null +++ b/src/core/hle/service/am/service/application_proxy_service.cpp @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/core.h" +#include "core/hle/service/am/am.h" +#include "core/hle/service/am/applet_manager.h" +#include "core/hle/service/am/service/application_proxy.h" +#include "core/hle/service/am/service/application_proxy_service.h" +#include "core/hle/service/am/window_system.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + +IApplicationProxyService::IApplicationProxyService(Core::System& system_, + WindowSystem& window_system) + : ServiceFramework{system_, "appletOE"}, m_window_system{window_system} { + static const FunctionInfo functions[] = { + {0, D<&IApplicationProxyService::OpenApplicationProxy>, "OpenApplicationProxy"}, + }; + RegisterHandlers(functions); +} + +IApplicationProxyService::~IApplicationProxyService() = default; + +Result IApplicationProxyService::OpenApplicationProxy( + Out> out_application_proxy, ClientProcessId pid, + InCopyHandle process_handle) { + LOG_DEBUG(Service_AM, "called"); + + if (const auto applet = this->GetAppletFromProcessId(pid)) { + *out_application_proxy = std::make_shared( + system, applet, process_handle.Get(), m_window_system); + R_SUCCEED(); + } else { + UNIMPLEMENTED(); + R_THROW(ResultUnknown); + } +} + +std::shared_ptr IApplicationProxyService::GetAppletFromProcessId(ProcessId process_id) { + return m_window_system.GetByAppletResourceUserId(process_id.pid); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_proxy_service.h b/src/core/hle/service/am/service/application_proxy_service.h new file mode 100644 index 0000000000..fce860a7c1 --- /dev/null +++ b/src/core/hle/service/am/service/application_proxy_service.h @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service { + +namespace AM { + +struct Applet; +class IApplicationProxy; +class WindowSystem; + +class IApplicationProxyService final : public ServiceFramework { +public: + explicit IApplicationProxyService(Core::System& system_, WindowSystem& window_system); + ~IApplicationProxyService() override; + +private: + Result OpenApplicationProxy(Out> out_application_proxy, + ClientProcessId pid, InCopyHandle process_handle); + +private: + std::shared_ptr GetAppletFromProcessId(ProcessId pid); + + WindowSystem& m_window_system; +}; + +} // namespace AM +} // namespace Service diff --git a/src/core/hle/service/am/service/audio_controller.cpp b/src/core/hle/service/am/service/audio_controller.cpp index 2c8494e056..4e9af756f2 100644 --- a/src/core/hle/service/am/service/audio_controller.cpp +++ b/src/core/hle/service/am/service/audio_controller.cpp @@ -9,20 +9,20 @@ namespace Service::AM { -std::optional IAudioController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAudioController::SetExpectedMasterVolume>, "SetExpectedMasterVolume"}, - FunctionInfo{1, D<&IAudioController::GetMainAppletExpectedMasterVolume>, "GetMainAppletExpectedMasterVolume"}, - FunctionInfo{2, D<&IAudioController::GetLibraryAppletExpectedMasterVolume>, "GetLibraryAppletExpectedMasterVolume"}, - FunctionInfo{3, D<&IAudioController::ChangeMainAppletMasterVolume>, "ChangeMainAppletMasterVolume"}, - FunctionInfo{4, D<&IAudioController::SetTransparentVolumeRate>, "SetTransparentVolumeRate"}, - FunctionInfo{5, nullptr, "Unknown5", MakeVersionGate({20,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAudioController::IAudioController(Core::System& system_) : ServiceFramework{system_, "IAudioController"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IAudioController::SetExpectedMasterVolume>, "SetExpectedMasterVolume"}, + {1, D<&IAudioController::GetMainAppletExpectedMasterVolume>, "GetMainAppletExpectedMasterVolume"}, + {2, D<&IAudioController::GetLibraryAppletExpectedMasterVolume>, "GetLibraryAppletExpectedMasterVolume"}, + {3, D<&IAudioController::ChangeMainAppletMasterVolume>, "ChangeMainAppletMasterVolume"}, + {4, D<&IAudioController::SetTransparentVolumeRate>, "SetTransparentVolumeRate"}, + {5, nullptr, "Unknown5"}, //20.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } IAudioController::~IAudioController() = default; diff --git a/src/core/hle/service/am/service/audio_controller.h b/src/core/hle/service/am/service/audio_controller.h index 9cdb33820d..a13f3b199b 100644 --- a/src/core/hle/service/am/service/audio_controller.h +++ b/src/core/hle/service/am/service/audio_controller.h @@ -23,7 +23,6 @@ private: Result ChangeMainAppletMasterVolume(f32 volume, s64 fade_time_ns); Result SetTransparentVolumeRate(f32 transparent_volume_rate); - std::optional FindRequest(u32 key) override; static constexpr float MinAllowedVolume = 0.0f; static constexpr float MaxAllowedVolume = 1.0f; diff --git a/src/core/hle/service/am/service/common_state_getter.cpp b/src/core/hle/service/am/service/common_state_getter.cpp index 6a6a51f42e..044929e434 100644 --- a/src/core/hle/service/am/service/common_state_getter.cpp +++ b/src/core/hle/service/am/service/common_state_getter.cpp @@ -8,6 +8,7 @@ #include "core/hle/service/am/am_results.h" #include "core/hle/service/am/applet.h" #include "core/hle/service/am/service/common_state_getter.h" +#include "core/hle/service/am/service/lock_accessor.h" #include "core/hle/service/am/service/storage.h" #include "core/hle/service/apm/apm_interface.h" #include "core/hle/service/cmif_serialization.h" @@ -17,147 +18,77 @@ namespace Service::AM { -std::optional ICommonStateGetter::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ICommonStateGetter::GetEventHandle>, "GetEventHandle"}, - FunctionInfo{1, D<&ICommonStateGetter::ReceiveMessage>, "ReceiveMessage"}, - FunctionInfo{2, nullptr, "GetThisAppletKind"}, - FunctionInfo{3, nullptr, "AllowToEnterSleep"}, - FunctionInfo{4, nullptr, "DisallowToEnterSleep"}, - FunctionInfo{5, D<&ICommonStateGetter::GetOperationMode>, "GetOperationMode"}, - FunctionInfo{6, D<&ICommonStateGetter::GetPerformanceMode>, "GetPerformanceMode"}, - FunctionInfo{7, nullptr, "GetCradleStatus"}, - FunctionInfo{8, D<&ICommonStateGetter::GetBootMode>, "GetBootMode"}, - FunctionInfo{9, D<&ICommonStateGetter::GetCurrentFocusState>, "GetCurrentFocusState"}, - FunctionInfo{10, D<&ICommonStateGetter::RequestToAcquireSleepLock>, "RequestToAcquireSleepLock"}, - FunctionInfo{11, D<&ICommonStateGetter::ReleaseSleepLock>, "ReleaseSleepLock"}, - FunctionInfo{12, D<&ICommonStateGetter::ReleaseSleepLockTransiently>, "ReleaseSleepLockTransiently"}, - FunctionInfo{13, D<&ICommonStateGetter::GetAcquiredSleepLockEvent>, "GetAcquiredSleepLockEvent"}, - FunctionInfo{14, nullptr, "GetWakeupCount", MakeVersionGate({11,0,0})}, - FunctionInfo{15, nullptr, "Unknown15", MakeVersionGate({19,0,0})}, - FunctionInfo{20, D<&ICommonStateGetter::PushToGeneralChannel>, "PushToGeneralChannel"}, - FunctionInfo{30, D<&ICommonStateGetter::GetHomeButtonReaderLockAccessor>, "GetHomeButtonReaderLockAccessor"}, - FunctionInfo{31, D<&ICommonStateGetter::GetReaderLockAccessorEx>, "GetReaderLockAccessorEx", MakeVersionGate({2,0,0})}, - FunctionInfo{32, D<&ICommonStateGetter::GetWriterLockAccessorEx>, "GetWriterLockAccessorEx", MakeVersionGate({7,0,0})}, - FunctionInfo{40, nullptr, "GetCradleFwVersion", MakeVersionGate({2,0,0})}, - FunctionInfo{50, D<&ICommonStateGetter::IsVrModeEnabled>, "IsVrModeEnabled", MakeVersionGate({3,0,0})}, - FunctionInfo{51, D<&ICommonStateGetter::SetVrModeEnabled>, "SetVrModeEnabled", MakeVersionGate({3,0,0})}, - FunctionInfo{52, D<&ICommonStateGetter::SetLcdBacklighOffEnabled>, "SetLcdBacklighOffEnabled", MakeVersionGate({4,0,0})}, - FunctionInfo{53, D<&ICommonStateGetter::BeginVrModeEx>, "BeginVrModeEx", MakeVersionGate({7,0,0})}, - FunctionInfo{54, D<&ICommonStateGetter::EndVrModeEx>, "EndVrModeEx", MakeVersionGate({7,0,0})}, - FunctionInfo{55, D<&ICommonStateGetter::IsInControllerFirmwareUpdateSection>, "IsInControllerFirmwareUpdateSection", MakeVersionGate({3,0,0})}, - FunctionInfo{59, nullptr, "SetVrPositionForDebug", MakeVersionGate({1,0,0})}, - FunctionInfo{60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"}, - FunctionInfo{61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"}, - FunctionInfo{62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"}, - FunctionInfo{63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"}, - FunctionInfo{64, nullptr, "SetTvPowerStateMatchingMode"}, - FunctionInfo{65, nullptr, "GetApplicationIdByContentActionName"}, - FunctionInfo{66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"}, - FunctionInfo{67, nullptr, "CancelCpuBoostMode"}, - FunctionInfo{68, D<&ICommonStateGetter::GetBuiltInDisplayType>, "GetBuiltInDisplayType"}, - FunctionInfo{80, D<&ICommonStateGetter::PerformSystemButtonPressingIfInFocus>, "PerformSystemButtonPressingIfInFocus"}, - FunctionInfo{90, nullptr, "SetPerformanceConfigurationChangedNotification"}, - FunctionInfo{91, nullptr, "GetCurrentPerformanceConfiguration"}, - FunctionInfo{100, D<&ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"}, - FunctionInfo{110, nullptr, "OpenMyGpuErrorHandler"}, - FunctionInfo{120, D<&ICommonStateGetter::GetAppletLaunchedHistory>, "GetAppletLaunchedHistory", MakeVersionGate({13,0,0})}, - FunctionInfo{130, D<&ICommonStateGetter::EnableStartupLogoDisappearedMessage>, "EnableStartupLogoDisappearedMessage", MakeVersionGate({21,0,0})}, - FunctionInfo{200, D<&ICommonStateGetter::GetOperationModeSystemInfo>, "GetOperationModeSystemInfo"}, - FunctionInfo{300, D<&ICommonStateGetter::GetSettingsPlatformRegion>, "GetSettingsPlatformRegion"}, - FunctionInfo{400, nullptr, "ActivateMigrationService"}, - FunctionInfo{401, nullptr, "DeactivateMigrationService"}, - FunctionInfo{500, nullptr, "DisableSleepTillShutdown"}, - FunctionInfo{501, nullptr, "SuppressDisablingSleepTemporarily"}, - FunctionInfo{502, nullptr, "IsSleepEnabled"}, - FunctionInfo{503, nullptr, "IsDisablingSleepSuppressed"}, - FunctionInfo{600, nullptr, "SetHidInputMagnificationForApplication", MakeVersionGate({20,0,0})}, - FunctionInfo{610, D<&ICommonStateGetter::Unknown610>, "Unknown610", MakeVersionGate({21,0,0})}, - FunctionInfo{611, D<&ICommonStateGetter::Unknown611>, "Unknown611", MakeVersionGate({22,0,0})}, - FunctionInfo{900, D<&ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled>, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled", MakeVersionGate({11,0,0})}, - FunctionInfo{910, nullptr, "GetLaunchRequiredTick", MakeVersionGate({17,0,0})}, - FunctionInfo{1000, D<&ICommonStateGetter::BeginVrMode3d>, "BeginVrMode3d", MakeVersionGate({19,0,0})}, - FunctionInfo{1001, D<&ICommonStateGetter::EndVrMode3d>, "EndVrMode3d", MakeVersionGate({19,0,0})}, - FunctionInfo{1002, D<&ICommonStateGetter::IsVrModeEnabled3d>, "IsVrModeEnabled3d", MakeVersionGate({19,0,0})}, - FunctionInfo{1003, D<&ICommonStateGetter::GetVrLaboGoggleViewport>, "GetVrLaboGoggleViewport", MakeVersionGate({21,0,0})}, - FunctionInfo{1004, D<&ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle>, "GetPanelPhysicalSizeForSpecificTitle", MakeVersionGate({21,0,0})}, - FunctionInfo{1005, D<&ICommonStateGetter::GetPanelResolutionForSpecificTitle>, "GetPanelResolutionForSpecificTitle", MakeVersionGate({21,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - -class ILockAccessor final : public ServiceFramework { -public: - explicit ILockAccessor(Core::System& system_) - : ServiceFramework{system_, "ILockAccessor"}, m_context{system_, "ILockAccessor"}, - m_event{m_context} { - m_event.Signal(system.Kernel()); - } - ~ILockAccessor() override = default; - - Result TryLock(Out out_is_locked, OutCopyHandle out_handle, bool return_handle) { - LOG_INFO(Service_AM, "called, return_handle={}", return_handle); - - { - std::scoped_lock lk{m_mutex}; - if (m_is_locked) { - *out_is_locked = false; - } else { - m_is_locked = true; - *out_is_locked = true; - } - } - - if (return_handle) { - *out_handle = m_event.GetHandle(); - } - - R_SUCCEED(); - } - - Result Unlock() { - LOG_INFO(Service_AM, "called"); - - { - std::scoped_lock lk{m_mutex}; - m_is_locked = false; - } - - m_event.Signal(system.Kernel()); - R_SUCCEED(); - } - - Result GetEvent(OutCopyHandle out_handle) { - LOG_INFO(Service_AM, "called"); - *out_handle = m_event.GetHandle(); - R_SUCCEED(); - } - - Result IsLocked(Out out_is_locked) { - LOG_INFO(Service_AM, "called"); - std::scoped_lock lk{m_mutex}; - *out_is_locked = m_is_locked; - R_SUCCEED(); - } - -private: - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, D<&ILockAccessor::TryLock>, "TryLock"}, - FunctionInfo{2, D<&ILockAccessor::Unlock>, "Unlock"}, - FunctionInfo{3, D<&ILockAccessor::GetEvent>, "GetEvent"}, - FunctionInfo{4, D<&ILockAccessor::IsLocked>, "IsLocked"} - ); - KernelHelpers::ServiceContext m_context; - Event m_event; - std::mutex m_mutex{}; - bool m_is_locked{}; -}; - ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr applet) : ServiceFramework{system_, "ICommonStateGetter"}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ICommonStateGetter::GetEventHandle>, "GetEventHandle"}, + {1, D<&ICommonStateGetter::ReceiveMessage>, "ReceiveMessage"}, + {2, nullptr, "GetThisAppletKind"}, + {3, nullptr, "AllowToEnterSleep"}, + {4, nullptr, "DisallowToEnterSleep"}, + {5, D<&ICommonStateGetter::GetOperationMode>, "GetOperationMode"}, + {6, D<&ICommonStateGetter::GetPerformanceMode>, "GetPerformanceMode"}, + {7, nullptr, "GetCradleStatus"}, + {8, D<&ICommonStateGetter::GetBootMode>, "GetBootMode"}, + {9, D<&ICommonStateGetter::GetCurrentFocusState>, "GetCurrentFocusState"}, + {10, D<&ICommonStateGetter::RequestToAcquireSleepLock>, "RequestToAcquireSleepLock"}, + {11, D<&ICommonStateGetter::ReleaseSleepLock>, "ReleaseSleepLock"}, + {12, D<&ICommonStateGetter::ReleaseSleepLockTransiently>, "ReleaseSleepLockTransiently"}, + {13, D<&ICommonStateGetter::GetAcquiredSleepLockEvent>, "GetAcquiredSleepLockEvent"}, + {14, nullptr, "GetWakeupCount"}, //11.0.0+ + {15, nullptr, "Unknown15"}, //19.0.0+ + {20, D<&ICommonStateGetter::PushToGeneralChannel>, "PushToGeneralChannel"}, + {30, D<&ICommonStateGetter::GetHomeButtonReaderLockAccessor>, "GetHomeButtonReaderLockAccessor"}, + {31, D<&ICommonStateGetter::GetReaderLockAccessorEx>, "GetReaderLockAccessorEx"}, //2.0.0+ + {32, D<&ICommonStateGetter::GetWriterLockAccessorEx>, "GetWriterLockAccessorEx"}, //7.0.0+ + {40, nullptr, "GetCradleFwVersion"}, //2.0.0+ + {50, D<&ICommonStateGetter::IsVrModeEnabled>, "IsVrModeEnabled"}, //3.0.0+ + {51, D<&ICommonStateGetter::SetVrModeEnabled>, "SetVrModeEnabled"}, //3.0.0+ + {52, D<&ICommonStateGetter::SetLcdBacklighOffEnabled>, "SetLcdBacklighOffEnabled"}, //4.0.0+ + {53, D<&ICommonStateGetter::BeginVrModeEx>, "BeginVrModeEx"}, //7.0.0+ + {54, D<&ICommonStateGetter::EndVrModeEx>, "EndVrModeEx"}, //7.0.0+ + {55, D<&ICommonStateGetter::IsInControllerFirmwareUpdateSection>, "IsInControllerFirmwareUpdateSection"}, //3.0.0+ + {59, nullptr, "SetVrPositionForDebug"}, //1.0.0+ + {60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"}, + {61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"}, + {62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"}, + {63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"}, + {64, nullptr, "SetTvPowerStateMatchingMode"}, + {65, nullptr, "GetApplicationIdByContentActionName"}, + {66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"}, + {67, nullptr, "CancelCpuBoostMode"}, + {68, D<&ICommonStateGetter::GetBuiltInDisplayType>, "GetBuiltInDisplayType"}, + {80, D<&ICommonStateGetter::PerformSystemButtonPressingIfInFocus>, "PerformSystemButtonPressingIfInFocus"}, + {90, nullptr, "SetPerformanceConfigurationChangedNotification"}, + {91, nullptr, "GetCurrentPerformanceConfiguration"}, + {100, D<&ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"}, + {110, nullptr, "OpenMyGpuErrorHandler"}, + {120, D<&ICommonStateGetter::GetAppletLaunchedHistory>, "GetAppletLaunchedHistory"}, //13.0.0+ + {130, D<&ICommonStateGetter::EnableStartupLogoDisappearedMessage>, "EnableStartupLogoDisappearedMessage"}, //21.0.0+ + {200, D<&ICommonStateGetter::GetOperationModeSystemInfo>, "GetOperationModeSystemInfo"}, + {300, D<&ICommonStateGetter::GetSettingsPlatformRegion>, "GetSettingsPlatformRegion"}, + {400, nullptr, "ActivateMigrationService"}, + {401, nullptr, "DeactivateMigrationService"}, + {500, nullptr, "DisableSleepTillShutdown"}, + {501, nullptr, "SuppressDisablingSleepTemporarily"}, + {502, nullptr, "IsSleepEnabled"}, + {503, nullptr, "IsDisablingSleepSuppressed"}, + {600, nullptr, "SetHidInputMagnificationForApplication"}, //20.0.0+ + {610, D<&ICommonStateGetter::Unknown610>, "Unknown610"}, //21.0.0+ + {611, D<&ICommonStateGetter::Unknown611>, "Unknown611"}, //22.0.0+ + {900, D<&ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled>, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled"}, //11.0.0+ + {910, nullptr, "GetLaunchRequiredTick"}, //17.0.0+ + {1000, D<&ICommonStateGetter::BeginVrMode3d>, "BeginVrMode3d"}, //19.0.0+ + {1001, D<&ICommonStateGetter::EndVrMode3d>, "EndVrMode3d"}, //19.0.0+ + {1002, D<&ICommonStateGetter::IsVrModeEnabled3d>, "IsVrModeEnabled3d"}, //19.0.0+ + {1003, D<&ICommonStateGetter::GetVrLaboGoggleViewport>, "GetVrLaboGoggleViewport"}, //21.0.0+ + {1004, D<&ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle>, "GetPanelPhysicalSizeForSpecificTitle"}, //21.0.0+ + {1005, D<&ICommonStateGetter::GetPanelResolutionForSpecificTitle>, "GetPanelResolutionForSpecificTitle"}, //21.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } ICommonStateGetter::~ICommonStateGetter() = default; diff --git a/src/core/hle/service/am/service/common_state_getter.h b/src/core/hle/service/am/service/common_state_getter.h index ad782ca48e..da86b5d079 100644 --- a/src/core/hle/service/am/service/common_state_getter.h +++ b/src/core/hle/service/am/service/common_state_getter.h @@ -76,7 +76,6 @@ private: void SetCpuBoostMode(HLERequestContext& ctx); - std::optional FindRequest(u32 key) override; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/cradle_firmware_updater.cpp b/src/core/hle/service/am/service/cradle_firmware_updater.cpp index a8097ea209..b9f19e59d2 100644 --- a/src/core/hle/service/am/service/cradle_firmware_updater.cpp +++ b/src/core/hle/service/am/service/cradle_firmware_updater.cpp @@ -9,21 +9,22 @@ namespace Service::AM { - std::optional ICradleFirmwareUpdater::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ICradleFirmwareUpdater::StartUpdate>, "StartUpdate"}, - FunctionInfo{1, D<&ICradleFirmwareUpdater::FinishUpdate>, "FinishUpdate"}, - FunctionInfo{2, D<&ICradleFirmwareUpdater::GetCradleDeviceInfo>, "GetCradleDeviceInfo"}, - FunctionInfo{3, D<&ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent>, "GetCradleDeviceInfoChangeEvent"}, - FunctionInfo{4, nullptr, "GetUpdateProgressInfo"}, - FunctionInfo{5, nullptr, "GetLastInternalResult"} - ); - return HandlerTableGenerateWithFind(key, functions); - } - ICradleFirmwareUpdater::ICradleFirmwareUpdater(Core::System& system_) : ServiceFramework{system_, "ICradleFirmwareUpdater"}, m_context{system, "ICradleFirmwareUpdater"}, m_cradle_device_info_event{m_context} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ICradleFirmwareUpdater::StartUpdate>, "StartUpdate"}, + {1, D<&ICradleFirmwareUpdater::FinishUpdate>, "FinishUpdate"}, + {2, D<&ICradleFirmwareUpdater::GetCradleDeviceInfo>, "GetCradleDeviceInfo"}, + {3, D<&ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent>, "GetCradleDeviceInfoChangeEvent"}, + {4, nullptr, "GetUpdateProgressInfo"}, + {5, nullptr, "GetLastInternalResult"}, + + }; + // clang-format on + + RegisterHandlers(functions); } ICradleFirmwareUpdater::~ICradleFirmwareUpdater() = default; diff --git a/src/core/hle/service/am/service/cradle_firmware_updater.h b/src/core/hle/service/am/service/cradle_firmware_updater.h index f8e4b93b27..c895a34c22 100644 --- a/src/core/hle/service/am/service/cradle_firmware_updater.h +++ b/src/core/hle/service/am/service/cradle_firmware_updater.h @@ -33,7 +33,6 @@ private: Result GetCradleDeviceInfoChangeEvent(OutCopyHandle out_event); private: - std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext m_context; Event m_cradle_device_info_event; }; diff --git a/src/core/hle/service/am/service/debug_functions.cpp b/src/core/hle/service/am/service/debug_functions.cpp new file mode 100644 index 0000000000..4128366270 --- /dev/null +++ b/src/core/hle/service/am/service/debug_functions.cpp @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/am/service/debug_functions.h" + +namespace Service::AM { + +IDebugFunctions::IDebugFunctions(Core::System& system_) + : ServiceFramework{system_, "IDebugFunctions"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "NotifyMessageToHomeMenuForDebug"}, + {1, nullptr, "OpenMainApplication"}, + {10, nullptr, "PerformSystemButtonPressing"}, + {20, nullptr, "InvalidateTransitionLayer"}, + {30, nullptr, "RequestLaunchApplicationWithUserAndArgumentForDebug"}, + {31, nullptr, "RequestLaunchApplicationByApplicationLaunchInfoForDebug"}, + {40, nullptr, "GetAppletResourceUsageInfo"}, + {50, nullptr, "AddSystemProgramIdAndAppletIdForDebug"}, + {51, nullptr, "AddOperationConfirmedLibraryAppletIdForDebug"}, + {100, nullptr, "SetCpuBoostModeForApplet"}, + {101, nullptr, "CancelCpuBoostModeForApplet"}, + {110, nullptr, "PushToAppletBoundChannelForDebug"}, + {111, nullptr, "TryPopFromAppletBoundChannelForDebug"}, + {120, nullptr, "AlarmSettingNotificationEnableAppEventReserve"}, + {121, nullptr, "AlarmSettingNotificationDisableAppEventReserve"}, + {122, nullptr, "AlarmSettingNotificationPushAppEventNotify"}, + {130, nullptr, "FriendInvitationSetApplicationParameter"}, + {131, nullptr, "FriendInvitationClearApplicationParameter"}, + {132, nullptr, "FriendInvitationPushApplicationParameter"}, + {140, nullptr, "RestrictPowerOperationForSecureLaunchModeForDebug"}, + {200, nullptr, "CreateFloatingLibraryAppletAccepterForDebug"}, + {300, nullptr, "TerminateAllRunningApplicationsForDebug"}, + {900, nullptr, "GetGrcProcessLaunchedSystemEvent"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IDebugFunctions::~IDebugFunctions() = default; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/debug_functions.h b/src/core/hle/service/am/service/debug_functions.h new file mode 100644 index 0000000000..381499e93d --- /dev/null +++ b/src/core/hle/service/am/service/debug_functions.h @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/service.h" + +namespace Service::AM { + +class IDebugFunctions final : public ServiceFramework { +public: + explicit IDebugFunctions(Core::System& system_); + ~IDebugFunctions() override; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/display_controller.cpp b/src/core/hle/service/am/service/display_controller.cpp index eb95dd1b86..8f87327b17 100644 --- a/src/core/hle/service/am/service/display_controller.cpp +++ b/src/core/hle/service/am/service/display_controller.cpp @@ -12,42 +12,42 @@ namespace Service::AM { -std::optional IDisplayController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetLastForegroundCaptureImage"}, - FunctionInfo{1, nullptr, "UpdateLastForegroundCaptureImage"}, - FunctionInfo{2, nullptr, "GetLastApplicationCaptureImage"}, - FunctionInfo{3, nullptr, "GetCallerAppletCaptureImage"}, - FunctionInfo{4, nullptr, "UpdateCallerAppletCaptureImage"}, - FunctionInfo{5, D<&IDisplayController::GetLastForegroundCaptureImageEx>, "GetLastForegroundCaptureImageEx"}, - FunctionInfo{6, nullptr, "GetLastApplicationCaptureImageEx"}, - FunctionInfo{7, D<&IDisplayController::GetCallerAppletCaptureImageEx>, "GetCallerAppletCaptureImageEx"}, - FunctionInfo{8, D<&IDisplayController::TakeScreenShotOfOwnLayer>, "TakeScreenShotOfOwnLayer"}, - FunctionInfo{9, nullptr, "CopyBetweenCaptureBuffers"}, - FunctionInfo{10, nullptr, "AcquireLastApplicationCaptureBuffer"}, - FunctionInfo{11, nullptr, "ReleaseLastApplicationCaptureBuffer"}, - FunctionInfo{12, nullptr, "AcquireLastForegroundCaptureBuffer"}, - FunctionInfo{13, nullptr, "ReleaseLastForegroundCaptureBuffer"}, - FunctionInfo{14, nullptr, "AcquireCallerAppletCaptureBuffer"}, - FunctionInfo{15, nullptr, "ReleaseCallerAppletCaptureBuffer"}, - FunctionInfo{16, nullptr, "AcquireLastApplicationCaptureBufferEx"}, - FunctionInfo{17, nullptr, "AcquireLastForegroundCaptureBufferEx"}, - FunctionInfo{18, nullptr, "AcquireCallerAppletCaptureBufferEx"}, - FunctionInfo{20, D<&IDisplayController::ClearCaptureBuffer>, "ClearCaptureBuffer"}, - FunctionInfo{21, nullptr, "ClearAppletTransitionBuffer"}, - FunctionInfo{22, D<&IDisplayController::AcquireLastApplicationCaptureSharedBuffer>, "AcquireLastApplicationCaptureSharedBuffer"}, - FunctionInfo{23, D<&IDisplayController::ReleaseLastApplicationCaptureSharedBuffer>, "ReleaseLastApplicationCaptureSharedBuffer"}, - FunctionInfo{24, D<&IDisplayController::AcquireLastForegroundCaptureSharedBuffer>, "AcquireLastForegroundCaptureSharedBuffer"}, - FunctionInfo{25, D<&IDisplayController::ReleaseLastForegroundCaptureSharedBuffer>, "ReleaseLastForegroundCaptureSharedBuffer"}, - FunctionInfo{26, D<&IDisplayController::AcquireCallerAppletCaptureSharedBuffer>, "AcquireCallerAppletCaptureSharedBuffer"}, - FunctionInfo{27, D<&IDisplayController::ReleaseCallerAppletCaptureSharedBuffer>, "ReleaseCallerAppletCaptureSharedBuffer"}, - FunctionInfo{28, nullptr, "TakeScreenShotOfOwnLayerEx"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IDisplayController::IDisplayController(Core::System& system_, std::shared_ptr applet_) : ServiceFramework{system_, "IDisplayController"}, applet(std::move(applet_)) { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetLastForegroundCaptureImage"}, + {1, nullptr, "UpdateLastForegroundCaptureImage"}, + {2, nullptr, "GetLastApplicationCaptureImage"}, + {3, nullptr, "GetCallerAppletCaptureImage"}, + {4, nullptr, "UpdateCallerAppletCaptureImage"}, + {5, D<&IDisplayController::GetLastForegroundCaptureImageEx>, "GetLastForegroundCaptureImageEx"}, + {6, nullptr, "GetLastApplicationCaptureImageEx"}, + {7, D<&IDisplayController::GetCallerAppletCaptureImageEx>, "GetCallerAppletCaptureImageEx"}, + {8, D<&IDisplayController::TakeScreenShotOfOwnLayer>, "TakeScreenShotOfOwnLayer"}, + {9, nullptr, "CopyBetweenCaptureBuffers"}, + {10, nullptr, "AcquireLastApplicationCaptureBuffer"}, + {11, nullptr, "ReleaseLastApplicationCaptureBuffer"}, + {12, nullptr, "AcquireLastForegroundCaptureBuffer"}, + {13, nullptr, "ReleaseLastForegroundCaptureBuffer"}, + {14, nullptr, "AcquireCallerAppletCaptureBuffer"}, + {15, nullptr, "ReleaseCallerAppletCaptureBuffer"}, + {16, nullptr, "AcquireLastApplicationCaptureBufferEx"}, + {17, nullptr, "AcquireLastForegroundCaptureBufferEx"}, + {18, nullptr, "AcquireCallerAppletCaptureBufferEx"}, + {20, D<&IDisplayController::ClearCaptureBuffer>, "ClearCaptureBuffer"}, + {21, nullptr, "ClearAppletTransitionBuffer"}, + {22, D<&IDisplayController::AcquireLastApplicationCaptureSharedBuffer>, "AcquireLastApplicationCaptureSharedBuffer"}, + {23, D<&IDisplayController::ReleaseLastApplicationCaptureSharedBuffer>, "ReleaseLastApplicationCaptureSharedBuffer"}, + {24, D<&IDisplayController::AcquireLastForegroundCaptureSharedBuffer>, "AcquireLastForegroundCaptureSharedBuffer"}, + {25, D<&IDisplayController::ReleaseLastForegroundCaptureSharedBuffer>, "ReleaseLastForegroundCaptureSharedBuffer"}, + {26, D<&IDisplayController::AcquireCallerAppletCaptureSharedBuffer>, "AcquireCallerAppletCaptureSharedBuffer"}, + {27, D<&IDisplayController::ReleaseCallerAppletCaptureSharedBuffer>, "ReleaseCallerAppletCaptureSharedBuffer"}, + {28, nullptr, "TakeScreenShotOfOwnLayerEx"}, + }; + // clang-format on + + RegisterHandlers(functions); } IDisplayController::~IDisplayController() = default; diff --git a/src/core/hle/service/am/service/display_controller.h b/src/core/hle/service/am/service/display_controller.h index 03d29f93c5..35e98b9ad3 100644 --- a/src/core/hle/service/am/service/display_controller.h +++ b/src/core/hle/service/am/service/display_controller.h @@ -35,7 +35,6 @@ private: Out out_fbshare_layer_index); Result ReleaseLastApplicationCaptureSharedBuffer(); - std::optional FindRequest(u32 key) override; const std::shared_ptr applet; }; diff --git a/src/core/hle/service/am/service/global_state_controller.cpp b/src/core/hle/service/am/service/global_state_controller.cpp index be080ffcb3..e7cd60927c 100644 --- a/src/core/hle/service/am/service/global_state_controller.cpp +++ b/src/core/hle/service/am/service/global_state_controller.cpp @@ -10,28 +10,28 @@ namespace Service::AM { - std::optional IGlobalStateController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestToEnterSleep"}, - FunctionInfo{1, nullptr, "EnterSleep"}, - FunctionInfo{2, nullptr, "StartSleepSequence"}, - FunctionInfo{3, D<&IGlobalStateController::StartShutdownSequence>, "StartShutdownSequence"}, - FunctionInfo{4, D<&IGlobalStateController::StartRebootSequence>, "StartRebootSequence"}, - FunctionInfo{9, nullptr, "IsAutoPowerDownRequested"}, - FunctionInfo{10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"}, - FunctionInfo{11, nullptr, "NotifyCecSettingsChanged"}, - FunctionInfo{12, nullptr, "SetDefaultHomeButtonLongPressTime"}, - FunctionInfo{13, nullptr, "UpdateDefaultDisplayResolution"}, - FunctionInfo{14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"}, - FunctionInfo{15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"}, - FunctionInfo{30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"} - ); - return HandlerTableGenerateWithFind(key, functions); - } - IGlobalStateController::IGlobalStateController(Core::System& system_) : ServiceFramework{system_, "IGlobalStateController"}, m_context{system_, "IGlobalStateController"}, m_hdcp_authentication_failed_event{m_context} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestToEnterSleep"}, + {1, nullptr, "EnterSleep"}, + {2, nullptr, "StartSleepSequence"}, + {3, D<&IGlobalStateController::StartShutdownSequence>, "StartShutdownSequence"}, + {4, D<&IGlobalStateController::StartRebootSequence>, "StartRebootSequence"}, + {9, nullptr, "IsAutoPowerDownRequested"}, + {10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"}, + {11, nullptr, "NotifyCecSettingsChanged"}, + {12, nullptr, "SetDefaultHomeButtonLongPressTime"}, + {13, nullptr, "UpdateDefaultDisplayResolution"}, + {14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"}, + {15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"}, + {30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"}, + }; + // clang-format on + + RegisterHandlers(functions); } Result IGlobalStateController::StartShutdownSequence() { diff --git a/src/core/hle/service/am/service/global_state_controller.h b/src/core/hle/service/am/service/global_state_controller.h index 0de1415295..012692ecd8 100644 --- a/src/core/hle/service/am/service/global_state_controller.h +++ b/src/core/hle/service/am/service/global_state_controller.h @@ -26,9 +26,9 @@ private: Result LoadAndApplyIdlePolicySettings(); Result ShouldSleepOnBoot(Out out_should_sleep_on_boot); Result GetHdcpAuthenticationFailedEvent(OutCopyHandle out_event); - Result OpenCradleFirmwareUpdater(Out> out_cradle_firmware_updater); + Result OpenCradleFirmwareUpdater( + Out> out_cradle_firmware_updater); - std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext m_context; Event m_hdcp_authentication_failed_event; }; diff --git a/src/core/hle/service/am/service/home_menu_functions.cpp b/src/core/hle/service/am/service/home_menu_functions.cpp index 5f61c842a2..f9d402ca99 100644 --- a/src/core/hle/service/am/service/home_menu_functions.cpp +++ b/src/core/hle/service/am/service/home_menu_functions.cpp @@ -14,31 +14,31 @@ namespace Service::AM { -std::optional IHomeMenuFunctions::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{10, D<&IHomeMenuFunctions::RequestToGetForeground>, "RequestToGetForeground"}, - FunctionInfo{11, D<&IHomeMenuFunctions::LockForeground>, "LockForeground"}, - FunctionInfo{12, D<&IHomeMenuFunctions::UnlockForeground>, "UnlockForeground"}, - FunctionInfo{20, D<&IHomeMenuFunctions::PopFromGeneralChannel>, "PopFromGeneralChannel"}, - FunctionInfo{21, D<&IHomeMenuFunctions::GetPopFromGeneralChannelEvent>, "GetPopFromGeneralChannelEvent"}, - FunctionInfo{30, nullptr, "GetHomeButtonWriterLockAccessor"}, - FunctionInfo{31, nullptr, "GetWriterLockAccessorEx"}, - FunctionInfo{40, D<&IHomeMenuFunctions::IsSleepEnabled>, "IsSleepEnabled"}, - FunctionInfo{41, D<&IHomeMenuFunctions::IsRebootEnabled>, "IsRebootEnabled"}, - FunctionInfo{50, nullptr, "LaunchSystemApplet"}, - FunctionInfo{51, nullptr, "LaunchStarter"}, - FunctionInfo{100, nullptr, "PopRequestLaunchApplicationForDebug"}, - FunctionInfo{110, D<&IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug>, "IsForceTerminateApplicationDisabledForDebug"}, - FunctionInfo{200, nullptr, "LaunchDevMenu"}, - FunctionInfo{1000, nullptr, "SetLastApplicationExitReason"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IHomeMenuFunctions::IHomeMenuFunctions(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) : ServiceFramework{system_, "IHomeMenuFunctions"}, m_window_system{window_system}, m_applet{std::move(applet)}, m_context{system, "IHomeMenuFunctions"} { + // clang-format off + static const FunctionInfo functions[] = { + {10, D<&IHomeMenuFunctions::RequestToGetForeground>, "RequestToGetForeground"}, + {11, D<&IHomeMenuFunctions::LockForeground>, "LockForeground"}, + {12, D<&IHomeMenuFunctions::UnlockForeground>, "UnlockForeground"}, + {20, D<&IHomeMenuFunctions::PopFromGeneralChannel>, "PopFromGeneralChannel"}, + {21, D<&IHomeMenuFunctions::GetPopFromGeneralChannelEvent>, "GetPopFromGeneralChannelEvent"}, + {30, nullptr, "GetHomeButtonWriterLockAccessor"}, + {31, nullptr, "GetWriterLockAccessorEx"}, + {40, D<&IHomeMenuFunctions::IsSleepEnabled>, "IsSleepEnabled"}, + {41, D<&IHomeMenuFunctions::IsRebootEnabled>, "IsRebootEnabled"}, + {50, nullptr, "LaunchSystemApplet"}, + {51, nullptr, "LaunchStarter"}, + {100, nullptr, "PopRequestLaunchApplicationForDebug"}, + {110, D<&IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug>, "IsForceTerminateApplicationDisabledForDebug"}, + {200, nullptr, "LaunchDevMenu"}, + {1000, nullptr, "SetLastApplicationExitReason"}, + }; + // clang-format on + + RegisterHandlers(functions); } IHomeMenuFunctions::~IHomeMenuFunctions() = default; diff --git a/src/core/hle/service/am/service/home_menu_functions.h b/src/core/hle/service/am/service/home_menu_functions.h index 25eb9db45e..2c3ef54375 100644 --- a/src/core/hle/service/am/service/home_menu_functions.h +++ b/src/core/hle/service/am/service/home_menu_functions.h @@ -34,7 +34,6 @@ private: Result IsForceTerminateApplicationDisabledForDebug( Out out_is_force_terminate_application_disabled_for_debug); - std::optional FindRequest(u32 key) override; WindowSystem& m_window_system; const std::shared_ptr m_applet; KernelHelpers::ServiceContext m_context; diff --git a/src/core/hle/service/am/service/library_applet_accessor.cpp b/src/core/hle/service/am/service/library_applet_accessor.cpp index c5386fb1a1..849e5794cf 100644 --- a/src/core/hle/service/am/service/library_applet_accessor.cpp +++ b/src/core/hle/service/am/service/library_applet_accessor.cpp @@ -17,7 +17,9 @@ namespace Service::AM { -static void EnableSingleUserPlay(const std::shared_ptr& impl) { +namespace { + +void EnableSingleUserPlay(const std::shared_ptr& impl) { constexpr s64 DisplayOptionsOffset = 0x90; constexpr s64 IsSkipEnabledOffset = 1; constexpr s64 ShowSkipButtonOffset = 4; @@ -27,7 +29,7 @@ static void EnableSingleUserPlay(const std::shared_ptr& im impl->Write(DisplayOptionsOffset + ShowSkipButtonOffset, &enabled, sizeof(enabled)); } -static void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr& impl) { +void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr& impl) { Frontend::UiReturnArg return_arg{}; impl->Read(0, &return_arg, sizeof(return_arg)); @@ -45,40 +47,42 @@ static void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr ILibraryAppletAccessor::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ILibraryAppletAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"}, - FunctionInfo{1, D<&ILibraryAppletAccessor::IsCompleted>, "IsCompleted"}, - FunctionInfo{10, D<&ILibraryAppletAccessor::Start>, "Start"}, - FunctionInfo{20, D<&ILibraryAppletAccessor::RequestExit>, "RequestExit"}, - FunctionInfo{25, D<&ILibraryAppletAccessor::Terminate>, "Terminate"}, - FunctionInfo{30, D<&ILibraryAppletAccessor::GetResult>, "GetResult"}, - FunctionInfo{50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"}, - FunctionInfo{60, D<&ILibraryAppletAccessor::PresetLibraryAppletGpuTimeSliceZero>, "PresetLibraryAppletGpuTimeSliceZero", MakeVersionGate({10,0,0})}, - FunctionInfo{80, nullptr, "RequestForLibraryAppletToGetForeground", MakeVersionGate({19,0,0})}, - FunctionInfo{81, nullptr, "GetCurrentChildLibraryApplet", MakeVersionGate({19,0,0})}, - FunctionInfo{90, D<&ILibraryAppletAccessor::Unknown90>, "Unknown90", MakeVersionGate({20,0,0})}, - FunctionInfo{100, D<&ILibraryAppletAccessor::PushInData>, "PushInData"}, - FunctionInfo{101, D<&ILibraryAppletAccessor::PopOutData>, "PopOutData"}, - FunctionInfo{102, nullptr, "PushExtraStorage"}, - FunctionInfo{103, D<&ILibraryAppletAccessor::PushInteractiveInData>, "PushInteractiveInData"}, - FunctionInfo{104, D<&ILibraryAppletAccessor::PopInteractiveOutData>, "PopInteractiveOutData"}, - FunctionInfo{105, D<&ILibraryAppletAccessor::GetPopOutDataEvent>, "GetPopOutDataEvent"}, - FunctionInfo{106, D<&ILibraryAppletAccessor::GetPopInteractiveOutDataEvent>, "GetPopInteractiveOutDataEvent"}, - FunctionInfo{110, nullptr, "NeedsToExitProcess"}, - FunctionInfo{120, D<&ILibraryAppletAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"}, - FunctionInfo{150, nullptr, "RequestForAppletToGetForeground"}, - FunctionInfo{160, D<&ILibraryAppletAccessor::GetIndirectLayerConsumerHandle>, "GetIndirectLayerConsumerHandle", MakeVersionGate({2,0,0})}, - FunctionInfo{170, D<&ILibraryAppletAccessor::Unknown170>, "Unknown170", MakeVersionGate({22,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); - } +} // namespace ILibraryAppletAccessor::ILibraryAppletAccessor(Core::System& system_, std::shared_ptr broker, std::shared_ptr applet) : ServiceFramework{system_, "ILibraryAppletAccessor"}, m_broker{std::move(broker)}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ILibraryAppletAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"}, + {1, D<&ILibraryAppletAccessor::IsCompleted>, "IsCompleted"}, + {10, D<&ILibraryAppletAccessor::Start>, "Start"}, + {20, D<&ILibraryAppletAccessor::RequestExit>, "RequestExit"}, + {25, D<&ILibraryAppletAccessor::Terminate>, "Terminate"}, + {30, D<&ILibraryAppletAccessor::GetResult>, "GetResult"}, + {50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"}, + {60, D<&ILibraryAppletAccessor::PresetLibraryAppletGpuTimeSliceZero>, "PresetLibraryAppletGpuTimeSliceZero"}, //10.0.0+ + {80, nullptr, "RequestForLibraryAppletToGetForeground"}, //19.0.0+ + {81, nullptr, "GetCurrentChildLibraryApplet"}, //19.0.0+ + {90, D<&ILibraryAppletAccessor::Unknown90>, "Unknown90"}, //20.0.0+ + {100, D<&ILibraryAppletAccessor::PushInData>, "PushInData"}, + {101, D<&ILibraryAppletAccessor::PopOutData>, "PopOutData"}, + {102, nullptr, "PushExtraStorage"}, + {103, D<&ILibraryAppletAccessor::PushInteractiveInData>, "PushInteractiveInData"}, + {104, D<&ILibraryAppletAccessor::PopInteractiveOutData>, "PopInteractiveOutData"}, + {105, D<&ILibraryAppletAccessor::GetPopOutDataEvent>, "GetPopOutDataEvent"}, + {106, D<&ILibraryAppletAccessor::GetPopInteractiveOutDataEvent>, "GetPopInteractiveOutDataEvent"}, + {110, nullptr, "NeedsToExitProcess"}, + {120, D<&ILibraryAppletAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"}, + {150, nullptr, "RequestForAppletToGetForeground"}, + {160, D<&ILibraryAppletAccessor::GetIndirectLayerConsumerHandle>, "GetIndirectLayerConsumerHandle"}, //2.0.0+ + {170, D<&ILibraryAppletAccessor::Unknown170>, "Unknown170"}, //22.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } ILibraryAppletAccessor::~ILibraryAppletAccessor() = default; diff --git a/src/core/hle/service/am/service/library_applet_accessor.h b/src/core/hle/service/am/service/library_applet_accessor.h index e14ddb3bde..ad40bc76c7 100644 --- a/src/core/hle/service/am/service/library_applet_accessor.h +++ b/src/core/hle/service/am/service/library_applet_accessor.h @@ -6,6 +6,7 @@ #pragma once +#include "core/hle/service/am/service/library_applet_self_accessor.h" #include "core/hle/service/cmif_types.h" #include "core/hle/service/service.h" @@ -15,26 +16,6 @@ class AppletDataBroker; struct Applet; class IStorage; -struct LibraryAppletInfo { - AppletId applet_id; - LibraryAppletMode library_applet_mode; -}; -static_assert(sizeof(LibraryAppletInfo) == 0x8, "LibraryAppletInfo has incorrect size."); - -struct ErrorCode { - u32 category; - u32 number; -}; -static_assert(sizeof(ErrorCode) == 0x8, "ErrorCode has incorrect size."); - -struct ErrorContext { - u8 type; - INSERT_PADDING_BYTES_NOINIT(0x7); - std::array data; - Result result; -}; -static_assert(sizeof(ErrorContext) == 0x200, "ErrorContext has incorrect size."); - class ILibraryAppletAccessor final : public ServiceFramework { public: explicit ILibraryAppletAccessor(Core::System& system_, std::shared_ptr broker, @@ -68,7 +49,6 @@ private: void FrontendExecuteInteractive(); void FrontendRequestExit(); - std::optional FindRequest(u32 key) override; const std::shared_ptr m_broker; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/library_applet_creator.cpp b/src/core/hle/service/am/service/library_applet_creator.cpp new file mode 100644 index 0000000000..4ee92908b5 --- /dev/null +++ b/src/core/hle/service/am/service/library_applet_creator.cpp @@ -0,0 +1,287 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "common/settings.h" +#include "core/hle/kernel/k_transfer_memory.h" +#include "core/hle/service/am/applet_data_broker.h" +#include "core/hle/service/am/applet_manager.h" +#include "core/hle/service/am/frontend/applets.h" +#include "core/hle/service/am/library_applet_storage.h" +#include "core/hle/service/am/process_creation.h" +#include "core/hle/service/am/service/library_applet_accessor.h" +#include "core/hle/service/am/service/library_applet_creator.h" + +#include "core/hle/api_version.h" +#include "core/hle/service/am/service/storage.h" +#include "core/hle/service/am/window_system.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/sm/sm.h" + +namespace Service::AM { + +namespace { + +bool ShouldCreateGuestApplet(AppletId applet_id) { +#define X(Name, name) \ + if (applet_id == AppletId::Name && \ + Settings::values.name##_applet_mode.GetValue() != Settings::AppletMode::LLE) { \ + return false; \ + } + + X(Cabinet, cabinet) + X(Controller, controller) + X(DataErase, data_erase) + X(Error, error) + X(NetConnect, net_connect) + X(ProfileSelect, player_select) + X(SoftwareKeyboard, swkbd) + X(MiiEdit, mii_edit) + X(Web, web) + X(Shop, shop) + X(PhotoViewer, photo_viewer) + X(OfflineWeb, offline_web) + X(LoginShare, login_share) + X(WebAuth, wifi_web_auth) + X(MyPage, my_page) + +#undef X + + return true; +} + +AppletProgramId AppletIdToProgramId(AppletId applet_id) { + switch (applet_id) { + case AppletId::OverlayDisplay: + return AppletProgramId::OverlayDisplay; + case AppletId::QLaunch: + return AppletProgramId::QLaunch; + case AppletId::Starter: + return AppletProgramId::Starter; + case AppletId::Auth: + return AppletProgramId::Auth; + case AppletId::Cabinet: + return AppletProgramId::Cabinet; + case AppletId::Controller: + return AppletProgramId::Controller; + case AppletId::DataErase: + return AppletProgramId::DataErase; + case AppletId::Error: + return AppletProgramId::Error; + case AppletId::NetConnect: + return AppletProgramId::NetConnect; + case AppletId::ProfileSelect: + return AppletProgramId::ProfileSelect; + case AppletId::SoftwareKeyboard: + return AppletProgramId::SoftwareKeyboard; + case AppletId::MiiEdit: + return AppletProgramId::MiiEdit; + case AppletId::Web: + return AppletProgramId::Web; + case AppletId::Shop: + return AppletProgramId::Shop; + case AppletId::PhotoViewer: + return AppletProgramId::PhotoViewer; + case AppletId::Settings: + return AppletProgramId::Settings; + case AppletId::OfflineWeb: + return AppletProgramId::OfflineWeb; + case AppletId::LoginShare: + return AppletProgramId::LoginShare; + case AppletId::WebAuth: + return AppletProgramId::WebAuth; + case AppletId::MyPage: + return AppletProgramId::MyPage; + default: + return static_cast(0); + } +} + +std::shared_ptr CreateGuestApplet(Core::System& system, + WindowSystem& window_system, + std::shared_ptr caller_applet, + AppletId applet_id, + LibraryAppletMode mode) { + const auto program_id = static_cast(AppletIdToProgramId(applet_id)); + if (program_id == 0) { + // Unknown applet + return {}; + } + + auto process = CreateProcess(system, program_id, 1, HLE::ApiVersion::HOS_VERSION_MAJOR); + if (process) { + const auto applet = std::make_shared(system, std::move(process), false); + applet->program_id = program_id; + applet->applet_id = applet_id; + applet->type = AppletType::LibraryApplet; + applet->library_applet_mode = mode; + applet->window_visible = mode != LibraryAppletMode::AllForegroundInitiallyHidden; + + auto broker = std::make_shared(system); + applet->caller_applet = caller_applet; + applet->caller_applet_broker = broker; + { + std::scoped_lock lk{caller_applet->lock}; + caller_applet->child_applets.push_back(applet); + } + window_system.TrackApplet(applet, false); + return std::make_shared(system, broker, applet); + } + // Couldn't initialize the guest process + return {}; +} + +std::shared_ptr CreateFrontendApplet(Core::System& system, + WindowSystem& window_system, + std::shared_ptr caller_applet, + AppletId applet_id, + LibraryAppletMode mode) { + const auto program_id = static_cast(AppletIdToProgramId(applet_id)); + + auto process = std::make_unique(system); + auto applet = std::make_shared(system, std::move(process), false); + applet->program_id = program_id; + applet->applet_id = applet_id; + applet->type = AppletType::LibraryApplet; + applet->library_applet_mode = mode; + + auto storage = std::make_shared(system); + applet->caller_applet = caller_applet; + applet->caller_applet_broker = storage; + applet->frontend = system.GetFrontendAppletHolder().GetApplet(applet, applet_id, mode); + { + std::scoped_lock lk{caller_applet->lock}; + caller_applet->child_applets.push_back(applet); + } + return std::make_shared(system, storage, applet); +} + +} // namespace + +ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr applet, + WindowSystem& window_system) + : ServiceFramework{system_, "ILibraryAppletCreator"}, + m_window_system{window_system}, m_applet{std::move(applet)} { + static const FunctionInfo functions[] = { + {0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"}, + {1, nullptr, "TerminateAllLibraryApplets"}, + {2, nullptr, "AreAnyLibraryAppletsLeft"}, + {3, D<&ILibraryAppletCreator::CreateLibraryAppletEx>, "CreateLibraryAppletEx"}, + {10, D<&ILibraryAppletCreator::CreateStorage>, "CreateStorage"}, + {11, D<&ILibraryAppletCreator::CreateTransferMemoryStorage>, "CreateTransferMemoryStorage"}, + {12, D<&ILibraryAppletCreator::CreateHandleStorage>, "CreateHandleStorage"}, + }; + RegisterHandlers(functions); +} + +ILibraryAppletCreator::~ILibraryAppletCreator() = default; + +Result ILibraryAppletCreator::CreateLibraryApplet( + Out> out_library_applet_accessor, AppletId applet_id, + LibraryAppletMode library_applet_mode) { + LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={}", applet_id, + library_applet_mode); + + std::shared_ptr library_applet; + if (ShouldCreateGuestApplet(applet_id)) { + library_applet = + CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); + } + if (!library_applet) { + library_applet = + CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); + } + if (!library_applet) { + LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); + R_THROW(ResultUnknown); + } + + // Applet is created, can now be launched. + m_applet->library_applet_launchable_event.Signal(system.Kernel()); + *out_library_applet_accessor = library_applet; + R_SUCCEED(); +} + +Result ILibraryAppletCreator::CreateLibraryAppletEx( + Out> out_library_applet_accessor, AppletId applet_id, + LibraryAppletMode library_applet_mode, u64 thread_id) { + LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={} thread_id={}", applet_id, + library_applet_mode, thread_id); + + std::shared_ptr library_applet; + if (ShouldCreateGuestApplet(applet_id)) { + library_applet = + CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); + } + if (!library_applet) { + library_applet = + CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode); + } + if (!library_applet) { + LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); + R_THROW(ResultUnknown); + } + + // Applet is created, can now be launched. + m_applet->library_applet_launchable_event.Signal(system.Kernel()); + *out_library_applet_accessor = library_applet; + R_SUCCEED(); +} + +Result ILibraryAppletCreator::CreateStorage(Out> out_storage, s64 size) { + LOG_DEBUG(Service_AM, "called, size={}", size); + + if (size <= 0) { + LOG_ERROR(Service_AM, "size is less than or equal to 0"); + R_THROW(ResultUnknown); + } + + *out_storage = std::make_shared(system, AM::CreateStorage(std::vector(size))); + R_SUCCEED(); +} + +Result ILibraryAppletCreator::CreateTransferMemoryStorage( + Out> out_storage, bool is_writable, s64 size, + InCopyHandle transfer_memory_handle) { + LOG_DEBUG(Service_AM, "called, is_writable={} size={}", is_writable, size); + + if (size <= 0) { + LOG_ERROR(Service_AM, "size is less than or equal to 0"); + R_THROW(ResultUnknown); + } + + if (!transfer_memory_handle) { + LOG_ERROR(Service_AM, "transfer_memory_handle is null"); + R_THROW(ResultUnknown); + } + + *out_storage = std::make_shared( + system, AM::CreateTransferMemoryStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(), + transfer_memory_handle.Get(), is_writable, size)); + R_SUCCEED(); +} + +Result ILibraryAppletCreator::CreateHandleStorage( + Out> out_storage, s64 size, + InCopyHandle transfer_memory_handle) { + LOG_DEBUG(Service_AM, "called, size={}", size); + + if (size <= 0) { + LOG_ERROR(Service_AM, "size is less than or equal to 0"); + R_THROW(ResultUnknown); + } + + if (!transfer_memory_handle) { + LOG_ERROR(Service_AM, "transfer_memory_handle is null"); + R_THROW(ResultUnknown); + } + + *out_storage = std::make_shared( + system, AM::CreateHandleStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(), + transfer_memory_handle.Get(), size)); + R_SUCCEED(); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_creator.h b/src/core/hle/service/am/service/library_applet_creator.h new file mode 100644 index 0000000000..1c7f930055 --- /dev/null +++ b/src/core/hle/service/am/service/library_applet_creator.h @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/am/am_types.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::AM { + +struct Applet; +class ILibraryAppletAccessor; +class IStorage; +class WindowSystem; + +class ILibraryAppletCreator final : public ServiceFramework { +public: + explicit ILibraryAppletCreator(Core::System& system_, std::shared_ptr applet, + WindowSystem& window_system); + ~ILibraryAppletCreator() override; + +private: + Result CreateLibraryApplet( + Out> out_library_applet_accessor, AppletId applet_id, + LibraryAppletMode library_applet_mode); + Result CreateLibraryAppletEx( + Out> out_library_applet_accessor, AppletId applet_id, + LibraryAppletMode library_applet_mode, u64 thread_id); + Result CreateStorage(Out> out_storage, s64 size); + Result CreateTransferMemoryStorage( + Out> out_storage, bool is_writable, s64 size, + InCopyHandle transfer_memory_handle); + Result CreateHandleStorage(Out> out_storage, s64 size, + InCopyHandle transfer_memory_handle); + + WindowSystem& m_window_system; + const std::shared_ptr m_applet; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_proxy.cpp b/src/core/hle/service/am/service/library_applet_proxy.cpp new file mode 100644 index 0000000000..567ff75797 --- /dev/null +++ b/src/core/hle/service/am/service/library_applet_proxy.cpp @@ -0,0 +1,137 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/am/service/applet_common_functions.h" +#include "core/hle/service/am/service/audio_controller.h" +#include "core/hle/service/am/service/common_state_getter.h" +#include "core/hle/service/am/service/debug_functions.h" +#include "core/hle/service/am/service/display_controller.h" +#include "core/hle/service/am/service/global_state_controller.h" +#include "core/hle/service/am/service/home_menu_functions.h" +#include "core/hle/service/am/service/library_applet_creator.h" +#include "core/hle/service/am/service/library_applet_proxy.h" +#include "core/hle/service/am/service/library_applet_self_accessor.h" +#include "core/hle/service/am/service/process_winding_controller.h" +#include "core/hle/service/am/service/self_controller.h" +#include "core/hle/service/am/service/window_controller.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + +ILibraryAppletProxy::ILibraryAppletProxy(Core::System& system_, std::shared_ptr applet, + Kernel::KProcess* process, WindowSystem& window_system) + : ServiceFramework{system_, "ILibraryAppletProxy"}, + m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ILibraryAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, + {1, D<&ILibraryAppletProxy::GetSelfController>, "GetSelfController"}, + {2, D<&ILibraryAppletProxy::GetWindowController>, "GetWindowController"}, + {3, D<&ILibraryAppletProxy::GetAudioController>, "GetAudioController"}, + {4, D<&ILibraryAppletProxy::GetDisplayController>, "GetDisplayController"}, + {10, D<&ILibraryAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, + {11, D<&ILibraryAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, + {20, D<&ILibraryAppletProxy::OpenLibraryAppletSelfAccessor>, "OpenLibraryAppletSelfAccessor"}, + {21, D<&ILibraryAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, + {22, D<&ILibraryAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"}, + {23, D<&ILibraryAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, + {1000, D<&ILibraryAppletProxy::GetDebugFunctions>, "GetDebugFunctions"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +ILibraryAppletProxy::~ILibraryAppletProxy() = default; + +Result ILibraryAppletProxy::GetAudioController( + Out> out_audio_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_audio_controller = std::make_shared(system); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetDisplayController( + Out> out_display_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_display_controller = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetProcessWindingController( + Out> out_process_winding_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_process_winding_controller = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetDebugFunctions( + Out> out_debug_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_debug_functions = std::make_shared(system); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetWindowController( + Out> out_window_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_window_controller = std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetSelfController( + Out> out_self_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_self_controller = std::make_shared(system, m_applet, m_process); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetCommonStateGetter( + Out> out_common_state_getter) { + LOG_DEBUG(Service_AM, "called"); + *out_common_state_getter = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetLibraryAppletCreator( + Out> out_library_applet_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_creator = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::OpenLibraryAppletSelfAccessor( + Out> out_library_applet_self_accessor) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_self_accessor = + std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetAppletCommonFunctions( + Out> out_applet_common_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_applet_common_functions = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetHomeMenuFunctions( + Out> out_home_menu_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_home_menu_functions = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); +} + +Result ILibraryAppletProxy::GetGlobalStateController( + Out> out_global_state_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_global_state_controller = std::make_shared(system); + R_SUCCEED(); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_proxy.h b/src/core/hle/service/am/service/library_applet_proxy.h new file mode 100644 index 0000000000..c659dbe187 --- /dev/null +++ b/src/core/hle/service/am/service/library_applet_proxy.h @@ -0,0 +1,59 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::AM { + +struct Applet; +class IAppletCommonFunctions; +class IAudioController; +class ICommonStateGetter; +class IDebugFunctions; +class IDisplayController; +class IHomeMenuFunctions; +class IGlobalStateController; +class ILibraryAppletCreator; +class ILibraryAppletSelfAccessor; +class IProcessWindingController; +class ISelfController; +class IWindowController; +class WindowSystem; + +class ILibraryAppletProxy final : public ServiceFramework { +public: + explicit ILibraryAppletProxy(Core::System& system_, std::shared_ptr applet, + Kernel::KProcess* process, WindowSystem& window_system); + ~ILibraryAppletProxy(); + +private: + Result GetAudioController(Out> out_audio_controller); + Result GetDisplayController(Out> out_display_controller); + Result GetProcessWindingController( + Out> out_process_winding_controller); + Result GetDebugFunctions(Out> out_debug_functions); + Result GetWindowController(Out> out_window_controller); + Result GetSelfController(Out> out_self_controller); + Result GetCommonStateGetter(Out> out_common_state_getter); + Result GetLibraryAppletCreator( + Out> out_library_applet_creator); + Result OpenLibraryAppletSelfAccessor( + Out> out_library_applet_self_accessor); + Result GetAppletCommonFunctions( + Out> out_applet_common_functions); + Result GetHomeMenuFunctions(Out> out_home_menu_functions); + Result GetGlobalStateController( + Out> out_global_state_controller); + + WindowSystem& m_window_system; + Kernel::KProcess* const m_process; + const std::shared_ptr m_applet; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.cpp b/src/core/hle/service/am/service/library_applet_self_accessor.cpp new file mode 100644 index 0000000000..907be49204 --- /dev/null +++ b/src/core/hle/service/am/service/library_applet_self_accessor.cpp @@ -0,0 +1,332 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/core_timing.h" +#include "core/file_sys/control_metadata.h" +#include "core/file_sys/patch_manager.h" +#include "core/file_sys/registered_cache.h" +#include "core/hle/service/acc/profile_manager.h" +#include "core/hle/service/am/applet_data_broker.h" +#include "core/hle/service/am/applet_manager.h" +#include "core/hle/service/am/frontend/applets.h" +#include "core/hle/service/am/service/library_applet_self_accessor.h" +#include "core/hle/service/am/service/storage.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/filesystem/filesystem.h" +#include "core/hle/service/glue/glue_manager.h" +#include "core/hle/service/ns/application_manager_interface.h" +#include "core/hle/service/ns/service_getter_interface.h" +#include "core/hle/service/sm/sm.h" + +namespace Service::AM { + +namespace { + +AppletIdentityInfo GetCallerIdentity(Applet& applet) { + if (const auto caller_applet = applet.caller_applet.lock(); caller_applet) { + // TODO: is this actually the application ID? + return { + .applet_id = caller_applet->applet_id, + .application_id = caller_applet->program_id, + }; + } else { + return { + .applet_id = AppletId::QLaunch, + .application_id = 0x0100000000001000ull, + }; + } +} + +} // namespace + +ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_, + std::shared_ptr applet) + : ServiceFramework{system_, "ILibraryAppletSelfAccessor"}, m_applet{std::move(applet)}, + m_broker{m_applet->caller_applet_broker} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ILibraryAppletSelfAccessor::PopInData>, "PopInData"}, + {1, D<&ILibraryAppletSelfAccessor::PushOutData>, "PushOutData"}, + {2, D<&ILibraryAppletSelfAccessor::PopInteractiveInData>, "PopInteractiveInData"}, + {3, D<&ILibraryAppletSelfAccessor::PushInteractiveOutData>, "PushInteractiveOutData"}, + {5, D<&ILibraryAppletSelfAccessor::GetPopInDataEvent>, "GetPopInDataEvent"}, + {6, D<&ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent>, "GetPopInteractiveInDataEvent"}, + {10, D<&ILibraryAppletSelfAccessor::ExitProcessAndReturn>, "ExitProcessAndReturn"}, + {11, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"}, + {12, D<&ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo>, "GetMainAppletIdentityInfo"}, + {13, D<&ILibraryAppletSelfAccessor::CanUseApplicationCore>, "CanUseApplicationCore"}, + {14, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo>, "GetCallerAppletIdentityInfo"}, + {15, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty>, "GetMainAppletApplicationControlProperty"}, + {16, D<&ILibraryAppletSelfAccessor::GetMainAppletStorageId>, "GetMainAppletStorageId"}, + {17, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack>, "GetCallerAppletIdentityInfoStack"}, + {18, nullptr, "GetNextReturnDestinationAppletIdentityInfo"}, + {19, D<&ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout>, "GetDesirableKeyboardLayout"}, + {20, nullptr, "PopExtraStorage"}, + {25, nullptr, "GetPopExtraStorageEvent"}, + {30, D<&ILibraryAppletSelfAccessor::UnpopInData>, "UnpopInData"}, + {31, nullptr, "UnpopExtraStorage"}, + {40, nullptr, "GetIndirectLayerProducerHandle"}, + {50, D<&ILibraryAppletSelfAccessor::ReportVisibleError>, "ReportVisibleError"}, + {51, D<&ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext>, "ReportVisibleErrorWithErrorContext"}, + {60, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage>, "GetMainAppletApplicationDesiredLanguage"}, + {70, D<&ILibraryAppletSelfAccessor::GetCurrentApplicationId>, "GetCurrentApplicationId"}, + {80, nullptr, "RequestExitToSelf"}, + {90, nullptr, "CreateApplicationAndPushAndRequestToLaunch"}, + {100, nullptr, "CreateGameMovieTrimmer"}, + {101, nullptr, "ReserveResourceForMovieOperation"}, + {102, nullptr, "UnreserveResourceForMovieOperation"}, + {110, D<&ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers>, "GetMainAppletAvailableUsers"}, + {120, nullptr, "GetLaunchStorageInfoForDebug"}, + {130, nullptr, "GetGpuErrorDetectedSystemEvent"}, + {140, nullptr, "SetApplicationMemoryReservation"}, + {150, D<&ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually>, "ShouldSetGpuTimeSliceManually"}, + {160, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx>, "GetLibraryAppletInfoEx"}, + }; + // clang-format on + RegisterHandlers(functions); +} + +ILibraryAppletSelfAccessor::~ILibraryAppletSelfAccessor() = default; + +Result ILibraryAppletSelfAccessor::PopInData(Out> out_storage) { + LOG_INFO(Service_AM, "called"); + R_RETURN(m_broker->GetInData().Pop(system.Kernel(), out_storage)); +} + +Result ILibraryAppletSelfAccessor::PushOutData(SharedPointer storage) { + LOG_INFO(Service_AM, "called"); + m_broker->GetOutData().Push(system.Kernel(), storage); + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::PopInteractiveInData(Out> out_storage) { + LOG_INFO(Service_AM, "called"); + R_RETURN(m_broker->GetInteractiveInData().Pop(system.Kernel(), out_storage)); +} + +Result ILibraryAppletSelfAccessor::PushInteractiveOutData(SharedPointer storage) { + LOG_INFO(Service_AM, "called"); + m_broker->GetInteractiveOutData().Push(system.Kernel(), storage); + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetPopInDataEvent( + OutCopyHandle out_event) { + LOG_INFO(Service_AM, "called"); + *out_event = m_broker->GetInData().GetEvent(); + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent( + OutCopyHandle out_event) { + LOG_INFO(Service_AM, "called"); + *out_event = m_broker->GetInteractiveInData().GetEvent(); + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetLibraryAppletInfo( + Out out_library_applet_info) { + LOG_INFO(Service_AM, "called"); + *out_library_applet_info = { + .applet_id = m_applet->applet_id, + .library_applet_mode = m_applet->library_applet_mode, + }; + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo( + Out out_identity_info) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_identity_info = { + .applet_id = AppletId::QLaunch, + .application_id = 0x0100000000001000ull, + }; + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::CanUseApplicationCore(Out out_can_use_application_core) { + // TODO: This appears to read the NPDM from state and check the core mask of the applet. + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_can_use_application_core = false; + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty( + OutLargeData, BufferAttr_HipcMapAlias> out_nacp) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + + // TODO: this should be the main applet, not the caller applet + const auto application = GetCallerIdentity(*m_applet); + std::vector nacp; + const auto result = + system.GetARPManager().GetControlProperty(&nacp, application.application_id); + + if (R_SUCCEEDED(result)) { + std::memcpy(out_nacp->data(), nacp.data(), (std::min)(nacp.size(), out_nacp->size())); + } + + R_RETURN(result); +} + +Result ILibraryAppletSelfAccessor::GetMainAppletStorageId(Out out_storage_id) { + LOG_INFO(Service_AM, "(STUBBED) called"); + *out_storage_id = FileSys::StorageId::NandUser; + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::ExitProcessAndReturn() { + LOG_INFO(Service_AM, "called"); + + if (const auto caller_applet = m_applet->caller_applet.lock(); caller_applet) { + m_applet->process->Terminate(); + } else { + system.GetUserChannel() = m_applet->user_channel_launch_parameter; + system.ExecuteProgram(0); + } + + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo( + Out out_identity_info) { + LOG_INFO(Service_AM, "called"); + *out_identity_info = GetCallerIdentity(*m_applet); + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack( + Out out_count, OutArray out_identity_info) { + LOG_INFO(Service_AM, "called"); + + std::shared_ptr applet = m_applet; + *out_count = 0; + + do { + if (*out_count >= static_cast(out_identity_info.size())) { + break; + } + out_identity_info[(*out_count)++] = GetCallerIdentity(*applet); + } while ((applet = applet->caller_applet.lock())); + + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout(Out out_desirable_layout) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_desirable_layout = 0; + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::ReportVisibleError(ErrorCode error_code) { + LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category, + error_code.number); + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext( + ErrorCode error_code, InLargeData error_context) { + LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category, + error_code.number); + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::UnpopInData(SharedPointer storage) { + LOG_INFO(Service_AM, "called"); + m_broker->GetInData().Unpop(system.Kernel(), storage); + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage( + Out out_desired_language) { + // FIXME: this is copied from IApplicationFunctions::GetDesiredLanguage + // FIXME: all of this stuff belongs to ns + auto identity = GetCallerIdentity(*m_applet); + + // TODO(bunnei): This should be configurable + LOG_DEBUG(Service_AM, "called"); + + // Get supported languages from NACP, if possible + // Default to 0 (all languages supported) + u32 supported_languages = 0; + + const auto res = FileSys::PatchManager::GetMetadataFromBaseOrUpdate(system, identity.application_id); + + if (res.first != nullptr) { + supported_languages = res.first->GetSupportedLanguages(); + } + + // Call IApplicationManagerInterface implementation. + auto& service_manager = system.ServiceManager(); + auto ns_am2 = service_manager.GetService("ns:am2"); + + std::shared_ptr app_man; + R_TRY(ns_am2->GetApplicationManagerInterface(&app_man)); + + // Get desired application language + NS::ApplicationLanguage desired_language{}; + R_TRY(app_man->GetApplicationDesiredLanguage(&desired_language, supported_languages)); + + // Convert to settings language code. + u64 language_code{}; + R_TRY(app_man->ConvertApplicationLanguageToLanguageCode(&language_code, desired_language)); + + LOG_DEBUG(Service_AM, "got desired_language={:016X}", language_code); + + *out_desired_language = language_code; + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetCurrentApplicationId(Out out_application_id) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + + // TODO: this should be the main applet, not the caller applet + const auto main_applet = GetCallerIdentity(*m_applet); + *out_application_id = main_applet.application_id; + + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers( + Out out_can_select_any_user, Out out_users_count, + OutArray out_users) { + const Service::Account::ProfileManager manager{}; + + *out_can_select_any_user = false; + *out_users_count = -1; + + LOG_INFO(Service_AM, "called"); + + if (manager.GetUserCount() > 0) { + *out_can_select_any_user = true; + *out_users_count = static_cast(manager.GetUserCount()); + + const auto users = manager.GetAllUsers(); + for (size_t i = 0; i < users.size() && i < out_users.size(); i++) { + out_users[i] = users[i]; + } + } + + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually( + Out out_should_set_gpu_time_slice_manually) { + LOG_INFO(Service_AM, "(STUBBED) called"); + *out_should_set_gpu_time_slice_manually = false; + R_SUCCEED(); +} + +Result ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx( + Out out_library_applet_info) { + LOG_INFO(Service_AM, "called"); + *out_library_applet_info = { + .applet_id = m_applet->applet_id, + .library_applet_mode = m_applet->library_applet_mode, + }; + R_SUCCEED(); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.h b/src/core/hle/service/am/service/library_applet_self_accessor.h new file mode 100644 index 0000000000..d287f6b403 --- /dev/null +++ b/src/core/hle/service/am/service/library_applet_self_accessor.h @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "common/uuid.h" +#include "core/hle/service/am/am_types.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace FileSys { +enum class StorageId : u8; +} + +namespace Kernel { +class KReadableEvent; +} + +namespace Service::AM { + +class AppletDataBroker; +struct Applet; +class IStorage; + +struct LibraryAppletInfo { + AppletId applet_id; + LibraryAppletMode library_applet_mode; +}; +static_assert(sizeof(LibraryAppletInfo) == 0x8, "LibraryAppletInfo has incorrect size."); + +struct ErrorCode { + u32 category; + u32 number; +}; +static_assert(sizeof(ErrorCode) == 0x8, "ErrorCode has incorrect size."); + +struct ErrorContext { + u8 type; + INSERT_PADDING_BYTES_NOINIT(0x7); + std::array data; + Result result; +}; +static_assert(sizeof(ErrorContext) == 0x200, "ErrorContext has incorrect size."); + +class ILibraryAppletSelfAccessor final : public ServiceFramework { +public: + explicit ILibraryAppletSelfAccessor(Core::System& system_, std::shared_ptr applet); + ~ILibraryAppletSelfAccessor() override; + +private: + Result PopInData(Out> out_storage); + Result PushOutData(SharedPointer storage); + Result PopInteractiveInData(Out> out_storage); + Result PushInteractiveOutData(SharedPointer storage); + Result GetPopInDataEvent(OutCopyHandle out_event); + Result GetPopInteractiveInDataEvent(OutCopyHandle out_event); + Result GetLibraryAppletInfo(Out out_library_applet_info); + Result GetMainAppletIdentityInfo(Out out_identity_info); + Result CanUseApplicationCore(Out out_can_use_application_core); + Result GetMainAppletApplicationControlProperty( + OutLargeData, BufferAttr_HipcMapAlias> out_nacp); + Result GetMainAppletStorageId(Out out_storage_id); + Result ExitProcessAndReturn(); + Result GetCallerAppletIdentityInfo(Out out_identity_info); + Result GetCallerAppletIdentityInfoStack( + Out out_count, + OutArray out_identity_info); + Result GetDesirableKeyboardLayout(Out out_desirable_layout); + Result ReportVisibleError(ErrorCode error_code); + Result ReportVisibleErrorWithErrorContext( + ErrorCode error_code, InLargeData error_context); + Result UnpopInData(SharedPointer storage); + Result GetMainAppletApplicationDesiredLanguage(Out out_desired_language); + Result GetCurrentApplicationId(Out out_application_id); + Result GetMainAppletAvailableUsers(Out out_can_select_any_user, Out out_users_count, + OutArray out_users); + Result ShouldSetGpuTimeSliceManually(Out out_should_set_gpu_time_slice_manually); + Result GetLibraryAppletInfoEx(Out out_library_applet_info); + + const std::shared_ptr m_applet; + const std::shared_ptr m_broker; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/lock_accessor.cpp b/src/core/hle/service/am/service/lock_accessor.cpp new file mode 100644 index 0000000000..0341254449 --- /dev/null +++ b/src/core/hle/service/am/service/lock_accessor.cpp @@ -0,0 +1,78 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/am/service/lock_accessor.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + +ILockAccessor::ILockAccessor(Core::System& system_) + : ServiceFramework{system_, "ILockAccessor"}, m_context{system_, "ILockAccessor"}, + m_event{m_context} { + // clang-format off + static const FunctionInfo functions[] = { + {1, D<&ILockAccessor::TryLock>, "TryLock"}, + {2, D<&ILockAccessor::Unlock>, "Unlock"}, + {3, D<&ILockAccessor::GetEvent>, "GetEvent"}, + {4, D<&ILockAccessor::IsLocked>, "IsLocked"}, + }; + // clang-format on + + RegisterHandlers(functions); + + m_event.Signal(system.Kernel()); +} + +ILockAccessor::~ILockAccessor() = default; + +Result ILockAccessor::TryLock(Out out_is_locked, + OutCopyHandle out_handle, + bool return_handle) { + LOG_INFO(Service_AM, "called, return_handle={}", return_handle); + + { + std::scoped_lock lk{m_mutex}; + if (m_is_locked) { + *out_is_locked = false; + } else { + m_is_locked = true; + *out_is_locked = true; + } + } + + if (return_handle) { + *out_handle = m_event.GetHandle(); + } + + R_SUCCEED(); +} + +Result ILockAccessor::Unlock() { + LOG_INFO(Service_AM, "called"); + + { + std::scoped_lock lk{m_mutex}; + m_is_locked = false; + } + + m_event.Signal(system.Kernel()); + R_SUCCEED(); +} + +Result ILockAccessor::GetEvent(OutCopyHandle out_handle) { + LOG_INFO(Service_AM, "called"); + *out_handle = m_event.GetHandle(); + R_SUCCEED(); +} + +Result ILockAccessor::IsLocked(Out out_is_locked) { + LOG_INFO(Service_AM, "called"); + std::scoped_lock lk{m_mutex}; + *out_is_locked = m_is_locked; + R_SUCCEED(); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/lock_accessor.h b/src/core/hle/service/am/service/lock_accessor.h new file mode 100644 index 0000000000..fe3f11dcf0 --- /dev/null +++ b/src/core/hle/service/am/service/lock_accessor.h @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/os/event.h" +#include "core/hle/service/service.h" + +namespace Service::AM { + +class ILockAccessor final : public ServiceFramework { +public: + explicit ILockAccessor(Core::System& system_); + ~ILockAccessor() override; + +private: + Result TryLock(Out out_is_locked, OutCopyHandle out_handle, + bool return_handle); + Result Unlock(); + Result GetEvent(OutCopyHandle out_handle); + Result IsLocked(Out out_is_locked); + +private: + KernelHelpers::ServiceContext m_context; + Event m_event; + std::mutex m_mutex{}; + bool m_is_locked{}; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/overlay_applet_proxy.cpp b/src/core/hle/service/am/service/overlay_applet_proxy.cpp new file mode 100644 index 0000000000..735ba9d307 --- /dev/null +++ b/src/core/hle/service/am/service/overlay_applet_proxy.cpp @@ -0,0 +1,120 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "core/hle/service/am/service/common_state_getter.h" +#include "core/hle/service/am/service/display_controller.h" +#include "core/hle/service/am/service/global_state_controller.h" +#include "core/hle/service/am/service/audio_controller.h" +#include "core/hle/service/am/service/applet_common_functions.h" +#include "core/hle/service/am/service/overlay_applet_proxy.h" +#include "core/hle/service/am/service/library_applet_creator.h" +#include "core/hle/service/am/service/process_winding_controller.h" +#include "core/hle/service/am/service/self_controller.h" +#include "core/hle/service/am/service/window_controller.h" +#include "core/hle/service/am/service/debug_functions.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + IOverlayAppletProxy::IOverlayAppletProxy(Core::System &system_, std::shared_ptr applet, + Kernel::KProcess *process, WindowSystem &window_system) + : ServiceFramework{system_, "IOverlayAppletProxy"}, + m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IOverlayAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, + {1, D<&IOverlayAppletProxy::GetSelfController>, "GetSelfController"}, + {2, D<&IOverlayAppletProxy::GetWindowController>, "GetWindowController"}, + {3, D<&IOverlayAppletProxy::GetAudioController>, "GetAudioController"}, + {4, D<&IOverlayAppletProxy::GetDisplayController>, "GetDisplayController"}, + {10, D<&IOverlayAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, + {11, D<&IOverlayAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, + {20, D<&IOverlayAppletProxy::GetOverlayFunctions>, "GetOverlayFunctions"}, + {21, D<&IOverlayAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, + {23, D<&IOverlayAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, + {1000, D<&IOverlayAppletProxy::GetDebugFunctions>, "GetDebugFunctions"}, + }; + // clang-format on + + RegisterHandlers(functions); + } + + IOverlayAppletProxy::~IOverlayAppletProxy() = default; + + Result IOverlayAppletProxy::GetCommonStateGetter( + Out > out_common_state_getter) { + LOG_DEBUG(Service_AM, "called"); + *out_common_state_getter = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetSelfController( + Out > out_self_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_self_controller = std::make_shared(system, m_applet, m_process); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetWindowController( + Out > out_window_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_window_controller = std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetAudioController( + Out > out_audio_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_audio_controller = std::make_shared(system); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetDisplayController( + Out > out_display_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_display_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetProcessWindingController( + Out > out_process_winding_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_process_winding_controller = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetLibraryAppletCreator( + Out > out_library_applet_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_creator = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetOverlayFunctions( + Out > out_overlay_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_overlay_functions = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetAppletCommonFunctions( + Out > out_applet_common_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_applet_common_functions = std::make_shared(system, m_applet); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetGlobalStateController( + Out > out_global_state_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_global_state_controller = std::make_shared(system); + R_SUCCEED(); + } + + Result IOverlayAppletProxy::GetDebugFunctions( + Out > out_debug_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_debug_functions = std::make_shared(system); + R_SUCCEED(); + } +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/overlay_applet_proxy.h b/src/core/hle/service/am/service/overlay_applet_proxy.h new file mode 100644 index 0000000000..6c02166a2d --- /dev/null +++ b/src/core/hle/service/am/service/overlay_applet_proxy.h @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" +#include "core/hle/service/am/service/overlay_functions.h" + +namespace Service::AM { + +struct Applet; +class IAppletCommonFunctions; +class IAudioController; +class ICommonStateGetter; +class IDebugFunctions; +class IDisplayController; +class IHomeMenuFunctions; +class IGlobalStateController; +class ILibraryAppletCreator; +class ILibraryAppletSelfAccessor; +class IProcessWindingController; +class ISelfController; +class IWindowController; +class WindowSystem; + +class IOverlayAppletProxy final : public ServiceFramework { +public: + explicit IOverlayAppletProxy(Core::System& system_, std::shared_ptr applet, + Kernel::KProcess* process, WindowSystem& window_system); + ~IOverlayAppletProxy(); + +private: + Result GetCommonStateGetter(Out> out_common_state_getter); + Result GetSelfController(Out> out_self_controller); + Result GetWindowController(Out> out_window_controller); + Result GetAudioController(Out> out_audio_controller); + Result GetDisplayController(Out> out_display_controller); + Result GetProcessWindingController( + Out> out_process_winding_controller); + Result GetLibraryAppletCreator( + Out> out_library_applet_creator); + Result GetOverlayFunctions(Out> out_overlay_functions); + Result GetAppletCommonFunctions( + Out> out_applet_common_functions); + Result GetGlobalStateController( + Out> out_global_state_controller); + Result GetDebugFunctions(Out> out_debug_functions); + + WindowSystem& m_window_system; + Kernel::KProcess* const m_process; + const std::shared_ptr m_applet; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/overlay_functions.cpp b/src/core/hle/service/am/service/overlay_functions.cpp index 006610bd47..8150b5dd07 100644 --- a/src/core/hle/service/am/service/overlay_functions.cpp +++ b/src/core/hle/service/am/service/overlay_functions.cpp @@ -8,34 +8,34 @@ #include "core/hle/service/am/window_system.h" namespace Service::AM { - std::optional IOverlayFunctions::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IOverlayFunctions::BeginToWatchShortHomeButtonMessage>, "BeginToWatchShortHomeButtonMessage"}, - FunctionInfo{1, D<&IOverlayFunctions::EndToWatchShortHomeButtonMessage>, "EndToWatchShortHomeButtonMessage"}, - FunctionInfo{2, D<&IOverlayFunctions::GetApplicationIdForLogo>, "GetApplicationIdForLogo"}, - FunctionInfo{3, nullptr, "SetGpuTimeSliceBoost"}, - FunctionInfo{4, D<&IOverlayFunctions::SetAutoSleepTimeAndDimmingTimeEnabled>, "SetAutoSleepTimeAndDimmingTimeEnabled"}, - FunctionInfo{5, nullptr, "TerminateApplicationAndSetReason"}, - FunctionInfo{6, nullptr, "SetScreenShotPermissionGlobally"}, - FunctionInfo{10, nullptr, "StartShutdownSequenceForOverlay"}, - FunctionInfo{11, nullptr, "StartRebootSequenceForOverlay"}, - FunctionInfo{20, D<&IOverlayFunctions::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"}, - FunctionInfo{21, D<&IOverlayFunctions::SetHandlingTouchScreenInputEnabled>, "SetHandlingTouchScreenInputEnabled"}, - FunctionInfo{30, nullptr, "SetHealthWarningShowingState"}, - FunctionInfo{31, D<&IOverlayFunctions::IsHealthWarningRequired>, "IsHealthWarningRequired"}, - FunctionInfo{40, nullptr, "GetApplicationNintendoLogo"}, - FunctionInfo{41, nullptr, "GetApplicationStartupMovie"}, - FunctionInfo{50, nullptr, "SetGpuTimeSliceBoostForApplication"}, - FunctionInfo{60, nullptr, "Unknown60"}, - FunctionInfo{70, D<&IOverlayFunctions::Unknown70>, "Unknown70"}, - FunctionInfo{90, nullptr, "SetRequiresGpuResourceUse"}, - FunctionInfo{101, nullptr, "BeginToObserveHidInputForDevelop"} - ); - return HandlerTableGenerateWithFind(key, functions); - } - IOverlayFunctions::IOverlayFunctions(Core::System &system_, std::shared_ptr applet) : ServiceFramework{system_, "IOverlayFunctions"}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IOverlayFunctions::BeginToWatchShortHomeButtonMessage>, "BeginToWatchShortHomeButtonMessage"}, + {1, D<&IOverlayFunctions::EndToWatchShortHomeButtonMessage>, "EndToWatchShortHomeButtonMessage"}, + {2, D<&IOverlayFunctions::GetApplicationIdForLogo>, "GetApplicationIdForLogo"}, + {3, nullptr, "SetGpuTimeSliceBoost"}, + {4, D<&IOverlayFunctions::SetAutoSleepTimeAndDimmingTimeEnabled>, "SetAutoSleepTimeAndDimmingTimeEnabled"}, + {5, nullptr, "TerminateApplicationAndSetReason"}, + {6, nullptr, "SetScreenShotPermissionGlobally"}, + {10, nullptr, "StartShutdownSequenceForOverlay"}, + {11, nullptr, "StartRebootSequenceForOverlay"}, + {20, D<&IOverlayFunctions::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"}, + {21, D<&IOverlayFunctions::SetHandlingTouchScreenInputEnabled>, "SetHandlingTouchScreenInputEnabled"}, + {30, nullptr, "SetHealthWarningShowingState"}, + {31, D<&IOverlayFunctions::IsHealthWarningRequired>, "IsHealthWarningRequired"}, + {40, nullptr, "GetApplicationNintendoLogo"}, + {41, nullptr, "GetApplicationStartupMovie"}, + {50, nullptr, "SetGpuTimeSliceBoostForApplication"}, + {60, nullptr, "Unknown60"}, + {70, D<&IOverlayFunctions::Unknown70>, "Unknown70"}, + {90, nullptr, "SetRequiresGpuResourceUse"}, + {101, nullptr, "BeginToObserveHidInputForDevelop"}, + }; + // clang-format on + + RegisterHandlers(functions); } IOverlayFunctions::~IOverlayFunctions() = default; diff --git a/src/core/hle/service/am/service/overlay_functions.h b/src/core/hle/service/am/service/overlay_functions.h index b94f0cc0d5..eefd8d862b 100644 --- a/src/core/hle/service/am/service/overlay_functions.h +++ b/src/core/hle/service/am/service/overlay_functions.h @@ -6,25 +6,24 @@ #include "core/hle/service/service.h" namespace Service::AM { -struct Applet; + struct Applet; -class IOverlayFunctions final : public ServiceFramework { -public: - explicit IOverlayFunctions(Core::System &system_, std::shared_ptr applet); - ~IOverlayFunctions() override; + class IOverlayFunctions final : public ServiceFramework { + public: + explicit IOverlayFunctions(Core::System &system_, std::shared_ptr applet); + ~IOverlayFunctions() override; -private: - Result BeginToWatchShortHomeButtonMessage(); - Result EndToWatchShortHomeButtonMessage(); - Result GetApplicationIdForLogo(Out out_application_id); - Result SetAutoSleepTimeAndDimmingTimeEnabled(bool enabled); - Result IsHealthWarningRequired(Out is_required); - Result SetHandlingHomeButtonShortPressedEnabled(bool enabled); - Result SetHandlingTouchScreenInputEnabled(bool enabled); - Result Unknown70(); + private: + Result BeginToWatchShortHomeButtonMessage(); + Result EndToWatchShortHomeButtonMessage(); + Result GetApplicationIdForLogo(Out out_application_id); + Result SetAutoSleepTimeAndDimmingTimeEnabled(bool enabled); + Result IsHealthWarningRequired(Out is_required); + Result SetHandlingHomeButtonShortPressedEnabled(bool enabled); + Result SetHandlingTouchScreenInputEnabled(bool enabled); + Result Unknown70(); -private: - std::optional FindRequest(u32 key) override; - const std::shared_ptr m_applet; -}; + private: + const std::shared_ptr m_applet; + }; } // namespace Service::AM diff --git a/src/core/hle/service/am/service/process_winding_controller.cpp b/src/core/hle/service/am/service/process_winding_controller.cpp index 159f4dfd5c..e284aa2d89 100644 --- a/src/core/hle/service/am/service/process_winding_controller.cpp +++ b/src/core/hle/service/am/service/process_winding_controller.cpp @@ -13,23 +13,23 @@ namespace Service::AM { - std::optional IProcessWindingController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"}, - FunctionInfo{11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"}, - FunctionInfo{21, D<&IProcessWindingController::PushContext>, "PushContext"}, - FunctionInfo{22, D<&IProcessWindingController::PopContext>, "PopContext"}, - FunctionInfo{23, D<&IProcessWindingController::CancelWindingReservation>, "CancelWindingReservation"}, - FunctionInfo{30, D<&IProcessWindingController::WindAndDoReserved>, "WindAndDoReserved"}, - FunctionInfo{40, D<&IProcessWindingController::ReserveToStartAndWaitAndUnwindThis>, "ReserveToStartAndWaitAndUnwindThis"}, - FunctionInfo{41, D<&IProcessWindingController::ReserveToStartAndWait>, "ReserveToStartAndWait"} - ); - return HandlerTableGenerateWithFind(key, functions); - } - IProcessWindingController::IProcessWindingController(Core::System& system_, std::shared_ptr applet) : ServiceFramework{system_, "IProcessWindingController"}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"}, + {11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"}, + {21, D<&IProcessWindingController::PushContext>, "PushContext"}, + {22, D<&IProcessWindingController::PopContext>, "PopContext"}, + {23, D<&IProcessWindingController::CancelWindingReservation>, "CancelWindingReservation"}, + {30, D<&IProcessWindingController::WindAndDoReserved>, "WindAndDoReserved"}, + {40, D<&IProcessWindingController::ReserveToStartAndWaitAndUnwindThis>, "ReserveToStartAndWaitAndUnwindThis"}, + {41, D<&IProcessWindingController::ReserveToStartAndWait>, "ReserveToStartAndWait"}, + }; + // clang-format on + + RegisterHandlers(functions); } IProcessWindingController::~IProcessWindingController() = default; diff --git a/src/core/hle/service/am/service/process_winding_controller.h b/src/core/hle/service/am/service/process_winding_controller.h index 91b29ac04b..f3417bcd97 100644 --- a/src/core/hle/service/am/service/process_winding_controller.h +++ b/src/core/hle/service/am/service/process_winding_controller.h @@ -33,7 +33,6 @@ private: SharedPointer reserved_applet_accessor); Result ReserveToStartAndWait(SharedPointer reserved_applet_accessor); - std::optional FindRequest(u32 key) override; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/self_controller.cpp b/src/core/hle/service/am/service/self_controller.cpp index ce8a308d6a..3a654b9daa 100644 --- a/src/core/hle/service/am/service/self_controller.cpp +++ b/src/core/hle/service/am/service/self_controller.cpp @@ -17,66 +17,67 @@ namespace Service::AM { - std::optional ISelfController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ISelfController::Exit>, "Exit"}, - FunctionInfo{1, D<&ISelfController::LockExit>, "LockExit"}, - FunctionInfo{2, D<&ISelfController::UnlockExit>, "UnlockExit"}, - FunctionInfo{3, D<&ISelfController::EnterFatalSection>, "EnterFatalSection"}, - FunctionInfo{4, D<&ISelfController::LeaveFatalSection>, "LeaveFatalSection"}, - FunctionInfo{9, D<&ISelfController::GetLibraryAppletLaunchableEvent>, "GetLibraryAppletLaunchableEvent"}, - FunctionInfo{10, D<&ISelfController::SetScreenShotPermission>, "SetScreenShotPermission"}, - FunctionInfo{11, D<&ISelfController::SetOperationModeChangedNotification>, "SetOperationModeChangedNotification"}, - FunctionInfo{12, D<&ISelfController::SetPerformanceModeChangedNotification>, "SetPerformanceModeChangedNotification"}, - FunctionInfo{13, D<&ISelfController::SetFocusHandlingMode>, "SetFocusHandlingMode"}, - FunctionInfo{14, D<&ISelfController::SetRestartMessageEnabled>, "SetRestartMessageEnabled"}, - FunctionInfo{15, D<&ISelfController::SetScreenShotAppletIdentityInfo>, "SetScreenShotAppletIdentityInfo"}, - FunctionInfo{16, D<&ISelfController::SetOutOfFocusSuspendingEnabled>, "SetOutOfFocusSuspendingEnabled"}, - FunctionInfo{17, nullptr, "SetControllerFirmwareUpdateSection"}, - FunctionInfo{18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"}, - FunctionInfo{19, D<&ISelfController::SetAlbumImageOrientation>, "SetAlbumImageOrientation"}, - FunctionInfo{20, nullptr, "SetDesirableKeyboardLayout"}, - FunctionInfo{21, nullptr, "GetScreenShotProgramId"}, - FunctionInfo{40, D<&ISelfController::CreateManagedDisplayLayer>, "CreateManagedDisplayLayer"}, - FunctionInfo{41, D<&ISelfController::IsSystemBufferSharingEnabled>, "IsSystemBufferSharingEnabled"}, - FunctionInfo{42, D<&ISelfController::GetSystemSharedLayerHandle>, "GetSystemSharedLayerHandle"}, - FunctionInfo{43, D<&ISelfController::GetSystemSharedBufferHandle>, "GetSystemSharedBufferHandle"}, - FunctionInfo{44, D<&ISelfController::CreateManagedDisplaySeparableLayer>, "CreateManagedDisplaySeparableLayer"}, - FunctionInfo{45, nullptr, "SetManagedDisplayLayerSeparationMode"}, - FunctionInfo{46, nullptr, "SetRecordingLayerCompositionEnabled"}, - FunctionInfo{50, D<&ISelfController::SetHandlesRequestToDisplay>, "SetHandlesRequestToDisplay"}, - FunctionInfo{51, D<&ISelfController::ApproveToDisplay>, "ApproveToDisplay"}, - FunctionInfo{60, D<&ISelfController::OverrideAutoSleepTimeAndDimmingTime>, "OverrideAutoSleepTimeAndDimmingTime"}, - FunctionInfo{61, D<&ISelfController::SetMediaPlaybackState>, "SetMediaPlaybackState"}, - FunctionInfo{62, D<&ISelfController::SetIdleTimeDetectionExtension>, "SetIdleTimeDetectionExtension"}, - FunctionInfo{63, D<&ISelfController::GetIdleTimeDetectionExtension>, "GetIdleTimeDetectionExtension"}, - FunctionInfo{64, nullptr, "SetInputDetectionSourceSet"}, - FunctionInfo{65, D<&ISelfController::ReportUserIsActive>, "ReportUserIsActive"}, - FunctionInfo{66, nullptr, "GetCurrentIlluminance"}, - FunctionInfo{67, D<&ISelfController::IsIlluminanceAvailable>, "IsIlluminanceAvailable"}, - FunctionInfo{68, D<&ISelfController::SetAutoSleepDisabled>, "SetAutoSleepDisabled"}, - FunctionInfo{69, D<&ISelfController::IsAutoSleepDisabled>, "IsAutoSleepDisabled"}, - FunctionInfo{70, nullptr, "ReportMultimediaError"}, - FunctionInfo{71, nullptr, "GetCurrentIlluminanceEx"}, - FunctionInfo{72, D<&ISelfController::SetInputDetectionPolicy>, "SetInputDetectionPolicy"}, - FunctionInfo{80, nullptr, "SetWirelessPriorityMode"}, - FunctionInfo{90, D<&ISelfController::GetAccumulatedSuspendedTickValue>, "GetAccumulatedSuspendedTickValue"}, - FunctionInfo{91, D<&ISelfController::GetAccumulatedSuspendedTickChangedEvent>, "GetAccumulatedSuspendedTickChangedEvent"}, - FunctionInfo{100, D<&ISelfController::SetAlbumImageTakenNotificationEnabled>, "SetAlbumImageTakenNotificationEnabled"}, - FunctionInfo{110, nullptr, "SetApplicationAlbumUserData"}, - FunctionInfo{120, D<&ISelfController::SaveCurrentScreenshot>, "SaveCurrentScreenshot"}, - FunctionInfo{130, D<&ISelfController::SetRecordVolumeMuted>, "SetRecordVolumeMuted"}, - FunctionInfo{230, D<&ISelfController::Unknown230>, "Unknown230"}, - FunctionInfo{240, D<&ISelfController::Unknown240>, "Unknown240"}, - FunctionInfo{1000, nullptr, "GetDebugStorageChannel"} - ); - return HandlerTableGenerateWithFind(key, functions); - } - ISelfController::ISelfController(Core::System& system_, std::shared_ptr applet, Kernel::KProcess* process) : ServiceFramework{system_, "ISelfController"}, m_process{process}, m_applet{ std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ISelfController::Exit>, "Exit"}, + {1, D<&ISelfController::LockExit>, "LockExit"}, + {2, D<&ISelfController::UnlockExit>, "UnlockExit"}, + {3, D<&ISelfController::EnterFatalSection>, "EnterFatalSection"}, + {4, D<&ISelfController::LeaveFatalSection>, "LeaveFatalSection"}, + {9, D<&ISelfController::GetLibraryAppletLaunchableEvent>, "GetLibraryAppletLaunchableEvent"}, + {10, D<&ISelfController::SetScreenShotPermission>, "SetScreenShotPermission"}, + {11, D<&ISelfController::SetOperationModeChangedNotification>, "SetOperationModeChangedNotification"}, + {12, D<&ISelfController::SetPerformanceModeChangedNotification>, "SetPerformanceModeChangedNotification"}, + {13, D<&ISelfController::SetFocusHandlingMode>, "SetFocusHandlingMode"}, + {14, D<&ISelfController::SetRestartMessageEnabled>, "SetRestartMessageEnabled"}, + {15, D<&ISelfController::SetScreenShotAppletIdentityInfo>, "SetScreenShotAppletIdentityInfo"}, + {16, D<&ISelfController::SetOutOfFocusSuspendingEnabled>, "SetOutOfFocusSuspendingEnabled"}, + {17, nullptr, "SetControllerFirmwareUpdateSection"}, + {18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"}, + {19, D<&ISelfController::SetAlbumImageOrientation>, "SetAlbumImageOrientation"}, + {20, nullptr, "SetDesirableKeyboardLayout"}, + {21, nullptr, "GetScreenShotProgramId"}, + {40, D<&ISelfController::CreateManagedDisplayLayer>, "CreateManagedDisplayLayer"}, + {41, D<&ISelfController::IsSystemBufferSharingEnabled>, "IsSystemBufferSharingEnabled"}, + {42, D<&ISelfController::GetSystemSharedLayerHandle>, "GetSystemSharedLayerHandle"}, + {43, D<&ISelfController::GetSystemSharedBufferHandle>, "GetSystemSharedBufferHandle"}, + {44, D<&ISelfController::CreateManagedDisplaySeparableLayer>, "CreateManagedDisplaySeparableLayer"}, + {45, nullptr, "SetManagedDisplayLayerSeparationMode"}, + {46, nullptr, "SetRecordingLayerCompositionEnabled"}, + {50, D<&ISelfController::SetHandlesRequestToDisplay>, "SetHandlesRequestToDisplay"}, + {51, D<&ISelfController::ApproveToDisplay>, "ApproveToDisplay"}, + {60, D<&ISelfController::OverrideAutoSleepTimeAndDimmingTime>, "OverrideAutoSleepTimeAndDimmingTime"}, + {61, D<&ISelfController::SetMediaPlaybackState>, "SetMediaPlaybackState"}, + {62, D<&ISelfController::SetIdleTimeDetectionExtension>, "SetIdleTimeDetectionExtension"}, + {63, D<&ISelfController::GetIdleTimeDetectionExtension>, "GetIdleTimeDetectionExtension"}, + {64, nullptr, "SetInputDetectionSourceSet"}, + {65, D<&ISelfController::ReportUserIsActive>, "ReportUserIsActive"}, + {66, nullptr, "GetCurrentIlluminance"}, + {67, D<&ISelfController::IsIlluminanceAvailable>, "IsIlluminanceAvailable"}, + {68, D<&ISelfController::SetAutoSleepDisabled>, "SetAutoSleepDisabled"}, + {69, D<&ISelfController::IsAutoSleepDisabled>, "IsAutoSleepDisabled"}, + {70, nullptr, "ReportMultimediaError"}, + {71, nullptr, "GetCurrentIlluminanceEx"}, + {72, D<&ISelfController::SetInputDetectionPolicy>, "SetInputDetectionPolicy"}, + {80, nullptr, "SetWirelessPriorityMode"}, + {90, D<&ISelfController::GetAccumulatedSuspendedTickValue>, "GetAccumulatedSuspendedTickValue"}, + {91, D<&ISelfController::GetAccumulatedSuspendedTickChangedEvent>, "GetAccumulatedSuspendedTickChangedEvent"}, + {100, D<&ISelfController::SetAlbumImageTakenNotificationEnabled>, "SetAlbumImageTakenNotificationEnabled"}, + {110, nullptr, "SetApplicationAlbumUserData"}, + {120, D<&ISelfController::SaveCurrentScreenshot>, "SaveCurrentScreenshot"}, + {130, D<&ISelfController::SetRecordVolumeMuted>, "SetRecordVolumeMuted"}, + {230, D<&ISelfController::Unknown230>, "Unknown230"}, + {240, D<&ISelfController::Unknown240>, "Unknown240"}, + {1000, nullptr, "GetDebugStorageChannel"}, + }; + // clang-format on + + RegisterHandlers(functions); + std::scoped_lock lk{m_applet->lock}; m_applet->display_layer_manager.Initialize(system, m_process, m_applet->applet_id, m_applet->library_applet_mode); diff --git a/src/core/hle/service/am/service/self_controller.h b/src/core/hle/service/am/service/self_controller.h index ce77769da2..c9f480f575 100644 --- a/src/core/hle/service/am/service/self_controller.h +++ b/src/core/hle/service/am/service/self_controller.h @@ -70,7 +70,6 @@ private: Result Unknown230(u32 in_val, Out out_val); Result Unknown240(u32 in_val); - std::optional FindRequest(u32 key) override; Kernel::KProcess* const m_process; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/am/service/storage.cpp b/src/core/hle/service/am/service/storage.cpp index 110a9f5a42..5fe191bf2f 100644 --- a/src/core/hle/service/am/service/storage.cpp +++ b/src/core/hle/service/am/service/storage.cpp @@ -4,86 +4,22 @@ // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "core/hle/kernel/k_transfer_memory.h" #include "core/hle/service/am/am_results.h" #include "core/hle/service/am/library_applet_storage.h" #include "core/hle/service/am/service/storage.h" +#include "core/hle/service/am/service/storage_accessor.h" #include "core/hle/service/cmif_serialization.h" namespace Service::AM { -class IStorageAccessor final : public ServiceFramework { -public: - explicit IStorageAccessor(Core::System& system_, std::shared_ptr impl) : ServiceFramework{system_, "IStorageAccessor"}, m_impl{std::move(impl)} {} - ~IStorageAccessor() override = default; - - Result GetSize(Out out_size) { - LOG_DEBUG(Service_AM, "called"); - *out_size = m_impl->GetSize(); - R_SUCCEED(); - } - - Result Write(InBuffer buffer, s64 offset) { - LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, buffer.size()); - R_RETURN(m_impl->Write(offset, buffer.data(), buffer.size())); - } - - Result Read(OutBuffer out_buffer, s64 offset) { - LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, out_buffer.size()); - R_RETURN(m_impl->Read(offset, out_buffer.data(), out_buffer.size())); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IStorageAccessor::GetSize>, "GetSize"}, - FunctionInfo{10, D<&IStorageAccessor::Write>, "Write"}, - FunctionInfo{11, D<&IStorageAccessor::Read>, "Read"} - ); - - const std::shared_ptr m_impl; -}; - -class ITransferStorageAccessor final : public ServiceFramework { -public: - explicit ITransferStorageAccessor(Core::System& system_, std::shared_ptr impl) : ServiceFramework{system_, "ITransferStorageAccessor"}, m_impl{std::move(impl)} {} - ~ITransferStorageAccessor() override = default; - - Result GetSize(Out out_size) { - LOG_DEBUG(Service_AM, "called"); - *out_size = m_impl->GetSize(); - R_SUCCEED(); - } - - Result GetHandle(Out out_size, OutCopyHandle out_handle) { - LOG_INFO(Service_AM, "called"); - *out_size = m_impl->GetSize(); - *out_handle = m_impl->GetHandle(); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ITransferStorageAccessor::GetSize>, "GetSize"}, - FunctionInfo{1, D<&ITransferStorageAccessor::GetHandle>, "GetHandle"} - ); - - const std::shared_ptr m_impl; -}; - -std::optional IStorage::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IStorage::Open>, "Open"}, - FunctionInfo{1, D<&IStorage::OpenTransferStorage>, "OpenTransferStorage"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IStorage::IStorage(Core::System& system_, std::shared_ptr impl) : ServiceFramework{system_, "IStorage"}, m_impl{std::move(impl)} { + static const FunctionInfo functions[] = { + {0, D<&IStorage::Open>, "Open"}, + {1, D<&IStorage::OpenTransferStorage>, "OpenTransferStorage"}, + }; + + RegisterHandlers(functions); } IStorage::IStorage(Core::System& system_, std::vector&& data) diff --git a/src/core/hle/service/am/service/storage.h b/src/core/hle/service/am/service/storage.h index 63b7a0ad4c..462c823206 100644 --- a/src/core/hle/service/am/service/storage.h +++ b/src/core/hle/service/am/service/storage.h @@ -32,7 +32,6 @@ private: Result OpenTransferStorage( Out> out_transfer_storage_accessor); - std::optional FindRequest(u32 key) override; const std::shared_ptr m_impl; }; diff --git a/src/core/hle/service/am/service/storage_accessor.cpp b/src/core/hle/service/am/service/storage_accessor.cpp new file mode 100644 index 0000000000..2fe379a74d --- /dev/null +++ b/src/core/hle/service/am/service/storage_accessor.cpp @@ -0,0 +1,71 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/kernel/k_transfer_memory.h" +#include "core/hle/service/am/library_applet_storage.h" +#include "core/hle/service/am/service/storage_accessor.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + +IStorageAccessor::IStorageAccessor(Core::System& system_, + std::shared_ptr impl) + : ServiceFramework{system_, "IStorageAccessor"}, m_impl{std::move(impl)} { + static const FunctionInfo functions[] = { + {0, D<&IStorageAccessor::GetSize>, "GetSize"}, + {10, D<&IStorageAccessor::Write>, "Write"}, + {11, D<&IStorageAccessor::Read>, "Read"}, + }; + + RegisterHandlers(functions); +} + +IStorageAccessor::~IStorageAccessor() = default; + +Result IStorageAccessor::GetSize(Out out_size) { + LOG_DEBUG(Service_AM, "called"); + *out_size = m_impl->GetSize(); + R_SUCCEED(); +} + +Result IStorageAccessor::Write(InBuffer buffer, s64 offset) { + LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, buffer.size()); + R_RETURN(m_impl->Write(offset, buffer.data(), buffer.size())); +} + +Result IStorageAccessor::Read(OutBuffer out_buffer, s64 offset) { + LOG_DEBUG(Service_AM, "called, offset={} size={}", offset, out_buffer.size()); + R_RETURN(m_impl->Read(offset, out_buffer.data(), out_buffer.size())); +} + +ITransferStorageAccessor::ITransferStorageAccessor(Core::System& system_, + std::shared_ptr impl) + : ServiceFramework{system_, "ITransferStorageAccessor"}, m_impl{std::move(impl)} { + static const FunctionInfo functions[] = { + {0, D<&ITransferStorageAccessor::GetSize>, "GetSize"}, + {1, D<&ITransferStorageAccessor::GetHandle>, "GetHandle"}, + }; + + RegisterHandlers(functions); +} + +ITransferStorageAccessor::~ITransferStorageAccessor() = default; + +Result ITransferStorageAccessor::GetSize(Out out_size) { + LOG_DEBUG(Service_AM, "called"); + *out_size = m_impl->GetSize(); + R_SUCCEED(); +} + +Result ITransferStorageAccessor::GetHandle(Out out_size, + OutCopyHandle out_handle) { + LOG_INFO(Service_AM, "called"); + *out_size = m_impl->GetSize(); + *out_handle = m_impl->GetHandle(); + R_SUCCEED(); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/storage_accessor.h b/src/core/hle/service/am/service/storage_accessor.h new file mode 100644 index 0000000000..76af3de363 --- /dev/null +++ b/src/core/hle/service/am/service/storage_accessor.h @@ -0,0 +1,41 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/am/library_applet_storage.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::AM { + +class IStorageAccessor final : public ServiceFramework { +public: + explicit IStorageAccessor(Core::System& system_, std::shared_ptr impl); + ~IStorageAccessor() override; + +private: + Result GetSize(Out out_size); + Result Write(InBuffer buffer, s64 offset); + Result Read(OutBuffer out_buffer, s64 offset); + + const std::shared_ptr m_impl; +}; + +class ITransferStorageAccessor final : public ServiceFramework { +public: + explicit ITransferStorageAccessor(Core::System& system_, + std::shared_ptr impl); + ~ITransferStorageAccessor() override; + +private: + Result GetSize(Out out_size); + Result GetHandle(Out out_size, OutCopyHandle out_handle); + + const std::shared_ptr m_impl; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/system_applet_proxy.cpp b/src/core/hle/service/am/service/system_applet_proxy.cpp new file mode 100644 index 0000000000..bb56750d09 --- /dev/null +++ b/src/core/hle/service/am/service/system_applet_proxy.cpp @@ -0,0 +1,136 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/am/service/applet_common_functions.h" +#include "core/hle/service/am/service/application_creator.h" +#include "core/hle/service/am/service/audio_controller.h" +#include "core/hle/service/am/service/common_state_getter.h" +#include "core/hle/service/am/service/debug_functions.h" +#include "core/hle/service/am/service/display_controller.h" +#include "core/hle/service/am/service/global_state_controller.h" +#include "core/hle/service/am/service/home_menu_functions.h" +#include "core/hle/service/am/service/library_applet_creator.h" +#include "core/hle/service/am/service/process_winding_controller.h" +#include "core/hle/service/am/service/self_controller.h" +#include "core/hle/service/am/service/system_applet_proxy.h" +#include "core/hle/service/am/service/window_controller.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + +ISystemAppletProxy::ISystemAppletProxy(Core::System& system_, std::shared_ptr applet, + Kernel::KProcess* process, WindowSystem& window_system) + : ServiceFramework{system_, "ISystemAppletProxy"}, + m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ISystemAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"}, + {1, D<&ISystemAppletProxy::GetSelfController>, "GetSelfController"}, + {2, D<&ISystemAppletProxy::GetWindowController>, "GetWindowController"}, + {3, D<&ISystemAppletProxy::GetAudioController>, "GetAudioController"}, + {4, D<&ISystemAppletProxy::GetDisplayController>, "GetDisplayController"}, + {10, D<&ISystemAppletProxy::GetProcessWindingController>, "GetProcessWindingController"}, + {11, D<&ISystemAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"}, + {20, D<&ISystemAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"}, + {21, D<&ISystemAppletProxy::GetGlobalStateController>, "GetGlobalStateController"}, + {22, D<&ISystemAppletProxy::GetApplicationCreator>, "GetApplicationCreator"}, + {23, D<&ISystemAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"}, + {1000, D<&ISystemAppletProxy::GetDebugFunctions>, "GetDebugFunctions"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +ISystemAppletProxy::~ISystemAppletProxy() = default; + +Result ISystemAppletProxy::GetAudioController( + Out> out_audio_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_audio_controller = std::make_shared(system); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetDisplayController( + Out> out_display_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_display_controller = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetProcessWindingController( + Out> out_process_winding_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_process_winding_controller = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetDebugFunctions( + Out> out_debug_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_debug_functions = std::make_shared(system); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetWindowController( + Out> out_window_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_window_controller = std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetSelfController( + Out> out_self_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_self_controller = std::make_shared(system, m_applet, m_process); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetCommonStateGetter( + Out> out_common_state_getter) { + LOG_DEBUG(Service_AM, "called"); + *out_common_state_getter = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetLibraryAppletCreator( + Out> out_library_applet_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_library_applet_creator = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetApplicationCreator( + Out> out_application_creator) { + LOG_DEBUG(Service_AM, "called"); + *out_application_creator = std::make_shared(system, m_window_system); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetAppletCommonFunctions( + Out> out_applet_common_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_applet_common_functions = std::make_shared(system, m_applet); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetHomeMenuFunctions( + Out> out_home_menu_functions) { + LOG_DEBUG(Service_AM, "called"); + *out_home_menu_functions = + std::make_shared(system, m_applet, m_window_system); + R_SUCCEED(); +} + +Result ISystemAppletProxy::GetGlobalStateController( + Out> out_global_state_controller) { + LOG_DEBUG(Service_AM, "called"); + *out_global_state_controller = std::make_shared(system); + R_SUCCEED(); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/system_applet_proxy.h b/src/core/hle/service/am/service/system_applet_proxy.h new file mode 100644 index 0000000000..76cef507a5 --- /dev/null +++ b/src/core/hle/service/am/service/system_applet_proxy.h @@ -0,0 +1,58 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::AM { + +struct Applet; +class IAppletCommonFunctions; +class IApplicationCreator; +class IAudioController; +class ICommonStateGetter; +class IDebugFunctions; +class IDisplayController; +class IHomeMenuFunctions; +class IGlobalStateController; +class ILibraryAppletCreator; +class IProcessWindingController; +class ISelfController; +class IWindowController; +class WindowSystem; + +class ISystemAppletProxy final : public ServiceFramework { +public: + explicit ISystemAppletProxy(Core::System& system, std::shared_ptr applet, + Kernel::KProcess* process, WindowSystem& window_system); + ~ISystemAppletProxy(); + +private: + Result GetCommonStateGetter(Out> out_common_state_getter); + Result GetSelfController(Out> out_self_controller); + Result GetWindowController(Out> out_window_controller); + Result GetAudioController(Out> out_audio_controller); + Result GetDisplayController(Out> out_display_controller); + Result GetProcessWindingController( + Out> out_process_winding_controller); + Result GetDebugFunctions(Out> out_debug_functions); + Result GetLibraryAppletCreator( + Out> out_library_applet_creator); + Result GetApplicationCreator(Out> out_application_creator); + Result GetAppletCommonFunctions( + Out> out_applet_common_functions); + Result GetHomeMenuFunctions(Out> out_home_menu_functions); + Result GetGlobalStateController( + Out> out_global_state_controller); + + WindowSystem& m_window_system; + Kernel::KProcess* const m_process; + const std::shared_ptr m_applet; +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/window_controller.cpp b/src/core/hle/service/am/service/window_controller.cpp index d07aba0c79..f2b9dccb27 100644 --- a/src/core/hle/service/am/service/window_controller.cpp +++ b/src/core/hle/service/am/service/window_controller.cpp @@ -12,24 +12,24 @@ namespace Service::AM { -std::optional IWindowController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateWindow"}, - FunctionInfo{1, D<&IWindowController::GetAppletResourceUserId>, "GetAppletResourceUserId"}, - FunctionInfo{2, D<&IWindowController::GetAppletResourceUserIdOfCallerApplet>, "GetAppletResourceUserIdOfCallerApplet"}, - FunctionInfo{10, D<&IWindowController::AcquireForegroundRights>, "AcquireForegroundRights"}, - FunctionInfo{11, D<&IWindowController::ReleaseForegroundRights>, "ReleaseForegroundRights"}, - FunctionInfo{12, D<&IWindowController::RejectToChangeIntoBackground>, "RejectToChangeIntoBackground"}, - FunctionInfo{20, D<&IWindowController::SetAppletWindowVisibility>, "SetAppletWindowVisibility"}, - FunctionInfo{21, D<&IWindowController::SetAppletGpuTimeSlice>, "SetAppletGpuTimeSlice"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IWindowController::IWindowController(Core::System& system_, std::shared_ptr applet, WindowSystem& window_system) : ServiceFramework{system_, "IWindowController"}, m_window_system{window_system}, m_applet{std::move(applet)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateWindow"}, + {1, D<&IWindowController::GetAppletResourceUserId>, "GetAppletResourceUserId"}, + {2, D<&IWindowController::GetAppletResourceUserIdOfCallerApplet>, "GetAppletResourceUserIdOfCallerApplet"}, + {10, D<&IWindowController::AcquireForegroundRights>, "AcquireForegroundRights"}, + {11, D<&IWindowController::ReleaseForegroundRights>, "ReleaseForegroundRights"}, + {12, D<&IWindowController::RejectToChangeIntoBackground>, "RejectToChangeIntoBackground"}, + {20, D<&IWindowController::SetAppletWindowVisibility>, "SetAppletWindowVisibility"}, + {21, D<&IWindowController::SetAppletGpuTimeSlice>, "SetAppletGpuTimeSlice"}, + }; + // clang-format on + + RegisterHandlers(functions); } IWindowController::~IWindowController() = default; diff --git a/src/core/hle/service/am/service/window_controller.h b/src/core/hle/service/am/service/window_controller.h index 29fd723421..51a67f3039 100644 --- a/src/core/hle/service/am/service/window_controller.h +++ b/src/core/hle/service/am/service/window_controller.h @@ -29,7 +29,6 @@ private: Result SetAppletWindowVisibility(bool visible); Result SetAppletGpuTimeSlice(s64 time_slice); - std::optional FindRequest(u32 key) override; WindowSystem& m_window_system; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/aoc/addon_content_manager.cpp b/src/core/hle/service/aoc/addon_content_manager.cpp index 0222d9c52b..be2aa34baa 100644 --- a/src/core/hle/service/aoc/addon_content_manager.cpp +++ b/src/core/hle/service/aoc/addon_content_manager.cpp @@ -28,34 +28,6 @@ namespace Service::AOC { -std::optional IAddOnContentManager::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CountAddOnContentByApplicationId"}, - FunctionInfo{1, nullptr, "ListAddOnContentByApplicationId"}, - FunctionInfo{2, D<&IAddOnContentManager::CountAddOnContent>, "CountAddOnContent"}, - FunctionInfo{3, D<&IAddOnContentManager::ListAddOnContent>, "ListAddOnContent"}, - FunctionInfo{4, nullptr, "GetAddOnContentBaseIdByApplicationId"}, - FunctionInfo{5, D<&IAddOnContentManager::GetAddOnContentBaseId>, "GetAddOnContentBaseId"}, - FunctionInfo{6, nullptr, "PrepareAddOnContentByApplicationId"}, - FunctionInfo{7, D<&IAddOnContentManager::PrepareAddOnContent>, "PrepareAddOnContent"}, - FunctionInfo{8, D<&IAddOnContentManager::GetAddOnContentListChangedEvent>, "GetAddOnContentListChangedEvent"}, - FunctionInfo{9, nullptr, "GetAddOnContentLostErrorCode"}, - FunctionInfo{10, D<&IAddOnContentManager::GetAddOnContentListChangedEventWithProcessId>, "GetAddOnContentListChangedEventWithProcessId"}, - FunctionInfo{11, D<&IAddOnContentManager::NotifyMountAddOnContent>, "NotifyMountAddOnContent"}, - FunctionInfo{12, D<&IAddOnContentManager::NotifyUnmountAddOnContent>, "NotifyUnmountAddOnContent"}, - FunctionInfo{13, nullptr, "IsAddOnContentMountedForDebug"}, - FunctionInfo{50, D<&IAddOnContentManager::CheckAddOnContentMountStatus>, "CheckAddOnContentMountStatus"}, - FunctionInfo{100, D<&IAddOnContentManager::CreateEcPurchasedEventManager>, "CreateEcPurchasedEventManager"}, - FunctionInfo{101, D<&IAddOnContentManager::CreatePermanentEcPurchasedEventManager>, "CreatePermanentEcPurchasedEventManager"}, - FunctionInfo{110, nullptr, "CreateContentsServiceManager"}, - FunctionInfo{200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, - FunctionInfo{300, nullptr, "SetupHostAddOnContent"}, - FunctionInfo{301, nullptr, "GetRegisteredAddOnContentPath"}, - FunctionInfo{302, nullptr, "UpdateCachedList"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - static bool CheckAOCTitleIDMatchesBase(u64 title_id, u64 base) { return FileSys::GetBaseTitleID(title_id) == base; } @@ -85,6 +57,35 @@ static std::vector AccumulateAOCTitleIDs(Core::System& system) { IAddOnContentManager::IAddOnContentManager(Core::System& system_) : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)}, service_context{system_, "aoc:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CountAddOnContentByApplicationId"}, + {1, nullptr, "ListAddOnContentByApplicationId"}, + {2, D<&IAddOnContentManager::CountAddOnContent>, "CountAddOnContent"}, + {3, D<&IAddOnContentManager::ListAddOnContent>, "ListAddOnContent"}, + {4, nullptr, "GetAddOnContentBaseIdByApplicationId"}, + {5, D<&IAddOnContentManager::GetAddOnContentBaseId>, "GetAddOnContentBaseId"}, + {6, nullptr, "PrepareAddOnContentByApplicationId"}, + {7, D<&IAddOnContentManager::PrepareAddOnContent>, "PrepareAddOnContent"}, + {8, D<&IAddOnContentManager::GetAddOnContentListChangedEvent>, "GetAddOnContentListChangedEvent"}, + {9, nullptr, "GetAddOnContentLostErrorCode"}, + {10, D<&IAddOnContentManager::GetAddOnContentListChangedEventWithProcessId>, "GetAddOnContentListChangedEventWithProcessId"}, + {11, D<&IAddOnContentManager::NotifyMountAddOnContent>, "NotifyMountAddOnContent"}, + {12, D<&IAddOnContentManager::NotifyUnmountAddOnContent>, "NotifyUnmountAddOnContent"}, + {13, nullptr, "IsAddOnContentMountedForDebug"}, + {50, D<&IAddOnContentManager::CheckAddOnContentMountStatus>, "CheckAddOnContentMountStatus"}, + {100, D<&IAddOnContentManager::CreateEcPurchasedEventManager>, "CreateEcPurchasedEventManager"}, + {101, D<&IAddOnContentManager::CreatePermanentEcPurchasedEventManager>, "CreatePermanentEcPurchasedEventManager"}, + {110, nullptr, "CreateContentsServiceManager"}, + {200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, + {300, nullptr, "SetupHostAddOnContent"}, + {301, nullptr, "GetRegisteredAddOnContentPath"}, + {302, nullptr, "UpdateCachedList"}, + }; + // clang-format on + + RegisterHandlers(functions); + aoc_change_event = service_context.CreateEvent("GetAddOnContentListChanged:Event"); } diff --git a/src/core/hle/service/aoc/addon_content_manager.h b/src/core/hle/service/aoc/addon_content_manager.h index 8ddb86cf19..b505525590 100644 --- a/src/core/hle/service/aoc/addon_content_manager.h +++ b/src/core/hle/service/aoc/addon_content_manager.h @@ -43,9 +43,9 @@ public: OutInterface out_interface); private: - std::optional FindRequest(u32 key) override; std::vector add_on_content; KernelHelpers::ServiceContext service_context; + Kernel::KEvent* aoc_change_event; }; diff --git a/src/core/hle/service/aoc/purchase_event_manager.cpp b/src/core/hle/service/aoc/purchase_event_manager.cpp index eded803b25..64e1244967 100644 --- a/src/core/hle/service/aoc/purchase_event_manager.cpp +++ b/src/core/hle/service/aoc/purchase_event_manager.cpp @@ -11,20 +11,21 @@ namespace Service::AOC { constexpr Result ResultNoPurchasedProductInfoAvailable{ErrorModule::NIMShop, 400}; -std::optional IPurchaseEventManager::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"}, - FunctionInfo{1, D<&IPurchaseEventManager::SetDeliveryTarget>, "SetDeliveryTarget"}, - FunctionInfo{2, D<&IPurchaseEventManager::GetPurchasedEvent>, "GetPurchasedEvent"}, - FunctionInfo{3, D<&IPurchaseEventManager::PopPurchasedProductInfo>, "PopPurchasedProductInfo"}, - FunctionInfo{4, D<&IPurchaseEventManager::PopPurchasedProductInfoWithUid>, "PopPurchasedProductInfoWithUid"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IPurchaseEventManager::IPurchaseEventManager(Core::System& system_) - : ServiceFramework{system_, "IPurchaseEventManager"} - , service_context{system, "IPurchaseEventManager"} { + : ServiceFramework{system_, "IPurchaseEventManager"}, service_context{system, + "IPurchaseEventManager"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"}, + {1, D<&IPurchaseEventManager::SetDeliveryTarget>, "SetDeliveryTarget"}, + {2, D<&IPurchaseEventManager::GetPurchasedEvent>, "GetPurchasedEvent"}, + {3, D<&IPurchaseEventManager::PopPurchasedProductInfo>, "PopPurchasedProductInfo"}, + {4, D<&IPurchaseEventManager::PopPurchasedProductInfoWithUid>, "PopPurchasedProductInfoWithUid"}, + }; + // clang-format on + + RegisterHandlers(functions); + purchased_event = service_context.CreateEvent("IPurchaseEventManager:PurchasedEvent"); } diff --git a/src/core/hle/service/aoc/purchase_event_manager.h b/src/core/hle/service/aoc/purchase_event_manager.h index d11089e567..c0bdfaf242 100644 --- a/src/core/hle/service/aoc/purchase_event_manager.h +++ b/src/core/hle/service/aoc/purchase_event_manager.h @@ -25,8 +25,6 @@ public: Result PopPurchasedProductInfo(); Result PopPurchasedProductInfoWithUid(); - std::optional FindRequest(u32 key) override; - private: KernelHelpers::ServiceContext service_context; Kernel::KEvent* purchased_event; diff --git a/src/core/hle/service/apm/apm.h b/src/core/hle/service/apm/apm.h index e188b4e446..265e581697 100644 --- a/src/core/hle/service/apm/apm.h +++ b/src/core/hle/service/apm/apm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/apm/apm_controller.h b/src/core/hle/service/apm/apm_controller.h index 3357b7762a..c2f65a2f0e 100644 --- a/src/core/hle/service/apm/apm_controller.h +++ b/src/core/hle/service/apm/apm_controller.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/apm/apm_interface.cpp b/src/core/hle/service/apm/apm_interface.cpp index 2b4768478e..51c01e2f25 100644 --- a/src/core/hle/service/apm/apm_interface.cpp +++ b/src/core/hle/service/apm/apm_interface.cpp @@ -14,7 +14,15 @@ namespace Service::APM { class ISession final : public ServiceFramework { public: - explicit ISession(Core::System& system_, Controller& controller_) : ServiceFramework{system_, "ISession"}, controller{controller_} {} + explicit ISession(Core::System& system_, Controller& controller_) + : ServiceFramework{system_, "ISession"}, controller{controller_} { + static const FunctionInfo functions[] = { + {0, &ISession::SetPerformanceConfiguration, "SetPerformanceConfiguration"}, + {1, &ISession::GetPerformanceConfiguration, "GetPerformanceConfiguration"}, + {2, &ISession::SetCpuOverclockEnabled, "SetCpuOverclockEnabled"}, + }; + RegisterHandlers(functions); + } private: void SetPerformanceConfiguration(HLERequestContext& ctx) { @@ -53,20 +61,18 @@ private: rb.Push(ResultSuccess); } - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ISession::SetPerformanceConfiguration, "SetPerformanceConfiguration"}, - FunctionInfo{1, &ISession::GetPerformanceConfiguration, "GetPerformanceConfiguration"}, - FunctionInfo{2, &ISession::SetCpuOverclockEnabled, "SetCpuOverclockEnabled"} - ); Controller& controller; }; APM::APM(Core::System& system_, std::shared_ptr apm_, Controller& controller_, const char* name) : ServiceFramework{system_, name}, apm(std::move(apm_)), controller{controller_} { + static const FunctionInfo functions[] = { + {0, &APM::OpenSession, "OpenSession"}, + {1, &APM::GetPerformanceMode, "GetPerformanceMode"}, + {6, &APM::IsCpuOverclockEnabled, "IsCpuOverclockEnabled"}, + }; + RegisterHandlers(functions); } APM::~APM() = default; @@ -96,6 +102,20 @@ void APM::IsCpuOverclockEnabled(HLERequestContext& ctx) { APM_Sys::APM_Sys(Core::System& system_, Controller& controller_) : ServiceFramework{system_, "apm:sys"}, controller{controller_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestPerformanceMode"}, + {1, &APM_Sys::GetPerformanceEvent, "GetPerformanceEvent"}, + {2, nullptr, "GetThrottlingState"}, + {3, nullptr, "GetLastThrottlingState"}, + {4, nullptr, "ClearLastThrottlingState"}, + {5, nullptr, "LoadAndApplySettings"}, + {6, &APM_Sys::SetCpuBoostMode, "SetCpuBoostMode"}, + {7, &APM_Sys::GetCurrentPerformanceConfiguration, "GetCurrentPerformanceConfiguration"}, + }; + // clang-format on + + RegisterHandlers(functions); } APM_Sys::~APM_Sys() = default; diff --git a/src/core/hle/service/apm/apm_interface.h b/src/core/hle/service/apm/apm_interface.h index 0bbcd185a3..eeac3474b0 100644 --- a/src/core/hle/service/apm/apm_interface.h +++ b/src/core/hle/service/apm/apm_interface.h @@ -24,14 +24,6 @@ private: void GetPerformanceMode(HLERequestContext& ctx); void IsCpuOverclockEnabled(HLERequestContext& ctx); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &APM::OpenSession, "OpenSession"}, - FunctionInfo{1, &APM::GetPerformanceMode, "GetPerformanceMode"}, - FunctionInfo{6, &APM::IsCpuOverclockEnabled, "IsCpuOverclockEnabled"} - ); std::shared_ptr apm; Controller& controller; }; @@ -47,19 +39,6 @@ private: void GetPerformanceEvent(HLERequestContext& ctx); void GetCurrentPerformanceConfiguration(HLERequestContext& ctx); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestPerformanceMode"}, - FunctionInfo{1, &APM_Sys::GetPerformanceEvent, "GetPerformanceEvent"}, - FunctionInfo{2, nullptr, "GetThrottlingState"}, - FunctionInfo{3, nullptr, "GetLastThrottlingState"}, - FunctionInfo{4, nullptr, "ClearLastThrottlingState"}, - FunctionInfo{5, nullptr, "LoadAndApplySettings"}, - FunctionInfo{6, &APM_Sys::SetCpuBoostMode, "SetCpuBoostMode"}, - FunctionInfo{7, &APM_Sys::GetCurrentPerformanceConfiguration, "GetCurrentPerformanceConfiguration"} - ); Controller& controller; }; diff --git a/src/core/hle/service/audio/audio.cpp b/src/core/hle/service/audio/audio.cpp index 6177efd46c..fde766a275 100644 --- a/src/core/hle/service/audio/audio.cpp +++ b/src/core/hle/service/audio/audio.cpp @@ -21,164 +21,164 @@ namespace Service::Audio { class IAudioOutManagerForApplet final : public ServiceFramework { public: explicit IAudioOutManagerForApplet(Core::System& system_) - : ServiceFramework{system_, "audout:a"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestSuspend"}, - FunctionInfo{1, nullptr, "RequestResume"}, - FunctionInfo{2, nullptr, "GetProcessMasterVolume"}, - FunctionInfo{3, nullptr, "SetProcessMasterVolume"}, - FunctionInfo{4, nullptr, "GetProcessRecordVolume"}, - FunctionInfo{5, nullptr, "SetProcessRecordVolume"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "audout:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + {2, nullptr, "GetProcessMasterVolume"}, + {3, nullptr, "SetProcessMasterVolume"}, + {4, nullptr, "GetProcessRecordVolume"}, + {5, nullptr, "SetProcessRecordVolume"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IAudioSnoopManager final : public ServiceFramework { public: explicit IAudioSnoopManager(Core::System& system_) - : ServiceFramework{system_, "auddev"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetDspStatistics"}, - FunctionInfo{1, nullptr, "GetAppletStateSummaries"}, - FunctionInfo{2, nullptr, "SetDspStatisticsParameter"}, - FunctionInfo{3, nullptr, "GetDspStatisticsParameter"}, - FunctionInfo{6, nullptr, "GetDspUsage"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "auddev"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetDspStatistics"}, + {1, nullptr, "GetAppletStateSummaries"}, + {2, nullptr, "SetDspStatisticsParameter"}, + {3, nullptr, "GetDspStatisticsParameter"}, + {6, nullptr, "GetDspUsage"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IAudioInManagerForApplet final : public ServiceFramework { public: explicit IAudioInManagerForApplet(Core::System& system_) - : ServiceFramework{system_, "audin:a"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestSuspend"}, - FunctionInfo{1, nullptr, "RequestResume"}, - FunctionInfo{2, nullptr, "GetProcessMasterVolume"}, - FunctionInfo{3, nullptr, "SetProcessMasterVolume"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "audin:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + {2, nullptr, "GetProcessMasterVolume"}, + {3, nullptr, "SetProcessMasterVolume"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IAudioRendererManagerForApplet final : public ServiceFramework { public: explicit IAudioRendererManagerForApplet(Core::System& system_) - : ServiceFramework{system_, "audren:a"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestSuspend"}, - FunctionInfo{1, nullptr, "RequestResume"}, - FunctionInfo{2, nullptr, "GetProcessMasterVolume"}, - FunctionInfo{3, nullptr, "SetProcessMasterVolume"}, - FunctionInfo{4, nullptr, "RegisterAppletResourceUserId"}, - FunctionInfo{5, nullptr, "UnregisterAppletResourceUserId"}, - FunctionInfo{6, nullptr, "GetProcessRecordVolume"}, - FunctionInfo{7, nullptr, "SetProcessRecordVolume"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "audren:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + {2, nullptr, "GetProcessMasterVolume"}, + {3, nullptr, "SetProcessMasterVolume"}, + {4, nullptr, "RegisterAppletResourceUserId"}, + {5, nullptr, "UnregisterAppletResourceUserId"}, + {6, nullptr, "GetProcessRecordVolume"}, + {7, nullptr, "SetProcessRecordVolume"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IAudioOutManagerForDebugger final : public ServiceFramework { public: explicit IAudioOutManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "audout:d"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestSuspend"}, - FunctionInfo{1, nullptr, "RequestResume"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "audout:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IAudioInManagerForDebugger final : public ServiceFramework { public: explicit IAudioInManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "audin:d"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestSuspend"}, - FunctionInfo{1, nullptr, "RequestResume"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "audin:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IFinalOutputRecorderManagerForDebugger final : public ServiceFramework { public: explicit IFinalOutputRecorderManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "audrec:d"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestSuspend"}, - FunctionInfo{1, nullptr, "RequestResume"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "audrec:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IAudioRendererManagerForDebugger final : public ServiceFramework { public: explicit IAudioRendererManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "audren:d"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestSuspend"}, - FunctionInfo{1, nullptr, "RequestResume"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "audren:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IAudioSystemManagerForApplet final : public ServiceFramework { public: explicit IAudioSystemManagerForApplet(Core::System& system_) - : ServiceFramework{system_, "aud:a"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RegisterAppletResourceUserId"}, - FunctionInfo{1, nullptr, "UnregisterAppletResourceUserId"}, - FunctionInfo{2, nullptr, "RequestSuspendAudio"}, - FunctionInfo{3, nullptr, "RequestResumeAudio"}, - FunctionInfo{4, nullptr, "GetAudioOutputProcessMasterVolume"}, - FunctionInfo{5, nullptr, "SetAudioOutputProcessMasterVolume"}, - FunctionInfo{6, nullptr, "GetAudioInputProcessMasterVolume"}, - FunctionInfo{7, nullptr, "SetAudioInputProcessMasterVolume"}, - FunctionInfo{8, nullptr, "GetAudioOutputProcessRecordVolume"}, - FunctionInfo{9, nullptr, "SetAudioOutputProcessRecordVolume"}, - FunctionInfo{10, nullptr, "GetAppletStateSummaries"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "aud:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RegisterAppletResourceUserId"}, + {1, nullptr, "UnregisterAppletResourceUserId"}, + {2, nullptr, "RequestSuspendAudio"}, + {3, nullptr, "RequestResumeAudio"}, + {4, nullptr, "GetAudioOutputProcessMasterVolume"}, + {5, nullptr, "SetAudioOutputProcessMasterVolume"}, + {6, nullptr, "GetAudioInputProcessMasterVolume"}, + {7, nullptr, "SetAudioInputProcessMasterVolume"}, + {8, nullptr, "GetAudioOutputProcessRecordVolume"}, + {9, nullptr, "SetAudioOutputProcessRecordVolume"}, + {10, nullptr, "GetAppletStateSummaries"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IAudioSystemManagerForDebugger final : public ServiceFramework { public: explicit IAudioSystemManagerForDebugger(Core::System& system_) - : ServiceFramework{system_, "aud:d"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestSuspendAudioForDebug"}, - FunctionInfo{1, nullptr, "RequestResumeAudioForDebug"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "aud:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspendAudioForDebug"}, + {1, nullptr, "RequestResumeAudioForDebug"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/audio/audio.h b/src/core/hle/service/audio/audio.h index d70f022c73..eb8f482690 100644 --- a/src/core/hle/service/audio/audio.h +++ b/src/core/hle/service/audio/audio.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/audio/audio_controller.cpp b/src/core/hle/service/audio/audio_controller.cpp index d912a5e86a..9e2db4a84c 100644 --- a/src/core/hle/service/audio/audio_controller.cpp +++ b/src/core/hle/service/audio/audio_controller.cpp @@ -1,9 +1,6 @@ // SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -20,75 +17,77 @@ namespace Service::Audio { -std::optional IAudioController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAudioController::GetTargetVolume>, "GetTargetVolume"}, - FunctionInfo{1, D<&IAudioController::SetTargetVolume>, "SetTargetVolume"}, - FunctionInfo{2, D<&IAudioController::GetTargetVolumeMin>, "GetTargetVolumeMin"}, - FunctionInfo{3, D<&IAudioController::GetTargetVolumeMax>, "GetTargetVolumeMax"}, - FunctionInfo{4, D<&IAudioController::IsTargetMute>, "IsTargetMute"}, - FunctionInfo{5, D<&IAudioController::SetTargetMute>, "SetTargetMute"}, - FunctionInfo{6, nullptr, "IsTargetConnected", MakeVersionGate({20,0,0})}, - FunctionInfo{7, nullptr, "SetDefaultTarget"}, - FunctionInfo{8, nullptr, "GetDefaultTarget"}, - FunctionInfo{9, D<&IAudioController::GetAudioOutputMode>, "GetAudioOutputMode"}, - FunctionInfo{10, D<&IAudioController::SetAudioOutputMode>, "SetAudioOutputMode"}, - FunctionInfo{11, nullptr, "SetForceMutePolicy"}, - FunctionInfo{12, D<&IAudioController::GetForceMutePolicy>, "GetForceMutePolicy"}, - FunctionInfo{13, D<&IAudioController::GetOutputModeSetting>, "GetOutputModeSetting"}, - FunctionInfo{14, D<&IAudioController::SetOutputModeSetting>, "SetOutputModeSetting"}, - FunctionInfo{15, nullptr, "SetOutputTarget"}, - FunctionInfo{16, nullptr, "SetInputTargetForceEnabled"}, - FunctionInfo{17, D<&IAudioController::SetHeadphoneOutputLevelMode>, "SetHeadphoneOutputLevelMode"}, - FunctionInfo{18, D<&IAudioController::GetHeadphoneOutputLevelMode>, "GetHeadphoneOutputLevelMode"}, - FunctionInfo{19, nullptr, "AcquireAudioVolumeUpdateEventForPlayReport"}, - FunctionInfo{20, nullptr, "AcquireAudioOutputDeviceUpdateEventForPlayReport"}, - FunctionInfo{21, nullptr, "GetAudioOutputTargetForPlayReport"}, - FunctionInfo{22, D<&IAudioController::NotifyHeadphoneVolumeWarningDisplayedEvent>, "NotifyHeadphoneVolumeWarningDisplayedEvent"}, - FunctionInfo{23, nullptr, "SetSystemOutputMasterVolume"}, - FunctionInfo{24, nullptr, "GetSystemOutputMasterVolume"}, - FunctionInfo{25, nullptr, "GetAudioVolumeDataForPlayReport"}, - FunctionInfo{26, nullptr, "UpdateHeadphoneSettings"}, - FunctionInfo{27, nullptr, "SetVolumeMappingTableForDev"}, - FunctionInfo{28, nullptr, "GetAudioOutputChannelCountForPlayReport"}, - FunctionInfo{29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, - FunctionInfo{30, D<&IAudioController::SetSpeakerAutoMuteEnabled>, "SetSpeakerAutoMuteEnabled"}, - FunctionInfo{31, D<&IAudioController::IsSpeakerAutoMuteEnabled>, "IsSpeakerAutoMuteEnabled"}, - FunctionInfo{32, D<&IAudioController::GetActiveOutputTarget>, "GetActiveOutputTarget"}, - FunctionInfo{33, nullptr, "GetTargetDeviceInfo"}, - FunctionInfo{34, D<&IAudioController::AcquireTargetNotification>, "AcquireTargetNotification"}, - FunctionInfo{35, nullptr, "SetHearingProtectionSafeguardTimerRemainingTimeForDebug"}, - FunctionInfo{36, nullptr, "GetHearingProtectionSafeguardTimerRemainingTimeForDebug"}, - FunctionInfo{37, nullptr, "SetHearingProtectionSafeguardEnabled"}, - FunctionInfo{38, nullptr, "IsHearingProtectionSafeguardEnabled"}, - FunctionInfo{39, nullptr, "IsHearingProtectionSafeguardMonitoringOutputForDebug"}, - FunctionInfo{40, nullptr, "GetSystemInformationForDebug"}, - FunctionInfo{41, nullptr, "SetVolumeButtonLongPressTime"}, - FunctionInfo{42, nullptr, "SetNativeVolumeForDebug"}, - FunctionInfo{43, nullptr, "Unknown43", MakeVersionGate({21,0,0})}, - FunctionInfo{5000, D<&IAudioController::Unknown5000>, "Unknown5000", MakeVersionGate({19,0,0})}, - FunctionInfo{10000, nullptr, "NotifyAudioOutputTargetForPlayReport"}, - FunctionInfo{10001, nullptr, "NotifyAudioOutputChannelCountForPlayReport"}, - FunctionInfo{10002, nullptr, "NotifyUnsupportedUsbOutputDeviceAttachedForPlayReport"}, - FunctionInfo{10100, nullptr, "GetAudioVolumeDataForPlayReport"}, - FunctionInfo{10101, nullptr, "BindAudioVolumeUpdateEventForPlayReport"}, - FunctionInfo{10102, nullptr, "BindAudioOutputTargetUpdateEventForPlayReport"}, - FunctionInfo{10103, nullptr, "GetAudioOutputTargetForPlayReport"}, - FunctionInfo{10104, nullptr, "GetAudioOutputChannelCountForPlayReport"}, - FunctionInfo{10105, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport", MakeVersionGate({14,0,0}, {19,0,1})}, - FunctionInfo{10106, nullptr, "GetDefaultAudioOutputTargetForPlayReport", MakeVersionGate({14,0,0}, {19,0,1})}, - FunctionInfo{10200, nullptr, "Unknown10200", MakeVersionGate({20,0,0})}, - FunctionInfo{50000, nullptr, "SetAnalogInputBoostGainForPrototyping", MakeVersionGate({15,0,0}, {18,1,0})}, - FunctionInfo{50001, nullptr, "OverrideDefaultTargetForDebug", MakeVersionGate({19,0,0}, {19,0,1})}, - FunctionInfo{50003, nullptr, "SetForceOverrideExternalDeviceNameForDebug", MakeVersionGate({19,0,0})}, - FunctionInfo{50004, nullptr, "ClearForceOverrideExternalDeviceNameForDebug", MakeVersionGate({19,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAudioController::IAudioController(Core::System& system_) : ServiceFramework{system_, "audctl"}, service_context{system, "audctl"} { - m_set_sys = system.ServiceManager().GetService("set:sys", true); + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IAudioController::GetTargetVolume>, "GetTargetVolume"}, + {1, D<&IAudioController::SetTargetVolume>, "SetTargetVolume"}, + {2, D<&IAudioController::GetTargetVolumeMin>, "GetTargetVolumeMin"}, + {3, D<&IAudioController::GetTargetVolumeMax>, "GetTargetVolumeMax"}, + {4, D<&IAudioController::IsTargetMute>, "IsTargetMute"}, + {5, D<&IAudioController::SetTargetMute>, "SetTargetMute"}, + {6, nullptr, "IsTargetConnected"}, //20.0.0+ + {7, nullptr, "SetDefaultTarget"}, + {8, nullptr, "GetDefaultTarget"}, + {9, D<&IAudioController::GetAudioOutputMode>, "GetAudioOutputMode"}, + {10, D<&IAudioController::SetAudioOutputMode>, "SetAudioOutputMode"}, + {11, nullptr, "SetForceMutePolicy"}, + {12, D<&IAudioController::GetForceMutePolicy>, "GetForceMutePolicy"}, + {13, D<&IAudioController::GetOutputModeSetting>, "GetOutputModeSetting"}, + {14, D<&IAudioController::SetOutputModeSetting>, "SetOutputModeSetting"}, + {15, nullptr, "SetOutputTarget"}, + {16, nullptr, "SetInputTargetForceEnabled"}, + {17, D<&IAudioController::SetHeadphoneOutputLevelMode>, "SetHeadphoneOutputLevelMode"}, + {18, D<&IAudioController::GetHeadphoneOutputLevelMode>, "GetHeadphoneOutputLevelMode"}, + {19, nullptr, "AcquireAudioVolumeUpdateEventForPlayReport"}, + {20, nullptr, "AcquireAudioOutputDeviceUpdateEventForPlayReport"}, + {21, nullptr, "GetAudioOutputTargetForPlayReport"}, + {22, D<&IAudioController::NotifyHeadphoneVolumeWarningDisplayedEvent>, "NotifyHeadphoneVolumeWarningDisplayedEvent"}, + {23, nullptr, "SetSystemOutputMasterVolume"}, + {24, nullptr, "GetSystemOutputMasterVolume"}, + {25, nullptr, "GetAudioVolumeDataForPlayReport"}, + {26, nullptr, "UpdateHeadphoneSettings"}, + {27, nullptr, "SetVolumeMappingTableForDev"}, + {28, nullptr, "GetAudioOutputChannelCountForPlayReport"}, + {29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, + {30, D<&IAudioController::SetSpeakerAutoMuteEnabled>, "SetSpeakerAutoMuteEnabled"}, + {31, D<&IAudioController::IsSpeakerAutoMuteEnabled>, "IsSpeakerAutoMuteEnabled"}, + {32, D<&IAudioController::GetActiveOutputTarget>, "GetActiveOutputTarget"}, + {33, nullptr, "GetTargetDeviceInfo"}, + {34, D<&IAudioController::AcquireTargetNotification>, "AcquireTargetNotification"}, + {35, nullptr, "SetHearingProtectionSafeguardTimerRemainingTimeForDebug"}, + {36, nullptr, "GetHearingProtectionSafeguardTimerRemainingTimeForDebug"}, + {37, nullptr, "SetHearingProtectionSafeguardEnabled"}, + {38, nullptr, "IsHearingProtectionSafeguardEnabled"}, + {39, nullptr, "IsHearingProtectionSafeguardMonitoringOutputForDebug"}, + {40, nullptr, "GetSystemInformationForDebug"}, + {41, nullptr, "SetVolumeButtonLongPressTime"}, + {42, nullptr, "SetNativeVolumeForDebug"}, + {43, nullptr, "Unknown43"}, //21.0.0+ + {5000, D<&IAudioController::Unknown5000>, "Unknown5000"}, //19.0.0+ + {10000, nullptr, "NotifyAudioOutputTargetForPlayReport"}, + {10001, nullptr, "NotifyAudioOutputChannelCountForPlayReport"}, + {10002, nullptr, "NotifyUnsupportedUsbOutputDeviceAttachedForPlayReport"}, + {10100, nullptr, "GetAudioVolumeDataForPlayReport"}, + {10101, nullptr, "BindAudioVolumeUpdateEventForPlayReport"}, + {10102, nullptr, "BindAudioOutputTargetUpdateEventForPlayReport"}, + {10103, nullptr, "GetAudioOutputTargetForPlayReport"}, + {10104, nullptr, "GetAudioOutputChannelCountForPlayReport"}, + {10105, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, //14.0.0-19.0.1 + {10106, nullptr, "GetDefaultAudioOutputTargetForPlayReport"}, //14.0.0-19.0.1 + {10200, nullptr, "Unknown10200"}, //20.0.0+ + {50000, nullptr, "SetAnalogInputBoostGainForPrototyping"}, //15.0.0-18.1.0 + {50001, nullptr, "OverrideDefaultTargetForDebug"}, //19.0.0-19.0.1 + {50003, nullptr, "SetForceOverrideExternalDeviceNameForDebug"}, //19.0.0+ + {50004, nullptr, "ClearForceOverrideExternalDeviceNameForDebug"} //19.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); + + m_set_sys = + system.ServiceManager().GetService("set:sys", true); notification_event = service_context.CreateEvent("IAudioController:NotificationEvent"); // Probably shouldn't do this in constructor? diff --git a/src/core/hle/service/audio/audio_controller.h b/src/core/hle/service/audio/audio_controller.h index e5c615fa21..a30b572ac7 100644 --- a/src/core/hle/service/audio/audio_controller.h +++ b/src/core/hle/service/audio/audio_controller.h @@ -59,8 +59,8 @@ private: Result AcquireTargetNotification(OutCopyHandle out_notification_event); Result Unknown5000(Out> out_audio_controller); - std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext service_context; + Kernel::KEvent* notification_event; std::shared_ptr m_set_sys; std::array m_target_volumes{{15, 15, 15, 15, 15, 15}}; diff --git a/src/core/hle/service/audio/audio_device.cpp b/src/core/hle/service/audio/audio_device.cpp index fc24bf3ccd..e9f7e074a1 100644 --- a/src/core/hle/service/audio/audio_device.cpp +++ b/src/core/hle/service/audio/audio_device.cpp @@ -12,38 +12,36 @@ namespace Service::Audio { using namespace AudioCore::Renderer; -std::optional IAudioDevice::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAudioDevice::ListAudioDeviceName>, "ListAudioDeviceName"}, - FunctionInfo{1, D<&IAudioDevice::SetAudioDeviceOutputVolume>, "SetAudioDeviceOutputVolume"}, - FunctionInfo{2, D<&IAudioDevice::GetAudioDeviceOutputVolume>, "GetAudioDeviceOutputVolume"}, - FunctionInfo{3, D<&IAudioDevice::GetActiveAudioDeviceName>, "GetActiveAudioDeviceName"}, - FunctionInfo{4, D<&IAudioDevice::QueryAudioDeviceSystemEvent>, "QueryAudioDeviceSystemEvent"}, - FunctionInfo{5, D<&IAudioDevice::GetActiveChannelCount>, "GetActiveChannelCount"}, - FunctionInfo{6, D<&IAudioDevice::ListAudioDeviceNameAuto>, "ListAudioDeviceNameAuto"}, - FunctionInfo{7, D<&IAudioDevice::SetAudioDeviceOutputVolumeAuto>, "SetAudioDeviceOutputVolumeAuto"}, - FunctionInfo{8, D<&IAudioDevice::GetAudioDeviceOutputVolumeAuto>, "GetAudioDeviceOutputVolumeAuto"}, - FunctionInfo{10, D<&IAudioDevice::GetActiveAudioDeviceNameAuto>, "GetActiveAudioDeviceNameAuto"}, - FunctionInfo{11, D<&IAudioDevice::QueryAudioDeviceInputEvent>, "QueryAudioDeviceInputEvent"}, - FunctionInfo{12, D<&IAudioDevice::QueryAudioDeviceOutputEvent>, "QueryAudioDeviceOutputEvent"}, - FunctionInfo{13, D<&IAudioDevice::GetActiveAudioDeviceName>, "GetActiveAudioOutputDeviceName"}, - FunctionInfo{14, D<&IAudioDevice::ListAudioOutputDeviceName>, "ListAudioOutputDeviceName"}, - FunctionInfo{15, nullptr, "AcquireAudioInputDeviceNotification", MakeVersionGate({17,0,0})}, - FunctionInfo{16, nullptr, "ReleaseAudioInputDeviceNotification", MakeVersionGate({17,0,0})}, - FunctionInfo{17, nullptr, "AcquireAudioOutputDeviceNotification", MakeVersionGate({17,0,0})}, - FunctionInfo{18, nullptr, "ReleaseAudioOutputDeviceNotification", MakeVersionGate({17,0,0})}, - FunctionInfo{19, D<&IAudioDevice::SetAudioDeviceOutputVolumeAutoTuneEnabled>, "SetAudioDeviceOutputVolumeAutoTuneEnabled", MakeVersionGate({18,0,0})}, - FunctionInfo{20, D<&IAudioDevice::IsAudioDeviceOutputVolumeAutoTuneEnabled>, "IsAudioDeviceOutputVolumeAutoTuneEnabled", MakeVersionGate({18,0,0})}, - FunctionInfo{21, nullptr, "IsActiveOutputDeviceEstimatedLowLatency", MakeVersionGate({21,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAudioDevice::IAudioDevice(Core::System& system_, u64 applet_resource_user_id, u32 revision, u32 device_num) : ServiceFramework{system_, "IAudioDevice"}, service_context{system_, "IAudioDevice"}, impl{std::make_unique(system_, applet_resource_user_id, revision)}, event{service_context.CreateEvent(fmt::format("IAudioDeviceEvent-{}", device_num))} { + static const FunctionInfo functions[] = { + {0, D<&IAudioDevice::ListAudioDeviceName>, "ListAudioDeviceName"}, + {1, D<&IAudioDevice::SetAudioDeviceOutputVolume>, "SetAudioDeviceOutputVolume"}, + {2, D<&IAudioDevice::GetAudioDeviceOutputVolume>, "GetAudioDeviceOutputVolume"}, + {3, D<&IAudioDevice::GetActiveAudioDeviceName>, "GetActiveAudioDeviceName"}, + {4, D<&IAudioDevice::QueryAudioDeviceSystemEvent>, "QueryAudioDeviceSystemEvent"}, + {5, D<&IAudioDevice::GetActiveChannelCount>, "GetActiveChannelCount"}, + {6, D<&IAudioDevice::ListAudioDeviceNameAuto>, "ListAudioDeviceNameAuto"}, + {7, D<&IAudioDevice::SetAudioDeviceOutputVolumeAuto>, "SetAudioDeviceOutputVolumeAuto"}, + {8, D<&IAudioDevice::GetAudioDeviceOutputVolumeAuto>, "GetAudioDeviceOutputVolumeAuto"}, + {10, D<&IAudioDevice::GetActiveAudioDeviceNameAuto>, "GetActiveAudioDeviceNameAuto"}, + {11, D<&IAudioDevice::QueryAudioDeviceInputEvent>, "QueryAudioDeviceInputEvent"}, + {12, D<&IAudioDevice::QueryAudioDeviceOutputEvent>, "QueryAudioDeviceOutputEvent"}, + {13, D<&IAudioDevice::GetActiveAudioDeviceName>, "GetActiveAudioOutputDeviceName"}, + {14, D<&IAudioDevice::ListAudioOutputDeviceName>, "ListAudioOutputDeviceName"}, + {15, nullptr, "AcquireAudioInputDeviceNotification"}, //17.0.0+ + {16, nullptr, "ReleaseAudioInputDeviceNotification"}, //17.0.0+ + {17, nullptr, "AcquireAudioOutputDeviceNotification"}, //17.0.0+ + {18, nullptr, "ReleaseAudioOutputDeviceNotification"}, //17.0.0+ + {19, D<&IAudioDevice::SetAudioDeviceOutputVolumeAutoTuneEnabled>, "SetAudioDeviceOutputVolumeAutoTuneEnabled"}, //18.0.0+ + {20, D<&IAudioDevice::IsAudioDeviceOutputVolumeAutoTuneEnabled>, "IsAudioDeviceOutputVolumeAutoTuneEnabled"}, //18.0.0+ + {21, nullptr, "IsActiveOutputDeviceEstimatedLowLatency"} //21.0.0+ + }; + RegisterHandlers(functions); + event->Signal(system.Kernel()); } diff --git a/src/core/hle/service/audio/audio_device.h b/src/core/hle/service/audio/audio_device.h index bd0aaa5f7c..f6c12fbfeb 100644 --- a/src/core/hle/service/audio/audio_device.h +++ b/src/core/hle/service/audio/audio_device.h @@ -55,7 +55,6 @@ private: Result SetAudioDeviceOutputVolumeAutoTuneEnabled(bool enabled); Result IsAudioDeviceOutputVolumeAutoTuneEnabled(Out out_enabled); - std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext service_context; std::unique_ptr impl; Kernel::KEvent* event; diff --git a/src/core/hle/service/audio/audio_in.cpp b/src/core/hle/service/audio/audio_in.cpp index 068574dbd2..6208c2d104 100644 --- a/src/core/hle/service/audio/audio_in.cpp +++ b/src/core/hle/service/audio/audio_in.cpp @@ -11,33 +11,35 @@ namespace Service::Audio { using namespace AudioCore::AudioIn; -std::optional IAudioIn::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAudioIn::GetAudioInState>, "GetAudioInState"}, - FunctionInfo{1, D<&IAudioIn::Start>, "Start"}, - FunctionInfo{2, D<&IAudioIn::Stop>, "Stop"}, - FunctionInfo{3, D<&IAudioIn::AppendAudioInBuffer>, "AppendAudioInBuffer"}, - FunctionInfo{4, D<&IAudioIn::RegisterBufferEvent>, "RegisterBufferEvent"}, - FunctionInfo{5, D<&IAudioIn::GetReleasedAudioInBuffers>, "GetReleasedAudioInBuffers"}, - FunctionInfo{6, D<&IAudioIn::ContainsAudioInBuffer>, "ContainsAudioInBuffer"}, - FunctionInfo{7, D<&IAudioIn::AppendAudioInBuffer>, "AppendUacInBuffer"}, - FunctionInfo{8, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendAudioInBufferAuto"}, - FunctionInfo{9, D<&IAudioIn::GetReleasedAudioInBuffersAuto>, "GetReleasedAudioInBuffersAuto"}, - FunctionInfo{10, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendUacInBufferAuto"}, - FunctionInfo{11, D<&IAudioIn::GetAudioInBufferCount>, "GetAudioInBufferCount"}, - FunctionInfo{12, D<&IAudioIn::SetDeviceGain>, "SetDeviceGain"}, - FunctionInfo{13, D<&IAudioIn::GetDeviceGain>, "GetDeviceGain"}, - FunctionInfo{14, D<&IAudioIn::FlushAudioInBuffers>, "FlushAudioInBuffers"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAudioIn::IAudioIn(Core::System& system_, Manager& manager, size_t session_id, const std::string& device_name, const AudioInParameter& in_params, Kernel::KProcess* handle, u64 applet_resource_user_id) - : ServiceFramework{system_, "IAudioIn"}, process{handle}, service_context{system_, "IAudioIn"} - , event{service_context.CreateEvent("AudioInEvent")}, impl{std::make_shared(system_, manager, event, session_id)} -{ + : ServiceFramework{system_, "IAudioIn"}, process{handle}, service_context{system_, "IAudioIn"}, + event{service_context.CreateEvent("AudioInEvent")}, impl{std::make_shared(system_, + manager, event, + session_id)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IAudioIn::GetAudioInState>, "GetAudioInState"}, + {1, D<&IAudioIn::Start>, "Start"}, + {2, D<&IAudioIn::Stop>, "Stop"}, + {3, D<&IAudioIn::AppendAudioInBuffer>, "AppendAudioInBuffer"}, + {4, D<&IAudioIn::RegisterBufferEvent>, "RegisterBufferEvent"}, + {5, D<&IAudioIn::GetReleasedAudioInBuffers>, "GetReleasedAudioInBuffers"}, + {6, D<&IAudioIn::ContainsAudioInBuffer>, "ContainsAudioInBuffer"}, + {7, D<&IAudioIn::AppendAudioInBuffer>, "AppendUacInBuffer"}, + {8, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendAudioInBufferAuto"}, + {9, D<&IAudioIn::GetReleasedAudioInBuffersAuto>, "GetReleasedAudioInBuffersAuto"}, + {10, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendUacInBufferAuto"}, + {11, D<&IAudioIn::GetAudioInBufferCount>, "GetAudioInBufferCount"}, + {12, D<&IAudioIn::SetDeviceGain>, "SetDeviceGain"}, + {13, D<&IAudioIn::GetDeviceGain>, "GetDeviceGain"}, + {14, D<&IAudioIn::FlushAudioInBuffers>, "FlushAudioInBuffers"}, + }; + // clang-format on + + RegisterHandlers(functions); + process->Open(system.Kernel()); if (impl->GetSystem() diff --git a/src/core/hle/service/audio/audio_in.h b/src/core/hle/service/audio/audio_in.h index dd7a41f300..793d2b3ad4 100644 --- a/src/core/hle/service/audio/audio_in.h +++ b/src/core/hle/service/audio/audio_in.h @@ -46,7 +46,6 @@ public: Result FlushAudioInBuffers(Out out_flushed); private: - std::optional FindRequest(u32 key) override; Kernel::KProcess* process; KernelHelpers::ServiceContext service_context; Kernel::KEvent* event; diff --git a/src/core/hle/service/audio/audio_in_manager.cpp b/src/core/hle/service/audio/audio_in_manager.cpp index 422e72148b..fccfe38b3b 100644 --- a/src/core/hle/service/audio/audio_in_manager.cpp +++ b/src/core/hle/service/audio/audio_in_manager.cpp @@ -12,22 +12,22 @@ namespace Service::Audio { using namespace AudioCore::AudioIn; -std::optional IAudioInManager::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAudioInManager::ListAudioIns>, "ListAudioIns"}, - FunctionInfo{1, D<&IAudioInManager::OpenAudioIn>, "OpenAudioIn"}, - FunctionInfo{2, D<&IAudioInManager::ListAudioIns>, "ListAudioInsAuto"}, - FunctionInfo{3, D<&IAudioInManager::OpenAudioIn>, "OpenAudioInAuto"}, - FunctionInfo{4, D<&IAudioInManager::ListAudioInsAutoFiltered>, "ListAudioInsAutoFiltered"}, - FunctionInfo{5, D<&IAudioInManager::OpenAudioInProtocolSpecified>, "OpenAudioInProtocolSpecified"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAudioInManager::IAudioInManager(Core::System& system_) - : ServiceFramework{system_, "audin:u"} - , impl{std::make_unique(system_)} -{} + : ServiceFramework{system_, "audin:u"}, impl{std::make_unique( + system_)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IAudioInManager::ListAudioIns>, "ListAudioIns"}, + {1, D<&IAudioInManager::OpenAudioIn>, "OpenAudioIn"}, + {2, D<&IAudioInManager::ListAudioIns>, "ListAudioInsAuto"}, + {3, D<&IAudioInManager::OpenAudioIn>, "OpenAudioInAuto"}, + {4, D<&IAudioInManager::ListAudioInsAutoFiltered>, "ListAudioInsAutoFiltered"}, + {5, D<&IAudioInManager::OpenAudioInProtocolSpecified>, "OpenAudioInProtocolSpecified"}, + }; + // clang-format on + + RegisterHandlers(functions); +} IAudioInManager::~IAudioInManager() = default; diff --git a/src/core/hle/service/audio/audio_in_manager.h b/src/core/hle/service/audio/audio_in_manager.h index 0ee0badba7..d8f63972c3 100644 --- a/src/core/hle/service/audio/audio_in_manager.h +++ b/src/core/hle/service/audio/audio_in_manager.h @@ -54,7 +54,6 @@ private: AudioCore::AudioIn::AudioInParameter parameter, InCopyHandle process_handle, ClientAppletResourceUserId aruid); - std::optional FindRequest(u32 key) override; std::unique_ptr impl; }; diff --git a/src/core/hle/service/audio/audio_out.cpp b/src/core/hle/service/audio/audio_out.cpp index a5f06faab8..996eeede58 100644 --- a/src/core/hle/service/audio/audio_out.cpp +++ b/src/core/hle/service/audio/audio_out.cpp @@ -15,26 +15,6 @@ namespace Service::Audio { using namespace AudioCore::AudioOut; -std::optional IAudioOut::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAudioOut::GetAudioOutState>, "GetAudioOutState"}, - FunctionInfo{1, D<&IAudioOut::Start>, "Start"}, - FunctionInfo{2, D<&IAudioOut::Stop>, "Stop"}, - FunctionInfo{3, D<&IAudioOut::AppendAudioOutBuffer>, "AppendAudioOutBuffer"}, - FunctionInfo{4, D<&IAudioOut::RegisterBufferEvent>, "RegisterBufferEvent"}, - FunctionInfo{5, D<&IAudioOut::GetReleasedAudioOutBuffers>, "GetReleasedAudioOutBuffers"}, - FunctionInfo{6, D<&IAudioOut::ContainsAudioOutBuffer>, "ContainsAudioOutBuffer"}, - FunctionInfo{7, D<&IAudioOut::AppendAudioOutBufferAuto>, "AppendAudioOutBufferAuto"}, - FunctionInfo{8, D<&IAudioOut::GetReleasedAudioOutBuffersAuto>, "GetReleasedAudioOutBuffersAuto"}, - FunctionInfo{9, D<&IAudioOut::GetAudioOutBufferCount>, "GetAudioOutBufferCount"}, - FunctionInfo{10, D<&IAudioOut::GetAudioOutPlayedSampleCount>, "GetAudioOutPlayedSampleCount"}, - FunctionInfo{11, D<&IAudioOut::FlushAudioOutBuffers>, "FlushAudioOutBuffers"}, - FunctionInfo{12, D<&IAudioOut::SetAudioOutVolume>, "SetAudioOutVolume"}, - FunctionInfo{13, D<&IAudioOut::GetAudioOutVolume>, "GetAudioOutVolume"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAudioOut::IAudioOut(Core::System& system_, Manager& manager, size_t session_id, const std::string& device_name, const AudioOutParameter& in_params, Kernel::KProcess* handle, u64 applet_resource_user_id) @@ -42,6 +22,26 @@ IAudioOut::IAudioOut(Core::System& system_, Manager& manager, size_t session_id, event{service_context.CreateEvent("AudioOutEvent")}, process{handle}, impl{std::make_shared(system_, manager, event, session_id)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IAudioOut::GetAudioOutState>, "GetAudioOutState"}, + {1, D<&IAudioOut::Start>, "Start"}, + {2, D<&IAudioOut::Stop>, "Stop"}, + {3, D<&IAudioOut::AppendAudioOutBuffer>, "AppendAudioOutBuffer"}, + {4, D<&IAudioOut::RegisterBufferEvent>, "RegisterBufferEvent"}, + {5, D<&IAudioOut::GetReleasedAudioOutBuffers>, "GetReleasedAudioOutBuffers"}, + {6, D<&IAudioOut::ContainsAudioOutBuffer>, "ContainsAudioOutBuffer"}, + {7, D<&IAudioOut::AppendAudioOutBufferAuto>, "AppendAudioOutBufferAuto"}, + {8, D<&IAudioOut::GetReleasedAudioOutBuffersAuto>, "GetReleasedAudioOutBuffersAuto"}, + {9, D<&IAudioOut::GetAudioOutBufferCount>, "GetAudioOutBufferCount"}, + {10, D<&IAudioOut::GetAudioOutPlayedSampleCount>, "GetAudioOutPlayedSampleCount"}, + {11, D<&IAudioOut::FlushAudioOutBuffers>, "FlushAudioOutBuffers"}, + {12, D<&IAudioOut::SetAudioOutVolume>, "SetAudioOutVolume"}, + {13, D<&IAudioOut::GetAudioOutVolume>, "GetAudioOutVolume"}, + }; + // clang-format on + RegisterHandlers(functions); + process->Open(system.Kernel()); } diff --git a/src/core/hle/service/audio/audio_out.h b/src/core/hle/service/audio/audio_out.h index 311eb84afe..178ee57df6 100644 --- a/src/core/hle/service/audio/audio_out.h +++ b/src/core/hle/service/audio/audio_out.h @@ -52,8 +52,6 @@ public: Result GetAudioOutVolume(Out out_volume); private: - std::optional FindRequest(u32 key) override; - KernelHelpers::ServiceContext service_context; Kernel::KEvent* event; Kernel::KProcess* process; diff --git a/src/core/hle/service/audio/audio_out_manager.cpp b/src/core/hle/service/audio/audio_out_manager.cpp index 9f24bc3513..3b2087932c 100644 --- a/src/core/hle/service/audio/audio_out_manager.cpp +++ b/src/core/hle/service/audio/audio_out_manager.cpp @@ -13,20 +13,20 @@ namespace Service::Audio { using namespace AudioCore::AudioOut; -std::optional IAudioOutManager::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAudioOutManager::ListAudioOuts>, "ListAudioOuts"}, - FunctionInfo{1, D<&IAudioOutManager::OpenAudioOut>, "OpenAudioOut"}, - FunctionInfo{2, D<&IAudioOutManager::ListAudioOutsAuto>, "ListAudioOutsAuto"}, - FunctionInfo{3, D<&IAudioOutManager::OpenAudioOutAuto>, "OpenAudioOutAuto"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAudioOutManager::IAudioOutManager(Core::System& system_) : ServiceFramework{system_, "audout:u"} , impl(system_) { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IAudioOutManager::ListAudioOuts>, "ListAudioOuts"}, + {1, D<&IAudioOutManager::OpenAudioOut>, "OpenAudioOut"}, + {2, D<&IAudioOutManager::ListAudioOutsAuto>, "ListAudioOutsAuto"}, + {3, D<&IAudioOutManager::OpenAudioOutAuto>, "OpenAudioOutAuto"}, + }; + // clang-format on + + RegisterHandlers(functions); } IAudioOutManager::~IAudioOutManager() = default; diff --git a/src/core/hle/service/audio/audio_out_manager.h b/src/core/hle/service/audio/audio_out_manager.h index 4c71c12cdf..ec974aaba4 100644 --- a/src/core/hle/service/audio/audio_out_manager.h +++ b/src/core/hle/service/audio/audio_out_manager.h @@ -43,7 +43,6 @@ private: AudioCore::AudioOut::AudioOutParameter parameter, InCopyHandle process_handle, ClientAppletResourceUserId aruid); - std::optional FindRequest(u32 key) override; std::optional impl; }; diff --git a/src/core/hle/service/audio/audio_renderer.cpp b/src/core/hle/service/audio/audio_renderer.cpp index bcb2adaf61..dd76544094 100644 --- a/src/core/hle/service/audio/audio_renderer.cpp +++ b/src/core/hle/service/audio/audio_renderer.cpp @@ -10,37 +10,38 @@ namespace Service::Audio { using namespace AudioCore::Renderer; -std::optional IAudioRenderer::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAudioRenderer::GetSampleRate>, "GetSampleRate"}, - FunctionInfo{1, D<&IAudioRenderer::GetSampleCount>, "GetSampleCount"}, - FunctionInfo{2, D<&IAudioRenderer::GetMixBufferCount>, "GetMixBufferCount"}, - FunctionInfo{3, D<&IAudioRenderer::GetState>, "GetState"}, - FunctionInfo{4, D<&IAudioRenderer::RequestUpdate>, "RequestUpdate"}, - FunctionInfo{5, D<&IAudioRenderer::Start>, "Start"}, - FunctionInfo{6, D<&IAudioRenderer::Stop>, "Stop"}, - FunctionInfo{7, D<&IAudioRenderer::QuerySystemEvent>, "QuerySystemEvent"}, - FunctionInfo{8, D<&IAudioRenderer::SetRenderingTimeLimit>, "SetRenderingTimeLimit"}, - FunctionInfo{9, D<&IAudioRenderer::GetRenderingTimeLimit>, "GetRenderingTimeLimit"}, - FunctionInfo{10, D<&IAudioRenderer::RequestUpdateAuto>, "RequestUpdateAuto", MakeVersionGate({3,0,0})}, - FunctionInfo{11, nullptr, "ExecuteAudioRendererRendering", MakeVersionGate({3,0,0})}, - FunctionInfo{12, D<&IAudioRenderer::SetVoiceDropParameter>, "SetVoiceDropParameter", MakeVersionGate({15,0,0})}, - FunctionInfo{13, D<&IAudioRenderer::GetVoiceDropParameter>, "GetVoiceDropParameter", MakeVersionGate({15,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAudioRenderer::IAudioRenderer(Core::System& system_, Manager& manager_, AudioCore::AudioRendererParameterInternal& params, Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, Kernel::KProcess* process_handle_, u64 applet_resource_user_id, s32 session_id) - : ServiceFramework{system_, "IAudioRenderer"}, service_context{system_, "IAudioRenderer"} - , rendered_event{service_context.CreateEvent("IAudioRendererEvent")}, manager{manager_} - , impl{std::make_unique(system_, manager, rendered_event)} - , process_handle{process_handle_} { + : ServiceFramework{system_, "IAudioRenderer"}, service_context{system_, "IAudioRenderer"}, + rendered_event{service_context.CreateEvent("IAudioRendererEvent")}, manager{manager_}, + impl{std::make_unique(system_, manager, rendered_event)}, process_handle{ + process_handle_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IAudioRenderer::GetSampleRate>, "GetSampleRate"}, + {1, D<&IAudioRenderer::GetSampleCount>, "GetSampleCount"}, + {2, D<&IAudioRenderer::GetMixBufferCount>, "GetMixBufferCount"}, + {3, D<&IAudioRenderer::GetState>, "GetState"}, + {4, D<&IAudioRenderer::RequestUpdate>, "RequestUpdate"}, + {5, D<&IAudioRenderer::Start>, "Start"}, + {6, D<&IAudioRenderer::Stop>, "Stop"}, + {7, D<&IAudioRenderer::QuerySystemEvent>, "QuerySystemEvent"}, + {8, D<&IAudioRenderer::SetRenderingTimeLimit>, "SetRenderingTimeLimit"}, + {9, D<&IAudioRenderer::GetRenderingTimeLimit>, "GetRenderingTimeLimit"}, + {10, D<&IAudioRenderer::RequestUpdateAuto>, "RequestUpdateAuto"}, //3.0.0+ + {11, nullptr, "ExecuteAudioRendererRendering"}, //3.0.0+ + {12, D<&IAudioRenderer::SetVoiceDropParameter>, "SetVoiceDropParameter"}, //15.0.0+ + {13, D<&IAudioRenderer::GetVoiceDropParameter>, "GetVoiceDropParameter"}, //15.0.0+ + }; + // clang-format on + RegisterHandlers(functions); + process_handle->Open(system_.Kernel()); - impl->Initialize(params, transfer_memory, transfer_memory_size, process_handle, applet_resource_user_id, session_id); + impl->Initialize(params, transfer_memory, transfer_memory_size, process_handle, + applet_resource_user_id, session_id); } IAudioRenderer::~IAudioRenderer() { diff --git a/src/core/hle/service/audio/audio_renderer.h b/src/core/hle/service/audio/audio_renderer.h index e03fc6551d..7f4ea9a662 100644 --- a/src/core/hle/service/audio/audio_renderer.h +++ b/src/core/hle/service/audio/audio_renderer.h @@ -45,7 +45,6 @@ private: Result SetVoiceDropParameter(f32 voice_drop_parameter); Result GetVoiceDropParameter(Out out_voice_drop_parameter); - std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext service_context; Kernel::KEvent* rendered_event; AudioCore::Renderer::Manager& manager; diff --git a/src/core/hle/service/audio/audio_renderer_manager.cpp b/src/core/hle/service/audio/audio_renderer_manager.cpp index 98701c79c1..4756802eeb 100644 --- a/src/core/hle/service/audio/audio_renderer_manager.cpp +++ b/src/core/hle/service/audio/audio_renderer_manager.cpp @@ -18,21 +18,21 @@ namespace Service::Audio { using namespace AudioCore::Renderer; -std::optional IAudioRendererManager::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAudioRendererManager::OpenAudioRenderer>, "OpenAudioRenderer"}, - FunctionInfo{1, D<&IAudioRendererManager::GetWorkBufferSize>, "GetWorkBufferSize"}, - FunctionInfo{2, D<&IAudioRendererManager::GetAudioDeviceService>, "GetAudioDeviceService"}, - FunctionInfo{3, nullptr, "OpenAudioRendererForManualExecution"}, - FunctionInfo{4, D<&IAudioRendererManager::GetAudioDeviceServiceWithRevisionInfo>, "GetAudioDeviceServiceWithRevisionInfo"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAudioRendererManager::IAudioRendererManager(Core::System& system_) : ServiceFramework{system_, "audren:u"} , impl(system_) { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IAudioRendererManager::OpenAudioRenderer>, "OpenAudioRenderer"}, + {1, D<&IAudioRendererManager::GetWorkBufferSize>, "GetWorkBufferSize"}, + {2, D<&IAudioRendererManager::GetAudioDeviceService>, "GetAudioDeviceService"}, + {3, nullptr, "OpenAudioRendererForManualExecution"}, + {4, D<&IAudioRendererManager::GetAudioDeviceServiceWithRevisionInfo>, "GetAudioDeviceServiceWithRevisionInfo"}, + }; + // clang-format on + + RegisterHandlers(functions); } IAudioRendererManager::~IAudioRendererManager() = default; diff --git a/src/core/hle/service/audio/audio_renderer_manager.h b/src/core/hle/service/audio/audio_renderer_manager.h index bd3ea06326..fdce8b6ffa 100644 --- a/src/core/hle/service/audio/audio_renderer_manager.h +++ b/src/core/hle/service/audio/audio_renderer_manager.h @@ -33,7 +33,6 @@ private: Result GetAudioDeviceServiceWithRevisionInfo(Out> out_audio_device, u32 revision, ClientAppletResourceUserId aruid); - std::optional FindRequest(u32 key) override; std::optional impl; u32 num_audio_devices{0}; }; diff --git a/src/core/hle/service/audio/final_output_recorder_manager.cpp b/src/core/hle/service/audio/final_output_recorder_manager.cpp index 9c51613de6..2bc9d29e3e 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager.cpp +++ b/src/core/hle/service/audio/final_output_recorder_manager.cpp @@ -11,29 +11,34 @@ namespace Service::Audio { class IFinalOutputRecorder final : public ServiceFramework { public: explicit IFinalOutputRecorder(Core::System& system_) - : ServiceFramework{system_, "IFinalOutputRecorder"} {} + : ServiceFramework{system_, "IFinalOutputRecorder"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetFinalOutputRecorderState"}, + {1, nullptr, "Start"}, + {2, nullptr, "Stop"}, + {3, nullptr, "AppendFinalOutputRecorderBuffer"}, + {4, nullptr, "RegisterBufferEvent"}, + {5, nullptr, "GetReleasedFinalOutputRecorderBuffers"}, + {6, nullptr, "ContainsFinalOutputRecorderBuffer"}, + {7, nullptr, "GetFinalOutputRecorderBufferEndTime"}, + {8, nullptr, "AppendFinalOutputRecorderBufferAuto"}, + {9, nullptr, "GetReleasedFinalOutputRecorderBufferAuto"}, + {10, nullptr, "FlushFinalOutputRecorderBuffers"}, + {11, nullptr, "AttachWorkBuffer"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetFinalOutputRecorderState"}, - FunctionInfo{1, nullptr, "Start"}, - FunctionInfo{2, nullptr, "Stop"}, - FunctionInfo{3, nullptr, "AppendFinalOutputRecorderBuffer"}, - FunctionInfo{4, nullptr, "RegisterBufferEvent"}, - FunctionInfo{5, nullptr, "GetReleasedFinalOutputRecorderBuffers"}, - FunctionInfo{6, nullptr, "ContainsFinalOutputRecorderBuffer"}, - FunctionInfo{7, nullptr, "GetFinalOutputRecorderBufferEndTime"}, - FunctionInfo{8, nullptr, "AppendFinalOutputRecorderBufferAuto"}, - FunctionInfo{9, nullptr, "GetReleasedFinalOutputRecorderBufferAuto"}, - FunctionInfo{10, nullptr, "FlushFinalOutputRecorderBuffers"}, - FunctionInfo{11, nullptr, "AttachWorkBuffer"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; IFinalOutputRecorderManager::IFinalOutputRecorderManager(Core::System& system_) : ServiceFramework{system_, "audrec:u"} { + static const FunctionInfo functions[] = { + {0, nullptr, "OpenFinalOutputRecorder"}, + }; + RegisterHandlers(functions); } IFinalOutputRecorderManager::~IFinalOutputRecorderManager() = default; diff --git a/src/core/hle/service/audio/final_output_recorder_manager.h b/src/core/hle/service/audio/final_output_recorder_manager.h index ee392b2ada..833c621be7 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager.h +++ b/src/core/hle/service/audio/final_output_recorder_manager.h @@ -18,13 +18,6 @@ class IFinalOutputRecorderManager final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenFinalOutputRecorder"} - ); }; } // namespace Service::Audio diff --git a/src/core/hle/service/audio/final_output_recorder_manager_for_applet.cpp b/src/core/hle/service/audio/final_output_recorder_manager_for_applet.cpp index 42c08d90ec..dc2ea63aa0 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager_for_applet.cpp +++ b/src/core/hle/service/audio/final_output_recorder_manager_for_applet.cpp @@ -10,6 +10,14 @@ namespace Service::Audio { IFinalOutputRecorderManagerForApplet::IFinalOutputRecorderManagerForApplet(Core::System& system_) : ServiceFramework{system_, "audrec:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + }; + // clang-format on + + RegisterHandlers(functions); } IFinalOutputRecorderManagerForApplet::~IFinalOutputRecorderManagerForApplet() = default; diff --git a/src/core/hle/service/audio/final_output_recorder_manager_for_applet.h b/src/core/hle/service/audio/final_output_recorder_manager_for_applet.h index 7beaa888ff..32efb75b5e 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager_for_applet.h +++ b/src/core/hle/service/audio/final_output_recorder_manager_for_applet.h @@ -19,14 +19,6 @@ class IFinalOutputRecorderManagerForApplet final public: explicit IFinalOutputRecorderManagerForApplet(Core::System& system_); ~IFinalOutputRecorderManagerForApplet() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestSuspend"}, - FunctionInfo{1, nullptr, "RequestResume"} - ); }; } // namespace Service::Audio diff --git a/src/core/hle/service/audio/hardware_opus_decoder.cpp b/src/core/hle/service/audio/hardware_opus_decoder.cpp index f0dde63e14..14888afa0d 100644 --- a/src/core/hle/service/audio/hardware_opus_decoder.cpp +++ b/src/core/hle/service/audio/hardware_opus_decoder.cpp @@ -11,25 +11,25 @@ namespace Service::Audio { using namespace AudioCore::OpusDecoder; - std::optional IHardwareOpusDecoder::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IHardwareOpusDecoder::DecodeInterleavedOld>, "DecodeInterleavedOld"}, - FunctionInfo{1, D<&IHardwareOpusDecoder::SetContext>, "SetContext"}, - FunctionInfo{2, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamOld>, "DecodeInterleavedForMultiStreamOld"}, - FunctionInfo{3, D<&IHardwareOpusDecoder::SetContextForMultiStream>, "SetContextForMultiStream"}, - FunctionInfo{4, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfOld>, "DecodeInterleavedWithPerfOld"}, - FunctionInfo{5, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfOld>, "DecodeInterleavedForMultiStreamWithPerfOld"}, - FunctionInfo{6, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfAndResetOld>, "DecodeInterleavedWithPerfAndResetOld"}, - FunctionInfo{7, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfAndResetOld>, "DecodeInterleavedForMultiStreamWithPerfAndResetOld"}, - FunctionInfo{8, D<&IHardwareOpusDecoder::DecodeInterleaved>, "DecodeInterleaved"}, - FunctionInfo{9, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStream>, "DecodeInterleavedForMultiStream"} - ); - return HandlerTableGenerateWithFind(key, functions); - } - IHardwareOpusDecoder::IHardwareOpusDecoder(Core::System& system_, HardwareOpus& hardware_opus) : ServiceFramework{system_, "IHardwareOpusDecoder"}, impl{std::make_unique(system_, hardware_opus)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IHardwareOpusDecoder::DecodeInterleavedOld>, "DecodeInterleavedOld"}, + {1, D<&IHardwareOpusDecoder::SetContext>, "SetContext"}, + {2, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamOld>, "DecodeInterleavedForMultiStreamOld"}, + {3, D<&IHardwareOpusDecoder::SetContextForMultiStream>, "SetContextForMultiStream"}, + {4, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfOld>, "DecodeInterleavedWithPerfOld"}, + {5, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfOld>, "DecodeInterleavedForMultiStreamWithPerfOld"}, + {6, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfAndResetOld>, "DecodeInterleavedWithPerfAndResetOld"}, + {7, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfAndResetOld>, "DecodeInterleavedForMultiStreamWithPerfAndResetOld"}, + {8, D<&IHardwareOpusDecoder::DecodeInterleaved>, "DecodeInterleaved"}, + {9, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStream>, "DecodeInterleavedForMultiStream"}, + }; + // clang-format on + + RegisterHandlers(functions); } IHardwareOpusDecoder::~IHardwareOpusDecoder() = default; diff --git a/src/core/hle/service/audio/hardware_opus_decoder.h b/src/core/hle/service/audio/hardware_opus_decoder.h index 9f9b17bc81..5297572da8 100644 --- a/src/core/hle/service/audio/hardware_opus_decoder.h +++ b/src/core/hle/service/audio/hardware_opus_decoder.h @@ -58,7 +58,6 @@ private: Out out_data_size, Out out_sample_count, Out out_time_taken, InBuffer opus_data, bool reset); - std::optional FindRequest(u32 key) override; std::unique_ptr impl; Common::ScratchBuffer output_data; diff --git a/src/core/hle/service/audio/hardware_opus_decoder_manager.cpp b/src/core/hle/service/audio/hardware_opus_decoder_manager.cpp index 3000ba8c60..b89e210012 100644 --- a/src/core/hle/service/audio/hardware_opus_decoder_manager.cpp +++ b/src/core/hle/service/audio/hardware_opus_decoder_manager.cpp @@ -12,24 +12,23 @@ namespace Service::Audio { using namespace AudioCore::OpusDecoder; -std::optional IHardwareOpusDecoderManager::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoder>, "OpenHardwareOpusDecoder"}, - FunctionInfo{1, D<&IHardwareOpusDecoderManager::GetWorkBufferSize>, "GetWorkBufferSize"}, - FunctionInfo{2, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStream>, "OpenOpusDecoderForMultiStream"}, - FunctionInfo{3, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStream>, "GetWorkBufferSizeForMultiStream"}, - FunctionInfo{4, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderEx>, "OpenHardwareOpusDecoderEx"}, - FunctionInfo{5, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeEx>, "GetWorkBufferSizeEx"}, - FunctionInfo{6, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStreamEx>, "OpenHardwareOpusDecoderForMultiStreamEx"}, - FunctionInfo{7, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamEx>, "GetWorkBufferSizeForMultiStreamEx"}, - FunctionInfo{8, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeExEx>, "GetWorkBufferSizeExEx"}, - FunctionInfo{9, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamExEx>, "GetWorkBufferSizeForMultiStreamExEx"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IHardwareOpusDecoderManager::IHardwareOpusDecoderManager(Core::System& system_) : ServiceFramework{system_, "hwopus"}, system{system_}, impl{system} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoder>, "OpenHardwareOpusDecoder"}, + {1, D<&IHardwareOpusDecoderManager::GetWorkBufferSize>, "GetWorkBufferSize"}, + {2, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStream>, "OpenOpusDecoderForMultiStream"}, + {3, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStream>, "GetWorkBufferSizeForMultiStream"}, + {4, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderEx>, "OpenHardwareOpusDecoderEx"}, + {5, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeEx>, "GetWorkBufferSizeEx"}, + {6, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStreamEx>, "OpenHardwareOpusDecoderForMultiStreamEx"}, + {7, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamEx>, "GetWorkBufferSizeForMultiStreamEx"}, + {8, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeExEx>, "GetWorkBufferSizeExEx"}, + {9, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamExEx>, "GetWorkBufferSizeForMultiStreamExEx"}, + }; + // clang-format on + RegisterHandlers(functions); } IHardwareOpusDecoderManager::~IHardwareOpusDecoderManager() = default; diff --git a/src/core/hle/service/audio/hardware_opus_decoder_manager.h b/src/core/hle/service/audio/hardware_opus_decoder_manager.h index 1dbac9addb..4dd211e232 100644 --- a/src/core/hle/service/audio/hardware_opus_decoder_manager.h +++ b/src/core/hle/service/audio/hardware_opus_decoder_manager.h @@ -49,7 +49,6 @@ private: Result GetWorkBufferSizeForMultiStreamExEx( Out out_size, InLargeData params); - std::optional FindRequest(u32 key) override; Core::System& system; AudioCore::OpusDecoder::OpusDecoderManager impl; }; diff --git a/src/core/hle/service/bcat/bcat.h b/src/core/hle/service/bcat/bcat.h index 2aaffc693b..65961baffe 100644 --- a/src/core/hle/service/bcat/bcat.h +++ b/src/core/hle/service/bcat/bcat.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/bcat/bcat_result.h b/src/core/hle/service/bcat/bcat_result.h index edf8a65641..c6fa1b4e26 100644 --- a/src/core/hle/service/bcat/bcat_result.h +++ b/src/core/hle/service/bcat/bcat_result.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/bcat/bcat_service.cpp b/src/core/hle/service/bcat/bcat_service.cpp index 85f262f6eb..bc2a3e3457 100644 --- a/src/core/hle/service/bcat/bcat_service.cpp +++ b/src/core/hle/service/bcat/bcat_service.cpp @@ -24,45 +24,44 @@ static u64 GetCurrentBuildID(const Core::System::CurrentBuildProcessID& id) { return out; } -std::optional IBcatService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{10100, D<&IBcatService::RequestSyncDeliveryCache>, "RequestSyncDeliveryCache"}, - FunctionInfo{10101, D<&IBcatService::RequestSyncDeliveryCacheWithDirectoryName>, "RequestSyncDeliveryCacheWithDirectoryName"}, - FunctionInfo{10200, nullptr, "CancelSyncDeliveryCacheRequest"}, - FunctionInfo{20100, nullptr, "RequestSyncDeliveryCacheWithApplicationId"}, - FunctionInfo{20101, nullptr, "RequestSyncDeliveryCacheWithApplicationIdAndDirectoryName"}, - FunctionInfo{20300, nullptr, "GetDeliveryCacheStorageUpdateNotifier"}, - FunctionInfo{20301, nullptr, "RequestSuspendDeliveryTask"}, - FunctionInfo{20400, nullptr, "RegisterSystemApplicationDeliveryTask"}, - FunctionInfo{20401, nullptr, "UnregisterSystemApplicationDeliveryTask"}, - FunctionInfo{20410, nullptr, "SetSystemApplicationDeliveryTaskTimer"}, - FunctionInfo{30100, D<&IBcatService::SetPassphrase>, "SetPassphrase"}, - FunctionInfo{30101, nullptr, "Unknown30101", MakeVersionGate({2,0,0}, {2,3,0})}, - FunctionInfo{30102, nullptr, "Unknown30102", MakeVersionGate({2,0,0}, {2,3,0})}, - FunctionInfo{30200, nullptr, "RegisterBackgroundDeliveryTask"}, - FunctionInfo{30201, nullptr, "UnregisterBackgroundDeliveryTask"}, - FunctionInfo{30202, nullptr, "BlockDeliveryTask"}, - FunctionInfo{30203, nullptr, "UnblockDeliveryTask"}, - FunctionInfo{30210, nullptr, "SetDeliveryTaskTimer"}, - FunctionInfo{30300, D<&IBcatService::RegisterSystemApplicationDeliveryTasks>, "RegisterSystemApplicationDeliveryTasks"}, - FunctionInfo{90100, nullptr, "GetDeliveryTaskList"}, - FunctionInfo{90101, nullptr, "GetDeliveryTaskListForSystem", MakeVersionGate({11,0,0})}, - FunctionInfo{90200, nullptr, "GetDeliveryList"}, - FunctionInfo{90201, D<&IBcatService::ClearDeliveryCacheStorage>, "ClearDeliveryCacheStorage"}, - FunctionInfo{90202, nullptr, "ClearDeliveryTaskSubscriptionStatus"}, - FunctionInfo{90300, nullptr, "GetPushNotificationLog"}, - FunctionInfo{90301, nullptr, "GetDeliveryCacheStorageUsage", MakeVersionGate({11,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IBcatService::IBcatService(Core::System& system_, BcatBackend& backend_, u64 program_id_) - : ServiceFramework{system_, "IBcatService"}, backend{backend_}, program_id{program_id_} - , progress{{ - ProgressServiceBackend{system_, "Normal"}, - ProgressServiceBackend{system_, "Directory"}, - }} -{} + : ServiceFramework{system_, "IBcatService"}, backend{backend_}, program_id{program_id_}, + progress{{ + ProgressServiceBackend{system_, "Normal"}, + ProgressServiceBackend{system_, "Directory"}, + }} { + // clang-format off + static const FunctionInfo functions[] = { + {10100, D<&IBcatService::RequestSyncDeliveryCache>, "RequestSyncDeliveryCache"}, + {10101, D<&IBcatService::RequestSyncDeliveryCacheWithDirectoryName>, "RequestSyncDeliveryCacheWithDirectoryName"}, + {10200, nullptr, "CancelSyncDeliveryCacheRequest"}, + {20100, nullptr, "RequestSyncDeliveryCacheWithApplicationId"}, + {20101, nullptr, "RequestSyncDeliveryCacheWithApplicationIdAndDirectoryName"}, + {20300, nullptr, "GetDeliveryCacheStorageUpdateNotifier"}, + {20301, nullptr, "RequestSuspendDeliveryTask"}, + {20400, nullptr, "RegisterSystemApplicationDeliveryTask"}, + {20401, nullptr, "UnregisterSystemApplicationDeliveryTask"}, + {20410, nullptr, "SetSystemApplicationDeliveryTaskTimer"}, + {30100, D<&IBcatService::SetPassphrase>, "SetPassphrase"}, + {30101, nullptr, "Unknown30101"}, //2.0.0-2.3.0 + {30102, nullptr, "Unknown30102"}, //2.0.0-2.3.0 + {30200, nullptr, "RegisterBackgroundDeliveryTask"}, + {30201, nullptr, "UnregisterBackgroundDeliveryTask"}, + {30202, nullptr, "BlockDeliveryTask"}, + {30203, nullptr, "UnblockDeliveryTask"}, + {30210, nullptr, "SetDeliveryTaskTimer"}, + {30300, D<&IBcatService::RegisterSystemApplicationDeliveryTasks>, "RegisterSystemApplicationDeliveryTasks"}, + {90100, nullptr, "GetDeliveryTaskList"}, + {90101, nullptr, "GetDeliveryTaskListForSystem"}, //11.0.0+ + {90200, nullptr, "GetDeliveryList"}, + {90201, D<&IBcatService::ClearDeliveryCacheStorage>, "ClearDeliveryCacheStorage"}, + {90202, nullptr, "ClearDeliveryTaskSubscriptionStatus"}, + {90300, nullptr, "GetPushNotificationLog"}, + {90301, nullptr, "GetDeliveryCacheStorageUsage"}, //11.0.0+ + }; + // clang-format on + RegisterHandlers(functions); +} IBcatService::~IBcatService() = default; diff --git a/src/core/hle/service/bcat/bcat_service.h b/src/core/hle/service/bcat/bcat_service.h index ed95f021d0..5e11059a78 100644 --- a/src/core/hle/service/bcat/bcat_service.h +++ b/src/core/hle/service/bcat/bcat_service.h @@ -41,7 +41,6 @@ private: ProgressServiceBackend& GetProgressBackend(SyncType type); const ProgressServiceBackend& GetProgressBackend(SyncType type) const; - std::optional FindRequest(u32 key) override; BcatBackend& backend; u64 program_id; std::array(SyncType::Count)> progress; diff --git a/src/core/hle/service/bcat/delivery_cache_directory_service.cpp b/src/core/hle/service/bcat/delivery_cache_directory_service.cpp index 0d464a2fdc..8ead0bae99 100644 --- a/src/core/hle/service/bcat/delivery_cache_directory_service.cpp +++ b/src/core/hle/service/bcat/delivery_cache_directory_service.cpp @@ -27,18 +27,18 @@ static BcatDigest DigestFile(const FileSys::VirtualFile& file) { return out; } -std::optional IDeliveryCacheDirectoryService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IDeliveryCacheDirectoryService::Open>, "Open"}, - FunctionInfo{1, D<&IDeliveryCacheDirectoryService::Read>, "Read"}, - FunctionInfo{2, D<&IDeliveryCacheDirectoryService::GetCount>, "GetCount"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IDeliveryCacheDirectoryService::IDeliveryCacheDirectoryService(Core::System& system_, FileSys::VirtualDir root_) : ServiceFramework{system_, "IDeliveryCacheDirectoryService"}, root(std::move(root_)) { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IDeliveryCacheDirectoryService::Open>, "Open"}, + {1, D<&IDeliveryCacheDirectoryService::Read>, "Read"}, + {2, D<&IDeliveryCacheDirectoryService::GetCount>, "GetCount"}, + }; + // clang-format on + + RegisterHandlers(functions); } IDeliveryCacheDirectoryService::~IDeliveryCacheDirectoryService() = default; diff --git a/src/core/hle/service/bcat/delivery_cache_directory_service.h b/src/core/hle/service/bcat/delivery_cache_directory_service.h index af90680390..cea67b0d87 100644 --- a/src/core/hle/service/bcat/delivery_cache_directory_service.h +++ b/src/core/hle/service/bcat/delivery_cache_directory_service.h @@ -29,7 +29,6 @@ private: OutArray out_buffer); Result GetCount(Out out_count); - std::optional FindRequest(u32 key) override; FileSys::VirtualDir root; FileSys::VirtualDir current_dir; }; diff --git a/src/core/hle/service/bcat/delivery_cache_file_service.cpp b/src/core/hle/service/bcat/delivery_cache_file_service.cpp index d9b6ff77ee..1d961e1655 100644 --- a/src/core/hle/service/bcat/delivery_cache_file_service.cpp +++ b/src/core/hle/service/bcat/delivery_cache_file_service.cpp @@ -12,19 +12,19 @@ namespace Service::BCAT { -std::optional IDeliveryCacheFileService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IDeliveryCacheFileService::Open>, "Open"}, - FunctionInfo{1, D<&IDeliveryCacheFileService::Read>, "Read"}, - FunctionInfo{2, D<&IDeliveryCacheFileService::GetSize>, "GetSize"}, - FunctionInfo{3, D<&IDeliveryCacheFileService::GetDigest>, "GetDigest"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IDeliveryCacheFileService::IDeliveryCacheFileService(Core::System& system_, FileSys::VirtualDir root_) : ServiceFramework{system_, "IDeliveryCacheFileService"}, root(std::move(root_)) { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IDeliveryCacheFileService::Open>, "Open"}, + {1, D<&IDeliveryCacheFileService::Read>, "Read"}, + {2, D<&IDeliveryCacheFileService::GetSize>, "GetSize"}, + {3, D<&IDeliveryCacheFileService::GetDigest>, "GetDigest"}, + }; + // clang-format on + + RegisterHandlers(functions); } IDeliveryCacheFileService::~IDeliveryCacheFileService() = default; diff --git a/src/core/hle/service/bcat/delivery_cache_file_service.h b/src/core/hle/service/bcat/delivery_cache_file_service.h index 176c8eb3e5..911bda55b3 100644 --- a/src/core/hle/service/bcat/delivery_cache_file_service.h +++ b/src/core/hle/service/bcat/delivery_cache_file_service.h @@ -29,7 +29,6 @@ private: Result GetSize(Out out_size); Result GetDigest(Out out_digest); - std::optional FindRequest(u32 key) override; FileSys::VirtualDir root; FileSys::VirtualFile current_file; }; diff --git a/src/core/hle/service/bcat/delivery_cache_progress_service.cpp b/src/core/hle/service/bcat/delivery_cache_progress_service.cpp index 4de42dd580..873977bf90 100644 --- a/src/core/hle/service/bcat/delivery_cache_progress_service.cpp +++ b/src/core/hle/service/bcat/delivery_cache_progress_service.cpp @@ -10,18 +10,18 @@ namespace Service::BCAT { -std::optional IDeliveryCacheProgressService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IDeliveryCacheProgressService::GetEvent>, "GetEvent"}, - FunctionInfo{1, D<&IDeliveryCacheProgressService::GetImpl>, "GetImpl"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IDeliveryCacheProgressService::IDeliveryCacheProgressService(Core::System& system_, Kernel::KReadableEvent& event_, const DeliveryCacheProgressImpl& impl_) : ServiceFramework{system_, "IDeliveryCacheProgressService"}, event{event_}, impl{impl_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IDeliveryCacheProgressService::GetEvent>, "Get"}, + {1, D<&IDeliveryCacheProgressService::GetImpl>, "Get"}, + }; + // clang-format on + + RegisterHandlers(functions); } IDeliveryCacheProgressService::~IDeliveryCacheProgressService() = default; diff --git a/src/core/hle/service/bcat/delivery_cache_progress_service.h b/src/core/hle/service/bcat/delivery_cache_progress_service.h index 88f49cea85..83d4d35827 100644 --- a/src/core/hle/service/bcat/delivery_cache_progress_service.h +++ b/src/core/hle/service/bcat/delivery_cache_progress_service.h @@ -31,7 +31,6 @@ private: Result GetEvent(OutCopyHandle out_event); Result GetImpl(OutLargeData out_impl); - std::optional FindRequest(u32 key) override; Kernel::KReadableEvent& event; const DeliveryCacheProgressImpl& impl; }; diff --git a/src/core/hle/service/bcat/delivery_cache_storage_service.cpp b/src/core/hle/service/bcat/delivery_cache_storage_service.cpp index 67dc857642..a363bcb2d1 100644 --- a/src/core/hle/service/bcat/delivery_cache_storage_service.cpp +++ b/src/core/hle/service/bcat/delivery_cache_storage_service.cpp @@ -12,18 +12,18 @@ namespace Service::BCAT { -std::optional IDeliveryCacheStorageService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IDeliveryCacheStorageService::CreateFileService>, "CreateFileService"}, - FunctionInfo{1, D<&IDeliveryCacheStorageService::CreateDirectoryService>, "CreateDirectoryService"}, - FunctionInfo{10, D<&IDeliveryCacheStorageService::EnumerateDeliveryCacheDirectory>, "EnumerateDeliveryCacheDirectory"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IDeliveryCacheStorageService::IDeliveryCacheStorageService(Core::System& system_, FileSys::VirtualDir root_) : ServiceFramework{system_, "IDeliveryCacheStorageService"}, root(std::move(root_)) { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IDeliveryCacheStorageService::CreateFileService>, "CreateFileService"}, + {1, D<&IDeliveryCacheStorageService::CreateDirectoryService>, "CreateDirectoryService"}, + {10, D<&IDeliveryCacheStorageService::EnumerateDeliveryCacheDirectory>, "EnumerateDeliveryCacheDirectory"}, + }; + // clang-format on + + RegisterHandlers(functions); } IDeliveryCacheStorageService::~IDeliveryCacheStorageService() = default; diff --git a/src/core/hle/service/bcat/delivery_cache_storage_service.h b/src/core/hle/service/bcat/delivery_cache_storage_service.h index b30f24fb47..4849e58047 100644 --- a/src/core/hle/service/bcat/delivery_cache_storage_service.h +++ b/src/core/hle/service/bcat/delivery_cache_storage_service.h @@ -31,7 +31,6 @@ private: Out out_directory_count, OutArray out_directories); - std::optional FindRequest(u32 key) override; FileSys::VirtualDir root; std::vector entries; std::size_t next_read_index = 0; diff --git a/src/core/hle/service/bcat/news/builtin_news.h b/src/core/hle/service/bcat/news/builtin_news.h index cb06b2d4e3..e47cc89588 100644 --- a/src/core/hle/service/bcat/news/builtin_news.h +++ b/src/core/hle/service/bcat/news/builtin_news.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later #pragma once diff --git a/src/core/hle/service/bcat/news/msgpack.cpp b/src/core/hle/service/bcat/news/msgpack.cpp index b67b75ea9d..9cea2de522 100644 --- a/src/core/hle/service/bcat/news/msgpack.cpp +++ b/src/core/hle/service/bcat/news/msgpack.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later #include "core/hle/service/bcat/news/msgpack.h" diff --git a/src/core/hle/service/bcat/news/msgpack.h b/src/core/hle/service/bcat/news/msgpack.h index a7a2aa40ba..3163689782 100644 --- a/src/core/hle/service/bcat/news/msgpack.h +++ b/src/core/hle/service/bcat/news/msgpack.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later #pragma once diff --git a/src/core/hle/service/bcat/news/newly_arrived_event_holder.cpp b/src/core/hle/service/bcat/news/newly_arrived_event_holder.cpp index 57d71c49d8..b60de3b1f5 100644 --- a/src/core/hle/service/bcat/news/newly_arrived_event_holder.cpp +++ b/src/core/hle/service/bcat/news/newly_arrived_event_holder.cpp @@ -9,16 +9,17 @@ namespace Service::News { -std::optional INewlyArrivedEventHolder::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&INewlyArrivedEventHolder::Get>, "Get"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - INewlyArrivedEventHolder::INewlyArrivedEventHolder(Core::System& system_) - : ServiceFramework{system_, "INewlyArrivedEventHolder"} - , service_context{system_, "INewlyArrivedEventHolder"} { + : ServiceFramework{system_, "INewlyArrivedEventHolder"}, service_context{ + system_, + "INewlyArrivedEventHolder"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&INewlyArrivedEventHolder::Get>, "Get"}, + }; + // clang-format on + + RegisterHandlers(functions); arrived_event = service_context.CreateEvent("INewlyArrivedEventHolder::ArrivedEvent"); } diff --git a/src/core/hle/service/bcat/news/newly_arrived_event_holder.h b/src/core/hle/service/bcat/news/newly_arrived_event_holder.h index fccc8d6e55..5c2aeec182 100644 --- a/src/core/hle/service/bcat/news/newly_arrived_event_holder.h +++ b/src/core/hle/service/bcat/news/newly_arrived_event_holder.h @@ -29,7 +29,6 @@ public: private: Result Get(OutCopyHandle out_event); - std::optional FindRequest(u32 key) override; Kernel::KEvent* arrived_event; KernelHelpers::ServiceContext service_context; }; diff --git a/src/core/hle/service/bcat/news/news_data_service.cpp b/src/core/hle/service/bcat/news/news_data_service.cpp index f5de93db49..200d00e785 100644 --- a/src/core/hle/service/bcat/news/news_data_service.cpp +++ b/src/core/hle/service/bcat/news/news_data_service.cpp @@ -24,19 +24,16 @@ std::string_view ToStringView(std::span buf) { } // namespace -std::optional INewsDataService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&INewsDataService::Open>, "Open"}, - FunctionInfo{1, D<&INewsDataService::OpenWithNewsRecordV1>, "OpenWithNewsRecordV1"}, - FunctionInfo{2, D<&INewsDataService::Read>, "Read"}, - FunctionInfo{3, D<&INewsDataService::GetSize>, "GetSize"}, - FunctionInfo{1001, D<&INewsDataService::OpenWithNewsRecord>, "OpenWithNewsRecord"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - INewsDataService::INewsDataService(Core::System& system_) : ServiceFramework{system_, "INewsDataService"} { + static const FunctionInfo functions[] = { + {0, D<&INewsDataService::Open>, "Open"}, + {1, D<&INewsDataService::OpenWithNewsRecordV1>, "OpenWithNewsRecordV1"}, + {2, D<&INewsDataService::Read>, "Read"}, + {3, D<&INewsDataService::GetSize>, "GetSize"}, + {1001, D<&INewsDataService::OpenWithNewsRecord>, "OpenWithNewsRecord"}, + }; + RegisterHandlers(functions); } INewsDataService::~INewsDataService() = default; diff --git a/src/core/hle/service/bcat/news/news_data_service.h b/src/core/hle/service/bcat/news/news_data_service.h index 8ce10c045d..45fe4bafcc 100644 --- a/src/core/hle/service/bcat/news/news_data_service.h +++ b/src/core/hle/service/bcat/news/news_data_service.h @@ -31,7 +31,6 @@ private: Result Read(Out out_size, s64 offset, OutBuffer out_buffer); Result GetSize(Out out_size); - std::optional FindRequest(u32 key) override; std::vector opened_payload; }; diff --git a/src/core/hle/service/bcat/news/news_database_service.cpp b/src/core/hle/service/bcat/news/news_database_service.cpp index 08fdfcb58b..27ca1ad378 100644 --- a/src/core/hle/service/bcat/news/news_database_service.cpp +++ b/src/core/hle/service/bcat/news/news_database_service.cpp @@ -45,21 +45,18 @@ bool UpdateField(NewsRecord& rec, std::string_view column, s32 value, bool addit } // namespace -std::optional INewsDatabaseService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&INewsDatabaseService::GetListV1>, "GetListV1"}, - FunctionInfo{1, D<&INewsDatabaseService::Count>, "Count"}, - FunctionInfo{2, D<&INewsDatabaseService::CountWithKey>, "CountWithKey"}, - FunctionInfo{3, D<&INewsDatabaseService::UpdateIntegerValue>, "UpdateIntegerValue"}, - FunctionInfo{4, D<&INewsDatabaseService::UpdateIntegerValueWithAddition>, "UpdateIntegerValueWithAddition"}, - FunctionInfo{5, D<&INewsDatabaseService::UpdateStringValue>, "UpdateStringValue"}, - FunctionInfo{1000, D<&INewsDatabaseService::GetList>, "GetList"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - INewsDatabaseService::INewsDatabaseService(Core::System& system_) : ServiceFramework{system_, "INewsDatabaseService"} { + static const FunctionInfo functions[] = { + {0, D<&INewsDatabaseService::GetListV1>, "GetListV1"}, + {1, D<&INewsDatabaseService::Count>, "Count"}, + {2, D<&INewsDatabaseService::CountWithKey>, "CountWithKey"}, + {3, D<&INewsDatabaseService::UpdateIntegerValue>, "UpdateIntegerValue"}, + {4, D<&INewsDatabaseService::UpdateIntegerValueWithAddition>, "UpdateIntegerValueWithAddition"}, + {5, D<&INewsDatabaseService::UpdateStringValue>, "UpdateStringValue"}, + {1000, D<&INewsDatabaseService::GetList>, "GetList"}, + }; + RegisterHandlers(functions); } INewsDatabaseService::~INewsDatabaseService() = default; diff --git a/src/core/hle/service/bcat/news/news_database_service.h b/src/core/hle/service/bcat/news/news_database_service.h index 0a097b97bc..7552da23de 100644 --- a/src/core/hle/service/bcat/news/news_database_service.h +++ b/src/core/hle/service/bcat/news/news_database_service.h @@ -49,8 +49,6 @@ private: InBuffer where_phrase, InBuffer order_by_phrase, s32 offset); - - std::optional FindRequest(u32 key) override; }; } // namespace Service::News diff --git a/src/core/hle/service/bcat/news/news_service.cpp b/src/core/hle/service/bcat/news/news_service.cpp index 7cb931896c..4dcaa14881 100644 --- a/src/core/hle/service/bcat/news/news_service.cpp +++ b/src/core/hle/service/bcat/news/news_service.cpp @@ -12,32 +12,32 @@ namespace Service::News { -std::optional INewsService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{10100, D<&INewsService::PostLocalNews>, "PostLocalNews"}, - FunctionInfo{20100, D<&INewsService::SetPassphrase>, "SetPassphrase"}, - FunctionInfo{30100, D<&INewsService::GetSubscriptionStatus>, "GetSubscriptionStatus"}, - FunctionInfo{30101, D<&INewsService::GetTopicList>, "GetTopicList", MakeVersionGate({3,0,0})}, - FunctionInfo{30110, D<&INewsService::GetTopicList>, "Unknown30110", MakeVersionGate({6,0,0})}, // stub - FunctionInfo{30200, D<&INewsService::IsSystemUpdateRequired>, "IsSystemUpdateRequired"}, - FunctionInfo{30201, D<&INewsService::IsSystemUpdateRequired>, "Unknown30201", MakeVersionGate({8,0,0})}, // stub - FunctionInfo{30210, D<&INewsService::IsSystemUpdateRequired>, "Unknown30210", MakeVersionGate({10,0,0})}, // stub - FunctionInfo{30300, nullptr, "RequestImmediateReception"}, - FunctionInfo{30400, nullptr, "DecodeArchiveFile", MakeVersionGate({3,0,0}, {18,1,0})}, // stub - FunctionInfo{30500, nullptr, "Unknown30500", MakeVersionGate({8,0,0})}, // stub - FunctionInfo{30900, nullptr, "Unknown30900", MakeVersionGate({1,0,0})}, // stub - FunctionInfo{30901, nullptr, "Unknown30901", MakeVersionGate({1,0,0})}, // stub - FunctionInfo{30902, nullptr, "Unknown30902", MakeVersionGate({1,0,0})}, // stub - FunctionInfo{40100, nullptr, "SetSubscriptionStatus"}, - FunctionInfo{40101, D<&INewsService::RequestAutoSubscription>, "RequestAutoSubscription", MakeVersionGate({3,0,0})}, - FunctionInfo{40200, D<&INewsService::ClearStorage>, "ClearStorage"}, - FunctionInfo{40201, D<&INewsService::ClearSubscriptionStatusAll>, "ClearSubscriptionStatusAll"}, - FunctionInfo{90100, D<&INewsService::GetNewsDatabaseDump>, "GetNewsDatabaseDump"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - INewsService::INewsService(Core::System& system_) : ServiceFramework{system_, "INewsService"} { + // clang-format off + static const FunctionInfo functions[] = { + {10100, D<&INewsService::PostLocalNews>, "PostLocalNews"}, + {20100, D<&INewsService::SetPassphrase>, "SetPassphrase"}, + {30100, D<&INewsService::GetSubscriptionStatus>, "GetSubscriptionStatus"}, + {30101, D<&INewsService::GetTopicList>, "GetTopicList"}, //3.0.0+ + {30110, D<&INewsService::GetTopicList>, "Unknown30110"}, //6.0.0+ (stub) + {30200, D<&INewsService::IsSystemUpdateRequired>, "IsSystemUpdateRequired"}, + {30201, D<&INewsService::IsSystemUpdateRequired>, "Unknown30201"}, //8.0.0+ (stub) + {30210, D<&INewsService::IsSystemUpdateRequired>, "Unknown30210"}, //10.0.0+ (stub) + {30300, nullptr, "RequestImmediateReception"}, + {30400, nullptr, "DecodeArchiveFile"}, //3.0.0-18.1.0 (stub) + {30500, nullptr, "Unknown30500"}, //8.0.0+ (stub) + {30900, nullptr, "Unknown30900"}, //1.0.0 (stub) + {30901, nullptr, "Unknown30901"}, //1.0.0 (stub) + {30902, nullptr, "Unknown30902"}, //1.0.0 (stub) + {40100, nullptr, "SetSubscriptionStatus"}, + {40101, D<&INewsService::RequestAutoSubscription>, "RequestAutoSubscription"}, //3.0.0+ + {40200, D<&INewsService::ClearStorage>, "ClearStorage"}, + {40201, D<&INewsService::ClearSubscriptionStatusAll>, "ClearSubscriptionStatusAll"}, + {90100, D<&INewsService::GetNewsDatabaseDump>, "GetNewsDatabaseDump"}, + }; + // clang-format on + + RegisterHandlers(functions); } INewsService::~INewsService() = default; diff --git a/src/core/hle/service/bcat/news/news_service.h b/src/core/hle/service/bcat/news/news_service.h index 577147e604..5d6109243b 100644 --- a/src/core/hle/service/bcat/news/news_service.h +++ b/src/core/hle/service/bcat/news/news_service.h @@ -22,15 +22,22 @@ public: private: Result PostLocalNews(InBuffer buffer_data); + Result SetPassphrase(InBuffer buffer_data); + Result GetSubscriptionStatus(Out out_status, InBuffer buffer_data); + Result GetTopicList(Out out_count, OutBuffer out_topics, s32 filter); + Result IsSystemUpdateRequired(Out out_is_system_update_required); + Result RequestAutoSubscription(u64 value); + Result ClearStorage(); + Result ClearSubscriptionStatusAll(); + Result GetNewsDatabaseDump(); - std::optional FindRequest(u32 key) override; }; } // namespace Service::News diff --git a/src/core/hle/service/bcat/news/news_storage.cpp b/src/core/hle/service/bcat/news/news_storage.cpp index 793c1fa94f..b65b680771 100644 --- a/src/core/hle/service/bcat/news/news_storage.cpp +++ b/src/core/hle/service/bcat/news/news_storage.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later #include "core/hle/service/bcat/news/news_storage.h" diff --git a/src/core/hle/service/bcat/news/overwrite_event_holder.cpp b/src/core/hle/service/bcat/news/overwrite_event_holder.cpp index a6b3029e83..08449f1c4a 100644 --- a/src/core/hle/service/bcat/news/overwrite_event_holder.cpp +++ b/src/core/hle/service/bcat/news/overwrite_event_holder.cpp @@ -9,16 +9,16 @@ namespace Service::News { -std::optional IOverwriteEventHolder::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IOverwriteEventHolder::Get>, "Get"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IOverwriteEventHolder::IOverwriteEventHolder(Core::System& system_) - : ServiceFramework{system_, "IOverwriteEventHolder"} - , service_context{system_, "IOverwriteEventHolder"} { + : ServiceFramework{system_, "IOverwriteEventHolder"}, service_context{system_, + "IOverwriteEventHolder"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IOverwriteEventHolder::Get>, "Get"}, + }; + // clang-format on + + RegisterHandlers(functions); overwrite_event = service_context.CreateEvent("IOverwriteEventHolder::OverwriteEvent"); } diff --git a/src/core/hle/service/bcat/news/overwrite_event_holder.h b/src/core/hle/service/bcat/news/overwrite_event_holder.h index ba52a36527..507f6ab668 100644 --- a/src/core/hle/service/bcat/news/overwrite_event_holder.h +++ b/src/core/hle/service/bcat/news/overwrite_event_holder.h @@ -29,7 +29,6 @@ public: private: Result Get(OutCopyHandle out_event); - std::optional FindRequest(u32 key) override; Kernel::KEvent* overwrite_event; KernelHelpers::ServiceContext service_context; }; diff --git a/src/core/hle/service/bcat/news/service_creator.cpp b/src/core/hle/service/bcat/news/service_creator.cpp index 66e3b1277e..f27e4e52e6 100644 --- a/src/core/hle/service/bcat/news/service_creator.cpp +++ b/src/core/hle/service/bcat/news/service_creator.cpp @@ -14,19 +14,19 @@ namespace Service::News { -std::optional IServiceCreator::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IServiceCreator::CreateNewsService>, "CreateNewsService"}, - FunctionInfo{1, D<&IServiceCreator::CreateNewlyArrivedEventHolder>, "CreateNewlyArrivedEventHolder"}, - FunctionInfo{2, D<&IServiceCreator::CreateNewsDataService>, "CreateNewsDataService"}, - FunctionInfo{3, D<&IServiceCreator::CreateNewsDatabaseService>, "CreateNewsDatabaseService"}, - FunctionInfo{4, D<&IServiceCreator::CreateOverwriteEventHolder>, "CreateOverwriteEventHolder"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IServiceCreator::IServiceCreator(Core::System& system_, u32 permissions_, const char* name_) : ServiceFramework{system_, name_}, permissions{permissions_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IServiceCreator::CreateNewsService>, "CreateNewsService"}, + {1, D<&IServiceCreator::CreateNewlyArrivedEventHolder>, "CreateNewlyArrivedEventHolder"}, + {2, D<&IServiceCreator::CreateNewsDataService>, "CreateNewsDataService"}, + {3, D<&IServiceCreator::CreateNewsDatabaseService>, "CreateNewsDatabaseService"}, + {4, D<&IServiceCreator::CreateOverwriteEventHolder>, "CreateOverwriteEventHolder"}, + }; + // clang-format on + + RegisterHandlers(functions); } IServiceCreator::~IServiceCreator() = default; diff --git a/src/core/hle/service/bcat/news/service_creator.h b/src/core/hle/service/bcat/news/service_creator.h index a87f30b67e..42fbccd2a0 100644 --- a/src/core/hle/service/bcat/news/service_creator.h +++ b/src/core/hle/service/bcat/news/service_creator.h @@ -32,7 +32,6 @@ private: Result CreateNewsDatabaseService(OutInterface out_interface); Result CreateOverwriteEventHolder(OutInterface out_interface); - std::optional FindRequest(u32 key) override; u32 permissions; }; diff --git a/src/core/hle/service/bcat/service_creator.cpp b/src/core/hle/service/bcat/service_creator.cpp index 83f97bb17a..15f59d3056 100644 --- a/src/core/hle/service/bcat/service_creator.cpp +++ b/src/core/hle/service/bcat/service_creator.cpp @@ -13,17 +13,6 @@ namespace Service::BCAT { -std::optional IServiceCreator::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IServiceCreator::CreateBcatService>, "CreateBcatService"}, - FunctionInfo{1, D<&IServiceCreator::CreateDeliveryCacheStorageService>, "CreateDeliveryCacheStorageService"}, - FunctionInfo{2, D<&IServiceCreator::CreateDeliveryCacheStorageServiceWithApplicationId>, "CreateDeliveryCacheStorageServiceWithApplicationId"}, - FunctionInfo{3, nullptr, "CreateDeliveryCacheProgressService"}, - FunctionInfo{4, nullptr, "CreateDeliveryCacheProgressServiceWithApplicationId"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - std::unique_ptr CreateBackendFromSettings([[maybe_unused]] Core::System& system, DirectoryGetter getter) { return std::make_unique(std::move(getter)); @@ -31,7 +20,20 @@ std::unique_ptr CreateBackendFromSettings([[maybe_unused]] Core::Sy IServiceCreator::IServiceCreator(Core::System& system_, const char* name_) : ServiceFramework{system_, name_}, fsc{system.GetFileSystemController()} { - backend = CreateBackendFromSettings(system_, [this](u64 tid) { return fsc.GetBCATDirectory(tid); }); + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IServiceCreator::CreateBcatService>, "CreateBcatService"}, + {1, D<&IServiceCreator::CreateDeliveryCacheStorageService>, "CreateDeliveryCacheStorageService"}, + {2, D<&IServiceCreator::CreateDeliveryCacheStorageServiceWithApplicationId>, "CreateDeliveryCacheStorageServiceWithApplicationId"}, + {3, nullptr, "CreateDeliveryCacheProgressService"}, + {4, nullptr, "CreateDeliveryCacheProgressServiceWithApplicationId"}, + }; + // clang-format on + + RegisterHandlers(functions); + + backend = + CreateBackendFromSettings(system_, [this](u64 tid) { return fsc.GetBCATDirectory(tid); }); } IServiceCreator::~IServiceCreator() = default; diff --git a/src/core/hle/service/bcat/service_creator.h b/src/core/hle/service/bcat/service_creator.h index 02527574dc..2245007d6c 100644 --- a/src/core/hle/service/bcat/service_creator.h +++ b/src/core/hle/service/bcat/service_creator.h @@ -36,7 +36,6 @@ private: Result CreateDeliveryCacheStorageServiceWithApplicationId( u64 application_id, OutInterface out_interface); - std::optional FindRequest(u32 key) override; std::unique_ptr backend; Service::FileSystem::FileSystemController& fsc; }; diff --git a/src/core/hle/service/bpc/bpc.cpp b/src/core/hle/service/bpc/bpc.cpp index 7c31cd190d..6f2e00b22b 100644 --- a/src/core/hle/service/bpc/bpc.cpp +++ b/src/core/hle/service/bpc/bpc.cpp @@ -14,101 +14,103 @@ namespace Service::BPC { class BPC final : public ServiceFramework { public: - explicit BPC(Core::System& system_) : ServiceFramework{system_, "bpc"} {} + explicit BPC(Core::System& system_) : ServiceFramework{system_, "bpc"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ShutdownSystem"}, + {1, nullptr, "RebootSystem"}, + {2, nullptr, "GetWakeupReason"}, + {3, nullptr, "GetShutdownReason"}, + {4, nullptr, "GetAcOk"}, + {5, nullptr, "GetBoardPowerControlEvent"}, + {6, nullptr, "GetSleepButtonState"}, + {7, nullptr, "GetPowerEvent"}, + {8, nullptr, "CreateWakeupTimer"}, + {9, nullptr, "CancelWakeupTimer"}, + {10, nullptr, "EnableWakeupTimerOnDevice"}, + {11, nullptr, "CreateWakeupTimerEx"}, + {12, nullptr, "GetLastEnabledWakeupTimerType"}, + {13, nullptr, "CleanAllWakeupTimers"}, + {14, nullptr, "GetPowerButton"}, + {15, nullptr, "SetEnableWakeupTimer"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "ShutdownSystem"}, - FunctionInfo{1, nullptr, "RebootSystem"}, - FunctionInfo{2, nullptr, "GetWakeupReason"}, - FunctionInfo{3, nullptr, "GetShutdownReason"}, - FunctionInfo{4, nullptr, "GetAcOk"}, - FunctionInfo{5, nullptr, "GetBoardPowerControlEvent"}, - FunctionInfo{6, nullptr, "GetSleepButtonState"}, - FunctionInfo{7, nullptr, "GetPowerEvent"}, - FunctionInfo{8, nullptr, "CreateWakeupTimer"}, - FunctionInfo{9, nullptr, "CancelWakeupTimer"}, - FunctionInfo{10, nullptr, "EnableWakeupTimerOnDevice"}, - FunctionInfo{11, nullptr, "CreateWakeupTimerEx"}, - FunctionInfo{12, nullptr, "GetLastEnabledWakeupTimerType"}, - FunctionInfo{13, nullptr, "CleanAllWakeupTimers"}, - FunctionInfo{14, nullptr, "GetPowerButton"}, - FunctionInfo{15, nullptr, "SetEnableWakeupTimer"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class BPC_R final : public ServiceFramework { public: - explicit BPC_R(Core::System& system_) : ServiceFramework{system_, "bpc:r"} {} + explicit BPC_R(Core::System& system_) : ServiceFramework{system_, "bpc:r"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetRtcTime"}, + {1, nullptr, "SetRtcTime"}, + {2, nullptr, "GetRtcResetDetected"}, + {3, nullptr, "ClearRtcResetDetected"}, + {4, nullptr, "SetUpRtcResetOnShutdown"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetRtcTime"}, - FunctionInfo{1, nullptr, "SetRtcTime"}, - FunctionInfo{2, nullptr, "GetRtcResetDetected"}, - FunctionInfo{3, nullptr, "ClearRtcResetDetected"}, - FunctionInfo{4, nullptr, "SetUpRtcResetOnShutdown"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class BPC_C final : public ServiceFramework { public: - explicit BPC_C(Core::System& system_) : ServiceFramework{system_, "bpc:c"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "ShutdownSystem"}, - FunctionInfo{1, nullptr, "RebootSystem"}, - FunctionInfo{2, nullptr, "GetWakeupReason"}, - FunctionInfo{3, nullptr, "GetShutdownReason"}, - FunctionInfo{4, nullptr, "GetAcOk"}, - FunctionInfo{5, nullptr, "GetPowerEvent"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit BPC_C(Core::System& system_) : ServiceFramework{system_, "bpc:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ShutdownSystem"}, + {1, nullptr, "RebootSystem"}, + {2, nullptr, "GetWakeupReason"}, + {3, nullptr, "GetShutdownReason"}, + {4, nullptr, "GetAcOk"}, + {5, nullptr, "GetPowerEvent"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class BPC_B final : public ServiceFramework { public: - explicit BPC_B(Core::System& system_) : ServiceFramework{system_, "bpc:b"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetSleepButtonState"}, - FunctionInfo{1, nullptr, "GetPowerButtonEvent"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit BPC_B(Core::System& system_) : ServiceFramework{system_, "bpc:b"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetSleepButtonState"}, + {1, nullptr, "GetPowerButtonEvent"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class BPC_W final : public ServiceFramework { public: - explicit BPC_W(Core::System& system_) : ServiceFramework{system_, "bpc:w"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateWakeupTimer"}, - FunctionInfo{1, nullptr, "CancelWakeupTimer"}, - FunctionInfo{2, nullptr, "EnableWakeupTimerOnDevice"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit BPC_W(Core::System& system_) : ServiceFramework{system_, "bpc:w"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateWakeupTimer"}, + {1, nullptr, "CancelWakeupTimer"}, + {2, nullptr, "EnableWakeupTimerOnDevice"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class BPC_AMS final : public ServiceFramework { public: - explicit BPC_AMS(Core::System& system_) : ServiceFramework{system_, "bpc:ams"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{65000, nullptr, "RebootToFatalError"}, - FunctionInfo{65001, nullptr, "SetRebootPayload"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit BPC_AMS(Core::System& system_) : ServiceFramework{system_, "bpc:ams"} { + // clang-format off + static const FunctionInfo functions[] = { + {65000, nullptr, "RebootToFatalError"}, + {65001, nullptr, "SetRebootPayload"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/bpc/bpc.h b/src/core/hle/service/bpc/bpc.h index 524391ddb5..bf13ce5bae 100644 --- a/src/core/hle/service/bpc/bpc.h +++ b/src/core/hle/service/bpc/bpc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index 913c9475e9..256a722a84 100644 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp @@ -20,13 +20,24 @@ namespace Service::BtDrv { class IBluetoothUser final : public ServiceFramework { public: explicit IBluetoothUser(Core::System& system_) - : ServiceFramework{system_, "bt"} - , service_context{system_, "bt"} { - register_event = service_context.CreateEvent("BT:RegisterEvent"); - } + : ServiceFramework{system_, "bt"}, service_context{system_, "bt"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "LeClientReadCharacteristic"}, + {1, nullptr, "LeClientReadDescriptor"}, + {2, nullptr, "LeClientWriteCharacteristic"}, + {3, nullptr, "LeClientWriteDescriptor"}, + {4, nullptr, "LeClientRegisterNotification"}, + {5, nullptr, "LeClientDeregisterNotification"}, + {6, nullptr, "SetLeResponse"}, + {7, nullptr, "LeSendIndication"}, + {8, nullptr, "GetLeEventInfo"}, + {9, C<&IBluetoothUser::RegisterBleEvent>, "RegisterBleEvent"}, + }; + // clang-format on + RegisterHandlers(functions); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + register_event = service_context.CreateEvent("BT:RegisterEvent"); } ~IBluetoothUser() override { @@ -41,28 +52,151 @@ private: R_SUCCEED(); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "LeClientReadCharacteristic"}, - FunctionInfo{1, nullptr, "LeClientReadDescriptor"}, - FunctionInfo{2, nullptr, "LeClientWriteCharacteristic"}, - FunctionInfo{3, nullptr, "LeClientWriteDescriptor"}, - FunctionInfo{4, nullptr, "LeClientRegisterNotification"}, - FunctionInfo{5, nullptr, "LeClientDeregisterNotification"}, - FunctionInfo{6, nullptr, "SetLeResponse"}, - FunctionInfo{7, nullptr, "LeSendIndication"}, - FunctionInfo{8, nullptr, "GetLeEventInfo"}, - FunctionInfo{9, C<&IBluetoothUser::RegisterBleEvent>, "RegisterBleEvent"} - ); KernelHelpers::ServiceContext service_context; + Kernel::KEvent* register_event; }; class IBluetoothDriver final : public ServiceFramework { public: - explicit IBluetoothDriver(Core::System& system_) : ServiceFramework{system_, "btdrv"} {} + explicit IBluetoothDriver(Core::System& system_) : ServiceFramework{system_, "btdrv"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "InitializeBluetoothDriver"}, + {1, nullptr, "InitializeBluetooth"}, + {2, nullptr, "EnableBluetooth"}, + {3, nullptr, "DisableBluetooth"}, + {4, nullptr, "FinalizeBluetooth"}, + {5, nullptr, "GetAdapterProperties"}, + {6, nullptr, "GetAdapterProperty"}, + {7, nullptr, "SetAdapterProperty"}, + {8, nullptr, "StartInquiry"}, + {9, nullptr, "StopInquiry"}, + {10, nullptr, "CreateBond"}, + {11, nullptr, "RemoveBond"}, + {12, nullptr, "CancelBond"}, + {13, nullptr, "RespondToPinRequest"}, + {14, nullptr, "RespondToSspRequest"}, + {15, nullptr, "GetEventInfo"}, + {16, nullptr, "InitializeHid"}, + {17, nullptr, "OpenHidConnection"}, + {18, nullptr, "CloseHidConnection"}, + {19, nullptr, "WriteHidData"}, + {20, nullptr, "WriteHidData2"}, + {21, nullptr, "SetHidReport"}, + {22, nullptr, "GetHidReport"}, + {23, nullptr, "TriggerConnection"}, + {24, nullptr, "AddPairedDeviceInfo"}, + {25, nullptr, "GetPairedDeviceInfo"}, + {26, nullptr, "FinalizeHid"}, + {27, nullptr, "GetHidEventInfo"}, + {28, nullptr, "SetTsi"}, + {29, nullptr, "EnableBurstMode"}, + {30, nullptr, "SetZeroRetransmission"}, + {31, nullptr, "EnableMcMode"}, + {32, nullptr, "EnableLlrScan"}, + {33, nullptr, "DisableLlrScan"}, + {34, C<&IBluetoothDriver::EnableRadio>, "EnableRadio"}, + {35, nullptr, "SetVisibility"}, + {36, nullptr, "EnableTbfcScan"}, + {37, nullptr, "RegisterHidReportEvent"}, + {38, nullptr, "GetHidReportEventInfo"}, + {39, nullptr, "GetLatestPlr"}, + {40, nullptr, "GetPendingConnections"}, + {41, nullptr, "GetChannelMap"}, + {42, nullptr, "EnableTxPowerBoostSetting"}, + {43, nullptr, "IsTxPowerBoostSettingEnabled"}, + {44, nullptr, "EnableAfhSetting"}, + {45, nullptr, "IsAfhSettingEnabled"}, + {46, nullptr, "InitializeBle"}, + {47, nullptr, "EnableBle"}, + {48, nullptr, "DisableBle"}, + {49, nullptr, "FinalizeBle"}, + {50, nullptr, "SetBleVisibility"}, + {51, nullptr, "SetBleConnectionParameter"}, + {52, nullptr, "SetBleDefaultConnectionParameter"}, + {53, nullptr, "SetBleAdvertiseData"}, + {54, nullptr, "SetBleAdvertiseParameter"}, + {55, nullptr, "StartBleScan"}, + {56, nullptr, "StopBleScan"}, + {57, nullptr, "AddBleScanFilterCondition"}, + {58, nullptr, "DeleteBleScanFilterCondition"}, + {59, nullptr, "DeleteBleScanFilter"}, + {60, nullptr, "ClearBleScanFilters"}, + {61, nullptr, "EnableBleScanFilter"}, + {62, nullptr, "RegisterGattClient"}, + {63, nullptr, "UnregisterGattClient"}, + {64, nullptr, "UnregisterAllGattClients"}, + {65, nullptr, "ConnectGattServer"}, + {66, nullptr, "CancelConnectGattServer"}, + {67, nullptr, "DisconnectGattServer"}, + {68, nullptr, "GetGattAttribute"}, + {69, nullptr, "GetGattService"}, + {70, nullptr, "ConfigureAttMtu"}, + {71, nullptr, "RegisterGattServer"}, + {72, nullptr, "UnregisterGattServer"}, + {73, nullptr, "ConnectGattClient"}, + {74, nullptr, "DisconnectGattClient"}, + {75, nullptr, "AddGattService"}, + {76, nullptr, "EnableGattService"}, + {77, nullptr, "AddGattCharacteristic"}, + {78, nullptr, "AddGattDescriptor"}, + {79, nullptr, "GetBleManagedEventInfo"}, + {80, nullptr, "GetGattFirstCharacteristic"}, + {81, nullptr, "GetGattNextCharacteristic"}, + {82, nullptr, "GetGattFirstDescriptor"}, + {83, nullptr, "GetGattNextDescriptor"}, + {84, nullptr, "RegisterGattManagedDataPath"}, + {85, nullptr, "UnregisterGattManagedDataPath"}, + {86, nullptr, "RegisterGattHidDataPath"}, + {87, nullptr, "UnregisterGattHidDataPath"}, + {88, nullptr, "RegisterGattDataPath"}, + {89, nullptr, "UnregisterGattDataPath"}, + {90, nullptr, "ReadGattCharacteristic"}, + {91, nullptr, "ReadGattDescriptor"}, + {92, nullptr, "WriteGattCharacteristic"}, + {93, nullptr, "WriteGattDescriptor"}, + {94, nullptr, "RegisterGattNotification"}, + {95, nullptr, "UnregisterGattNotification"}, + {96, nullptr, "GetLeHidEventInfo"}, + {97, nullptr, "RegisterBleHidEvent"}, + {98, nullptr, "SetBleScanParameter"}, + {99, nullptr, "MoveToSecondaryPiconet"}, + {100, nullptr, "IsBluetoothEnabled"}, + {128, nullptr, "AcquireAudioEvent"}, + {129, nullptr, "GetAudioEventInfo"}, + {130, nullptr, "OpenAudioConnection"}, + {131, nullptr, "CloseAudioConnection"}, + {132, nullptr, "OpenAudioOut"}, + {133, nullptr, "CloseAudioOut"}, + {134, nullptr, "AcquireAudioOutStateChangedEvent"}, + {135, nullptr, "StartAudioOut"}, + {136, nullptr, "StopAudioOut"}, + {137, nullptr, "GetAudioOutState"}, + {138, nullptr, "GetAudioOutFeedingCodec"}, + {139, nullptr, "GetAudioOutFeedingParameter"}, + {140, nullptr, "AcquireAudioOutBufferAvailableEvent"}, + {141, nullptr, "SendAudioData"}, + {142, nullptr, "AcquireAudioControlInputStateChangedEvent"}, + {143, nullptr, "GetAudioControlInputState"}, + {144, nullptr, "AcquireAudioConnectionStateChangedEvent"}, + {145, nullptr, "GetConnectedAudioDevice"}, + {146, nullptr, "CloseAudioControlInput"}, + {147, nullptr, "RegisterAudioControlNotification"}, + {148, nullptr, "SendAudioControlPassthroughCommand"}, + {149, nullptr, "SendAudioControlSetAbsoluteVolumeCommand"}, + {150, nullptr, "AcquireAudioSinkVolumeLocallyChangedEvent"}, + {151, nullptr, "AcquireAudioSinkVolumeUpdateRequestCompletedEvent"}, + {152, nullptr, "GetAudioSinkVolume"}, + {153, nullptr, "RequestUpdateAudioSinkVolume"}, + {154, nullptr, "IsAudioSinkVolumeSupported"}, + {256, nullptr, "IsManufacturingMode"}, + {257, nullptr, "EmulateBluetoothCrash"}, + {258, nullptr, "GetBleChannelMap"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -70,140 +204,6 @@ private: LOG_WARNING(Service_BTDRV, "(STUBBED) called"); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "InitializeBluetoothDriver"}, - FunctionInfo{1, nullptr, "InitializeBluetooth"}, - FunctionInfo{2, nullptr, "EnableBluetooth"}, - FunctionInfo{3, nullptr, "DisableBluetooth"}, - FunctionInfo{4, nullptr, "FinalizeBluetooth"}, - FunctionInfo{5, nullptr, "GetAdapterProperties"}, - FunctionInfo{6, nullptr, "GetAdapterProperty"}, - FunctionInfo{7, nullptr, "SetAdapterProperty"}, - FunctionInfo{8, nullptr, "StartInquiry"}, - FunctionInfo{9, nullptr, "StopInquiry"}, - FunctionInfo{10, nullptr, "CreateBond"}, - FunctionInfo{11, nullptr, "RemoveBond"}, - FunctionInfo{12, nullptr, "CancelBond"}, - FunctionInfo{13, nullptr, "RespondToPinRequest"}, - FunctionInfo{14, nullptr, "RespondToSspRequest"}, - FunctionInfo{15, nullptr, "GetEventInfo"}, - FunctionInfo{16, nullptr, "InitializeHid"}, - FunctionInfo{17, nullptr, "OpenHidConnection"}, - FunctionInfo{18, nullptr, "CloseHidConnection"}, - FunctionInfo{19, nullptr, "WriteHidData"}, - FunctionInfo{20, nullptr, "WriteHidData2"}, - FunctionInfo{21, nullptr, "SetHidReport"}, - FunctionInfo{22, nullptr, "GetHidReport"}, - FunctionInfo{23, nullptr, "TriggerConnection"}, - FunctionInfo{24, nullptr, "AddPairedDeviceInfo"}, - FunctionInfo{25, nullptr, "GetPairedDeviceInfo"}, - FunctionInfo{26, nullptr, "FinalizeHid"}, - FunctionInfo{27, nullptr, "GetHidEventInfo"}, - FunctionInfo{28, nullptr, "SetTsi"}, - FunctionInfo{29, nullptr, "EnableBurstMode"}, - FunctionInfo{30, nullptr, "SetZeroRetransmission"}, - FunctionInfo{31, nullptr, "EnableMcMode"}, - FunctionInfo{32, nullptr, "EnableLlrScan"}, - FunctionInfo{33, nullptr, "DisableLlrScan"}, - FunctionInfo{34, C<&IBluetoothDriver::EnableRadio>, "EnableRadio"}, - FunctionInfo{35, nullptr, "SetVisibility"}, - FunctionInfo{36, nullptr, "EnableTbfcScan"}, - FunctionInfo{37, nullptr, "RegisterHidReportEvent"}, - FunctionInfo{38, nullptr, "GetHidReportEventInfo"}, - FunctionInfo{39, nullptr, "GetLatestPlr"}, - FunctionInfo{40, nullptr, "GetPendingConnections"}, - FunctionInfo{41, nullptr, "GetChannelMap"}, - FunctionInfo{42, nullptr, "EnableTxPowerBoostSetting"}, - FunctionInfo{43, nullptr, "IsTxPowerBoostSettingEnabled"}, - FunctionInfo{44, nullptr, "EnableAfhSetting"}, - FunctionInfo{45, nullptr, "IsAfhSettingEnabled"}, - FunctionInfo{46, nullptr, "InitializeBle"}, - FunctionInfo{47, nullptr, "EnableBle"}, - FunctionInfo{48, nullptr, "DisableBle"}, - FunctionInfo{49, nullptr, "FinalizeBle"}, - FunctionInfo{50, nullptr, "SetBleVisibility"}, - FunctionInfo{51, nullptr, "SetBleConnectionParameter"}, - FunctionInfo{52, nullptr, "SetBleDefaultConnectionParameter"}, - FunctionInfo{53, nullptr, "SetBleAdvertiseData"}, - FunctionInfo{54, nullptr, "SetBleAdvertiseParameter"}, - FunctionInfo{55, nullptr, "StartBleScan"}, - FunctionInfo{56, nullptr, "StopBleScan"}, - FunctionInfo{57, nullptr, "AddBleScanFilterCondition"}, - FunctionInfo{58, nullptr, "DeleteBleScanFilterCondition"}, - FunctionInfo{59, nullptr, "DeleteBleScanFilter"}, - FunctionInfo{60, nullptr, "ClearBleScanFilters"}, - FunctionInfo{61, nullptr, "EnableBleScanFilter"}, - FunctionInfo{62, nullptr, "RegisterGattClient"}, - FunctionInfo{63, nullptr, "UnregisterGattClient"}, - FunctionInfo{64, nullptr, "UnregisterAllGattClients"}, - FunctionInfo{65, nullptr, "ConnectGattServer"}, - FunctionInfo{66, nullptr, "CancelConnectGattServer"}, - FunctionInfo{67, nullptr, "DisconnectGattServer"}, - FunctionInfo{68, nullptr, "GetGattAttribute"}, - FunctionInfo{69, nullptr, "GetGattService"}, - FunctionInfo{70, nullptr, "ConfigureAttMtu"}, - FunctionInfo{71, nullptr, "RegisterGattServer"}, - FunctionInfo{72, nullptr, "UnregisterGattServer"}, - FunctionInfo{73, nullptr, "ConnectGattClient"}, - FunctionInfo{74, nullptr, "DisconnectGattClient"}, - FunctionInfo{75, nullptr, "AddGattService"}, - FunctionInfo{76, nullptr, "EnableGattService"}, - FunctionInfo{77, nullptr, "AddGattCharacteristic"}, - FunctionInfo{78, nullptr, "AddGattDescriptor"}, - FunctionInfo{79, nullptr, "GetBleManagedEventInfo"}, - FunctionInfo{80, nullptr, "GetGattFirstCharacteristic"}, - FunctionInfo{81, nullptr, "GetGattNextCharacteristic"}, - FunctionInfo{82, nullptr, "GetGattFirstDescriptor"}, - FunctionInfo{83, nullptr, "GetGattNextDescriptor"}, - FunctionInfo{84, nullptr, "RegisterGattManagedDataPath"}, - FunctionInfo{85, nullptr, "UnregisterGattManagedDataPath"}, - FunctionInfo{86, nullptr, "RegisterGattHidDataPath"}, - FunctionInfo{87, nullptr, "UnregisterGattHidDataPath"}, - FunctionInfo{88, nullptr, "RegisterGattDataPath"}, - FunctionInfo{89, nullptr, "UnregisterGattDataPath"}, - FunctionInfo{90, nullptr, "ReadGattCharacteristic"}, - FunctionInfo{91, nullptr, "ReadGattDescriptor"}, - FunctionInfo{92, nullptr, "WriteGattCharacteristic"}, - FunctionInfo{93, nullptr, "WriteGattDescriptor"}, - FunctionInfo{94, nullptr, "RegisterGattNotification"}, - FunctionInfo{95, nullptr, "UnregisterGattNotification"}, - FunctionInfo{96, nullptr, "GetLeHidEventInfo"}, - FunctionInfo{97, nullptr, "RegisterBleHidEvent"}, - FunctionInfo{98, nullptr, "SetBleScanParameter"}, - FunctionInfo{99, nullptr, "MoveToSecondaryPiconet"}, - FunctionInfo{100, nullptr, "IsBluetoothEnabled"}, - FunctionInfo{128, nullptr, "AcquireAudioEvent"}, - FunctionInfo{129, nullptr, "GetAudioEventInfo"}, - FunctionInfo{130, nullptr, "OpenAudioConnection"}, - FunctionInfo{131, nullptr, "CloseAudioConnection"}, - FunctionInfo{132, nullptr, "OpenAudioOut"}, - FunctionInfo{133, nullptr, "CloseAudioOut"}, - FunctionInfo{134, nullptr, "AcquireAudioOutStateChangedEvent"}, - FunctionInfo{135, nullptr, "StartAudioOut"}, - FunctionInfo{136, nullptr, "StopAudioOut"}, - FunctionInfo{137, nullptr, "GetAudioOutState"}, - FunctionInfo{138, nullptr, "GetAudioOutFeedingCodec"}, - FunctionInfo{139, nullptr, "GetAudioOutFeedingParameter"}, - FunctionInfo{140, nullptr, "AcquireAudioOutBufferAvailableEvent"}, - FunctionInfo{141, nullptr, "SendAudioData"}, - FunctionInfo{142, nullptr, "AcquireAudioControlInputStateChangedEvent"}, - FunctionInfo{143, nullptr, "GetAudioControlInputState"}, - FunctionInfo{144, nullptr, "AcquireAudioConnectionStateChangedEvent"}, - FunctionInfo{145, nullptr, "GetConnectedAudioDevice"}, - FunctionInfo{146, nullptr, "CloseAudioControlInput"}, - FunctionInfo{147, nullptr, "RegisterAudioControlNotification"}, - FunctionInfo{148, nullptr, "SendAudioControlPassthroughCommand"}, - FunctionInfo{149, nullptr, "SendAudioControlSetAbsoluteVolumeCommand"}, - FunctionInfo{150, nullptr, "AcquireAudioSinkVolumeLocallyChangedEvent"}, - FunctionInfo{151, nullptr, "AcquireAudioSinkVolumeUpdateRequestCompletedEvent"}, - FunctionInfo{152, nullptr, "GetAudioSinkVolume"}, - FunctionInfo{153, nullptr, "RequestUpdateAudioSinkVolume"}, - FunctionInfo{154, nullptr, "IsAudioSinkVolumeSupported"}, - FunctionInfo{256, nullptr, "IsManufacturingMode"}, - FunctionInfo{257, nullptr, "EmulateBluetoothCrash"}, - FunctionInfo{258, nullptr, "GetBleChannelMap"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/btdrv/btdrv.h b/src/core/hle/service/btdrv/btdrv.h index 42713860e6..4e739a96e3 100644 --- a/src/core/hle/service/btdrv/btdrv.h +++ b/src/core/hle/service/btdrv/btdrv.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index e8fa29af7c..b358387ffe 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp @@ -6,414 +6,111 @@ #include -#include "common/logging.h" -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/set/system_settings_server.h" -#include "core/hle/service/sm/sm.h" #include "core/hle/service/btm/btm.h" +#include "core/hle/service/btm/btm_debug.h" +#include "core/hle/service/btm/btm_system.h" +#include "core/hle/service/btm/btm_user.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" -namespace Kernel { -class KEvent; -class KReadableEvent; -} // namespace Kernel - -namespace Core { -class System; -} - -namespace Service::Set { -class ISystemSettingsServer; -} - namespace Service::BTM { -class IBtmSystemCore final : public ServiceFramework { -public: - explicit IBtmSystemCore(Core::System& system_) - : ServiceFramework{system_, "IBtmSystemCore"}, service_context{system_, "IBtmSystemCore"} { - radio_event = service_context.CreateEvent("IBtmSystemCore:RadioEvent"); - audio_device_connection_event = service_context.CreateEvent("IBtmSystemCore:AudioDeviceConnectionEvent"); - m_set_sys = system.ServiceManager().GetService("set:sys", true); - } - - ~IBtmSystemCore() override { - service_context.CloseEvent(radio_event); - service_context.CloseEvent(audio_device_connection_event); - } - - Result StartGamepadPairing() { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - R_SUCCEED(); - } - - Result CancelGamepadPairing() { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - R_SUCCEED(); - } - - Result EnableRadio() { - LOG_DEBUG(Service_BTM, "called"); - - R_RETURN(m_set_sys->SetBluetoothEnableFlag(true)); - } - Result DisableRadio() { - LOG_DEBUG(Service_BTM, "called"); - - R_RETURN(m_set_sys->SetBluetoothEnableFlag(false)); - } - - Result IsRadioEnabled(Out out_is_enabled) { - LOG_DEBUG(Service_BTM, "called"); - - R_RETURN(m_set_sys->GetBluetoothEnableFlag(out_is_enabled)); - } - - Result AcquireRadioEvent(Out out_is_valid, - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &radio_event->GetReadableEvent(); - R_SUCCEED(); - } - - Result GetDiscoveredAudioDevice(OutArray, BufferAttr_HipcPointer> out_audio_devices, s32 count, Out out_total) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - R_SUCCEED(); - } - - Result AcquireAudioDeviceConnectionEvent( - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_event = &audio_device_connection_event->GetReadableEvent(); - R_SUCCEED(); - } - - Result GetConnectedAudioDevices( - Out out_count, OutArray, BufferAttr_HipcPointer> out_audio_devices) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_count = 0; - R_SUCCEED(); - } - - Result GetPairedAudioDevices( - Out out_count, OutArray, BufferAttr_HipcPointer> out_audio_devices) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_count = 0; - R_SUCCEED(); - } - - Result RequestAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) { - LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid); - R_SUCCEED(); - } - - Result CancelAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) { - LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IBtmSystemCore::StartGamepadPairing>, "StartGamepadPairing"}, - FunctionInfo{1, C<&IBtmSystemCore::CancelGamepadPairing>, "CancelGamepadPairing"}, - FunctionInfo{2, nullptr, "ClearGamepadPairingDatabase"}, - FunctionInfo{3, nullptr, "GetPairedGamepadCount"}, - FunctionInfo{4, C<&IBtmSystemCore::EnableRadio>, "EnableRadio"}, - FunctionInfo{5, C<&IBtmSystemCore::DisableRadio>, "DisableRadio"}, - FunctionInfo{6, C<&IBtmSystemCore::IsRadioEnabled>, "IsRadioEnabled"}, - FunctionInfo{7, C<&IBtmSystemCore::AcquireRadioEvent>, "AcquireRadioEvent"}, - FunctionInfo{8, nullptr, "AcquireGamepadPairingEvent"}, - FunctionInfo{9, nullptr, "IsGamepadPairingStarted"}, - FunctionInfo{10, nullptr, "StartAudioDeviceDiscovery"}, - FunctionInfo{11, nullptr, "StopAudioDeviceDiscovery"}, - FunctionInfo{12, nullptr, "IsDiscoveryingAudioDevice"}, - FunctionInfo{13, C<&IBtmSystemCore::GetDiscoveredAudioDevice>, "GetDiscoveredAudioDevice"}, - FunctionInfo{14, C<&IBtmSystemCore::AcquireAudioDeviceConnectionEvent>, "AcquireAudioDeviceConnectionEvent"}, - FunctionInfo{15, nullptr, "ConnectAudioDevice"}, - FunctionInfo{16, nullptr, "IsConnectingAudioDevice"}, - FunctionInfo{17, C<&IBtmSystemCore::GetConnectedAudioDevices>, "GetConnectedAudioDevices"}, - FunctionInfo{18, nullptr, "DisconnectAudioDevice"}, - FunctionInfo{19, nullptr, "AcquirePairedAudioDeviceInfoChangedEvent"}, - FunctionInfo{20, C<&IBtmSystemCore::GetPairedAudioDevices>, "GetPairedAudioDevices"}, - FunctionInfo{21, nullptr, "RemoveAudioDevicePairing"}, - FunctionInfo{22, C<&IBtmSystemCore::RequestAudioDeviceConnectionRejection>, "RequestAudioDeviceConnectionRejection"}, - FunctionInfo{23, C<&IBtmSystemCore::CancelAudioDeviceConnectionRejection>, "CancelAudioDeviceConnectionRejection"} - ); - KernelHelpers::ServiceContext service_context; - Kernel::KEvent* radio_event; - Kernel::KEvent* audio_device_connection_event; - std::shared_ptr m_set_sys; -}; - -class IBtmSystem final : public ServiceFramework { -public: - explicit IBtmSystem(Core::System& system_) : ServiceFramework{system_, "btm:sys"} {} - ~IBtmSystem() override = default; - - Result GetCore(OutInterface out_interface) { - LOG_WARNING(Service_BTM, "called"); - - *out_interface = std::make_shared(system); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IBtmSystem::GetCore>, "GetCore"} - ); -}; - -class IBtmUserCore final : public ServiceFramework { -public: - explicit IBtmUserCore(Core::System& system_) - : ServiceFramework{system_, "IBtmUserCore"}, service_context{system_, "IBtmUserCore"} { - scan_event = service_context.CreateEvent("IBtmUserCore:ScanEvent"); - connection_event = service_context.CreateEvent("IBtmUserCore:ConnectionEvent"); - service_discovery_event = service_context.CreateEvent("IBtmUserCore:DiscoveryEvent"); - config_event = service_context.CreateEvent("IBtmUserCore:ConfigEvent"); - } - - ~IBtmUserCore() override { - service_context.CloseEvent(scan_event); - service_context.CloseEvent(connection_event); - service_context.CloseEvent(service_discovery_event); - service_context.CloseEvent(config_event); - } - - Result AcquireBleScanEvent(Out out_is_valid, - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &scan_event->GetReadableEvent(); - R_SUCCEED(); - } - - Result AcquireBleConnectionEvent(Out out_is_valid, - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &connection_event->GetReadableEvent(); - R_SUCCEED(); - } - - Result AcquireBleServiceDiscoveryEvent( - Out out_is_valid, OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &service_discovery_event->GetReadableEvent(); - R_SUCCEED(); - } - - Result AcquireBleMtuConfigEvent(Out out_is_valid, - OutCopyHandle out_event) { - LOG_WARNING(Service_BTM, "(STUBBED) called"); - - *out_is_valid = true; - *out_event = &config_event->GetReadableEvent(); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IBtmUserCore::AcquireBleScanEvent>, "AcquireBleScanEvent"}, - FunctionInfo{1, nullptr, "GetBleScanFilterParameter"}, - FunctionInfo{2, nullptr, "GetBleScanFilterParameter2"}, - FunctionInfo{3, nullptr, "StartBleScanForGeneral"}, - FunctionInfo{4, nullptr, "StopBleScanForGeneral"}, - FunctionInfo{5, nullptr, "GetBleScanResultsForGeneral"}, - FunctionInfo{6, nullptr, "StartBleScanForPaired"}, - FunctionInfo{7, nullptr, "StopBleScanForPaired"}, - FunctionInfo{8, nullptr, "StartBleScanForSmartDevice"}, - FunctionInfo{9, nullptr, "StopBleScanForSmartDevice"}, - FunctionInfo{10, nullptr, "GetBleScanResultsForSmartDevice"}, - FunctionInfo{17, C<&IBtmUserCore::AcquireBleConnectionEvent>, "AcquireBleConnectionEvent"}, - FunctionInfo{18, nullptr, "BleConnect"}, - FunctionInfo{19, nullptr, "BleDisconnect"}, - FunctionInfo{20, nullptr, "BleGetConnectionState"}, - FunctionInfo{21, nullptr, "AcquireBlePairingEvent"}, - FunctionInfo{22, nullptr, "BlePairDevice"}, - FunctionInfo{23, nullptr, "BleUnPairDevice"}, - FunctionInfo{24, nullptr, "BleUnPairDevice2"}, - FunctionInfo{25, nullptr, "BleGetPairedDevices"}, - FunctionInfo{26, C<&IBtmUserCore::AcquireBleServiceDiscoveryEvent>, "AcquireBleServiceDiscoveryEvent"}, - FunctionInfo{27, nullptr, "GetGattServices"}, - FunctionInfo{28, nullptr, "GetGattService"}, - FunctionInfo{29, nullptr, "GetGattIncludedServices"}, - FunctionInfo{30, nullptr, "GetBelongingGattService"}, - FunctionInfo{31, nullptr, "GetGattCharacteristics"}, - FunctionInfo{32, nullptr, "GetGattDescriptors"}, - FunctionInfo{33, C<&IBtmUserCore::AcquireBleMtuConfigEvent>, "AcquireBleMtuConfigEvent"}, - FunctionInfo{34, nullptr, "ConfigureBleMtu"}, - FunctionInfo{35, nullptr, "GetBleMtu"}, - FunctionInfo{36, nullptr, "RegisterBleGattDataPath"}, - FunctionInfo{37, nullptr, "UnregisterBleGattDataPath"} - ); - KernelHelpers::ServiceContext service_context; - Kernel::KEvent* scan_event; - Kernel::KEvent* connection_event; - Kernel::KEvent* service_discovery_event; - Kernel::KEvent* config_event; -}; - -class IBtmUser final : public ServiceFramework { -public: - explicit IBtmUser(Core::System& system_) : ServiceFramework{system_, "btm:u"} {} - ~IBtmUser() override = default; - - Result GetCore(OutInterface out_interface) { - LOG_WARNING(Service_BTM, "called"); - - *out_interface = std::make_shared(system); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IBtmUser::GetCore>, "GetCore"} - ); -}; - -class IBtmDebug final : public ServiceFramework { -public: - explicit IBtmDebug(Core::System& system_) : ServiceFramework{system_, "btm:dbg"} {} - ~IBtmDebug() override = default; - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "AcquireDiscoveryEvent"}, - FunctionInfo{1, nullptr, "StartDiscovery"}, - FunctionInfo{2, nullptr, "CancelDiscovery"}, - FunctionInfo{3, nullptr, "GetDeviceProperty"}, - FunctionInfo{4, nullptr, "CreateBond"}, - FunctionInfo{5, nullptr, "CancelBond"}, - FunctionInfo{6, nullptr, "SetTsiMode"}, - FunctionInfo{7, nullptr, "GeneralTest"}, - FunctionInfo{8, nullptr, "HidConnect"}, - FunctionInfo{9, nullptr, "GeneralGet", MakeVersionGate({5,0,0})}, - FunctionInfo{10, nullptr, "GetGattClientDisconnectionReason", MakeVersionGate({5,0,0})}, - FunctionInfo{11, nullptr, "GetBleConnectionParameter", MakeVersionGate({5,1,0})}, - FunctionInfo{12, nullptr, "GetBleConnectionParameterRequest", MakeVersionGate({5,1,0})}, - FunctionInfo{13, nullptr, "GetDiscoveredDevice", MakeVersionGate({12,0,0})}, - FunctionInfo{14, nullptr, "SleepAwakeLoopTest", MakeVersionGate({15,0,0})}, - FunctionInfo{15, nullptr, "SleepTest", MakeVersionGate({15,0,0})}, - FunctionInfo{16, nullptr, "MinimumAwakeTest", MakeVersionGate({15,0,0})}, - FunctionInfo{17, nullptr, "ForceEnableBtm", MakeVersionGate({15,0,0})} - ); -}; - class IBtm final : public ServiceFramework { public: - explicit IBtm(Core::System& system_) : ServiceFramework{system_, "btm"} {} + explicit IBtm(Core::System& system_) : ServiceFramework{system_, "btm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetState"}, + {1, nullptr, "GetHostDeviceProperty"}, + {2, nullptr, "AcquireDeviceConditionEvent"}, + {3, nullptr, "GetDeviceCondition"}, + {4, nullptr, "SetBurstMode"}, + {5, nullptr, "SetSlotMode"}, + {6, nullptr, "SetBluetoothMode"}, + {7, nullptr, "SetWlanMode"}, + {8, nullptr, "AcquireDeviceInfoEvent"}, + {9, nullptr, "GetDeviceInfo"}, + {10, nullptr, "AddDeviceInfo"}, + {11, nullptr, "RemoveDeviceInfo"}, + {12, nullptr, "IncreaseDeviceInfoOrder"}, + {13, nullptr, "LlrNotify"}, + {14, nullptr, "EnableRadio"}, + {15, nullptr, "DisableRadio"}, + {16, nullptr, "HidDisconnect"}, + {17, nullptr, "HidSetRetransmissionMode"}, + {18, nullptr, "AcquireAwakeReqEvent"}, + {19, nullptr, "AcquireLlrStateEvent"}, + {20, nullptr, "IsLlrStarted"}, + {21, nullptr, "EnableSlotSaving"}, + {22, nullptr, "ProtectDeviceInfo"}, + {23, nullptr, "AcquireBleScanEvent"}, + {24, nullptr, "GetBleScanParameterGeneral"}, + {25, nullptr, "GetBleScanParameterSmartDevice"}, + {26, nullptr, "StartBleScanForGeneral"}, + {27, nullptr, "StopBleScanForGeneral"}, + {28, nullptr, "GetBleScanResultsForGeneral"}, + {29, nullptr, "StartBleScanForPairedDevice"}, + {30, nullptr, "StopBleScanForPairedDevice"}, + {31, nullptr, "StartBleScanForSmartDevice"}, + {32, nullptr, "StopBleScanForSmartDevice"}, + {33, nullptr, "GetBleScanResultsForSmartDevice"}, + {34, nullptr, "AcquireBleConnectionEvent"}, + {35, nullptr, "BleConnect"}, + {36, nullptr, "BleOverrideConnection"}, + {37, nullptr, "BleDisconnect"}, + {38, nullptr, "BleGetConnectionState"}, + {39, nullptr, "BleGetGattClientConditionList"}, + {40, nullptr, "AcquireBlePairingEvent"}, + {41, nullptr, "BlePairDevice"}, + {42, nullptr, "BleUnpairDeviceOnBoth"}, + {43, nullptr, "BleUnpairDevice"}, + {44, nullptr, "BleGetPairedAddresses"}, + {45, nullptr, "AcquireBleServiceDiscoveryEvent"}, + {46, nullptr, "GetGattServices"}, + {47, nullptr, "GetGattService"}, + {48, nullptr, "GetGattIncludedServices"}, + {49, nullptr, "GetBelongingService"}, + {50, nullptr, "GetGattCharacteristics"}, + {51, nullptr, "GetGattDescriptors"}, + {52, nullptr, "AcquireBleMtuConfigEvent"}, + {53, nullptr, "ConfigureBleMtu"}, + {54, nullptr, "GetBleMtu"}, + {55, nullptr, "RegisterBleGattDataPath"}, + {56, nullptr, "UnregisterBleGattDataPath"}, + {57, nullptr, "RegisterAppletResourceUserId"}, + {58, nullptr, "UnregisterAppletResourceUserId"}, + {59, nullptr, "SetAppletResourceUserId"}, + {60, nullptr, "AcquireBleConnectionParameterUpdateEvent"}, //8.0.0+ + {61, nullptr, "SetCeLength"}, //8.0.0+ + {62, nullptr, "EnsureSlotExpansion"}, //9.0.0+ + {63, nullptr, "IsSlotExpansionEnsured"}, //9.0.0+ + {64, nullptr, "CancelConnectionTrigger"}, //10.0.0+ + {65, nullptr, "GetConnectionCapacity"}, //13.0.0+ + {66, nullptr, "GetWlanMode"}, //13.0.0+ + {67, nullptr, "IsSlotSavingEnabled"}, //13.0.0+ + {68, nullptr, "IsSlotSavingForPairingEnabled"}, //13.0.0+ + {69, nullptr, "AcquireAudioDeviceConnectionEvent"}, //13.0.0+ + {70, nullptr, "GetConnectedAudioDevices"}, //13.0.0+ + {71, nullptr, "SetAudioSourceVolume"}, //13.0.0+ + {72, nullptr, "GetAudioSourceVolume"}, //13.0.0+ + {73, nullptr, "RequestAudioDeviceConnectionRejection"}, //13.0.0+ + {74, nullptr, "CancelAudioDeviceConnectionRejection"}, //13.0.0+ + {75, nullptr, "GetPairedAudioDevices"}, //13.0.0+ + {76, nullptr, "SetWlanModeWithOption"}, //13.1.0+ + {100, nullptr, "AcquireConnectionDisallowedEvent"}, //13.0.0+ + {101, nullptr, "GetUsecaseViolationFactor"}, //13.0.0+ + {110, nullptr, "GetShortenedDeviceInfo"}, //13.0.0+ + {111, nullptr, "AcquirePairingCountUpdateEvent"},//13.0.0+ + {112, nullptr, "Unknown112"}, //14.0.0-14.1.2 + {113, nullptr, "Unknown113"}, //14.0.0-14.1.2 + {114, nullptr, "IsFirstAudioControlConnection"}, //14.0.0+ + {115, nullptr, "GetShortenedDeviceCondition"}, //14.0.0+ + {116, nullptr, "SetAudioSinkVolume"}, //15.0.0+ + {117, nullptr, "GetAudioSinkVolume"}, //15.0.0+ + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetState"}, - FunctionInfo{1, nullptr, "GetHostDeviceProperty"}, - FunctionInfo{2, nullptr, "AcquireDeviceConditionEvent"}, - FunctionInfo{3, nullptr, "GetDeviceCondition"}, - FunctionInfo{4, nullptr, "SetBurstMode"}, - FunctionInfo{5, nullptr, "SetSlotMode"}, - FunctionInfo{6, nullptr, "SetBluetoothMode"}, - FunctionInfo{7, nullptr, "SetWlanMode"}, - FunctionInfo{8, nullptr, "AcquireDeviceInfoEvent"}, - FunctionInfo{9, nullptr, "GetDeviceInfo"}, - FunctionInfo{10, nullptr, "AddDeviceInfo"}, - FunctionInfo{11, nullptr, "RemoveDeviceInfo"}, - FunctionInfo{12, nullptr, "IncreaseDeviceInfoOrder"}, - FunctionInfo{13, nullptr, "LlrNotify"}, - FunctionInfo{14, nullptr, "EnableRadio"}, - FunctionInfo{15, nullptr, "DisableRadio"}, - FunctionInfo{16, nullptr, "HidDisconnect"}, - FunctionInfo{17, nullptr, "HidSetRetransmissionMode"}, - FunctionInfo{18, nullptr, "AcquireAwakeReqEvent"}, - FunctionInfo{19, nullptr, "AcquireLlrStateEvent"}, - FunctionInfo{20, nullptr, "IsLlrStarted"}, - FunctionInfo{21, nullptr, "EnableSlotSaving"}, - FunctionInfo{22, nullptr, "ProtectDeviceInfo"}, - FunctionInfo{23, nullptr, "AcquireBleScanEvent"}, - FunctionInfo{24, nullptr, "GetBleScanParameterGeneral"}, - FunctionInfo{25, nullptr, "GetBleScanParameterSmartDevice"}, - FunctionInfo{26, nullptr, "StartBleScanForGeneral"}, - FunctionInfo{27, nullptr, "StopBleScanForGeneral"}, - FunctionInfo{28, nullptr, "GetBleScanResultsForGeneral"}, - FunctionInfo{29, nullptr, "StartBleScanForPairedDevice"}, - FunctionInfo{30, nullptr, "StopBleScanForPairedDevice"}, - FunctionInfo{31, nullptr, "StartBleScanForSmartDevice"}, - FunctionInfo{32, nullptr, "StopBleScanForSmartDevice"}, - FunctionInfo{33, nullptr, "GetBleScanResultsForSmartDevice"}, - FunctionInfo{34, nullptr, "AcquireBleConnectionEvent"}, - FunctionInfo{35, nullptr, "BleConnect"}, - FunctionInfo{36, nullptr, "BleOverrideConnection"}, - FunctionInfo{37, nullptr, "BleDisconnect"}, - FunctionInfo{38, nullptr, "BleGetConnectionState"}, - FunctionInfo{39, nullptr, "BleGetGattClientConditionList"}, - FunctionInfo{40, nullptr, "AcquireBlePairingEvent"}, - FunctionInfo{41, nullptr, "BlePairDevice"}, - FunctionInfo{42, nullptr, "BleUnpairDeviceOnBoth"}, - FunctionInfo{43, nullptr, "BleUnpairDevice"}, - FunctionInfo{44, nullptr, "BleGetPairedAddresses"}, - FunctionInfo{45, nullptr, "AcquireBleServiceDiscoveryEvent"}, - FunctionInfo{46, nullptr, "GetGattServices"}, - FunctionInfo{47, nullptr, "GetGattService"}, - FunctionInfo{48, nullptr, "GetGattIncludedServices"}, - FunctionInfo{49, nullptr, "GetBelongingService"}, - FunctionInfo{50, nullptr, "GetGattCharacteristics"}, - FunctionInfo{51, nullptr, "GetGattDescriptors"}, - FunctionInfo{52, nullptr, "AcquireBleMtuConfigEvent"}, - FunctionInfo{53, nullptr, "ConfigureBleMtu"}, - FunctionInfo{54, nullptr, "GetBleMtu"}, - FunctionInfo{55, nullptr, "RegisterBleGattDataPath"}, - FunctionInfo{56, nullptr, "UnregisterBleGattDataPath"}, - FunctionInfo{57, nullptr, "RegisterAppletResourceUserId"}, - FunctionInfo{58, nullptr, "UnregisterAppletResourceUserId"}, - FunctionInfo{59, nullptr, "SetAppletResourceUserId"}, - FunctionInfo{60, nullptr, "AcquireBleConnectionParameterUpdateEvent", MakeVersionGate({8,0,0})}, - FunctionInfo{61, nullptr, "SetCeLength", MakeVersionGate({8,0,0})}, - FunctionInfo{62, nullptr, "EnsureSlotExpansion", MakeVersionGate({9,0,0})}, - FunctionInfo{63, nullptr, "IsSlotExpansionEnsured", MakeVersionGate({9,0,0})}, - FunctionInfo{64, nullptr, "CancelConnectionTrigger", MakeVersionGate({10,0,0})}, - FunctionInfo{65, nullptr, "GetConnectionCapacity", MakeVersionGate({13,0,0})}, - FunctionInfo{66, nullptr, "GetWlanMode", MakeVersionGate({13,0,0})}, - FunctionInfo{67, nullptr, "IsSlotSavingEnabled", MakeVersionGate({13,0,0})}, - FunctionInfo{68, nullptr, "IsSlotSavingForPairingEnabled", MakeVersionGate({13,0,0})}, - FunctionInfo{69, nullptr, "AcquireAudioDeviceConnectionEvent", MakeVersionGate({13,0,0})}, - FunctionInfo{70, nullptr, "GetConnectedAudioDevices", MakeVersionGate({13,0,0})}, - FunctionInfo{71, nullptr, "SetAudioSourceVolume", MakeVersionGate({13,0,0})}, - FunctionInfo{72, nullptr, "GetAudioSourceVolume", MakeVersionGate({13,0,0})}, - FunctionInfo{73, nullptr, "RequestAudioDeviceConnectionRejection", MakeVersionGate({13,0,0})}, - FunctionInfo{74, nullptr, "CancelAudioDeviceConnectionRejection", MakeVersionGate({13,0,0})}, - FunctionInfo{75, nullptr, "GetPairedAudioDevices", MakeVersionGate({13,0,0})}, - FunctionInfo{76, nullptr, "SetWlanModeWithOption", MakeVersionGate({13,1,0})}, - FunctionInfo{100, nullptr, "AcquireConnectionDisallowedEvent", MakeVersionGate({13,0,0})}, - FunctionInfo{101, nullptr, "GetUsecaseViolationFactor", MakeVersionGate({13,0,0})}, - FunctionInfo{110, nullptr, "GetShortenedDeviceInfo", MakeVersionGate({13,0,0})}, - FunctionInfo{111, nullptr, "AcquirePairingCountUpdateEvent"},//13.0.0+ - FunctionInfo{112, nullptr, "Unknown112", MakeVersionGate({14,0,0}, {14,1,2})}, - FunctionInfo{113, nullptr, "Unknown113", MakeVersionGate({14,0,0}, {14,1,2})}, - FunctionInfo{114, nullptr, "IsFirstAudioControlConnection", MakeVersionGate({14,0,0})}, - FunctionInfo{115, nullptr, "GetShortenedDeviceCondition", MakeVersionGate({14,0,0})}, - FunctionInfo{116, nullptr, "SetAudioSinkVolume", MakeVersionGate({15,0,0})}, - FunctionInfo{117, nullptr, "GetAudioSinkVolume", MakeVersionGate({15,0,0})} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/btm/btm.h b/src/core/hle/service/btm/btm.h index 0bf77d053e..902a61d8cc 100644 --- a/src/core/hle/service/btm/btm.h +++ b/src/core/hle/service/btm/btm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/btm/btm_debug.cpp b/src/core/hle/service/btm/btm_debug.cpp new file mode 100644 index 0000000000..abbe7d4832 --- /dev/null +++ b/src/core/hle/service/btm/btm_debug.cpp @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "core/hle/service/btm/btm_debug.h" + +namespace Service::BTM { + +IBtmDebug::IBtmDebug(Core::System& system_) : ServiceFramework{system_, "btm:dbg"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "AcquireDiscoveryEvent"}, + {1, nullptr, "StartDiscovery"}, + {2, nullptr, "CancelDiscovery"}, + {3, nullptr, "GetDeviceProperty"}, + {4, nullptr, "CreateBond"}, + {5, nullptr, "CancelBond"}, + {6, nullptr, "SetTsiMode"}, + {7, nullptr, "GeneralTest"}, + {8, nullptr, "HidConnect"}, + {9, nullptr, "GeneralGet"}, //5.0.0+ + {10, nullptr, "GetGattClientDisconnectionReason"}, //5.0.0+ + {11, nullptr, "GetBleConnectionParameter"}, //5.1.0+ + {12, nullptr, "GetBleConnectionParameterRequest"}, //5.1.0+ + {13, nullptr, "GetDiscoveredDevice"}, //12.0.0+ + {14, nullptr, "SleepAwakeLoopTest"}, //15.0.0+ + {15, nullptr, "SleepTest"}, //15.0.0+ + {16, nullptr, "MinimumAwakeTest"}, //15.0.0+ + {17, nullptr, "ForceEnableBtm"}, //15.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); +} + +IBtmDebug::~IBtmDebug() = default; + +} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_debug.h b/src/core/hle/service/btm/btm_debug.h new file mode 100644 index 0000000000..fad760d674 --- /dev/null +++ b/src/core/hle/service/btm/btm_debug.h @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::BTM { + +class IBtmDebug final : public ServiceFramework { +public: + explicit IBtmDebug(Core::System& system_); + ~IBtmDebug() override; +}; + +} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_system.cpp b/src/core/hle/service/btm/btm_system.cpp new file mode 100644 index 0000000000..1684b0193e --- /dev/null +++ b/src/core/hle/service/btm/btm_system.cpp @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "common/logging.h" +#include "core/hle/service/btm/btm_system.h" +#include "core/hle/service/btm/btm_system_core.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/service.h" + +namespace Service::BTM { + +IBtmSystem::IBtmSystem(Core::System& system_) : ServiceFramework{system_, "btm:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&IBtmSystem::GetCore>, "GetCore"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IBtmSystem::~IBtmSystem() = default; + +Result IBtmSystem::GetCore(OutInterface out_interface) { + LOG_WARNING(Service_BTM, "called"); + + *out_interface = std::make_shared(system); + R_SUCCEED(); +} + +} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_system.h b/src/core/hle/service/btm/btm_system.h new file mode 100644 index 0000000000..9755540204 --- /dev/null +++ b/src/core/hle/service/btm/btm_system.h @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::BTM { +class IBtmSystemCore; + +class IBtmSystem final : public ServiceFramework { +public: + explicit IBtmSystem(Core::System& system_); + ~IBtmSystem() override; + +private: + Result GetCore(OutInterface out_interface); +}; + +} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_system_core.cpp b/src/core/hle/service/btm/btm_system_core.cpp new file mode 100644 index 0000000000..318657fc32 --- /dev/null +++ b/src/core/hle/service/btm/btm_system_core.cpp @@ -0,0 +1,135 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "common/logging.h" +#include "core/hle/service/btm/btm_system_core.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/set/system_settings_server.h" +#include "core/hle/service/sm/sm.h" + +namespace Service::BTM { + +IBtmSystemCore::IBtmSystemCore(Core::System& system_) + : ServiceFramework{system_, "IBtmSystemCore"}, service_context{system_, "IBtmSystemCore"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&IBtmSystemCore::StartGamepadPairing>, "StartGamepadPairing"}, + {1, C<&IBtmSystemCore::CancelGamepadPairing>, "CancelGamepadPairing"}, + {2, nullptr, "ClearGamepadPairingDatabase"}, + {3, nullptr, "GetPairedGamepadCount"}, + {4, C<&IBtmSystemCore::EnableRadio>, "EnableRadio"}, + {5, C<&IBtmSystemCore::DisableRadio>, "DisableRadio"}, + {6, C<&IBtmSystemCore::IsRadioEnabled>, "IsRadioEnabled"}, + {7, C<&IBtmSystemCore::AcquireRadioEvent>, "AcquireRadioEvent"}, + {8, nullptr, "AcquireGamepadPairingEvent"}, + {9, nullptr, "IsGamepadPairingStarted"}, + {10, nullptr, "StartAudioDeviceDiscovery"}, + {11, nullptr, "StopAudioDeviceDiscovery"}, + {12, nullptr, "IsDiscoveryingAudioDevice"}, + {13, C<&IBtmSystemCore::GetDiscoveredAudioDevice>, "GetDiscoveredAudioDevice"}, + {14, C<&IBtmSystemCore::AcquireAudioDeviceConnectionEvent>, "AcquireAudioDeviceConnectionEvent"}, + {15, nullptr, "ConnectAudioDevice"}, + {16, nullptr, "IsConnectingAudioDevice"}, + {17, C<&IBtmSystemCore::GetConnectedAudioDevices>, "GetConnectedAudioDevices"}, + {18, nullptr, "DisconnectAudioDevice"}, + {19, nullptr, "AcquirePairedAudioDeviceInfoChangedEvent"}, + {20, C<&IBtmSystemCore::GetPairedAudioDevices>, "GetPairedAudioDevices"}, + {21, nullptr, "RemoveAudioDevicePairing"}, + {22, C<&IBtmSystemCore::RequestAudioDeviceConnectionRejection>, "RequestAudioDeviceConnectionRejection"}, + {23, C<&IBtmSystemCore::CancelAudioDeviceConnectionRejection>, "CancelAudioDeviceConnectionRejection"} + }; + // clang-format on + + RegisterHandlers(functions); + radio_event = service_context.CreateEvent("IBtmSystemCore::RadioEvent"); + audio_device_connection_event = + service_context.CreateEvent("IBtmSystemCore::AudioDeviceConnectionEvent"); + + m_set_sys = + system.ServiceManager().GetService("set:sys", true); +} + +IBtmSystemCore::~IBtmSystemCore() { + service_context.CloseEvent(radio_event); + service_context.CloseEvent(audio_device_connection_event); +} + +Result IBtmSystemCore::StartGamepadPairing() { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + R_SUCCEED(); +} + +Result IBtmSystemCore::CancelGamepadPairing() { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + R_SUCCEED(); +} + +Result IBtmSystemCore::EnableRadio() { + LOG_DEBUG(Service_BTM, "called"); + + R_RETURN(m_set_sys->SetBluetoothEnableFlag(true)); +} +Result IBtmSystemCore::DisableRadio() { + LOG_DEBUG(Service_BTM, "called"); + + R_RETURN(m_set_sys->SetBluetoothEnableFlag(false)); +} + +Result IBtmSystemCore::IsRadioEnabled(Out out_is_enabled) { + LOG_DEBUG(Service_BTM, "called"); + + R_RETURN(m_set_sys->GetBluetoothEnableFlag(out_is_enabled)); +} + +Result IBtmSystemCore::AcquireRadioEvent(Out out_is_valid, + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &radio_event->GetReadableEvent(); + R_SUCCEED(); +} + +Result IBtmSystemCore::GetDiscoveredAudioDevice(OutArray, BufferAttr_HipcPointer> out_audio_devices, s32 count, Out out_total) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + R_SUCCEED(); +} + +Result IBtmSystemCore::AcquireAudioDeviceConnectionEvent( + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_event = &audio_device_connection_event->GetReadableEvent(); + R_SUCCEED(); +} + +Result IBtmSystemCore::GetConnectedAudioDevices( + Out out_count, OutArray, BufferAttr_HipcPointer> out_audio_devices) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_count = 0; + R_SUCCEED(); +} + +Result IBtmSystemCore::GetPairedAudioDevices( + Out out_count, OutArray, BufferAttr_HipcPointer> out_audio_devices) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_count = 0; + R_SUCCEED(); +} + +Result IBtmSystemCore::RequestAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) { + LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid); + R_SUCCEED(); +} + +Result IBtmSystemCore::CancelAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) { + LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid); + R_SUCCEED(); +} + +} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_system_core.h b/src/core/hle/service/btm/btm_system_core.h new file mode 100644 index 0000000000..3fc4c0d56c --- /dev/null +++ b/src/core/hle/service/btm/btm_system_core.h @@ -0,0 +1,62 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/service.h" + +namespace Kernel { +class KEvent; +class KReadableEvent; +} // namespace Kernel + +namespace Core { +class System; +} + +namespace Service::Set { +class ISystemSettingsServer; +} + +namespace Service::BTM { + +class IBtmSystemCore final : public ServiceFramework { +public: + explicit IBtmSystemCore(Core::System& system_); + ~IBtmSystemCore() override; + +private: + Result StartGamepadPairing(); + Result CancelGamepadPairing(); + Result EnableRadio(); + Result DisableRadio(); + Result IsRadioEnabled(Out out_is_enabled); + + Result AcquireRadioEvent(Out out_is_valid, OutCopyHandle out_event); + Result GetDiscoveredAudioDevice(OutArray, BufferAttr_HipcPointer> out_audio_devices, s32 count, Out out_total); + Result AcquireAudioDeviceConnectionEvent(OutCopyHandle out_event); + + Result GetConnectedAudioDevices( + Out out_count, + OutArray, BufferAttr_HipcPointer> out_audio_devices); + + Result GetPairedAudioDevices( + Out out_count, + OutArray, BufferAttr_HipcPointer> out_audio_devices); + + Result RequestAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid); + Result CancelAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid); + + KernelHelpers::ServiceContext service_context; + + Kernel::KEvent* radio_event; + Kernel::KEvent* audio_device_connection_event; + std::shared_ptr m_set_sys; +}; + +} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_user.cpp b/src/core/hle/service/btm/btm_user.cpp new file mode 100644 index 0000000000..c380c573fa --- /dev/null +++ b/src/core/hle/service/btm/btm_user.cpp @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "common/logging.h" +#include "core/hle/service/btm/btm_user.h" +#include "core/hle/service/btm/btm_user_core.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::BTM { + +IBtmUser::IBtmUser(Core::System& system_) : ServiceFramework{system_, "btm:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&IBtmUser::GetCore>, "GetCore"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IBtmUser::~IBtmUser() = default; + +Result IBtmUser::GetCore(OutInterface out_interface) { + LOG_WARNING(Service_BTM, "called"); + + *out_interface = std::make_shared(system); + R_SUCCEED(); +} + +} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_user.h b/src/core/hle/service/btm/btm_user.h new file mode 100644 index 0000000000..d6cf330ed6 --- /dev/null +++ b/src/core/hle/service/btm/btm_user.h @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::BTM { +class IBtmUserCore; + +class IBtmUser final : public ServiceFramework { +public: + explicit IBtmUser(Core::System& system_); + ~IBtmUser() override; + +private: + Result GetCore(OutInterface out_interface); +}; + +} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_user_core.cpp b/src/core/hle/service/btm/btm_user_core.cpp new file mode 100644 index 0000000000..b120df14c0 --- /dev/null +++ b/src/core/hle/service/btm/btm_user_core.cpp @@ -0,0 +1,106 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include + +#include "common/logging.h" +#include "core/core.h" +#include "core/hle/kernel/k_event.h" +#include "core/hle/service/btm/btm_user_core.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::BTM { + +IBtmUserCore::IBtmUserCore(Core::System& system_) + : ServiceFramework{system_, "IBtmUserCore"}, service_context{system_, "IBtmUserCore"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&IBtmUserCore::AcquireBleScanEvent>, "AcquireBleScanEvent"}, + {1, nullptr, "GetBleScanFilterParameter"}, + {2, nullptr, "GetBleScanFilterParameter2"}, + {3, nullptr, "StartBleScanForGeneral"}, + {4, nullptr, "StopBleScanForGeneral"}, + {5, nullptr, "GetBleScanResultsForGeneral"}, + {6, nullptr, "StartBleScanForPaired"}, + {7, nullptr, "StopBleScanForPaired"}, + {8, nullptr, "StartBleScanForSmartDevice"}, + {9, nullptr, "StopBleScanForSmartDevice"}, + {10, nullptr, "GetBleScanResultsForSmartDevice"}, + {17, C<&IBtmUserCore::AcquireBleConnectionEvent>, "AcquireBleConnectionEvent"}, + {18, nullptr, "BleConnect"}, + {19, nullptr, "BleDisconnect"}, + {20, nullptr, "BleGetConnectionState"}, + {21, nullptr, "AcquireBlePairingEvent"}, + {22, nullptr, "BlePairDevice"}, + {23, nullptr, "BleUnPairDevice"}, + {24, nullptr, "BleUnPairDevice2"}, + {25, nullptr, "BleGetPairedDevices"}, + {26, C<&IBtmUserCore::AcquireBleServiceDiscoveryEvent>, "AcquireBleServiceDiscoveryEvent"}, + {27, nullptr, "GetGattServices"}, + {28, nullptr, "GetGattService"}, + {29, nullptr, "GetGattIncludedServices"}, + {30, nullptr, "GetBelongingGattService"}, + {31, nullptr, "GetGattCharacteristics"}, + {32, nullptr, "GetGattDescriptors"}, + {33, C<&IBtmUserCore::AcquireBleMtuConfigEvent>, "AcquireBleMtuConfigEvent"}, + {34, nullptr, "ConfigureBleMtu"}, + {35, nullptr, "GetBleMtu"}, + {36, nullptr, "RegisterBleGattDataPath"}, + {37, nullptr, "UnregisterBleGattDataPath"}, + }; + // clang-format on + RegisterHandlers(functions); + + scan_event = service_context.CreateEvent("IBtmUserCore:ScanEvent"); + connection_event = service_context.CreateEvent("IBtmUserCore:ConnectionEvent"); + service_discovery_event = service_context.CreateEvent("IBtmUserCore:DiscoveryEvent"); + config_event = service_context.CreateEvent("IBtmUserCore:ConfigEvent"); +} + +IBtmUserCore::~IBtmUserCore() { + service_context.CloseEvent(scan_event); + service_context.CloseEvent(connection_event); + service_context.CloseEvent(service_discovery_event); + service_context.CloseEvent(config_event); +} + +Result IBtmUserCore::AcquireBleScanEvent(Out out_is_valid, + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &scan_event->GetReadableEvent(); + R_SUCCEED(); +} + +Result IBtmUserCore::AcquireBleConnectionEvent(Out out_is_valid, + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &connection_event->GetReadableEvent(); + R_SUCCEED(); +} + +Result IBtmUserCore::AcquireBleServiceDiscoveryEvent( + Out out_is_valid, OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &service_discovery_event->GetReadableEvent(); + R_SUCCEED(); +} + +Result IBtmUserCore::AcquireBleMtuConfigEvent(Out out_is_valid, + OutCopyHandle out_event) { + LOG_WARNING(Service_BTM, "(STUBBED) called"); + + *out_is_valid = true; + *out_event = &config_event->GetReadableEvent(); + R_SUCCEED(); +} + +} // namespace Service::BTM diff --git a/src/core/hle/service/btm/btm_user_core.h b/src/core/hle/service/btm/btm_user_core.h new file mode 100644 index 0000000000..5a565a5897 --- /dev/null +++ b/src/core/hle/service/btm/btm_user_core.h @@ -0,0 +1,50 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/service.h" + +namespace Kernel { +class KEvent; +class KReadableEvent; +} // namespace Kernel + +namespace Core { +class System; +} + +namespace Service::BTM { + +class IBtmUserCore final : public ServiceFramework { +public: + explicit IBtmUserCore(Core::System& system_); + ~IBtmUserCore() override; + +private: + Result AcquireBleScanEvent(Out out_is_valid, + OutCopyHandle out_event); + + Result AcquireBleConnectionEvent(Out out_is_valid, + OutCopyHandle out_event); + + Result AcquireBleServiceDiscoveryEvent(Out out_is_valid, + OutCopyHandle out_event); + + Result AcquireBleMtuConfigEvent(Out out_is_valid, + OutCopyHandle out_event); + + KernelHelpers::ServiceContext service_context; + + Kernel::KEvent* scan_event; + Kernel::KEvent* connection_event; + Kernel::KEvent* service_discovery_event; + Kernel::KEvent* config_event; +}; + +} // namespace Service::BTM diff --git a/src/core/hle/service/caps/caps.cpp b/src/core/hle/service/caps/caps.cpp index 6cc37999f3..f07fbd2185 100644 --- a/src/core/hle/service/caps/caps.cpp +++ b/src/core/hle/service/caps/caps.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "core/hle/service/caps/caps.h" +#include "core/hle/service/caps/caps_a.h" #include "core/hle/service/caps/caps_c.h" #include "core/hle/service/caps/caps_manager.h" #include "core/hle/service/caps/caps_sc.h" @@ -13,223 +14,24 @@ #include "core/hle/service/caps/caps_u.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" -#include "common/logging.h" #include "frontend_common/firmware_manager.h" -#include "core/hle/service/caps/caps_result.h" -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/ipc_helpers.h" namespace Service::Capture { class IDecoderControlService final : public ServiceFramework { public: - explicit IDecoderControlService(Core::System& system_) : ServiceFramework{system_, "grc:d"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{3001, nullptr, "DecodeJpeg"}, - FunctionInfo{4001, nullptr, "ShrinkJpeg"}, - FunctionInfo{4002, nullptr, "ShrinkJpegEx"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit IDecoderControlService(Core::System& system_) : ServiceFramework{system_, "grc:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {3001, nullptr, "DecodeJpeg"}, + {4001, nullptr, "ShrinkJpeg"}, + {4002, nullptr, "ShrinkJpegEx"}, + }; + // clang-format on + RegisterHandlers(functions); } }; -class IAlbumAccessorService final : public ServiceFramework { -public: - explicit IAlbumAccessorService(Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:a"}, manager{album_manager} {} - ~IAlbumAccessorService() override = default; - - Result GetAlbumFileList( - Out out_count, AlbumStorage storage, - OutArray out_entries) { - LOG_INFO(Service_Capture, "called, storage={}", storage); - - const Result result = manager->GetAlbumFileList(out_entries, *out_count, storage, 0); - R_RETURN(TranslateResult(result)); - } - - Result DeleteAlbumFile(AlbumFileId file_id) { - LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}", - file_id.application_id, file_id.storage, file_id.type); - - const Result result = manager->DeleteAlbumFile(file_id); - R_RETURN(TranslateResult(result)); - } - - Result IsAlbumMounted(Out out_is_mounted, AlbumStorage storage) { - LOG_INFO(Service_Capture, "called, storage={}", storage); - - const Result result = manager->IsAlbumMounted(storage); - *out_is_mounted = result.IsSuccess(); - R_RETURN(TranslateResult(result)); - } - - Result Unknown18( - Out out_buffer_size, - OutArray out_buffer) { - LOG_WARNING(Service_Capture, "(STUBBED) called"); - *out_buffer_size = 0; - R_SUCCEED(); - } - - Result GetAlbumFileListEx0( - Out out_entries_size, AlbumStorage storage, u8 flags, - OutArray out_entries) { - LOG_INFO(Service_Capture, "called, storage={}, flags={}", storage, flags); - - const Result result = manager->GetAlbumFileList(out_entries, *out_entries_size, storage, flags); - R_RETURN(TranslateResult(result)); - } - - Result GetAutoSavingStorage(Out out_is_autosaving) { - LOG_WARNING(Service_Capture, "(STUBBED) called"); - - const Result result = manager->GetAutoSavingStorage(*out_is_autosaving); - R_RETURN(TranslateResult(result)); - } - - Result LoadAlbumScreenShotImageEx1( - const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, - OutLargeData out_image_output, - OutArray out_image, - OutArray out_buffer) { - LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}, flags={}", - file_id.application_id, file_id.storage, file_id.type, decoder_options.flags); - - const Result result = - manager->LoadAlbumScreenShotImage(*out_image_output, out_image, file_id, decoder_options); - R_RETURN(TranslateResult(result)); - } - - Result LoadAlbumScreenShotThumbnailImageEx1( - const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, - OutLargeData out_image_output, - OutArray out_image, - OutArray out_buffer) { - LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}, flags={}", - file_id.application_id, file_id.storage, file_id.type, decoder_options.flags); - - const Result result = manager->LoadAlbumScreenShotThumbnail(*out_image_output, out_image, - file_id, decoder_options); - R_RETURN(TranslateResult(result)); - } - - Result TranslateResult(Result in_result) { - if (in_result.IsSuccess()) { - return in_result; - } - - if ((in_result.raw & 0x3801ff) == ResultUnknown1024.raw) { - if (in_result.GetDescription() - 0x514 < 100) { - return ResultInvalidFileData; - } - if (in_result.GetDescription() - 0x5dc < 100) { - return ResultInvalidFileData; - } - - if (in_result.GetDescription() - 0x578 < 100) { - if (in_result == ResultFileCountLimit) { - return ResultUnknown22; - } - return ResultUnknown25; - } - - if (in_result.raw < ResultUnknown1801.raw) { - if (in_result == ResultUnknown1202) { - return ResultUnknown810; - } - if (in_result == ResultUnknown1203) { - return ResultUnknown810; - } - if (in_result == ResultUnknown1701) { - return ResultUnknown5; - } - } else if (in_result.raw < ResultUnknown1803.raw) { - if (in_result == ResultUnknown1801) { - return ResultUnknown5; - } - if (in_result == ResultUnknown1802) { - return ResultUnknown6; - } - } else { - if (in_result == ResultUnknown1803) { - return ResultUnknown7; - } - if (in_result == ResultUnknown1804) { - return ResultOutOfRange; - } - } - return ResultUnknown1024; - } - - if (in_result.GetModule() == ErrorModule::FS) { - if ((in_result.GetDescription() >> 0xc < 0x7d) || - (in_result.GetDescription() - 1000 < 2000) || - (((in_result.GetDescription() - 3000) >> 3) < 0x271)) { - // TODO: Translate FS error - return in_result; - } - } - - return in_result; - } - - Result GetAlbumAccessResultForDebug(Out out_result) { - LOG_WARNING(Service_Capture, "(STUBBED) called"); - *out_result = ResultSuccess; - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetAlbumFileCount"}, - FunctionInfo{1, C<&IAlbumAccessorService::GetAlbumFileList>, "GetAlbumFileList"}, - FunctionInfo{2, nullptr, "LoadAlbumFile"}, - FunctionInfo{3, C<&IAlbumAccessorService::DeleteAlbumFile>, "DeleteAlbumFile"}, - FunctionInfo{4, nullptr, "StorageCopyAlbumFile"}, - FunctionInfo{5, C<&IAlbumAccessorService::IsAlbumMounted>, "IsAlbumMounted"}, - FunctionInfo{6, nullptr, "GetAlbumUsage"}, - FunctionInfo{7, nullptr, "GetAlbumFileSize"}, - FunctionInfo{8, nullptr, "LoadAlbumFileThumbnail"}, - FunctionInfo{9, nullptr, "LoadAlbumScreenShotImage"}, - FunctionInfo{10, nullptr, "LoadAlbumScreenShotThumbnailImage"}, - FunctionInfo{11, nullptr, "GetAlbumEntryFromApplicationAlbumEntry"}, - FunctionInfo{12, nullptr, "LoadAlbumScreenShotImageEx"}, - FunctionInfo{13, nullptr, "LoadAlbumScreenShotThumbnailImageEx"}, - FunctionInfo{14, nullptr, "LoadAlbumScreenShotImageEx0"}, - FunctionInfo{15, nullptr, "GetAlbumUsage3"}, - FunctionInfo{16, nullptr, "GetAlbumMountResult"}, - FunctionInfo{17, nullptr, "GetAlbumUsage16"}, - FunctionInfo{18, C<&IAlbumAccessorService::Unknown18>, "Unknown18"}, - FunctionInfo{19, nullptr, "Unknown19"}, - FunctionInfo{100, nullptr, "GetAlbumFileCountEx0"}, - FunctionInfo{101, C<&IAlbumAccessorService::GetAlbumFileListEx0>, "GetAlbumFileListEx0"}, - FunctionInfo{202, nullptr, "SaveEditedScreenShot"}, - FunctionInfo{301, nullptr, "GetLastThumbnail"}, - FunctionInfo{302, nullptr, "GetLastOverlayMovieThumbnail"}, - FunctionInfo{401, C<&IAlbumAccessorService::GetAutoSavingStorage>, "GetAutoSavingStorage"}, - FunctionInfo{501, nullptr, "GetRequiredStorageSpaceSizeToCopyAll"}, - FunctionInfo{1001, nullptr, "LoadAlbumScreenShotThumbnailImageEx0"}, - FunctionInfo{1002, C<&IAlbumAccessorService::LoadAlbumScreenShotImageEx1>, "LoadAlbumScreenShotImageEx1"}, - FunctionInfo{1003, C<&IAlbumAccessorService::LoadAlbumScreenShotThumbnailImageEx1>, "LoadAlbumScreenShotThumbnailImageEx1"}, - FunctionInfo{8001, nullptr, "ForceAlbumUnmounted"}, - FunctionInfo{8002, nullptr, "ResetAlbumMountStatus"}, - FunctionInfo{8011, nullptr, "RefreshAlbumCache"}, - FunctionInfo{8012, nullptr, "GetAlbumCache"}, - FunctionInfo{8013, nullptr, "GetAlbumCacheEx"}, - FunctionInfo{8021, nullptr, "GetAlbumEntryFromApplicationAlbumEntryAruid"}, - FunctionInfo{10011, nullptr, "SetInternalErrorConversionEnabled"}, - FunctionInfo{50000, nullptr, "LoadMakerNoteInfoForDebug"}, - FunctionInfo{50011, C<&IAlbumAccessorService::GetAlbumAccessResultForDebug>, "GetAlbumAccessResultForDebug"}, - FunctionInfo{60002, nullptr, "OpenAccessorSession"} - ); - - std::shared_ptr manager = nullptr; -}; - void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); auto album_manager = std::make_shared(system); diff --git a/src/core/hle/service/caps/caps.h b/src/core/hle/service/caps/caps.h index 58e9725b85..670ee59cda 100644 --- a/src/core/hle/service/caps/caps.h +++ b/src/core/hle/service/caps/caps.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/caps/caps_a.cpp b/src/core/hle/service/caps/caps_a.cpp new file mode 100644 index 0000000000..8f561bfcdc --- /dev/null +++ b/src/core/hle/service/caps/caps_a.cpp @@ -0,0 +1,211 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "common/logging.h" +#include "core/hle/service/caps/caps_a.h" +#include "core/hle/service/caps/caps_manager.h" +#include "core/hle/service/caps/caps_result.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/ipc_helpers.h" + +namespace Service::Capture { + +IAlbumAccessorService::IAlbumAccessorService(Core::System& system_, + std::shared_ptr album_manager) + : ServiceFramework{system_, "caps:a"}, manager{album_manager} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetAlbumFileCount"}, + {1, C<&IAlbumAccessorService::GetAlbumFileList>, "GetAlbumFileList"}, + {2, nullptr, "LoadAlbumFile"}, + {3, C<&IAlbumAccessorService::DeleteAlbumFile>, "DeleteAlbumFile"}, + {4, nullptr, "StorageCopyAlbumFile"}, + {5, C<&IAlbumAccessorService::IsAlbumMounted>, "IsAlbumMounted"}, + {6, nullptr, "GetAlbumUsage"}, + {7, nullptr, "GetAlbumFileSize"}, + {8, nullptr, "LoadAlbumFileThumbnail"}, + {9, nullptr, "LoadAlbumScreenShotImage"}, + {10, nullptr, "LoadAlbumScreenShotThumbnailImage"}, + {11, nullptr, "GetAlbumEntryFromApplicationAlbumEntry"}, + {12, nullptr, "LoadAlbumScreenShotImageEx"}, + {13, nullptr, "LoadAlbumScreenShotThumbnailImageEx"}, + {14, nullptr, "LoadAlbumScreenShotImageEx0"}, + {15, nullptr, "GetAlbumUsage3"}, + {16, nullptr, "GetAlbumMountResult"}, + {17, nullptr, "GetAlbumUsage16"}, + {18, C<&IAlbumAccessorService::Unknown18>, "Unknown18"}, + {19, nullptr, "Unknown19"}, + {100, nullptr, "GetAlbumFileCountEx0"}, + {101, C<&IAlbumAccessorService::GetAlbumFileListEx0>, "GetAlbumFileListEx0"}, + {202, nullptr, "SaveEditedScreenShot"}, + {301, nullptr, "GetLastThumbnail"}, + {302, nullptr, "GetLastOverlayMovieThumbnail"}, + {401, C<&IAlbumAccessorService::GetAutoSavingStorage>, "GetAutoSavingStorage"}, + {501, nullptr, "GetRequiredStorageSpaceSizeToCopyAll"}, + {1001, nullptr, "LoadAlbumScreenShotThumbnailImageEx0"}, + {1002, C<&IAlbumAccessorService::LoadAlbumScreenShotImageEx1>, "LoadAlbumScreenShotImageEx1"}, + {1003, C<&IAlbumAccessorService::LoadAlbumScreenShotThumbnailImageEx1>, "LoadAlbumScreenShotThumbnailImageEx1"}, + {8001, nullptr, "ForceAlbumUnmounted"}, + {8002, nullptr, "ResetAlbumMountStatus"}, + {8011, nullptr, "RefreshAlbumCache"}, + {8012, nullptr, "GetAlbumCache"}, + {8013, nullptr, "GetAlbumCacheEx"}, + {8021, nullptr, "GetAlbumEntryFromApplicationAlbumEntryAruid"}, + {10011, nullptr, "SetInternalErrorConversionEnabled"}, + {50000, nullptr, "LoadMakerNoteInfoForDebug"}, + {50011, C<&IAlbumAccessorService::GetAlbumAccessResultForDebug>, "GetAlbumAccessResultForDebug"}, + {60002, nullptr, "OpenAccessorSession"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IAlbumAccessorService::~IAlbumAccessorService() = default; + +Result IAlbumAccessorService::GetAlbumFileList( + Out out_count, AlbumStorage storage, + OutArray out_entries) { + LOG_INFO(Service_Capture, "called, storage={}", storage); + + const Result result = manager->GetAlbumFileList(out_entries, *out_count, storage, 0); + R_RETURN(TranslateResult(result)); +} + +Result IAlbumAccessorService::DeleteAlbumFile(AlbumFileId file_id) { + LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}", + file_id.application_id, file_id.storage, file_id.type); + + const Result result = manager->DeleteAlbumFile(file_id); + R_RETURN(TranslateResult(result)); +} + +Result IAlbumAccessorService::IsAlbumMounted(Out out_is_mounted, AlbumStorage storage) { + LOG_INFO(Service_Capture, "called, storage={}", storage); + + const Result result = manager->IsAlbumMounted(storage); + *out_is_mounted = result.IsSuccess(); + R_RETURN(TranslateResult(result)); +} + +Result IAlbumAccessorService::Unknown18( + Out out_buffer_size, + OutArray out_buffer) { + LOG_WARNING(Service_Capture, "(STUBBED) called"); + *out_buffer_size = 0; + R_SUCCEED(); +} + +Result IAlbumAccessorService::GetAlbumFileListEx0( + Out out_entries_size, AlbumStorage storage, u8 flags, + OutArray out_entries) { + LOG_INFO(Service_Capture, "called, storage={}, flags={}", storage, flags); + + const Result result = manager->GetAlbumFileList(out_entries, *out_entries_size, storage, flags); + R_RETURN(TranslateResult(result)); +} + +Result IAlbumAccessorService::GetAutoSavingStorage(Out out_is_autosaving) { + LOG_WARNING(Service_Capture, "(STUBBED) called"); + + const Result result = manager->GetAutoSavingStorage(*out_is_autosaving); + R_RETURN(TranslateResult(result)); +} + +Result IAlbumAccessorService::LoadAlbumScreenShotImageEx1( + const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, + OutLargeData out_image_output, + OutArray out_image, + OutArray out_buffer) { + LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}, flags={}", + file_id.application_id, file_id.storage, file_id.type, decoder_options.flags); + + const Result result = + manager->LoadAlbumScreenShotImage(*out_image_output, out_image, file_id, decoder_options); + R_RETURN(TranslateResult(result)); +} + +Result IAlbumAccessorService::LoadAlbumScreenShotThumbnailImageEx1( + const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, + OutLargeData out_image_output, + OutArray out_image, + OutArray out_buffer) { + LOG_INFO(Service_Capture, "called, application_id={:#0x}, storage={}, type={}, flags={}", + file_id.application_id, file_id.storage, file_id.type, decoder_options.flags); + + const Result result = manager->LoadAlbumScreenShotThumbnail(*out_image_output, out_image, + file_id, decoder_options); + R_RETURN(TranslateResult(result)); +} + +Result IAlbumAccessorService::TranslateResult(Result in_result) { + if (in_result.IsSuccess()) { + return in_result; + } + + if ((in_result.raw & 0x3801ff) == ResultUnknown1024.raw) { + if (in_result.GetDescription() - 0x514 < 100) { + return ResultInvalidFileData; + } + if (in_result.GetDescription() - 0x5dc < 100) { + return ResultInvalidFileData; + } + + if (in_result.GetDescription() - 0x578 < 100) { + if (in_result == ResultFileCountLimit) { + return ResultUnknown22; + } + return ResultUnknown25; + } + + if (in_result.raw < ResultUnknown1801.raw) { + if (in_result == ResultUnknown1202) { + return ResultUnknown810; + } + if (in_result == ResultUnknown1203) { + return ResultUnknown810; + } + if (in_result == ResultUnknown1701) { + return ResultUnknown5; + } + } else if (in_result.raw < ResultUnknown1803.raw) { + if (in_result == ResultUnknown1801) { + return ResultUnknown5; + } + if (in_result == ResultUnknown1802) { + return ResultUnknown6; + } + } else { + if (in_result == ResultUnknown1803) { + return ResultUnknown7; + } + if (in_result == ResultUnknown1804) { + return ResultOutOfRange; + } + } + return ResultUnknown1024; + } + + if (in_result.GetModule() == ErrorModule::FS) { + if ((in_result.GetDescription() >> 0xc < 0x7d) || + (in_result.GetDescription() - 1000 < 2000) || + (((in_result.GetDescription() - 3000) >> 3) < 0x271)) { + // TODO: Translate FS error + return in_result; + } + } + + return in_result; +} + + +Result IAlbumAccessorService::GetAlbumAccessResultForDebug(Out out_result) { + LOG_WARNING(Service_Capture, "(STUBBED) called"); + *out_result = ResultSuccess; + R_SUCCEED(); +} + +} // namespace Service::Capture diff --git a/src/core/hle/service/caps/caps_a.h b/src/core/hle/service/caps/caps_a.h new file mode 100644 index 0000000000..c6aa8f9210 --- /dev/null +++ b/src/core/hle/service/caps/caps_a.h @@ -0,0 +1,63 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/caps/caps_types.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::Capture { +class AlbumManager; + +class IAlbumAccessorService final : public ServiceFramework { +public: + explicit IAlbumAccessorService(Core::System& system_, + std::shared_ptr album_manager); + ~IAlbumAccessorService() override; + +private: + Result GetAlbumFileList(Out out_count, AlbumStorage storage, + OutArray out_entries); + + Result DeleteAlbumFile(AlbumFileId file_id); + + Result IsAlbumMounted(Out out_is_mounted, AlbumStorage storage); + + Result Unknown18( + Out out_buffer_size, + OutArray + out_buffer); + + Result GetAlbumFileListEx0(Out out_entries_size, AlbumStorage storage, u8 flags, + OutArray out_entries); + + Result GetAutoSavingStorage(Out out_is_autosaving); + + Result LoadAlbumScreenShotImageEx1( + const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, + OutLargeData out_image_output, + OutArray out_image, + OutArray out_buffer); + + Result LoadAlbumScreenShotThumbnailImageEx1( + const AlbumFileId& file_id, const ScreenShotDecodeOption& decoder_options, + OutLargeData out_image_output, + OutArray out_image, + OutArray out_buffer); + + Result TranslateResult(Result in_result); + + Result GetAlbumAccessResultForDebug(Out out_result); + + std::shared_ptr manager = nullptr; +}; + +} // namespace Service::Capture diff --git a/src/core/hle/service/caps/caps_c.cpp b/src/core/hle/service/caps/caps_c.cpp index c62c3cd5d3..6c9f8e964d 100644 --- a/src/core/hle/service/caps/caps_c.cpp +++ b/src/core/hle/service/caps/caps_c.cpp @@ -14,34 +14,34 @@ namespace Service::Capture { -std::optional IAlbumControlService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "CaptureRawImage"}, - FunctionInfo{2, nullptr, "CaptureRawImageWithTimeout"}, - FunctionInfo{33, C<&IAlbumControlService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, - FunctionInfo{1001, nullptr, "RequestTakingScreenShot"}, - FunctionInfo{1002, nullptr, "RequestTakingScreenShotWithTimeout"}, - FunctionInfo{1011, nullptr, "NotifyTakingScreenShotRefused"}, - FunctionInfo{2001, nullptr, "NotifyAlbumStorageIsAvailable"}, - FunctionInfo{2002, nullptr, "NotifyAlbumStorageIsUnavailable"}, - FunctionInfo{2011, nullptr, "RegisterAppletResourceUserId"}, - FunctionInfo{2012, nullptr, "UnregisterAppletResourceUserId"}, - FunctionInfo{2013, nullptr, "GetApplicationIdFromAruid"}, - FunctionInfo{2014, nullptr, "CheckApplicationIdRegistered"}, - FunctionInfo{2101, nullptr, "GenerateCurrentAlbumFileId"}, - FunctionInfo{2102, nullptr, "GenerateApplicationAlbumEntry"}, - FunctionInfo{2201, nullptr, "SaveAlbumScreenShotFile"}, - FunctionInfo{2202, nullptr, "SaveAlbumScreenShotFileEx"}, - FunctionInfo{2301, nullptr, "SetOverlayScreenShotThumbnailData"}, - FunctionInfo{2302, nullptr, "SetOverlayMovieThumbnailData"}, - FunctionInfo{60001, nullptr, "OpenControlSession"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAlbumControlService::IAlbumControlService(Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:c"}, manager{album_manager} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "CaptureRawImage"}, + {2, nullptr, "CaptureRawImageWithTimeout"}, + {33, C<&IAlbumControlService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, + {1001, nullptr, "RequestTakingScreenShot"}, + {1002, nullptr, "RequestTakingScreenShotWithTimeout"}, + {1011, nullptr, "NotifyTakingScreenShotRefused"}, + {2001, nullptr, "NotifyAlbumStorageIsAvailable"}, + {2002, nullptr, "NotifyAlbumStorageIsUnavailable"}, + {2011, nullptr, "RegisterAppletResourceUserId"}, + {2012, nullptr, "UnregisterAppletResourceUserId"}, + {2013, nullptr, "GetApplicationIdFromAruid"}, + {2014, nullptr, "CheckApplicationIdRegistered"}, + {2101, nullptr, "GenerateCurrentAlbumFileId"}, + {2102, nullptr, "GenerateApplicationAlbumEntry"}, + {2201, nullptr, "SaveAlbumScreenShotFile"}, + {2202, nullptr, "SaveAlbumScreenShotFileEx"}, + {2301, nullptr, "SetOverlayScreenShotThumbnailData"}, + {2302, nullptr, "SetOverlayMovieThumbnailData"}, + {60001, nullptr, "OpenControlSession"}, + }; + // clang-format on + + RegisterHandlers(functions); } IAlbumControlService::~IAlbumControlService() = default; diff --git a/src/core/hle/service/caps/caps_c.h b/src/core/hle/service/caps/caps_c.h index a1f19bbfc3..f50de0ee8c 100644 --- a/src/core/hle/service/caps/caps_c.h +++ b/src/core/hle/service/caps/caps_c.h @@ -19,11 +19,14 @@ enum class ShimLibraryVersion : u64; class IAlbumControlService final : public ServiceFramework { public: - explicit IAlbumControlService(Core::System& system_, std::shared_ptr album_manager); + explicit IAlbumControlService(Core::System& system_, + std::shared_ptr album_manager); ~IAlbumControlService() override; + private: - Result SetShimLibraryVersion(ShimLibraryVersion library_version, ClientAppletResourceUserId aruid); - std::optional FindRequest(u32 key) override; + Result SetShimLibraryVersion(ShimLibraryVersion library_version, + ClientAppletResourceUserId aruid); + std::shared_ptr manager = nullptr; }; diff --git a/src/core/hle/service/caps/caps_result.h b/src/core/hle/service/caps/caps_result.h index 179ae48409..b7ba2a642d 100644 --- a/src/core/hle/service/caps/caps_result.h +++ b/src/core/hle/service/caps/caps_result.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/caps/caps_sc.cpp b/src/core/hle/service/caps/caps_sc.cpp index 59119d8ed7..92d53da9f5 100644 --- a/src/core/hle/service/caps/caps_sc.cpp +++ b/src/core/hle/service/caps/caps_sc.cpp @@ -10,6 +10,32 @@ namespace Service::Capture { IScreenShotControlService::IScreenShotControlService(Core::System& system_) : ServiceFramework{system_, "caps:sc"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "CaptureRawImage"}, + {2, nullptr, "CaptureRawImageWithTimeout"}, + {3, nullptr, "AttachSharedBuffer"}, + {5, nullptr, "CaptureRawImageToAttachedSharedBuffer"}, + {210, nullptr, "Unknown210"}, + {1001, nullptr, "RequestTakingScreenShot"}, + {1002, nullptr, "RequestTakingScreenShotWithTimeout"}, + {1003, nullptr, "RequestTakingScreenShotEx"}, + {1004, nullptr, "RequestTakingScreenShotEx1"}, + {1009, nullptr, "CancelTakingScreenShot"}, + {1010, nullptr, "SetTakingScreenShotCancelState"}, + {1011, nullptr, "NotifyTakingScreenShotRefused"}, + {1012, nullptr, "NotifyTakingScreenShotFailed"}, + {1101, nullptr, "SetupOverlayMovieThumbnail"}, + {1106, nullptr, "Unknown1106"}, + {1107, nullptr, "Unknown1107"}, + {1201, nullptr, "OpenRawScreenShotReadStream"}, + {1202, nullptr, "CloseRawScreenShotReadStream"}, + {1203, nullptr, "ReadRawScreenShotReadStream"}, + {1204, nullptr, "Unknown1204"}, + }; + // clang-format on + + RegisterHandlers(functions); } IScreenShotControlService::~IScreenShotControlService() = default; diff --git a/src/core/hle/service/caps/caps_sc.h b/src/core/hle/service/caps/caps_sc.h index 422f062e59..72e947bf16 100644 --- a/src/core/hle/service/caps/caps_sc.h +++ b/src/core/hle/service/caps/caps_sc.h @@ -18,32 +18,6 @@ class IScreenShotControlService final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "CaptureRawImage"}, - FunctionInfo{2, nullptr, "CaptureRawImageWithTimeout"}, - FunctionInfo{3, nullptr, "AttachSharedBuffer"}, - FunctionInfo{5, nullptr, "CaptureRawImageToAttachedSharedBuffer"}, - FunctionInfo{210, nullptr, "Unknown210"}, - FunctionInfo{1001, nullptr, "RequestTakingScreenShot"}, - FunctionInfo{1002, nullptr, "RequestTakingScreenShotWithTimeout"}, - FunctionInfo{1003, nullptr, "RequestTakingScreenShotEx"}, - FunctionInfo{1004, nullptr, "RequestTakingScreenShotEx1"}, - FunctionInfo{1009, nullptr, "CancelTakingScreenShot"}, - FunctionInfo{1010, nullptr, "SetTakingScreenShotCancelState"}, - FunctionInfo{1011, nullptr, "NotifyTakingScreenShotRefused"}, - FunctionInfo{1012, nullptr, "NotifyTakingScreenShotFailed"}, - FunctionInfo{1101, nullptr, "SetupOverlayMovieThumbnail"}, - FunctionInfo{1106, nullptr, "Unknown1106"}, - FunctionInfo{1107, nullptr, "Unknown1107"}, - FunctionInfo{1201, nullptr, "OpenRawScreenShotReadStream"}, - FunctionInfo{1202, nullptr, "CloseRawScreenShotReadStream"}, - FunctionInfo{1203, nullptr, "ReadRawScreenShotReadStream"}, - FunctionInfo{1204, nullptr, "Unknown1204"} - ); }; } // namespace Service::Capture diff --git a/src/core/hle/service/caps/caps_ss.cpp b/src/core/hle/service/caps/caps_ss.cpp index 0c444116b7..0cd641f551 100644 --- a/src/core/hle/service/caps/caps_ss.cpp +++ b/src/core/hle/service/caps/caps_ss.cpp @@ -12,22 +12,22 @@ namespace Service::Capture { -std::optional IScreenShotService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{201, nullptr, "SaveScreenShot"}, - FunctionInfo{202, nullptr, "SaveEditedScreenShot"}, - FunctionInfo{203, C<&IScreenShotService::SaveScreenShotEx0>, "SaveScreenShotEx0"}, - FunctionInfo{204, nullptr, "SaveEditedScreenShotEx0"}, - FunctionInfo{206, C<&IScreenShotService::SaveEditedScreenShotEx1>, "SaveEditedScreenShotEx1"}, - FunctionInfo{208, nullptr, "SaveScreenShotOfMovieEx1"}, - FunctionInfo{1000, nullptr, "Unknown1000"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IScreenShotService::IScreenShotService(Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:ss"}, manager{album_manager} { + // clang-format off + static const FunctionInfo functions[] = { + {201, nullptr, "SaveScreenShot"}, + {202, nullptr, "SaveEditedScreenShot"}, + {203, C<&IScreenShotService::SaveScreenShotEx0>, "SaveScreenShotEx0"}, + {204, nullptr, "SaveEditedScreenShotEx0"}, + {206, C<&IScreenShotService::SaveEditedScreenShotEx1>, "SaveEditedScreenShotEx1"}, + {208, nullptr, "SaveScreenShotOfMovieEx1"}, + {1000, nullptr, "Unknown1000"}, + }; + // clang-format on + + RegisterHandlers(functions); } IScreenShotService::~IScreenShotService() = default; diff --git a/src/core/hle/service/caps/caps_ss.h b/src/core/hle/service/caps/caps_ss.h index 8817637fb8..78971bde0e 100644 --- a/src/core/hle/service/caps/caps_ss.h +++ b/src/core/hle/service/caps/caps_ss.h @@ -37,7 +37,6 @@ private: const InBuffer thumbnail_image_data_buffer); - std::optional FindRequest(u32 key) override; std::shared_ptr manager; }; diff --git a/src/core/hle/service/caps/caps_su.cpp b/src/core/hle/service/caps/caps_su.cpp index e708ddbb68..4ecfc840e4 100644 --- a/src/core/hle/service/caps/caps_su.cpp +++ b/src/core/hle/service/caps/caps_su.cpp @@ -15,20 +15,20 @@ namespace Service::Capture { -std::optional IScreenShotApplicationService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{32, C<&IScreenShotApplicationService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, - FunctionInfo{201, nullptr, "SaveScreenShot"}, - FunctionInfo{203, C<&IScreenShotApplicationService::SaveScreenShotEx0>, "SaveScreenShotEx0"}, - FunctionInfo{205, C<&IScreenShotApplicationService::SaveScreenShotEx1>, "SaveScreenShotEx1"}, - FunctionInfo{210, nullptr, "SaveScreenShotEx2"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IScreenShotApplicationService::IScreenShotApplicationService( Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:su"}, manager{album_manager} { + // clang-format off + static const FunctionInfo functions[] = { + {32, C<&IScreenShotApplicationService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, + {201, nullptr, "SaveScreenShot"}, + {203, C<&IScreenShotApplicationService::SaveScreenShotEx0>, "SaveScreenShotEx0"}, + {205, C<&IScreenShotApplicationService::SaveScreenShotEx1>, "SaveScreenShotEx1"}, + {210, nullptr, "SaveScreenShotEx2"}, + }; + // clang-format on + + RegisterHandlers(functions); } IScreenShotApplicationService::~IScreenShotApplicationService() = default; diff --git a/src/core/hle/service/caps/caps_su.h b/src/core/hle/service/caps/caps_su.h index 0fdc994a25..b7e53007ce 100644 --- a/src/core/hle/service/caps/caps_su.h +++ b/src/core/hle/service/caps/caps_su.h @@ -45,8 +45,8 @@ private: const InBuffer image_data_buffer); - std::optional FindRequest(u32 key) override; std::array image_data; + std::shared_ptr manager; }; diff --git a/src/core/hle/service/caps/caps_u.cpp b/src/core/hle/service/caps/caps_u.cpp index c1fa418e03..6472b2bac6 100644 --- a/src/core/hle/service/caps/caps_u.cpp +++ b/src/core/hle/service/caps/caps_u.cpp @@ -13,29 +13,29 @@ namespace Service::Capture { -std::optional IAlbumApplicationService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{32, C<&IAlbumApplicationService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, - FunctionInfo{102, C<&IAlbumApplicationService::GetAlbumFileList0AafeAruidDeprecated>, "GetAlbumFileList0AafeAruidDeprecated"}, - FunctionInfo{103, nullptr, "DeleteAlbumFileByAruid"}, - FunctionInfo{104, nullptr, "GetAlbumFileSizeByAruid"}, - FunctionInfo{105, nullptr, "DeleteAlbumFileByAruidForDebug"}, - FunctionInfo{110, nullptr, "LoadAlbumScreenShotImageByAruid"}, - FunctionInfo{120, nullptr, "LoadAlbumScreenShotThumbnailImageByAruid"}, - FunctionInfo{130, nullptr, "PrecheckToCreateContentsByAruid"}, - FunctionInfo{140, nullptr, "GetAlbumFileList1AafeAruidDeprecated"}, - FunctionInfo{141, nullptr, "GetAlbumFileList2AafeUidAruidDeprecated"}, - FunctionInfo{142, C<&IAlbumApplicationService::GetAlbumFileList3AaeAruid>, "GetAlbumFileList3AaeAruid"}, - FunctionInfo{143, nullptr, "GetAlbumFileList4AaeUidAruid"}, - FunctionInfo{144, nullptr, "GetAllAlbumFileList3AaeAruid"}, - FunctionInfo{60002, nullptr, "OpenAccessorSessionForApplication"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAlbumApplicationService::IAlbumApplicationService(Core::System& system_, std::shared_ptr album_manager) : ServiceFramework{system_, "caps:u"}, manager{album_manager} { + // clang-format off + static const FunctionInfo functions[] = { + {32, C<&IAlbumApplicationService::SetShimLibraryVersion>, "SetShimLibraryVersion"}, + {102, C<&IAlbumApplicationService::GetAlbumFileList0AafeAruidDeprecated>, "GetAlbumFileList0AafeAruidDeprecated"}, + {103, nullptr, "DeleteAlbumFileByAruid"}, + {104, nullptr, "GetAlbumFileSizeByAruid"}, + {105, nullptr, "DeleteAlbumFileByAruidForDebug"}, + {110, nullptr, "LoadAlbumScreenShotImageByAruid"}, + {120, nullptr, "LoadAlbumScreenShotThumbnailImageByAruid"}, + {130, nullptr, "PrecheckToCreateContentsByAruid"}, + {140, nullptr, "GetAlbumFileList1AafeAruidDeprecated"}, + {141, nullptr, "GetAlbumFileList2AafeUidAruidDeprecated"}, + {142, C<&IAlbumApplicationService::GetAlbumFileList3AaeAruid>, "GetAlbumFileList3AaeAruid"}, + {143, nullptr, "GetAlbumFileList4AaeUidAruid"}, + {144, nullptr, "GetAllAlbumFileList3AaeAruid"}, + {60002, nullptr, "OpenAccessorSessionForApplication"}, + }; + // clang-format on + + RegisterHandlers(functions); } IAlbumApplicationService::~IAlbumApplicationService() = default; diff --git a/src/core/hle/service/caps/caps_u.h b/src/core/hle/service/caps/caps_u.h index 52e151bbe2..debae97a46 100644 --- a/src/core/hle/service/caps/caps_u.h +++ b/src/core/hle/service/caps/caps_u.h @@ -36,7 +36,6 @@ private: AlbumFileDateTime end_date_time, ClientAppletResourceUserId aruid, OutArray out_entries); - std::optional FindRequest(u32 key) override; std::shared_ptr manager = nullptr; }; diff --git a/src/core/hle/service/cmif_types.h b/src/core/hle/service/cmif_types.h index dad358b87c..783bce7781 100644 --- a/src/core/hle/service/cmif_types.h +++ b/src/core/hle/service/cmif_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/erpt/erpt.cpp b/src/core/hle/service/erpt/erpt.cpp index 7bed893bd7..014f1da62f 100644 --- a/src/core/hle/service/erpt/erpt.cpp +++ b/src/core/hle/service/erpt/erpt.cpp @@ -17,10 +17,30 @@ namespace Service::ERPT { class ErrorReportContext final : public ServiceFramework { public: - explicit ErrorReportContext(Core::System& system_) : ServiceFramework{system_, "erpt:c"} {} + explicit ErrorReportContext(Core::System& system_) : ServiceFramework{system_, "erpt:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&ErrorReportContext::SubmitContext>, "SubmitContext"}, + {1, C<&ErrorReportContext::CreateReportV0>, "CreateReportV0"}, + {2, nullptr, "SetInitialLaunchSettingsCompletionTime"}, + {3, nullptr, "ClearInitialLaunchSettingsCompletionTime"}, + {4, nullptr, "UpdatePowerOnTime"}, + {5, D<&ErrorReportContext::UpdateAwakeTime>, "UpdateAwakeTime"}, + {6, nullptr, "SubmitMultipleCategoryContext"}, + {7, nullptr, "UpdateApplicationLaunchTime"}, + {8, nullptr, "ClearApplicationLaunchTime"}, + {9, nullptr, "SubmitAttachment"}, + {10, nullptr, "CreateReportWithAttachments"}, + {11, C<&ErrorReportContext::CreateReportV1>, "CreateReportV1"}, + {12, C<&ErrorReportContext::CreateReport>, "CreateReport"}, + {20, nullptr, "RegisterRunningApplet"}, + {21, nullptr, "UnregisterRunningApplet"}, + {22, nullptr, "UpdateAppletSuspendedDuration"}, + {30, nullptr, "InvalidateForcedShutdownDetection"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -65,41 +85,21 @@ private: data_a.size(), data_b.size(), flag_a, flag_b); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&ErrorReportContext::SubmitContext>, "SubmitContext"}, - FunctionInfo{1, C<&ErrorReportContext::CreateReportV0>, "CreateReportV0"}, - FunctionInfo{2, nullptr, "SetInitialLaunchSettingsCompletionTime"}, - FunctionInfo{3, nullptr, "ClearInitialLaunchSettingsCompletionTime"}, - FunctionInfo{4, nullptr, "UpdatePowerOnTime"}, - FunctionInfo{5, D<&ErrorReportContext::UpdateAwakeTime>, "UpdateAwakeTime"}, - FunctionInfo{6, nullptr, "SubmitMultipleCategoryContext"}, - FunctionInfo{7, nullptr, "UpdateApplicationLaunchTime"}, - FunctionInfo{8, nullptr, "ClearApplicationLaunchTime"}, - FunctionInfo{9, nullptr, "SubmitAttachment"}, - FunctionInfo{10, nullptr, "CreateReportWithAttachments"}, - FunctionInfo{11, C<&ErrorReportContext::CreateReportV1>, "CreateReportV1"}, - FunctionInfo{12, C<&ErrorReportContext::CreateReport>, "CreateReport"}, - FunctionInfo{20, nullptr, "RegisterRunningApplet"}, - FunctionInfo{21, nullptr, "UnregisterRunningApplet"}, - FunctionInfo{22, nullptr, "UpdateAppletSuspendedDuration"}, - FunctionInfo{30, nullptr, "InvalidateForcedShutdownDetection"} - ); }; class ErrorReportSession final : public ServiceFramework { public: - explicit ErrorReportSession(Core::System& system_) : ServiceFramework{system_, "erpt:r"} {} + explicit ErrorReportSession(Core::System& system_) : ServiceFramework{system_, "erpt:r"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenReport"}, + {1, nullptr, "OpenManager"}, + {2, nullptr, "OpenAttachment"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenReport"}, - FunctionInfo{1, nullptr, "OpenManager"}, - FunctionInfo{2, nullptr, "OpenAttachment"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/erpt/erpt.h b/src/core/hle/service/erpt/erpt.h index 60094f556e..456e9af910 100644 --- a/src/core/hle/service/erpt/erpt.h +++ b/src/core/hle/service/erpt/erpt.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index 01d11183c9..432783f96e 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp @@ -19,14 +19,110 @@ constexpr Result ERROR_INVALID_RIGHTS_ID{ErrorModule::ETicket, 3}; class ETicket final : public ServiceFramework { public: explicit ETicket(Core::System& system_) : ServiceFramework{system_, "es"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, &ETicket::ImportTicket, "ImportTicket"}, + {2, nullptr, "ImportTicketCertificateSet"}, + {3, nullptr, "DeleteTicket"}, + {4, nullptr, "DeletePersonalizedTicket"}, + {5, nullptr, "DeleteAllCommonTicket"}, + {6, nullptr, "DeleteAllPersonalizedTicket"}, + {7, nullptr, "DeleteAllPersonalizedTicketEx"}, + {8, &ETicket::GetTitleKey, "GetTitleKey"}, + {9, &ETicket::CountCommonTicket, "CountCommonTicket"}, + {10, &ETicket::CountPersonalizedTicket, "CountPersonalizedTicket"}, + {11, &ETicket::ListCommonTicketRightsIds, "ListCommonTicketRightsIds"}, + {12, &ETicket::ListPersonalizedTicketRightsIds, "ListPersonalizedTicketRightsIds"}, + {13, nullptr, "ListMissingPersonalizedTicket"}, + {14, &ETicket::GetCommonTicketSize, "GetCommonTicketSize"}, + {15, &ETicket::GetPersonalizedTicketSize, "GetPersonalizedTicketSize"}, + {16, &ETicket::GetCommonTicketData, "GetCommonTicketData"}, + {17, &ETicket::GetPersonalizedTicketData, "GetPersonalizedTicketData"}, + {18, nullptr, "OwnTicket"}, + {19, nullptr, "GetTicketInfo"}, + {20, nullptr, "ListLightTicketInfo"}, + {21, nullptr, "SignData"}, + {22, nullptr, "GetCommonTicketAndCertificateSize"}, + {23, nullptr, "GetCommonTicketAndCertificateData"}, + {24, nullptr, "ImportPrepurchaseRecord"}, + {25, nullptr, "DeletePrepurchaseRecord"}, + {26, nullptr, "DeleteAllPrepurchaseRecord"}, + {27, nullptr, "CountPrepurchaseRecord"}, + {28, nullptr, "ListPrepurchaseRecordRightsIds"}, + {29, nullptr, "ListPrepurchaseRecordInfo"}, + {30, nullptr, "CountTicket"}, + {31, nullptr, "ListTicketRightsIds"}, + {32, nullptr, "CountPrepurchaseRecordEx"}, + {33, nullptr, "ListPrepurchaseRecordRightsIdsEx"}, + {34, nullptr, "GetEncryptedTicketSize"}, + {35, nullptr, "GetEncryptedTicketData"}, + {36, nullptr, "DeleteAllInactiveELicenseRequiredPersonalizedTicket"}, + {37, nullptr, "OwnTicket2"}, + {38, nullptr, "OwnTicket3"}, + {39, nullptr, "DeleteAllInactivePersonalizedTicket"}, + {40, nullptr, "DeletePrepurchaseRecordByNintendoAccountId"}, + {101, nullptr, "Unknown101"}, //18.0.0+ + {102, nullptr, "Unknown102"}, //18.0.0+ + {103, nullptr, "Unknown103"}, //18.0.0+ + {104, nullptr, "Unknown104"}, //18.0.0+ + {105, nullptr, "Unknown105"}, //20.0.0+ + {201, nullptr, "Unknown201"}, //18.0.0+ + {202, nullptr, "Unknown202"}, //18.0.0+ + {203, nullptr, "Unknown203"}, //18.0.0+ + {204, nullptr, "Unknown204"}, //18.0.0+ + {205, nullptr, "Unknown205"}, //18.0.0+ + {501, nullptr, "Unknown501"}, + {502, nullptr, "Unknown502"}, + {503, nullptr, "GetTitleKey"}, + {504, nullptr, "Unknown504"}, + {508, nullptr, "Unknown508"}, + {509, nullptr, "Unknown509"}, + {510, nullptr, "Unknown510"}, + {511, nullptr, "Unknown511"}, + {1001, nullptr, "Unknown1001"}, + {1002, nullptr, "Unknown1001"}, + {1003, nullptr, "Unknown1003"}, + {1004, nullptr, "Unknown1004"}, + {1005, nullptr, "Unknown1005"}, + {1006, nullptr, "Unknown1006"}, + {1007, nullptr, "Unknown1007"}, + {1009, nullptr, "Unknown1009"}, + {1010, nullptr, "Unknown1010"}, + {1011, nullptr, "Unknown1011"}, + {1012, nullptr, "Unknown1012"}, + {1013, nullptr, "Unknown1013"}, + {1014, nullptr, "Unknown1014"}, + {1015, nullptr, "Unknown1015"}, + {1016, nullptr, "Unknown1016"}, + {1017, nullptr, "Unknown1017"}, + {1018, nullptr, "Unknown1018"}, + {1019, nullptr, "Unknown1019"}, + {1020, nullptr, "Unknown1020"}, + {1021, nullptr, "Unknown1021"}, + {1501, nullptr, "Unknown1501"}, + {1502, nullptr, "Unknown1502"}, + {1503, nullptr, "Unknown1503"}, + {1504, nullptr, "Unknown1504"}, + {1505, nullptr, "Unknown1505"}, + {1506, nullptr, "Unknown1506"}, + {2000, nullptr, "Unknown2000"}, + {2001, nullptr, "Unknown2001"}, + {2002, nullptr, "Unknown2002"}, + {2003, nullptr, "Unknown2003"}, + {2100, nullptr, "Unknown2100"}, + {2501, nullptr, "Unknown2501"}, + {2502, nullptr, "Unknown2502"}, + {2601, nullptr, "Unknown2601"}, + {3001, nullptr, "Unknown3001"}, + {3002, nullptr, "Unknown3002"}, + }; + // clang-format on + RegisterHandlers(functions); + keys.PopulateTickets(); keys.SynthesizeTickets(); } - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - private: bool CheckRightsId(HLERequestContext& ctx, const u128& rights_id) { if (rights_id == u128{}) { @@ -221,185 +317,89 @@ private: rb.Push(write_size); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, &ETicket::ImportTicket, "ImportTicket"}, - FunctionInfo{2, nullptr, "ImportTicketCertificateSet"}, - FunctionInfo{3, nullptr, "DeleteTicket"}, - FunctionInfo{4, nullptr, "DeletePersonalizedTicket"}, - FunctionInfo{5, nullptr, "DeleteAllCommonTicket"}, - FunctionInfo{6, nullptr, "DeleteAllPersonalizedTicket"}, - FunctionInfo{7, nullptr, "DeleteAllPersonalizedTicketEx"}, - FunctionInfo{8, &ETicket::GetTitleKey, "GetTitleKey"}, - FunctionInfo{9, &ETicket::CountCommonTicket, "CountCommonTicket"}, - FunctionInfo{10, &ETicket::CountPersonalizedTicket, "CountPersonalizedTicket"}, - FunctionInfo{11, &ETicket::ListCommonTicketRightsIds, "ListCommonTicketRightsIds"}, - FunctionInfo{12, &ETicket::ListPersonalizedTicketRightsIds, "ListPersonalizedTicketRightsIds"}, - FunctionInfo{13, nullptr, "ListMissingPersonalizedTicket"}, - FunctionInfo{14, &ETicket::GetCommonTicketSize, "GetCommonTicketSize"}, - FunctionInfo{15, &ETicket::GetPersonalizedTicketSize, "GetPersonalizedTicketSize"}, - FunctionInfo{16, &ETicket::GetCommonTicketData, "GetCommonTicketData"}, - FunctionInfo{17, &ETicket::GetPersonalizedTicketData, "GetPersonalizedTicketData"}, - FunctionInfo{18, nullptr, "OwnTicket"}, - FunctionInfo{19, nullptr, "GetTicketInfo"}, - FunctionInfo{20, nullptr, "ListLightTicketInfo"}, - FunctionInfo{21, nullptr, "SignData"}, - FunctionInfo{22, nullptr, "GetCommonTicketAndCertificateSize"}, - FunctionInfo{23, nullptr, "GetCommonTicketAndCertificateData"}, - FunctionInfo{24, nullptr, "ImportPrepurchaseRecord"}, - FunctionInfo{25, nullptr, "DeletePrepurchaseRecord"}, - FunctionInfo{26, nullptr, "DeleteAllPrepurchaseRecord"}, - FunctionInfo{27, nullptr, "CountPrepurchaseRecord"}, - FunctionInfo{28, nullptr, "ListPrepurchaseRecordRightsIds"}, - FunctionInfo{29, nullptr, "ListPrepurchaseRecordInfo"}, - FunctionInfo{30, nullptr, "CountTicket"}, - FunctionInfo{31, nullptr, "ListTicketRightsIds"}, - FunctionInfo{32, nullptr, "CountPrepurchaseRecordEx"}, - FunctionInfo{33, nullptr, "ListPrepurchaseRecordRightsIdsEx"}, - FunctionInfo{34, nullptr, "GetEncryptedTicketSize"}, - FunctionInfo{35, nullptr, "GetEncryptedTicketData"}, - FunctionInfo{36, nullptr, "DeleteAllInactiveELicenseRequiredPersonalizedTicket"}, - FunctionInfo{37, nullptr, "OwnTicket2"}, - FunctionInfo{38, nullptr, "OwnTicket3"}, - FunctionInfo{39, nullptr, "DeleteAllInactivePersonalizedTicket"}, - FunctionInfo{40, nullptr, "DeletePrepurchaseRecordByNintendoAccountId"}, - FunctionInfo{101, nullptr, "Unknown101", MakeVersionGate({18,0,0})}, - FunctionInfo{102, nullptr, "Unknown102", MakeVersionGate({18,0,0})}, - FunctionInfo{103, nullptr, "Unknown103", MakeVersionGate({18,0,0})}, - FunctionInfo{104, nullptr, "Unknown104", MakeVersionGate({18,0,0})}, - FunctionInfo{105, nullptr, "Unknown105", MakeVersionGate({20,0,0})}, - FunctionInfo{201, nullptr, "Unknown201", MakeVersionGate({18,0,0})}, - FunctionInfo{202, nullptr, "Unknown202", MakeVersionGate({18,0,0})}, - FunctionInfo{203, nullptr, "Unknown203", MakeVersionGate({18,0,0})}, - FunctionInfo{204, nullptr, "Unknown204", MakeVersionGate({18,0,0})}, - FunctionInfo{205, nullptr, "Unknown205", MakeVersionGate({18,0,0})}, - FunctionInfo{501, nullptr, "Unknown501"}, - FunctionInfo{502, nullptr, "Unknown502"}, - FunctionInfo{503, nullptr, "GetTitleKey"}, - FunctionInfo{504, nullptr, "Unknown504"}, - FunctionInfo{508, nullptr, "Unknown508"}, - FunctionInfo{509, nullptr, "Unknown509"}, - FunctionInfo{510, nullptr, "Unknown510"}, - FunctionInfo{511, nullptr, "Unknown511"}, - FunctionInfo{1001, nullptr, "Unknown1001"}, - FunctionInfo{1002, nullptr, "Unknown1001"}, - FunctionInfo{1003, nullptr, "Unknown1003"}, - FunctionInfo{1004, nullptr, "Unknown1004"}, - FunctionInfo{1005, nullptr, "Unknown1005"}, - FunctionInfo{1006, nullptr, "Unknown1006"}, - FunctionInfo{1007, nullptr, "Unknown1007"}, - FunctionInfo{1009, nullptr, "Unknown1009"}, - FunctionInfo{1010, nullptr, "Unknown1010"}, - FunctionInfo{1011, nullptr, "Unknown1011"}, - FunctionInfo{1012, nullptr, "Unknown1012"}, - FunctionInfo{1013, nullptr, "Unknown1013"}, - FunctionInfo{1014, nullptr, "Unknown1014"}, - FunctionInfo{1015, nullptr, "Unknown1015"}, - FunctionInfo{1016, nullptr, "Unknown1016"}, - FunctionInfo{1017, nullptr, "Unknown1017"}, - FunctionInfo{1018, nullptr, "Unknown1018"}, - FunctionInfo{1019, nullptr, "Unknown1019"}, - FunctionInfo{1020, nullptr, "Unknown1020"}, - FunctionInfo{1021, nullptr, "Unknown1021"}, - FunctionInfo{1501, nullptr, "Unknown1501"}, - FunctionInfo{1502, nullptr, "Unknown1502"}, - FunctionInfo{1503, nullptr, "Unknown1503"}, - FunctionInfo{1504, nullptr, "Unknown1504"}, - FunctionInfo{1505, nullptr, "Unknown1505"}, - FunctionInfo{1506, nullptr, "Unknown1506"}, - FunctionInfo{2000, nullptr, "Unknown2000"}, - FunctionInfo{2001, nullptr, "Unknown2001"}, - FunctionInfo{2002, nullptr, "Unknown2002"}, - FunctionInfo{2003, nullptr, "Unknown2003"}, - FunctionInfo{2100, nullptr, "Unknown2100"}, - FunctionInfo{2501, nullptr, "Unknown2501"}, - FunctionInfo{2502, nullptr, "Unknown2502"}, - FunctionInfo{2601, nullptr, "Unknown2601"}, - FunctionInfo{3001, nullptr, "Unknown3001"}, - FunctionInfo{3002, nullptr, "Unknown3002"} - ); Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); }; class NDRM_LU final : public ServiceFramework { public: explicit NDRM_LU(Core::System& system_) - : ServiceFramework{system_, "ndrm:lu"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "Cmd1"}, - FunctionInfo{2, nullptr, "Cmd2"}, - FunctionInfo{3, nullptr, "Cmd3"}, - FunctionInfo{1000, nullptr, "Cmd1000"}, - FunctionInfo{8000, nullptr, "Cmd8000"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "ndrm:lu"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "Cmd1"}, + {2, nullptr, "Cmd2"}, + {3, nullptr, "Cmd3"}, + {1000, nullptr, "Cmd1000"}, + {8000, nullptr, "Cmd8000"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class NDRM_LA final : public ServiceFramework { public: explicit NDRM_LA(Core::System& system_) - : ServiceFramework{system_, "ndrm:la"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "Cmd1"}, - FunctionInfo{2, nullptr, "Cmd2"}, - FunctionInfo{3, nullptr, "Cmd3"}, - FunctionInfo{4, nullptr, "Cmd4"}, - FunctionInfo{5, nullptr, "Cmd5"}, - FunctionInfo{6, nullptr, "Cmd6"}, - FunctionInfo{7, nullptr, "Cmd7"}, - FunctionInfo{8, nullptr, "Cmd8"}, - FunctionInfo{9, nullptr, "Cmd9"}, - FunctionInfo{10, nullptr, "Cmd10"}, - FunctionInfo{11, nullptr, "Cmd11"}, - FunctionInfo{12, nullptr, "Cmd12"}, - FunctionInfo{13, nullptr, "Cmd13"}, - FunctionInfo{14, nullptr, "Cmd14"}, - FunctionInfo{15, nullptr, "Cmd15"}, - FunctionInfo{16, nullptr, "Cmd16"}, - FunctionInfo{17, nullptr, "Cmd17"}, - FunctionInfo{18, nullptr, "Cmd18"}, - FunctionInfo{19, nullptr, "Cmd19"}, - FunctionInfo{20, nullptr, "Cmd20"}, - FunctionInfo{21, nullptr, "Cmd21"}, - FunctionInfo{22, nullptr, "Cmd22"}, - FunctionInfo{23, nullptr, "Cmd23"}, - FunctionInfo{24, nullptr, "Cmd24"}, - FunctionInfo{25, nullptr, "Cmd25"}, - FunctionInfo{26, nullptr, "Cmd26"}, - FunctionInfo{27, nullptr, "Cmd27"}, - FunctionInfo{28, nullptr, "Cmd28"}, - FunctionInfo{29, nullptr, "Cmd29"}, - FunctionInfo{30, nullptr, "Cmd30"}, - FunctionInfo{31, nullptr, "Cmd31"}, - FunctionInfo{32, nullptr, "Cmd32"}, - FunctionInfo{33, nullptr, "Cmd33"}, - FunctionInfo{34, nullptr, "Cmd34"}, - FunctionInfo{35, nullptr, "Cmd35"}, - FunctionInfo{36, nullptr, "Cmd36"}, - FunctionInfo{37, nullptr, "Cmd37"}, - FunctionInfo{38, nullptr, "Cmd38"}, - FunctionInfo{39, nullptr, "Cmd39"}, - FunctionInfo{40, nullptr, "Cmd40"}, - FunctionInfo{42, nullptr, "Cmd42"}, - FunctionInfo{43, nullptr, "Cmd43"}, - FunctionInfo{44, nullptr, "Cmd44"}, - FunctionInfo{45, nullptr, "Cmd45"}, - FunctionInfo{46, nullptr, "Cmd46"}, - FunctionInfo{47, nullptr, "Cmd47"}, - FunctionInfo{48, nullptr, "Cmd48"}, - FunctionInfo{49, nullptr, "Cmd49"}, - FunctionInfo{50, nullptr, "Cmd50"}, - FunctionInfo{51, nullptr, "Cmd51"}, - FunctionInfo{8000, nullptr, "Cmd8000"}, - FunctionInfo{8001, nullptr, "Cmd8001"}, - FunctionInfo{8002, nullptr, "Cmd8002"}, - FunctionInfo{8003, nullptr, "Cmd8003"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "ndrm:la"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "Cmd1"}, + {2, nullptr, "Cmd2"}, + {3, nullptr, "Cmd3"}, + {4, nullptr, "Cmd4"}, + {5, nullptr, "Cmd5"}, + {6, nullptr, "Cmd6"}, + {7, nullptr, "Cmd7"}, + {8, nullptr, "Cmd8"}, + {9, nullptr, "Cmd9"}, + {10, nullptr, "Cmd10"}, + {11, nullptr, "Cmd11"}, + {12, nullptr, "Cmd12"}, + {13, nullptr, "Cmd13"}, + {14, nullptr, "Cmd14"}, + {15, nullptr, "Cmd15"}, + {16, nullptr, "Cmd16"}, + {17, nullptr, "Cmd17"}, + {18, nullptr, "Cmd18"}, + {19, nullptr, "Cmd19"}, + {20, nullptr, "Cmd20"}, + {21, nullptr, "Cmd21"}, + {22, nullptr, "Cmd22"}, + {23, nullptr, "Cmd23"}, + {24, nullptr, "Cmd24"}, + {25, nullptr, "Cmd25"}, + {26, nullptr, "Cmd26"}, + {27, nullptr, "Cmd27"}, + {28, nullptr, "Cmd28"}, + {29, nullptr, "Cmd29"}, + {30, nullptr, "Cmd30"}, + {31, nullptr, "Cmd31"}, + {32, nullptr, "Cmd32"}, + {33, nullptr, "Cmd33"}, + {34, nullptr, "Cmd34"}, + {35, nullptr, "Cmd35"}, + {36, nullptr, "Cmd36"}, + {37, nullptr, "Cmd37"}, + {38, nullptr, "Cmd38"}, + {39, nullptr, "Cmd39"}, + {40, nullptr, "Cmd40"}, + {42, nullptr, "Cmd42"}, + {43, nullptr, "Cmd43"}, + {44, nullptr, "Cmd44"}, + {45, nullptr, "Cmd45"}, + {46, nullptr, "Cmd46"}, + {47, nullptr, "Cmd47"}, + {48, nullptr, "Cmd48"}, + {49, nullptr, "Cmd49"}, + {50, nullptr, "Cmd50"}, + {51, nullptr, "Cmd51"}, + {8000, nullptr, "Cmd8000"}, + {8001, nullptr, "Cmd8001"}, + {8002, nullptr, "Cmd8002"}, + {8003, nullptr, "Cmd8003"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/es/es.h b/src/core/hle/service/es/es.h index 3176806252..215aadb98f 100644 --- a/src/core/hle/service/es/es.h +++ b/src/core/hle/service/es/es.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/eupld/eupld.cpp b/src/core/hle/service/eupld/eupld.cpp index ed1e1c19c5..9b26ae9c83 100644 --- a/src/core/hle/service/eupld/eupld.cpp +++ b/src/core/hle/service/eupld/eupld.cpp @@ -14,34 +14,36 @@ namespace Service::EUPLD { class ErrorUploadContext final : public ServiceFramework { public: - explicit ErrorUploadContext(Core::System& system_) : ServiceFramework{system_, "eupld:c"} {} + explicit ErrorUploadContext(Core::System& system_) : ServiceFramework{system_, "eupld:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetUrl"}, + {1, nullptr, "ImportCrt"}, + {2, nullptr, "ImportPki"}, + {3, nullptr, "SetAutoUpload"}, + {4, nullptr, "GetAutoUpload"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetUrl"}, - FunctionInfo{1, nullptr, "ImportCrt"}, - FunctionInfo{2, nullptr, "ImportPki"}, - FunctionInfo{3, nullptr, "SetAutoUpload"}, - FunctionInfo{4, nullptr, "GetAutoUpload"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class ErrorUploadRequest final : public ServiceFramework { public: - explicit ErrorUploadRequest(Core::System& system_) : ServiceFramework{system_, "eupld:r"} {} + explicit ErrorUploadRequest(Core::System& system_) : ServiceFramework{system_, "eupld:r"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "UploadAll"}, + {2, nullptr, "UploadSelected"}, + {3, nullptr, "GetUploadStatus"}, + {4, nullptr, "CancelUpload"}, + {5, nullptr, "GetResult"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{1, nullptr, "UploadAll"}, - FunctionInfo{2, nullptr, "UploadSelected"}, - FunctionInfo{3, nullptr, "GetUploadStatus"}, - FunctionInfo{4, nullptr, "CancelUpload"}, - FunctionInfo{5, nullptr, "GetResult"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/eupld/eupld.h b/src/core/hle/service/eupld/eupld.h index 8eb0a5b4f2..851e286733 100644 --- a/src/core/hle/service/eupld/eupld.h +++ b/src/core/hle/service/eupld/eupld.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/fatal/fatal.cpp b/src/core/hle/service/fatal/fatal.cpp index 4c9eca5d5b..db48526614 100644 --- a/src/core/hle/service/fatal/fatal.cpp +++ b/src/core/hle/service/fatal/fatal.cpp @@ -13,6 +13,8 @@ #include "common/swap.h" #include "core/core.h" #include "core/hle/service/fatal/fatal.h" +#include "core/hle/service/fatal/fatal_p.h" +#include "core/hle/service/fatal/fatal_u.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/server_manager.h" #include "core/reporter.h" @@ -165,35 +167,6 @@ void Module::Interface::ThrowFatalWithCpuContext(HLERequestContext& ctx) { rb.Push(ResultSuccess); } -class Fatal_P final : public Module::Interface { -public: - explicit Fatal_P(std::shared_ptr module_, Core::System& system_) : Interface(std::move(module_), system_, "fatal:p") {} - ~Fatal_P() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetFatalEvent"}, - FunctionInfo{10, nullptr, "GetFatalContext"} - ); -}; - -class Fatal_U final : public Module::Interface { -public: - explicit Fatal_U(std::shared_ptr module_, Core::System& system_) : Interface(std::move(module_), system_, "fatal:u") {} - ~Fatal_U() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &Fatal_U::ThrowFatal, "ThrowFatal"}, - FunctionInfo{1, &Fatal_U::ThrowFatalWithPolicy, "ThrowFatalWithPolicy"}, - FunctionInfo{2, &Fatal_U::ThrowFatalWithCpuContext, "ThrowFatalWithCpuContext"} - ); -}; - void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); auto module = std::make_shared(); diff --git a/src/core/hle/service/fatal/fatal.h b/src/core/hle/service/fatal/fatal.h index f1c1104060..176ad8d0d9 100644 --- a/src/core/hle/service/fatal/fatal.h +++ b/src/core/hle/service/fatal/fatal.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/fatal/fatal_p.cpp b/src/core/hle/service/fatal/fatal_p.cpp new file mode 100644 index 0000000000..345743d6bc --- /dev/null +++ b/src/core/hle/service/fatal/fatal_p.cpp @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/fatal/fatal_p.h" + +namespace Service::Fatal { + +Fatal_P::Fatal_P(std::shared_ptr module_, Core::System& system_) + : Interface(std::move(module_), system_, "fatal:p") { + static const FunctionInfo functions[] = { + {0, nullptr, "GetFatalEvent"}, + {10, nullptr, "GetFatalContext"}, + }; + RegisterHandlers(functions); +} + +Fatal_P::~Fatal_P() = default; + +} // namespace Service::Fatal diff --git a/src/core/hle/service/fatal/fatal_p.h b/src/core/hle/service/fatal/fatal_p.h new file mode 100644 index 0000000000..ea2183c125 --- /dev/null +++ b/src/core/hle/service/fatal/fatal_p.h @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/fatal/fatal.h" + +namespace Service::Fatal { + +class Fatal_P final : public Module::Interface { +public: + explicit Fatal_P(std::shared_ptr module_, Core::System& system_); + ~Fatal_P() override; +}; + +} // namespace Service::Fatal diff --git a/src/core/hle/service/fatal/fatal_u.cpp b/src/core/hle/service/fatal/fatal_u.cpp new file mode 100644 index 0000000000..b2850c3e62 --- /dev/null +++ b/src/core/hle/service/fatal/fatal_u.cpp @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/fatal/fatal_u.h" + +namespace Service::Fatal { + +Fatal_U::Fatal_U(std::shared_ptr module_, Core::System& system_) + : Interface(std::move(module_), system_, "fatal:u") { + static const FunctionInfo functions[] = { + {0, &Fatal_U::ThrowFatal, "ThrowFatal"}, + {1, &Fatal_U::ThrowFatalWithPolicy, "ThrowFatalWithPolicy"}, + {2, &Fatal_U::ThrowFatalWithCpuContext, "ThrowFatalWithCpuContext"}, + }; + RegisterHandlers(functions); +} + +Fatal_U::~Fatal_U() = default; + +} // namespace Service::Fatal diff --git a/src/core/hle/service/fatal/fatal_u.h b/src/core/hle/service/fatal/fatal_u.h new file mode 100644 index 0000000000..4d193857d0 --- /dev/null +++ b/src/core/hle/service/fatal/fatal_u.h @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/fatal/fatal.h" + +namespace Service::Fatal { + +class Fatal_U final : public Module::Interface { +public: + explicit Fatal_U(std::shared_ptr module_, Core::System& system_); + ~Fatal_U() override; +}; + +} // namespace Service::Fatal diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp index 96ea3478ea..cac03ae24c 100644 --- a/src/core/hle/service/fgm/fgm.cpp +++ b/src/core/hle/service/fgm/fgm.cpp @@ -16,26 +16,30 @@ namespace Service::FGM { class IRequest final : public ServiceFramework { public: - explicit IRequest(Core::System& system_) : ServiceFramework{system_, "IRequest"} {} + explicit IRequest(Core::System& system_) : ServiceFramework{system_, "IRequest"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "Set"}, + {2, nullptr, "Get"}, + {3, nullptr, "Cancel"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{1, nullptr, "Set"}, - FunctionInfo{2, nullptr, "Get"}, - FunctionInfo{3, nullptr, "Cancel"} - ); }; class FGM final : public ServiceFramework { public: - explicit FGM(Core::System& system_, const char* name) : ServiceFramework{system_, name} {} + explicit FGM(Core::System& system_, const char* name) : ServiceFramework{system_, name} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &FGM::Initialize, "Initialize"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -46,25 +50,21 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &FGM::Initialize, "Initialize"} - ); }; class FGM_DBG final : public ServiceFramework { public: - explicit FGM_DBG(Core::System& system_) : ServiceFramework{system_, "fgm:dbg"} {} + explicit FGM_DBG(Core::System& system_) : ServiceFramework{system_, "fgm:dbg"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "Read"}, + {2, nullptr, "Cancel"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{1, nullptr, "Read"}, - FunctionInfo{2, nullptr, "Cancel"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/fgm/fgm.h b/src/core/hle/service/fgm/fgm.h index 9d2465c0fb..89ef7096bb 100644 --- a/src/core/hle/service/fgm/fgm.h +++ b/src/core/hle/service/fgm/fgm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp b/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp index 793b86cc51..c4e3c81f22 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp @@ -11,18 +11,15 @@ namespace Service::FileSystem { -std::optional IDirectory::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IDirectory::Read>, "Read"}, - FunctionInfo{1, D<&IDirectory::GetEntryCount>, "GetEntryCount"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IDirectory::IDirectory(Core::System& system_, FileSys::VirtualDir directory_, FileSys::OpenDirectoryMode mode) : ServiceFramework{system_, "IDirectory"}, backend(std::make_unique(directory_, mode)) { + static const FunctionInfo functions[] = { + {0, D<&IDirectory::Read>, "Read"}, + {1, D<&IDirectory::GetEntryCount>, "GetEntryCount"}, + }; + RegisterHandlers(functions); } Result IDirectory::Read( diff --git a/src/core/hle/service/filesystem/fsp/fs_i_directory.h b/src/core/hle/service/filesystem/fsp/fs_i_directory.h index f2a57260e1..79256604f3 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_directory.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_directory.h @@ -29,8 +29,6 @@ private: Result Read(Out out_count, const OutArray out_entries); Result GetEntryCount(Out out_count); - - std::optional FindRequest(u32 key) override; }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fs_i_file.cpp b/src/core/hle/service/filesystem/fsp/fs_i_file.cpp index 78ca90a4af..22cbe2be2c 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_file.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_file.cpp @@ -12,6 +12,18 @@ namespace Service::FileSystem { IFile::IFile(Core::System& system_, FileSys::VirtualFile file_) : ServiceFramework{system_, "IFile"}, backend{std::make_unique(file_)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IFile::Read>, "Read"}, + {1, D<&IFile::Write>, "Write"}, + {2, D<&IFile::Flush>, "Flush"}, + {3, D<&IFile::SetSize>, "SetSize"}, + {4, D<&IFile::GetSize>, "GetSize"}, + {5, nullptr, "OperateRange"}, + {6, nullptr, "OperateRangeWithBuffer"}, + }; + // clang-format on + RegisterHandlers(functions); } Result IFile::Read( diff --git a/src/core/hle/service/filesystem/fsp/fs_i_file.h b/src/core/hle/service/filesystem/fsp/fs_i_file.h index 992330e149..14348f7fc6 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_file.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_file.h @@ -30,19 +30,6 @@ private: Result Flush(); Result SetSize(s64 size); Result GetSize(Out out_size); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IFile::Read>, "Read"}, - FunctionInfo{1, D<&IFile::Write>, "Write"}, - FunctionInfo{2, D<&IFile::Flush>, "Flush"}, - FunctionInfo{3, D<&IFile::SetSize>, "SetSize"}, - FunctionInfo{4, D<&IFile::GetSize>, "GetSize"}, - FunctionInfo{5, nullptr, "OperateRange"}, - FunctionInfo{6, nullptr, "OperateRangeWithBuffer"} - ); }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp index 6ab4916a36..edd381f57c 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp @@ -13,33 +13,30 @@ namespace Service::FileSystem { -std::optional IFileSystem::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IFileSystem::CreateFile>, "CreateFile"}, - FunctionInfo{1, D<&IFileSystem::DeleteFile>, "DeleteFile"}, - FunctionInfo{2, D<&IFileSystem::CreateDirectory>, "CreateDirectory"}, - FunctionInfo{3, D<&IFileSystem::DeleteDirectory>, "DeleteDirectory"}, - FunctionInfo{4, D<&IFileSystem::DeleteDirectoryRecursively>, "DeleteDirectoryRecursively"}, - FunctionInfo{5, D<&IFileSystem::RenameFile>, "RenameFile"}, - FunctionInfo{6, D<&IFileSystem::RenameDirectory>, "RenameDirectory"}, - FunctionInfo{7, D<&IFileSystem::GetEntryType>, "GetEntryType"}, - FunctionInfo{8, D<&IFileSystem::OpenFile>, "OpenFile"}, - FunctionInfo{9, D<&IFileSystem::OpenDirectory>, "OpenDirectory"}, - FunctionInfo{10, D<&IFileSystem::Commit>, "Commit"}, - FunctionInfo{11, D<&IFileSystem::GetFreeSpaceSize>, "GetFreeSpaceSize"}, - FunctionInfo{12, D<&IFileSystem::GetTotalSpaceSize>, "GetTotalSpaceSize"}, - FunctionInfo{13, D<&IFileSystem::CleanDirectoryRecursively>, "CleanDirectoryRecursively"}, - FunctionInfo{14, D<&IFileSystem::GetFileTimeStampRaw>, "GetFileTimeStampRaw"}, - FunctionInfo{15, nullptr, "QueryEntry"}, - FunctionInfo{16, D<&IFileSystem::GetFileSystemAttribute>, "GetFileSystemAttribute"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IFileSystem::IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGetter size_getter_) : ServiceFramework{system_, "IFileSystem"}, backend{std::make_unique( dir_)}, size_getter{std::move(size_getter_)} { + static const FunctionInfo functions[] = { + {0, D<&IFileSystem::CreateFile>, "CreateFile"}, + {1, D<&IFileSystem::DeleteFile>, "DeleteFile"}, + {2, D<&IFileSystem::CreateDirectory>, "CreateDirectory"}, + {3, D<&IFileSystem::DeleteDirectory>, "DeleteDirectory"}, + {4, D<&IFileSystem::DeleteDirectoryRecursively>, "DeleteDirectoryRecursively"}, + {5, D<&IFileSystem::RenameFile>, "RenameFile"}, + {6, D<&IFileSystem::RenameDirectory>, "RenameDirectory"}, + {7, D<&IFileSystem::GetEntryType>, "GetEntryType"}, + {8, D<&IFileSystem::OpenFile>, "OpenFile"}, + {9, D<&IFileSystem::OpenDirectory>, "OpenDirectory"}, + {10, D<&IFileSystem::Commit>, "Commit"}, + {11, D<&IFileSystem::GetFreeSpaceSize>, "GetFreeSpaceSize"}, + {12, D<&IFileSystem::GetTotalSpaceSize>, "GetTotalSpaceSize"}, + {13, D<&IFileSystem::CleanDirectoryRecursively>, "CleanDirectoryRecursively"}, + {14, D<&IFileSystem::GetFileTimeStampRaw>, "GetFileTimeStampRaw"}, + {15, nullptr, "QueryEntry"}, + {16, D<&IFileSystem::GetFileSystemAttribute>, "GetFileSystemAttribute"}, + }; + RegisterHandlers(functions); } Result IFileSystem::CreateFile(const InLargeData path, diff --git a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h index 11d3c7fb31..ed03c3ef83 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h @@ -58,7 +58,6 @@ public: Result GetFileSystemAttribute(Out out_attribute); private: - std::optional FindRequest(u32 key) override; std::unique_ptr backend; SizeGetter size_getter; }; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp index f6eac6ca10..4af0a4ea2d 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp @@ -12,6 +12,11 @@ namespace Service::FileSystem { IMultiCommitManager::IMultiCommitManager(Core::System& system_) : ServiceFramework{system_, "IMultiCommitManager"} { + static const FunctionInfo functions[] = { + {1, D<&IMultiCommitManager::Add>, "Add"}, + {2, D<&IMultiCommitManager::Commit>, "Commit"}, + }; + RegisterHandlers(functions); } IMultiCommitManager::~IMultiCommitManager() = default; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h index 31182e9159..3ebeb2cb0a 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h @@ -20,13 +20,6 @@ private: Result Add(std::shared_ptr filesystem); Result Commit(); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, D<&IMultiCommitManager::Add>, "Add"}, - FunctionInfo{2, D<&IMultiCommitManager::Commit>, "Commit"} - ); FileSys::VirtualFile backend; }; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp index 8353b72c24..0cac094caf 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp @@ -17,6 +17,11 @@ ISaveDataInfoReader::ISaveDataInfoReader(Core::System& system_, FileSys::SaveDataSpaceId space) : ServiceFramework{system_, "ISaveDataInfoReader"}, save_data_controller{ save_data_controller_} { + static const FunctionInfo functions[] = { + {0, D<&ISaveDataInfoReader::ReadSaveDataInfo>, "ReadSaveDataInfo"}, + }; + RegisterHandlers(functions); + FindAllSaves(space); } diff --git a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h index 7faa4291c0..d2b8eb97cf 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h @@ -45,12 +45,6 @@ private: void FindNormalSaves(FileSys::SaveDataSpaceId space, const FileSys::VirtualDir& type); void FindTemporaryStorageSaves(FileSys::SaveDataSpaceId space, const FileSys::VirtualDir& type); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ISaveDataInfoReader::ReadSaveDataInfo>, "ReadSaveDataInfo"} - ); std::shared_ptr save_data_controller; std::vector info; u64 next_entry_index = 0; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp index ac884b3b28..50b7d1e765 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp @@ -12,6 +12,15 @@ namespace Service::FileSystem { IStorage::IStorage(Core::System& system_, FileSys::VirtualFile backend_) : ServiceFramework{system_, "IStorage"}, backend(std::move(backend_)) { + static const FunctionInfo functions[] = { + {0, D<&IStorage::Read>, "Read"}, + {1, nullptr, "Write"}, + {2, nullptr, "Flush"}, + {3, nullptr, "SetSize"}, + {4, D<&IStorage::GetSize>, "GetSize"}, + {5, nullptr, "OperateRange"}, + }; + RegisterHandlers(functions); } Result IStorage::Read( diff --git a/src/core/hle/service/filesystem/fsp/fs_i_storage.h b/src/core/hle/service/filesystem/fsp/fs_i_storage.h index 44d5a6c8bb..e676c52220 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_storage.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_storage.h @@ -18,23 +18,12 @@ public: explicit IStorage(Core::System& system_, FileSys::VirtualFile backend_); private: + FileSys::VirtualFile backend; + Result Read( OutBuffer out_bytes, s64 offset, s64 length); Result GetSize(Out out_size); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IStorage::Read>, "Read"}, - FunctionInfo{1, nullptr, "Write"}, - FunctionInfo{2, nullptr, "Flush"}, - FunctionInfo{3, nullptr, "SetSize"}, - FunctionInfo{4, D<&IStorage::GetSize>, "GetSize"}, - FunctionInfo{5, nullptr, "OperateRange"} - ); - FileSys::VirtualFile backend; }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fsp_ldr.cpp b/src/core/hle/service/filesystem/fsp/fsp_ldr.cpp index 1f83d6509b..1dcacb0231 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_ldr.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_ldr.cpp @@ -9,6 +9,15 @@ namespace Service::FileSystem { FSP_LDR::FSP_LDR(Core::System& system_) : ServiceFramework{system_, "fsp:ldr"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenCodeFileSystem"}, + {1, nullptr, "IsArchivedProgram"}, + {2, nullptr, "SetCurrentProcess"}, + }; + // clang-format on + + RegisterHandlers(functions); } FSP_LDR::~FSP_LDR() = default; diff --git a/src/core/hle/service/filesystem/fsp/fsp_ldr.h b/src/core/hle/service/filesystem/fsp/fsp_ldr.h index fe3abeff1d..b642efe7ad 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_ldr.h +++ b/src/core/hle/service/filesystem/fsp/fsp_ldr.h @@ -18,15 +18,6 @@ class FSP_LDR final : public ServiceFramework { public: explicit FSP_LDR(Core::System& system_); ~FSP_LDR() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenCodeFileSystem"}, - FunctionInfo{1, nullptr, "IsArchivedProgram"}, - FunctionInfo{2, nullptr, "SetCurrentProcess"} - ); }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fsp_pr.cpp b/src/core/hle/service/filesystem/fsp/fsp_pr.cpp index 9378e6e0c6..e7941ef9c9 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_pr.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_pr.cpp @@ -9,6 +9,16 @@ namespace Service::FileSystem { FSP_PR::FSP_PR(Core::System& system_) : ServiceFramework{system_, "fsp:pr"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RegisterProgram"}, + {1, nullptr, "UnregisterProgram"}, + {2, nullptr, "SetCurrentProcess"}, + {256, nullptr, "SetEnabledProgramVerification"}, + }; + // clang-format on + + RegisterHandlers(functions); } FSP_PR::~FSP_PR() = default; diff --git a/src/core/hle/service/filesystem/fsp/fsp_pr.h b/src/core/hle/service/filesystem/fsp/fsp_pr.h index bc692151a5..175a3c7a23 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_pr.h +++ b/src/core/hle/service/filesystem/fsp/fsp_pr.h @@ -18,16 +18,6 @@ class FSP_PR final : public ServiceFramework { public: explicit FSP_PR(Core::System& system_); ~FSP_PR() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RegisterProgram"}, - FunctionInfo{1, nullptr, "UnregisterProgram"}, - FunctionInfo{2, nullptr, "SetCurrentProcess"}, - FunctionInfo{256, nullptr, "SetEnabledProgramVerification"} - ); }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index cb349636d5..58303a0bd6 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp @@ -47,142 +47,143 @@ namespace Service::FileSystem { -std::optional FSP_SRV::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenFileSystem"}, - FunctionInfo{1, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, - FunctionInfo{2, D<&FSP_SRV::OpenDataFileSystemByCurrentProcess>, "OpenDataFileSystemByCurrentProcess"}, - FunctionInfo{7, D<&FSP_SRV::OpenFileSystemWithPatch>, "OpenFileSystemWithPatch"}, - FunctionInfo{8, nullptr, "OpenFileSystemWithId"}, - FunctionInfo{9, nullptr, "OpenDataFileSystemByApplicationId"}, - FunctionInfo{11, nullptr, "OpenBisFileSystem"}, - FunctionInfo{12, nullptr, "OpenBisStorage"}, - FunctionInfo{13, nullptr, "InvalidateBisCache"}, - FunctionInfo{17, nullptr, "OpenHostFileSystem"}, - FunctionInfo{18, D<&FSP_SRV::OpenSdCardFileSystem>, "OpenSdCardFileSystem"}, - FunctionInfo{19, nullptr, "FormatSdCardFileSystem"}, - FunctionInfo{21, nullptr, "DeleteSaveDataFileSystem"}, - FunctionInfo{22, D<&FSP_SRV::CreateSaveDataFileSystem>, "CreateSaveDataFileSystem"}, - FunctionInfo{23, D<&FSP_SRV::CreateSaveDataFileSystemBySystemSaveDataId>, "CreateSaveDataFileSystemBySystemSaveDataId"}, - FunctionInfo{24, nullptr, "RegisterSaveDataFileSystemAtomicDeletion"}, - FunctionInfo{25, nullptr, "DeleteSaveDataFileSystemBySaveDataSpaceId"}, - FunctionInfo{26, nullptr, "FormatSdCardDryRun"}, - FunctionInfo{27, D<&FSP_SRV::IsExFatSupported>, "IsExFatSupported"}, - FunctionInfo{28, nullptr, "DeleteSaveDataFileSystemBySaveDataAttribute"}, - FunctionInfo{30, nullptr, "OpenGameCardStorage"}, - FunctionInfo{31, nullptr, "OpenGameCardFileSystem"}, - FunctionInfo{32, D<&FSP_SRV::ExtendSaveDataFileSystem>, "ExtendSaveDataFileSystem"}, - FunctionInfo{33, nullptr, "DeleteCacheStorage"}, - FunctionInfo{34, D<&FSP_SRV::GetCacheStorageSize>, "GetCacheStorageSize"}, - FunctionInfo{35, nullptr, "CreateSaveDataFileSystemByHashSalt"}, - FunctionInfo{36, nullptr, "OpenHostFileSystemWithOption"}, - FunctionInfo{37, D<&FSP_SRV::CreateSaveDataFileSystemWithCreationInfo2>, "CreateSaveDataFileSystemWithCreationInfo2"}, - FunctionInfo{51, D<&FSP_SRV::OpenSaveDataFileSystem>, "OpenSaveDataFileSystem"}, - FunctionInfo{52, D<&FSP_SRV::OpenSaveDataFileSystemBySystemSaveDataId>, "OpenSaveDataFileSystemBySystemSaveDataId"}, - FunctionInfo{53, D<&FSP_SRV::OpenReadOnlySaveDataFileSystem>, "OpenReadOnlySaveDataFileSystem"}, - FunctionInfo{57, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataBySaveDataSpaceId>, "ReadSaveDataFileSystemExtraDataBySaveDataSpaceId"}, - FunctionInfo{58, D<&FSP_SRV::ReadSaveDataFileSystemExtraData>, "ReadSaveDataFileSystemExtraData"}, - FunctionInfo{59, D<&FSP_SRV::WriteSaveDataFileSystemExtraData>, "WriteSaveDataFileSystemExtraData"}, - FunctionInfo{60, nullptr, "OpenSaveDataInfoReader"}, - FunctionInfo{61, D<&FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId>, "OpenSaveDataInfoReaderBySaveDataSpaceId"}, - FunctionInfo{62, D<&FSP_SRV::OpenSaveDataInfoReaderOnlyCacheStorage>, "OpenSaveDataInfoReaderOnlyCacheStorage"}, - FunctionInfo{64, nullptr, "OpenSaveDataInternalStorageFileSystem"}, - FunctionInfo{65, nullptr, "UpdateSaveDataMacForDebug"}, - FunctionInfo{66, nullptr, "WriteSaveDataFileSystemExtraData2"}, - FunctionInfo{67, D<&FSP_SRV::FindSaveDataWithFilter>, "FindSaveDataWithFilter"}, - FunctionInfo{68, nullptr, "OpenSaveDataInfoReaderBySaveDataFilter"}, - FunctionInfo{69, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataBySaveDataAttribute>, "ReadSaveDataFileSystemExtraDataBySaveDataAttribute"}, - FunctionInfo{70, D<&FSP_SRV::WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute>, "WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, - FunctionInfo{71, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute>, "ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, - FunctionInfo{80, nullptr, "OpenSaveDataMetaFile"}, - FunctionInfo{81, nullptr, "OpenSaveDataTransferManager"}, - FunctionInfo{82, nullptr, "OpenSaveDataTransferManagerVersion2"}, - FunctionInfo{83, D<&FSP_SRV::OpenSaveDataTransferProhibiter>, "OpenSaveDataTransferProhibiter"}, - FunctionInfo{84, nullptr, "ListApplicationAccessibleSaveDataOwnerId"}, - FunctionInfo{85, nullptr, "OpenSaveDataTransferManagerForSaveDataRepair"}, - FunctionInfo{86, nullptr, "OpenSaveDataMover"}, - FunctionInfo{87, nullptr, "OpenSaveDataTransferManagerForRepair"}, - FunctionInfo{100, nullptr, "OpenImageDirectoryFileSystem"}, - FunctionInfo{101, nullptr, "OpenBaseFileSystem"}, - FunctionInfo{102, nullptr, "FormatBaseFileSystem"}, - FunctionInfo{110, nullptr, "OpenContentStorageFileSystem"}, - FunctionInfo{120, nullptr, "OpenCloudBackupWorkStorageFileSystem"}, - FunctionInfo{130, nullptr, "OpenCustomStorageFileSystem"}, - FunctionInfo{200, D<&FSP_SRV::OpenDataStorageByCurrentProcess>, "OpenDataStorageByCurrentProcess"}, - FunctionInfo{201, nullptr, "OpenDataStorageByProgramId"}, - FunctionInfo{202, D<&FSP_SRV::OpenDataStorageByDataId>, "OpenDataStorageByDataId"}, - FunctionInfo{203, D<&FSP_SRV::OpenPatchDataStorageByCurrentProcess>, "OpenPatchDataStorageByCurrentProcess"}, - FunctionInfo{204, nullptr, "OpenDataFileSystemByProgramIndex"}, - FunctionInfo{205, D<&FSP_SRV::OpenDataStorageWithProgramIndex>, "OpenDataStorageWithProgramIndex"}, - FunctionInfo{206, nullptr, "OpenDataStorageByPath"}, - FunctionInfo{210, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, - FunctionInfo{400, nullptr, "OpenDeviceOperator"}, - FunctionInfo{500, nullptr, "OpenSdCardDetectionEventNotifier"}, - FunctionInfo{501, nullptr, "OpenGameCardDetectionEventNotifier"}, - FunctionInfo{510, nullptr, "OpenSystemDataUpdateEventNotifier"}, - FunctionInfo{511, nullptr, "NotifySystemDataUpdateEvent"}, - FunctionInfo{520, nullptr, "SimulateGameCardDetectionEvent"}, - FunctionInfo{600, nullptr, "SetCurrentPosixTime"}, - FunctionInfo{601, nullptr, "QuerySaveDataTotalSize"}, - FunctionInfo{602, nullptr, "VerifySaveDataFileSystem"}, - FunctionInfo{603, nullptr, "CorruptSaveDataFileSystem"}, - FunctionInfo{604, nullptr, "CreatePaddingFile"}, - FunctionInfo{605, nullptr, "DeleteAllPaddingFiles"}, - FunctionInfo{606, nullptr, "GetRightsId"}, - FunctionInfo{607, nullptr, "RegisterExternalKey"}, - FunctionInfo{608, nullptr, "UnregisterAllExternalKey"}, - FunctionInfo{609, nullptr, "GetRightsIdByPath"}, - FunctionInfo{610, nullptr, "GetRightsIdAndKeyGenerationByPath"}, - FunctionInfo{611, nullptr, "SetCurrentPosixTimeWithTimeDifference"}, - FunctionInfo{612, nullptr, "GetFreeSpaceSizeForSaveData"}, - FunctionInfo{613, nullptr, "VerifySaveDataFileSystemBySaveDataSpaceId"}, - FunctionInfo{614, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId"}, - FunctionInfo{615, nullptr, "QuerySaveDataInternalStorageTotalSize"}, - FunctionInfo{616, nullptr, "GetSaveDataCommitId"}, - FunctionInfo{617, nullptr, "UnregisterExternalKey"}, - FunctionInfo{620, nullptr, "SetSdCardEncryptionSeed"}, - FunctionInfo{630, nullptr, "SetSdCardAccessibility"}, - FunctionInfo{631, D<&FSP_SRV::IsSdCardAccessible>, "IsSdCardAccessible"}, - FunctionInfo{640, nullptr, "IsSignedSystemPartitionOnSdCardValid"}, - FunctionInfo{700, nullptr, "OpenAccessFailureResolver"}, - FunctionInfo{701, nullptr, "GetAccessFailureDetectionEvent"}, - FunctionInfo{702, nullptr, "IsAccessFailureDetected"}, - FunctionInfo{710, nullptr, "ResolveAccessFailure"}, - FunctionInfo{720, nullptr, "AbandonAccessFailure"}, - FunctionInfo{800, nullptr, "GetAndClearFileSystemProxyErrorInfo"}, - FunctionInfo{810, nullptr, "RegisterProgramIndexMapInfo"}, - FunctionInfo{820, nullptr, "GetContentStorageInfoIndex"}, - FunctionInfo{830, nullptr, "EncryptStreamPlaySaveData"}, - FunctionInfo{831, nullptr, "DecryptStreamPlaySaveData"}, - FunctionInfo{1000, nullptr, "SetBisRootForHost"}, - FunctionInfo{1001, nullptr, "SetSaveDataSize"}, - FunctionInfo{1002, nullptr, "SetSaveDataRootPath"}, - FunctionInfo{1003, D<&FSP_SRV::DisableAutoSaveDataCreation>, "DisableAutoSaveDataCreation"}, - FunctionInfo{1004, D<&FSP_SRV::SetGlobalAccessLogMode>, "SetGlobalAccessLogMode"}, - FunctionInfo{1005, D<&FSP_SRV::GetGlobalAccessLogMode>, "GetGlobalAccessLogMode"}, - FunctionInfo{1006, D<&FSP_SRV::OutputAccessLogToSdCard>, "OutputAccessLogToSdCard"}, - FunctionInfo{1007, nullptr, "RegisterUpdatePartition"}, - FunctionInfo{1008, nullptr, "OpenRegisteredUpdatePartition"}, - FunctionInfo{1009, nullptr, "GetAndClearMemoryReportInfo"}, - FunctionInfo{1010, nullptr, "SetDataStorageRedirectTarget"}, - FunctionInfo{1011, D<&FSP_SRV::GetProgramIndexForAccessLog>, "GetProgramIndexForAccessLog"}, - FunctionInfo{1012, nullptr, "GetFsStackUsage"}, - FunctionInfo{1013, nullptr, "UnsetSaveDataRootPath"}, - FunctionInfo{1014, nullptr, "OutputMultiProgramTagAccessLog"}, - FunctionInfo{1016, D<&FSP_SRV::FlushAccessLogOnSdCard>, "FlushAccessLogOnSdCard"}, - FunctionInfo{1017, nullptr, "OutputApplicationInfoAccessLog"}, - FunctionInfo{1018, nullptr, "SetDebugOption"}, - FunctionInfo{1019, nullptr, "UnsetDebugOption"}, - FunctionInfo{1100, nullptr, "OverrideSaveDataTransferTokenSignVerificationKey"}, - FunctionInfo{1110, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId2"}, - FunctionInfo{1200, D<&FSP_SRV::OpenMultiCommitManager>, "OpenMultiCommitManager"}, - FunctionInfo{1300, nullptr, "OpenBisWiper"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - FSP_SRV::FSP_SRV(Core::System& system_) - : ServiceFramework{system_, "fsp-srv"}, fsc{system.GetFileSystemController()}, content_provider{system.GetContentProvider()}, reporter{system.GetReporter()} { + : ServiceFramework{system_, "fsp-srv"}, fsc{system.GetFileSystemController()}, + content_provider{system.GetContentProvider()}, reporter{system.GetReporter()} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenFileSystem"}, + {1, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, + {2, D<&FSP_SRV::OpenDataFileSystemByCurrentProcess>, "OpenDataFileSystemByCurrentProcess"}, + {7, D<&FSP_SRV::OpenFileSystemWithPatch>, "OpenFileSystemWithPatch"}, + {8, nullptr, "OpenFileSystemWithId"}, + {9, nullptr, "OpenDataFileSystemByApplicationId"}, + {11, nullptr, "OpenBisFileSystem"}, + {12, nullptr, "OpenBisStorage"}, + {13, nullptr, "InvalidateBisCache"}, + {17, nullptr, "OpenHostFileSystem"}, + {18, D<&FSP_SRV::OpenSdCardFileSystem>, "OpenSdCardFileSystem"}, + {19, nullptr, "FormatSdCardFileSystem"}, + {21, nullptr, "DeleteSaveDataFileSystem"}, + {22, D<&FSP_SRV::CreateSaveDataFileSystem>, "CreateSaveDataFileSystem"}, + {23, D<&FSP_SRV::CreateSaveDataFileSystemBySystemSaveDataId>, "CreateSaveDataFileSystemBySystemSaveDataId"}, + {24, nullptr, "RegisterSaveDataFileSystemAtomicDeletion"}, + {25, nullptr, "DeleteSaveDataFileSystemBySaveDataSpaceId"}, + {26, nullptr, "FormatSdCardDryRun"}, + {27, D<&FSP_SRV::IsExFatSupported>, "IsExFatSupported"}, + {28, nullptr, "DeleteSaveDataFileSystemBySaveDataAttribute"}, + {30, nullptr, "OpenGameCardStorage"}, + {31, nullptr, "OpenGameCardFileSystem"}, + {32, D<&FSP_SRV::ExtendSaveDataFileSystem>, "ExtendSaveDataFileSystem"}, + {33, nullptr, "DeleteCacheStorage"}, + {34, D<&FSP_SRV::GetCacheStorageSize>, "GetCacheStorageSize"}, + {35, nullptr, "CreateSaveDataFileSystemByHashSalt"}, + {36, nullptr, "OpenHostFileSystemWithOption"}, + {37, D<&FSP_SRV::CreateSaveDataFileSystemWithCreationInfo2>, "CreateSaveDataFileSystemWithCreationInfo2"}, + {51, D<&FSP_SRV::OpenSaveDataFileSystem>, "OpenSaveDataFileSystem"}, + {52, D<&FSP_SRV::OpenSaveDataFileSystemBySystemSaveDataId>, "OpenSaveDataFileSystemBySystemSaveDataId"}, + {53, D<&FSP_SRV::OpenReadOnlySaveDataFileSystem>, "OpenReadOnlySaveDataFileSystem"}, + {57, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataBySaveDataSpaceId>, "ReadSaveDataFileSystemExtraDataBySaveDataSpaceId"}, + {58, D<&FSP_SRV::ReadSaveDataFileSystemExtraData>, "ReadSaveDataFileSystemExtraData"}, + {59, D<&FSP_SRV::WriteSaveDataFileSystemExtraData>, "WriteSaveDataFileSystemExtraData"}, + {60, nullptr, "OpenSaveDataInfoReader"}, + {61, D<&FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId>, "OpenSaveDataInfoReaderBySaveDataSpaceId"}, + {62, D<&FSP_SRV::OpenSaveDataInfoReaderOnlyCacheStorage>, "OpenSaveDataInfoReaderOnlyCacheStorage"}, + {64, nullptr, "OpenSaveDataInternalStorageFileSystem"}, + {65, nullptr, "UpdateSaveDataMacForDebug"}, + {66, nullptr, "WriteSaveDataFileSystemExtraData2"}, + {67, D<&FSP_SRV::FindSaveDataWithFilter>, "FindSaveDataWithFilter"}, + {68, nullptr, "OpenSaveDataInfoReaderBySaveDataFilter"}, + {69, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataBySaveDataAttribute>, "ReadSaveDataFileSystemExtraDataBySaveDataAttribute"}, + {70, D<&FSP_SRV::WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute>, "WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, + {71, D<&FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute>, "ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, + {80, nullptr, "OpenSaveDataMetaFile"}, + {81, nullptr, "OpenSaveDataTransferManager"}, + {82, nullptr, "OpenSaveDataTransferManagerVersion2"}, + {83, D<&FSP_SRV::OpenSaveDataTransferProhibiter>, "OpenSaveDataTransferProhibiter"}, + {84, nullptr, "ListApplicationAccessibleSaveDataOwnerId"}, + {85, nullptr, "OpenSaveDataTransferManagerForSaveDataRepair"}, + {86, nullptr, "OpenSaveDataMover"}, + {87, nullptr, "OpenSaveDataTransferManagerForRepair"}, + {100, nullptr, "OpenImageDirectoryFileSystem"}, + {101, nullptr, "OpenBaseFileSystem"}, + {102, nullptr, "FormatBaseFileSystem"}, + {110, nullptr, "OpenContentStorageFileSystem"}, + {120, nullptr, "OpenCloudBackupWorkStorageFileSystem"}, + {130, nullptr, "OpenCustomStorageFileSystem"}, + {200, D<&FSP_SRV::OpenDataStorageByCurrentProcess>, "OpenDataStorageByCurrentProcess"}, + {201, nullptr, "OpenDataStorageByProgramId"}, + {202, D<&FSP_SRV::OpenDataStorageByDataId>, "OpenDataStorageByDataId"}, + {203, D<&FSP_SRV::OpenPatchDataStorageByCurrentProcess>, "OpenPatchDataStorageByCurrentProcess"}, + {204, nullptr, "OpenDataFileSystemByProgramIndex"}, + {205, D<&FSP_SRV::OpenDataStorageWithProgramIndex>, "OpenDataStorageWithProgramIndex"}, + {206, nullptr, "OpenDataStorageByPath"}, + {210, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, + {400, nullptr, "OpenDeviceOperator"}, + {500, nullptr, "OpenSdCardDetectionEventNotifier"}, + {501, nullptr, "OpenGameCardDetectionEventNotifier"}, + {510, nullptr, "OpenSystemDataUpdateEventNotifier"}, + {511, nullptr, "NotifySystemDataUpdateEvent"}, + {520, nullptr, "SimulateGameCardDetectionEvent"}, + {600, nullptr, "SetCurrentPosixTime"}, + {601, nullptr, "QuerySaveDataTotalSize"}, + {602, nullptr, "VerifySaveDataFileSystem"}, + {603, nullptr, "CorruptSaveDataFileSystem"}, + {604, nullptr, "CreatePaddingFile"}, + {605, nullptr, "DeleteAllPaddingFiles"}, + {606, nullptr, "GetRightsId"}, + {607, nullptr, "RegisterExternalKey"}, + {608, nullptr, "UnregisterAllExternalKey"}, + {609, nullptr, "GetRightsIdByPath"}, + {610, nullptr, "GetRightsIdAndKeyGenerationByPath"}, + {611, nullptr, "SetCurrentPosixTimeWithTimeDifference"}, + {612, nullptr, "GetFreeSpaceSizeForSaveData"}, + {613, nullptr, "VerifySaveDataFileSystemBySaveDataSpaceId"}, + {614, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId"}, + {615, nullptr, "QuerySaveDataInternalStorageTotalSize"}, + {616, nullptr, "GetSaveDataCommitId"}, + {617, nullptr, "UnregisterExternalKey"}, + {620, nullptr, "SetSdCardEncryptionSeed"}, + {630, nullptr, "SetSdCardAccessibility"}, + {631, D<&FSP_SRV::IsSdCardAccessible>, "IsSdCardAccessible"}, + {640, nullptr, "IsSignedSystemPartitionOnSdCardValid"}, + {700, nullptr, "OpenAccessFailureResolver"}, + {701, nullptr, "GetAccessFailureDetectionEvent"}, + {702, nullptr, "IsAccessFailureDetected"}, + {710, nullptr, "ResolveAccessFailure"}, + {720, nullptr, "AbandonAccessFailure"}, + {800, nullptr, "GetAndClearFileSystemProxyErrorInfo"}, + {810, nullptr, "RegisterProgramIndexMapInfo"}, + {820, nullptr, "GetContentStorageInfoIndex"}, + {830, nullptr, "EncryptStreamPlaySaveData"}, + {831, nullptr, "DecryptStreamPlaySaveData"}, + {1000, nullptr, "SetBisRootForHost"}, + {1001, nullptr, "SetSaveDataSize"}, + {1002, nullptr, "SetSaveDataRootPath"}, + {1003, D<&FSP_SRV::DisableAutoSaveDataCreation>, "DisableAutoSaveDataCreation"}, + {1004, D<&FSP_SRV::SetGlobalAccessLogMode>, "SetGlobalAccessLogMode"}, + {1005, D<&FSP_SRV::GetGlobalAccessLogMode>, "GetGlobalAccessLogMode"}, + {1006, D<&FSP_SRV::OutputAccessLogToSdCard>, "OutputAccessLogToSdCard"}, + {1007, nullptr, "RegisterUpdatePartition"}, + {1008, nullptr, "OpenRegisteredUpdatePartition"}, + {1009, nullptr, "GetAndClearMemoryReportInfo"}, + {1010, nullptr, "SetDataStorageRedirectTarget"}, + {1011, D<&FSP_SRV::GetProgramIndexForAccessLog>, "GetProgramIndexForAccessLog"}, + {1012, nullptr, "GetFsStackUsage"}, + {1013, nullptr, "UnsetSaveDataRootPath"}, + {1014, nullptr, "OutputMultiProgramTagAccessLog"}, + {1016, D<&FSP_SRV::FlushAccessLogOnSdCard>, "FlushAccessLogOnSdCard"}, + {1017, nullptr, "OutputApplicationInfoAccessLog"}, + {1018, nullptr, "SetDebugOption"}, + {1019, nullptr, "UnsetDebugOption"}, + {1100, nullptr, "OverrideSaveDataTransferTokenSignVerificationKey"}, + {1110, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId2"}, + {1200, D<&FSP_SRV::OpenMultiCommitManager>, "OpenMultiCommitManager"}, + {1300, nullptr, "OpenBisWiper"}, + }; + // clang-format on + RegisterHandlers(functions); + if (Settings::values.enable_fs_access_log) { access_log_mode = AccessLogMode::SdCard; } diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.h b/src/core/hle/service/filesystem/fsp/fsp_srv.h index ebda008bcc..156cf4e571 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.h @@ -115,7 +115,6 @@ private: s64 available_size, s64 journal_size); Result GetCacheStorageSize(s32 index, Out out_data_size, Out out_journal_size); - std::optional FindRequest(u32 key) override; FileSystemController& fsc; const FileSys::ContentProvider& content_provider; const Core::Reporter& reporter; diff --git a/src/core/hle/service/filesystem/fsp/fsp_types.h b/src/core/hle/service/filesystem/fsp/fsp_types.h index 294da6a2de..c704203ad1 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_types.h +++ b/src/core/hle/service/filesystem/fsp/fsp_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.cpp b/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.cpp index d8d6289fe1..f4c218db8d 100644 --- a/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.cpp +++ b/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h b/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h index d206e1dea4..6141bae18c 100644 --- a/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h +++ b/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/filesystem/romfs_controller.cpp b/src/core/hle/service/filesystem/romfs_controller.cpp index 19c9cec722..9725d02f4b 100644 --- a/src/core/hle/service/filesystem/romfs_controller.cpp +++ b/src/core/hle/service/filesystem/romfs_controller.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/filesystem/romfs_controller.h b/src/core/hle/service/filesystem/romfs_controller.h index 3c3ead344c..5471e136c3 100644 --- a/src/core/hle/service/filesystem/romfs_controller.h +++ b/src/core/hle/service/filesystem/romfs_controller.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/filesystem/save_data_controller.cpp b/src/core/hle/service/filesystem/save_data_controller.cpp index 8720681d17..d3e22b1552 100644 --- a/src/core/hle/service/filesystem/save_data_controller.cpp +++ b/src/core/hle/service/filesystem/save_data_controller.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project diff --git a/src/core/hle/service/filesystem/save_data_controller.h b/src/core/hle/service/filesystem/save_data_controller.h index dc9d713dfb..afb95cb949 100644 --- a/src/core/hle/service/filesystem/save_data_controller.h +++ b/src/core/hle/service/filesystem/save_data_controller.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp index 5480d22b83..f8690dbb8b 100644 --- a/src/core/hle/service/friend/friend.cpp +++ b/src/core/hle/service/friend/friend.cpp @@ -11,36 +11,137 @@ #include "core/hle/kernel/k_event.h" #include "core/hle/service/acc/errors.h" #include "core/hle/service/friend/friend.h" +#include "core/hle/service/friend/friend_interface.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/server_manager.h" namespace Service::Friend { -class Friend final : public Module::Interface { -public: - explicit Friend(std::shared_ptr module_, Core::System& system_, const char* name) : Interface(std::move(module_), system_, name) {} - ~Friend() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &Friend::CreateFriendService, "CreateFriendService"}, - FunctionInfo{1, &Friend::CreateNotificationService, "CreateNotificationService"}, - FunctionInfo{2, nullptr, "CreateDaemonSuspendSessionService"} - ); -}; - class IFriendService final : public ServiceFramework { public: explicit IFriendService(Core::System& system_) : ServiceFramework{system_, "IFriendService"}, service_context{system, "IFriendService"} { - completion_event = service_context.CreateEvent("IFriendService:CompletionEvent"); - } + // clang-format off + static const FunctionInfo functions[] = { + {0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"}, + {1, &IFriendService::Cancel, "Cancel"}, + {10100, nullptr, "GetFriendListIds"}, + {10101, &IFriendService::GetFriendList, "GetFriendList"}, + {10102, nullptr, "UpdateFriendInfo"}, + {10110, nullptr, "GetFriendProfileImage"}, + {10111, nullptr, "GetFriendProfileImageWithImageSize"}, // 18.0.0+ + {10120, &IFriendService::CheckFriendListAvailability, "CheckFriendListAvailability"}, + {10121, nullptr, "EnsureFriendListAvailable"}, + {10200, nullptr, "SendFriendRequestForApplication"}, + {10211, nullptr, "AddFacedFriendRequestForApplication"}, + {10400, &IFriendService::GetBlockedUserListIds, "GetBlockedUserListIds"}, + {10420, &IFriendService::CheckBlockedUserListAvailability, "CheckBlockedUserListAvailability"}, + {10421, nullptr, "EnsureBlockedUserListAvailable"}, + {10500, nullptr, "GetProfileList"}, + {10501, nullptr, "GetProfileListV2"}, // 18.0.0+ + {10600, nullptr, "DeclareOpenOnlinePlaySession"}, + {10601, &IFriendService::DeclareCloseOnlinePlaySession, "DeclareCloseOnlinePlaySession"}, + {10610, &IFriendService::UpdateUserPresence, "UpdateUserPresence"}, + {10700, &IFriendService::GetPlayHistoryRegistrationKey, "GetPlayHistoryRegistrationKey"}, + {10701, nullptr, "GetPlayHistoryRegistrationKeyWithNetworkServiceAccountId"}, + {10702, nullptr, "AddPlayHistory"}, + {11000, nullptr, "GetProfileImageUrl"}, + {11001, nullptr, "GetProfileImageUrlV2"}, // 18.0.0+ + {20100, &IFriendService::GetFriendCount, "GetFriendCount"}, + {20101, &IFriendService::GetNewlyFriendCount, "GetNewlyFriendCount"}, + {20102, nullptr, "GetFriendDetailedInfo"}, + {20103, nullptr, "SyncFriendList"}, + {20104, &IFriendService::RequestSyncFriendList, "RequestSyncFriendList"}, + {20105, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV1"}, + {20106, nullptr, "UpdateFriendInfoForViewerV1"}, + {20107, nullptr, "GetFriendDetailedInfoV2"}, // 20.0.0+ + {20108, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV2"}, // 22.0.0+ + {20109, nullptr, "UpdateFriendInfoForViewerV2"}, // 22.0.0+ + {20110, nullptr, "LoadFriendSettingV1"}, + {20111, nullptr, "LoadFriendSettingV2"}, // 22.0.0+ + {20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"}, + {20201, nullptr, "GetFriendRequestListV1"}, + {20202, nullptr, "GetFriendRequestListV2"}, // 20.0.0+ + {20203, nullptr, "GetFriendRequestReceivedNotificationCount"}, // 22.0.0+ + {20300, nullptr, "GetFriendCandidateList"}, + {20301, nullptr, "GetNintendoNetworkIdInfo"}, + {20302, nullptr, "GetSnsAccountLinkage"}, // 5.0.0-19.0.1 + {20303, nullptr, "GetSnsAccountProfile"}, // 5.0.0-19.0.1 + {20304, nullptr, "GetSnsAccountFriendList"}, // 5.0.0-19.0.1 + {20400, nullptr, "GetBlockedUserListV1"}, + {20401, nullptr, "SyncBlockedUserList"}, + {20402, nullptr, "GetBlockedUserListV2"}, // 20.0.0+ + {20500, nullptr, "GetProfileExtraListV1"}, + {20501, nullptr, "GetRelationship"}, + {20502, nullptr, "GetProfileExtraListV2"}, // 19.0.0+ + {20600, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV1"}, + {20601, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV2"}, // 19.0.0+ + {20700, nullptr, "GetPlayHistoryListV1"}, + {20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"}, + {20702, nullptr, "GetPlayHistoryListV2"}, // 19.0.0+ + {20800, &IFriendService::LoadUserSetting, "LoadUserSettingV1"}, + {20801, nullptr, "SyncUserSetting"}, + {20802, &IFriendService::LoadUserSetting, "LoadUserSettingV2"}, // 19.0.0+ + {20900, &IFriendService::RequestListSummaryOverlayNotification, "RequestListSummaryOverlayNotification"}, + {21000, nullptr, "GetExternalApplicationCatalog"}, + {22000, nullptr, "GetReceivedFriendInvitationListV1"}, + {22001, nullptr, "GetReceivedFriendInvitationDetailedInfoV1"}, + {22002, nullptr, "GetReceivedFriendInvitationListV2"}, // 19.0.0+ + {22003, nullptr, "GetReceivedFriendInvitationDetailedInfoV2"}, // 19.0.0+ + {22010, &IFriendService::GetReceivedFriendInvitationCountCache, "GetReceivedFriendInvitationCountCache"}, + {30100, nullptr, "DropFriendNewlyFlags"}, + {30101, nullptr, "DeleteFriend"}, + {30110, nullptr, "DropFriendNewlyFlag"}, + {30120, nullptr, "ChangeFriendFavoriteFlag"}, + {30121, nullptr, "ChangeFriendOnlineNotificationFlag"}, + {30130, nullptr, "SetFriendNote"}, // 22.0.0+ + {30131, nullptr, "RequestUploadPendingNote"}, // 22.0.0+ + {30190, nullptr, "RequestSyncLocalUpdates"}, // 22.0.0+ + {30200, nullptr, "SendFriendRequest"}, + {30201, nullptr, "SendFriendRequestWithApplicationInfoV1"}, + {30202, nullptr, "CancelFriendRequest"}, + {30203, nullptr, "AcceptFriendRequest"}, + {30204, nullptr, "RejectFriendRequest"}, + {30205, nullptr, "ReadFriendRequest"}, + {30210, nullptr, "GetFacedFriendRequestRegistrationKey"}, + {30211, nullptr, "AddFacedFriendRequest"}, + {30212, nullptr, "CancelFacedFriendRequest"}, + {30213, nullptr, "GetFacedFriendRequestProfileImage"}, + {30214, nullptr, "GetFacedFriendRequestProfileImageFromPath"}, + {30215, nullptr, "SendFriendRequestWithExternalApplicationCatalogId"}, + {30216, nullptr, "ResendFacedFriendRequest"}, + {30217, nullptr, "SendFriendRequestWithNintendoNetworkIdInfo"}, + {30218, nullptr, "SendFriendRequestWithApplicationInfoV2"}, // 20.0.0+ + {30300, nullptr, "GetSnsAccountLinkPageUrl"}, // 5.0.0-19.0.1 + {30301, nullptr, "UnlinkSnsAccount"}, // 5.0.0-19.0.1 + {30400, nullptr, "BlockUser"}, + {30401, nullptr, "BlockUserWithApplicationInfoV1"}, + {30402, nullptr, "UnblockUser"}, + {30403, nullptr, "BlockUserWithApplicationInfoV2"}, // 20.0.0+ + {30500, nullptr, "GetProfileExtraFromFriendCodeV1"}, + {30501, nullptr, "GetProfileExtraFromFriendCodeV2"}, // 19.0.0+ + {30700, nullptr, "DeletePlayHistory"}, + {30701, nullptr, "AddPlayHistoryWithApplication"}, // 19.0.0+ + {30810, nullptr, "ChangePresencePermission"}, + {30811, nullptr, "ChangeFriendRequestReception"}, + {30812, nullptr, "ChangePlayLogPermission"}, + {30820, nullptr, "IssueFriendCode"}, + {30830, nullptr, "ClearPlayLog"}, + {30900, nullptr, "SendFriendInvitationV1"}, + {30901, nullptr, "SendFriendInvitationV2"}, // 19.0.0+ + {30910, nullptr, "ReadFriendInvitation"}, + {30911, nullptr, "ReadAllFriendInvitations"}, + {31000, nullptr, "OpenUser"}, // 19.0.0+ + {40100, nullptr, "DeleteFriendListCache"}, + {40400, nullptr, "DeleteBlockedUserListCache"}, + {49900, nullptr, "DeleteNetworkServiceAccountCache"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); + + completion_event = service_context.CreateEvent("IFriendService:CompletionEvent"); } ~IFriendService() override { @@ -266,134 +367,27 @@ private: rb.Push(0); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"}, - FunctionInfo{1, &IFriendService::Cancel, "Cancel"}, - FunctionInfo{10100, nullptr, "GetFriendListIds"}, - FunctionInfo{10101, &IFriendService::GetFriendList, "GetFriendList"}, - FunctionInfo{10102, nullptr, "UpdateFriendInfo"}, - FunctionInfo{10110, nullptr, "GetFriendProfileImage"}, - FunctionInfo{10111, nullptr, "GetFriendProfileImageWithImageSize", MakeVersionGate({18,0,0})}, - FunctionInfo{10120, &IFriendService::CheckFriendListAvailability, "CheckFriendListAvailability"}, - FunctionInfo{10121, nullptr, "EnsureFriendListAvailable"}, - FunctionInfo{10200, nullptr, "SendFriendRequestForApplication"}, - FunctionInfo{10211, nullptr, "AddFacedFriendRequestForApplication"}, - FunctionInfo{10400, &IFriendService::GetBlockedUserListIds, "GetBlockedUserListIds"}, - FunctionInfo{10420, &IFriendService::CheckBlockedUserListAvailability, "CheckBlockedUserListAvailability"}, - FunctionInfo{10421, nullptr, "EnsureBlockedUserListAvailable"}, - FunctionInfo{10500, nullptr, "GetProfileList"}, - FunctionInfo{10501, nullptr, "GetProfileListV2", MakeVersionGate({18,0,0})}, - FunctionInfo{10600, nullptr, "DeclareOpenOnlinePlaySession"}, - FunctionInfo{10601, &IFriendService::DeclareCloseOnlinePlaySession, "DeclareCloseOnlinePlaySession"}, - FunctionInfo{10610, &IFriendService::UpdateUserPresence, "UpdateUserPresence"}, - FunctionInfo{10700, &IFriendService::GetPlayHistoryRegistrationKey, "GetPlayHistoryRegistrationKey"}, - FunctionInfo{10701, nullptr, "GetPlayHistoryRegistrationKeyWithNetworkServiceAccountId"}, - FunctionInfo{10702, nullptr, "AddPlayHistory"}, - FunctionInfo{11000, nullptr, "GetProfileImageUrl"}, - FunctionInfo{11001, nullptr, "GetProfileImageUrlV2", MakeVersionGate({18,0,0})}, - FunctionInfo{20100, &IFriendService::GetFriendCount, "GetFriendCount"}, - FunctionInfo{20101, &IFriendService::GetNewlyFriendCount, "GetNewlyFriendCount"}, - FunctionInfo{20102, nullptr, "GetFriendDetailedInfo"}, - FunctionInfo{20103, nullptr, "SyncFriendList"}, - FunctionInfo{20104, &IFriendService::RequestSyncFriendList, "RequestSyncFriendList"}, - FunctionInfo{20105, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV1"}, - FunctionInfo{20106, nullptr, "UpdateFriendInfoForViewerV1"}, - FunctionInfo{20107, nullptr, "GetFriendDetailedInfoV2", MakeVersionGate({20,0,0})}, - FunctionInfo{20108, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV2", MakeVersionGate({22,0,0})}, - FunctionInfo{20109, nullptr, "UpdateFriendInfoForViewerV2", MakeVersionGate({22,0,0})}, - FunctionInfo{20110, nullptr, "LoadFriendSettingV1"}, - FunctionInfo{20111, nullptr, "LoadFriendSettingV2", MakeVersionGate({22,0,0})}, - FunctionInfo{20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"}, - FunctionInfo{20201, nullptr, "GetFriendRequestListV1"}, - FunctionInfo{20202, nullptr, "GetFriendRequestListV2", MakeVersionGate({20,0,0})}, - FunctionInfo{20203, nullptr, "GetFriendRequestReceivedNotificationCount", MakeVersionGate({22,0,0})}, - FunctionInfo{20300, nullptr, "GetFriendCandidateList"}, - FunctionInfo{20301, nullptr, "GetNintendoNetworkIdInfo"}, - FunctionInfo{20302, nullptr, "GetSnsAccountLinkage", MakeVersionGate({5,0,0}, {19,0,1})}, - FunctionInfo{20303, nullptr, "GetSnsAccountProfile", MakeVersionGate({5,0,0}, {19,0,1})}, - FunctionInfo{20304, nullptr, "GetSnsAccountFriendList", MakeVersionGate({5,0,0}, {19,0,1})}, - FunctionInfo{20400, nullptr, "GetBlockedUserListV1"}, - FunctionInfo{20401, nullptr, "SyncBlockedUserList"}, - FunctionInfo{20402, nullptr, "GetBlockedUserListV2", MakeVersionGate({20,0,0})}, - FunctionInfo{20500, nullptr, "GetProfileExtraListV1"}, - FunctionInfo{20501, nullptr, "GetRelationship"}, - FunctionInfo{20502, nullptr, "GetProfileExtraListV2", MakeVersionGate({19,0,0})}, - FunctionInfo{20600, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV1"}, - FunctionInfo{20601, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV2", MakeVersionGate({19,0,0})}, - FunctionInfo{20700, nullptr, "GetPlayHistoryListV1"}, - FunctionInfo{20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"}, - FunctionInfo{20702, nullptr, "GetPlayHistoryListV2", MakeVersionGate({19,0,0})}, - FunctionInfo{20800, &IFriendService::LoadUserSetting, "LoadUserSettingV1"}, - FunctionInfo{20801, nullptr, "SyncUserSetting"}, - FunctionInfo{20802, &IFriendService::LoadUserSetting, "LoadUserSettingV2", MakeVersionGate({19,0,0})}, - FunctionInfo{20900, &IFriendService::RequestListSummaryOverlayNotification, "RequestListSummaryOverlayNotification"}, - FunctionInfo{21000, nullptr, "GetExternalApplicationCatalog"}, - FunctionInfo{22000, nullptr, "GetReceivedFriendInvitationListV1"}, - FunctionInfo{22001, nullptr, "GetReceivedFriendInvitationDetailedInfoV1"}, - FunctionInfo{22002, nullptr, "GetReceivedFriendInvitationListV2", MakeVersionGate({19,0,0})}, - FunctionInfo{22003, nullptr, "GetReceivedFriendInvitationDetailedInfoV2", MakeVersionGate({19,0,0})}, - FunctionInfo{22010, &IFriendService::GetReceivedFriendInvitationCountCache, "GetReceivedFriendInvitationCountCache"}, - FunctionInfo{30100, nullptr, "DropFriendNewlyFlags"}, - FunctionInfo{30101, nullptr, "DeleteFriend"}, - FunctionInfo{30110, nullptr, "DropFriendNewlyFlag"}, - FunctionInfo{30120, nullptr, "ChangeFriendFavoriteFlag"}, - FunctionInfo{30121, nullptr, "ChangeFriendOnlineNotificationFlag"}, - FunctionInfo{30130, nullptr, "SetFriendNote", MakeVersionGate({22,0,0})}, - FunctionInfo{30131, nullptr, "RequestUploadPendingNote", MakeVersionGate({22,0,0})}, - FunctionInfo{30190, nullptr, "RequestSyncLocalUpdates", MakeVersionGate({22,0,0})}, - FunctionInfo{30200, nullptr, "SendFriendRequest"}, - FunctionInfo{30201, nullptr, "SendFriendRequestWithApplicationInfoV1"}, - FunctionInfo{30202, nullptr, "CancelFriendRequest"}, - FunctionInfo{30203, nullptr, "AcceptFriendRequest"}, - FunctionInfo{30204, nullptr, "RejectFriendRequest"}, - FunctionInfo{30205, nullptr, "ReadFriendRequest"}, - FunctionInfo{30210, nullptr, "GetFacedFriendRequestRegistrationKey"}, - FunctionInfo{30211, nullptr, "AddFacedFriendRequest"}, - FunctionInfo{30212, nullptr, "CancelFacedFriendRequest"}, - FunctionInfo{30213, nullptr, "GetFacedFriendRequestProfileImage"}, - FunctionInfo{30214, nullptr, "GetFacedFriendRequestProfileImageFromPath"}, - FunctionInfo{30215, nullptr, "SendFriendRequestWithExternalApplicationCatalogId"}, - FunctionInfo{30216, nullptr, "ResendFacedFriendRequest"}, - FunctionInfo{30217, nullptr, "SendFriendRequestWithNintendoNetworkIdInfo"}, - FunctionInfo{30218, nullptr, "SendFriendRequestWithApplicationInfoV2", MakeVersionGate({20,0,0})}, - FunctionInfo{30300, nullptr, "GetSnsAccountLinkPageUrl", MakeVersionGate({5,0,0}, {19,0,1})}, - FunctionInfo{30301, nullptr, "UnlinkSnsAccount", MakeVersionGate({5,0,0}, {19,0,1})}, - FunctionInfo{30400, nullptr, "BlockUser"}, - FunctionInfo{30401, nullptr, "BlockUserWithApplicationInfoV1"}, - FunctionInfo{30402, nullptr, "UnblockUser"}, - FunctionInfo{30403, nullptr, "BlockUserWithApplicationInfoV2", MakeVersionGate({20,0,0})}, - FunctionInfo{30500, nullptr, "GetProfileExtraFromFriendCodeV1"}, - FunctionInfo{30501, nullptr, "GetProfileExtraFromFriendCodeV2", MakeVersionGate({19,0,0})}, - FunctionInfo{30700, nullptr, "DeletePlayHistory"}, - FunctionInfo{30701, nullptr, "AddPlayHistoryWithApplication", MakeVersionGate({19,0,0})}, - FunctionInfo{30810, nullptr, "ChangePresencePermission"}, - FunctionInfo{30811, nullptr, "ChangeFriendRequestReception"}, - FunctionInfo{30812, nullptr, "ChangePlayLogPermission"}, - FunctionInfo{30820, nullptr, "IssueFriendCode"}, - FunctionInfo{30830, nullptr, "ClearPlayLog"}, - FunctionInfo{30900, nullptr, "SendFriendInvitationV1"}, - FunctionInfo{30901, nullptr, "SendFriendInvitationV2", MakeVersionGate({19,0,0})}, - FunctionInfo{30910, nullptr, "ReadFriendInvitation"}, - FunctionInfo{30911, nullptr, "ReadAllFriendInvitations"}, - FunctionInfo{31000, nullptr, "OpenUser", MakeVersionGate({19,0,0})}, - FunctionInfo{40100, nullptr, "DeleteFriendListCache"}, - FunctionInfo{40400, nullptr, "DeleteBlockedUserListCache"}, - FunctionInfo{49900, nullptr, "DeleteNetworkServiceAccountCache"} - ); KernelHelpers::ServiceContext service_context; + Kernel::KEvent* completion_event; }; class INotificationService final : public ServiceFramework { public: explicit INotificationService(Core::System& system_, Common::UUID uuid_) - : ServiceFramework{system_, "INotificationService"}, uuid{uuid_} - , service_context{system_, "INotificationService"} { - notification_event = service_context.CreateEvent("INotificationService:NotifyEvent"); - } + : ServiceFramework{system_, "INotificationService"}, uuid{uuid_}, + service_context{system_, "INotificationService"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &INotificationService::GetEvent, "GetEvent"}, + {1, &INotificationService::Clear, "Clear"}, + {2, &INotificationService::Pop, "Pop"} + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); + + notification_event = service_context.CreateEvent("INotificationService:NotifyEvent"); } ~INotificationService() override { @@ -471,13 +465,9 @@ private: bool has_received_friend_request; }; - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &INotificationService::GetEvent, "GetEvent"}, - FunctionInfo{1, &INotificationService::Clear, "Clear"}, - FunctionInfo{2, &INotificationService::Pop, "Pop"} - ); Common::UUID uuid; KernelHelpers::ServiceContext service_context; + Kernel::KEvent* notification_event; std::queue notifications; States states{}; @@ -511,67 +501,61 @@ class IServiceForApplication final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + {0, nullptr, "GetReceivableNeighborInfoCountMax"}, + {10, nullptr, "IsNeighborDetectionEnabled"}, + }; + RegisterHandlers(functions); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetReceivableNeighborInfoCountMax"}, - FunctionInfo{10, nullptr, "IsNeighborDetectionEnabled"} - ); }; class IServiceForSystem final : public ServiceFramework { public: explicit IServiceForSystem(Core::System& system_) : ServiceFramework{system_, "nd:sys"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + {0, nullptr, "GetReceivableNeighborInfoCountMax"}, + {10, nullptr, "IsNeighborDetectionEnabled"}, + {200, nullptr, "SetSystemData"}, + {201, nullptr, "ClearSystemData"}, + {203, nullptr, "GetReceivableNeighborInfoCountForSystem"}, + {204, nullptr, "ReceiveNeighborInfoForSystem"}, + {205, nullptr, "SetSender"}, + {206, nullptr, "GetSender"}, + {207, nullptr, "CreateScannerForSystem"}, + {208, nullptr, "CreateReceiveEventHolderForSystem"}, + {223, nullptr, "EnableNeighborDetection"}, + {224, nullptr, "DisableNeighborDetection"}, + {226, nullptr, "EnablePowerSave"}, + {227, nullptr, "DisablePowerSave"}, + {228, nullptr, "IsPowerSaveEnabled"}, + {232, nullptr, "ClearBlockedUsers"}, + {233, nullptr, "GetBlockedUserCount"}, + {234, nullptr, "BlockUserByLocalUserId"}, + {235, nullptr, "BlockUserByNetworkUserId"}, + {236, nullptr, "UnblockUserByLocalUserId"}, + {237, nullptr, "UnblockUserByNetworkUserId"}, + {240, nullptr, "DeleteApplication"}, + {250, nullptr, "InitializeApplicationInfo"}, + {260, nullptr, "CreateAccountSystemSaveDataAccessSuppressor"}, + {300, nullptr, "AddReceivedNeighborInfoForSystemForDebug"}, + {301, nullptr, "GetSendDataForDebug"}, + {302, nullptr, "ClearReceiveCounterForDebug"}, + {303, nullptr, "GetNextReceiveCounterForDebug"}, + {304, nullptr, "ListBlockedUsersForDebug"}, + {305, nullptr, "RefreshSendDataIdForDebug"}, + {306, nullptr, "ReloadFwdbgSettingsForDebug"}, + {307, nullptr, "EnableApplicationForDebug"}, + {308, nullptr, "GetNextReceiveCountersForDebug"}, + {309, nullptr, "ListApplicationInfoForDebug"}, + {310, nullptr, "SetApplicationDataForDebug"}, + {400, nullptr, "GetNetworkUserId"}, + {401, nullptr, "DeleteNetworkUserId"}, + }; + RegisterHandlers(functions); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetReceivableNeighborInfoCountMax"}, - FunctionInfo{10, nullptr, "IsNeighborDetectionEnabled"}, - FunctionInfo{200, nullptr, "SetSystemData"}, - FunctionInfo{201, nullptr, "ClearSystemData"}, - FunctionInfo{203, nullptr, "GetReceivableNeighborInfoCountForSystem"}, - FunctionInfo{204, nullptr, "ReceiveNeighborInfoForSystem"}, - FunctionInfo{205, nullptr, "SetSender"}, - FunctionInfo{206, nullptr, "GetSender"}, - FunctionInfo{207, nullptr, "CreateScannerForSystem"}, - FunctionInfo{208, nullptr, "CreateReceiveEventHolderForSystem"}, - FunctionInfo{223, nullptr, "EnableNeighborDetection"}, - FunctionInfo{224, nullptr, "DisableNeighborDetection"}, - FunctionInfo{226, nullptr, "EnablePowerSave"}, - FunctionInfo{227, nullptr, "DisablePowerSave"}, - FunctionInfo{228, nullptr, "IsPowerSaveEnabled"}, - FunctionInfo{232, nullptr, "ClearBlockedUsers"}, - FunctionInfo{233, nullptr, "GetBlockedUserCount"}, - FunctionInfo{234, nullptr, "BlockUserByLocalUserId"}, - FunctionInfo{235, nullptr, "BlockUserByNetworkUserId"}, - FunctionInfo{236, nullptr, "UnblockUserByLocalUserId"}, - FunctionInfo{237, nullptr, "UnblockUserByNetworkUserId"}, - FunctionInfo{240, nullptr, "DeleteApplication"}, - FunctionInfo{250, nullptr, "InitializeApplicationInfo"}, - FunctionInfo{260, nullptr, "CreateAccountSystemSaveDataAccessSuppressor"}, - FunctionInfo{300, nullptr, "AddReceivedNeighborInfoForSystemForDebug"}, - FunctionInfo{301, nullptr, "GetSendDataForDebug"}, - FunctionInfo{302, nullptr, "ClearReceiveCounterForDebug"}, - FunctionInfo{303, nullptr, "GetNextReceiveCounterForDebug"}, - FunctionInfo{304, nullptr, "ListBlockedUsersForDebug"}, - FunctionInfo{305, nullptr, "RefreshSendDataIdForDebug"}, - FunctionInfo{306, nullptr, "ReloadFwdbgSettingsForDebug"}, - FunctionInfo{307, nullptr, "EnableApplicationForDebug"}, - FunctionInfo{308, nullptr, "GetNextReceiveCountersForDebug"}, - FunctionInfo{309, nullptr, "ListApplicationInfoForDebug"}, - FunctionInfo{310, nullptr, "SetApplicationDataForDebug"}, - FunctionInfo{400, nullptr, "GetNetworkUserId"}, - FunctionInfo{401, nullptr, "DeleteNetworkUserId"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/friend/friend.h b/src/core/hle/service/friend/friend.h index 2824dc7866..61ac92fbb4 100644 --- a/src/core/hle/service/friend/friend.h +++ b/src/core/hle/service/friend/friend.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/friend/friend_interface.cpp b/src/core/hle/service/friend/friend_interface.cpp new file mode 100644 index 0000000000..b436d43303 --- /dev/null +++ b/src/core/hle/service/friend/friend_interface.cpp @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/friend/friend_interface.h" + +namespace Service::Friend { + +Friend::Friend(std::shared_ptr module_, Core::System& system_, const char* name) + : Interface(std::move(module_), system_, name) { + static const FunctionInfo functions[] = { + {0, &Friend::CreateFriendService, "CreateFriendService"}, + {1, &Friend::CreateNotificationService, "CreateNotificationService"}, + {2, nullptr, "CreateDaemonSuspendSessionService"}, + }; + RegisterHandlers(functions); +} + +Friend::~Friend() = default; + +} // namespace Service::Friend diff --git a/src/core/hle/service/friend/friend_interface.h b/src/core/hle/service/friend/friend_interface.h new file mode 100644 index 0000000000..0315c62c39 --- /dev/null +++ b/src/core/hle/service/friend/friend_interface.h @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/friend/friend.h" + +namespace Service::Friend { + +class Friend final : public Module::Interface { +public: + explicit Friend(std::shared_ptr module_, Core::System& system_, const char* name); + ~Friend() override; +}; + +} // namespace Service::Friend diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp index 203adb7ca7..7eda57ddc3 100644 --- a/src/core/hle/service/glue/arp.cpp +++ b/src/core/hle/service/glue/arp.cpp @@ -35,6 +35,22 @@ std::optional GetTitleIDForProcessID(Core::System& system, u64 process_id) ARP_R::ARP_R(Core::System& system_, const ARPManager& manager_) : ServiceFramework{system_, "arp:r"}, manager{manager_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &ARP_R::GetApplicationLaunchProperty, "GetApplicationLaunchProperty"}, + {1, &ARP_R::GetApplicationLaunchPropertyWithApplicationId, "GetApplicationLaunchPropertyWithApplicationId"}, + {2, &ARP_R::GetApplicationControlProperty, "GetApplicationControlProperty"}, + {3, &ARP_R::GetApplicationControlPropertyWithApplicationId, "GetApplicationControlPropertyWithApplicationId"}, + {4, nullptr, "GetApplicationInstanceUnregistrationNotifier"}, + {5, nullptr, "ListApplicationInstanceId"}, + {6, nullptr, "GetMicroApplicationInstanceId"}, + {7, nullptr, "GetApplicationCertificate"}, + {9998, nullptr, "GetPreomiaApplicationLaunchProperty"}, + {9999, nullptr, "GetPreomiaApplicationControlProperty"}, + }; + // clang-format on + + RegisterHandlers(functions); } ARP_R::~ARP_R() = default; @@ -148,10 +164,16 @@ public: using IssuerFn = std::function)>; explicit IRegistrar(Core::System& system_, IssuerFn&& issuer) - : ServiceFramework{system_, "IRegistrar"}, issue_process_id{std::move(issuer)} {} + : ServiceFramework{system_, "IRegistrar"}, issue_process_id{std::move(issuer)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IRegistrar::Issue, "Issue"}, + {1, &IRegistrar::SetApplicationLaunchProperty, "SetApplicationLaunchProperty"}, + {2, &IRegistrar::SetApplicationControlProperty, "SetApplicationControlProperty"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -216,11 +238,6 @@ private: rb.Push(ResultSuccess); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IRegistrar::Issue, "Issue"}, - FunctionInfo{1, &IRegistrar::SetApplicationLaunchProperty, "SetApplicationLaunchProperty"}, - FunctionInfo{2, &IRegistrar::SetApplicationControlProperty, "SetApplicationControlProperty"} - ); IssuerFn issue_process_id; bool issued = false; ApplicationLaunchProperty launch{}; @@ -229,6 +246,15 @@ private: ARP_W::ARP_W(Core::System& system_, ARPManager& manager_) : ServiceFramework{system_, "arp:w"}, manager{manager_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &ARP_W::AcquireRegistrar, "AcquireRegistrar"}, + {1, &ARP_W::UnregisterApplicationInstance , "UnregisterApplicationInstance "}, + {2, nullptr, "AcquireUpdater"}, + }; + // clang-format on + + RegisterHandlers(functions); } ARP_W::~ARP_W() = default; diff --git a/src/core/hle/service/glue/arp.h b/src/core/hle/service/glue/arp.h index de966475f9..ec3d809b5b 100644 --- a/src/core/hle/service/glue/arp.h +++ b/src/core/hle/service/glue/arp.h @@ -24,21 +24,6 @@ private: void GetApplicationControlProperty(HLERequestContext& ctx); void GetApplicationControlPropertyWithApplicationId(HLERequestContext& ctx); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ARP_R::GetApplicationLaunchProperty, "GetApplicationLaunchProperty"}, - FunctionInfo{1, &ARP_R::GetApplicationLaunchPropertyWithApplicationId, "GetApplicationLaunchPropertyWithApplicationId"}, - FunctionInfo{2, &ARP_R::GetApplicationControlProperty, "GetApplicationControlProperty"}, - FunctionInfo{3, &ARP_R::GetApplicationControlPropertyWithApplicationId, "GetApplicationControlPropertyWithApplicationId"}, - FunctionInfo{4, nullptr, "GetApplicationInstanceUnregistrationNotifier"}, - FunctionInfo{5, nullptr, "ListApplicationInstanceId"}, - FunctionInfo{6, nullptr, "GetMicroApplicationInstanceId"}, - FunctionInfo{7, nullptr, "GetApplicationCertificate"}, - FunctionInfo{9998, nullptr, "GetPreomiaApplicationLaunchProperty"}, - FunctionInfo{9999, nullptr, "GetPreomiaApplicationControlProperty"} - ); const ARPManager& manager; }; @@ -51,14 +36,6 @@ private: void AcquireRegistrar(HLERequestContext& ctx); void UnregisterApplicationInstance(HLERequestContext& ctx); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ARP_W::AcquireRegistrar, "AcquireRegistrar"}, - FunctionInfo{1, &ARP_W::UnregisterApplicationInstance , "UnregisterApplicationInstance "}, - FunctionInfo{2, nullptr, "AcquireUpdater"} - ); ARPManager& manager; std::shared_ptr registrar; }; diff --git a/src/core/hle/service/glue/bgtc.cpp b/src/core/hle/service/glue/bgtc.cpp index 7c7b5ea13c..360f16f0dd 100644 --- a/src/core/hle/service/glue/bgtc.cpp +++ b/src/core/hle/service/glue/bgtc.cpp @@ -11,7 +11,15 @@ namespace Service::Glue { -BGTC_T::BGTC_T(Core::System& system_) : ServiceFramework{system_, "bgtc:t"} {} +BGTC_T::BGTC_T(Core::System& system_) : ServiceFramework{system_, "bgtc:t"} { + // clang-format off + static const FunctionInfo functions[] = { + {100, &BGTC_T::OpenTaskService, "OpenTaskService"}, + }; + // clang-format on + + RegisterHandlers(functions); +} BGTC_T::~BGTC_T() = default; @@ -24,11 +32,44 @@ void BGTC_T::OpenTaskService(HLERequestContext& ctx) { } ITaskService::ITaskService(Core::System& system_) : ServiceFramework{system_, "ITaskService"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "NotifyTaskStarting"}, + {2, nullptr, "NotifyTaskFinished"}, + {3, nullptr, "GetTriggerEvent"}, + {4, nullptr, "IsInHalfAwake"}, + {5, nullptr, "NotifyClientName"}, + {6, nullptr, "IsInFullAwake"}, + {11, nullptr, "ScheduleTask"}, + {12, nullptr, "GetScheduledTaskInterval"}, + {13, nullptr, "UnscheduleTask"}, + {14, nullptr, "GetScheduleEvent"}, + {15, nullptr, "SchedulePeriodicTask"}, + {16, nullptr, "Unknown16"}, + {101, nullptr, "GetOperationMode"}, + {102, nullptr, "WillDisconnectNetworkWhenEnteringSleep"}, + {103, nullptr, "WillStayHalfAwakeInsteadSleep"}, + {200, nullptr, "Unknown200"}, + }; + // clang-format on + + RegisterHandlers(functions); } ITaskService::~ITaskService() = default; BGTC_SC::BGTC_SC(Core::System& system_) : ServiceFramework{system_, "bgtc:sc"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "GetState"}, + {2, nullptr, "GetStateChangedEvent"}, + {3, nullptr, "NotifyEnteringHalfAwake"}, + {4, nullptr, "NotifyLeavingHalfAwake"}, + {5, nullptr, "SetIsUsingSleepUnsupportedDevices"}, + }; + // clang-format on + + RegisterHandlers(functions); } BGTC_SC::~BGTC_SC() = default; diff --git a/src/core/hle/service/glue/bgtc.h b/src/core/hle/service/glue/bgtc.h index 0ef0ab902f..129193da1f 100644 --- a/src/core/hle/service/glue/bgtc.h +++ b/src/core/hle/service/glue/bgtc.h @@ -20,57 +20,18 @@ public: ~BGTC_T() override; void OpenTaskService(HLERequestContext& ctx); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{100, &BGTC_T::OpenTaskService, "OpenTaskService"} - ); }; class ITaskService final : public ServiceFramework { public: explicit ITaskService(Core::System& system_); ~ITaskService() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "NotifyTaskStarting"}, - FunctionInfo{2, nullptr, "NotifyTaskFinished"}, - FunctionInfo{3, nullptr, "GetTriggerEvent"}, - FunctionInfo{4, nullptr, "IsInHalfAwake"}, - FunctionInfo{5, nullptr, "NotifyClientName"}, - FunctionInfo{6, nullptr, "IsInFullAwake"}, - FunctionInfo{11, nullptr, "ScheduleTask"}, - FunctionInfo{12, nullptr, "GetScheduledTaskInterval"}, - FunctionInfo{13, nullptr, "UnscheduleTask"}, - FunctionInfo{14, nullptr, "GetScheduleEvent"}, - FunctionInfo{15, nullptr, "SchedulePeriodicTask"}, - FunctionInfo{16, nullptr, "Unknown16"}, - FunctionInfo{101, nullptr, "GetOperationMode"}, - FunctionInfo{102, nullptr, "WillDisconnectNetworkWhenEnteringSleep"}, - FunctionInfo{103, nullptr, "WillStayHalfAwakeInsteadSleep"}, - FunctionInfo{200, nullptr, "Unknown200"} - ); }; class BGTC_SC final : public ServiceFramework { public: explicit BGTC_SC(Core::System& system_); ~BGTC_SC() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "GetState"}, - FunctionInfo{2, nullptr, "GetStateChangedEvent"}, - FunctionInfo{3, nullptr, "NotifyEnteringHalfAwake"}, - FunctionInfo{4, nullptr, "NotifyLeavingHalfAwake"}, - FunctionInfo{5, nullptr, "SetIsUsingSleepUnsupportedDevices"} - ); }; } // namespace Service::Glue diff --git a/src/core/hle/service/glue/ectx.cpp b/src/core/hle/service/glue/ectx.cpp index 80d22a0ca7..322ae45254 100644 --- a/src/core/hle/service/glue/ectx.cpp +++ b/src/core/hle/service/glue/ectx.cpp @@ -12,10 +12,14 @@ namespace Service::Glue { // This is nn::err::context::IContextRegistrar class IContextRegistrar : public ServiceFramework { public: - IContextRegistrar(Core::System& system_) : ServiceFramework{system_, "IContextRegistrar"} {} + IContextRegistrar(Core::System& system_) : ServiceFramework{system_, "IContextRegistrar"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IContextRegistrar::Complete, "Complete"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } ~IContextRegistrar() override = default; @@ -37,21 +41,41 @@ private: rb.Push(ResultSuccess); rb.Push(0); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IContextRegistrar::Complete, "Complete"} - ); }; ECTX_W::ECTX_W(Core::System& system_) : ServiceFramework{system_, "ectx:w"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateContextRegistrar"}, + {1, nullptr, "CommitContext"}, + {2, nullptr, "RemoveContext"}, + }; + // clang-format on + RegisterHandlers(functions); } ECTX_W::~ECTX_W() = default; ECTX_R::ECTX_R(Core::System& system_) : ServiceFramework{system_, "ectx:r"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetContextInfo"}, + {1, nullptr, "PullContext"}, + {2, nullptr, "ListContextDescriptorWithResultForDebug"}, + }; + // clang-format on + RegisterHandlers(functions); } ECTX_R::~ECTX_R() = default; ECTX_AW::ECTX_AW(Core::System& system_) : ServiceFramework{system_, "ectx:aw"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &ECTX_AW::CreateContextRegistrar, "CreateContextRegistrar"}, + {1, nullptr, "CommitContext"}, + }; + // clang-format on + + RegisterHandlers(functions); } ECTX_AW::~ECTX_AW() = default; diff --git a/src/core/hle/service/glue/ectx.h b/src/core/hle/service/glue/ectx.h index 01f109c609..ff48075eda 100644 --- a/src/core/hle/service/glue/ectx.h +++ b/src/core/hle/service/glue/ectx.h @@ -18,30 +18,12 @@ class ECTX_W final : public ServiceFramework { public: explicit ECTX_W(Core::System& system_); ~ECTX_W() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateContextRegistrar"}, - FunctionInfo{1, nullptr, "CommitContext"}, - FunctionInfo{2, nullptr, "RemoveContext"} - ); }; class ECTX_R final : public ServiceFramework { public: explicit ECTX_R(Core::System& system_); ~ECTX_R() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetContextInfo"}, - FunctionInfo{1, nullptr, "PullContext"}, - FunctionInfo{2, nullptr, "ListContextDescriptorWithResultForDebug"} - ); }; class ECTX_AW final : public ServiceFramework { @@ -51,14 +33,6 @@ public: private: void CreateContextRegistrar(HLERequestContext& ctx); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ECTX_AW::CreateContextRegistrar, "CreateContextRegistrar"}, - FunctionInfo{1, nullptr, "CommitContext"} - ); }; } // namespace Service::Glue diff --git a/src/core/hle/service/glue/errors.h b/src/core/hle/service/glue/errors.h index 30feaa5c03..9839271447 100644 --- a/src/core/hle/service/glue/errors.h +++ b/src/core/hle/service/glue/errors.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/glue.h b/src/core/hle/service/glue/glue.h index 2a906f5ad6..64d45cfc14 100644 --- a/src/core/hle/service/glue/glue.h +++ b/src/core/hle/service/glue/glue.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/glue_manager.cpp b/src/core/hle/service/glue/glue_manager.cpp index 22f0017044..78fc5ebac3 100644 --- a/src/core/hle/service/glue/glue_manager.cpp +++ b/src/core/hle/service/glue/glue_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/glue_manager.h b/src/core/hle/service/glue/glue_manager.h index 216aa34c19..6330828834 100644 --- a/src/core/hle/service/glue/glue_manager.h +++ b/src/core/hle/service/glue/glue_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/notif.cpp b/src/core/hle/service/glue/notif.cpp index a369b78ddd..716e4da32d 100644 --- a/src/core/hle/service/glue/notif.cpp +++ b/src/core/hle/service/glue/notif.cpp @@ -17,45 +17,9 @@ namespace Service::Glue { namespace { + constexpr inline std::size_t MaxAlarms = 8; -} -std::optional INotificationServicesForApplication::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{500, D<&INotificationServicesForApplication::RegisterAlarmSetting>, "RegisterAlarmSetting"}, - FunctionInfo{510, D<&INotificationServicesForApplication::UpdateAlarmSetting>, "UpdateAlarmSetting"}, - FunctionInfo{520, D<&INotificationServicesForApplication::ListAlarmSettings>, "ListAlarmSettings"}, - FunctionInfo{530, D<&INotificationServicesForApplication::LoadApplicationParameter>, "LoadApplicationParameter"}, - FunctionInfo{540, D<&INotificationServicesForApplication::DeleteAlarmSetting>, "DeleteAlarmSetting"}, - FunctionInfo{1000, D<&INotificationServicesForApplication::Initialize>, "Initialize"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - -std::optional INotificationServices::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{500, D<&INotificationServices::RegisterAlarmSetting>, "RegisterAlarmSetting"}, - FunctionInfo{510, D<&INotificationServices::UpdateAlarmSetting>, "UpdateAlarmSetting"}, - FunctionInfo{520, D<&INotificationServices::ListAlarmSettings>, "ListAlarmSettings"}, - FunctionInfo{530, D<&INotificationServices::LoadApplicationParameter>, "LoadApplicationParameter"}, - FunctionInfo{540, D<&INotificationServices::DeleteAlarmSetting>, "DeleteAlarmSetting"}, - FunctionInfo{1000, D<&INotificationServices::Initialize>, "Initialize"}, - FunctionInfo{1010, nullptr, "ListNotifications"}, - FunctionInfo{1020, nullptr, "DeleteNotification"}, - FunctionInfo{1030, nullptr, "ClearNotifications"}, - FunctionInfo{1040, D<&INotificationServices::OpenNotificationSystemEventAccessor>, "OpenNotificationSystemEventAccessor"}, - FunctionInfo{1500, nullptr, "SetNotificationPresentationSetting"}, - FunctionInfo{1510, D<&INotificationServices::GetNotificationPresentationSetting>, "GetNotificationPresentationSetting"}, - FunctionInfo{2000, nullptr, "GetAlarmSetting"}, - FunctionInfo{2001, nullptr, "GetAlarmSettingWithApplicationParameter"}, - FunctionInfo{2010, nullptr, "MuteAlarmSetting"}, - FunctionInfo{2020, nullptr, "IsAlarmSettingReady"}, - FunctionInfo{8000, nullptr, "RegisterAppletResourceUserId"}, - FunctionInfo{8010, nullptr, "UnregisterAppletResourceUserId"}, - FunctionInfo{8999, nullptr, "GetCurrentTime"}, - FunctionInfo{9000, nullptr, "GetAlarmSettingNextNotificationTime"} - ); - return HandlerTableGenerateWithFind(key, functions); } Result NotificationServiceImpl::RegisterAlarmSetting(AlarmSettingId* out_alarm_setting_id, @@ -160,6 +124,18 @@ std::vector::iterator NotificationServiceImpl::GetAlarmFromId(Alar INotificationServicesForApplication::INotificationServicesForApplication(Core::System& system_) : ServiceFramework{system_, "notif:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {500, D<&INotificationServicesForApplication::RegisterAlarmSetting>, "RegisterAlarmSetting"}, + {510, D<&INotificationServicesForApplication::UpdateAlarmSetting>, "UpdateAlarmSetting"}, + {520, D<&INotificationServicesForApplication::ListAlarmSettings>, "ListAlarmSettings"}, + {530, D<&INotificationServicesForApplication::LoadApplicationParameter>, "LoadApplicationParameter"}, + {540, D<&INotificationServicesForApplication::DeleteAlarmSetting>, "DeleteAlarmSetting"}, + {1000, D<&INotificationServicesForApplication::Initialize>, "Initialize"}, + }; + // clang-format on + + RegisterHandlers(functions); } INotificationServicesForApplication::~INotificationServicesForApplication() = default; @@ -202,13 +178,18 @@ class INotificationSystemEventAccessor final : public ServiceFramework { public: explicit INotificationSystemEventAccessor(Core::System& system_) - : ServiceFramework{system_, "INotificationSystemEventAccessor"} - , service_context{system_, "INotificationSystemEventAccessor"} { - notification_event = service_context.CreateEvent("INotificationSystemEventAccessor:NotificationEvent"); - } + : ServiceFramework{system_, "INotificationSystemEventAccessor"}, + service_context{system_, "INotificationSystemEventAccessor"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&INotificationSystemEventAccessor::GetSystemEvent>, "GetSystemEvent"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); + + notification_event = + service_context.CreateEvent("INotificationSystemEventAccessor:NotificationEvent"); } ~INotificationSystemEventAccessor() { @@ -223,15 +204,38 @@ private: R_SUCCEED(); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&INotificationSystemEventAccessor::GetSystemEvent>, "GetSystemEvent"} - ); KernelHelpers::ServiceContext service_context; Kernel::KEvent* notification_event; }; INotificationServices::INotificationServices(Core::System& system_) : ServiceFramework{system_, "notif:s"} { + // clang-format off + static const FunctionInfo functions[] = { + {500, D<&INotificationServices::RegisterAlarmSetting>, "RegisterAlarmSetting"}, + {510, D<&INotificationServices::UpdateAlarmSetting>, "UpdateAlarmSetting"}, + {520, D<&INotificationServices::ListAlarmSettings>, "ListAlarmSettings"}, + {530, D<&INotificationServices::LoadApplicationParameter>, "LoadApplicationParameter"}, + {540, D<&INotificationServices::DeleteAlarmSetting>, "DeleteAlarmSetting"}, + {1000, D<&INotificationServices::Initialize>, "Initialize"}, + {1010, nullptr, "ListNotifications"}, + {1020, nullptr, "DeleteNotification"}, + {1030, nullptr, "ClearNotifications"}, + {1040, D<&INotificationServices::OpenNotificationSystemEventAccessor>, "OpenNotificationSystemEventAccessor"}, + {1500, nullptr, "SetNotificationPresentationSetting"}, + {1510, D<&INotificationServices::GetNotificationPresentationSetting>, "GetNotificationPresentationSetting"}, + {2000, nullptr, "GetAlarmSetting"}, + {2001, nullptr, "GetAlarmSettingWithApplicationParameter"}, + {2010, nullptr, "MuteAlarmSetting"}, + {2020, nullptr, "IsAlarmSettingReady"}, + {8000, nullptr, "RegisterAppletResourceUserId"}, + {8010, nullptr, "UnregisterAppletResourceUserId"}, + {8999, nullptr, "GetCurrentTime"}, + {9000, nullptr, "GetAlarmSettingNextNotificationTime"}, + }; + // clang-format on + + RegisterHandlers(functions); } INotificationServices::~INotificationServices() = default; diff --git a/src/core/hle/service/glue/notif.h b/src/core/hle/service/glue/notif.h index c5367e5da4..7ae20ba6f8 100644 --- a/src/core/hle/service/glue/notif.h +++ b/src/core/hle/service/glue/notif.h @@ -101,7 +101,6 @@ private: Result DeleteAlarmSetting(AlarmSettingId alarm_setting_id); Result Initialize(ClientAppletResourceUserId aruid); - std::optional FindRequest(u32 key) override; NotificationServiceImpl impl; }; @@ -131,7 +130,6 @@ private: Out out_notification_presentation_setting, NotificationChannel notification_channel); - std::optional FindRequest(u32 key) override; NotificationServiceImpl impl; }; } // namespace Service::Glue diff --git a/src/core/hle/service/glue/time/alarm_worker.h b/src/core/hle/service/glue/time/alarm_worker.h index 131d012a6a..c8882fed88 100644 --- a/src/core/hle/service/glue/time/alarm_worker.h +++ b/src/core/hle/service/glue/time/alarm_worker.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/file_timestamp_worker.cpp b/src/core/hle/service/glue/time/file_timestamp_worker.cpp index 048ff174c9..60bd688e72 100644 --- a/src/core/hle/service/glue/time/file_timestamp_worker.cpp +++ b/src/core/hle/service/glue/time/file_timestamp_worker.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/file_timestamp_worker.h b/src/core/hle/service/glue/time/file_timestamp_worker.h index 5f8b9b0499..58f74e7d29 100644 --- a/src/core/hle/service/glue/time/file_timestamp_worker.h +++ b/src/core/hle/service/glue/time/file_timestamp_worker.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/manager.cpp b/src/core/hle/service/glue/time/manager.cpp index 0da790e1c8..0b3312904e 100644 --- a/src/core/hle/service/glue/time/manager.cpp +++ b/src/core/hle/service/glue/time/manager.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project diff --git a/src/core/hle/service/glue/time/manager.h b/src/core/hle/service/glue/time/manager.h index 87e6a21fd5..5a86585754 100644 --- a/src/core/hle/service/glue/time/manager.h +++ b/src/core/hle/service/glue/time/manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/pm_state_change_handler.cpp b/src/core/hle/service/glue/time/pm_state_change_handler.cpp index 7470fb2259..0bc37f75da 100644 --- a/src/core/hle/service/glue/time/pm_state_change_handler.cpp +++ b/src/core/hle/service/glue/time/pm_state_change_handler.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/pm_state_change_handler.h b/src/core/hle/service/glue/time/pm_state_change_handler.h index 27d9f78726..bf99fa8a14 100644 --- a/src/core/hle/service/glue/time/pm_state_change_handler.h +++ b/src/core/hle/service/glue/time/pm_state_change_handler.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/standard_steady_clock_resource.cpp b/src/core/hle/service/glue/time/standard_steady_clock_resource.cpp index 5ebaa33e00..e191405567 100644 --- a/src/core/hle/service/glue/time/standard_steady_clock_resource.cpp +++ b/src/core/hle/service/glue/time/standard_steady_clock_resource.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/standard_steady_clock_resource.h b/src/core/hle/service/glue/time/standard_steady_clock_resource.h index 978d6b63b8..b5168cb837 100644 --- a/src/core/hle/service/glue/time/standard_steady_clock_resource.h +++ b/src/core/hle/service/glue/time/standard_steady_clock_resource.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/static.cpp b/src/core/hle/service/glue/time/static.cpp index dc7651fd1f..beccf6ce43 100644 --- a/src/core/hle/service/glue/time/static.cpp +++ b/src/core/hle/service/glue/time/static.cpp @@ -24,42 +24,42 @@ namespace Service::Glue::Time { -std::optional StaticService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"}, - FunctionInfo{1, D<&StaticService::GetStandardNetworkSystemClock>, "GetStandardNetworkSystemClock"}, - FunctionInfo{2, D<&StaticService::GetStandardSteadyClock>, "GetStandardSteadyClock"}, - FunctionInfo{3, D<&StaticService::GetTimeZoneService>, "GetTimeZoneService"}, - FunctionInfo{4, D<&StaticService::GetStandardLocalSystemClock>, "GetStandardLocalSystemClock"}, - FunctionInfo{5, D<&StaticService::GetEphemeralNetworkSystemClock>, "GetEphemeralNetworkSystemClock"}, - FunctionInfo{20, D<&StaticService::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, - FunctionInfo{50, D<&StaticService::SetStandardSteadyClockInternalOffset>, "SetStandardSteadyClockInternalOffset"}, - FunctionInfo{51, D<&StaticService::GetStandardSteadyClockRtcValue>, "GetStandardSteadyClockRtcValue"}, - FunctionInfo{100, D<&StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled>, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, - FunctionInfo{101, D<&StaticService::SetStandardUserSystemClockAutomaticCorrectionEnabled>, "SetStandardUserSystemClockAutomaticCorrectionEnabled"}, - FunctionInfo{102, D<&StaticService::GetStandardUserSystemClockInitialYear>, "GetStandardUserSystemClockInitialYear"}, - FunctionInfo{200, D<&StaticService::IsStandardNetworkSystemClockAccuracySufficient>, "IsStandardNetworkSystemClockAccuracySufficient"}, - FunctionInfo{201, D<&StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedTime"}, - FunctionInfo{300, D<&StaticService::CalculateMonotonicSystemClockBaseTimePoint>, "CalculateMonotonicSystemClockBaseTimePoint"}, - FunctionInfo{400, D<&StaticService::GetClockSnapshot>, "GetClockSnapshot"}, - FunctionInfo{401, D<&StaticService::GetClockSnapshotFromSystemClockContext>, "GetClockSnapshotFromSystemClockContext"}, - FunctionInfo{500, D<&StaticService::CalculateStandardUserSystemClockDifferenceByUser>, "CalculateStandardUserSystemClockDifferenceByUser"}, - FunctionInfo{501, D<&StaticService::CalculateSpanBetween>, "CalculateSpanBetween"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - StaticService::StaticService(Core::System& system_, Service::PSC::Time::StaticServiceSetupInfo setup_info, std::shared_ptr time, const char* name) - : ServiceFramework{system_, name}, m_time_m{time->m_time_m}, + : ServiceFramework{system_, name}, m_system{system_}, m_time_m{time->m_time_m}, m_setup_info{setup_info}, m_time_sm{time->m_time_sm}, m_file_timestamp_worker{time->m_file_timestamp_worker}, m_standard_steady_clock_resource{time->m_steady_clock_resource}, m_time_zone_binary{time->m_time_zone_binary} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"}, + {1, D<&StaticService::GetStandardNetworkSystemClock>, "GetStandardNetworkSystemClock"}, + {2, D<&StaticService::GetStandardSteadyClock>, "GetStandardSteadyClock"}, + {3, D<&StaticService::GetTimeZoneService>, "GetTimeZoneService"}, + {4, D<&StaticService::GetStandardLocalSystemClock>, "GetStandardLocalSystemClock"}, + {5, D<&StaticService::GetEphemeralNetworkSystemClock>, "GetEphemeralNetworkSystemClock"}, + {20, D<&StaticService::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, + {50, D<&StaticService::SetStandardSteadyClockInternalOffset>, "SetStandardSteadyClockInternalOffset"}, + {51, D<&StaticService::GetStandardSteadyClockRtcValue>, "GetStandardSteadyClockRtcValue"}, + {100, D<&StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled>, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, + {101, D<&StaticService::SetStandardUserSystemClockAutomaticCorrectionEnabled>, "SetStandardUserSystemClockAutomaticCorrectionEnabled"}, + {102, D<&StaticService::GetStandardUserSystemClockInitialYear>, "GetStandardUserSystemClockInitialYear"}, + {200, D<&StaticService::IsStandardNetworkSystemClockAccuracySufficient>, "IsStandardNetworkSystemClockAccuracySufficient"}, + {201, D<&StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedTime"}, + {300, D<&StaticService::CalculateMonotonicSystemClockBaseTimePoint>, "CalculateMonotonicSystemClockBaseTimePoint"}, + {400, D<&StaticService::GetClockSnapshot>, "GetClockSnapshot"}, + {401, D<&StaticService::GetClockSnapshotFromSystemClockContext>, "GetClockSnapshotFromSystemClockContext"}, + {500, D<&StaticService::CalculateStandardUserSystemClockDifferenceByUser>, "CalculateStandardUserSystemClockDifferenceByUser"}, + {501, D<&StaticService::CalculateSpanBetween>, "CalculateSpanBetween"}, + }; + // clang-format on + + RegisterHandlers(functions); m_set_sys = - system.ServiceManager().GetService("set:sys", true); + m_system.ServiceManager().GetService("set:sys", true); if (m_setup_info.can_write_local_clock && m_setup_info.can_write_user_clock && !m_setup_info.can_write_network_clock && m_setup_info.can_write_timezone_device_location && @@ -109,7 +109,7 @@ Result StaticService::GetTimeZoneService(OutInterface out_servi LOG_DEBUG(Service_Time, "called."); *out_service = std::make_shared( - system, m_file_timestamp_worker, m_setup_info.can_write_timezone_device_location, + m_system, m_file_timestamp_worker, m_setup_info.can_write_timezone_device_location, m_time_zone_binary, m_time_zone); R_SUCCEED(); } diff --git a/src/core/hle/service/glue/time/static.h b/src/core/hle/service/glue/time/static.h index 5856553461..a52b84bf31 100644 --- a/src/core/hle/service/glue/time/static.h +++ b/src/core/hle/service/glue/time/static.h @@ -72,11 +72,12 @@ public: Result CalculateSpanBetween(Out out_time, InClockSnapshot a, InClockSnapshot b); private: - std::optional FindRequest(u32 key) override; + Core::System& m_system; std::shared_ptr m_set_sys; std::shared_ptr m_time_m; std::shared_ptr m_wrapped_service; + Service::PSC::Time::StaticServiceSetupInfo m_setup_info; std::shared_ptr m_time_sm; std::shared_ptr m_time_zone; diff --git a/src/core/hle/service/glue/time/time_zone.cpp b/src/core/hle/service/glue/time/time_zone.cpp index 6e861b4060..52bd651f2b 100644 --- a/src/core/hle/service/glue/time/time_zone.cpp +++ b/src/core/hle/service/glue/time/time_zone.cpp @@ -19,26 +19,6 @@ namespace Service::Glue::Time { -std::optional TimeZoneService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"}, - FunctionInfo{1, D<&TimeZoneService::SetDeviceLocationName>, "SetDeviceLocationName"}, - FunctionInfo{2, D<&TimeZoneService::GetTotalLocationNameCount>, "GetTotalLocationNameCount"}, - FunctionInfo{3, D<&TimeZoneService::LoadLocationNameList>, "LoadLocationNameList"}, - FunctionInfo{4, D<&TimeZoneService::LoadTimeZoneRule>, "LoadTimeZoneRule"}, - FunctionInfo{5, D<&TimeZoneService::GetTimeZoneRuleVersion>, "GetTimeZoneRuleVersion"}, - FunctionInfo{6, D<&TimeZoneService::GetDeviceLocationNameAndUpdatedTime>, "GetDeviceLocationNameAndUpdatedTime"}, - FunctionInfo{7, D<&TimeZoneService::SetDeviceLocationNameWithTimeZoneRule>, "SetDeviceLocationNameWithTimeZoneRule"}, - FunctionInfo{8, D<&TimeZoneService::ParseTimeZoneBinary>, "ParseTimeZoneBinary"}, - FunctionInfo{20, D<&TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle>, "GetDeviceLocationNameOperationEventReadableHandle"}, - FunctionInfo{100, D<&TimeZoneService::ToCalendarTime>, "ToCalendarTime"}, - FunctionInfo{101, D<&TimeZoneService::ToCalendarTimeWithMyRule>, "ToCalendarTimeWithMyRule"}, - FunctionInfo{201, D<&TimeZoneService::ToPosixTime>, "ToPosixTime"}, - FunctionInfo{202, D<&TimeZoneService::ToPosixTimeWithMyRule>, "ToPosixTimeWithMyRule"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - TimeZoneService::TimeZoneService( Core::System& system_, FileTimestampWorker& file_timestamp_worker, bool can_write_timezone_device_location, TimeZoneBinary& time_zone_binary, @@ -50,6 +30,26 @@ TimeZoneService::TimeZoneService( , m_operation_event{system} , m_time_zone_binary{time_zone_binary} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"}, + {1, D<&TimeZoneService::SetDeviceLocationName>, "SetDeviceLocationName"}, + {2, D<&TimeZoneService::GetTotalLocationNameCount>, "GetTotalLocationNameCount"}, + {3, D<&TimeZoneService::LoadLocationNameList>, "LoadLocationNameList"}, + {4, D<&TimeZoneService::LoadTimeZoneRule>, "LoadTimeZoneRule"}, + {5, D<&TimeZoneService::GetTimeZoneRuleVersion>, "GetTimeZoneRuleVersion"}, + {6, D<&TimeZoneService::GetDeviceLocationNameAndUpdatedTime>, "GetDeviceLocationNameAndUpdatedTime"}, + {7, D<&TimeZoneService::SetDeviceLocationNameWithTimeZoneRule>, "SetDeviceLocationNameWithTimeZoneRule"}, + {8, D<&TimeZoneService::ParseTimeZoneBinary>, "ParseTimeZoneBinary"}, + {20, D<&TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle>, "GetDeviceLocationNameOperationEventReadableHandle"}, + {100, D<&TimeZoneService::ToCalendarTime>, "ToCalendarTime"}, + {101, D<&TimeZoneService::ToCalendarTimeWithMyRule>, "ToCalendarTimeWithMyRule"}, + {201, D<&TimeZoneService::ToPosixTime>, "ToPosixTime"}, + {202, D<&TimeZoneService::ToPosixTimeWithMyRule>, "ToPosixTimeWithMyRule"}, + }; + // clang-format on + RegisterHandlers(functions); + m_set_sys = system.ServiceManager().GetService("set:sys", true); } diff --git a/src/core/hle/service/glue/time/time_zone.h b/src/core/hle/service/glue/time/time_zone.h index 839d823e67..635070263b 100644 --- a/src/core/hle/service/glue/time/time_zone.h +++ b/src/core/hle/service/glue/time/time_zone.h @@ -80,7 +80,6 @@ public: const Service::PSC::Time::CalendarTime& calendar_time); private: - std::optional FindRequest(u32 key) override; std::shared_ptr m_set_sys; bool m_can_write_timezone_device_location; FileTimestampWorker& m_file_timestamp_worker; diff --git a/src/core/hle/service/glue/time/time_zone_binary.cpp b/src/core/hle/service/glue/time/time_zone_binary.cpp index 3cc1a62afd..eadad551e5 100644 --- a/src/core/hle/service/glue/time/time_zone_binary.cpp +++ b/src/core/hle/service/glue/time/time_zone_binary.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/time_zone_binary.h b/src/core/hle/service/glue/time/time_zone_binary.h index 135da631f2..012b933573 100644 --- a/src/core/hle/service/glue/time/time_zone_binary.h +++ b/src/core/hle/service/glue/time/time_zone_binary.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/time/worker.h b/src/core/hle/service/glue/time/worker.h index 69904e6748..f4be2ff367 100644 --- a/src/core/hle/service/glue/time/worker.h +++ b/src/core/hle/service/glue/time/worker.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/gpio/gpio.cpp b/src/core/hle/service/gpio/gpio.cpp index 5441149c65..8b4aa0f5ab 100644 --- a/src/core/hle/service/gpio/gpio.cpp +++ b/src/core/hle/service/gpio/gpio.cpp @@ -13,15 +13,15 @@ namespace Service::GPIO { class GPIO final : public ServiceFramework { public: - explicit GPIO(Core::System& system_) : ServiceFramework{system_, "gpio"} {} - ~GPIO() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit GPIO(Core::System& system_) + : ServiceFramework{system_, "gpio"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "Cmd0"}, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Cmd0"} - ); + ~GPIO() override = default; }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/grc/grc.cpp b/src/core/hle/service/grc/grc.cpp index 5f6c84e914..e8e901662d 100644 --- a/src/core/hle/service/grc/grc.cpp +++ b/src/core/hle/service/grc/grc.cpp @@ -14,31 +14,32 @@ namespace Service::GRC { class GRC final : public ServiceFramework { public: - explicit GRC(Core::System& system_) : ServiceFramework{system_, "grc:c"} {} + explicit GRC(Core::System& system_) : ServiceFramework{system_, "grc:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "OpenContinuousRecorder"}, + {2, nullptr, "OpenGameMovieTrimmer"}, + {3, nullptr, "OpenOffscreenRecorder"}, + {101, nullptr, "CreateMovieMaker"}, + {9903, nullptr, "SetOffscreenRecordingMarker"} + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "OpenContinuousRecorder"}, - FunctionInfo{2, nullptr, "OpenGameMovieTrimmer"}, - FunctionInfo{3, nullptr, "OpenOffscreenRecorder"}, - FunctionInfo{101, nullptr, "CreateMovieMaker"}, - FunctionInfo{9903, nullptr, "SetOffscreenRecordingMarker"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class GRC_D final : public ServiceFramework { public: - explicit GRC_D(Core::System& system_) : ServiceFramework{system_, "grc:d"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "Initialize"}, - FunctionInfo{2, nullptr, "Transfer"}, - FunctionInfo{3, nullptr, "Cmd3"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit GRC_D(Core::System& system_) : ServiceFramework{system_, "grc:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "Initialize"}, + {2, nullptr, "Transfer"}, + {3, nullptr, "Cmd3"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/grc/grc.h b/src/core/hle/service/grc/grc.h index a3f8a5b90e..4c2b45057d 100644 --- a/src/core/hle/service/grc/grc.h +++ b/src/core/hle/service/grc/grc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/hid/active_vibration_device_list.cpp b/src/core/hle/service/hid/active_vibration_device_list.cpp index 7a4f4cce2c..e0d6d3f2d9 100644 --- a/src/core/hle/service/hid/active_vibration_device_list.cpp +++ b/src/core/hle/service/hid/active_vibration_device_list.cpp @@ -14,16 +14,16 @@ namespace Service::HID { -std::optional IActiveVibrationDeviceList::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IActiveVibrationDeviceList::ActivateVibrationDevice>, "ActivateVibrationDevice"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IActiveVibrationDeviceList::IActiveVibrationDeviceList(Core::System& system_, std::shared_ptr resource) : ServiceFramework{system_, "IActiveVibrationDeviceList"}, resource_manager(resource) { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&IActiveVibrationDeviceList::ActivateVibrationDevice>, "ActivateVibrationDevice"}, + }; + // clang-format on + + RegisterHandlers(functions); } IActiveVibrationDeviceList::~IActiveVibrationDeviceList() = default; diff --git a/src/core/hle/service/hid/active_vibration_device_list.h b/src/core/hle/service/hid/active_vibration_device_list.h index 57c31a8df1..f155eaf839 100644 --- a/src/core/hle/service/hid/active_vibration_device_list.h +++ b/src/core/hle/service/hid/active_vibration_device_list.h @@ -29,8 +29,8 @@ public: private: static constexpr std::size_t MaxVibrationDevicesHandles{0x100}; + Result ActivateVibrationDevice(Core::HID::VibrationDeviceHandle vibration_device_handle); - std::optional FindRequest(u32 key) override; mutable std::mutex mutex; std::size_t list_size{}; diff --git a/src/core/hle/service/hid/applet_resource.cpp b/src/core/hle/service/hid/applet_resource.cpp index 6f658fa875..44ae767841 100644 --- a/src/core/hle/service/hid/applet_resource.cpp +++ b/src/core/hle/service/hid/applet_resource.cpp @@ -12,17 +12,14 @@ namespace Service::HID { -std::optional IAppletResource::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IAppletResource::GetSharedMemoryHandle>, "GetSharedMemoryHandle"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAppletResource::IAppletResource(Core::System& system_, std::shared_ptr resource, u64 applet_resource_user_id) : ServiceFramework{system_, "IAppletResource"}, aruid{applet_resource_user_id}, resource_manager{resource} { + static const FunctionInfo functions[] = { + {0, C<&IAppletResource::GetSharedMemoryHandle>, "GetSharedMemoryHandle"}, + }; + RegisterHandlers(functions); } IAppletResource::~IAppletResource() { diff --git a/src/core/hle/service/hid/applet_resource.h b/src/core/hle/service/hid/applet_resource.h index 7b5d915218..40c3852baa 100644 --- a/src/core/hle/service/hid/applet_resource.h +++ b/src/core/hle/service/hid/applet_resource.h @@ -32,7 +32,6 @@ public: private: Result GetSharedMemoryHandle(OutCopyHandle out_shared_memory_handle); - std::optional FindRequest(u32 key) override; u64 aruid{}; std::shared_ptr resource_manager; }; diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 0ea587312b..25096ff36f 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -16,24 +16,19 @@ #include "core/hle/service/server_manager.h" #include "hid_core/resource_manager.h" #include "hid_core/resources/hid_firmware_settings.h" -#include "core/hle/service/ipc_helpers.h" -#include "hid_core/hid_types.h" -#include "hid_core/resources/touch_screen/gesture.h" -#include "hid_core/resources/touch_screen/touch_screen.h" -#include "core/hle/service/cmif_serialization.h" namespace Service::HID { class IHidTemporaryServer final : public ServiceFramework { public: explicit IHidTemporaryServer(Core::System& system_) - : ServiceFramework{system_, "hid:tmp"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetConsoleSixAxisSensorCalibrationValues"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "hid:tmp"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetConsoleSixAxisSensorCalibrationValues"}, + }; + // clang-format on + RegisterHandlers(functions); } ~IHidTemporaryServer() override = default; }; @@ -41,17 +36,17 @@ public: class AHID_CD final : public ServiceFramework { public: explicit AHID_CD(Core::System& system_) - : ServiceFramework{system_, "ahid:cd"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "AcquireDevice"}, - FunctionInfo{1, nullptr, "ReleaseDevice"}, - FunctionInfo{2, nullptr, "GetCtrlSession"}, - FunctionInfo{3, nullptr, "GetReadSession"}, - FunctionInfo{4, nullptr, "GetWriteSession"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "ahid:cd"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "AcquireDevice"}, + {1, nullptr, "ReleaseDevice"}, + {2, nullptr, "GetCtrlSession"}, + {3, nullptr, "GetReadSession"}, + {4, nullptr, "GetWriteSession"}, + }; + // clang-format on + RegisterHandlers(functions); } ~AHID_CD() override = default; }; @@ -59,322 +54,22 @@ public: class AHID_HDR final : public ServiceFramework { public: explicit AHID_HDR(Core::System& system_) - : ServiceFramework{system_, "ahid:hdr"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetDeviceEntries"}, - FunctionInfo{1, nullptr, "GetDeviceList"}, - FunctionInfo{2, nullptr, "GetDeviceParameters"}, - FunctionInfo{3, nullptr, "AttachDevice"}, - FunctionInfo{4, nullptr, "DetachDevice"}, - FunctionInfo{5, nullptr, "SetDeviceFilter"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "ahid:hdr"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetDeviceEntries"}, + {1, nullptr, "GetDeviceList"}, + {2, nullptr, "GetDeviceParameters"}, + {3, nullptr, "AttachDevice"}, + {4, nullptr, "DetachDevice"}, + {5, nullptr, "SetDeviceFilter"}, + }; + // clang-format on + RegisterHandlers(functions); } ~AHID_HDR() override = default; }; -class IHidDebugServer final : public ServiceFramework { -public: - explicit IHidDebugServer(Core::System& system_, std::shared_ptr resource, - std::shared_ptr settings) - : ServiceFramework{system_, "hid:dbg"} - , resource_manager{resource} - , firmware_settings{settings} - {} - - ~IHidDebugServer() override = default; - - Result DeactivateTouchScreen() { - LOG_INFO(Service_HID, "called"); - - if (!firmware_settings->IsDeviceManaged()) { - R_RETURN(GetResourceManager()->GetTouchScreen()->Deactivate()); - } - - R_SUCCEED(); - } - - Result SetTouchScreenAutoPilotState( - InArray auto_pilot_buffer) { - AutoPilotState auto_pilot{}; - - auto_pilot.count = - static_cast((std::min)(auto_pilot_buffer.size(), auto_pilot.state.size())); - memcpy(auto_pilot.state.data(), auto_pilot_buffer.data(), - auto_pilot.count * sizeof(TouchState)); - - LOG_INFO(Service_HID, "called, auto_pilot_count={}", auto_pilot.count); - - R_RETURN(GetResourceManager()->GetTouchScreen()->SetTouchScreenAutoPilotState(auto_pilot)); - } - - Result UnsetTouchScreenAutoPilotState() { - LOG_INFO(Service_HID, "called"); - R_RETURN(GetResourceManager()->GetTouchScreen()->UnsetTouchScreenAutoPilotState()); - } - - Result GetTouchScreenConfiguration( - Out out_touchscreen_config, - ClientAppletResourceUserId aruid) { - LOG_INFO(Service_HID, "called, applet_resource_user_id={}", aruid.pid); - - R_TRY(GetResourceManager()->GetTouchScreen()->GetTouchScreenConfiguration( - *out_touchscreen_config, aruid.pid)); - - if (out_touchscreen_config->mode != Core::HID::TouchScreenModeForNx::Heat2 && - out_touchscreen_config->mode != Core::HID::TouchScreenModeForNx::Finger) { - out_touchscreen_config->mode = Core::HID::TouchScreenModeForNx::UseSystemSetting; - } - - R_SUCCEED(); - } - - Result ProcessTouchScreenAutoTune() { - LOG_INFO(Service_HID, "called"); - R_RETURN(GetResourceManager()->GetTouchScreen()->ProcessTouchScreenAutoTune()); - } - - Result ForceStopTouchScreenManagement() { - LOG_INFO(Service_HID, "called"); - - if (!firmware_settings->IsDeviceManaged()) { - R_SUCCEED(); - } - - auto touch_screen = GetResourceManager()->GetTouchScreen(); - auto gesture = GetResourceManager()->GetGesture(); - - if (firmware_settings->IsTouchI2cManaged()) { - bool is_touch_active{}; - bool is_gesture_active{}; - R_TRY(touch_screen->IsActive(is_touch_active)); - R_TRY(gesture->IsActive(is_gesture_active)); - - if (is_touch_active) { - R_TRY(touch_screen->Deactivate()); - } - if (is_gesture_active) { - R_TRY(gesture->Deactivate()); - } - } - - R_SUCCEED(); - } - - Result ForceRestartTouchScreenManagement(u32 basic_gesture_id, - ClientAppletResourceUserId aruid) { - LOG_INFO(Service_HID, "called, basic_gesture_id={}, applet_resource_user_id={}", - basic_gesture_id, aruid.pid); - - auto touch_screen = GetResourceManager()->GetTouchScreen(); - auto gesture = GetResourceManager()->GetGesture(); - - if (firmware_settings->IsDeviceManaged() && firmware_settings->IsTouchI2cManaged()) { - R_TRY(gesture->Activate()); - R_TRY(gesture->Activate(aruid.pid, basic_gesture_id)); - R_TRY(touch_screen->Activate()); - R_TRY(touch_screen->Activate(aruid.pid)); - } - - R_SUCCEED(); - } - - Result IsTouchScreenManaged(Out out_is_managed) { - LOG_INFO(Service_HID, "called"); - - bool is_touch_active{}; - bool is_gesture_active{}; - R_TRY(GetResourceManager()->GetTouchScreen()->IsActive(is_touch_active)); - R_TRY(GetResourceManager()->GetGesture()->IsActive(is_gesture_active)); - - *out_is_managed = is_touch_active || is_gesture_active; - R_SUCCEED(); - } - - Result DeactivateGesture() { - LOG_INFO(Service_HID, "called"); - - if (!firmware_settings->IsDeviceManaged()) { - R_RETURN(GetResourceManager()->GetGesture()->Deactivate()); - } - - R_SUCCEED(); - } - - std::shared_ptr GetResourceManager() { - resource_manager->Initialize(); - return resource_manager; - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "DeactivateDebugPad"}, - FunctionInfo{1, nullptr, "SetDebugPadAutoPilotState"}, - FunctionInfo{2, nullptr, "UnsetDebugPadAutoPilotState"}, - FunctionInfo{10, C<&IHidDebugServer::DeactivateTouchScreen>, "DeactivateTouchScreen"}, - FunctionInfo{11, C<&IHidDebugServer::SetTouchScreenAutoPilotState>, "SetTouchScreenAutoPilotState"}, - FunctionInfo{12, C<&IHidDebugServer::UnsetTouchScreenAutoPilotState>, "UnsetTouchScreenAutoPilotState"}, - FunctionInfo{13, C<&IHidDebugServer::GetTouchScreenConfiguration>, "GetTouchScreenConfiguration"}, - FunctionInfo{14, C<&IHidDebugServer::ProcessTouchScreenAutoTune>, "ProcessTouchScreenAutoTune"}, - FunctionInfo{15, C<&IHidDebugServer::ForceStopTouchScreenManagement>, "ForceStopTouchScreenManagement"}, - FunctionInfo{16, C<&IHidDebugServer::ForceRestartTouchScreenManagement>, "ForceRestartTouchScreenManagement"}, - FunctionInfo{17, C<&IHidDebugServer::IsTouchScreenManaged>, "IsTouchScreenManaged"}, - FunctionInfo{20, nullptr, "DeactivateMouse"}, - FunctionInfo{21, nullptr, "SetMouseAutoPilotState"}, - FunctionInfo{22, nullptr, "UnsetMouseAutoPilotState"}, - FunctionInfo{23, nullptr, "AddMouseSideWheelDelta"}, - FunctionInfo{25, nullptr, "SetDebugMouseAutoPilotState"}, - FunctionInfo{26, nullptr, "UnsetDebugMouseAutoPilotState"}, - FunctionInfo{30, nullptr, "DeactivateKeyboard"}, - FunctionInfo{31, nullptr, "SetKeyboardAutoPilotState"}, - FunctionInfo{32, nullptr, "UnsetKeyboardAutoPilotState"}, - FunctionInfo{50, nullptr, "DeactivateXpad"}, - FunctionInfo{51, nullptr, "SetXpadAutoPilotState"}, - FunctionInfo{52, nullptr, "UnsetXpadAutoPilotState"}, - FunctionInfo{53, nullptr, "DeactivateJoyXpad"}, - FunctionInfo{60, nullptr, "ClearNpadSystemCommonPolicy"}, - FunctionInfo{61, nullptr, "DeactivateNpad"}, - FunctionInfo{62, nullptr, "ForceDisconnectNpad"}, - FunctionInfo{91, C<&IHidDebugServer::DeactivateGesture>, "DeactivateGesture"}, - FunctionInfo{110, nullptr, "DeactivateHomeButton"}, - FunctionInfo{111, nullptr, "SetHomeButtonAutoPilotState"}, - FunctionInfo{112, nullptr, "UnsetHomeButtonAutoPilotState"}, - FunctionInfo{120, nullptr, "DeactivateSleepButton"}, - FunctionInfo{121, nullptr, "SetSleepButtonAutoPilotState"}, - FunctionInfo{122, nullptr, "UnsetSleepButtonAutoPilotState"}, - FunctionInfo{123, nullptr, "DeactivateInputDetector"}, - FunctionInfo{130, nullptr, "DeactivateCaptureButton"}, - FunctionInfo{131, nullptr, "SetCaptureButtonAutoPilotState"}, - FunctionInfo{132, nullptr, "UnsetCaptureButtonAutoPilotState"}, - FunctionInfo{133, nullptr, "SetShiftAccelerometerCalibrationValue"}, - FunctionInfo{134, nullptr, "GetShiftAccelerometerCalibrationValue"}, - FunctionInfo{135, nullptr, "SetShiftGyroscopeCalibrationValue"}, - FunctionInfo{136, nullptr, "GetShiftGyroscopeCalibrationValue"}, - FunctionInfo{140, nullptr, "DeactivateConsoleSixAxisSensor"}, - FunctionInfo{141, nullptr, "GetConsoleSixAxisSensorSamplingFrequency"}, - FunctionInfo{142, nullptr, "DeactivateSevenSixAxisSensor"}, - FunctionInfo{143, nullptr, "GetConsoleSixAxisSensorCountStates"}, - FunctionInfo{144, nullptr, "GetAccelerometerFsr"}, - FunctionInfo{145, nullptr, "SetAccelerometerFsr"}, - FunctionInfo{146, nullptr, "GetAccelerometerOdr"}, - FunctionInfo{147, nullptr, "SetAccelerometerOdr"}, - FunctionInfo{148, nullptr, "GetGyroscopeFsr"}, - FunctionInfo{149, nullptr, "SetGyroscopeFsr"}, - FunctionInfo{150, nullptr, "GetGyroscopeOdr"}, - FunctionInfo{151, nullptr, "SetGyroscopeOdr"}, - FunctionInfo{152, nullptr, "GetWhoAmI"}, - FunctionInfo{201, nullptr, "ActivateFirmwareUpdate"}, - FunctionInfo{202, nullptr, "DeactivateFirmwareUpdate"}, - FunctionInfo{203, nullptr, "StartFirmwareUpdate"}, - FunctionInfo{204, nullptr, "GetFirmwareUpdateStage"}, - FunctionInfo{205, nullptr, "GetFirmwareVersion"}, - FunctionInfo{206, nullptr, "GetDestinationFirmwareVersion"}, - FunctionInfo{207, nullptr, "DiscardFirmwareInfoCacheForRevert"}, - FunctionInfo{208, nullptr, "StartFirmwareUpdateForRevert"}, - FunctionInfo{209, nullptr, "GetAvailableFirmwareVersionForRevert"}, - FunctionInfo{210, nullptr, "IsFirmwareUpdatingDevice"}, - FunctionInfo{211, nullptr, "StartFirmwareUpdateIndividual"}, - FunctionInfo{212, nullptr, "GetDetailFirmwareVersion", MakeVersionGate({19,0,0})}, - FunctionInfo{215, nullptr, "SetUsbFirmwareForceUpdateEnabled"}, - FunctionInfo{216, nullptr, "SetAllKuinaDevicesToFirmwareUpdateMode"}, - FunctionInfo{221, nullptr, "UpdateControllerColor"}, - FunctionInfo{222, nullptr, "ConnectUsbPadsAsync"}, - FunctionInfo{223, nullptr, "DisconnectUsbPadsAsync"}, - FunctionInfo{224, nullptr, "UpdateDesignInfo"}, - FunctionInfo{225, nullptr, "GetUniquePadDriverState"}, - FunctionInfo{226, nullptr, "GetSixAxisSensorDriverStates"}, - FunctionInfo{227, nullptr, "GetRxPacketHistory"}, - FunctionInfo{228, nullptr, "AcquireOperationEventHandle"}, - FunctionInfo{229, nullptr, "ReadSerialFlash"}, - FunctionInfo{230, nullptr, "WriteSerialFlash"}, - FunctionInfo{231, nullptr, "GetOperationResult"}, - FunctionInfo{232, nullptr, "EnableShipmentMode"}, - FunctionInfo{233, nullptr, "ClearPairingInfo"}, - FunctionInfo{234, nullptr, "GetUniquePadDeviceTypeSetInternal"}, - FunctionInfo{235, nullptr, "EnableAnalogStickPower"}, - FunctionInfo{236, nullptr, "RequestKuinaUartClockCal"}, - FunctionInfo{237, nullptr, "GetKuinaUartClockCal"}, - FunctionInfo{238, nullptr, "SetKuinaUartClockTrim"}, - FunctionInfo{239, nullptr, "KuinaLoopbackTest"}, - FunctionInfo{240, nullptr, "RequestBatteryVoltage"}, - FunctionInfo{241, nullptr, "GetBatteryVoltage"}, - FunctionInfo{242, nullptr, "GetUniquePadPowerInfo"}, - FunctionInfo{243, nullptr, "RebootUniquePad"}, - FunctionInfo{244, nullptr, "RequestKuinaFirmwareVersion"}, - FunctionInfo{245, nullptr, "GetKuinaFirmwareVersion"}, - FunctionInfo{246, nullptr, "GetVidPid"}, - FunctionInfo{247, nullptr, "GetAnalogStickCalibrationValue"}, - FunctionInfo{248, nullptr, "GetUniquePadIdsFull"}, - FunctionInfo{249, nullptr, "ConnectUniquePad"}, - FunctionInfo{250, nullptr, "IsVirtual"}, - FunctionInfo{251, nullptr, "GetAnalogStickModuleParam"}, - FunctionInfo{253, nullptr, "ClearStorageForShipment", MakeVersionGate({19,0,0})}, - FunctionInfo{261, nullptr, "UpdateDesignInfo12", MakeVersionGate({21,0,0})}, - FunctionInfo{262, nullptr, "GetUniquePadButtonCount", MakeVersionGate({21,0,0})}, - FunctionInfo{267, nullptr, "SetAnalogStickCalibration", MakeVersionGate({21,0,0})}, - FunctionInfo{268, nullptr, "ResetAnalogStickCalibration", MakeVersionGate({21,0,0})}, - FunctionInfo{301, nullptr, "GetAbstractedPadHandles"}, - FunctionInfo{302, nullptr, "GetAbstractedPadState"}, - FunctionInfo{303, nullptr, "GetAbstractedPadsState"}, - FunctionInfo{321, nullptr, "SetAutoPilotVirtualPadState"}, - FunctionInfo{322, nullptr, "UnsetAutoPilotVirtualPadState"}, - FunctionInfo{323, nullptr, "UnsetAllAutoPilotVirtualPadState"}, - FunctionInfo{324, nullptr, "AttachHdlsWorkBuffer"}, - FunctionInfo{325, nullptr, "ReleaseHdlsWorkBuffer"}, - FunctionInfo{326, nullptr, "DumpHdlsNpadAssignmentState"}, - FunctionInfo{327, nullptr, "DumpHdlsStates"}, - FunctionInfo{328, nullptr, "ApplyHdlsNpadAssignmentState"}, - FunctionInfo{329, nullptr, "ApplyHdlsStateList"}, - FunctionInfo{330, nullptr, "AttachHdlsVirtualDevice"}, - FunctionInfo{331, nullptr, "DetachHdlsVirtualDevice"}, - FunctionInfo{332, nullptr, "SetHdlsState"}, - FunctionInfo{350, nullptr, "AddRegisteredDevice"}, - FunctionInfo{351, nullptr, "GetRegisteredDevicesCountDebug", MakeVersionGate({17,0,0}, {18,1,0})}, - FunctionInfo{352, nullptr, "DeleteRegisteredDevicesDebug", MakeVersionGate({17,0,0}, {18,1,0})}, - FunctionInfo{400, nullptr, "DisableExternalMcuOnNxDevice"}, - FunctionInfo{401, nullptr, "DisableRailDeviceFiltering"}, - FunctionInfo{402, nullptr, "EnableWiredPairing"}, - FunctionInfo{403, nullptr, "EnableShipmentModeAutoClear"}, - FunctionInfo{404, nullptr, "SetRailEnabled"}, - FunctionInfo{500, nullptr, "SetFactoryInt"}, - FunctionInfo{501, nullptr, "IsFactoryBootEnabled"}, - FunctionInfo{550, nullptr, "SetAnalogStickModelDataTemporarily"}, - FunctionInfo{551, nullptr, "GetAnalogStickModelData"}, - FunctionInfo{552, nullptr, "ResetAnalogStickModelData"}, - FunctionInfo{600, nullptr, "ConvertPadState"}, - FunctionInfo{601, nullptr, "IsButtonConfigSupported", MakeVersionGate({18,0,0})}, - FunctionInfo{602, nullptr, "IsButtonConfigEmbeddedSupported", MakeVersionGate({18,0,0})}, - FunctionInfo{603, nullptr, "DeleteButtonConfig", MakeVersionGate({18,0,0})}, - FunctionInfo{604, nullptr, "DeleteButtonConfigEmbedded", MakeVersionGate({18,0,0})}, - FunctionInfo{605, nullptr, "SetButtonConfigEnabled", MakeVersionGate({18,0,0})}, - FunctionInfo{606, nullptr, "SetButtonConfigEmbeddedEnabled", MakeVersionGate({18,0,0})}, - FunctionInfo{607, nullptr, "IsButtonConfigEnabled", MakeVersionGate({18,0,0})}, - FunctionInfo{608, nullptr, "IsButtonConfigEmbeddedEnabled", MakeVersionGate({18,0,0})}, - FunctionInfo{609, nullptr, "SetButtonConfigEmbedded", MakeVersionGate({18,0,0})}, - FunctionInfo{610, nullptr, "SetButtonConfigFull", MakeVersionGate({18,0,0})}, - FunctionInfo{611, nullptr, "SetButtonConfigLeft", MakeVersionGate({18,0,0})}, - FunctionInfo{612, nullptr, "SetButtonConfigRight", MakeVersionGate({18,0,0})}, - FunctionInfo{613, nullptr, "GetButtonConfigEmbedded", MakeVersionGate({18,0,0})}, - FunctionInfo{614, nullptr, "GetButtonConfigFull", MakeVersionGate({18,0,0})}, - FunctionInfo{615, nullptr, "GetButtonConfigLeft", MakeVersionGate({18,0,0})}, - FunctionInfo{616, nullptr, "GetButtonConfigRight", MakeVersionGate({18,0,0})}, - FunctionInfo{650, nullptr, "AddButtonPlayData"}, - FunctionInfo{651, nullptr, "StartButtonPlayData"}, - FunctionInfo{652, nullptr, "StopButtonPlayData"}, - FunctionInfo{700, nullptr, "GetRailAttachEventCount", MakeVersionGate({21,0,0})}, - FunctionInfo{2000, nullptr, "DeactivateDigitizer"}, - FunctionInfo{2001, nullptr, "SetDigitizerAutoPilotState"}, - FunctionInfo{2002, nullptr, "UnsetDigitizerAutoPilotState"}, - FunctionInfo{3000, nullptr, "ReloadFirmwareDebugSettings"} - ); - std::shared_ptr resource_manager; - std::shared_ptr firmware_settings; -}; - void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); auto firmware_settings = std::make_shared(system); diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index ec5463f4e2..bf8cd44481 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/hid/hid_debug_server.cpp b/src/core/hle/service/hid/hid_debug_server.cpp index 091d09dae5..42428a9ff9 100644 --- a/src/core/hle/service/hid/hid_debug_server.cpp +++ b/src/core/hle/service/hid/hid_debug_server.cpp @@ -18,4 +18,298 @@ namespace Service::HID { +IHidDebugServer::IHidDebugServer(Core::System& system_, std::shared_ptr resource, + std::shared_ptr settings) + : ServiceFramework{system_, "hid:dbg"}, resource_manager{resource}, firmware_settings{ + settings} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "DeactivateDebugPad"}, + {1, nullptr, "SetDebugPadAutoPilotState"}, + {2, nullptr, "UnsetDebugPadAutoPilotState"}, + {10, C<&IHidDebugServer::DeactivateTouchScreen>, "DeactivateTouchScreen"}, + {11, C<&IHidDebugServer::SetTouchScreenAutoPilotState>, "SetTouchScreenAutoPilotState"}, + {12, C<&IHidDebugServer::UnsetTouchScreenAutoPilotState>, "UnsetTouchScreenAutoPilotState"}, + {13, C<&IHidDebugServer::GetTouchScreenConfiguration>, "GetTouchScreenConfiguration"}, + {14, C<&IHidDebugServer::ProcessTouchScreenAutoTune>, "ProcessTouchScreenAutoTune"}, + {15, C<&IHidDebugServer::ForceStopTouchScreenManagement>, "ForceStopTouchScreenManagement"}, + {16, C<&IHidDebugServer::ForceRestartTouchScreenManagement>, "ForceRestartTouchScreenManagement"}, + {17, C<&IHidDebugServer::IsTouchScreenManaged>, "IsTouchScreenManaged"}, + {20, nullptr, "DeactivateMouse"}, + {21, nullptr, "SetMouseAutoPilotState"}, + {22, nullptr, "UnsetMouseAutoPilotState"}, + {23, nullptr, "AddMouseSideWheelDelta"}, + {25, nullptr, "SetDebugMouseAutoPilotState"}, + {26, nullptr, "UnsetDebugMouseAutoPilotState"}, + {30, nullptr, "DeactivateKeyboard"}, + {31, nullptr, "SetKeyboardAutoPilotState"}, + {32, nullptr, "UnsetKeyboardAutoPilotState"}, + {50, nullptr, "DeactivateXpad"}, + {51, nullptr, "SetXpadAutoPilotState"}, + {52, nullptr, "UnsetXpadAutoPilotState"}, + {53, nullptr, "DeactivateJoyXpad"}, + {60, nullptr, "ClearNpadSystemCommonPolicy"}, + {61, nullptr, "DeactivateNpad"}, + {62, nullptr, "ForceDisconnectNpad"}, + {91, C<&IHidDebugServer::DeactivateGesture>, "DeactivateGesture"}, + {110, nullptr, "DeactivateHomeButton"}, + {111, nullptr, "SetHomeButtonAutoPilotState"}, + {112, nullptr, "UnsetHomeButtonAutoPilotState"}, + {120, nullptr, "DeactivateSleepButton"}, + {121, nullptr, "SetSleepButtonAutoPilotState"}, + {122, nullptr, "UnsetSleepButtonAutoPilotState"}, + {123, nullptr, "DeactivateInputDetector"}, + {130, nullptr, "DeactivateCaptureButton"}, + {131, nullptr, "SetCaptureButtonAutoPilotState"}, + {132, nullptr, "UnsetCaptureButtonAutoPilotState"}, + {133, nullptr, "SetShiftAccelerometerCalibrationValue"}, + {134, nullptr, "GetShiftAccelerometerCalibrationValue"}, + {135, nullptr, "SetShiftGyroscopeCalibrationValue"}, + {136, nullptr, "GetShiftGyroscopeCalibrationValue"}, + {140, nullptr, "DeactivateConsoleSixAxisSensor"}, + {141, nullptr, "GetConsoleSixAxisSensorSamplingFrequency"}, + {142, nullptr, "DeactivateSevenSixAxisSensor"}, + {143, nullptr, "GetConsoleSixAxisSensorCountStates"}, + {144, nullptr, "GetAccelerometerFsr"}, + {145, nullptr, "SetAccelerometerFsr"}, + {146, nullptr, "GetAccelerometerOdr"}, + {147, nullptr, "SetAccelerometerOdr"}, + {148, nullptr, "GetGyroscopeFsr"}, + {149, nullptr, "SetGyroscopeFsr"}, + {150, nullptr, "GetGyroscopeOdr"}, + {151, nullptr, "SetGyroscopeOdr"}, + {152, nullptr, "GetWhoAmI"}, + {201, nullptr, "ActivateFirmwareUpdate"}, + {202, nullptr, "DeactivateFirmwareUpdate"}, + {203, nullptr, "StartFirmwareUpdate"}, + {204, nullptr, "GetFirmwareUpdateStage"}, + {205, nullptr, "GetFirmwareVersion"}, + {206, nullptr, "GetDestinationFirmwareVersion"}, + {207, nullptr, "DiscardFirmwareInfoCacheForRevert"}, + {208, nullptr, "StartFirmwareUpdateForRevert"}, + {209, nullptr, "GetAvailableFirmwareVersionForRevert"}, + {210, nullptr, "IsFirmwareUpdatingDevice"}, + {211, nullptr, "StartFirmwareUpdateIndividual"}, + {212, nullptr, "GetDetailFirmwareVersion"}, // 19.0.0+ + {215, nullptr, "SetUsbFirmwareForceUpdateEnabled"}, + {216, nullptr, "SetAllKuinaDevicesToFirmwareUpdateMode"}, + {221, nullptr, "UpdateControllerColor"}, + {222, nullptr, "ConnectUsbPadsAsync"}, + {223, nullptr, "DisconnectUsbPadsAsync"}, + {224, nullptr, "UpdateDesignInfo"}, + {225, nullptr, "GetUniquePadDriverState"}, + {226, nullptr, "GetSixAxisSensorDriverStates"}, + {227, nullptr, "GetRxPacketHistory"}, + {228, nullptr, "AcquireOperationEventHandle"}, + {229, nullptr, "ReadSerialFlash"}, + {230, nullptr, "WriteSerialFlash"}, + {231, nullptr, "GetOperationResult"}, + {232, nullptr, "EnableShipmentMode"}, + {233, nullptr, "ClearPairingInfo"}, + {234, nullptr, "GetUniquePadDeviceTypeSetInternal"}, + {235, nullptr, "EnableAnalogStickPower"}, + {236, nullptr, "RequestKuinaUartClockCal"}, + {237, nullptr, "GetKuinaUartClockCal"}, + {238, nullptr, "SetKuinaUartClockTrim"}, + {239, nullptr, "KuinaLoopbackTest"}, + {240, nullptr, "RequestBatteryVoltage"}, + {241, nullptr, "GetBatteryVoltage"}, + {242, nullptr, "GetUniquePadPowerInfo"}, + {243, nullptr, "RebootUniquePad"}, + {244, nullptr, "RequestKuinaFirmwareVersion"}, + {245, nullptr, "GetKuinaFirmwareVersion"}, + {246, nullptr, "GetVidPid"}, + {247, nullptr, "GetAnalogStickCalibrationValue"}, + {248, nullptr, "GetUniquePadIdsFull"}, + {249, nullptr, "ConnectUniquePad"}, + {250, nullptr, "IsVirtual"}, + {251, nullptr, "GetAnalogStickModuleParam"}, + {253, nullptr, "ClearStorageForShipment"}, //19.0.0+ + {261, nullptr, "UpdateDesignInfo12"}, //21.0.0+ + {262, nullptr, "GetUniquePadButtonCount"}, //21.0.0+ + {267, nullptr, "SetAnalogStickCalibration"}, //21.0.0+ + {268, nullptr, "ResetAnalogStickCalibration"}, //21.0.0+ + {301, nullptr, "GetAbstractedPadHandles"}, + {302, nullptr, "GetAbstractedPadState"}, + {303, nullptr, "GetAbstractedPadsState"}, + {321, nullptr, "SetAutoPilotVirtualPadState"}, + {322, nullptr, "UnsetAutoPilotVirtualPadState"}, + {323, nullptr, "UnsetAllAutoPilotVirtualPadState"}, + {324, nullptr, "AttachHdlsWorkBuffer"}, + {325, nullptr, "ReleaseHdlsWorkBuffer"}, + {326, nullptr, "DumpHdlsNpadAssignmentState"}, + {327, nullptr, "DumpHdlsStates"}, + {328, nullptr, "ApplyHdlsNpadAssignmentState"}, + {329, nullptr, "ApplyHdlsStateList"}, + {330, nullptr, "AttachHdlsVirtualDevice"}, + {331, nullptr, "DetachHdlsVirtualDevice"}, + {332, nullptr, "SetHdlsState"}, + {350, nullptr, "AddRegisteredDevice"}, + {351, nullptr, "GetRegisteredDevicesCountDebug"}, //17.0.0-18.1.0 + {352, nullptr, "DeleteRegisteredDevicesDebug"}, //17.0.0-18.1.0 + {400, nullptr, "DisableExternalMcuOnNxDevice"}, + {401, nullptr, "DisableRailDeviceFiltering"}, + {402, nullptr, "EnableWiredPairing"}, + {403, nullptr, "EnableShipmentModeAutoClear"}, + {404, nullptr, "SetRailEnabled"}, + {500, nullptr, "SetFactoryInt"}, + {501, nullptr, "IsFactoryBootEnabled"}, + {550, nullptr, "SetAnalogStickModelDataTemporarily"}, + {551, nullptr, "GetAnalogStickModelData"}, + {552, nullptr, "ResetAnalogStickModelData"}, + {600, nullptr, "ConvertPadState"}, + {601, nullptr, "IsButtonConfigSupported"}, //18.0.0+ + {602, nullptr, "IsButtonConfigEmbeddedSupported"}, //18.0.0+ + {603, nullptr, "DeleteButtonConfig"}, //18.0.0+ + {604, nullptr, "DeleteButtonConfigEmbedded"}, //18.0.0+ + {605, nullptr, "SetButtonConfigEnabled"}, //18.0.0+ + {606, nullptr, "SetButtonConfigEmbeddedEnabled"}, //18.0.0+ + {607, nullptr, "IsButtonConfigEnabled"}, //18.0.0+ + {608, nullptr, "IsButtonConfigEmbeddedEnabled"}, //18.0.0+ + {609, nullptr, "SetButtonConfigEmbedded"}, //18.0.0+ + {610, nullptr, "SetButtonConfigFull"}, //18.0.0+ + {611, nullptr, "SetButtonConfigLeft"}, //18.0.0+ + {612, nullptr, "SetButtonConfigRight"}, //18.0.0+ + {613, nullptr, "GetButtonConfigEmbedded"}, //18.0.0+ + {614, nullptr, "GetButtonConfigFull"}, //18.0.0+ + {615, nullptr, "GetButtonConfigLeft"}, //18.0.0+ + {616, nullptr, "GetButtonConfigRight"}, //18.0.0+ + {650, nullptr, "AddButtonPlayData"}, + {651, nullptr, "StartButtonPlayData"}, + {652, nullptr, "StopButtonPlayData"}, + {700, nullptr, "GetRailAttachEventCount"}, //21.0.0+ + {2000, nullptr, "DeactivateDigitizer"}, + {2001, nullptr, "SetDigitizerAutoPilotState"}, + {2002, nullptr, "UnsetDigitizerAutoPilotState"}, + {3000, nullptr, "ReloadFirmwareDebugSettings"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IHidDebugServer::~IHidDebugServer() = default; + +Result IHidDebugServer::DeactivateTouchScreen() { + LOG_INFO(Service_HID, "called"); + + if (!firmware_settings->IsDeviceManaged()) { + R_RETURN(GetResourceManager()->GetTouchScreen()->Deactivate()); + } + + R_SUCCEED(); +} + +Result IHidDebugServer::SetTouchScreenAutoPilotState( + InArray auto_pilot_buffer) { + AutoPilotState auto_pilot{}; + + auto_pilot.count = + static_cast((std::min)(auto_pilot_buffer.size(), auto_pilot.state.size())); + memcpy(auto_pilot.state.data(), auto_pilot_buffer.data(), + auto_pilot.count * sizeof(TouchState)); + + LOG_INFO(Service_HID, "called, auto_pilot_count={}", auto_pilot.count); + + R_RETURN(GetResourceManager()->GetTouchScreen()->SetTouchScreenAutoPilotState(auto_pilot)); +} + +Result IHidDebugServer::UnsetTouchScreenAutoPilotState() { + LOG_INFO(Service_HID, "called"); + R_RETURN(GetResourceManager()->GetTouchScreen()->UnsetTouchScreenAutoPilotState()); +} + +Result IHidDebugServer::GetTouchScreenConfiguration( + Out out_touchscreen_config, + ClientAppletResourceUserId aruid) { + LOG_INFO(Service_HID, "called, applet_resource_user_id={}", aruid.pid); + + R_TRY(GetResourceManager()->GetTouchScreen()->GetTouchScreenConfiguration( + *out_touchscreen_config, aruid.pid)); + + if (out_touchscreen_config->mode != Core::HID::TouchScreenModeForNx::Heat2 && + out_touchscreen_config->mode != Core::HID::TouchScreenModeForNx::Finger) { + out_touchscreen_config->mode = Core::HID::TouchScreenModeForNx::UseSystemSetting; + } + + R_SUCCEED(); +} + +Result IHidDebugServer::ProcessTouchScreenAutoTune() { + LOG_INFO(Service_HID, "called"); + R_RETURN(GetResourceManager()->GetTouchScreen()->ProcessTouchScreenAutoTune()); +} + +Result IHidDebugServer::ForceStopTouchScreenManagement() { + LOG_INFO(Service_HID, "called"); + + if (!firmware_settings->IsDeviceManaged()) { + R_SUCCEED(); + } + + auto touch_screen = GetResourceManager()->GetTouchScreen(); + auto gesture = GetResourceManager()->GetGesture(); + + if (firmware_settings->IsTouchI2cManaged()) { + bool is_touch_active{}; + bool is_gesture_active{}; + R_TRY(touch_screen->IsActive(is_touch_active)); + R_TRY(gesture->IsActive(is_gesture_active)); + + if (is_touch_active) { + R_TRY(touch_screen->Deactivate()); + } + if (is_gesture_active) { + R_TRY(gesture->Deactivate()); + } + } + + R_SUCCEED(); +} + +Result IHidDebugServer::ForceRestartTouchScreenManagement(u32 basic_gesture_id, + ClientAppletResourceUserId aruid) { + LOG_INFO(Service_HID, "called, basic_gesture_id={}, applet_resource_user_id={}", + basic_gesture_id, aruid.pid); + + auto touch_screen = GetResourceManager()->GetTouchScreen(); + auto gesture = GetResourceManager()->GetGesture(); + + if (firmware_settings->IsDeviceManaged() && firmware_settings->IsTouchI2cManaged()) { + R_TRY(gesture->Activate()); + R_TRY(gesture->Activate(aruid.pid, basic_gesture_id)); + R_TRY(touch_screen->Activate()); + R_TRY(touch_screen->Activate(aruid.pid)); + } + + R_SUCCEED(); +} + +Result IHidDebugServer::IsTouchScreenManaged(Out out_is_managed) { + LOG_INFO(Service_HID, "called"); + + bool is_touch_active{}; + bool is_gesture_active{}; + R_TRY(GetResourceManager()->GetTouchScreen()->IsActive(is_touch_active)); + R_TRY(GetResourceManager()->GetGesture()->IsActive(is_gesture_active)); + + *out_is_managed = is_touch_active || is_gesture_active; + R_SUCCEED(); +} + +Result IHidDebugServer::DeactivateGesture() { + LOG_INFO(Service_HID, "called"); + + if (!firmware_settings->IsDeviceManaged()) { + R_RETURN(GetResourceManager()->GetGesture()->Deactivate()); + } + + R_SUCCEED(); +} + +std::shared_ptr IHidDebugServer::GetResourceManager() { + resource_manager->Initialize(); + return resource_manager; +} + } // namespace Service::HID diff --git a/src/core/hle/service/hid/hid_debug_server.h b/src/core/hle/service/hid/hid_debug_server.h index 20cc1ed541..f48f0205ed 100644 --- a/src/core/hle/service/hid/hid_debug_server.h +++ b/src/core/hle/service/hid/hid_debug_server.h @@ -18,5 +18,31 @@ namespace Service::HID { class ResourceManager; class HidFirmwareSettings; +class IHidDebugServer final : public ServiceFramework { +public: + explicit IHidDebugServer(Core::System& system_, std::shared_ptr resource, + std::shared_ptr settings); + ~IHidDebugServer() override; + +private: + Result DeactivateTouchScreen(); + Result SetTouchScreenAutoPilotState( + InArray auto_pilot_buffer); + Result UnsetTouchScreenAutoPilotState(); + Result GetTouchScreenConfiguration( + Out out_touchscreen_config, + ClientAppletResourceUserId aruid); + Result ProcessTouchScreenAutoTune(); + Result ForceStopTouchScreenManagement(); + Result ForceRestartTouchScreenManagement(u32 basic_gesture_id, + ClientAppletResourceUserId aruid); + Result IsTouchScreenManaged(Out out_is_managed); + Result DeactivateGesture(); + + std::shared_ptr GetResourceManager(); + + std::shared_ptr resource_manager; + std::shared_ptr firmware_settings; +}; } // namespace Service::HID diff --git a/src/core/hle/service/hid/hid_server.cpp b/src/core/hle/service/hid/hid_server.cpp index 18e57628d0..9689bce8dd 100644 --- a/src/core/hle/service/hid/hid_server.cpp +++ b/src/core/hle/service/hid/hid_server.cpp @@ -42,207 +42,207 @@ namespace Service::HID { -std::optional IHidServer::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IHidServer::CreateAppletResource>, "CreateAppletResource"}, - FunctionInfo{1, C<&IHidServer::ActivateDebugPad>, "ActivateDebugPad"}, - FunctionInfo{11, C<&IHidServer::ActivateTouchScreen>, "ActivateTouchScreen"}, - FunctionInfo{21, C<&IHidServer::ActivateMouse>, "ActivateMouse"}, - FunctionInfo{26, C<&IHidServer::ActivateDebugMouse>, "ActivateDebugMouse"}, - FunctionInfo{31, C<&IHidServer::ActivateKeyboard>, "ActivateKeyboard"}, - FunctionInfo{32, C<&IHidServer::SendKeyboardLockKeyEvent>, "SendKeyboardLockKeyEvent"}, - FunctionInfo{40, C<&IHidServer::AcquireXpadIdEventHandle>, "AcquireXpadIdEventHandle"}, - FunctionInfo{41, C<&IHidServer::ReleaseXpadIdEventHandle>, "ReleaseXpadIdEventHandle"}, - FunctionInfo{51, C<&IHidServer::ActivateXpad>, "ActivateXpad"}, - FunctionInfo{55, C<&IHidServer::GetXpadIds>, "GetXpadIds"}, - FunctionInfo{56, C<&IHidServer::ActivateJoyXpad>, "ActivateJoyXpad"}, - FunctionInfo{58, C<&IHidServer::GetJoyXpadLifoHandle>, "GetJoyXpadLifoHandle"}, - FunctionInfo{59, C<&IHidServer::GetJoyXpadIds>, "GetJoyXpadIds"}, - FunctionInfo{60, C<&IHidServer::ActivateSixAxisSensor>, "ActivateSixAxisSensor"}, - FunctionInfo{61, C<&IHidServer::DeactivateSixAxisSensor>, "DeactivateSixAxisSensor"}, - FunctionInfo{62, C<&IHidServer::GetSixAxisSensorLifoHandle>, "GetSixAxisSensorLifoHandle"}, - FunctionInfo{63, C<&IHidServer::ActivateJoySixAxisSensor>, "ActivateJoySixAxisSensor"}, - FunctionInfo{64, C<&IHidServer::DeactivateJoySixAxisSensor>, "DeactivateJoySixAxisSensor"}, - FunctionInfo{65, C<&IHidServer::GetJoySixAxisSensorLifoHandle>, "GetJoySixAxisSensorLifoHandle"}, - FunctionInfo{66, C<&IHidServer::StartSixAxisSensor>, "StartSixAxisSensor"}, - FunctionInfo{67, C<&IHidServer::StopSixAxisSensor>, "StopSixAxisSensor"}, - FunctionInfo{68, C<&IHidServer::IsSixAxisSensorFusionEnabled>, "IsSixAxisSensorFusionEnabled"}, - FunctionInfo{69, C<&IHidServer::EnableSixAxisSensorFusion>, "EnableSixAxisSensorFusion"}, - FunctionInfo{70, C<&IHidServer::SetSixAxisSensorFusionParameters>, "SetSixAxisSensorFusionParameters"}, - FunctionInfo{71, C<&IHidServer::GetSixAxisSensorFusionParameters>, "GetSixAxisSensorFusionParameters"}, - FunctionInfo{72, C<&IHidServer::ResetSixAxisSensorFusionParameters>, "ResetSixAxisSensorFusionParameters"}, - FunctionInfo{73, nullptr, "SetAccelerometerParameters"}, - FunctionInfo{74, nullptr, "GetAccelerometerParameters"}, - FunctionInfo{75, nullptr, "ResetAccelerometerParameters"}, - FunctionInfo{76, nullptr, "SetAccelerometerPlayMode"}, - FunctionInfo{77, nullptr, "GetAccelerometerPlayMode"}, - FunctionInfo{78, nullptr, "ResetAccelerometerPlayMode"}, - FunctionInfo{79, C<&IHidServer::SetGyroscopeZeroDriftMode>, "SetGyroscopeZeroDriftMode"}, - FunctionInfo{80, C<&IHidServer::GetGyroscopeZeroDriftMode>, "GetGyroscopeZeroDriftMode"}, - FunctionInfo{81, C<&IHidServer::ResetGyroscopeZeroDriftMode>, "ResetGyroscopeZeroDriftMode"}, - FunctionInfo{82, C<&IHidServer::IsSixAxisSensorAtRest>, "IsSixAxisSensorAtRest"}, - FunctionInfo{83, C<&IHidServer::IsFirmwareUpdateAvailableForSixAxisSensor>, "IsFirmwareUpdateAvailableForSixAxisSensor"}, - FunctionInfo{84, C<&IHidServer::EnableSixAxisSensorUnalteredPassthrough>, "EnableSixAxisSensorUnalteredPassthrough"}, - FunctionInfo{85, C<&IHidServer::IsSixAxisSensorUnalteredPassthroughEnabled>, "IsSixAxisSensorUnalteredPassthroughEnabled"}, - FunctionInfo{86, nullptr, "StoreSixAxisSensorCalibrationParameter"}, - FunctionInfo{87, C<&IHidServer::LoadSixAxisSensorCalibrationParameter>, "LoadSixAxisSensorCalibrationParameter"}, - FunctionInfo{88, C<&IHidServer::GetSixAxisSensorIcInformation>, "GetSixAxisSensorIcInformation"}, - FunctionInfo{89, C<&IHidServer::ResetIsSixAxisSensorDeviceNewlyAssigned>, "ResetIsSixAxisSensorDeviceNewlyAssigned"}, - FunctionInfo{91, C<&IHidServer::ActivateGesture>, "ActivateGesture"}, - FunctionInfo{92, C<&IHidServer::SetGestureOutputRanges>, "SetGestureOutputRanges"}, - FunctionInfo{100, C<&IHidServer::SetSupportedNpadStyleSet>, "SetSupportedNpadStyleSet"}, - FunctionInfo{101, C<&IHidServer::GetSupportedNpadStyleSet>, "GetSupportedNpadStyleSet"}, - FunctionInfo{102, C<&IHidServer::SetSupportedNpadIdType>, "SetSupportedNpadIdType"}, - FunctionInfo{103, C<&IHidServer::ActivateNpad>, "ActivateNpad"}, - FunctionInfo{104, C<&IHidServer::DeactivateNpad>, "DeactivateNpad"}, - FunctionInfo{106, C<&IHidServer::AcquireNpadStyleSetUpdateEventHandle>, "AcquireNpadStyleSetUpdateEventHandle"}, - FunctionInfo{107, C<&IHidServer::DisconnectNpad>, "DisconnectNpad"}, - FunctionInfo{108, C<&IHidServer::GetPlayerLedPattern>, "GetPlayerLedPattern"}, - FunctionInfo{109, C<&IHidServer::ActivateNpadWithRevision>, "ActivateNpadWithRevision"}, - FunctionInfo{120, C<&IHidServer::SetNpadJoyHoldType>, "SetNpadJoyHoldType"}, - FunctionInfo{121, C<&IHidServer::GetNpadJoyHoldType>, "GetNpadJoyHoldType"}, - FunctionInfo{122, C<&IHidServer::SetNpadJoyAssignmentModeSingleByDefault>, "SetNpadJoyAssignmentModeSingleByDefault"}, - FunctionInfo{123, C<&IHidServer::SetNpadJoyAssignmentModeSingle>, "SetNpadJoyAssignmentModeSingle"}, - FunctionInfo{124, C<&IHidServer::SetNpadJoyAssignmentModeDual>, "SetNpadJoyAssignmentModeDual"}, - FunctionInfo{125, C<&IHidServer::MergeSingleJoyAsDualJoy>, "MergeSingleJoyAsDualJoy"}, - FunctionInfo{126, C<&IHidServer::StartLrAssignmentMode>, "StartLrAssignmentMode"}, - FunctionInfo{127, C<&IHidServer::StopLrAssignmentMode>, "StopLrAssignmentMode"}, - FunctionInfo{128, C<&IHidServer::SetNpadHandheldActivationMode>, "SetNpadHandheldActivationMode"}, - FunctionInfo{129, C<&IHidServer::GetNpadHandheldActivationMode>, "GetNpadHandheldActivationMode"}, - FunctionInfo{130, C<&IHidServer::SwapNpadAssignment>, "SwapNpadAssignment"}, - FunctionInfo{131, C<&IHidServer::IsUnintendedHomeButtonInputProtectionEnabled>, "IsUnintendedHomeButtonInputProtectionEnabled"}, - FunctionInfo{132, C<&IHidServer::EnableUnintendedHomeButtonInputProtection>, "EnableUnintendedHomeButtonInputProtection"}, - FunctionInfo{133, C<&IHidServer::SetNpadJoyAssignmentModeSingleWithDestination>, "SetNpadJoyAssignmentModeSingleWithDestination"}, - FunctionInfo{134, C<&IHidServer::SetNpadAnalogStickUseCenterClamp>, "SetNpadAnalogStickUseCenterClamp"}, - FunctionInfo{135, C<&IHidServer::SetNpadCaptureButtonAssignment>, "SetNpadCaptureButtonAssignment"}, - FunctionInfo{136, C<&IHidServer::ClearNpadCaptureButtonAssignment>, "ClearNpadCaptureButtonAssignment"}, - FunctionInfo{200, C<&IHidServer::GetVibrationDeviceInfo>, "GetVibrationDeviceInfo"}, - FunctionInfo{201, C<&IHidServer::SendVibrationValue>, "SendVibrationValue"}, - FunctionInfo{202, C<&IHidServer::GetActualVibrationValue>, "GetActualVibrationValue"}, - FunctionInfo{203, C<&IHidServer::CreateActiveVibrationDeviceList>, "CreateActiveVibrationDeviceList"}, - FunctionInfo{204, C<&IHidServer::PermitVibration>, "PermitVibration"}, - FunctionInfo{205, C<&IHidServer::IsVibrationPermitted>, "IsVibrationPermitted"}, - FunctionInfo{206, C<&IHidServer::SendVibrationValues>, "SendVibrationValues"}, - FunctionInfo{207, C<&IHidServer::SendVibrationGcErmCommand>, "SendVibrationGcErmCommand"}, - FunctionInfo{208, C<&IHidServer::GetActualVibrationGcErmCommand>, "GetActualVibrationGcErmCommand"}, - FunctionInfo{209, C<&IHidServer::BeginPermitVibrationSession>, "BeginPermitVibrationSession"}, - FunctionInfo{210, C<&IHidServer::EndPermitVibrationSession>, "EndPermitVibrationSession"}, - FunctionInfo{211, C<&IHidServer::IsVibrationDeviceMounted>, "IsVibrationDeviceMounted"}, - FunctionInfo{212, C<&IHidServer::SendVibrationValueInBool>, "SendVibrationValueInBool"}, - FunctionInfo{300, C<&IHidServer::ActivateConsoleSixAxisSensor>, "ActivateConsoleSixAxisSensor"}, - FunctionInfo{301, C<&IHidServer::StartConsoleSixAxisSensor>, "StartConsoleSixAxisSensor"}, - FunctionInfo{302, C<&IHidServer::StopConsoleSixAxisSensor>, "StopConsoleSixAxisSensor"}, - FunctionInfo{303, C<&IHidServer::ActivateSevenSixAxisSensor>, "ActivateSevenSixAxisSensor"}, - FunctionInfo{304, C<&IHidServer::StartSevenSixAxisSensor>, "StartSevenSixAxisSensor"}, - FunctionInfo{305, C<&IHidServer::StopSevenSixAxisSensor>, "StopSevenSixAxisSensor"}, - FunctionInfo{306, C<&IHidServer::InitializeSevenSixAxisSensor>, "InitializeSevenSixAxisSensor"}, - FunctionInfo{307, C<&IHidServer::FinalizeSevenSixAxisSensor>, "FinalizeSevenSixAxisSensor"}, - FunctionInfo{308, nullptr, "SetSevenSixAxisSensorFusionStrength"}, - FunctionInfo{309, nullptr, "GetSevenSixAxisSensorFusionStrength"}, - FunctionInfo{310, C<&IHidServer::ResetSevenSixAxisSensorTimestamp>, "ResetSevenSixAxisSensorTimestamp"}, - FunctionInfo{320, nullptr, "EnableNpadImu", MakeVersionGate({21,0,0})}, - FunctionInfo{321, nullptr, "DisableNpadImu", MakeVersionGate({21,0,0})}, - FunctionInfo{400, C<&IHidServer::IsUsbFullKeyControllerEnabled>, "IsUsbFullKeyControllerEnabled"}, - FunctionInfo{401, nullptr, "EnableUsbFullKeyController"}, - FunctionInfo{402, nullptr, "IsUsbFullKeyControllerConnected"}, - FunctionInfo{403, nullptr, "HasBattery"}, - FunctionInfo{404, nullptr, "HasLeftRightBattery"}, - FunctionInfo{405, nullptr, "GetNpadInterfaceType"}, - FunctionInfo{406, nullptr, "GetNpadLeftRightInterfaceType"}, - FunctionInfo{407, nullptr, "GetNpadOfHighestBatteryLevel"}, - FunctionInfo{408, nullptr, "GetNpadOfHighestBatteryLevelForJoyRight"}, - FunctionInfo{500, C<&IHidServer::GetPalmaConnectionHandle>, "GetPalmaConnectionHandle"}, - FunctionInfo{501, C<&IHidServer::InitializePalma>, "InitializePalma"}, - FunctionInfo{502, C<&IHidServer::AcquirePalmaOperationCompleteEvent>, "AcquirePalmaOperationCompleteEvent"}, - FunctionInfo{503, C<&IHidServer::GetPalmaOperationInfo>, "GetPalmaOperationInfo"}, - FunctionInfo{504, C<&IHidServer::PlayPalmaActivity>, "PlayPalmaActivity"}, - FunctionInfo{505, C<&IHidServer::SetPalmaFrModeType>, "SetPalmaFrModeType"}, - FunctionInfo{506, C<&IHidServer::ReadPalmaStep>, "ReadPalmaStep"}, - FunctionInfo{507, C<&IHidServer::EnablePalmaStep>, "EnablePalmaStep"}, - FunctionInfo{508, C<&IHidServer::ResetPalmaStep>, "ResetPalmaStep"}, - FunctionInfo{509, C<&IHidServer::ReadPalmaApplicationSection>, "ReadPalmaApplicationSection"}, - FunctionInfo{510, C<&IHidServer::WritePalmaApplicationSection>, "WritePalmaApplicationSection"}, - FunctionInfo{511, C<&IHidServer::ReadPalmaUniqueCode>, "ReadPalmaUniqueCode"}, - FunctionInfo{512, C<&IHidServer::SetPalmaUniqueCodeInvalid>, "SetPalmaUniqueCodeInvalid"}, - FunctionInfo{513, C<&IHidServer::WritePalmaActivityEntry>, "WritePalmaActivityEntry"}, - FunctionInfo{514, C<&IHidServer::WritePalmaRgbLedPatternEntry>, "WritePalmaRgbLedPatternEntry"}, - FunctionInfo{515, C<&IHidServer::WritePalmaWaveEntry>, "WritePalmaWaveEntry"}, - FunctionInfo{516, C<&IHidServer::SetPalmaDataBaseIdentificationVersion>, "SetPalmaDataBaseIdentificationVersion"}, - FunctionInfo{517, C<&IHidServer::GetPalmaDataBaseIdentificationVersion>, "GetPalmaDataBaseIdentificationVersion"}, - FunctionInfo{518, C<&IHidServer::SuspendPalmaFeature>, "SuspendPalmaFeature"}, - FunctionInfo{519, C<&IHidServer::GetPalmaOperationResult>, "GetPalmaOperationResult"}, - FunctionInfo{520, C<&IHidServer::ReadPalmaPlayLog>, "ReadPalmaPlayLog"}, - FunctionInfo{521, C<&IHidServer::ResetPalmaPlayLog>, "ResetPalmaPlayLog"}, - FunctionInfo{522, C<&IHidServer::SetIsPalmaAllConnectable>, "SetIsPalmaAllConnectable"}, - FunctionInfo{523, C<&IHidServer::SetIsPalmaPairedConnectable>, "SetIsPalmaPairedConnectable"}, - FunctionInfo{524, C<&IHidServer::PairPalma>, "PairPalma"}, - FunctionInfo{525, C<&IHidServer::SetPalmaBoostMode>, "SetPalmaBoostMode"}, - FunctionInfo{526, C<&IHidServer::CancelWritePalmaWaveEntry>, "CancelWritePalmaWaveEntry"}, - FunctionInfo{527, C<&IHidServer::EnablePalmaBoostMode>, "EnablePalmaBoostMode"}, - FunctionInfo{528, C<&IHidServer::GetPalmaBluetoothAddress>, "GetPalmaBluetoothAddress"}, - FunctionInfo{529, C<&IHidServer::SetDisallowedPalmaConnection>, "SetDisallowedPalmaConnection"}, - FunctionInfo{1000, C<&IHidServer::SetNpadCommunicationMode>, "SetNpadCommunicationMode"}, - FunctionInfo{1001, C<&IHidServer::GetNpadCommunicationMode>, "GetNpadCommunicationMode"}, - FunctionInfo{1002, C<&IHidServer::SetTouchScreenConfiguration>, "SetTouchScreenConfiguration"}, - FunctionInfo{1003, C<&IHidServer::IsFirmwareUpdateNeededForNotification>, "IsFirmwareUpdateNeededForNotification"}, - FunctionInfo{1004, C<&IHidServer::SetTouchScreenResolution>, "SetTouchScreenResolution"}, - FunctionInfo{1270, nullptr, "DeleteButtonConfigStorageRight"}, - FunctionInfo{1271, nullptr, "IsUsingCustomButtonConfig"}, - FunctionInfo{1272, nullptr, "IsAnyCustomButtonConfigEnabled"}, - FunctionInfo{1273, nullptr, "SetAllCustomButtonConfigEnabled"}, - FunctionInfo{1274, nullptr, "SetDefaultButtonConfig"}, - FunctionInfo{1275, nullptr, "SetAllDefaultButtonConfig"}, - FunctionInfo{1276, nullptr, "SetHidButtonConfigEmbedded"}, - FunctionInfo{1277, nullptr, "SetHidButtonConfigFull"}, - FunctionInfo{1278, nullptr, "SetHidButtonConfigLeft"}, - FunctionInfo{1279, nullptr, "SetHidButtonConfigRight"}, - FunctionInfo{1280, nullptr, "GetHidButtonConfigEmbedded"}, - FunctionInfo{1281, nullptr, "GetHidButtonConfigFull"}, - FunctionInfo{1282, nullptr, "GetHidButtonConfigLeft"}, - FunctionInfo{1283, nullptr, "GetHidButtonConfigRight"}, - FunctionInfo{1284, nullptr, "GetButtonConfigStorageEmbedded"}, - FunctionInfo{1285, nullptr, "GetButtonConfigStorageFull"}, - FunctionInfo{1286, nullptr, "GetButtonConfigStorageLeft"}, - FunctionInfo{1287, nullptr, "GetButtonConfigStorageRight"}, - FunctionInfo{1288, nullptr, "SetButtonConfigStorageEmbedded"}, - FunctionInfo{1289, nullptr, "SetButtonConfigStorageFull"}, - FunctionInfo{1290, nullptr, "SetButtonConfigStorageLeft"}, - FunctionInfo{1291, nullptr, "SetButtonConfigStorageRight"}, - FunctionInfo{1308, nullptr, "SetButtonConfigVisible"}, - FunctionInfo{1309, nullptr, "IsButtonConfigVisible"}, - FunctionInfo{1320, nullptr, "WakeTouchScreenUp"}, - FunctionInfo{1321, nullptr, "PutTouchScreenToSleep"}, - FunctionInfo{1322, nullptr, "AcquireTouchScreenAsyncWakeCompletedEvent"}, - FunctionInfo{1323, nullptr, "StartTouchScreenAutoTuneForSystemSettings"}, - FunctionInfo{1324, nullptr, "AcquireTouchScreenAutoTuneCompletedEvent"}, - FunctionInfo{1325, nullptr, "IsTouchScreenAutoTuneRequiredForRepairProviderReplacement"}, - FunctionInfo{1420, nullptr, "GetAppletResourceProperty"}, - FunctionInfo{2000, nullptr, "ActivateDigitizer"}, - FunctionInfo{3000, nullptr, "GetDebugPadGenericPadMap"}, - FunctionInfo{3001, nullptr, "SetDebugPadGenericPadMap"}, - FunctionInfo{3002, nullptr, "ResetDebugPadGenericPadMap"}, - FunctionInfo{3003, nullptr, "GetDebugPadKeyboardMap"}, - FunctionInfo{3004, nullptr, "SetDebugPadKeyboardMap"}, - FunctionInfo{3005, nullptr, "ResetDebugPadKeyboardMap"}, - FunctionInfo{3006, nullptr, "GetFullKeyGenericPadMap"}, - FunctionInfo{3007, nullptr, "SetFullKeyGenericPadMap"}, - FunctionInfo{3008, nullptr, "ResetFullKeyGenericPadMap"}, - FunctionInfo{3009, nullptr, "GetFullKeyKeyboardMap"}, - FunctionInfo{3010, nullptr, "SetFullKeyKeyboardMap"}, - FunctionInfo{3011, nullptr, "ResetFullKeyKeyboardMap"}, - FunctionInfo{3012, nullptr, "GetDebugPadGenericPadMap", MakeVersionGate({21,0,0})}, - FunctionInfo{3013, nullptr, "SetDebugPadGenericPadMap", MakeVersionGate({21,0,0})}, - FunctionInfo{3014, nullptr, "GetDebugPadKeyboardMap", MakeVersionGate({21,0,0})}, - FunctionInfo{3015, nullptr, "SetDebugPadKeyboardMap", MakeVersionGate({21,0,0})}, - FunctionInfo{3150, C<&IHidServer::SetMouseLibraryVersion>, "SetMouseLibraryVersion", MakeVersionGate({21,0,0})} - // What? -- {12010, nullptr, "SetButtonConfigLeft"}, - ); - return HandlerTableGenerateWithFind(key, functions); -} - IHidServer::IHidServer(Core::System& system_, std::shared_ptr resource, std::shared_ptr settings) : ServiceFramework{system_, "hid"}, resource_manager{resource}, firmware_settings{settings} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&IHidServer::CreateAppletResource>, "CreateAppletResource"}, + {1, C<&IHidServer::ActivateDebugPad>, "ActivateDebugPad"}, + {11, C<&IHidServer::ActivateTouchScreen>, "ActivateTouchScreen"}, + {21, C<&IHidServer::ActivateMouse>, "ActivateMouse"}, + {26, C<&IHidServer::ActivateDebugMouse>, "ActivateDebugMouse"}, + {31, C<&IHidServer::ActivateKeyboard>, "ActivateKeyboard"}, + {32, C<&IHidServer::SendKeyboardLockKeyEvent>, "SendKeyboardLockKeyEvent"}, + {40, C<&IHidServer::AcquireXpadIdEventHandle>, "AcquireXpadIdEventHandle"}, + {41, C<&IHidServer::ReleaseXpadIdEventHandle>, "ReleaseXpadIdEventHandle"}, + {51, C<&IHidServer::ActivateXpad>, "ActivateXpad"}, + {55, C<&IHidServer::GetXpadIds>, "GetXpadIds"}, + {56, C<&IHidServer::ActivateJoyXpad>, "ActivateJoyXpad"}, + {58, C<&IHidServer::GetJoyXpadLifoHandle>, "GetJoyXpadLifoHandle"}, + {59, C<&IHidServer::GetJoyXpadIds>, "GetJoyXpadIds"}, + {60, C<&IHidServer::ActivateSixAxisSensor>, "ActivateSixAxisSensor"}, + {61, C<&IHidServer::DeactivateSixAxisSensor>, "DeactivateSixAxisSensor"}, + {62, C<&IHidServer::GetSixAxisSensorLifoHandle>, "GetSixAxisSensorLifoHandle"}, + {63, C<&IHidServer::ActivateJoySixAxisSensor>, "ActivateJoySixAxisSensor"}, + {64, C<&IHidServer::DeactivateJoySixAxisSensor>, "DeactivateJoySixAxisSensor"}, + {65, C<&IHidServer::GetJoySixAxisSensorLifoHandle>, "GetJoySixAxisSensorLifoHandle"}, + {66, C<&IHidServer::StartSixAxisSensor>, "StartSixAxisSensor"}, + {67, C<&IHidServer::StopSixAxisSensor>, "StopSixAxisSensor"}, + {68, C<&IHidServer::IsSixAxisSensorFusionEnabled>, "IsSixAxisSensorFusionEnabled"}, + {69, C<&IHidServer::EnableSixAxisSensorFusion>, "EnableSixAxisSensorFusion"}, + {70, C<&IHidServer::SetSixAxisSensorFusionParameters>, "SetSixAxisSensorFusionParameters"}, + {71, C<&IHidServer::GetSixAxisSensorFusionParameters>, "GetSixAxisSensorFusionParameters"}, + {72, C<&IHidServer::ResetSixAxisSensorFusionParameters>, "ResetSixAxisSensorFusionParameters"}, + {73, nullptr, "SetAccelerometerParameters"}, + {74, nullptr, "GetAccelerometerParameters"}, + {75, nullptr, "ResetAccelerometerParameters"}, + {76, nullptr, "SetAccelerometerPlayMode"}, + {77, nullptr, "GetAccelerometerPlayMode"}, + {78, nullptr, "ResetAccelerometerPlayMode"}, + {79, C<&IHidServer::SetGyroscopeZeroDriftMode>, "SetGyroscopeZeroDriftMode"}, + {80, C<&IHidServer::GetGyroscopeZeroDriftMode>, "GetGyroscopeZeroDriftMode"}, + {81, C<&IHidServer::ResetGyroscopeZeroDriftMode>, "ResetGyroscopeZeroDriftMode"}, + {82, C<&IHidServer::IsSixAxisSensorAtRest>, "IsSixAxisSensorAtRest"}, + {83, C<&IHidServer::IsFirmwareUpdateAvailableForSixAxisSensor>, "IsFirmwareUpdateAvailableForSixAxisSensor"}, + {84, C<&IHidServer::EnableSixAxisSensorUnalteredPassthrough>, "EnableSixAxisSensorUnalteredPassthrough"}, + {85, C<&IHidServer::IsSixAxisSensorUnalteredPassthroughEnabled>, "IsSixAxisSensorUnalteredPassthroughEnabled"}, + {86, nullptr, "StoreSixAxisSensorCalibrationParameter"}, + {87, C<&IHidServer::LoadSixAxisSensorCalibrationParameter>, "LoadSixAxisSensorCalibrationParameter"}, + {88, C<&IHidServer::GetSixAxisSensorIcInformation>, "GetSixAxisSensorIcInformation"}, + {89, C<&IHidServer::ResetIsSixAxisSensorDeviceNewlyAssigned>, "ResetIsSixAxisSensorDeviceNewlyAssigned"}, + {91, C<&IHidServer::ActivateGesture>, "ActivateGesture"}, + {92, C<&IHidServer::SetGestureOutputRanges>, "SetGestureOutputRanges"}, + {100, C<&IHidServer::SetSupportedNpadStyleSet>, "SetSupportedNpadStyleSet"}, + {101, C<&IHidServer::GetSupportedNpadStyleSet>, "GetSupportedNpadStyleSet"}, + {102, C<&IHidServer::SetSupportedNpadIdType>, "SetSupportedNpadIdType"}, + {103, C<&IHidServer::ActivateNpad>, "ActivateNpad"}, + {104, C<&IHidServer::DeactivateNpad>, "DeactivateNpad"}, + {106, C<&IHidServer::AcquireNpadStyleSetUpdateEventHandle>, "AcquireNpadStyleSetUpdateEventHandle"}, + {107, C<&IHidServer::DisconnectNpad>, "DisconnectNpad"}, + {108, C<&IHidServer::GetPlayerLedPattern>, "GetPlayerLedPattern"}, + {109, C<&IHidServer::ActivateNpadWithRevision>, "ActivateNpadWithRevision"}, + {120, C<&IHidServer::SetNpadJoyHoldType>, "SetNpadJoyHoldType"}, + {121, C<&IHidServer::GetNpadJoyHoldType>, "GetNpadJoyHoldType"}, + {122, C<&IHidServer::SetNpadJoyAssignmentModeSingleByDefault>, "SetNpadJoyAssignmentModeSingleByDefault"}, + {123, C<&IHidServer::SetNpadJoyAssignmentModeSingle>, "SetNpadJoyAssignmentModeSingle"}, + {124, C<&IHidServer::SetNpadJoyAssignmentModeDual>, "SetNpadJoyAssignmentModeDual"}, + {125, C<&IHidServer::MergeSingleJoyAsDualJoy>, "MergeSingleJoyAsDualJoy"}, + {126, C<&IHidServer::StartLrAssignmentMode>, "StartLrAssignmentMode"}, + {127, C<&IHidServer::StopLrAssignmentMode>, "StopLrAssignmentMode"}, + {128, C<&IHidServer::SetNpadHandheldActivationMode>, "SetNpadHandheldActivationMode"}, + {129, C<&IHidServer::GetNpadHandheldActivationMode>, "GetNpadHandheldActivationMode"}, + {130, C<&IHidServer::SwapNpadAssignment>, "SwapNpadAssignment"}, + {131, C<&IHidServer::IsUnintendedHomeButtonInputProtectionEnabled>, "IsUnintendedHomeButtonInputProtectionEnabled"}, + {132, C<&IHidServer::EnableUnintendedHomeButtonInputProtection>, "EnableUnintendedHomeButtonInputProtection"}, + {133, C<&IHidServer::SetNpadJoyAssignmentModeSingleWithDestination>, "SetNpadJoyAssignmentModeSingleWithDestination"}, + {134, C<&IHidServer::SetNpadAnalogStickUseCenterClamp>, "SetNpadAnalogStickUseCenterClamp"}, + {135, C<&IHidServer::SetNpadCaptureButtonAssignment>, "SetNpadCaptureButtonAssignment"}, + {136, C<&IHidServer::ClearNpadCaptureButtonAssignment>, "ClearNpadCaptureButtonAssignment"}, + {200, C<&IHidServer::GetVibrationDeviceInfo>, "GetVibrationDeviceInfo"}, + {201, C<&IHidServer::SendVibrationValue>, "SendVibrationValue"}, + {202, C<&IHidServer::GetActualVibrationValue>, "GetActualVibrationValue"}, + {203, C<&IHidServer::CreateActiveVibrationDeviceList>, "CreateActiveVibrationDeviceList"}, + {204, C<&IHidServer::PermitVibration>, "PermitVibration"}, + {205, C<&IHidServer::IsVibrationPermitted>, "IsVibrationPermitted"}, + {206, C<&IHidServer::SendVibrationValues>, "SendVibrationValues"}, + {207, C<&IHidServer::SendVibrationGcErmCommand>, "SendVibrationGcErmCommand"}, + {208, C<&IHidServer::GetActualVibrationGcErmCommand>, "GetActualVibrationGcErmCommand"}, + {209, C<&IHidServer::BeginPermitVibrationSession>, "BeginPermitVibrationSession"}, + {210, C<&IHidServer::EndPermitVibrationSession>, "EndPermitVibrationSession"}, + {211, C<&IHidServer::IsVibrationDeviceMounted>, "IsVibrationDeviceMounted"}, + {212, C<&IHidServer::SendVibrationValueInBool>, "SendVibrationValueInBool"}, + {300, C<&IHidServer::ActivateConsoleSixAxisSensor>, "ActivateConsoleSixAxisSensor"}, + {301, C<&IHidServer::StartConsoleSixAxisSensor>, "StartConsoleSixAxisSensor"}, + {302, C<&IHidServer::StopConsoleSixAxisSensor>, "StopConsoleSixAxisSensor"}, + {303, C<&IHidServer::ActivateSevenSixAxisSensor>, "ActivateSevenSixAxisSensor"}, + {304, C<&IHidServer::StartSevenSixAxisSensor>, "StartSevenSixAxisSensor"}, + {305, C<&IHidServer::StopSevenSixAxisSensor>, "StopSevenSixAxisSensor"}, + {306, C<&IHidServer::InitializeSevenSixAxisSensor>, "InitializeSevenSixAxisSensor"}, + {307, C<&IHidServer::FinalizeSevenSixAxisSensor>, "FinalizeSevenSixAxisSensor"}, + {308, nullptr, "SetSevenSixAxisSensorFusionStrength"}, + {309, nullptr, "GetSevenSixAxisSensorFusionStrength"}, + {310, C<&IHidServer::ResetSevenSixAxisSensorTimestamp>, "ResetSevenSixAxisSensorTimestamp"}, + {320, nullptr, "EnableNpadImu"}, //21.0.0+ + {321, nullptr, "DisableNpadImu"}, //21.0.0+ + {400, C<&IHidServer::IsUsbFullKeyControllerEnabled>, "IsUsbFullKeyControllerEnabled"}, + {401, nullptr, "EnableUsbFullKeyController"}, + {402, nullptr, "IsUsbFullKeyControllerConnected"}, + {403, nullptr, "HasBattery"}, + {404, nullptr, "HasLeftRightBattery"}, + {405, nullptr, "GetNpadInterfaceType"}, + {406, nullptr, "GetNpadLeftRightInterfaceType"}, + {407, nullptr, "GetNpadOfHighestBatteryLevel"}, + {408, nullptr, "GetNpadOfHighestBatteryLevelForJoyRight"}, + {500, C<&IHidServer::GetPalmaConnectionHandle>, "GetPalmaConnectionHandle"}, + {501, C<&IHidServer::InitializePalma>, "InitializePalma"}, + {502, C<&IHidServer::AcquirePalmaOperationCompleteEvent>, "AcquirePalmaOperationCompleteEvent"}, + {503, C<&IHidServer::GetPalmaOperationInfo>, "GetPalmaOperationInfo"}, + {504, C<&IHidServer::PlayPalmaActivity>, "PlayPalmaActivity"}, + {505, C<&IHidServer::SetPalmaFrModeType>, "SetPalmaFrModeType"}, + {506, C<&IHidServer::ReadPalmaStep>, "ReadPalmaStep"}, + {507, C<&IHidServer::EnablePalmaStep>, "EnablePalmaStep"}, + {508, C<&IHidServer::ResetPalmaStep>, "ResetPalmaStep"}, + {509, C<&IHidServer::ReadPalmaApplicationSection>, "ReadPalmaApplicationSection"}, + {510, C<&IHidServer::WritePalmaApplicationSection>, "WritePalmaApplicationSection"}, + {511, C<&IHidServer::ReadPalmaUniqueCode>, "ReadPalmaUniqueCode"}, + {512, C<&IHidServer::SetPalmaUniqueCodeInvalid>, "SetPalmaUniqueCodeInvalid"}, + {513, C<&IHidServer::WritePalmaActivityEntry>, "WritePalmaActivityEntry"}, + {514, C<&IHidServer::WritePalmaRgbLedPatternEntry>, "WritePalmaRgbLedPatternEntry"}, + {515, C<&IHidServer::WritePalmaWaveEntry>, "WritePalmaWaveEntry"}, + {516, C<&IHidServer::SetPalmaDataBaseIdentificationVersion>, "SetPalmaDataBaseIdentificationVersion"}, + {517, C<&IHidServer::GetPalmaDataBaseIdentificationVersion>, "GetPalmaDataBaseIdentificationVersion"}, + {518, C<&IHidServer::SuspendPalmaFeature>, "SuspendPalmaFeature"}, + {519, C<&IHidServer::GetPalmaOperationResult>, "GetPalmaOperationResult"}, + {520, C<&IHidServer::ReadPalmaPlayLog>, "ReadPalmaPlayLog"}, + {521, C<&IHidServer::ResetPalmaPlayLog>, "ResetPalmaPlayLog"}, + {522, C<&IHidServer::SetIsPalmaAllConnectable>, "SetIsPalmaAllConnectable"}, + {523, C<&IHidServer::SetIsPalmaPairedConnectable>, "SetIsPalmaPairedConnectable"}, + {524, C<&IHidServer::PairPalma>, "PairPalma"}, + {525, C<&IHidServer::SetPalmaBoostMode>, "SetPalmaBoostMode"}, + {526, C<&IHidServer::CancelWritePalmaWaveEntry>, "CancelWritePalmaWaveEntry"}, + {527, C<&IHidServer::EnablePalmaBoostMode>, "EnablePalmaBoostMode"}, + {528, C<&IHidServer::GetPalmaBluetoothAddress>, "GetPalmaBluetoothAddress"}, + {529, C<&IHidServer::SetDisallowedPalmaConnection>, "SetDisallowedPalmaConnection"}, + {1000, C<&IHidServer::SetNpadCommunicationMode>, "SetNpadCommunicationMode"}, + {1001, C<&IHidServer::GetNpadCommunicationMode>, "GetNpadCommunicationMode"}, + {1002, C<&IHidServer::SetTouchScreenConfiguration>, "SetTouchScreenConfiguration"}, + {1003, C<&IHidServer::IsFirmwareUpdateNeededForNotification>, "IsFirmwareUpdateNeededForNotification"}, + {1004, C<&IHidServer::SetTouchScreenResolution>, "SetTouchScreenResolution"}, + {1270, nullptr, "DeleteButtonConfigStorageRight"}, + {1271, nullptr, "IsUsingCustomButtonConfig"}, + {1272, nullptr, "IsAnyCustomButtonConfigEnabled"}, + {1273, nullptr, "SetAllCustomButtonConfigEnabled"}, + {1274, nullptr, "SetDefaultButtonConfig"}, + {1275, nullptr, "SetAllDefaultButtonConfig"}, + {1276, nullptr, "SetHidButtonConfigEmbedded"}, + {1277, nullptr, "SetHidButtonConfigFull"}, + {1278, nullptr, "SetHidButtonConfigLeft"}, + {1279, nullptr, "SetHidButtonConfigRight"}, + {1280, nullptr, "GetHidButtonConfigEmbedded"}, + {1281, nullptr, "GetHidButtonConfigFull"}, + {1282, nullptr, "GetHidButtonConfigLeft"}, + {1283, nullptr, "GetHidButtonConfigRight"}, + {1284, nullptr, "GetButtonConfigStorageEmbedded"}, + {1285, nullptr, "GetButtonConfigStorageFull"}, + {1286, nullptr, "GetButtonConfigStorageLeft"}, + {1287, nullptr, "GetButtonConfigStorageRight"}, + {1288, nullptr, "SetButtonConfigStorageEmbedded"}, + {1289, nullptr, "SetButtonConfigStorageFull"}, + {1290, nullptr, "SetButtonConfigStorageLeft"}, + {1291, nullptr, "SetButtonConfigStorageRight"}, + {1308, nullptr, "SetButtonConfigVisible"}, + {1309, nullptr, "IsButtonConfigVisible"}, + {1320, nullptr, "WakeTouchScreenUp"}, + {1321, nullptr, "PutTouchScreenToSleep"}, + {1322, nullptr, "AcquireTouchScreenAsyncWakeCompletedEvent"}, + {1323, nullptr, "StartTouchScreenAutoTuneForSystemSettings"}, + {1324, nullptr, "AcquireTouchScreenAutoTuneCompletedEvent"}, + {1325, nullptr, "IsTouchScreenAutoTuneRequiredForRepairProviderReplacement"}, + {1420, nullptr, "GetAppletResourceProperty"}, + {2000, nullptr, "ActivateDigitizer"}, + {3000, nullptr, "GetDebugPadGenericPadMap"}, + {3001, nullptr, "SetDebugPadGenericPadMap"}, + {3002, nullptr, "ResetDebugPadGenericPadMap"}, + {3003, nullptr, "GetDebugPadKeyboardMap"}, + {3004, nullptr, "SetDebugPadKeyboardMap"}, + {3005, nullptr, "ResetDebugPadKeyboardMap"}, + {3006, nullptr, "GetFullKeyGenericPadMap"}, + {3007, nullptr, "SetFullKeyGenericPadMap"}, + {3008, nullptr, "ResetFullKeyGenericPadMap"}, + {3009, nullptr, "GetFullKeyKeyboardMap"}, + {3010, nullptr, "SetFullKeyKeyboardMap"}, + {3011, nullptr, "ResetFullKeyKeyboardMap"}, + {3012, nullptr, "GetDebugPadGenericPadMap"}, //21.0.0+ + {3013, nullptr, "SetDebugPadGenericPadMap"}, //21.0.0+ + {3014, nullptr, "GetDebugPadKeyboardMap"}, //21.0.0+ + {3015, nullptr, "SetDebugPadKeyboardMap"}, //21.0.0+ + {3150, C<&IHidServer::SetMouseLibraryVersion>, "SetMouseLibraryVersion"}, //21.0.0+ + // What? -- {12010, nullptr, "SetButtonConfigLeft"}, + }; + // clang-format on + + RegisterHandlers(functions); } IHidServer::~IHidServer() = default; diff --git a/src/core/hle/service/hid/hid_server.h b/src/core/hle/service/hid/hid_server.h index f2c08e9df8..57a1a04b9c 100644 --- a/src/core/hle/service/hid/hid_server.h +++ b/src/core/hle/service/hid/hid_server.h @@ -265,8 +265,6 @@ private: Result SetTouchScreenResolution(u32 width, u32 height, ClientAppletResourceUserId aruid); Result SetMouseLibraryVersion(ClientAppletResourceUserId aruid); - std::optional FindRequest(u32 key) override; - std::shared_ptr resource_manager; std::shared_ptr firmware_settings; }; diff --git a/src/core/hle/service/hid/hid_system_server.cpp b/src/core/hle/service/hid/hid_system_server.cpp index 4df021f443..e544adf03c 100644 --- a/src/core/hle/service/hid/hid_system_server.cpp +++ b/src/core/hle/service/hid/hid_system_server.cpp @@ -22,6 +22,252 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr settings) : ServiceFramework{system_, "hid:sys"}, service_context{system_, service_name}, resource_manager{resource}, firmware_settings{settings} { + // clang-format off + static const FunctionInfo functions[] = { + {31, nullptr, "SendKeyboardLockKeyEvent"}, + {101, nullptr, "AcquireHomeButtonEventHandle"}, + {111, nullptr, "ActivateHomeButton"}, + {121, nullptr, "AcquireSleepButtonEventHandle"}, + {131, nullptr, "ActivateSleepButton"}, + {141, nullptr, "AcquireCaptureButtonEventHandle"}, + {151, nullptr, "ActivateCaptureButton"}, + {161, &IHidSystemServer::GetPlatformConfig, "GetPlatformConfig"}, + {210, nullptr, "AcquireNfcDeviceUpdateEventHandle"}, + {211, nullptr, "GetNpadsWithNfc"}, + {212, nullptr, "AcquireNfcActivateEventHandle"}, + {213, nullptr, "ActivateNfc"}, + {214, nullptr, "GetXcdHandleForNpadWithNfc"}, + {215, nullptr, "IsNfcActivated"}, + {216, nullptr, "GetAbstractedPadIdForNpadWithNfc"}, + {217, nullptr, "SetNfcEvent"}, + {218, nullptr, "GetNfcInfo"}, + {219, nullptr, "StartNfcDiscovery"}, + {220, nullptr, "StopNfcDiscovery"}, + {221, nullptr, "StartNtagRead"}, + {222, nullptr, "StartNtagWrite"}, + {223, nullptr, "SendNfcRawData"}, + {224, nullptr, "RegisterMifareKey"}, + {225, nullptr, "ClearMifareKey"}, + {226, nullptr, "StartMifareRead"}, + {227, nullptr, "StartMifareWrite"}, + {230, nullptr, "AcquireIrSensorEventHndle" }, + {231, nullptr, "ActivateIrSensor"}, + {232, nullptr, "GetIrSensorState"}, + {233, nullptr, "GetXcdHandleForNpadWihIrSensor" }, + {234, nullptr, "GetNpadJoyHoldType"}, + {241, nullptr, "GetDataFormat"}, + {242, nullptr, "SetDataFormat"}, + {243, nullptr, "GetMcuState"}, + {244, nullptr, "SetMcuState"}, + {245, nullptr, "GetMcuVersionForNfc"}, + {246, nullptr, "CheckNfcDevicePower"}, + {247, nullptr, "SetMcuStateImmediate"}, + {301, nullptr, "ActivateNpadSystem"}, + {303, &IHidSystemServer::ApplyNpadSystemCommonPolicy, "ApplyNpadSystemCommonPolicy"}, + {304, &IHidSystemServer::EnableAssigningSingleOnSlSrPress, "EnableAssigningSingleOnSlSrPress"}, + {305, &IHidSystemServer::DisableAssigningSingleOnSlSrPress, "DisableAssigningSingleOnSlSrPress"}, + {306, &IHidSystemServer::GetLastActiveNpad, "GetLastActiveNpad"}, + {307, nullptr, "GetNpadSystemExtStyle"}, + {308, &IHidSystemServer::ApplyNpadSystemCommonPolicyFull, "ApplyNpadSystemCommonPolicyFull"}, + {309, &IHidSystemServer::GetNpadFullKeyGripColor, "GetNpadFullKeyGripColor"}, + {310, &IHidSystemServer::GetMaskedSupportedNpadStyleSet, "GetMaskedSupportedNpadStyleSet"}, + {311, nullptr, "SetNpadPlayerLedBlinkingDevice"}, + {312, &IHidSystemServer::SetSupportedNpadStyleSetAll, "SetSupportedNpadStyleSetAll"}, + {313, &IHidSystemServer::GetNpadCaptureButtonAssignment, "GetNpadCaptureButtonAssignment"}, + {314, nullptr, "GetAppletFooterUiType"}, + {315, &IHidSystemServer::GetAppletDetailedUiType, "GetAppletDetailedUiType"}, + {316, &IHidSystemServer::GetNpadInterfaceType, "GetNpadInterfaceType"}, + {317, &IHidSystemServer::GetNpadLeftRightInterfaceType, "GetNpadLeftRightInterfaceType"}, + {318, &IHidSystemServer::HasBattery, "HasBattery"}, + {319, &IHidSystemServer::HasLeftRightBattery, "HasLeftRightBattery"}, + {321, &IHidSystemServer::GetUniquePadsFromNpad, "GetUniquePadsFromNpad"}, + {322, &IHidSystemServer::SetNpadSystemExtStateEnabled, "SetNpadSystemExtStateEnabled"}, + {323, nullptr, "GetLastActiveUniquePad"}, + {324, nullptr, "GetUniquePadButtonSet"}, + {325, nullptr, "GetUniquePadColor"}, + {326, nullptr, "GetUniquePadAppletDetailedUiType"}, + {327, nullptr, "GetAbstractedPadIdDataFromNpad"}, + {328, nullptr, "AttachAbstractedPadToNpad"}, + {329, nullptr, "DetachAbstractedPadAll"}, + {330, nullptr, "CheckAbstractedPadConnection"}, + {332, nullptr, "ConvertAppletDetailedUiTypeFromPlayReportType"}, //19.0.0+ + {333, nullptr, "SetNpadUserSpgApplet"}, //20.0.0+ + {334, nullptr, "AcquireUniquePadButtonStateChangedEventHandle"}, //20.0.0+ + {501, &IHidSystemServer::RegisterAppletResourceUserId, "RegisterAppletResourceUserId"}, + {502, &IHidSystemServer::UnregisterAppletResourceUserId, "UnregisterAppletResourceUserId"}, + {503, &IHidSystemServer::EnableAppletToGetInput, "EnableAppletToGetInput"}, + {504, &IHidSystemServer::SetAruidValidForVibration, "SetAruidValidForVibration"}, + {505, &IHidSystemServer::EnableAppletToGetSixAxisSensor, "EnableAppletToGetSixAxisSensor"}, + {506, &IHidSystemServer::EnableAppletToGetPadInput, "EnableAppletToGetPadInput"}, + {507, &IHidSystemServer::EnableAppletToGetTouchScreen, "EnableAppletToGetTouchScreen"}, + {510, &IHidSystemServer::SetVibrationMasterVolume, "SetVibrationMasterVolume"}, + {511, &IHidSystemServer::GetVibrationMasterVolume, "GetVibrationMasterVolume"}, + {512, &IHidSystemServer::BeginPermitVibrationSession, "BeginPermitVibrationSession"}, + {513, &IHidSystemServer::EndPermitVibrationSession, "EndPermitVibrationSession"}, + {514, nullptr, "Unknown514"}, + {520, nullptr, "EnableHandheldHids"}, + {521, nullptr, "DisableHandheldHids"}, + {522, nullptr, "SetJoyConRailEnabled"}, + {523, &IHidSystemServer::IsJoyConRailEnabled, "IsJoyConRailEnabled"}, + {524, nullptr, "IsHandheldHidsEnabled"}, + {525, &IHidSystemServer::IsJoyConAttachedOnAllRail, "IsJoyConAttachedOnAllRail"}, + {540, nullptr, "AcquirePlayReportControllerUsageUpdateEvent"}, + {541, nullptr, "GetPlayReportControllerUsages"}, + {542, nullptr, "AcquirePlayReportRegisteredDeviceUpdateEvent"}, + {543, nullptr, "GetRegisteredDevicesOld"}, + {544, &IHidSystemServer::AcquireConnectionTriggerTimeoutEvent, "AcquireConnectionTriggerTimeoutEvent"}, + {545, nullptr, "SendConnectionTrigger"}, + {546, &IHidSystemServer::AcquireDeviceRegisteredEventForControllerSupport, "AcquireDeviceRegisteredEventForControllerSupport"}, + {547, nullptr, "GetAllowedBluetoothLinksCount"}, + {548, &IHidSystemServer::GetRegisteredDevices, "GetRegisteredDevices"}, + {549, nullptr, "GetConnectableRegisteredDevices"}, + {551, &IHidSystemServer::GetRegisteredDevices, "GetRegisteredDevicesForControllerSupport"}, //20.0.0+ //mocked via 548 for Diablo 3 (at least) + {700, nullptr, "ActivateUniquePad"}, + {702, &IHidSystemServer::AcquireUniquePadConnectionEventHandle, "AcquireUniquePadConnectionEventHandle"}, + {703, &IHidSystemServer::GetUniquePadIds, "GetUniquePadIds"}, + {711, nullptr, "AcquireUniquePadConnectionOnHandheldForNsEventHandle"}, //20.0.0+ + {712, nullptr, "GetUniquePadColor12"}, //20.0.0+ + {751, &IHidSystemServer::AcquireJoyDetachOnBluetoothOffEventHandle, "AcquireJoyDetachOnBluetoothOffEventHandle"}, + {800, nullptr, "ListSixAxisSensorHandles"}, + {801, nullptr, "IsSixAxisSensorUserCalibrationSupported"}, + {802, nullptr, "ResetSixAxisSensorCalibrationValues"}, + {803, nullptr, "StartSixAxisSensorUserCalibration"}, + {804, nullptr, "CancelSixAxisSensorUserCalibration"}, + {805, nullptr, "GetUniquePadBluetoothAddress"}, + {806, nullptr, "DisconnectUniquePad"}, + {807, nullptr, "GetUniquePadType"}, + {808, nullptr, "GetUniquePadInterface"}, + {809, nullptr, "GetUniquePadSerialNumber"}, + {810, nullptr, "GetUniquePadControllerNumber"}, + {811, nullptr, "GetSixAxisSensorUserCalibrationStage"}, + {812, nullptr, "GetConsoleUniqueSixAxisSensorHandle"}, + {813, nullptr, "GetDeviceType"}, + {821, nullptr, "StartAnalogStickManualCalibration"}, + {822, nullptr, "RetryCurrentAnalogStickManualCalibrationStage"}, + {823, nullptr, "CancelAnalogStickManualCalibration"}, + {824, nullptr, "ResetAnalogStickManualCalibration"}, + {825, nullptr, "GetAnalogStickState"}, + {826, nullptr, "GetAnalogStickManualCalibrationStage"}, + {827, nullptr, "IsAnalogStickButtonPressed"}, + {828, nullptr, "IsAnalogStickInReleasePosition"}, + {829, nullptr, "IsAnalogStickInCircumference"}, + {830, nullptr, "SetNotificationLedPattern"}, + {831, nullptr, "SetNotificationLedPatternWithTimeout"}, + {832, nullptr, "PrepareHidsForNotificationWake"}, + {850, &IHidSystemServer::IsUsbFullKeyControllerEnabled, "IsUsbFullKeyControllerEnabled"}, + {851, &IHidSystemServer::EnableUsbFullKeyController, "EnableUsbFullKeyController"}, + {852, nullptr, "IsUsbConnected"}, + {870, &IHidSystemServer::IsHandheldButtonPressedOnConsoleMode, "IsHandheldButtonPressedOnConsoleMode"}, + {900, nullptr, "ActivateInputDetector"}, + {901, nullptr, "NotifyInputDetector"}, + {1000, &IHidSystemServer::InitializeFirmwareUpdate, "InitializeFirmwareUpdate"}, + {1001, nullptr, "GetFirmwareVersion"}, + {1002, nullptr, "GetAvailableFirmwareVersion"}, + {1003, nullptr, "IsFirmwareUpdateAvailable"}, + {1004, &IHidSystemServer::CheckFirmwareUpdateRequired, "CheckFirmwareUpdateRequired"}, + {1005, nullptr, "StartFirmwareUpdate"}, + {1006, nullptr, "AbortFirmwareUpdate"}, + {1007, nullptr, "GetFirmwareUpdateState"}, + {1008, nullptr, "ActivateAudioControl"}, + {1009, nullptr, "AcquireAudioControlEventHandle"}, + {1010, nullptr, "GetAudioControlStates"}, + {1011, nullptr, "DeactivateAudioControl"}, + {1012, nullptr, "GetFirmwareVersionStringForUserSupportPage"}, + {1050, nullptr, "IsSixAxisSensorAccurateUserCalibrationSupported"}, + {1051, nullptr, "StartSixAxisSensorAccurateUserCalibration"}, + {1052, nullptr, "CancelSixAxisSensorAccurateUserCalibration"}, + {1053, nullptr, "GetSixAxisSensorAccurateUserCalibrationState"}, + {1100, nullptr, "GetHidbusSystemServiceObject"}, + {1120, &IHidSystemServer::SetFirmwareHotfixUpdateSkipEnabled, "SetFirmwareHotfixUpdateSkipEnabled"}, + {1130, &IHidSystemServer::InitializeUsbFirmwareUpdate, "InitializeUsbFirmwareUpdate"}, + {1131, &IHidSystemServer::FinalizeUsbFirmwareUpdate, "FinalizeUsbFirmwareUpdate"}, + {1132, &IHidSystemServer::CheckUsbFirmwareUpdateRequired, "CheckUsbFirmwareUpdateRequired"}, + {1133, nullptr, "StartUsbFirmwareUpdate"}, + {1134, nullptr, "GetUsbFirmwareUpdateState"}, + {1135, &IHidSystemServer::InitializeUsbFirmwareUpdateWithoutMemory, "InitializeUsbFirmwareUpdateWithoutMemory"}, + {1150, &IHidSystemServer::SetTouchScreenMagnification, "SetTouchScreenMagnification"}, + {1151, &IHidSystemServer::GetTouchScreenFirmwareVersion, "GetTouchScreenFirmwareVersion"}, + {1152, &IHidSystemServer::SetTouchScreenDefaultConfiguration, "SetTouchScreenDefaultConfiguration"}, + {1153, &IHidSystemServer::GetTouchScreenDefaultConfiguration, "GetTouchScreenDefaultConfiguration"}, + {1154, nullptr, "IsFirmwareAvailableForNotification"}, + {1155, &IHidSystemServer::SetForceHandheldStyleVibration, "SetForceHandheldStyleVibration"}, + {1156, nullptr, "SendConnectionTriggerWithoutTimeoutEvent"}, + {1157, nullptr, "CancelConnectionTrigger"}, + {1158, nullptr, "SetConnectionLimitForSplay"}, //20.1.0+ + {1159, nullptr, "ClearConnectionLimitForSplay"}, //20.1.0+ + {1200, nullptr, "IsButtonConfigSupported"}, + {1201, nullptr, "IsButtonConfigEmbeddedSupported"}, + {1202, nullptr, "DeleteButtonConfig"}, + {1203, nullptr, "DeleteButtonConfigEmbedded"}, + {1204, nullptr, "SetButtonConfigEnabled"}, + {1205, nullptr, "SetButtonConfigEmbeddedEnabled"}, + {1206, nullptr, "IsButtonConfigEnabled"}, + {1207, nullptr, "IsButtonConfigEmbeddedEnabled"}, + {1208, nullptr, "SetButtonConfigEmbedded"}, + {1209, nullptr, "SetButtonConfigFull"}, + {1210, nullptr, "SetButtonConfigLeft"}, + {1211, nullptr, "SetButtonConfigRight"}, + {1212, nullptr, "GetButtonConfigEmbedded"}, + {1213, nullptr, "GetButtonConfigFull"}, + {1214, nullptr, "GetButtonConfigLeft"}, + {1215, nullptr, "GetButtonConfigRight"}, + {1250, nullptr, "IsCustomButtonConfigSupported"}, + {1251, nullptr, "IsDefaultButtonConfigEmbedded"}, + {1252, nullptr, "IsDefaultButtonConfigFull"}, + {1253, nullptr, "IsDefaultButtonConfigLeft"}, + {1254, nullptr, "IsDefaultButtonConfigRight"}, + {1255, nullptr, "IsButtonConfigStorageEmbeddedEmpty"}, + {1256, nullptr, "IsButtonConfigStorageFullEmpty"}, + {1257, nullptr, "IsButtonConfigStorageLeftEmpty"}, + {1258, nullptr, "IsButtonConfigStorageRightEmpty"}, + {1259, nullptr, "GetButtonConfigStorageEmbeddedDeprecated"}, + {1260, nullptr, "GetButtonConfigStorageFullDeprecated"}, + {1261, nullptr, "GetButtonConfigStorageLeftDeprecated"}, + {1262, nullptr, "GetButtonConfigStorageRightDeprecated"}, + {1263, nullptr, "SetButtonConfigStorageEmbeddedDeprecated"}, + {1264, nullptr, "SetButtonConfigStorageFullDeprecated"}, + {1265, nullptr, "SetButtonConfigStorageLeftDeprecated"}, + {1266, nullptr, "SetButtonConfigStorageRightDeprecated"}, + {1267, nullptr, "DeleteButtonConfigStorageEmbedded"}, + {1268, nullptr, "DeleteButtonConfigStorageFull"}, + {1269, nullptr, "DeleteButtonConfigStorageLeft"}, + {1270, nullptr, "DeleteButtonConfigStorageRight"}, + {1271, &IHidSystemServer::IsUsingCustomButtonConfig, "IsUsingCustomButtonConfig"}, + {1272, &IHidSystemServer::IsAnyCustomButtonConfigEnabled, "IsAnyCustomButtonConfigEnabled"}, + {1273, nullptr, "SetAllCustomButtonConfigEnabled"}, + {1274, nullptr, "SetDefaultButtonConfig"}, + {1275, nullptr, "SetAllDefaultButtonConfig"}, + {1276, nullptr, "SetHidButtonConfigEmbedded"}, + {1277, nullptr, "SetHidButtonConfigFull"}, + {1278, nullptr, "SetHidButtonConfigLeft"}, + {1279, nullptr, "SetHidButtonConfigRight"}, + {1280, nullptr, "GetHidButtonConfigEmbedded"}, + {1281, nullptr, "GetHidButtonConfigFull"}, + {1282, nullptr, "GetHidButtonConfigLeft"}, + {1283, nullptr, "GetHidButtonConfigRight"}, + {1284, nullptr, "GetButtonConfigStorageEmbedded"}, + {1285, nullptr, "GetButtonConfigStorageFull"}, + {1286, nullptr, "GetButtonConfigStorageLeft"}, + {1287, nullptr, "GetButtonConfigStorageRight"}, + {1288, nullptr, "SetButtonConfigStorageEmbedded"}, + {1289, nullptr, "SetButtonConfigStorageFull"}, + {1290, nullptr, "DeleteButtonConfigStorageRight"}, + {1291, nullptr, "DeleteButtonConfigStorageRight"}, + {1308, nullptr, "SetButtonConfigVisible"}, //18.0.0+ + {1309, nullptr, "IsButtonConfigVisible"}, //18.0.0+ + {1320, nullptr, "WakeTouchScreenUp"}, //17.0.0+ + {1321, nullptr, "PutTouchScreenToSleep"}, //17.0.0+ + {1322, nullptr, "AcquireTouchScreenAsyncWakeCompletedEvent"}, //20.0.0+ + {1323, nullptr, "StartTouchScreenAutoTuneForSystemSettings"}, //21.0.0+ + {1324, nullptr, "AcquireTouchScreenAutoTuneCompletedEvent"}, //21.0.0+ + {1325, nullptr, "IsTouchScreenAutoTuneRequiredForRepairProviderReplacement"}, //21.0.0+ + {1326, nullptr, "SetTouchScreenOffset"}, //21.0.0+ + {1420, nullptr, "GetAppletResourceProperty"}, //19.0.0+ + {12010, nullptr, "SetButtonConfigLeft"} //11.0.0-17.0.1 + }; + // clang-format on + + RegisterHandlers(functions); joy_detach_event = service_context.CreateEvent("IHidSystemServer::JoyDetachEvent"); acquire_device_registered_event = diff --git a/src/core/hle/service/hid/hid_system_server.h b/src/core/hle/service/hid/hid_system_server.h index e5da7bbdac..150b697305 100644 --- a/src/core/hle/service/hid/hid_system_server.h +++ b/src/core/hle/service/hid/hid_system_server.h @@ -84,252 +84,6 @@ private: std::shared_ptr GetResourceManager(); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{31, nullptr, "SendKeyboardLockKeyEvent"}, - FunctionInfo{101, nullptr, "AcquireHomeButtonEventHandle"}, - FunctionInfo{111, nullptr, "ActivateHomeButton"}, - FunctionInfo{121, nullptr, "AcquireSleepButtonEventHandle"}, - FunctionInfo{131, nullptr, "ActivateSleepButton"}, - FunctionInfo{141, nullptr, "AcquireCaptureButtonEventHandle"}, - FunctionInfo{151, nullptr, "ActivateCaptureButton"}, - FunctionInfo{161, &IHidSystemServer::GetPlatformConfig, "GetPlatformConfig"}, - FunctionInfo{210, nullptr, "AcquireNfcDeviceUpdateEventHandle"}, - FunctionInfo{211, nullptr, "GetNpadsWithNfc"}, - FunctionInfo{212, nullptr, "AcquireNfcActivateEventHandle"}, - FunctionInfo{213, nullptr, "ActivateNfc"}, - FunctionInfo{214, nullptr, "GetXcdHandleForNpadWithNfc"}, - FunctionInfo{215, nullptr, "IsNfcActivated"}, - FunctionInfo{216, nullptr, "GetAbstractedPadIdForNpadWithNfc"}, - FunctionInfo{217, nullptr, "SetNfcEvent"}, - FunctionInfo{218, nullptr, "GetNfcInfo"}, - FunctionInfo{219, nullptr, "StartNfcDiscovery"}, - FunctionInfo{220, nullptr, "StopNfcDiscovery"}, - FunctionInfo{221, nullptr, "StartNtagRead"}, - FunctionInfo{222, nullptr, "StartNtagWrite"}, - FunctionInfo{223, nullptr, "SendNfcRawData"}, - FunctionInfo{224, nullptr, "RegisterMifareKey"}, - FunctionInfo{225, nullptr, "ClearMifareKey"}, - FunctionInfo{226, nullptr, "StartMifareRead"}, - FunctionInfo{227, nullptr, "StartMifareWrite"}, - FunctionInfo{230, nullptr, "AcquireIrSensorEventHndle" }, - FunctionInfo{231, nullptr, "ActivateIrSensor"}, - FunctionInfo{232, nullptr, "GetIrSensorState"}, - FunctionInfo{233, nullptr, "GetXcdHandleForNpadWihIrSensor" }, - FunctionInfo{234, nullptr, "GetNpadJoyHoldType"}, - FunctionInfo{241, nullptr, "GetDataFormat"}, - FunctionInfo{242, nullptr, "SetDataFormat"}, - FunctionInfo{243, nullptr, "GetMcuState"}, - FunctionInfo{244, nullptr, "SetMcuState"}, - FunctionInfo{245, nullptr, "GetMcuVersionForNfc"}, - FunctionInfo{246, nullptr, "CheckNfcDevicePower"}, - FunctionInfo{247, nullptr, "SetMcuStateImmediate"}, - FunctionInfo{301, nullptr, "ActivateNpadSystem"}, - FunctionInfo{303, &IHidSystemServer::ApplyNpadSystemCommonPolicy, "ApplyNpadSystemCommonPolicy"}, - FunctionInfo{304, &IHidSystemServer::EnableAssigningSingleOnSlSrPress, "EnableAssigningSingleOnSlSrPress"}, - FunctionInfo{305, &IHidSystemServer::DisableAssigningSingleOnSlSrPress, "DisableAssigningSingleOnSlSrPress"}, - FunctionInfo{306, &IHidSystemServer::GetLastActiveNpad, "GetLastActiveNpad"}, - FunctionInfo{307, nullptr, "GetNpadSystemExtStyle"}, - FunctionInfo{308, &IHidSystemServer::ApplyNpadSystemCommonPolicyFull, "ApplyNpadSystemCommonPolicyFull"}, - FunctionInfo{309, &IHidSystemServer::GetNpadFullKeyGripColor, "GetNpadFullKeyGripColor"}, - FunctionInfo{310, &IHidSystemServer::GetMaskedSupportedNpadStyleSet, "GetMaskedSupportedNpadStyleSet"}, - FunctionInfo{311, nullptr, "SetNpadPlayerLedBlinkingDevice"}, - FunctionInfo{312, &IHidSystemServer::SetSupportedNpadStyleSetAll, "SetSupportedNpadStyleSetAll"}, - FunctionInfo{313, &IHidSystemServer::GetNpadCaptureButtonAssignment, "GetNpadCaptureButtonAssignment"}, - FunctionInfo{314, nullptr, "GetAppletFooterUiType"}, - FunctionInfo{315, &IHidSystemServer::GetAppletDetailedUiType, "GetAppletDetailedUiType"}, - FunctionInfo{316, &IHidSystemServer::GetNpadInterfaceType, "GetNpadInterfaceType"}, - FunctionInfo{317, &IHidSystemServer::GetNpadLeftRightInterfaceType, "GetNpadLeftRightInterfaceType"}, - FunctionInfo{318, &IHidSystemServer::HasBattery, "HasBattery"}, - FunctionInfo{319, &IHidSystemServer::HasLeftRightBattery, "HasLeftRightBattery"}, - FunctionInfo{321, &IHidSystemServer::GetUniquePadsFromNpad, "GetUniquePadsFromNpad"}, - FunctionInfo{322, &IHidSystemServer::SetNpadSystemExtStateEnabled, "SetNpadSystemExtStateEnabled"}, - FunctionInfo{323, nullptr, "GetLastActiveUniquePad"}, - FunctionInfo{324, nullptr, "GetUniquePadButtonSet"}, - FunctionInfo{325, nullptr, "GetUniquePadColor"}, - FunctionInfo{326, nullptr, "GetUniquePadAppletDetailedUiType"}, - FunctionInfo{327, nullptr, "GetAbstractedPadIdDataFromNpad"}, - FunctionInfo{328, nullptr, "AttachAbstractedPadToNpad"}, - FunctionInfo{329, nullptr, "DetachAbstractedPadAll"}, - FunctionInfo{330, nullptr, "CheckAbstractedPadConnection"}, - FunctionInfo{332, nullptr, "ConvertAppletDetailedUiTypeFromPlayReportType", MakeVersionGate({19,0,0})}, - FunctionInfo{333, nullptr, "SetNpadUserSpgApplet", MakeVersionGate({20,0,0})}, - FunctionInfo{334, nullptr, "AcquireUniquePadButtonStateChangedEventHandle", MakeVersionGate({20,0,0})}, - FunctionInfo{501, &IHidSystemServer::RegisterAppletResourceUserId, "RegisterAppletResourceUserId"}, - FunctionInfo{502, &IHidSystemServer::UnregisterAppletResourceUserId, "UnregisterAppletResourceUserId"}, - FunctionInfo{503, &IHidSystemServer::EnableAppletToGetInput, "EnableAppletToGetInput"}, - FunctionInfo{504, &IHidSystemServer::SetAruidValidForVibration, "SetAruidValidForVibration"}, - FunctionInfo{505, &IHidSystemServer::EnableAppletToGetSixAxisSensor, "EnableAppletToGetSixAxisSensor"}, - FunctionInfo{506, &IHidSystemServer::EnableAppletToGetPadInput, "EnableAppletToGetPadInput"}, - FunctionInfo{507, &IHidSystemServer::EnableAppletToGetTouchScreen, "EnableAppletToGetTouchScreen"}, - FunctionInfo{510, &IHidSystemServer::SetVibrationMasterVolume, "SetVibrationMasterVolume"}, - FunctionInfo{511, &IHidSystemServer::GetVibrationMasterVolume, "GetVibrationMasterVolume"}, - FunctionInfo{512, &IHidSystemServer::BeginPermitVibrationSession, "BeginPermitVibrationSession"}, - FunctionInfo{513, &IHidSystemServer::EndPermitVibrationSession, "EndPermitVibrationSession"}, - FunctionInfo{514, nullptr, "Unknown514"}, - FunctionInfo{520, nullptr, "EnableHandheldHids"}, - FunctionInfo{521, nullptr, "DisableHandheldHids"}, - FunctionInfo{522, nullptr, "SetJoyConRailEnabled"}, - FunctionInfo{523, &IHidSystemServer::IsJoyConRailEnabled, "IsJoyConRailEnabled"}, - FunctionInfo{524, nullptr, "IsHandheldHidsEnabled"}, - FunctionInfo{525, &IHidSystemServer::IsJoyConAttachedOnAllRail, "IsJoyConAttachedOnAllRail"}, - FunctionInfo{540, nullptr, "AcquirePlayReportControllerUsageUpdateEvent"}, - FunctionInfo{541, nullptr, "GetPlayReportControllerUsages"}, - FunctionInfo{542, nullptr, "AcquirePlayReportRegisteredDeviceUpdateEvent"}, - FunctionInfo{543, nullptr, "GetRegisteredDevicesOld"}, - FunctionInfo{544, &IHidSystemServer::AcquireConnectionTriggerTimeoutEvent, "AcquireConnectionTriggerTimeoutEvent"}, - FunctionInfo{545, nullptr, "SendConnectionTrigger"}, - FunctionInfo{546, &IHidSystemServer::AcquireDeviceRegisteredEventForControllerSupport, "AcquireDeviceRegisteredEventForControllerSupport"}, - FunctionInfo{547, nullptr, "GetAllowedBluetoothLinksCount"}, - FunctionInfo{548, &IHidSystemServer::GetRegisteredDevices, "GetRegisteredDevices"}, - FunctionInfo{549, nullptr, "GetConnectableRegisteredDevices"}, - FunctionInfo{551, &IHidSystemServer::GetRegisteredDevices, "GetRegisteredDevicesForControllerSupport", MakeVersionGate({20,0,0})}, //mocked via 548 for Diablo 3 (at least) - FunctionInfo{700, nullptr, "ActivateUniquePad"}, - FunctionInfo{702, &IHidSystemServer::AcquireUniquePadConnectionEventHandle, "AcquireUniquePadConnectionEventHandle"}, - FunctionInfo{703, &IHidSystemServer::GetUniquePadIds, "GetUniquePadIds"}, - FunctionInfo{711, nullptr, "AcquireUniquePadConnectionOnHandheldForNsEventHandle", MakeVersionGate({20,0,0})}, - FunctionInfo{712, nullptr, "GetUniquePadColor12", MakeVersionGate({20,0,0})}, - FunctionInfo{751, &IHidSystemServer::AcquireJoyDetachOnBluetoothOffEventHandle, "AcquireJoyDetachOnBluetoothOffEventHandle"}, - FunctionInfo{800, nullptr, "ListSixAxisSensorHandles"}, - FunctionInfo{801, nullptr, "IsSixAxisSensorUserCalibrationSupported"}, - FunctionInfo{802, nullptr, "ResetSixAxisSensorCalibrationValues"}, - FunctionInfo{803, nullptr, "StartSixAxisSensorUserCalibration"}, - FunctionInfo{804, nullptr, "CancelSixAxisSensorUserCalibration"}, - FunctionInfo{805, nullptr, "GetUniquePadBluetoothAddress"}, - FunctionInfo{806, nullptr, "DisconnectUniquePad"}, - FunctionInfo{807, nullptr, "GetUniquePadType"}, - FunctionInfo{808, nullptr, "GetUniquePadInterface"}, - FunctionInfo{809, nullptr, "GetUniquePadSerialNumber"}, - FunctionInfo{810, nullptr, "GetUniquePadControllerNumber"}, - FunctionInfo{811, nullptr, "GetSixAxisSensorUserCalibrationStage"}, - FunctionInfo{812, nullptr, "GetConsoleUniqueSixAxisSensorHandle"}, - FunctionInfo{813, nullptr, "GetDeviceType"}, - FunctionInfo{821, nullptr, "StartAnalogStickManualCalibration"}, - FunctionInfo{822, nullptr, "RetryCurrentAnalogStickManualCalibrationStage"}, - FunctionInfo{823, nullptr, "CancelAnalogStickManualCalibration"}, - FunctionInfo{824, nullptr, "ResetAnalogStickManualCalibration"}, - FunctionInfo{825, nullptr, "GetAnalogStickState"}, - FunctionInfo{826, nullptr, "GetAnalogStickManualCalibrationStage"}, - FunctionInfo{827, nullptr, "IsAnalogStickButtonPressed"}, - FunctionInfo{828, nullptr, "IsAnalogStickInReleasePosition"}, - FunctionInfo{829, nullptr, "IsAnalogStickInCircumference"}, - FunctionInfo{830, nullptr, "SetNotificationLedPattern"}, - FunctionInfo{831, nullptr, "SetNotificationLedPatternWithTimeout"}, - FunctionInfo{832, nullptr, "PrepareHidsForNotificationWake"}, - FunctionInfo{850, &IHidSystemServer::IsUsbFullKeyControllerEnabled, "IsUsbFullKeyControllerEnabled"}, - FunctionInfo{851, &IHidSystemServer::EnableUsbFullKeyController, "EnableUsbFullKeyController"}, - FunctionInfo{852, nullptr, "IsUsbConnected"}, - FunctionInfo{870, &IHidSystemServer::IsHandheldButtonPressedOnConsoleMode, "IsHandheldButtonPressedOnConsoleMode"}, - FunctionInfo{900, nullptr, "ActivateInputDetector"}, - FunctionInfo{901, nullptr, "NotifyInputDetector"}, - FunctionInfo{1000, &IHidSystemServer::InitializeFirmwareUpdate, "InitializeFirmwareUpdate"}, - FunctionInfo{1001, nullptr, "GetFirmwareVersion"}, - FunctionInfo{1002, nullptr, "GetAvailableFirmwareVersion"}, - FunctionInfo{1003, nullptr, "IsFirmwareUpdateAvailable"}, - FunctionInfo{1004, &IHidSystemServer::CheckFirmwareUpdateRequired, "CheckFirmwareUpdateRequired"}, - FunctionInfo{1005, nullptr, "StartFirmwareUpdate"}, - FunctionInfo{1006, nullptr, "AbortFirmwareUpdate"}, - FunctionInfo{1007, nullptr, "GetFirmwareUpdateState"}, - FunctionInfo{1008, nullptr, "ActivateAudioControl"}, - FunctionInfo{1009, nullptr, "AcquireAudioControlEventHandle"}, - FunctionInfo{1010, nullptr, "GetAudioControlStates"}, - FunctionInfo{1011, nullptr, "DeactivateAudioControl"}, - FunctionInfo{1012, nullptr, "GetFirmwareVersionStringForUserSupportPage"}, - FunctionInfo{1050, nullptr, "IsSixAxisSensorAccurateUserCalibrationSupported"}, - FunctionInfo{1051, nullptr, "StartSixAxisSensorAccurateUserCalibration"}, - FunctionInfo{1052, nullptr, "CancelSixAxisSensorAccurateUserCalibration"}, - FunctionInfo{1053, nullptr, "GetSixAxisSensorAccurateUserCalibrationState"}, - FunctionInfo{1100, nullptr, "GetHidbusSystemServiceObject"}, - FunctionInfo{1120, &IHidSystemServer::SetFirmwareHotfixUpdateSkipEnabled, "SetFirmwareHotfixUpdateSkipEnabled"}, - FunctionInfo{1130, &IHidSystemServer::InitializeUsbFirmwareUpdate, "InitializeUsbFirmwareUpdate"}, - FunctionInfo{1131, &IHidSystemServer::FinalizeUsbFirmwareUpdate, "FinalizeUsbFirmwareUpdate"}, - FunctionInfo{1132, &IHidSystemServer::CheckUsbFirmwareUpdateRequired, "CheckUsbFirmwareUpdateRequired"}, - FunctionInfo{1133, nullptr, "StartUsbFirmwareUpdate"}, - FunctionInfo{1134, nullptr, "GetUsbFirmwareUpdateState"}, - FunctionInfo{1135, &IHidSystemServer::InitializeUsbFirmwareUpdateWithoutMemory, "InitializeUsbFirmwareUpdateWithoutMemory"}, - FunctionInfo{1150, &IHidSystemServer::SetTouchScreenMagnification, "SetTouchScreenMagnification"}, - FunctionInfo{1151, &IHidSystemServer::GetTouchScreenFirmwareVersion, "GetTouchScreenFirmwareVersion"}, - FunctionInfo{1152, &IHidSystemServer::SetTouchScreenDefaultConfiguration, "SetTouchScreenDefaultConfiguration"}, - FunctionInfo{1153, &IHidSystemServer::GetTouchScreenDefaultConfiguration, "GetTouchScreenDefaultConfiguration"}, - FunctionInfo{1154, nullptr, "IsFirmwareAvailableForNotification"}, - FunctionInfo{1155, &IHidSystemServer::SetForceHandheldStyleVibration, "SetForceHandheldStyleVibration"}, - FunctionInfo{1156, nullptr, "SendConnectionTriggerWithoutTimeoutEvent"}, - FunctionInfo{1157, nullptr, "CancelConnectionTrigger"}, - FunctionInfo{1158, nullptr, "SetConnectionLimitForSplay", MakeVersionGate({20,1,0})}, - FunctionInfo{1159, nullptr, "ClearConnectionLimitForSplay", MakeVersionGate({20,1,0})}, - FunctionInfo{1200, nullptr, "IsButtonConfigSupported"}, - FunctionInfo{1201, nullptr, "IsButtonConfigEmbeddedSupported"}, - FunctionInfo{1202, nullptr, "DeleteButtonConfig"}, - FunctionInfo{1203, nullptr, "DeleteButtonConfigEmbedded"}, - FunctionInfo{1204, nullptr, "SetButtonConfigEnabled"}, - FunctionInfo{1205, nullptr, "SetButtonConfigEmbeddedEnabled"}, - FunctionInfo{1206, nullptr, "IsButtonConfigEnabled"}, - FunctionInfo{1207, nullptr, "IsButtonConfigEmbeddedEnabled"}, - FunctionInfo{1208, nullptr, "SetButtonConfigEmbedded"}, - FunctionInfo{1209, nullptr, "SetButtonConfigFull"}, - FunctionInfo{1210, nullptr, "SetButtonConfigLeft"}, - FunctionInfo{1211, nullptr, "SetButtonConfigRight"}, - FunctionInfo{1212, nullptr, "GetButtonConfigEmbedded"}, - FunctionInfo{1213, nullptr, "GetButtonConfigFull"}, - FunctionInfo{1214, nullptr, "GetButtonConfigLeft"}, - FunctionInfo{1215, nullptr, "GetButtonConfigRight"}, - FunctionInfo{1250, nullptr, "IsCustomButtonConfigSupported"}, - FunctionInfo{1251, nullptr, "IsDefaultButtonConfigEmbedded"}, - FunctionInfo{1252, nullptr, "IsDefaultButtonConfigFull"}, - FunctionInfo{1253, nullptr, "IsDefaultButtonConfigLeft"}, - FunctionInfo{1254, nullptr, "IsDefaultButtonConfigRight"}, - FunctionInfo{1255, nullptr, "IsButtonConfigStorageEmbeddedEmpty"}, - FunctionInfo{1256, nullptr, "IsButtonConfigStorageFullEmpty"}, - FunctionInfo{1257, nullptr, "IsButtonConfigStorageLeftEmpty"}, - FunctionInfo{1258, nullptr, "IsButtonConfigStorageRightEmpty"}, - FunctionInfo{1259, nullptr, "GetButtonConfigStorageEmbeddedDeprecated"}, - FunctionInfo{1260, nullptr, "GetButtonConfigStorageFullDeprecated"}, - FunctionInfo{1261, nullptr, "GetButtonConfigStorageLeftDeprecated"}, - FunctionInfo{1262, nullptr, "GetButtonConfigStorageRightDeprecated"}, - FunctionInfo{1263, nullptr, "SetButtonConfigStorageEmbeddedDeprecated"}, - FunctionInfo{1264, nullptr, "SetButtonConfigStorageFullDeprecated"}, - FunctionInfo{1265, nullptr, "SetButtonConfigStorageLeftDeprecated"}, - FunctionInfo{1266, nullptr, "SetButtonConfigStorageRightDeprecated"}, - FunctionInfo{1267, nullptr, "DeleteButtonConfigStorageEmbedded"}, - FunctionInfo{1268, nullptr, "DeleteButtonConfigStorageFull"}, - FunctionInfo{1269, nullptr, "DeleteButtonConfigStorageLeft"}, - FunctionInfo{1270, nullptr, "DeleteButtonConfigStorageRight"}, - FunctionInfo{1271, &IHidSystemServer::IsUsingCustomButtonConfig, "IsUsingCustomButtonConfig"}, - FunctionInfo{1272, &IHidSystemServer::IsAnyCustomButtonConfigEnabled, "IsAnyCustomButtonConfigEnabled"}, - FunctionInfo{1273, nullptr, "SetAllCustomButtonConfigEnabled"}, - FunctionInfo{1274, nullptr, "SetDefaultButtonConfig"}, - FunctionInfo{1275, nullptr, "SetAllDefaultButtonConfig"}, - FunctionInfo{1276, nullptr, "SetHidButtonConfigEmbedded"}, - FunctionInfo{1277, nullptr, "SetHidButtonConfigFull"}, - FunctionInfo{1278, nullptr, "SetHidButtonConfigLeft"}, - FunctionInfo{1279, nullptr, "SetHidButtonConfigRight"}, - FunctionInfo{1280, nullptr, "GetHidButtonConfigEmbedded"}, - FunctionInfo{1281, nullptr, "GetHidButtonConfigFull"}, - FunctionInfo{1282, nullptr, "GetHidButtonConfigLeft"}, - FunctionInfo{1283, nullptr, "GetHidButtonConfigRight"}, - FunctionInfo{1284, nullptr, "GetButtonConfigStorageEmbedded"}, - FunctionInfo{1285, nullptr, "GetButtonConfigStorageFull"}, - FunctionInfo{1286, nullptr, "GetButtonConfigStorageLeft"}, - FunctionInfo{1287, nullptr, "GetButtonConfigStorageRight"}, - FunctionInfo{1288, nullptr, "SetButtonConfigStorageEmbedded"}, - FunctionInfo{1289, nullptr, "SetButtonConfigStorageFull"}, - FunctionInfo{1290, nullptr, "DeleteButtonConfigStorageRight"}, - FunctionInfo{1291, nullptr, "DeleteButtonConfigStorageRight"}, - FunctionInfo{1308, nullptr, "SetButtonConfigVisible", MakeVersionGate({18,0,0})}, - FunctionInfo{1309, nullptr, "IsButtonConfigVisible", MakeVersionGate({18,0,0})}, - FunctionInfo{1320, nullptr, "WakeTouchScreenUp", MakeVersionGate({17,0,0})}, - FunctionInfo{1321, nullptr, "PutTouchScreenToSleep", MakeVersionGate({17,0,0})}, - FunctionInfo{1322, nullptr, "AcquireTouchScreenAsyncWakeCompletedEvent", MakeVersionGate({20,0,0})}, - FunctionInfo{1323, nullptr, "StartTouchScreenAutoTuneForSystemSettings", MakeVersionGate({21,0,0})}, - FunctionInfo{1324, nullptr, "AcquireTouchScreenAutoTuneCompletedEvent", MakeVersionGate({21,0,0})}, - FunctionInfo{1325, nullptr, "IsTouchScreenAutoTuneRequiredForRepairProviderReplacement", MakeVersionGate({21,0,0})}, - FunctionInfo{1326, nullptr, "SetTouchScreenOffset", MakeVersionGate({21,0,0})}, - FunctionInfo{1420, nullptr, "GetAppletResourceProperty", MakeVersionGate({19,0,0})}, - FunctionInfo{12010, nullptr, "SetButtonConfigLeft", MakeVersionGate({11,0,0}, {17,0,1})} - ); - Kernel::KEvent* acquire_connection_trigger_timeout_event; Kernel::KEvent* acquire_device_registered_event; Kernel::KEvent* joy_detach_event; diff --git a/src/core/hle/service/hid/hidbus.cpp b/src/core/hle/service/hid/hidbus.cpp index 326cfbf74b..70bb5437e3 100644 --- a/src/core/hle/service/hid/hidbus.cpp +++ b/src/core/hle/service/hid/hidbus.cpp @@ -26,28 +26,30 @@ namespace Service::HID { // (15ms, 66Hz) constexpr auto hidbus_update_ns = std::chrono::nanoseconds{15 * 1000 * 1000}; -std::optional Hidbus::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, C<&Hidbus::GetBusHandle>, "GetBusHandle"}, - FunctionInfo{2, C<&Hidbus::IsExternalDeviceConnected>, "IsExternalDeviceConnected"}, - FunctionInfo{3, C<&Hidbus::Initialize>, "Initialize"}, - FunctionInfo{4, C<&Hidbus::Finalize>, "Finalize"}, - FunctionInfo{5, C<&Hidbus::EnableExternalDevice>, "EnableExternalDevice"}, - FunctionInfo{6, C<&Hidbus::GetExternalDeviceId>, "GetExternalDeviceId"}, - FunctionInfo{7, C<&Hidbus::SendCommandAsync>, "SendCommandAsync"}, - FunctionInfo{8, C<&Hidbus::GetSendCommandAsynceResult>, "GetSendCommandAsynceResult"}, - FunctionInfo{9, C<&Hidbus::SetEventForSendCommandAsycResult>, "SetEventForSendCommandAsycResult"}, - FunctionInfo{10, C<&Hidbus::GetSharedMemoryHandle>, "GetSharedMemoryHandle"}, - FunctionInfo{11, C<&Hidbus::EnableJoyPollingReceiveMode>, "EnableJoyPollingReceiveMode"}, - FunctionInfo{12, C<&Hidbus::DisableJoyPollingReceiveMode>, "DisableJoyPollingReceiveMode"}, - FunctionInfo{13, nullptr, "GetPollingData"}, - FunctionInfo{14, C<&Hidbus::SetStatusManagerType>, "SetStatusManagerType"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - Hidbus::Hidbus(Core::System& system_) : ServiceFramework{system_, "hidbus"}, service_context{system_, service_name} { + + // clang-format off + static const FunctionInfo functions[] = { + {1, C<&Hidbus::GetBusHandle>, "GetBusHandle"}, + {2, C<&Hidbus::IsExternalDeviceConnected>, "IsExternalDeviceConnected"}, + {3, C<&Hidbus::Initialize>, "Initialize"}, + {4, C<&Hidbus::Finalize>, "Finalize"}, + {5, C<&Hidbus::EnableExternalDevice>, "EnableExternalDevice"}, + {6, C<&Hidbus::GetExternalDeviceId>, "GetExternalDeviceId"}, + {7, C<&Hidbus::SendCommandAsync>, "SendCommandAsync"}, + {8, C<&Hidbus::GetSendCommandAsynceResult>, "GetSendCommandAsynceResult"}, + {9, C<&Hidbus::SetEventForSendCommandAsycResult>, "SetEventForSendCommandAsycResult"}, + {10, C<&Hidbus::GetSharedMemoryHandle>, "GetSharedMemoryHandle"}, + {11, C<&Hidbus::EnableJoyPollingReceiveMode>, "EnableJoyPollingReceiveMode"}, + {12, C<&Hidbus::DisableJoyPollingReceiveMode>, "DisableJoyPollingReceiveMode"}, + {13, nullptr, "GetPollingData"}, + {14, C<&Hidbus::SetStatusManagerType>, "SetStatusManagerType"}, + }; + // clang-format on + + RegisterHandlers(functions); + // Register update callbacks hidbus_update_event = Core::Timing::CreateEvent( "Hidbus::UpdateCallback", diff --git a/src/core/hle/service/hid/hidbus.h b/src/core/hle/service/hid/hidbus.h index 9ad097150e..19dd894ed3 100644 --- a/src/core/hle/service/hid/hidbus.h +++ b/src/core/hle/service/hid/hidbus.h @@ -147,8 +147,6 @@ private: } } - std::optional FindRequest(u32 key) override; - bool is_hidbus_enabled{false}; HidbusStatusManager hidbus_status{}; std::array devices{}; diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp index a17395b596..3d87e6788d 100644 --- a/src/core/hle/service/hid/irs.cpp +++ b/src/core/hle/service/hid/irs.cpp @@ -29,32 +29,32 @@ namespace Service::IRS { -std::optional IRS::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{302, C<&IRS::ActivateIrsensor>, "ActivateIrsensor"}, - FunctionInfo{303, C<&IRS::DeactivateIrsensor>, "DeactivateIrsensor"}, - FunctionInfo{304, C<&IRS::GetIrsensorSharedMemoryHandle>, "GetIrsensorSharedMemoryHandle"}, - FunctionInfo{305, C<&IRS::StopImageProcessor>, "StopImageProcessor"}, - FunctionInfo{306, C<&IRS::RunMomentProcessor>, "RunMomentProcessor"}, - FunctionInfo{307, C<&IRS::RunClusteringProcessor>, "RunClusteringProcessor"}, - FunctionInfo{308, C<&IRS::RunImageTransferProcessor>, "RunImageTransferProcessor"}, - FunctionInfo{309, C<&IRS::GetImageTransferProcessorState>, "GetImageTransferProcessorState"}, - FunctionInfo{310, C<&IRS::RunTeraPluginProcessor>, "RunTeraPluginProcessor"}, - FunctionInfo{311, C<&IRS::GetNpadIrCameraHandle>, "GetNpadIrCameraHandle"}, - FunctionInfo{312, C<&IRS::RunPointingProcessor>, "RunPointingProcessor"}, - FunctionInfo{313, C<&IRS::SuspendImageProcessor>, "SuspendImageProcessor"}, - FunctionInfo{314, C<&IRS::CheckFirmwareVersion>, "CheckFirmwareVersion"}, - FunctionInfo{315, C<&IRS::SetFunctionLevel>, "SetFunctionLevel"}, - FunctionInfo{316, C<&IRS::RunImageTransferExProcessor>, "RunImageTransferExProcessor"}, - FunctionInfo{317, C<&IRS::RunIrLedProcessor>, "RunIrLedProcessor"}, - FunctionInfo{318, C<&IRS::StopImageProcessorAsync>, "StopImageProcessorAsync"}, - FunctionInfo{319, C<&IRS::ActivateIrsensorWithFunctionLevel>, "ActivateIrsensorWithFunctionLevel"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IRS::IRS(Core::System& system_) : ServiceFramework{system_, "irs"} { + // clang-format off + static const FunctionInfo functions[] = { + {302, C<&IRS::ActivateIrsensor>, "ActivateIrsensor"}, + {303, C<&IRS::DeactivateIrsensor>, "DeactivateIrsensor"}, + {304, C<&IRS::GetIrsensorSharedMemoryHandle>, "GetIrsensorSharedMemoryHandle"}, + {305, C<&IRS::StopImageProcessor>, "StopImageProcessor"}, + {306, C<&IRS::RunMomentProcessor>, "RunMomentProcessor"}, + {307, C<&IRS::RunClusteringProcessor>, "RunClusteringProcessor"}, + {308, C<&IRS::RunImageTransferProcessor>, "RunImageTransferProcessor"}, + {309, C<&IRS::GetImageTransferProcessorState>, "GetImageTransferProcessorState"}, + {310, C<&IRS::RunTeraPluginProcessor>, "RunTeraPluginProcessor"}, + {311, C<&IRS::GetNpadIrCameraHandle>, "GetNpadIrCameraHandle"}, + {312, C<&IRS::RunPointingProcessor>, "RunPointingProcessor"}, + {313, C<&IRS::SuspendImageProcessor>, "SuspendImageProcessor"}, + {314, C<&IRS::CheckFirmwareVersion>, "CheckFirmwareVersion"}, + {315, C<&IRS::SetFunctionLevel>, "SetFunctionLevel"}, + {316, C<&IRS::RunImageTransferExProcessor>, "RunImageTransferExProcessor"}, + {317, C<&IRS::RunIrLedProcessor>, "RunIrLedProcessor"}, + {318, C<&IRS::StopImageProcessorAsync>, "StopImageProcessorAsync"}, + {319, C<&IRS::ActivateIrsensorWithFunctionLevel>, "ActivateIrsensorWithFunctionLevel"}, + }; + // clang-format on + u8* raw_shared_memory = system.Kernel().GetIrsSharedMem().GetPointer(); + RegisterHandlers(functions); shared_memory = std::construct_at(reinterpret_cast(raw_shared_memory)); npad_device = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); @@ -369,6 +369,16 @@ Core::IrSensor::DeviceFormat& IRS::GetIrCameraSharedMemoryDeviceEntry( } IRS_SYS::IRS_SYS(Core::System& system_) : ServiceFramework{system_, "irs:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {500, nullptr, "SetAppletResourceUserId"}, + {501, nullptr, "RegisterAppletResourceUserId"}, + {502, nullptr, "UnregisterAppletResourceUserId"}, + {503, nullptr, "EnableAppletToGetInput"}, + }; + // clang-format on + + RegisterHandlers(functions); } IRS_SYS::~IRS_SYS() = default; diff --git a/src/core/hle/service/hid/irs.h b/src/core/hle/service/hid/irs.h index be81ea75a9..2ca34b9106 100644 --- a/src/core/hle/service/hid/irs.h +++ b/src/core/hle/service/hid/irs.h @@ -157,8 +157,6 @@ private: return static_cast(*processors[index]); } - std::optional FindRequest(u32 key) override; - Core::HID::EmulatedController* npad_device = nullptr; StatusManager* shared_memory = nullptr; std::array, 9> processors{}; @@ -168,16 +166,6 @@ class IRS_SYS final : public ServiceFramework { public: explicit IRS_SYS(Core::System& system); ~IRS_SYS() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{500, nullptr, "SetAppletResourceUserId"}, - FunctionInfo{501, nullptr, "RegisterAppletResourceUserId"}, - FunctionInfo{502, nullptr, "UnregisterAppletResourceUserId"}, - FunctionInfo{503, nullptr, "EnableAppletToGetInput"} - ); }; } // namespace Service::IRS diff --git a/src/core/hle/service/hid/xcd.cpp b/src/core/hle/service/hid/xcd.cpp index 6b8ae7048c..2e41cbd3da 100644 --- a/src/core/hle/service/hid/xcd.cpp +++ b/src/core/hle/service/hid/xcd.cpp @@ -9,6 +9,33 @@ namespace Service::HID { XCD_SYS::XCD_SYS(Core::System& system_) : ServiceFramework{system_, "xcd:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetDataFormat"}, + {1, nullptr, "SetDataFormat"}, + {2, nullptr, "GetMcuState"}, + {3, nullptr, "SetMcuState"}, + {4, nullptr, "GetMcuVersionForNfc"}, + {5, nullptr, "CheckNfcDevicePower"}, + {10, nullptr, "SetNfcEvent"}, + {11, nullptr, "GetNfcInfo"}, + {12, nullptr, "StartNfcDiscovery"}, + {13, nullptr, "StopNfcDiscovery"}, + {14, nullptr, "StartNtagRead"}, + {15, nullptr, "StartNtagWrite"}, + {16, nullptr, "SendNfcRawData"}, + {17, nullptr, "RegisterMifareKey"}, + {18, nullptr, "ClearMifareKey"}, + {19, nullptr, "StartMifareRead"}, + {20, nullptr, "StartMifareWrite"}, + {101, nullptr, "GetAwakeTriggerReasonForLeftRail"}, + {102, nullptr, "GetAwakeTriggerReasonForRightRail"}, + {103, nullptr, "GetAwakeTriggerBatteryLevelTransitionForLeftRail"}, + {104, nullptr, "GetAwakeTriggerBatteryLevelTransitionForRightRail"}, + }; + // clang-format on + + RegisterHandlers(functions); } XCD_SYS::~XCD_SYS() = default; diff --git a/src/core/hle/service/hid/xcd.h b/src/core/hle/service/hid/xcd.h index af1dd88ef7..9000110a9a 100644 --- a/src/core/hle/service/hid/xcd.h +++ b/src/core/hle/service/hid/xcd.h @@ -18,33 +18,6 @@ class XCD_SYS final : public ServiceFramework { public: explicit XCD_SYS(Core::System& system_); ~XCD_SYS() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetDataFormat"}, - FunctionInfo{1, nullptr, "SetDataFormat"}, - FunctionInfo{2, nullptr, "GetMcuState"}, - FunctionInfo{3, nullptr, "SetMcuState"}, - FunctionInfo{4, nullptr, "GetMcuVersionForNfc"}, - FunctionInfo{5, nullptr, "CheckNfcDevicePower"}, - FunctionInfo{10, nullptr, "SetNfcEvent"}, - FunctionInfo{11, nullptr, "GetNfcInfo"}, - FunctionInfo{12, nullptr, "StartNfcDiscovery"}, - FunctionInfo{13, nullptr, "StopNfcDiscovery"}, - FunctionInfo{14, nullptr, "StartNtagRead"}, - FunctionInfo{15, nullptr, "StartNtagWrite"}, - FunctionInfo{16, nullptr, "SendNfcRawData"}, - FunctionInfo{17, nullptr, "RegisterMifareKey"}, - FunctionInfo{18, nullptr, "ClearMifareKey"}, - FunctionInfo{19, nullptr, "StartMifareRead"}, - FunctionInfo{20, nullptr, "StartMifareWrite"}, - FunctionInfo{101, nullptr, "GetAwakeTriggerReasonForLeftRail"}, - FunctionInfo{102, nullptr, "GetAwakeTriggerReasonForRightRail"}, - FunctionInfo{103, nullptr, "GetAwakeTriggerBatteryLevelTransitionForLeftRail"}, - FunctionInfo{104, nullptr, "GetAwakeTriggerBatteryLevelTransitionForRightRail"} - ); }; } // namespace Service::HID diff --git a/src/core/hle/service/i2c/i2c.cpp b/src/core/hle/service/i2c/i2c.cpp index d0a5e29f8c..0b242768c2 100644 --- a/src/core/hle/service/i2c/i2c.cpp +++ b/src/core/hle/service/i2c/i2c.cpp @@ -17,26 +17,25 @@ namespace Service::I2C { class I2CSession final : public ServiceFramework { public: - explicit I2CSession(Core::System& system_) : ServiceFramework{system_, "I2CSession"} {} + explicit I2CSession(Core::System& system_) + : ServiceFramework{system_, "I2CSession"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "SendOld"}, + {1, nullptr, "ReceiveOld"}, + {2, nullptr, "ExecuteCommandListOld"}, + {10, C<&I2CSession::Send>, "Send"}, + {11, nullptr, "Receive"}, + {12, nullptr, "ExecuteCommandList"}, + {13, nullptr, "SetRetryPolicy"}, + }; + RegisterHandlers(functions); + } ~I2CSession() override = default; - Result Send(InBuffer in_data, u32 transaction_option) { LOG_WARNING(Service, "(stubbed) topt={}", transaction_option); R_THROW(ResultUnknown); } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SendOld"}, - FunctionInfo{1, nullptr, "ReceiveOld"}, - FunctionInfo{2, nullptr, "ExecuteCommandListOld"}, - FunctionInfo{10, C<&I2CSession::Send>, "Send"}, - FunctionInfo{11, nullptr, "Receive"}, - FunctionInfo{12, nullptr, "ExecuteCommandList"}, - FunctionInfo{13, nullptr, "SetRetryPolicy"} - ); }; enum class I2CDevice : u32 { @@ -46,9 +45,19 @@ enum class I2CDevice : u32 { class I2C final : public ServiceFramework { public: - explicit I2C(Core::System& system_) : ServiceFramework{system_, "i2c"} {} + explicit I2C(Core::System& system_) + : ServiceFramework{system_, "i2c"} + { + static const FunctionInfo functions[] = { + {0, C<&I2C::OpenSessionForDev>, "OpenSessionForDev"}, + {1, C<&I2C::OpenSession>, "OpenSession"}, + {2, C<&I2C::HasDevice>, "HasDevice"}, + {3, C<&I2C::HasDeviceForDev>, "HasDeviceForDev"}, + {4, C<&I2C::OpenSession2>, "OpenSession2"}, + }; + RegisterHandlers(functions); + } ~I2C() override = default; - Result OpenSessionForDev(OutInterface out_session, s32 bus_idx, u32 slave_address, u32 addressing_mode, u32 speed_mode) { LOG_DEBUG(Service, "(stubbed)"); *out_session = std::make_shared(system); @@ -74,17 +83,6 @@ public: *out_session = std::make_shared(system); R_SUCCEED(); } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&I2C::OpenSessionForDev>, "OpenSessionForDev"}, - FunctionInfo{1, C<&I2C::OpenSession>, "OpenSession"}, - FunctionInfo{2, C<&I2C::HasDevice>, "HasDevice"}, - FunctionInfo{3, C<&I2C::HasDeviceForDev>, "HasDeviceForDev"}, - FunctionInfo{4, C<&I2C::OpenSession2>, "OpenSession2"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/jit/jit.cpp b/src/core/hle/service/jit/jit.cpp index 9059aaf518..ec3a3a8dcb 100644 --- a/src/core/hle/service/jit/jit.cpp +++ b/src/core/hle/service/jit/jit.cpp @@ -37,6 +37,18 @@ public: , user_ro{std::move(user_ro_)} , context{process_->GetMemory()} { + + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&IJitEnvironment::GenerateCode>, "GenerateCode"}, + {1, C<&IJitEnvironment::Control>, "Control"}, + {1000, C<&IJitEnvironment::LoadPlugin>, "LoadPlugin"}, + {1001, C<&IJitEnvironment::GetCodeAddress>, "GetCodeAddress"}, + }; + // clang-format on + + RegisterHandlers(functions); + // Identity map user code range into sysmodule context configuration.user_rx_memory.size = user_rx.GetSize(); configuration.user_rx_memory.offset = user_rx.GetAddress(); @@ -47,10 +59,6 @@ public: configuration.sys_ro_memory = configuration.user_ro_memory; } - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - ~IJitEnvironment() { user_rx.Finalize(system.Kernel()); user_ro.Finalize(system.Kernel()); @@ -240,13 +248,6 @@ private: return in; } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IJitEnvironment::GenerateCode>, "GenerateCode"}, - FunctionInfo{1, C<&IJitEnvironment::Control>, "Control"}, - FunctionInfo{1000, C<&IJitEnvironment::LoadPlugin>, "LoadPlugin"}, - FunctionInfo{1001, C<&IJitEnvironment::GetCodeAddress>, "GetCodeAddress"} - ); - Kernel::KScopedAutoObject process; CodeMemory user_rx; CodeMemory user_ro; @@ -257,10 +258,14 @@ private: class JITU final : public ServiceFramework { public: - explicit JITU(Core::System& system_) : ServiceFramework{system_, "jit:u"} {} + explicit JITU(Core::System& system_) : ServiceFramework{system_, "jit:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&JITU::CreateJitEnvironment>, "CreateJitEnvironment"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -289,10 +294,6 @@ private: } private: - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&JITU::CreateJitEnvironment>, "CreateJitEnvironment"} - ); - std::mt19937_64 generate_random{}; }; diff --git a/src/core/hle/service/jit/jit.h b/src/core/hle/service/jit/jit.h index 19014c75a4..a9ebf146ec 100644 --- a/src/core/hle/service/jit/jit.h +++ b/src/core/hle/service/jit/jit.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/jit/jit_context.h b/src/core/hle/service/jit/jit_context.h index f17fc5e244..aa9a2d3589 100644 --- a/src/core/hle/service/jit/jit_context.h +++ b/src/core/hle/service/jit/jit_context.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp index 9b245201ff..68a9bff2df 100644 --- a/src/core/hle/service/lbl/lbl.cpp +++ b/src/core/hle/service/lbl/lbl.cpp @@ -18,10 +18,43 @@ namespace Service::LBL { class LBL final : public ServiceFramework { public: - explicit LBL(Core::System& system_) : ServiceFramework{system_, "lbl"} {} + explicit LBL(Core::System& system_) : ServiceFramework{system_, "lbl"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &LBL::SaveCurrentSetting, "SaveCurrentSetting"}, + {1, &LBL::LoadCurrentSetting, "LoadCurrentSetting"}, + {2, &LBL::SetCurrentBrightnessSetting, "SetCurrentBrightnessSetting"}, + {3, &LBL::GetCurrentBrightnessSetting, "GetCurrentBrightnessSetting"}, + {4, nullptr, "ApplyCurrentBrightnessSettingToBacklight"}, + {5, nullptr, "GetBrightnessSettingAppliedToBacklight"}, + {6, &LBL::SwitchBacklightOn, "SwitchBacklightOn"}, + {7, &LBL::SwitchBacklightOff, "SwitchBacklightOff"}, + {8, &LBL::GetBacklightSwitchStatus, "GetBacklightSwitchStatus"}, + {9, &LBL::EnableDimming, "EnableDimming"}, + {10, &LBL::DisableDimming, "DisableDimming"}, + {11, &LBL::IsDimmingEnabled, "IsDimmingEnabled"}, + {12, &LBL::EnableAutoBrightnessControl, "EnableAutoBrightnessControl"}, + {13, &LBL::DisableAutoBrightnessControl, "DisableAutoBrightnessControl"}, + {14, &LBL::IsAutoBrightnessControlEnabled, "IsAutoBrightnessControlEnabled"}, + {15, &LBL::SetAmbientLightSensorValue, "SetAmbientLightSensorValue"}, + {16, &LBL::GetAmbientLightSensorValue, "GetAmbientLightSensorValue"}, + {17, &LBL::SetBrightnessReflectionDelayLevel, "SetBrightnessReflectionDelayLevel"}, + {18, &LBL::GetBrightnessReflectionDelayLevel, "GetBrightnessReflectionDelayLevel"}, + {19, &LBL::SetCurrentBrightnessMapping, "SetCurrentBrightnessMapping"}, + {20, &LBL::GetCurrentBrightnessMapping, "GetCurrentBrightnessMapping"}, + {21, &LBL::SetCurrentAmbientLightSensorMapping, "SetCurrentAmbientLightSensorMapping"}, + {22, &LBL::GetCurrentAmbientLightSensorMapping, "GetCurrentAmbientLightSensorMapping"}, + {23, &LBL::IsAmbientLightSensorAvailable, "IsAmbientLightSensorAvailable"}, + {24, &LBL::SetCurrentBrightnessSettingForVrMode, "SetCurrentBrightnessSettingForVrMode"}, + {25, &LBL::GetCurrentBrightnessSettingForVrMode, "GetCurrentBrightnessSettingForVrMode"}, + {26, &LBL::EnableVrMode, "EnableVrMode"}, + {27, &LBL::DisableVrMode, "DisableVrMode"}, + {28, &LBL::IsVrModeEnabled, "IsVrModeEnabled"}, + {29, &LBL::IsAutoBrightnessControlSupported, "IsAutoBrightnessControlSupported"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -302,38 +335,6 @@ private: rb.Push(auto_brightness_supported); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &LBL::SaveCurrentSetting, "SaveCurrentSetting"}, - FunctionInfo{1, &LBL::LoadCurrentSetting, "LoadCurrentSetting"}, - FunctionInfo{2, &LBL::SetCurrentBrightnessSetting, "SetCurrentBrightnessSetting"}, - FunctionInfo{3, &LBL::GetCurrentBrightnessSetting, "GetCurrentBrightnessSetting"}, - FunctionInfo{4, nullptr, "ApplyCurrentBrightnessSettingToBacklight"}, - FunctionInfo{5, nullptr, "GetBrightnessSettingAppliedToBacklight"}, - FunctionInfo{6, &LBL::SwitchBacklightOn, "SwitchBacklightOn"}, - FunctionInfo{7, &LBL::SwitchBacklightOff, "SwitchBacklightOff"}, - FunctionInfo{8, &LBL::GetBacklightSwitchStatus, "GetBacklightSwitchStatus"}, - FunctionInfo{9, &LBL::EnableDimming, "EnableDimming"}, - FunctionInfo{10, &LBL::DisableDimming, "DisableDimming"}, - FunctionInfo{11, &LBL::IsDimmingEnabled, "IsDimmingEnabled"}, - FunctionInfo{12, &LBL::EnableAutoBrightnessControl, "EnableAutoBrightnessControl"}, - FunctionInfo{13, &LBL::DisableAutoBrightnessControl, "DisableAutoBrightnessControl"}, - FunctionInfo{14, &LBL::IsAutoBrightnessControlEnabled, "IsAutoBrightnessControlEnabled"}, - FunctionInfo{15, &LBL::SetAmbientLightSensorValue, "SetAmbientLightSensorValue"}, - FunctionInfo{16, &LBL::GetAmbientLightSensorValue, "GetAmbientLightSensorValue"}, - FunctionInfo{17, &LBL::SetBrightnessReflectionDelayLevel, "SetBrightnessReflectionDelayLevel"}, - FunctionInfo{18, &LBL::GetBrightnessReflectionDelayLevel, "GetBrightnessReflectionDelayLevel"}, - FunctionInfo{19, &LBL::SetCurrentBrightnessMapping, "SetCurrentBrightnessMapping"}, - FunctionInfo{20, &LBL::GetCurrentBrightnessMapping, "GetCurrentBrightnessMapping"}, - FunctionInfo{21, &LBL::SetCurrentAmbientLightSensorMapping, "SetCurrentAmbientLightSensorMapping"}, - FunctionInfo{22, &LBL::GetCurrentAmbientLightSensorMapping, "GetCurrentAmbientLightSensorMapping"}, - FunctionInfo{23, &LBL::IsAmbientLightSensorAvailable, "IsAmbientLightSensorAvailable"}, - FunctionInfo{24, &LBL::SetCurrentBrightnessSettingForVrMode, "SetCurrentBrightnessSettingForVrMode"}, - FunctionInfo{25, &LBL::GetCurrentBrightnessSettingForVrMode, "GetCurrentBrightnessSettingForVrMode"}, - FunctionInfo{26, &LBL::EnableVrMode, "EnableVrMode"}, - FunctionInfo{27, &LBL::DisableVrMode, "DisableVrMode"}, - FunctionInfo{28, &LBL::IsVrModeEnabled, "IsVrModeEnabled"}, - FunctionInfo{29, &LBL::IsAutoBrightnessControlSupported, "IsAutoBrightnessControlSupported"} - ); bool vr_mode_enabled = false; float current_brightness = 1.0f; float ambient_light_value = 0.0f; diff --git a/src/core/hle/service/lbl/lbl.h b/src/core/hle/service/lbl/lbl.h index e47759c01c..e2cd1b3980 100644 --- a/src/core/hle/service/lbl/lbl.h +++ b/src/core/hle/service/lbl/lbl.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ldn/lan_discovery.cpp b/src/core/hle/service/ldn/lan_discovery.cpp index f37dbe492f..90adcdcee4 100644 --- a/src/core/hle/service/ldn/lan_discovery.cpp +++ b/src/core/hle/service/ldn/lan_discovery.cpp @@ -1,5 +1,6 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ldn/lan_discovery.h b/src/core/hle/service/ldn/lan_discovery.h index 5d0642bd0f..f1f3c4bece 100644 --- a/src/core/hle/service/ldn/lan_discovery.h +++ b/src/core/hle/service/ldn/lan_discovery.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp index 838fe85f79..1a0165fd2e 100644 --- a/src/core/hle/service/ldn/ldn.cpp +++ b/src/core/hle/service/ldn/ldn.cpp @@ -9,6 +9,7 @@ #include "core/hle/service/ldn/ldn.h" #include "core/hle/service/ldn/monitor_service.h" #include "core/hle/service/ldn/sf_monitor_service.h" +#include "core/hle/service/ldn/sf_service.h" #include "core/hle/service/ldn/sf_service_monitor.h" #include "core/hle/service/ldn/system_local_communication_service.h" #include "core/hle/service/ldn/user_local_communication_service.h" @@ -18,10 +19,14 @@ namespace Service::LDN { class IClientProcessMonitor final : public ServiceFramework { public: - explicit IClientProcessMonitor(Core::System& system_) : ServiceFramework{system_, "IClientProcessMonitor"} {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit IClientProcessMonitor(Core::System& system_) + : ServiceFramework{system_, "IClientProcessMonitor"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IClientProcessMonitor::RegisterClient>, "RegisterClient"}, + }; + // clang-format on + RegisterHandlers(functions); } ~IClientProcessMonitor() override = default; private: @@ -29,19 +34,19 @@ private: LOG_WARNING(Service_LDN, "(STUBBED) called"); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IClientProcessMonitor::RegisterClient>, "RegisterClient"} - ); }; class IMonitorServiceCreator final : public ServiceFramework { public: - explicit IMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:m"} {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit IMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:m"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&IMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"} + }; + // clang-format on + RegisterHandlers(functions); } + private: Result CreateMonitorService(OutInterface out_interface) { LOG_DEBUG(Service_LDN, "called"); @@ -49,19 +54,21 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"} - ); }; class ISystemServiceCreator final : public ServiceFramework { public: - explicit ISystemServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:s"} {} + explicit ISystemServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:s"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&ISystemServiceCreator::CreateSystemLocalCommunicationService>, "CreateSystemLocalCommunicationService"}, + {1, C<&ISystemServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor"} // 18.0.0+ + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } + private: Result CreateSystemLocalCommunicationService( OutInterface out_interface) { @@ -78,20 +85,21 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&ISystemServiceCreator::CreateSystemLocalCommunicationService>, "CreateSystemLocalCommunicationService"}, - FunctionInfo{1, C<&ISystemServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor", MakeVersionGate({18,0,0})} - ); }; class IUserServiceCreator final : public ServiceFramework { public: - explicit IUserServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:u"} {} + explicit IUserServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IUserServiceCreator::CreateUserLocalCommunicationService>, "CreateUserLocalCommunicationService"}, + {1, D<&IUserServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor"} // 18.0.0+ + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } + private: Result CreateUserLocalCommunicationService( OutInterface out_interface) { @@ -108,50 +116,22 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IUserServiceCreator::CreateUserLocalCommunicationService>, "CreateUserLocalCommunicationService"}, - FunctionInfo{1, D<&IUserServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor", MakeVersionGate({18,0,0})} - ); -}; - -class ISfService final : public ServiceFramework { -public: - explicit ISfService(Core::System& system_) : ServiceFramework{system_, "ISfService"} {} - ~ISfService() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, - FunctionInfo{264, nullptr, "GetNetworkInterfaceLastError"}, - FunctionInfo{272, nullptr, "GetRole"}, - FunctionInfo{280, nullptr, "GetAdvertiseData"}, - FunctionInfo{288, nullptr, "GetGroupInfo"}, - FunctionInfo{296, nullptr, "GetGroupInfo2"}, - FunctionInfo{304, nullptr, "GetGroupOwner"}, - FunctionInfo{312, nullptr, "GetIpConfig"}, - FunctionInfo{320, nullptr, "GetLinkLevel"}, - FunctionInfo{512, nullptr, "Scan"}, - FunctionInfo{768, nullptr, "CreateGroup"}, - FunctionInfo{776, nullptr, "DestroyGroup"}, - FunctionInfo{784, nullptr, "SetAdvertiseData"}, - FunctionInfo{1536, nullptr, "SendToOtherGroup"}, - FunctionInfo{1544, nullptr, "RecvFromOtherGroup"}, - FunctionInfo{1552, nullptr, "AddAcceptableGroupId"}, - FunctionInfo{1560, nullptr, "ClearAcceptableGroupId"} - ); }; class ISfServiceCreator final : public ServiceFramework { public: - explicit ISfServiceCreator(Core::System& system_, bool is_system_, const char* name_) : ServiceFramework{system_, name_}, is_system{is_system_} {} + explicit ISfServiceCreator(Core::System& system_, bool is_system_, const char* name_) + : ServiceFramework{system_, name_}, is_system{is_system_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&ISfServiceCreator::CreateNetworkService>, "CreateNetworkService"}, + {8, C<&ISfServiceCreator::CreateNetworkServiceMonitor>, "CreateNetworkServiceMonitor"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } + private: Result CreateNetworkService(OutInterface out_interface, u32 input, u64 reserved_input) { @@ -170,20 +150,21 @@ private: R_SUCCEED(); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&ISfServiceCreator::CreateNetworkService>, "CreateNetworkService"}, - FunctionInfo{8, C<&ISfServiceCreator::CreateNetworkServiceMonitor>, "CreateNetworkServiceMonitor"} - ); bool is_system{}; }; class ISfMonitorServiceCreator final : public ServiceFramework { public: - explicit ISfMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "lp2p:m"} {} + explicit ISfMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "lp2p:m"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&ISfMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } + private: Result CreateMonitorService(OutInterface out_interface, u64 reserved_input) { LOG_INFO(Service_LDN, "called, reserved_input={}", reserved_input); @@ -191,10 +172,6 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&ISfMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"} - ); }; void LoopProcess(Core::System& system) { @@ -204,9 +181,12 @@ void LoopProcess(Core::System& system) { server_manager->RegisterNamedService("ldn:s", std::make_shared(system)); server_manager->RegisterNamedService("ldn:u", std::make_shared(system)); - server_manager->RegisterNamedService("lp2p:app", std::make_shared(system, false, "lp2p:app")); - server_manager->RegisterNamedService("lp2p:sys", std::make_shared(system, true, "lp2p:sys")); - server_manager->RegisterNamedService("lp2p:m", std::make_shared(system)); + server_manager->RegisterNamedService( + "lp2p:app", std::make_shared(system, false, "lp2p:app")); + server_manager->RegisterNamedService( + "lp2p:sys", std::make_shared(system, true, "lp2p:sys")); + server_manager->RegisterNamedService("lp2p:m", + std::make_shared(system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/ldn/ldn.h b/src/core/hle/service/ldn/ldn.h index dae037fa8f..76c7f4f439 100644 --- a/src/core/hle/service/ldn/ldn.h +++ b/src/core/hle/service/ldn/ldn.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ldn/ldn_results.h b/src/core/hle/service/ldn/ldn_results.h index f340bda422..cf6c22b54b 100644 --- a/src/core/hle/service/ldn/ldn_results.h +++ b/src/core/hle/service/ldn/ldn_results.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/ldn/monitor_service.cpp b/src/core/hle/service/ldn/monitor_service.cpp index 6a60b0b3d8..6cb7180b15 100644 --- a/src/core/hle/service/ldn/monitor_service.cpp +++ b/src/core/hle/service/ldn/monitor_service.cpp @@ -10,22 +10,22 @@ namespace Service::LDN { -std::optional IMonitorService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IMonitorService::GetStateForMonitor>, "GetStateForMonitor"}, - FunctionInfo{1, nullptr, "GetNetworkInfoForMonitor"}, - FunctionInfo{2, nullptr, "GetIpv4AddressForMonitor"}, - FunctionInfo{3, nullptr, "GetDisconnectReasonForMonitor"}, - FunctionInfo{4, nullptr, "GetSecurityParameterForMonitor"}, - FunctionInfo{5, nullptr, "GetNetworkConfigForMonitor"}, - FunctionInfo{100, C<&IMonitorService::InitializeMonitor>, "InitializeMonitor"}, - FunctionInfo{101, C<&IMonitorService::FinalizeMonitor>, "FinalizeMonitor"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IMonitorService::IMonitorService(Core::System& system_) : ServiceFramework{system_, "IMonitorService"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&IMonitorService::GetStateForMonitor>, "GetStateForMonitor"}, + {1, nullptr, "GetNetworkInfoForMonitor"}, + {2, nullptr, "GetIpv4AddressForMonitor"}, + {3, nullptr, "GetDisconnectReasonForMonitor"}, + {4, nullptr, "GetSecurityParameterForMonitor"}, + {5, nullptr, "GetNetworkConfigForMonitor"}, + {100, C<&IMonitorService::InitializeMonitor>, "InitializeMonitor"}, + {101, C<&IMonitorService::FinalizeMonitor>, "FinalizeMonitor"}, + }; + // clang-format on + + RegisterHandlers(functions); } IMonitorService::~IMonitorService() = default; diff --git a/src/core/hle/service/ldn/monitor_service.h b/src/core/hle/service/ldn/monitor_service.h index 9c1acd0a1e..2d4a69c311 100644 --- a/src/core/hle/service/ldn/monitor_service.h +++ b/src/core/hle/service/ldn/monitor_service.h @@ -26,7 +26,6 @@ private: Result InitializeMonitor(); Result FinalizeMonitor(); - std::optional FindRequest(u32 key) override; State state{State::None}; }; diff --git a/src/core/hle/service/ldn/sf_monitor_service.cpp b/src/core/hle/service/ldn/sf_monitor_service.cpp index ebe06b2059..5ac663b4c2 100644 --- a/src/core/hle/service/ldn/sf_monitor_service.cpp +++ b/src/core/hle/service/ldn/sf_monitor_service.cpp @@ -10,17 +10,17 @@ namespace Service::LDN { -std::optional ISfMonitorService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&ISfMonitorService::Initialize>, "Initialize"}, - FunctionInfo{288, C<&ISfMonitorService::GetGroupInfo>, "GetGroupInfo"}, - FunctionInfo{320, nullptr, "GetLinkLevel"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - ISfMonitorService::ISfMonitorService(Core::System& system_) : ServiceFramework{system_, "ISfMonitorService"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&ISfMonitorService::Initialize>, "Initialize"}, + {288, C<&ISfMonitorService::GetGroupInfo>, "GetGroupInfo"}, + {320, nullptr, "GetLinkLevel"}, + }; + // clang-format on + + RegisterHandlers(functions); } ISfMonitorService::~ISfMonitorService() = default; diff --git a/src/core/hle/service/ldn/sf_monitor_service.h b/src/core/hle/service/ldn/sf_monitor_service.h index 09ca16727d..a596093f1b 100644 --- a/src/core/hle/service/ldn/sf_monitor_service.h +++ b/src/core/hle/service/ldn/sf_monitor_service.h @@ -24,7 +24,6 @@ public: private: Result Initialize(Out out_value); Result GetGroupInfo(OutLargeData out_group_info); - std::optional FindRequest(u32 key) override; }; } // namespace Service::LDN diff --git a/src/core/hle/service/ldn/sf_service.cpp b/src/core/hle/service/ldn/sf_service.cpp new file mode 100644 index 0000000000..b77672a1b6 --- /dev/null +++ b/src/core/hle/service/ldn/sf_service.cpp @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "core/hle/service/ldn/sf_service.h" + +namespace Service::LDN { + +ISfService::ISfService(Core::System& system_) : ServiceFramework{system_, "ISfService"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, + {264, nullptr, "GetNetworkInterfaceLastError"}, + {272, nullptr, "GetRole"}, + {280, nullptr, "GetAdvertiseData"}, + {288, nullptr, "GetGroupInfo"}, + {296, nullptr, "GetGroupInfo2"}, + {304, nullptr, "GetGroupOwner"}, + {312, nullptr, "GetIpConfig"}, + {320, nullptr, "GetLinkLevel"}, + {512, nullptr, "Scan"}, + {768, nullptr, "CreateGroup"}, + {776, nullptr, "DestroyGroup"}, + {784, nullptr, "SetAdvertiseData"}, + {1536, nullptr, "SendToOtherGroup"}, + {1544, nullptr, "RecvFromOtherGroup"}, + {1552, nullptr, "AddAcceptableGroupId"}, + {1560, nullptr, "ClearAcceptableGroupId"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +ISfService::~ISfService() = default; + +} // namespace Service::LDN diff --git a/src/core/hle/service/ldn/sf_service.h b/src/core/hle/service/ldn/sf_service.h new file mode 100644 index 0000000000..ca7a81cf29 --- /dev/null +++ b/src/core/hle/service/ldn/sf_service.h @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::LDN { + +class ISfService final : public ServiceFramework { +public: + explicit ISfService(Core::System& system_); + ~ISfService() override; +}; + +} // namespace Service::LDN diff --git a/src/core/hle/service/ldn/sf_service_monitor.cpp b/src/core/hle/service/ldn/sf_service_monitor.cpp index 574ba82a0b..95a9bcaf71 100644 --- a/src/core/hle/service/ldn/sf_service_monitor.cpp +++ b/src/core/hle/service/ldn/sf_service_monitor.cpp @@ -10,27 +10,27 @@ namespace Service::LDN { -std::optional ISfServiceMonitor::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&ISfServiceMonitor::Initialize>, "Initialize"}, - FunctionInfo{256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, - FunctionInfo{264, nullptr, "GetNetworkInterfaceLastError"}, - FunctionInfo{272, nullptr, "GetRole"}, - FunctionInfo{280, nullptr, "GetAdvertiseData"}, - FunctionInfo{281, nullptr, "GetAdvertiseData2"}, - FunctionInfo{288, C<&ISfServiceMonitor::GetGroupInfo>, "GetGroupInfo"}, - FunctionInfo{296, nullptr, "GetGroupInfo2"}, - FunctionInfo{304, nullptr, "GetGroupOwner"}, - FunctionInfo{312, nullptr, "GetIpConfig"}, - FunctionInfo{320, nullptr, "GetLinkLevel"}, - FunctionInfo{328, nullptr, "AttachJoinEvent"}, - FunctionInfo{336, nullptr, "GetMembers"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - ISfServiceMonitor::ISfServiceMonitor(Core::System& system_) : ServiceFramework{system_, "ISfServiceMonitor"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&ISfServiceMonitor::Initialize>, "Initialize"}, + {256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, + {264, nullptr, "GetNetworkInterfaceLastError"}, + {272, nullptr, "GetRole"}, + {280, nullptr, "GetAdvertiseData"}, + {281, nullptr, "GetAdvertiseData2"}, + {288, C<&ISfServiceMonitor::GetGroupInfo>, "GetGroupInfo"}, + {296, nullptr, "GetGroupInfo2"}, + {304, nullptr, "GetGroupOwner"}, + {312, nullptr, "GetIpConfig"}, + {320, nullptr, "GetLinkLevel"}, + {328, nullptr, "AttachJoinEvent"}, + {336, nullptr, "GetMembers"}, + }; + // clang-format on + + RegisterHandlers(functions); } ISfServiceMonitor::~ISfServiceMonitor() = default; diff --git a/src/core/hle/service/ldn/sf_service_monitor.h b/src/core/hle/service/ldn/sf_service_monitor.h index 5e5e64ae6c..87854b868d 100644 --- a/src/core/hle/service/ldn/sf_service_monitor.h +++ b/src/core/hle/service/ldn/sf_service_monitor.h @@ -23,8 +23,8 @@ public: private: Result Initialize(Out out_value); - Result GetGroupInfo(OutLargeData out_group_info, GroupInfo in_group_info); - std::optional FindRequest(u32 key) override; + Result GetGroupInfo(OutLargeData out_group_info, + GroupInfo in_group_info); }; } // namespace Service::LDN diff --git a/src/core/hle/service/ldn/system_local_communication_service.cpp b/src/core/hle/service/ldn/system_local_communication_service.cpp index 9d3d49aac4..57a1c6a6c2 100644 --- a/src/core/hle/service/ldn/system_local_communication_service.cpp +++ b/src/core/hle/service/ldn/system_local_communication_service.cpp @@ -9,44 +9,44 @@ namespace Service::LDN { -std::optional ISystemLocalCommunicationService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetState"}, - FunctionInfo{1, nullptr, "GetNetworkInfo"}, - FunctionInfo{2, nullptr, "GetIpv4Address"}, - FunctionInfo{3, nullptr, "GetDisconnectReason"}, - FunctionInfo{4, nullptr, "GetSecurityParameter"}, - FunctionInfo{5, nullptr, "GetNetworkConfig"}, - FunctionInfo{100, nullptr, "AttachStateChangeEvent"}, - FunctionInfo{101, nullptr, "GetNetworkInfoLatestUpdate"}, - FunctionInfo{102, nullptr, "Scan"}, - FunctionInfo{103, nullptr, "ScanPrivate"}, - FunctionInfo{104, nullptr, "SetWirelessControllerRestriction"}, - FunctionInfo{200, nullptr, "OpenAccessPoint"}, - FunctionInfo{201, nullptr, "CloseAccessPoint"}, - FunctionInfo{202, nullptr, "CreateNetwork"}, - FunctionInfo{203, nullptr, "CreateNetworkPrivate"}, - FunctionInfo{204, nullptr, "DestroyNetwork"}, - FunctionInfo{205, nullptr, "Reject"}, - FunctionInfo{206, nullptr, "SetAdvertiseData"}, - FunctionInfo{207, nullptr, "SetStationAcceptPolicy"}, - FunctionInfo{208, nullptr, "AddAcceptFilterEntry"}, - FunctionInfo{209, nullptr, "ClearAcceptFilter"}, - FunctionInfo{300, nullptr, "OpenStation"}, - FunctionInfo{301, nullptr, "CloseStation"}, - FunctionInfo{302, nullptr, "Connect"}, - FunctionInfo{303, nullptr, "ConnectPrivate"}, - FunctionInfo{304, nullptr, "Disconnect"}, - FunctionInfo{400, nullptr, "InitializeSystem"}, - FunctionInfo{401, nullptr, "FinalizeSystem"}, - FunctionInfo{402, nullptr, "SetOperationMode"}, - FunctionInfo{403, C<&ISystemLocalCommunicationService::InitializeSystem2>, "InitializeSystem2"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - ISystemLocalCommunicationService::ISystemLocalCommunicationService(Core::System& system_) : ServiceFramework{system_, "ISystemLocalCommunicationService"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetState"}, + {1, nullptr, "GetNetworkInfo"}, + {2, nullptr, "GetIpv4Address"}, + {3, nullptr, "GetDisconnectReason"}, + {4, nullptr, "GetSecurityParameter"}, + {5, nullptr, "GetNetworkConfig"}, + {100, nullptr, "AttachStateChangeEvent"}, + {101, nullptr, "GetNetworkInfoLatestUpdate"}, + {102, nullptr, "Scan"}, + {103, nullptr, "ScanPrivate"}, + {104, nullptr, "SetWirelessControllerRestriction"}, + {200, nullptr, "OpenAccessPoint"}, + {201, nullptr, "CloseAccessPoint"}, + {202, nullptr, "CreateNetwork"}, + {203, nullptr, "CreateNetworkPrivate"}, + {204, nullptr, "DestroyNetwork"}, + {205, nullptr, "Reject"}, + {206, nullptr, "SetAdvertiseData"}, + {207, nullptr, "SetStationAcceptPolicy"}, + {208, nullptr, "AddAcceptFilterEntry"}, + {209, nullptr, "ClearAcceptFilter"}, + {300, nullptr, "OpenStation"}, + {301, nullptr, "CloseStation"}, + {302, nullptr, "Connect"}, + {303, nullptr, "ConnectPrivate"}, + {304, nullptr, "Disconnect"}, + {400, nullptr, "InitializeSystem"}, + {401, nullptr, "FinalizeSystem"}, + {402, nullptr, "SetOperationMode"}, + {403, C<&ISystemLocalCommunicationService::InitializeSystem2>, "InitializeSystem2"}, + }; + // clang-format on + + RegisterHandlers(functions); } ISystemLocalCommunicationService::~ISystemLocalCommunicationService() = default; diff --git a/src/core/hle/service/ldn/system_local_communication_service.h b/src/core/hle/service/ldn/system_local_communication_service.h index c7e937e3a2..fa0e45bde4 100644 --- a/src/core/hle/service/ldn/system_local_communication_service.h +++ b/src/core/hle/service/ldn/system_local_communication_service.h @@ -23,7 +23,6 @@ public: private: Result InitializeSystem2(); - std::optional FindRequest(u32 key) override; }; } // namespace Service::LDN diff --git a/src/core/hle/service/ldn/user_local_communication_service.cpp b/src/core/hle/service/ldn/user_local_communication_service.cpp index 26a742bf0b..7011bd52f2 100644 --- a/src/core/hle/service/ldn/user_local_communication_service.cpp +++ b/src/core/hle/service/ldn/user_local_communication_service.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -21,46 +22,46 @@ namespace Service::LDN { -std::optional IUserLocalCommunicationService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IUserLocalCommunicationService::GetState>, "GetState"}, - FunctionInfo{1, D<&IUserLocalCommunicationService::GetNetworkInfo>, "GetNetworkInfo"}, - FunctionInfo{2, D<&IUserLocalCommunicationService::GetIpv4Address>, "GetIpv4Address"}, - FunctionInfo{3, D<&IUserLocalCommunicationService::GetDisconnectReason>, "GetDisconnectReason"}, - FunctionInfo{4, D<&IUserLocalCommunicationService::GetSecurityParameter>, "GetSecurityParameter"}, - FunctionInfo{5, D<&IUserLocalCommunicationService::GetNetworkConfig>, "GetNetworkConfig"}, - FunctionInfo{100, D<&IUserLocalCommunicationService::AttachStateChangeEvent>, "AttachStateChangeEvent"}, - FunctionInfo{101, D<&IUserLocalCommunicationService::GetNetworkInfoLatestUpdate>, "GetNetworkInfoLatestUpdate"}, - FunctionInfo{102, D<&IUserLocalCommunicationService::Scan>, "Scan"}, - FunctionInfo{103, D<&IUserLocalCommunicationService::ScanPrivate>, "ScanPrivate"}, - FunctionInfo{104, D<&IUserLocalCommunicationService::SetWirelessControllerRestriction>, "SetWirelessControllerRestriction"}, - FunctionInfo{106, D<&IUserLocalCommunicationService::SetProtocol>, "SetProtocol" }, - FunctionInfo{200, D<&IUserLocalCommunicationService::OpenAccessPoint>, "OpenAccessPoint"}, - FunctionInfo{201, D<&IUserLocalCommunicationService::CloseAccessPoint>, "CloseAccessPoint"}, - FunctionInfo{202, D<&IUserLocalCommunicationService::CreateNetwork>, "CreateNetwork"}, - FunctionInfo{203, D<&IUserLocalCommunicationService::CreateNetworkPrivate>, "CreateNetworkPrivate"}, - FunctionInfo{204, D<&IUserLocalCommunicationService::DestroyNetwork>, "DestroyNetwork"}, - FunctionInfo{205, nullptr, "Reject"}, - FunctionInfo{206, D<&IUserLocalCommunicationService::SetAdvertiseData>, "SetAdvertiseData"}, - FunctionInfo{207, D<&IUserLocalCommunicationService::SetStationAcceptPolicy>, "SetStationAcceptPolicy"}, - FunctionInfo{208, D<&IUserLocalCommunicationService::AddAcceptFilterEntry>, "AddAcceptFilterEntry"}, - FunctionInfo{209, nullptr, "ClearAcceptFilter"}, - FunctionInfo{300, D<&IUserLocalCommunicationService::OpenStation>, "OpenStation"}, - FunctionInfo{301, D<&IUserLocalCommunicationService::CloseStation>, "CloseStation"}, - FunctionInfo{302, D<&IUserLocalCommunicationService::Connect>, "Connect"}, - FunctionInfo{303, nullptr, "ConnectPrivate"}, - FunctionInfo{304, D<&IUserLocalCommunicationService::Disconnect>, "Disconnect"}, - FunctionInfo{400, D<&IUserLocalCommunicationService::Initialize>, "Initialize"}, - FunctionInfo{401, D<&IUserLocalCommunicationService::Finalize>, "Finalize"}, - FunctionInfo{402, D<&IUserLocalCommunicationService::Initialize2>, "Initialize2"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IUserLocalCommunicationService::IUserLocalCommunicationService(Core::System& system_) : ServiceFramework{system_, "IUserLocalCommunicationService"}, service_context{system, "IUserLocalCommunicationService"}, lan_discovery{} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IUserLocalCommunicationService::GetState>, "GetState"}, + {1, D<&IUserLocalCommunicationService::GetNetworkInfo>, "GetNetworkInfo"}, + {2, D<&IUserLocalCommunicationService::GetIpv4Address>, "GetIpv4Address"}, + {3, D<&IUserLocalCommunicationService::GetDisconnectReason>, "GetDisconnectReason"}, + {4, D<&IUserLocalCommunicationService::GetSecurityParameter>, "GetSecurityParameter"}, + {5, D<&IUserLocalCommunicationService::GetNetworkConfig>, "GetNetworkConfig"}, + {100, D<&IUserLocalCommunicationService::AttachStateChangeEvent>, "AttachStateChangeEvent"}, + {101, D<&IUserLocalCommunicationService::GetNetworkInfoLatestUpdate>, "GetNetworkInfoLatestUpdate"}, + {102, D<&IUserLocalCommunicationService::Scan>, "Scan"}, + {103, D<&IUserLocalCommunicationService::ScanPrivate>, "ScanPrivate"}, + {104, D<&IUserLocalCommunicationService::SetWirelessControllerRestriction>, "SetWirelessControllerRestriction"}, + { 106, D<&IUserLocalCommunicationService::SetProtocol>, "SetProtocol" }, + {200, D<&IUserLocalCommunicationService::OpenAccessPoint>, "OpenAccessPoint"}, + {201, D<&IUserLocalCommunicationService::CloseAccessPoint>, "CloseAccessPoint"}, + {202, D<&IUserLocalCommunicationService::CreateNetwork>, "CreateNetwork"}, + {203, D<&IUserLocalCommunicationService::CreateNetworkPrivate>, "CreateNetworkPrivate"}, + {204, D<&IUserLocalCommunicationService::DestroyNetwork>, "DestroyNetwork"}, + {205, nullptr, "Reject"}, + {206, D<&IUserLocalCommunicationService::SetAdvertiseData>, "SetAdvertiseData"}, + {207, D<&IUserLocalCommunicationService::SetStationAcceptPolicy>, "SetStationAcceptPolicy"}, + {208, D<&IUserLocalCommunicationService::AddAcceptFilterEntry>, "AddAcceptFilterEntry"}, + {209, nullptr, "ClearAcceptFilter"}, + {300, D<&IUserLocalCommunicationService::OpenStation>, "OpenStation"}, + {301, D<&IUserLocalCommunicationService::CloseStation>, "CloseStation"}, + {302, D<&IUserLocalCommunicationService::Connect>, "Connect"}, + {303, nullptr, "ConnectPrivate"}, + {304, D<&IUserLocalCommunicationService::Disconnect>, "Disconnect"}, + {400, D<&IUserLocalCommunicationService::Initialize>, "Initialize"}, + {401, D<&IUserLocalCommunicationService::Finalize>, "Finalize"}, + {402, D<&IUserLocalCommunicationService::Initialize2>, "Initialize2"}, + }; + // clang-format on + + RegisterHandlers(functions); state_change_event = service_context.CreateEvent("IUserLocalCommunicationService:StateChangeEvent"); diff --git a/src/core/hle/service/ldn/user_local_communication_service.h b/src/core/hle/service/ldn/user_local_communication_service.h index 6f832b7a23..720d5e9bf4 100644 --- a/src/core/hle/service/ldn/user_local_communication_service.h +++ b/src/core/hle/service/ldn/user_local_communication_service.h @@ -1,7 +1,7 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later #pragma once @@ -89,7 +89,6 @@ private: /// Callback to parse and handle a received LDN packet. void OnLDNPacketReceived(const Network::LDNPacket& packet); void OnEventFired(); - std::optional FindRequest(u32 key) override; KernelHelpers::ServiceContext service_context; Kernel::KEvent* state_change_event; diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index 25ecc58fa4..db4d51b49d 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp @@ -12,44 +12,47 @@ namespace Service::LDR { class DebugMonitor final : public ServiceFramework { public: - explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "ldr:dmnt"} {} + explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "ldr:dmnt"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetProgramArgument"}, + {1, nullptr, "FlushArguments"}, + {2, nullptr, "GetProcessModuleInfo"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetProgramArgument"}, - FunctionInfo{1, nullptr, "FlushArguments"}, - FunctionInfo{2, nullptr, "GetProcessModuleInfo"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class ProcessManager final : public ServiceFramework { public: - explicit ProcessManager(Core::System& system_) : ServiceFramework{system_, "ldr:pm"} {} + explicit ProcessManager(Core::System& system_) : ServiceFramework{system_, "ldr:pm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateProcess"}, + {1, nullptr, "GetProgramInfo"}, + {2, nullptr, "PinProgram"}, + {3, nullptr, "UnpinProgram"}, + {4, nullptr, "SetEnabledProgramVerification"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateProcess"}, - FunctionInfo{1, nullptr, "GetProgramInfo"}, - FunctionInfo{2, nullptr, "PinProgram"}, - FunctionInfo{3, nullptr, "UnpinProgram"}, - FunctionInfo{4, nullptr, "SetEnabledProgramVerification"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class Shell final : public ServiceFramework { public: - explicit Shell(Core::System& system_) : ServiceFramework{system_, "ldr:shel"} {} + explicit Shell(Core::System& system_) : ServiceFramework{system_, "ldr:shel"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetProgramArgument"}, + {1, nullptr, "FlushArguments"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetProgramArgument"}, - FunctionInfo{1, nullptr, "FlushArguments"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/ldr/ldr.h b/src/core/hle/service/ldr/ldr.h index c9281dbfb2..12a6b1f507 100644 --- a/src/core/hle/service/ldr/ldr.h +++ b/src/core/hle/service/ldr/ldr.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index be8cdf9aa9..d631a6dd80 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp @@ -87,7 +87,16 @@ DECLARE_ENUM_FLAG_OPERATORS(LogPacketFlags); class ILogger final : public ServiceFramework { public: - explicit ILogger(Core::System& system_) : ServiceFramework{system_, "ILogger"} {} + explicit ILogger(Core::System& system_) : ServiceFramework{system_, "ILogger"} { + static const FunctionInfo functions[] = { + {0, &ILogger::Log, "Log"}, + {1, &ILogger::SetDestination, "SetDestination"}, + {2, nullptr, "TransmitHashedLog"}, //20.0.0+ + {3, nullptr, "DevNotify"}, //20.0.0+ + }; + RegisterHandlers(functions); + } + private: void Log(HLERequestContext& ctx) { std::size_t offset{}; @@ -322,25 +331,20 @@ private: }; static_assert(sizeof(LogPacketHeader) == 0x18, "LogPacketHeader is an invalid size"); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ILogger::Log, "Log"}, - FunctionInfo{1, &ILogger::SetDestination, "SetDestination"}, - FunctionInfo{2, nullptr, "TransmitHashedLog", MakeVersionGate({20,0,0})}, - FunctionInfo{3, nullptr, "DevNotify", MakeVersionGate({20,0,0})} - ); ::Common::unordered_map> entries{}; LogDestination destination{LogDestination::All}; }; class LM final : public ServiceFramework { public: - explicit LM(Core::System& system_) : ServiceFramework{system_, "lm"} {} + explicit LM(Core::System& system_) : ServiceFramework{system_, "lm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &LM::OpenLogger, "OpenLogger"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -351,26 +355,21 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &LM::OpenLogger, "OpenLogger"} - ); }; class LM_GET final : public ServiceFramework { public: - explicit LM_GET(Core::System& system_) : ServiceFramework{system_, "lm:get"} {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit LM_GET(Core::System& system_) + : ServiceFramework{system_, "lm:get"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "StartLogging"}, + {1, nullptr, "StopLogging"}, + {2, nullptr, "GetLog"}, + {100, nullptr, "CreateDevNotificationReceiver"}, + }; + RegisterHandlers(functions); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "StartLogging"}, - FunctionInfo{1, nullptr, "StopLogging"}, - FunctionInfo{2, nullptr, "GetLog"}, - FunctionInfo{100, nullptr, "CreateDevNotificationReceiver"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/lm/lm.h b/src/core/hle/service/lm/lm.h index 0d7c39cbc3..890344f44a 100644 --- a/src/core/hle/service/lm/lm.h +++ b/src/core/hle/service/lm/lm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mig/mig.cpp b/src/core/hle/service/mig/mig.cpp index 2560050622..7412674417 100644 --- a/src/core/hle/service/mig/mig.cpp +++ b/src/core/hle/service/mig/mig.cpp @@ -14,50 +14,50 @@ namespace Service::Migration { class MIG_USR final : public ServiceFramework { public: - explicit MIG_USR(Core::System& system_) : ServiceFramework{system_, "mig:usr"} {} + explicit MIG_USR(Core::System& system_) : ServiceFramework{system_, "mig:usr"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Unknown0"}, //19.0.0+ + {1, nullptr, "Unknown1"}, //20.0.0+ + {2, nullptr, "Unknown2"}, //20.0.0+ + {10, nullptr, "TryGetLastMigrationInfo"}, + {11, nullptr, "Unknown11"}, //20.0.0+ + {100, nullptr, "CreateUserMigrationServer"}, //7.0.0+ + {101, nullptr, "ResumeUserMigrationServer"}, //7.0.0+ + {200, nullptr, "CreateUserMigrationClient"}, //7.0.0+ + {201, nullptr, "ResumeUserMigrationClient"}, //7.0.0+ + {1001, nullptr, "GetSaveDataMigrationPolicyInfoAsync"}, //8.0.0-20.5.0 + {1010, nullptr, "TryGetLastSaveDataMigrationInfo"}, //7.0.0+ + {1100, nullptr, "CreateSaveDataMigrationServer"}, //7.0.0-19.0.1 + {1101, nullptr, "ResumeSaveDataMigrationServer"}, //7.0.0+ + {1110, nullptr, "Unknown1101"}, //17.0.0+ + {1200, nullptr, "CreateSaveDataMigrationClient"}, //7.0.0+ + {1201, nullptr, "ResumeSaveDataMigrationClient"}, //7.0.0+ + {2001, nullptr, "Unknown2001"}, //20.0.0+ + {2010, nullptr, "Unknown2010"}, //20.0.0+ + {2100, nullptr, "Unknown2100"}, //20.0.0+ + {2110, nullptr, "Unknown2110"}, //20.0.0+ + {2200, nullptr, "Unknown2200"}, //20.0.0+ + {2210, nullptr, "Unknown2210"}, //20.0.0+ + {2220, nullptr, "Unknown2220"}, //20.0.0+ + {2230, nullptr, "Unknown2230"}, //20.0.0+ + {2231, nullptr, "Unknown2231"}, //20.0.0+ + {2232, nullptr, "Unknown2232"}, //20.0.0+ + {2233, nullptr, "Unknown2233"}, //20.0.0+ + {2234, nullptr, "Unknown2234"}, //20.0.0+ + {2250, nullptr, "Unknown2250"}, //20.0.0+ + {2260, nullptr, "Unknown2260"}, //20.0.0+ + {2270, nullptr, "Unknown2270"}, //20.0.0+ + {2280, nullptr, "Unknown2280"}, //20.0.0+ + {2300, nullptr, "Unknown2300"}, //20.0.0+ + {2310, nullptr, "Unknown2310"}, //20.0.0+ + {2400, nullptr, "Unknown2400"}, //20.0.0+ + {2420, nullptr, "Unknown2420"}, //20.0.0+ + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Unknown0", MakeVersionGate({19,0,0})}, - FunctionInfo{1, nullptr, "Unknown1", MakeVersionGate({20,0,0})}, - FunctionInfo{2, nullptr, "Unknown2", MakeVersionGate({20,0,0})}, - FunctionInfo{10, nullptr, "TryGetLastMigrationInfo"}, - FunctionInfo{11, nullptr, "Unknown11", MakeVersionGate({20,0,0})}, - FunctionInfo{100, nullptr, "CreateUserMigrationServer", MakeVersionGate({7,0,0})}, - FunctionInfo{101, nullptr, "ResumeUserMigrationServer", MakeVersionGate({7,0,0})}, - FunctionInfo{200, nullptr, "CreateUserMigrationClient", MakeVersionGate({7,0,0})}, - FunctionInfo{201, nullptr, "ResumeUserMigrationClient", MakeVersionGate({7,0,0})}, - FunctionInfo{1001, nullptr, "GetSaveDataMigrationPolicyInfoAsync", MakeVersionGate({8,0,0}, {20,5,0})}, - FunctionInfo{1010, nullptr, "TryGetLastSaveDataMigrationInfo", MakeVersionGate({7,0,0})}, - FunctionInfo{1100, nullptr, "CreateSaveDataMigrationServer", MakeVersionGate({7,0,0}, {19,0,1})}, - FunctionInfo{1101, nullptr, "ResumeSaveDataMigrationServer", MakeVersionGate({7,0,0})}, - FunctionInfo{1110, nullptr, "Unknown1101", MakeVersionGate({17,0,0})}, - FunctionInfo{1200, nullptr, "CreateSaveDataMigrationClient", MakeVersionGate({7,0,0})}, - FunctionInfo{1201, nullptr, "ResumeSaveDataMigrationClient", MakeVersionGate({7,0,0})}, - FunctionInfo{2001, nullptr, "Unknown2001", MakeVersionGate({20,0,0})}, - FunctionInfo{2010, nullptr, "Unknown2010", MakeVersionGate({20,0,0})}, - FunctionInfo{2100, nullptr, "Unknown2100", MakeVersionGate({20,0,0})}, - FunctionInfo{2110, nullptr, "Unknown2110", MakeVersionGate({20,0,0})}, - FunctionInfo{2200, nullptr, "Unknown2200", MakeVersionGate({20,0,0})}, - FunctionInfo{2210, nullptr, "Unknown2210", MakeVersionGate({20,0,0})}, - FunctionInfo{2220, nullptr, "Unknown2220", MakeVersionGate({20,0,0})}, - FunctionInfo{2230, nullptr, "Unknown2230", MakeVersionGate({20,0,0})}, - FunctionInfo{2231, nullptr, "Unknown2231", MakeVersionGate({20,0,0})}, - FunctionInfo{2232, nullptr, "Unknown2232", MakeVersionGate({20,0,0})}, - FunctionInfo{2233, nullptr, "Unknown2233", MakeVersionGate({20,0,0})}, - FunctionInfo{2234, nullptr, "Unknown2234", MakeVersionGate({20,0,0})}, - FunctionInfo{2250, nullptr, "Unknown2250", MakeVersionGate({20,0,0})}, - FunctionInfo{2260, nullptr, "Unknown2260", MakeVersionGate({20,0,0})}, - FunctionInfo{2270, nullptr, "Unknown2270", MakeVersionGate({20,0,0})}, - FunctionInfo{2280, nullptr, "Unknown2280", MakeVersionGate({20,0,0})}, - FunctionInfo{2300, nullptr, "Unknown2300", MakeVersionGate({20,0,0})}, - FunctionInfo{2310, nullptr, "Unknown2310", MakeVersionGate({20,0,0})}, - FunctionInfo{2400, nullptr, "Unknown2400", MakeVersionGate({20,0,0})}, - FunctionInfo{2420, nullptr, "Unknown2420", MakeVersionGate({20,0,0})} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/mig/mig.h b/src/core/hle/service/mig/mig.h index c8ed732a5b..39e92a59eb 100644 --- a/src/core/hle/service/mig/mig.h +++ b/src/core/hle/service/mig/mig.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/mii.cpp b/src/core/hle/service/mii/mii.cpp index 642a9e4907..513bb671f8 100644 --- a/src/core/hle/service/mii/mii.cpp +++ b/src/core/hle/service/mii/mii.cpp @@ -22,25 +22,49 @@ namespace Service::Mii { -std::optional IStaticService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IStaticService::GetDatabaseService>, "GetDatabaseService"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - class IDatabaseService final : public ServiceFramework { public: - explicit IDatabaseService(Core::System& system_, std::shared_ptr mii_manager, bool is_system_) - : ServiceFramework{system_, "IDatabaseService"} - , manager{mii_manager} - , is_system{is_system_} { - m_set_sys = system.ServiceManager().GetService("set:sys", true); - manager->Initialize(metadata); - } + explicit IDatabaseService(Core::System& system_, std::shared_ptr mii_manager, + bool is_system_) + : ServiceFramework{system_, "IDatabaseService"}, manager{mii_manager}, is_system{ + is_system_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IDatabaseService::IsUpdated>, "IsUpdated"}, + {1, D<&IDatabaseService::IsFullDatabase>, "IsFullDatabase"}, + {2, D<&IDatabaseService::GetCount>, "GetCount"}, + {3, D<&IDatabaseService::Get>, "Get"}, + {4, D<&IDatabaseService::Get1>, "Get1"}, + {5, D<&IDatabaseService::UpdateLatest>, "UpdateLatest"}, + {6, D<&IDatabaseService::BuildRandom>, "BuildRandom"}, + {7, D<&IDatabaseService::BuildDefault>, "BuildDefault"}, + {8, D<&IDatabaseService::Get2>, "Get2"}, + {9, D<&IDatabaseService::Get3>, "Get3"}, + {10, D<&IDatabaseService::UpdateLatest1>, "UpdateLatest1"}, + {11, D<&IDatabaseService::FindIndex>, "FindIndex"}, + {12, D<&IDatabaseService::Move>, "Move"}, + {13, D<&IDatabaseService::AddOrReplace>, "AddOrReplace"}, + {14, D<&IDatabaseService::Delete>, "Delete"}, + {15, D<&IDatabaseService::DestroyFile>, "DestroyFile"}, + {16, D<&IDatabaseService::DeleteFile>, "DeleteFile"}, + {17, D<&IDatabaseService::Format>, "Format"}, + {18, nullptr, "Import"}, + {19, nullptr, "Export"}, + {20, D<&IDatabaseService::IsBrokenDatabaseWithClearFlag>, "IsBrokenDatabaseWithClearFlag"}, + {21, D<&IDatabaseService::GetIndex>, "GetIndex"}, + {22, D<&IDatabaseService::SetInterfaceVersion>, "SetInterfaceVersion"}, + {23, D<&IDatabaseService::Convert>, "Convert"}, + {24, D<&IDatabaseService::ConvertCoreDataToCharInfo>, "ConvertCoreDataToCharInfo"}, + {25, D<&IDatabaseService::ConvertCharInfoToCoreData>, "ConvertCharInfoToCoreData"}, + {26, D<&IDatabaseService::Append>, "Append"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); + + m_set_sys = system.ServiceManager().GetService( + "set:sys", true); + manager->Initialize(metadata); } private: @@ -264,45 +288,23 @@ private: R_RETURN(manager->Append(metadata, char_info)); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IDatabaseService::IsUpdated>, "IsUpdated"}, - FunctionInfo{1, D<&IDatabaseService::IsFullDatabase>, "IsFullDatabase"}, - FunctionInfo{2, D<&IDatabaseService::GetCount>, "GetCount"}, - FunctionInfo{3, D<&IDatabaseService::Get>, "Get"}, - FunctionInfo{4, D<&IDatabaseService::Get1>, "Get1"}, - FunctionInfo{5, D<&IDatabaseService::UpdateLatest>, "UpdateLatest"}, - FunctionInfo{6, D<&IDatabaseService::BuildRandom>, "BuildRandom"}, - FunctionInfo{7, D<&IDatabaseService::BuildDefault>, "BuildDefault"}, - FunctionInfo{8, D<&IDatabaseService::Get2>, "Get2"}, - FunctionInfo{9, D<&IDatabaseService::Get3>, "Get3"}, - FunctionInfo{10, D<&IDatabaseService::UpdateLatest1>, "UpdateLatest1"}, - FunctionInfo{11, D<&IDatabaseService::FindIndex>, "FindIndex"}, - FunctionInfo{12, D<&IDatabaseService::Move>, "Move"}, - FunctionInfo{13, D<&IDatabaseService::AddOrReplace>, "AddOrReplace"}, - FunctionInfo{14, D<&IDatabaseService::Delete>, "Delete"}, - FunctionInfo{15, D<&IDatabaseService::DestroyFile>, "DestroyFile"}, - FunctionInfo{16, D<&IDatabaseService::DeleteFile>, "DeleteFile"}, - FunctionInfo{17, D<&IDatabaseService::Format>, "Format"}, - FunctionInfo{18, nullptr, "Import"}, - FunctionInfo{19, nullptr, "Export"}, - FunctionInfo{20, D<&IDatabaseService::IsBrokenDatabaseWithClearFlag>, "IsBrokenDatabaseWithClearFlag"}, - FunctionInfo{21, D<&IDatabaseService::GetIndex>, "GetIndex"}, - FunctionInfo{22, D<&IDatabaseService::SetInterfaceVersion>, "SetInterfaceVersion"}, - FunctionInfo{23, D<&IDatabaseService::Convert>, "Convert"}, - FunctionInfo{24, D<&IDatabaseService::ConvertCoreDataToCharInfo>, "ConvertCoreDataToCharInfo"}, - FunctionInfo{25, D<&IDatabaseService::ConvertCharInfoToCoreData>, "ConvertCharInfoToCoreData"}, - FunctionInfo{26, D<&IDatabaseService::Append>, "Append"} - ); - std::shared_ptr manager = nullptr; DatabaseSessionMetadata metadata{}; bool is_system{}; + std::shared_ptr m_set_sys; }; IStaticService::IStaticService(Core::System& system_, const char* name_, std::shared_ptr mii_manager, bool is_system_) : ServiceFramework{system_, name_}, manager{mii_manager}, is_system{is_system_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IStaticService::GetDatabaseService>, "GetDatabaseService"}, + }; + // clang-format on + + RegisterHandlers(functions); } IStaticService::~IStaticService() = default; @@ -322,10 +324,27 @@ std::shared_ptr IStaticService::GetMiiManager() { class IImageDatabaseService final : public ServiceFramework { public: - explicit IImageDatabaseService(Core::System& system_) : ServiceFramework{system_, "miiimg"} {} + explicit IImageDatabaseService(Core::System& system_) : ServiceFramework{system_, "miiimg"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IImageDatabaseService::Initialize>, "Initialize"}, + {10, nullptr, "Reload"}, + {11, D<&IImageDatabaseService::GetCount>, "GetCount"}, + {12, nullptr, "IsEmpty"}, + {13, nullptr, "IsFull"}, + {14, nullptr, "GetAttribute"}, + {15, nullptr, "LoadImage"}, + {16, nullptr, "AddOrUpdateImage"}, + {17, nullptr, "DeleteImages"}, + {100, nullptr, "DeleteFile"}, + {101, nullptr, "DestroyFile"}, + {102, nullptr, "ImportFile"}, + {103, nullptr, "ExportFile"}, + {104, nullptr, "ForceInitialize"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -342,23 +361,6 @@ private: R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IImageDatabaseService::Initialize>, "Initialize"}, - FunctionInfo{10, nullptr, "Reload"}, - FunctionInfo{11, D<&IImageDatabaseService::GetCount>, "GetCount"}, - FunctionInfo{12, nullptr, "IsEmpty"}, - FunctionInfo{13, nullptr, "IsFull"}, - FunctionInfo{14, nullptr, "GetAttribute"}, - FunctionInfo{15, nullptr, "LoadImage"}, - FunctionInfo{16, nullptr, "AddOrUpdateImage"}, - FunctionInfo{17, nullptr, "DeleteImages"}, - FunctionInfo{100, nullptr, "DeleteFile"}, - FunctionInfo{101, nullptr, "DestroyFile"}, - FunctionInfo{102, nullptr, "ImportFile"}, - FunctionInfo{103, nullptr, "ExportFile"}, - FunctionInfo{104, nullptr, "ForceInitialize"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/mii/mii.h b/src/core/hle/service/mii/mii.h index ba20db40d7..9ec6f248e5 100644 --- a/src/core/hle/service/mii/mii.h +++ b/src/core/hle/service/mii/mii.h @@ -27,7 +27,6 @@ public: private: Result GetDatabaseService(Out> out_database_service); - std::optional FindRequest(u32 key) override; std::shared_ptr manager{nullptr}; bool is_system{}; }; diff --git a/src/core/hle/service/mii/mii_database.cpp b/src/core/hle/service/mii/mii_database.cpp index d1f4e1f198..6dd9773b2b 100644 --- a/src/core/hle/service/mii/mii_database.cpp +++ b/src/core/hle/service/mii/mii_database.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project diff --git a/src/core/hle/service/mii/mii_database.h b/src/core/hle/service/mii/mii_database.h index 3bd240f93b..6d28696206 100644 --- a/src/core/hle/service/mii/mii_database.h +++ b/src/core/hle/service/mii/mii_database.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/mii_database_manager.h b/src/core/hle/service/mii/mii_database_manager.h index 52c32be82c..52ec3a91cc 100644 --- a/src/core/hle/service/mii/mii_database_manager.h +++ b/src/core/hle/service/mii/mii_database_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/mii_manager.h b/src/core/hle/service/mii/mii_manager.h index 48d8e8bb7d..9c546d2cbf 100644 --- a/src/core/hle/service/mii/mii_manager.h +++ b/src/core/hle/service/mii/mii_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/mii_result.h b/src/core/hle/service/mii/mii_result.h index e2c36e556d..f4964133e7 100644 --- a/src/core/hle/service/mii/mii_result.h +++ b/src/core/hle/service/mii/mii_result.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/mii_types.h b/src/core/hle/service/mii/mii_types.h index 08c6029dff..6afa07ef43 100644 --- a/src/core/hle/service/mii/mii_types.h +++ b/src/core/hle/service/mii/mii_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/types/char_info.cpp b/src/core/hle/service/mii/types/char_info.cpp index e90124af4c..b5f4492994 100644 --- a/src/core/hle/service/mii/types/char_info.cpp +++ b/src/core/hle/service/mii/types/char_info.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/types/char_info.h b/src/core/hle/service/mii/types/char_info.h index d0c457fd56..e9c41435e1 100644 --- a/src/core/hle/service/mii/types/char_info.h +++ b/src/core/hle/service/mii/types/char_info.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/types/core_data.cpp b/src/core/hle/service/mii/types/core_data.cpp index ba1da76bae..7f2acea3ef 100644 --- a/src/core/hle/service/mii/types/core_data.cpp +++ b/src/core/hle/service/mii/types/core_data.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/types/core_data.h b/src/core/hle/service/mii/types/core_data.h index 8897e4f3b3..48a1ba5c73 100644 --- a/src/core/hle/service/mii/types/core_data.h +++ b/src/core/hle/service/mii/types/core_data.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/types/raw_data.h b/src/core/hle/service/mii/types/raw_data.h index 9a4cfa738e..f8182847ec 100644 --- a/src/core/hle/service/mii/types/raw_data.h +++ b/src/core/hle/service/mii/types/raw_data.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/types/store_data.cpp b/src/core/hle/service/mii/types/store_data.cpp index 127221fdb6..fcef3850f2 100644 --- a/src/core/hle/service/mii/types/store_data.cpp +++ b/src/core/hle/service/mii/types/store_data.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/types/store_data.h b/src/core/hle/service/mii/types/store_data.h index ed5dfb9494..5d5269a15b 100644 --- a/src/core/hle/service/mii/types/store_data.h +++ b/src/core/hle/service/mii/types/store_data.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/types/ver3_store_data.cpp b/src/core/hle/service/mii/types/ver3_store_data.cpp index c27646fcfd..840e0f35b3 100644 --- a/src/core/hle/service/mii/types/ver3_store_data.cpp +++ b/src/core/hle/service/mii/types/ver3_store_data.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mii/types/ver3_store_data.h b/src/core/hle/service/mii/types/ver3_store_data.h index 47907bf7d7..f2cb395136 100644 --- a/src/core/hle/service/mii/types/ver3_store_data.h +++ b/src/core/hle/service/mii/types/ver3_store_data.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mm/mm_u.cpp b/src/core/hle/service/mm/mm_u.cpp index 0b361ecdd2..e5353ee42c 100644 --- a/src/core/hle/service/mm/mm_u.cpp +++ b/src/core/hle/service/mm/mm_u.cpp @@ -49,10 +49,21 @@ public: class MM_U final : public ServiceFramework { public: - explicit MM_U(Core::System& system_) : ServiceFramework{system_, "mm:u"} {} + explicit MM_U(Core::System& system_) : ServiceFramework{system_, "mm:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &MM_U::InitializeOld, "InitializeOld"}, + {1, &MM_U::FinalizeOld, "FinalizeOld"}, + {2, &MM_U::SetAndWaitOld, "SetAndWaitOld"}, + {3, &MM_U::GetOld, "GetOld"}, + {4, &MM_U::Initialize, "Initialize"}, + {5, &MM_U::Finalize, "Finalize"}, + {6, &MM_U::SetAndWait, "SetAndWait"}, + {7, &MM_U::Get, "Get"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -201,16 +212,6 @@ private: rb.Push(0); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &MM_U::InitializeOld, "InitializeOld"}, - FunctionInfo{1, &MM_U::FinalizeOld, "FinalizeOld"}, - FunctionInfo{2, &MM_U::SetAndWaitOld, "SetAndWaitOld"}, - FunctionInfo{3, &MM_U::GetOld, "GetOld"}, - FunctionInfo{4, &MM_U::Initialize, "Initialize"}, - FunctionInfo{5, &MM_U::Finalize, "Finalize"}, - FunctionInfo{6, &MM_U::SetAndWait, "SetAndWait"}, - FunctionInfo{7, &MM_U::Get, "Get"} - ); std::vector sessions; u32 request_id{1}; }; diff --git a/src/core/hle/service/mm/mm_u.h b/src/core/hle/service/mm/mm_u.h index 43117c9b1c..ab0e76f40a 100644 --- a/src/core/hle/service/mm/mm_u.h +++ b/src/core/hle/service/mm/mm_u.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/mnpp/mnpp.cpp b/src/core/hle/service/mnpp/mnpp.cpp index c5bc306302..11b6f3a386 100644 --- a/src/core/hle/service/mnpp/mnpp.cpp +++ b/src/core/hle/service/mnpp/mnpp.cpp @@ -14,10 +14,15 @@ namespace Service::MNPP { class MNPP_APP final : public ServiceFramework { public: - explicit MNPP_APP(Core::System& system_) : ServiceFramework{system_, "mnpp:app"} {} + explicit MNPP_APP(Core::System& system_) : ServiceFramework{system_, "mnpp:app"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &MNPP_APP::Cmd0, "Cmd0"}, + {1, &MNPP_APP::Cmd1, "Cmd1"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -34,43 +39,38 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &MNPP_APP::Cmd0, "Cmd0"}, - FunctionInfo{1, &MNPP_APP::Cmd1, "Cmd1"} - ); }; class MNPP_SYS final : public ServiceFramework { public: - explicit MNPP_SYS(Core::System& system_) : ServiceFramework{system_, "mnpp:sys"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Cmd0"}, - FunctionInfo{10, nullptr, "Cmd10"}, - FunctionInfo{100, nullptr, "Cmd100"}, - FunctionInfo{200, nullptr, "Cmd200"}, - FunctionInfo{300, nullptr, "Cmd300"}, - FunctionInfo{400, nullptr, "Cmd400"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit MNPP_SYS(Core::System& system_) : ServiceFramework{system_, "mnpp:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Cmd0"}, + {10, nullptr, "Cmd10"}, + {100, nullptr, "Cmd100"}, + {200, nullptr, "Cmd200"}, + {300, nullptr, "Cmd300"}, + {400, nullptr, "Cmd400"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class MNPP_WEB final : public ServiceFramework { public: - explicit MNPP_WEB(Core::System& system_) : ServiceFramework{system_, "mnpp:web"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Cmd0"}, - FunctionInfo{1, nullptr, "Cmd1"}, - FunctionInfo{10, nullptr, "Cmd10"}, - FunctionInfo{20, nullptr, "Cmd20"}, - FunctionInfo{100, nullptr, "Cmd100"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit MNPP_WEB(Core::System& system_) : ServiceFramework{system_, "mnpp:web"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Cmd0"}, + {1, nullptr, "Cmd1"}, + {10, nullptr, "Cmd10"}, + {20, nullptr, "Cmd20"}, + {100, nullptr, "Cmd100"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp index 4091eadcf9..6c754d5567 100644 --- a/src/core/hle/service/ncm/ncm.cpp +++ b/src/core/hle/service/ncm/ncm.cpp @@ -24,32 +24,33 @@ namespace Service::NCM { class ILocationResolver final : public ServiceFramework { public: explicit ILocationResolver(Core::System& system_, FileSys::StorageId id) - : ServiceFramework{system_, "ILocationResolver"}, storage{id} {} + : ServiceFramework{system_, "ILocationResolver"}, storage{id} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ResolveProgramPath"}, + {1, nullptr, "RedirectProgramPath"}, + {2, nullptr, "ResolveApplicationControlPath"}, + {3, nullptr, "ResolveApplicationHtmlDocumentPath"}, + {4, nullptr, "ResolveDataPath"}, + {5, nullptr, "RedirectApplicationControlPath"}, + {6, nullptr, "RedirectApplicationHtmlDocumentPath"}, + {7, nullptr, "ResolveApplicationLegalInformationPath"}, + {8, nullptr, "RedirectApplicationLegalInformationPath"}, + {9, nullptr, "Refresh"}, + {10, nullptr, "RedirectApplicationProgramPath"}, + {11, nullptr, "ClearApplicationRedirection"}, + {12, nullptr, "EraseProgramRedirection"}, + {13, nullptr, "EraseApplicationControlRedirection"}, + {14, nullptr, "EraseApplicationHtmlDocumentRedirection"}, + {15, nullptr, "EraseApplicationLegalInformationRedirection"}, + {16, nullptr, "ResolveProgramPathForDebug"}, + {17, nullptr, "RedirectProgramPathForDebug"}, + {18, nullptr, "RedirectApplicationProgramPathForDebug"}, + {19, nullptr, "EraseProgramRedirectionForDebug"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "ResolveProgramPath"}, - FunctionInfo{1, nullptr, "RedirectProgramPath"}, - FunctionInfo{2, nullptr, "ResolveApplicationControlPath"}, - FunctionInfo{3, nullptr, "ResolveApplicationHtmlDocumentPath"}, - FunctionInfo{4, nullptr, "ResolveDataPath"}, - FunctionInfo{5, nullptr, "RedirectApplicationControlPath"}, - FunctionInfo{6, nullptr, "RedirectApplicationHtmlDocumentPath"}, - FunctionInfo{7, nullptr, "ResolveApplicationLegalInformationPath"}, - FunctionInfo{8, nullptr, "RedirectApplicationLegalInformationPath"}, - FunctionInfo{9, nullptr, "Refresh"}, - FunctionInfo{10, nullptr, "RedirectApplicationProgramPath"}, - FunctionInfo{11, nullptr, "ClearApplicationRedirection"}, - FunctionInfo{12, nullptr, "EraseProgramRedirection"}, - FunctionInfo{13, nullptr, "EraseApplicationControlRedirection"}, - FunctionInfo{14, nullptr, "EraseApplicationHtmlDocumentRedirection"}, - FunctionInfo{15, nullptr, "EraseApplicationLegalInformationRedirection"}, - FunctionInfo{16, nullptr, "ResolveProgramPathForDebug"}, - FunctionInfo{17, nullptr, "RedirectProgramPathForDebug"}, - FunctionInfo{18, nullptr, "RedirectApplicationProgramPathForDebug"}, - FunctionInfo{19, nullptr, "EraseProgramRedirectionForDebug"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -59,49 +60,60 @@ private: class IRegisteredLocationResolver final : public ServiceFramework { public: explicit IRegisteredLocationResolver(Core::System& system_) - : ServiceFramework{system_, "IRegisteredLocationResolver"} {} + : ServiceFramework{system_, "IRegisteredLocationResolver"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ResolveProgramPath"}, + {1, nullptr, "RegisterProgramPath"}, + {2, nullptr, "UnregisterProgramPath"}, + {3, nullptr, "RedirectProgramPath"}, + {4, nullptr, "ResolveHtmlDocumentPath"}, + {5, nullptr, "RegisterHtmlDocumentPath"}, + {6, nullptr, "UnregisterHtmlDocumentPath"}, + {7, nullptr, "RedirectHtmlDocumentPath"}, + {8, nullptr, "Refresh"}, + {9, nullptr, "RefreshExcluding"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "ResolveProgramPath"}, - FunctionInfo{1, nullptr, "RegisterProgramPath"}, - FunctionInfo{2, nullptr, "UnregisterProgramPath"}, - FunctionInfo{3, nullptr, "RedirectProgramPath"}, - FunctionInfo{4, nullptr, "ResolveHtmlDocumentPath"}, - FunctionInfo{5, nullptr, "RegisterHtmlDocumentPath"}, - FunctionInfo{6, nullptr, "UnregisterHtmlDocumentPath"}, - FunctionInfo{7, nullptr, "RedirectHtmlDocumentPath"}, - FunctionInfo{8, nullptr, "Refresh"}, - FunctionInfo{9, nullptr, "RefreshExcluding"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IAddOnContentLocationResolver final : public ServiceFramework { public: explicit IAddOnContentLocationResolver(Core::System& system_) - : ServiceFramework{system_, "IAddOnContentLocationResolver"} {} + : ServiceFramework{system_, "IAddOnContentLocationResolver"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ResolveAddOnContentPath"}, + {1, nullptr, "RegisterAddOnContentStorage"}, + {2, nullptr, "UnregisterAllAddOnContentPath"}, + {3, nullptr, "RefreshApplicationAddOnContent"}, + {4, nullptr, "UnregisterApplicationAddOnContent"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "ResolveAddOnContentPath"}, - FunctionInfo{1, nullptr, "RegisterAddOnContentStorage"}, - FunctionInfo{2, nullptr, "UnregisterAllAddOnContentPath"}, - FunctionInfo{3, nullptr, "RefreshApplicationAddOnContent"}, - FunctionInfo{4, nullptr, "UnregisterApplicationAddOnContent"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IContentStorage final : public ServiceFramework { public: explicit IContentStorage(Core::System& system_, FileSys::StorageId id) - : ServiceFramework{system_, "IContentStorage"}, storage{id} {} + : ServiceFramework{system_, "IContentStorage"}, storage{id} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IContentStorage::GeneratePlaceHolderId, "GeneratePlaceHolderId"}, + {1, &IContentStorage::CreatePlaceHolder, "CreatePlaceHolder"}, + {2, &IContentStorage::DeletePlaceHolder, "DeletePlaceHolder"}, + {4, &IContentStorage::WritePlaceHolder, "WritePlaceHolder"}, + {5, &IContentStorage::Register, "Register"}, + {6, &IContentStorage::Delete, "Delete"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -240,24 +252,23 @@ private: rb.Push(succeeded ? ResultSuccess : ResultUnknown); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IContentStorage::GeneratePlaceHolderId, "GeneratePlaceHolderId"}, - FunctionInfo{1, &IContentStorage::CreatePlaceHolder, "CreatePlaceHolder"}, - FunctionInfo{2, &IContentStorage::DeletePlaceHolder, "DeletePlaceHolder"}, - FunctionInfo{4, &IContentStorage::WritePlaceHolder, "WritePlaceHolder"}, - FunctionInfo{5, &IContentStorage::Register, "Register"}, - FunctionInfo{6, &IContentStorage::Delete, "Delete"} - ); FileSys::StorageId storage; }; class IContentMetaDatabase final : public ServiceFramework { public: explicit IContentMetaDatabase(Core::System& system_, FileSys::StorageId id) - : ServiceFramework{system_, "IContentMetaDatabase"}, storage{id} {} + : ServiceFramework{system_, "IContentMetaDatabase"}, storage{id} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IContentMetaDatabase::Set, "Set"}, + {2, &IContentMetaDatabase::Remove, "Remove"}, + {8, &IContentMetaDatabase::Has, "Has"}, + {15, &IContentMetaDatabase::Commit, "Commit"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -345,37 +356,51 @@ private: rb.Push(ResultSuccess); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IContentMetaDatabase::Set, "Set"}, - FunctionInfo{2, &IContentMetaDatabase::Remove, "Remove"}, - FunctionInfo{8, &IContentMetaDatabase::Has, "Has"}, - FunctionInfo{15, &IContentMetaDatabase::Commit, "Commit"} - ); FileSys::StorageId storage; std::vector entries; }; class LR final : public ServiceFramework { public: - explicit LR(Core::System& system_) : ServiceFramework{system_, "lr"} {} + explicit LR(Core::System& system_) : ServiceFramework{system_, "lr"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenLocationResolver"}, + {1, nullptr, "OpenRegisteredLocationResolver"}, + {2, nullptr, "RefreshLocationResolver"}, + {3, nullptr, "OpenAddOnContentLocationResolver"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenLocationResolver"}, - FunctionInfo{1, nullptr, "OpenRegisteredLocationResolver"}, - FunctionInfo{2, nullptr, "RefreshLocationResolver"}, - FunctionInfo{3, nullptr, "OpenAddOnContentLocationResolver"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class NCM final : public ServiceFramework { public: - explicit NCM(Core::System& system_) : ServiceFramework{system_, "ncm"} {} + explicit NCM(Core::System& system_) : ServiceFramework{system_, "ncm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateContentStorage"}, + {1, nullptr, "CreateContentMetaDatabase"}, + {2, nullptr, "VerifyContentStorage"}, + {3, nullptr, "VerifyContentMetaDatabase"}, + {4, &NCM::OpenContentStorage, "OpenContentStorage"}, + {5, &NCM::OpenContentMetaDatabase, "OpenContentMetaDatabase"}, + {6, nullptr, "CloseContentStorageForcibly"}, + {7, nullptr, "CloseContentMetaDatabaseForcibly"}, + {8, nullptr, "CleanupContentMetaDatabase"}, + {9, nullptr, "ActivateContentStorage"}, + {10, nullptr, "InactivateContentStorage"}, + {11, nullptr, "ActivateContentMetaDatabase"}, + {12, nullptr, "InactivateContentMetaDatabase"}, + {13, nullptr, "InvalidateRightsIdCache"}, + {14, nullptr, "GetMemoryReport"}, + {15, nullptr, "ActivateFsContentStorage"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -400,39 +425,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system, storage_id); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateContentStorage"}, - FunctionInfo{1, nullptr, "CreateContentMetaDatabase"}, - FunctionInfo{2, nullptr, "VerifyContentStorage"}, - FunctionInfo{3, nullptr, "VerifyContentMetaDatabase"}, - FunctionInfo{4, &NCM::OpenContentStorage, "OpenContentStorage"}, - FunctionInfo{5, &NCM::OpenContentMetaDatabase, "OpenContentMetaDatabase"}, - FunctionInfo{6, nullptr, "CloseContentStorageForcibly"}, - FunctionInfo{7, nullptr, "CloseContentMetaDatabaseForcibly"}, - FunctionInfo{8, nullptr, "CleanupContentMetaDatabase"}, - FunctionInfo{9, nullptr, "ActivateContentStorage"}, - FunctionInfo{10, nullptr, "InactivateContentStorage"}, - FunctionInfo{11, nullptr, "ActivateContentMetaDatabase"}, - FunctionInfo{12, nullptr, "InactivateContentMetaDatabase"}, - FunctionInfo{13, nullptr, "InvalidateRightsIdCache"}, - FunctionInfo{14, nullptr, "GetMemoryReport"}, - FunctionInfo{15, nullptr, "ActivateFsContentStorage"} - ); }; class NCM_V final : public ServiceFramework { public: explicit NCM_V(Core::System& system_) : ServiceFramework{system_, "ncm:v"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + {0, nullptr, "GetSystemVersion"}, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetSystemVersion"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/ncm/ncm.h b/src/core/hle/service/ncm/ncm.h index b78efdcd79..1d8bc7a9ea 100644 --- a/src/core/hle/service/ncm/ncm.h +++ b/src/core/hle/service/ncm/ncm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nfc/common/device.h b/src/core/hle/service/nfc/common/device.h index d59202d18f..98063bbc29 100644 --- a/src/core/hle/service/nfc/common/device.h +++ b/src/core/hle/service/nfc/common/device.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nfc/common/device_manager.h b/src/core/hle/service/nfc/common/device_manager.h index 6c0e6b255e..116ae8cb7e 100644 --- a/src/core/hle/service/nfc/common/device_manager.h +++ b/src/core/hle/service/nfc/common/device_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nfc/mifare_result.h b/src/core/hle/service/nfc/mifare_result.h index 16a9171e60..399f01313e 100644 --- a/src/core/hle/service/nfc/mifare_result.h +++ b/src/core/hle/service/nfc/mifare_result.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nfc/mifare_types.h b/src/core/hle/service/nfc/mifare_types.h index 4679373994..237f60f0de 100644 --- a/src/core/hle/service/nfc/mifare_types.h +++ b/src/core/hle/service/nfc/mifare_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp index d3a986faea..f64445835e 100644 --- a/src/core/hle/service/nfc/nfc.cpp +++ b/src/core/hle/service/nfc/nfc.cpp @@ -18,71 +18,74 @@ namespace Service::NFC { class IUser final : public NfcInterface { public: - explicit IUser(Core::System& system_) : NfcInterface(system_, "NFC::IUser", BackendType::Nfc) {} + explicit IUser(Core::System& system_) : NfcInterface(system_, "NFC::IUser", BackendType::Nfc) { + // clang-format off + static const FunctionInfo functions[] = { + {0, &NfcInterface::Initialize, "InitializeOld"}, + {1, &NfcInterface::Finalize, "FinalizeOld"}, + {2, &NfcInterface::GetState, "GetStateOld"}, + {3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"}, + {400, &NfcInterface::Initialize, "Initialize"}, + {401, &NfcInterface::Finalize, "Finalize"}, + {402, &NfcInterface::GetState, "GetState"}, + {403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"}, + {404, &NfcInterface::ListDevices, "ListDevices"}, + {405, &NfcInterface::GetDeviceState, "GetDeviceState"}, + {406, &NfcInterface::GetNpadId, "GetNpadId"}, + {407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + {408, &NfcInterface::StartDetection, "StartDetection"}, + {409, &NfcInterface::StopDetection, "StopDetection"}, + {410, &NfcInterface::GetTagInfo, "GetTagInfo"}, + {411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"}, + {412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"}, + {1000, &NfcInterface::ReadMifare, "ReadMifare"}, + {1001, &NfcInterface::WriteMifare ,"WriteMifare"}, + {1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"}, + {1301, nullptr, "KeepPassThroughSession"}, + {1302, nullptr, "ReleasePassThroughSession"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMapWithClass( - FunctionInfoTyped{0, &NfcInterface::Initialize, "InitializeOld"}, - FunctionInfoTyped{1, &NfcInterface::Finalize, "FinalizeOld"}, - FunctionInfoTyped{2, &NfcInterface::GetState, "GetStateOld"}, - FunctionInfoTyped{3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"}, - FunctionInfoTyped{400, &NfcInterface::Initialize, "Initialize"}, - FunctionInfoTyped{401, &NfcInterface::Finalize, "Finalize"}, - FunctionInfoTyped{402, &NfcInterface::GetState, "GetState"}, - FunctionInfoTyped{403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"}, - FunctionInfoTyped{404, &NfcInterface::ListDevices, "ListDevices"}, - FunctionInfoTyped{405, &NfcInterface::GetDeviceState, "GetDeviceState"}, - FunctionInfoTyped{406, &NfcInterface::GetNpadId, "GetNpadId"}, - FunctionInfoTyped{407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - FunctionInfoTyped{408, &NfcInterface::StartDetection, "StartDetection"}, - FunctionInfoTyped{409, &NfcInterface::StopDetection, "StopDetection"}, - FunctionInfoTyped{410, &NfcInterface::GetTagInfo, "GetTagInfo"}, - FunctionInfoTyped{411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"}, - FunctionInfoTyped{412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"}, - FunctionInfoTyped{1000, &NfcInterface::ReadMifare, "ReadMifare"}, - FunctionInfoTyped{1001, &NfcInterface::WriteMifare ,"WriteMifare"}, - FunctionInfoTyped{1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"}, - FunctionInfoTyped{1301, nullptr, "KeepPassThroughSession"}, - FunctionInfoTyped{1302, nullptr, "ReleasePassThroughSession"} - ); }; class ISystem final : public NfcInterface { public: - explicit ISystem(Core::System& system_) : NfcInterface{system_, "NFC::ISystem", BackendType::Nfc} {} + explicit ISystem(Core::System& system_) + : NfcInterface{system_, "NFC::ISystem", BackendType::Nfc} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &NfcInterface::Initialize, "InitializeOld"}, + {1, &NfcInterface::Finalize, "FinalizeOld"}, + {2, &NfcInterface::GetState, "GetStateOld"}, + {3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"}, + {100, &NfcInterface::SetNfcEnabled, "SetNfcEnabledOld"}, + {400, &NfcInterface::Initialize, "Initialize"}, + {401, &NfcInterface::Finalize, "Finalize"}, + {402, &NfcInterface::GetState, "GetState"}, + {403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"}, + {404, &NfcInterface::ListDevices, "ListDevices"}, + {405, &NfcInterface::GetDeviceState, "GetDeviceState"}, + {406, &NfcInterface::GetNpadId, "GetNpadId"}, + {407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + {408, &NfcInterface::StartDetection, "StartDetection"}, + {409, &NfcInterface::StopDetection, "StopDetection"}, + {410, &NfcInterface::GetTagInfo, "GetTagInfo"}, + {411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"}, + {412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"}, + {500, &NfcInterface::SetNfcEnabled, "SetNfcEnabled"}, + {510, nullptr, "OutputTestWave"}, + {1000, &NfcInterface::ReadMifare, "ReadMifare"}, + {1001, &NfcInterface::WriteMifare, "WriteMifare"}, + {1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"}, + {1301, nullptr, "KeepPassThroughSession"}, + {1302, nullptr, "ReleasePassThroughSession"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMapWithClass( - FunctionInfoTyped{0, &NfcInterface::Initialize, "InitializeOld"}, - FunctionInfoTyped{1, &NfcInterface::Finalize, "FinalizeOld"}, - FunctionInfoTyped{2, &NfcInterface::GetState, "GetStateOld"}, - FunctionInfoTyped{3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"}, - FunctionInfoTyped{100, &NfcInterface::SetNfcEnabled, "SetNfcEnabledOld"}, - FunctionInfoTyped{400, &NfcInterface::Initialize, "Initialize"}, - FunctionInfoTyped{401, &NfcInterface::Finalize, "Finalize"}, - FunctionInfoTyped{402, &NfcInterface::GetState, "GetState"}, - FunctionInfoTyped{403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"}, - FunctionInfoTyped{404, &NfcInterface::ListDevices, "ListDevices"}, - FunctionInfoTyped{405, &NfcInterface::GetDeviceState, "GetDeviceState"}, - FunctionInfoTyped{406, &NfcInterface::GetNpadId, "GetNpadId"}, - FunctionInfoTyped{407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - FunctionInfoTyped{408, &NfcInterface::StartDetection, "StartDetection"}, - FunctionInfoTyped{409, &NfcInterface::StopDetection, "StopDetection"}, - FunctionInfoTyped{410, &NfcInterface::GetTagInfo, "GetTagInfo"}, - FunctionInfoTyped{411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"}, - FunctionInfoTyped{412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"}, - FunctionInfoTyped{500, &NfcInterface::SetNfcEnabled, "SetNfcEnabled"}, - FunctionInfoTyped{510, nullptr, "OutputTestWave"}, - FunctionInfoTyped{1000, &NfcInterface::ReadMifare, "ReadMifare"}, - FunctionInfoTyped{1001, &NfcInterface::WriteMifare, "WriteMifare"}, - FunctionInfoTyped{1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"}, - FunctionInfoTyped{1301, nullptr, "KeepPassThroughSession"}, - FunctionInfoTyped{1302, nullptr, "ReleasePassThroughSession"} - ); }; // MFInterface has an unique interface but it's identical to NfcInterface so we can keep the code @@ -90,49 +93,56 @@ public: using MFInterface = NfcInterface; class MFIUser final : public MFInterface { public: - explicit MFIUser(Core::System& system_) : MFInterface{system_, "NFC::MFInterface", BackendType::Mifare} {} + explicit MFIUser(Core::System& system_) + : MFInterface{system_, "NFC::MFInterface", BackendType::Mifare} { + // clang-format off + static const FunctionInfoTyped functions[] = { + {0, &MFIUser::Initialize, "Initialize"}, + {1, &MFIUser::Finalize, "Finalize"}, + {2, &MFIUser::ListDevices, "ListDevices"}, + {3, &MFIUser::StartDetection, "StartDetection"}, + {4, &MFIUser::StopDetection, "StopDetection"}, + {5, &MFIUser::ReadMifare, "Read"}, + {6, &MFIUser::WriteMifare, "Write"}, + {7, &MFIUser::GetTagInfo, "GetTagInfo"}, + {8, &MFIUser::AttachActivateEvent, "GetActivateEventHandle"}, + {9, &MFIUser::AttachDeactivateEvent, "GetDeactivateEventHandle"}, + {10, &MFIUser::GetState, "GetState"}, + {11, &MFIUser::GetDeviceState, "GetDeviceState"}, + {12, &MFIUser::GetNpadId, "GetNpadId"}, + {13, &MFIUser::AttachAvailabilityChangeEvent, "GetAvailabilityChangeEventHandle"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMapWithClass( - FunctionInfoTyped{0, &MFIUser::Initialize, "Initialize"}, - FunctionInfoTyped{1, &MFIUser::Finalize, "Finalize"}, - FunctionInfoTyped{2, &MFIUser::ListDevices, "ListDevices"}, - FunctionInfoTyped{3, &MFIUser::StartDetection, "StartDetection"}, - FunctionInfoTyped{4, &MFIUser::StopDetection, "StopDetection"}, - FunctionInfoTyped{5, &MFIUser::ReadMifare, "Read"}, - FunctionInfoTyped{6, &MFIUser::WriteMifare, "Write"}, - FunctionInfoTyped{7, &MFIUser::GetTagInfo, "GetTagInfo"}, - FunctionInfoTyped{8, &MFIUser::AttachActivateEvent, "GetActivateEventHandle"}, - FunctionInfoTyped{9, &MFIUser::AttachDeactivateEvent, "GetDeactivateEventHandle"}, - FunctionInfoTyped{10, &MFIUser::GetState, "GetState"}, - FunctionInfoTyped{11, &MFIUser::GetDeviceState, "GetDeviceState"}, - FunctionInfoTyped{12, &MFIUser::GetNpadId, "GetNpadId"}, - FunctionInfoTyped{13, &MFIUser::AttachAvailabilityChangeEvent, "GetAvailabilityChangeEventHandle"} - ); }; class IAm final : public ServiceFramework { public: - explicit IAm(Core::System& system_) : ServiceFramework{system_, "NFC::IAm"} {} + explicit IAm(Core::System& system_) : ServiceFramework{system_, "NFC::IAm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "Finalize"}, + {2, nullptr, "NotifyForegroundApplet"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{1, nullptr, "Finalize"}, - FunctionInfo{2, nullptr, "NotifyForegroundApplet"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class NFC_AM final : public ServiceFramework { public: - explicit NFC_AM(Core::System& system_) : ServiceFramework{system_, "nfc:am"} {} + explicit NFC_AM(Core::System& system_) : ServiceFramework{system_, "nfc:am"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &NFC_AM::CreateAmNfcInterface, "CreateAmNfcInterface"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -143,18 +153,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &NFC_AM::CreateAmNfcInterface, "CreateAmNfcInterface"} - ); }; class NFC_MF_U final : public ServiceFramework { public: - explicit NFC_MF_U(Core::System& system_) : ServiceFramework{system_, "nfc:mf:u"} {} + explicit NFC_MF_U(Core::System& system_) : ServiceFramework{system_, "nfc:mf:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &NFC_MF_U::CreateUserNfcInterface, "CreateUserNfcInterface"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -165,18 +175,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &NFC_MF_U::CreateUserNfcInterface, "CreateUserNfcInterface"} - ); }; class NFC_U final : public ServiceFramework { public: - explicit NFC_U(Core::System& system_) : ServiceFramework{system_, "nfc:user"} {} + explicit NFC_U(Core::System& system_) : ServiceFramework{system_, "nfc:user"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &NFC_U::CreateUserNfcInterface, "CreateUserNfcInterface"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -187,18 +197,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &NFC_U::CreateUserNfcInterface, "CreateUserNfcInterface"} - ); }; class NFC_SYS final : public ServiceFramework { public: - explicit NFC_SYS(Core::System& system_) : ServiceFramework{system_, "nfc:sys"} {} + explicit NFC_SYS(Core::System& system_) : ServiceFramework{system_, "nfc:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &NFC_SYS::CreateSystemNfcInterface, "CreateSystemNfcInterface"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -209,10 +219,6 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &NFC_SYS::CreateSystemNfcInterface, "CreateSystemNfcInterface"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/nfc/nfc.h b/src/core/hle/service/nfc/nfc.h index d15955b755..bfda30d6f1 100644 --- a/src/core/hle/service/nfc/nfc.h +++ b/src/core/hle/service/nfc/nfc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nfc/nfc_interface.h b/src/core/hle/service/nfc/nfc_interface.h index 5cc0d8ec04..a1e0d8d9ca 100644 --- a/src/core/hle/service/nfc/nfc_interface.h +++ b/src/core/hle/service/nfc/nfc_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nfc/nfc_result.h b/src/core/hle/service/nfc/nfc_result.h index 464b5fd69a..aab83c326c 100644 --- a/src/core/hle/service/nfc/nfc_result.h +++ b/src/core/hle/service/nfc/nfc_result.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nfc/nfc_types.h b/src/core/hle/service/nfc/nfc_types.h index 6d44014ea1..6774a9b4d6 100644 --- a/src/core/hle/service/nfc/nfc_types.h +++ b/src/core/hle/service/nfc/nfc_types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index bfeb7d5553..e0c24679ab 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -14,134 +14,145 @@ namespace Service::NFP { class IUser final : public Interface { public: - explicit IUser(Core::System& system_) : Interface(system_, "NFP:IUser") {} + explicit IUser(Core::System& system_) : Interface(system_, "NFP:IUser") { + // clang-format off + static const FunctionInfoTyped functions[] = { + {0, &IUser::Initialize, "Initialize"}, + {1, &IUser::Finalize, "Finalize"}, + {2, &IUser::ListDevices, "ListDevices"}, + {3, &IUser::StartDetection, "StartDetection"}, + {4, &IUser::StopDetection, "StopDetection"}, + {5, &IUser::Mount, "Mount"}, + {6, &IUser::Unmount, "Unmount"}, + {7, &IUser::OpenApplicationArea, "OpenApplicationArea"}, + {8, &IUser::GetApplicationArea, "GetApplicationArea"}, + {9, &IUser::SetApplicationArea, "SetApplicationArea"}, + {10, &IUser::Flush, "Flush"}, + {11, &IUser::Restore, "Restore"}, + {12, &IUser::CreateApplicationArea, "CreateApplicationArea"}, + {13, &IUser::GetTagInfo, "GetTagInfo"}, + {14, &IUser::GetRegisterInfo, "GetRegisterInfo"}, + {15, &IUser::GetCommonInfo, "GetCommonInfo"}, + {16, &IUser::GetModelInfo, "GetModelInfo"}, + {17, &IUser::AttachActivateEvent, "AttachActivateEvent"}, + {18, &IUser::AttachDeactivateEvent, "AttachDeactivateEvent"}, + {19, &IUser::GetState, "GetState"}, + {20, &IUser::GetDeviceState, "GetDeviceState"}, + {21, &IUser::GetNpadId, "GetNpadId"}, + {22, &IUser::GetApplicationAreaSize, "GetApplicationAreaSize"}, + {23, &IUser::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + {24, &IUser::RecreateApplicationArea, "RecreateApplicationArea"}, + {25, &IUser::StartDetection, "StartDetectionWithFilter"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMapWithClass( - FunctionInfoTyped{0, &IUser::Initialize, "Initialize"}, - FunctionInfoTyped{1, &IUser::Finalize, "Finalize"}, - FunctionInfoTyped{2, &IUser::ListDevices, "ListDevices"}, - FunctionInfoTyped{3, &IUser::StartDetection, "StartDetection"}, - FunctionInfoTyped{4, &IUser::StopDetection, "StopDetection"}, - FunctionInfoTyped{5, &IUser::Mount, "Mount"}, - FunctionInfoTyped{6, &IUser::Unmount, "Unmount"}, - FunctionInfoTyped{7, &IUser::OpenApplicationArea, "OpenApplicationArea"}, - FunctionInfoTyped{8, &IUser::GetApplicationArea, "GetApplicationArea"}, - FunctionInfoTyped{9, &IUser::SetApplicationArea, "SetApplicationArea"}, - FunctionInfoTyped{10, &IUser::Flush, "Flush"}, - FunctionInfoTyped{11, &IUser::Restore, "Restore"}, - FunctionInfoTyped{12, &IUser::CreateApplicationArea, "CreateApplicationArea"}, - FunctionInfoTyped{13, &IUser::GetTagInfo, "GetTagInfo"}, - FunctionInfoTyped{14, &IUser::GetRegisterInfo, "GetRegisterInfo"}, - FunctionInfoTyped{15, &IUser::GetCommonInfo, "GetCommonInfo"}, - FunctionInfoTyped{16, &IUser::GetModelInfo, "GetModelInfo"}, - FunctionInfoTyped{17, &IUser::AttachActivateEvent, "AttachActivateEvent"}, - FunctionInfoTyped{18, &IUser::AttachDeactivateEvent, "AttachDeactivateEvent"}, - FunctionInfoTyped{19, &IUser::GetState, "GetState"}, - FunctionInfoTyped{20, &IUser::GetDeviceState, "GetDeviceState"}, - FunctionInfoTyped{21, &IUser::GetNpadId, "GetNpadId"}, - FunctionInfoTyped{22, &IUser::GetApplicationAreaSize, "GetApplicationAreaSize"}, - FunctionInfoTyped{23, &IUser::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - FunctionInfoTyped{24, &IUser::RecreateApplicationArea, "RecreateApplicationArea"}, - FunctionInfoTyped{25, &IUser::StartDetection, "StartDetectionWithFilter"} - ); }; class ISystem final : public Interface { public: - explicit ISystem(Core::System& system_) : Interface(system_, "NFP:ISystem") {} + explicit ISystem(Core::System& system_) : Interface(system_, "NFP:ISystem") { + // clang-format off + static const FunctionInfoTyped functions[] = { + {0, &ISystem::InitializeSystem, "InitializeSystem"}, + {1, &ISystem::FinalizeSystem, "FinalizeSystem"}, + {2, &ISystem::ListDevices, "ListDevices"}, + {3, &ISystem::StartDetection, "StartDetection"}, + {4, &ISystem::StopDetection, "StopDetection"}, + {5, &ISystem::Mount, "Mount"}, + {6, &ISystem::Unmount, "Unmount"}, + {10, &ISystem::Flush, "Flush"}, + {11, &ISystem::Restore, "Restore"}, + {12, &ISystem::CreateApplicationArea, "CreateApplicationArea"}, + {13, &ISystem::GetTagInfo, "GetTagInfo"}, + {14, &ISystem::GetRegisterInfo, "GetRegisterInfo"}, + {15, &ISystem::GetCommonInfo, "GetCommonInfo"}, + {16, &ISystem::GetModelInfo, "GetModelInfo"}, + {17, &ISystem::AttachActivateEvent, "AttachActivateEvent"}, + {18, &ISystem::AttachDeactivateEvent, "AttachDeactivateEvent"}, + {19, &ISystem::GetState, "GetState"}, + {20, &ISystem::GetDeviceState, "GetDeviceState"}, + {21, &ISystem::GetNpadId, "GetNpadId"}, + {23, &ISystem::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + {25, &ISystem::StartDetection, "StartDetectionWithFilter"}, + {100, &ISystem::Format, "Format"}, + {101, &ISystem::GetAdminInfo, "GetAdminInfo"}, + {102, &ISystem::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"}, + {103, &ISystem::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"}, + {104, &ISystem::DeleteRegisterInfo, "DeleteRegisterInfo"}, + {105, &ISystem::DeleteApplicationArea, "DeleteApplicationArea"}, + {106, &ISystem::ExistsApplicationArea, "ExistsApplicationArea"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMapWithClass( - FunctionInfoTyped{0, &ISystem::InitializeSystem, "InitializeSystem"}, - FunctionInfoTyped{1, &ISystem::FinalizeSystem, "FinalizeSystem"}, - FunctionInfoTyped{2, &ISystem::ListDevices, "ListDevices"}, - FunctionInfoTyped{3, &ISystem::StartDetection, "StartDetection"}, - FunctionInfoTyped{4, &ISystem::StopDetection, "StopDetection"}, - FunctionInfoTyped{5, &ISystem::Mount, "Mount"}, - FunctionInfoTyped{6, &ISystem::Unmount, "Unmount"}, - FunctionInfoTyped{10, &ISystem::Flush, "Flush"}, - FunctionInfoTyped{11, &ISystem::Restore, "Restore"}, - FunctionInfoTyped{12, &ISystem::CreateApplicationArea, "CreateApplicationArea"}, - FunctionInfoTyped{13, &ISystem::GetTagInfo, "GetTagInfo"}, - FunctionInfoTyped{14, &ISystem::GetRegisterInfo, "GetRegisterInfo"}, - FunctionInfoTyped{15, &ISystem::GetCommonInfo, "GetCommonInfo"}, - FunctionInfoTyped{16, &ISystem::GetModelInfo, "GetModelInfo"}, - FunctionInfoTyped{17, &ISystem::AttachActivateEvent, "AttachActivateEvent"}, - FunctionInfoTyped{18, &ISystem::AttachDeactivateEvent, "AttachDeactivateEvent"}, - FunctionInfoTyped{19, &ISystem::GetState, "GetState"}, - FunctionInfoTyped{20, &ISystem::GetDeviceState, "GetDeviceState"}, - FunctionInfoTyped{21, &ISystem::GetNpadId, "GetNpadId"}, - FunctionInfoTyped{23, &ISystem::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - FunctionInfoTyped{25, &ISystem::StartDetection, "StartDetectionWithFilter"}, - FunctionInfoTyped{100, &ISystem::Format, "Format"}, - FunctionInfoTyped{101, &ISystem::GetAdminInfo, "GetAdminInfo"}, - FunctionInfoTyped{102, &ISystem::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"}, - FunctionInfoTyped{103, &ISystem::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"}, - FunctionInfoTyped{104, &ISystem::DeleteRegisterInfo, "DeleteRegisterInfo"}, - FunctionInfoTyped{105, &ISystem::DeleteApplicationArea, "DeleteApplicationArea"}, - FunctionInfoTyped{106, &ISystem::ExistsApplicationArea, "ExistsApplicationArea"} - ); }; class IDebug final : public Interface { public: - explicit IDebug(Core::System& system_) : Interface(system_, "NFP:IDebug") {} + explicit IDebug(Core::System& system_) : Interface(system_, "NFP:IDebug") { + // clang-format off + static const FunctionInfoTyped functions[] = { + {0, &IDebug::InitializeDebug, "InitializeDebug"}, + {1, &IDebug::FinalizeDebug, "FinalizeDebug"}, + {2, &IDebug::ListDevices, "ListDevices"}, + {3, &IDebug::StartDetection, "StartDetection"}, + {4, &IDebug::StopDetection, "StopDetection"}, + {5, &IDebug::Mount, "Mount"}, + {6, &IDebug::Unmount, "Unmount"}, + {7, &IDebug::OpenApplicationArea, "OpenApplicationArea"}, + {8, &IDebug::GetApplicationArea, "GetApplicationArea"}, + {9, &IDebug::SetApplicationArea, "SetApplicationArea"}, + {10, &IDebug::Flush, "Flush"}, + {11, &IDebug::Restore, "Restore"}, + {12, &IDebug::CreateApplicationArea, "CreateApplicationArea"}, + {13, &IDebug::GetTagInfo, "GetTagInfo"}, + {14, &IDebug::GetRegisterInfo, "GetRegisterInfo"}, + {15, &IDebug::GetCommonInfo, "GetCommonInfo"}, + {16, &IDebug::GetModelInfo, "GetModelInfo"}, + {17, &IDebug::AttachActivateEvent, "AttachActivateEvent"}, + {18, &IDebug::AttachDeactivateEvent, "AttachDeactivateEvent"}, + {19, &IDebug::GetState, "GetState"}, + {20, &IDebug::GetDeviceState, "GetDeviceState"}, + {21, &IDebug::GetNpadId, "GetNpadId"}, + {22, &IDebug::GetApplicationAreaSize, "GetApplicationAreaSize"}, + {23, &IDebug::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, + {24, &IDebug::RecreateApplicationArea, "RecreateApplicationArea"}, + {25, &IDebug::StartDetection, "StartDetectionWithFilter"}, + {100, &IDebug::Format, "Format"}, + {101, &IDebug::GetAdminInfo, "GetAdminInfo"}, + {102, &IDebug::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"}, + {103, &IDebug::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"}, + {104, &IDebug::DeleteRegisterInfo, "DeleteRegisterInfo"}, + {105, &IDebug::DeleteApplicationArea, "DeleteApplicationArea"}, + {106, &IDebug::ExistsApplicationArea, "ExistsApplicationArea"}, + {200, &IDebug::GetAll, "GetAll"}, + {201, &IDebug::SetAll, "SetAll"}, + {202, &IDebug::FlushDebug, "FlushDebug"}, + {203, &IDebug::BreakTag, "BreakTag"}, + {204, &IDebug::ReadBackupData, "ReadBackupData"}, + {205, &IDebug::WriteBackupData, "WriteBackupData"}, + {206, &IDebug::WriteNtf, "WriteNtf"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMapWithClass( - FunctionInfoTyped{0, &IDebug::InitializeDebug, "InitializeDebug"}, - FunctionInfoTyped{1, &IDebug::FinalizeDebug, "FinalizeDebug"}, - FunctionInfoTyped{2, &IDebug::ListDevices, "ListDevices"}, - FunctionInfoTyped{3, &IDebug::StartDetection, "StartDetection"}, - FunctionInfoTyped{4, &IDebug::StopDetection, "StopDetection"}, - FunctionInfoTyped{5, &IDebug::Mount, "Mount"}, - FunctionInfoTyped{6, &IDebug::Unmount, "Unmount"}, - FunctionInfoTyped{7, &IDebug::OpenApplicationArea, "OpenApplicationArea"}, - FunctionInfoTyped{8, &IDebug::GetApplicationArea, "GetApplicationArea"}, - FunctionInfoTyped{9, &IDebug::SetApplicationArea, "SetApplicationArea"}, - FunctionInfoTyped{10, &IDebug::Flush, "Flush"}, - FunctionInfoTyped{11, &IDebug::Restore, "Restore"}, - FunctionInfoTyped{12, &IDebug::CreateApplicationArea, "CreateApplicationArea"}, - FunctionInfoTyped{13, &IDebug::GetTagInfo, "GetTagInfo"}, - FunctionInfoTyped{14, &IDebug::GetRegisterInfo, "GetRegisterInfo"}, - FunctionInfoTyped{15, &IDebug::GetCommonInfo, "GetCommonInfo"}, - FunctionInfoTyped{16, &IDebug::GetModelInfo, "GetModelInfo"}, - FunctionInfoTyped{17, &IDebug::AttachActivateEvent, "AttachActivateEvent"}, - FunctionInfoTyped{18, &IDebug::AttachDeactivateEvent, "AttachDeactivateEvent"}, - FunctionInfoTyped{19, &IDebug::GetState, "GetState"}, - FunctionInfoTyped{20, &IDebug::GetDeviceState, "GetDeviceState"}, - FunctionInfoTyped{21, &IDebug::GetNpadId, "GetNpadId"}, - FunctionInfoTyped{22, &IDebug::GetApplicationAreaSize, "GetApplicationAreaSize"}, - FunctionInfoTyped{23, &IDebug::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, - FunctionInfoTyped{24, &IDebug::RecreateApplicationArea, "RecreateApplicationArea"}, - FunctionInfoTyped{25, &IDebug::StartDetection, "StartDetectionWithFilter"}, - FunctionInfoTyped{100, &IDebug::Format, "Format"}, - FunctionInfoTyped{101, &IDebug::GetAdminInfo, "GetAdminInfo"}, - FunctionInfoTyped{102, &IDebug::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"}, - FunctionInfoTyped{103, &IDebug::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"}, - FunctionInfoTyped{104, &IDebug::DeleteRegisterInfo, "DeleteRegisterInfo"}, - FunctionInfoTyped{105, &IDebug::DeleteApplicationArea, "DeleteApplicationArea"}, - FunctionInfoTyped{106, &IDebug::ExistsApplicationArea, "ExistsApplicationArea"}, - FunctionInfoTyped{200, &IDebug::GetAll, "GetAll"}, - FunctionInfoTyped{201, &IDebug::SetAll, "SetAll"}, - FunctionInfoTyped{202, &IDebug::FlushDebug, "FlushDebug"}, - FunctionInfoTyped{203, &IDebug::BreakTag, "BreakTag"}, - FunctionInfoTyped{204, &IDebug::ReadBackupData, "ReadBackupData"}, - FunctionInfoTyped{205, &IDebug::WriteBackupData, "WriteBackupData"}, - FunctionInfoTyped{206, &IDebug::WriteNtf, "WriteNtf"} - ); }; class IUserManager final : public ServiceFramework { public: - explicit IUserManager(Core::System& system_) : ServiceFramework{system_, "nfp:user"} {} + explicit IUserManager(Core::System& system_) : ServiceFramework{system_, "nfp:user"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IUserManager::CreateUserInterface, "CreateUserInterface"}, + }; + // clang-format on + + RegisterHandlers(functions); + } private: void CreateUserInterface(HLERequestContext& ctx) { @@ -151,21 +162,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IUserManager::CreateUserInterface, "CreateUserInterface"} - ); }; class ISystemManager final : public ServiceFramework { public: - explicit ISystemManager(Core::System& system_) : ServiceFramework{system_, "nfp:sys"} {} + explicit ISystemManager(Core::System& system_) : ServiceFramework{system_, "nfp:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &ISystemManager::CreateSystemInterface, "CreateSystemInterface"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -176,18 +184,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ISystemManager::CreateSystemInterface, "CreateSystemInterface"} - ); }; class IDebugManager final : public ServiceFramework { public: - explicit IDebugManager(Core::System& system_) : ServiceFramework{system_, "nfp:dbg"} {} + explicit IDebugManager(Core::System& system_) : ServiceFramework{system_, "nfp:dbg"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IDebugManager::CreateDebugInterface, "CreateDebugInterface"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -198,10 +206,6 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IDebugManager::CreateDebugInterface, "CreateDebugInterface"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/nfp/nfp.h b/src/core/hle/service/nfp/nfp.h index a5aac710b5..e7af7ae39d 100644 --- a/src/core/hle/service/nfp/nfp.h +++ b/src/core/hle/service/nfp/nfp.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nfp/nfp_interface.h b/src/core/hle/service/nfp/nfp_interface.h index fa985b068e..531db84652 100644 --- a/src/core/hle/service/nfp/nfp_interface.h +++ b/src/core/hle/service/nfp/nfp_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nfp/nfp_result.h b/src/core/hle/service/nfp/nfp_result.h index 6185338438..528b5417fa 100644 --- a/src/core/hle/service/nfp/nfp_result.h +++ b/src/core/hle/service/nfp/nfp_result.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nfp/nfp_types.h b/src/core/hle/service/nfp/nfp_types.h index 8330134d18..108548ea46 100644 --- a/src/core/hle/service/nfp/nfp_types.h +++ b/src/core/hle/service/nfp/nfp_types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project diff --git a/src/core/hle/service/ngc/ngc.cpp b/src/core/hle/service/ngc/ngc.cpp index fb3ef39093..e79108a1eb 100644 --- a/src/core/hle/service/ngc/ngc.cpp +++ b/src/core/hle/service/ngc/ngc.cpp @@ -21,10 +21,15 @@ namespace Service::NGC { class IService final : public ServiceFramework { public: - explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} {} + explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IService::Match, "Match"}, + {1, &IService::Filter, "Filter"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -56,19 +61,23 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IService::Match, "Match"}, - FunctionInfo{1, &IService::Filter, "Filter"} - ); }; class NgcServiceImpl final : public ServiceFramework { public: - explicit NgcServiceImpl(Core::System& system_) : ServiceFramework(system_, "ngc:u") {} + explicit NgcServiceImpl(Core::System& system_) : ServiceFramework(system_, "ngc:u") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &NgcServiceImpl::GetContentVersion, "GetContentVersion"}, + {1, &NgcServiceImpl::Check, "Check"}, + {2, &NgcServiceImpl::Mask, "Mask"}, + {3, &NgcServiceImpl::Reload, "Reload"}, + {4, &NgcServiceImpl::Check, "Check2"}, + {5, &NgcServiceImpl::Mask, "Mask2"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -141,34 +150,25 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &NgcServiceImpl::GetContentVersion, "GetContentVersion"}, - FunctionInfo{1, &NgcServiceImpl::Check, "Check"}, - FunctionInfo{2, &NgcServiceImpl::Mask, "Mask"}, - FunctionInfo{3, &NgcServiceImpl::Reload, "Reload"}, - FunctionInfo{4, &NgcServiceImpl::Check, "Check2"}, - FunctionInfo{5, &NgcServiceImpl::Mask, "Mask2"} - ); }; class IServiceWithManagementApi final : public ServiceFramework { public: - explicit IServiceWithManagementApi(Core::System& system_) : ServiceFramework(system_, "ngct:s") {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Match"}, - FunctionInfo{1, nullptr, "Filter"}, - FunctionInfo{100, nullptr, "ConfigureAutoUpdateSetting"}, - FunctionInfo{101, nullptr, "RequestResourceUpdateCheck"}, - FunctionInfo{110, nullptr, "Reload"}, - FunctionInfo{111, nullptr, "IsReloadRequired"}, - FunctionInfo{112, nullptr, "TryAcquireReloadRequestNotifier"}, - FunctionInfo{120, nullptr, "CalculateContentFingerprint"}, - FunctionInfo{130, nullptr, "TryEnableTemporalPassThrough"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit IServiceWithManagementApi(Core::System& system_) : ServiceFramework(system_, "ngct:s") { + // clang-format off + static const FunctionInfo functions[] = { + {0 , nullptr, "Match"}, + {1 , nullptr, "Filter"}, + {100, nullptr, "ConfigureAutoUpdateSetting"}, + {101, nullptr, "RequestResourceUpdateCheck"}, + {110, nullptr, "Reload"}, + {111, nullptr, "IsReloadRequired"}, + {112, nullptr, "TryAcquireReloadRequestNotifier"}, + {120, nullptr, "CalculateContentFingerprint"}, + {130, nullptr, "TryEnableTemporalPassThrough"}, + }; + // clang-format on + RegisterHandlers(functions); } }; @@ -179,10 +179,20 @@ static_assert(sizeof(SaveDataHandle) == 0x08); class IUserShimScopedObject final : public ServiceFramework { public: - explicit IUserShimScopedObject(Core::System& system_) : ServiceFramework(system_, "IUserShimScopedObject") {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit IUserShimScopedObject(Core::System& system_) : ServiceFramework(system_, "IUserShimScopedObject") { + // clang-format off + static const FunctionInfo functions[] = { + {450, nullptr, "InitializeForSaveData"}, + {451, nullptr, "FinalizeForSaveData"}, + {452, D<&IUserShimScopedObject::OpenSaveData>, "OpenSaveData"}, + {453, nullptr, "CloseSaveData"}, + {454, D<&IUserShimScopedObject::ReadSaveSlot>, "ReadSaveSlot"}, + {455, D<&IUserShimScopedObject::WriteSaveSlot>, "WriteSaveSlot"}, + {456, nullptr, "FlushSaveSlot"}, + {457, nullptr, "CommitSaveData"}, + }; + // clang-format on + RegisterHandlers(functions); } Result OpenSaveData(Account::Uid unk0, Out unk1) { @@ -200,43 +210,42 @@ public: // to implement R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{450, nullptr, "InitializeForSaveData"}, - FunctionInfo{451, nullptr, "FinalizeForSaveData"}, - FunctionInfo{452, D<&IUserShimScopedObject::OpenSaveData>, "OpenSaveData"}, - FunctionInfo{453, nullptr, "CloseSaveData"}, - FunctionInfo{454, D<&IUserShimScopedObject::ReadSaveSlot>, "ReadSaveSlot"}, - FunctionInfo{455, D<&IUserShimScopedObject::WriteSaveSlot>, "WriteSaveSlot"}, - FunctionInfo{456, nullptr, "FlushSaveSlot"}, - FunctionInfo{457, nullptr, "CommitSaveData"} - ); }; class IUserService final : public ServiceFramework { public: - explicit IUserService(Core::System& system_) : ServiceFramework(system_, "stpl:u") {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit IUserService(Core::System& system_) : ServiceFramework(system_, "stpl:u") { + // clang-format off + static const FunctionInfo functions[] = { + {0 , D<&IUserService::Cmd0>, "Cmd0"}, + }; + // clang-format on + RegisterHandlers(functions); } Result Cmd0(u32 unk0, OutInterface out_interface) { LOG_WARNING(Service_NGC, "stubbed"); *out_interface = std::make_shared(system); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IUserService::Cmd0>, "Cmd0"} - ); }; class ISystemShimScopedObject final : public ServiceFramework { public: - explicit ISystemShimScopedObject(Core::System& system_) : ServiceFramework(system_, "ISystemShimScopedObject") {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit ISystemShimScopedObject(Core::System& system_) : ServiceFramework(system_, "ISystemShimScopedObject") { + // clang-format off + static const FunctionInfo functions[] = { + {106, nullptr, "Cmd106"}, + {107, nullptr, "Cmd107"}, + {108, D<&ISystemShimScopedObject::Cmd108>, "Cmd108"}, + {207, nullptr, "Cmd207"}, + {208, D<&ISystemShimScopedObject::Cmd208>, "Cmd208"}, + {209, nullptr, "Cmd209"}, + {210, nullptr, "Cmd210"}, + {211, nullptr, "Cmd211"}, + {212, nullptr, "Cmd212"}, + }; + // clang-format on + RegisterHandlers(functions); } Result Cmd108() { @@ -248,36 +257,23 @@ public: LOG_WARNING(Service_NGC, "stubbed"); R_THROW(IPC::ResultNotSupported); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{106, nullptr, "Cmd106"}, - FunctionInfo{107, nullptr, "Cmd107"}, - FunctionInfo{108, D<&ISystemShimScopedObject::Cmd108>, "Cmd108"}, - FunctionInfo{207, nullptr, "Cmd207"}, - FunctionInfo{208, D<&ISystemShimScopedObject::Cmd208>, "Cmd208"}, - FunctionInfo{209, nullptr, "Cmd209"}, - FunctionInfo{210, nullptr, "Cmd210"}, - FunctionInfo{211, nullptr, "Cmd211"}, - FunctionInfo{212, nullptr, "Cmd212"} - ); }; class ISystemService final : public ServiceFramework { public: - explicit ISystemService(Core::System& system_) : ServiceFramework(system_, "stpl:sys") {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit ISystemService(Core::System& system_) : ServiceFramework(system_, "stpl:sys") { + // clang-format off + static const FunctionInfo functions[] = { + {0 , D<&ISystemService::Cmd0>, "Cmd0"}, + }; + // clang-format on + RegisterHandlers(functions); } Result Cmd0(OutInterface out_interface) { LOG_WARNING(Service_NGC, "stubbed"); *out_interface = std::make_shared(system); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ISystemService::Cmd0>, "Cmd0"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/ngc/ngc.h b/src/core/hle/service/ngc/ngc.h index 823b1aa819..7dc4a46577 100644 --- a/src/core/hle/service/ngc/ngc.h +++ b/src/core/hle/service/ngc/ngc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 5befe8e943..efada9b807 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -235,6 +235,15 @@ public: explicit IScanRequest(Core::System& system_) : ServiceFramework{system_, "IScanRequest"}, svc_ctx{system_, "IScanRequest"} { + static const FunctionInfo functions[] = { + {0, &IScanRequest::Submit, "Submit"}, + {1, &IScanRequest::IsProcessing, "IsProcessing"}, + {2, &IScanRequest::GetResult, "GetResult"}, + {3, &IScanRequest::GetSystemEventReadableHandle, "GetSystemEventReadableHandle"}, + {4, &IScanRequest::SetChannels, "SetChannels"}, + }; + RegisterHandlers(functions); + evt_scan_complete = CreateKEvent(svc_ctx, "IScanRequest:Complete"); evt_processing = CreateKEvent(svc_ctx, "IScanRequest:Processing"); } @@ -248,6 +257,8 @@ public: } private: + std::vector scan_results; + void Submit(HLERequestContext& ctx) { if (state.load() == State::Finished) { @@ -318,17 +329,6 @@ private: evt_scan_complete->Signal(system.Kernel()); } - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IScanRequest::Submit, "Submit"}, - FunctionInfo{1, &IScanRequest::IsProcessing, "IsProcessing"}, - FunctionInfo{2, &IScanRequest::GetResult, "GetResult"}, - FunctionInfo{3, &IScanRequest::GetSystemEventReadableHandle, "GetSystemEventReadableHandle"}, - FunctionInfo{4, &IScanRequest::SetChannels, "SetChannels"} - ); - std::vector scan_results; KernelHelpers::ServiceContext svc_ctx; Kernel::KEvent* evt_scan_complete{}; @@ -342,6 +342,36 @@ class IRequest final : public ServiceFramework { public: explicit IRequest(Core::System& system_) : ServiceFramework{system_, "IRequest"}, service_context{system_, "IRequest"} { + static const FunctionInfo functions[] = { + {0, &IRequest::GetRequestState, "GetRequestState"}, + {1, &IRequest::GetResult, "GetResult"}, + {2, &IRequest::GetSystemEventReadableHandles, "GetSystemEventReadableHandles"}, + {3, &IRequest::Cancel, "Cancel"}, + {4, &IRequest::Submit, "Submit"}, + {5, nullptr, "SetRequirement"}, + {6, &IRequest::SetRequirementPreset, "SetRequirementPreset"}, + {8, nullptr, "SetPriority"}, + {9, &IRequest::SetNetworkProfileId, "SetNetworkProfileId"}, + {10, nullptr, "SetRejectable"}, + {11, &IRequest::SetConnectionConfirmationOption, "SetConnectionConfirmationOption"}, + {12, nullptr, "SetPersistent"}, + {13, nullptr, "SetInstant"}, + {14, nullptr, "SetSustainable"}, + {15, nullptr, "SetRawPriority"}, + {16, nullptr, "SetGreedy"}, + {17, nullptr, "SetSharable"}, + {18, nullptr, "SetRequirementByRevision"}, + {19, nullptr, "GetRequirement"}, + {20, nullptr, "GetRevision"}, + {21, &IRequest::GetAppletInfo, "GetAppletInfo"}, + {22, nullptr, "GetAdditionalInfo"}, + {23, nullptr, "SetKeptInSleep"}, + {24, nullptr, "RegisterSocketDescriptor"}, + {25, nullptr, "UnregisterSocketDescriptor"}, + {26, nullptr, "GetNetworkAccessStatus"}, //21.0.0+ + }; + RegisterHandlers(functions); + event1 = CreateKEvent(service_context, "IRequest:Event1"); event2 = CreateKEvent(service_context, "IRequest:Event2"); state = RequestState::NotSubmitted; @@ -464,37 +494,6 @@ private: event1->Signal(system.Kernel()); } - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IRequest::GetRequestState, "GetRequestState"}, - FunctionInfo{1, &IRequest::GetResult, "GetResult"}, - FunctionInfo{2, &IRequest::GetSystemEventReadableHandles, "GetSystemEventReadableHandles"}, - FunctionInfo{3, &IRequest::Cancel, "Cancel"}, - FunctionInfo{4, &IRequest::Submit, "Submit"}, - FunctionInfo{5, nullptr, "SetRequirement"}, - FunctionInfo{6, &IRequest::SetRequirementPreset, "SetRequirementPreset"}, - FunctionInfo{8, nullptr, "SetPriority"}, - FunctionInfo{9, &IRequest::SetNetworkProfileId, "SetNetworkProfileId"}, - FunctionInfo{10, nullptr, "SetRejectable"}, - FunctionInfo{11, &IRequest::SetConnectionConfirmationOption, "SetConnectionConfirmationOption"}, - FunctionInfo{12, nullptr, "SetPersistent"}, - FunctionInfo{13, nullptr, "SetInstant"}, - FunctionInfo{14, nullptr, "SetSustainable"}, - FunctionInfo{15, nullptr, "SetRawPriority"}, - FunctionInfo{16, nullptr, "SetGreedy"}, - FunctionInfo{17, nullptr, "SetSharable"}, - FunctionInfo{18, nullptr, "SetRequirementByRevision"}, - FunctionInfo{19, nullptr, "GetRequirement"}, - FunctionInfo{20, nullptr, "GetRevision"}, - FunctionInfo{21, &IRequest::GetAppletInfo, "GetAppletInfo"}, - FunctionInfo{22, nullptr, "GetAdditionalInfo"}, - FunctionInfo{23, nullptr, "SetKeptInSleep"}, - FunctionInfo{24, nullptr, "RegisterSocketDescriptor"}, - FunctionInfo{25, nullptr, "UnregisterSocketDescriptor"}, - FunctionInfo{26, nullptr, "GetNetworkAccessStatus", MakeVersionGate({21,0,0})} - ); KernelHelpers::ServiceContext service_context; RequestState state; @@ -509,16 +508,14 @@ private: class INetworkProfile final : public ServiceFramework { public: - explicit INetworkProfile(Core::System& system_) : ServiceFramework{system_, "INetworkProfile"} {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit INetworkProfile(Core::System& system_) : ServiceFramework{system_, "INetworkProfile"} { + static const FunctionInfo functions[] = { + {0, nullptr, "Update"}, + {1, nullptr, "PersistOld"}, + {2, nullptr, "Persist"}, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Update"}, - FunctionInfo{1, nullptr, "PersistOld"}, - FunctionInfo{2, nullptr, "Persist"} - ); }; void IGeneralService::GetClientId(HLERequestContext& ctx) { @@ -1053,70 +1050,78 @@ void IGeneralService::GetCurrentAccessPoint(HLERequestContext& ctx) { rb.Push(ResultSuccess); } -std::optional IGeneralService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, &IGeneralService::GetClientId, "GetClientId"}, - FunctionInfo{2, &IGeneralService::CreateScanRequest, "CreateScanRequest"}, - FunctionInfo{4, &IGeneralService::CreateRequest, "CreateRequest"}, - FunctionInfo{5, &IGeneralService::GetCurrentNetworkProfile, "GetCurrentNetworkProfile"}, - FunctionInfo{6, &IGeneralService::EnumerateNetworkInterfaces, "EnumerateNetworkInterfaces"}, - FunctionInfo{7, &IGeneralService::EnumerateNetworkProfiles, "EnumerateNetworkProfiles"}, - FunctionInfo{8, &IGeneralService::GetNetworkProfile, "GetNetworkProfile"}, - FunctionInfo{9, &IGeneralService::SetNetworkProfile, "SetNetworkProfile"}, - FunctionInfo{10, &IGeneralService::RemoveNetworkProfile, "RemoveNetworkProfile"}, - FunctionInfo{11, &IGeneralService::GetScanData, "GetScanDataOld"}, - FunctionInfo{12, &IGeneralService::GetCurrentIpAddress, "GetCurrentIpAddress"}, - FunctionInfo{13, nullptr, "GetCurrentAccessPointOld"}, - FunctionInfo{14, &IGeneralService::CreateTemporaryNetworkProfile, "CreateTemporaryNetworkProfile"}, - FunctionInfo{15, &IGeneralService::GetCurrentIpConfigInfo, "GetCurrentIpConfigInfo"}, - FunctionInfo{16, &IGeneralService::SetWirelessCommunicationEnabled, "SetWirelessCommunicationEnabled"}, - FunctionInfo{17, &IGeneralService::IsWirelessCommunicationEnabled, "IsWirelessCommunicationEnabled"}, - FunctionInfo{18, &IGeneralService::GetInternetConnectionStatus, "GetInternetConnectionStatus"}, - FunctionInfo{19, &IGeneralService::SetEthernetCommunicationEnabled, "SetEthernetCommunicationEnabled"}, - FunctionInfo{20, &IGeneralService::IsEthernetCommunicationEnabled, "IsEthernetCommunicationEnabled"}, - FunctionInfo{21, &IGeneralService::IsAnyInternetRequestAccepted, "IsAnyInternetRequestAccepted"}, - FunctionInfo{22, &IGeneralService::IsAnyForegroundRequestAccepted, "IsAnyForegroundRequestAccepted"}, - FunctionInfo{23, nullptr, "PutToSleep"}, - FunctionInfo{24, nullptr, "WakeUp"}, - FunctionInfo{25, &IGeneralService::GetSsidListVersion, "GetSsidListVersion"}, - FunctionInfo{26, nullptr, "SetExclusiveClient"}, - FunctionInfo{27, nullptr, "GetDefaultIpSetting"}, - FunctionInfo{28, nullptr, "SetDefaultIpSetting"}, - FunctionInfo{29, nullptr, "SetWirelessCommunicationEnabledForTest"}, - FunctionInfo{30, nullptr, "SetEthernetCommunicationEnabledForTest"}, - FunctionInfo{31, nullptr, "GetTelemetorySystemEventReadableHandle"}, - FunctionInfo{32, nullptr, "GetTelemetryInfo"}, - FunctionInfo{33, &IGeneralService::ConfirmSystemAvailability, "ConfirmSystemAvailability", MakeVersionGate({2,0,0})}, - FunctionInfo{34, &IGeneralService::SetBackgroundRequestEnabled, "SetBackgroundRequestEnabled", MakeVersionGate({4,0,0})}, - FunctionInfo{35, &IGeneralService::GetScanDataV2, "GetScanData"}, - FunctionInfo{36, &IGeneralService::GetCurrentAccessPoint, "GetCurrentAccessPoint"}, - FunctionInfo{37, nullptr, "Shutdown"}, - FunctionInfo{38, nullptr, "GetAllowedChannels"}, - FunctionInfo{39, nullptr, "NotifyApplicationSuspended"}, - FunctionInfo{40, nullptr, "SetAcceptableNetworkTypeFlag"}, - FunctionInfo{41, nullptr, "GetAcceptableNetworkTypeFlag"}, - FunctionInfo{42, nullptr, "NotifyConnectionStateChanged"}, - FunctionInfo{43, nullptr, "SetWowlDelayedWakeTime"}, - FunctionInfo{44, nullptr, "IsWiredConnectionAvailable", MakeVersionGate({18,0,0})}, - FunctionInfo{45, nullptr, "IsNetworkEmulationFeatureEnabled", MakeVersionGate({18,0,0})}, - FunctionInfo{46, nullptr, "SelectActiveNetworkEmulationProfileIdForDebug", MakeVersionGate({18,0,0})}, - FunctionInfo{47, &IGeneralService::GetScanDataV3, "GetScanData", MakeVersionGate({19,0,0})}, - FunctionInfo{50, nullptr, "IsRewriteFeatureEnabled", MakeVersionGate({18,0,0})}, - FunctionInfo{51, nullptr, "CreateRewriteRule", MakeVersionGate({18,0,0})}, - FunctionInfo{52, nullptr, "DestroyRewriteRule", MakeVersionGate({18,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IGeneralService::IGeneralService(Core::System& system_) : ServiceFramework{system_, "IGeneralService"} { + // clang-format off + + static const FunctionInfo functions[] = { + {1, &IGeneralService::GetClientId, "GetClientId"}, + {2, &IGeneralService::CreateScanRequest, "CreateScanRequest"}, + {4, &IGeneralService::CreateRequest, "CreateRequest"}, + {5, &IGeneralService::GetCurrentNetworkProfile, "GetCurrentNetworkProfile"}, + {6, &IGeneralService::EnumerateNetworkInterfaces, "EnumerateNetworkInterfaces"}, + {7, &IGeneralService::EnumerateNetworkProfiles, "EnumerateNetworkProfiles"}, + {8, &IGeneralService::GetNetworkProfile, "GetNetworkProfile"}, + {9, &IGeneralService::SetNetworkProfile, "SetNetworkProfile"}, + {10, &IGeneralService::RemoveNetworkProfile, "RemoveNetworkProfile"}, + {11, &IGeneralService::GetScanData, "GetScanDataOld"}, + {12, &IGeneralService::GetCurrentIpAddress, "GetCurrentIpAddress"}, + {13, nullptr, "GetCurrentAccessPointOld"}, + {14, &IGeneralService::CreateTemporaryNetworkProfile, "CreateTemporaryNetworkProfile"}, + {15, &IGeneralService::GetCurrentIpConfigInfo, "GetCurrentIpConfigInfo"}, + {16, &IGeneralService::SetWirelessCommunicationEnabled, "SetWirelessCommunicationEnabled"}, + {17, &IGeneralService::IsWirelessCommunicationEnabled, "IsWirelessCommunicationEnabled"}, + {18, &IGeneralService::GetInternetConnectionStatus, "GetInternetConnectionStatus"}, + {19, &IGeneralService::SetEthernetCommunicationEnabled, "SetEthernetCommunicationEnabled"}, + {20, &IGeneralService::IsEthernetCommunicationEnabled, "IsEthernetCommunicationEnabled"}, + {21, &IGeneralService::IsAnyInternetRequestAccepted, "IsAnyInternetRequestAccepted"}, + {22, &IGeneralService::IsAnyForegroundRequestAccepted, "IsAnyForegroundRequestAccepted"}, + {23, nullptr, "PutToSleep"}, + {24, nullptr, "WakeUp"}, + {25, &IGeneralService::GetSsidListVersion, "GetSsidListVersion"}, + {26, nullptr, "SetExclusiveClient"}, + {27, nullptr, "GetDefaultIpSetting"}, + {28, nullptr, "SetDefaultIpSetting"}, + {29, nullptr, "SetWirelessCommunicationEnabledForTest"}, + {30, nullptr, "SetEthernetCommunicationEnabledForTest"}, + {31, nullptr, "GetTelemetorySystemEventReadableHandle"}, + {32, nullptr, "GetTelemetryInfo"}, + {33, &IGeneralService::ConfirmSystemAvailability, "ConfirmSystemAvailability"}, // 2.0.0+ + {34, &IGeneralService::SetBackgroundRequestEnabled, "SetBackgroundRequestEnabled"}, // 4.0.0+ + {35, &IGeneralService::GetScanDataV2, "GetScanData"}, + {36, &IGeneralService::GetCurrentAccessPoint, "GetCurrentAccessPoint"}, + {37, nullptr, "Shutdown"}, + {38, nullptr, "GetAllowedChannels"}, + {39, nullptr, "NotifyApplicationSuspended"}, + {40, nullptr, "SetAcceptableNetworkTypeFlag"}, + {41, nullptr, "GetAcceptableNetworkTypeFlag"}, + {42, nullptr, "NotifyConnectionStateChanged"}, + {43, nullptr, "SetWowlDelayedWakeTime"}, + {44, nullptr, "IsWiredConnectionAvailable"}, // 18.0.0+ + {45, nullptr, "IsNetworkEmulationFeatureEnabled"}, // 18.0.0+ + {46, nullptr, "SelectActiveNetworkEmulationProfileIdForDebug"}, // 18.0.0+ + {47, &IGeneralService::GetScanDataV3, "GetScanData"}, // 19.0.0+ + {50, nullptr, "IsRewriteFeatureEnabled"}, // 18.0.0+ + {51, nullptr, "CreateRewriteRule"}, // 18.0.0+ + {52, nullptr, "DestroyRewriteRule"} // 18.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } IGeneralService::~IGeneralService() = default; class NetworkInterface final : public ServiceFramework { public: - explicit NetworkInterface(const char* name, Core::System& system_) : ServiceFramework{system_, name} {} + explicit NetworkInterface(const char* name, Core::System& system_) + : ServiceFramework{system_, name} { + static const FunctionInfo functions[] = { + {4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, + {5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"}, + }; + RegisterHandlers(functions); + } private: void CreateGeneralServiceOld(HLERequestContext& ctx) { @@ -1134,14 +1139,6 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, - FunctionInfo{5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h index 3f3535fa93..44859e0c51 100644 --- a/src/core/hle/service/nifm/nifm.h +++ b/src/core/hle/service/nifm/nifm.h @@ -51,7 +51,6 @@ private: void SetBackgroundRequestEnabled(HLERequestContext& ctx); void GetCurrentAccessPoint(HLERequestContext& ctx); void GetScanDataV3(HLERequestContext& ctx); - std::optional FindRequest(u32 key) override; }; } // namespace Service::NIFM diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index c48bf54646..e5f2d85dde 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -24,13 +24,22 @@ namespace Service::NIM { class IShopServiceAsync final : public ServiceFramework { public: explicit IShopServiceAsync(Core::System& system_) - : ServiceFramework{system_, "IShopServiceAsync"} - , service_context{system_, "IShopServiceAsync"} { - completion_event = service_context.CreateEvent("IShopServiceAsync:Completion"); - } + : ServiceFramework{system_, "IShopServiceAsync"}, + service_context{system_, "IShopServiceAsync"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IShopServiceAsync::Cancel>, "Cancel"}, + {1, D<&IShopServiceAsync::GetSize>, "GetSize"}, + {2, D<&IShopServiceAsync::Read>, "Read"}, + {3, D<&IShopServiceAsync::GetErrorCode>, "GetErrorCode"}, + {4, D<&IShopServiceAsync::Request>, "Request"}, + {5, D<&IShopServiceAsync::Prepare>, "Prepare"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); + + completion_event = service_context.CreateEvent("IShopServiceAsync:Completion"); } ~IShopServiceAsync() override { @@ -43,6 +52,15 @@ public: } private: + KernelHelpers::ServiceContext service_context; + Kernel::KEvent* completion_event; + + std::jthread worker; + std::atomic error_code{0}; + + std::mutex data_mutex; + std::vector download_data; + void CancelImpl() { worker.request_stop(); if (worker.joinable()) { @@ -118,30 +136,19 @@ private: } R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IShopServiceAsync::Cancel>, "Cancel"}, - FunctionInfo{1, D<&IShopServiceAsync::GetSize>, "GetSize"}, - FunctionInfo{2, D<&IShopServiceAsync::Read>, "Read"}, - FunctionInfo{3, D<&IShopServiceAsync::GetErrorCode>, "GetErrorCode"}, - FunctionInfo{4, D<&IShopServiceAsync::Request>, "Request"}, - FunctionInfo{5, D<&IShopServiceAsync::Prepare>, "Prepare"} - ); - KernelHelpers::ServiceContext service_context; - Kernel::KEvent* completion_event; - std::jthread worker; - std::atomic error_code{0}; - std::mutex data_mutex; - std::vector download_data; }; class IShopServiceAccessor final : public ServiceFramework { public: explicit IShopServiceAccessor(Core::System& system_) - : ServiceFramework{system_, "IShopServiceAccessor"} {} + : ServiceFramework{system_, "IShopServiceAccessor"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IShopServiceAccessor::CreateAsyncInterface, "CreateAsyncInterface"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -153,19 +160,19 @@ private: rb.PushCopyObjects(ctx, async_interface->GetEvent()); rb.PushIpcInterface(ctx, std::move(async_interface)); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IShopServiceAccessor::CreateAsyncInterface, "CreateAsyncInterface"} - ); }; class IShopServiceAccessServer final : public ServiceFramework { public: explicit IShopServiceAccessServer(Core::System& system_) - : ServiceFramework{system_, "IShopServiceAccessServer"} {} + : ServiceFramework{system_, "IShopServiceAccessServer"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IShopServiceAccessServer::CreateAccessorInterface, "CreateAccessorInterface"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -175,252 +182,258 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IShopServiceAccessServer::CreateAccessorInterface, "CreateAccessorInterface"} - ); }; class NIM final : public ServiceFramework { public: - explicit NIM(Core::System& system_) : ServiceFramework{system_, "nim"} {} + explicit NIM(Core::System& system_) : ServiceFramework{system_, "nim"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateSystemUpdateTask"}, + {1, nullptr, "DestroySystemUpdateTask"}, + {2, nullptr, "ListSystemUpdateTask"}, + {3, nullptr, "RequestSystemUpdateTaskRun"}, + {4, nullptr, "GetSystemUpdateTaskInfo"}, + {5, nullptr, "CommitSystemUpdateTask"}, + {6, nullptr, "CreateNetworkInstallTask"}, + {7, nullptr, "DestroyNetworkInstallTask"}, + {8, nullptr, "ListNetworkInstallTask"}, + {9, nullptr, "RequestNetworkInstallTaskRun"}, + {10, nullptr, "GetNetworkInstallTaskInfo"}, + {11, nullptr, "CommitNetworkInstallTask"}, + {12, nullptr, "RequestLatestSystemUpdateMeta"}, + {14, nullptr, "ListApplicationNetworkInstallTask"}, + {15, nullptr, "ListNetworkInstallTaskContentMeta"}, + {16, nullptr, "RequestLatestVersion"}, + {17, nullptr, "SetNetworkInstallTaskAttribute"}, + {18, nullptr, "AddNetworkInstallTaskContentMeta"}, + {19, nullptr, "GetDownloadedSystemDataPath"}, + {20, nullptr, "CalculateNetworkInstallTaskRequiredSize"}, + {21, nullptr, "IsExFatDriverIncluded"}, + {22, nullptr, "GetBackgroundDownloadStressTaskInfo"}, + {23, nullptr, "RequestDeviceAuthenticationToken"}, + {24, nullptr, "RequestGameCardRegistrationStatus"}, + {25, nullptr, "RequestRegisterGameCard"}, + {26, nullptr, "RequestRegisterNotificationToken"}, + {27, nullptr, "RequestDownloadTaskList"}, + {28, nullptr, "RequestApplicationControl"}, + {29, nullptr, "RequestLatestApplicationControl"}, + {30, nullptr, "RequestVersionList"}, + {31, nullptr, "CreateApplyDeltaTask"}, + {32, nullptr, "DestroyApplyDeltaTask"}, + {33, nullptr, "ListApplicationApplyDeltaTask"}, + {34, nullptr, "RequestApplyDeltaTaskRun"}, + {35, nullptr, "GetApplyDeltaTaskInfo"}, + {36, nullptr, "ListApplyDeltaTask"}, + {37, nullptr, "CommitApplyDeltaTask"}, + {38, nullptr, "CalculateApplyDeltaTaskRequiredSize"}, + {39, nullptr, "PrepareShutdown"}, + {40, nullptr, "ListApplyDeltaTask"}, + {41, nullptr, "ClearNotEnoughSpaceStateOfApplyDeltaTask"}, + {42, nullptr, "CreateApplyDeltaTaskFromDownloadTask"}, + {43, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, + {44, nullptr, "GetApplyDeltaTaskRequiredStorage"}, + {45, nullptr, "CalculateNetworkInstallTaskContentsSize"}, + {46, nullptr, "PrepareShutdownForSystemUpdate"}, + {47, nullptr, "FindMaxRequiredApplicationVersionOfTask"}, + {48, nullptr, "CommitNetworkInstallTaskPartially"}, + {49, nullptr, "ListNetworkInstallTaskCommittedContentMeta"}, + {50, nullptr, "ListNetworkInstallTaskNotCommittedContentMeta"}, + {51, nullptr, "FindMaxRequiredSystemVersionOfTask"}, + {52, nullptr, "GetNetworkInstallTaskErrorContext"}, + {53, nullptr, "CreateLocalCommunicationReceiveApplicationTask"}, + {54, nullptr, "DestroyLocalCommunicationReceiveApplicationTask"}, + {55, nullptr, "ListLocalCommunicationReceiveApplicationTask"}, + {56, nullptr, "RequestLocalCommunicationReceiveApplicationTaskRun"}, + {57, nullptr, "GetLocalCommunicationReceiveApplicationTaskInfo"}, + {58, nullptr, "CommitLocalCommunicationReceiveApplicationTask"}, + {59, nullptr, "ListLocalCommunicationReceiveApplicationTaskContentMeta"}, + {60, nullptr, "CreateLocalCommunicationSendApplicationTask"}, + {61, nullptr, "RequestLocalCommunicationSendApplicationTaskRun"}, + {62, nullptr, "GetLocalCommunicationReceiveApplicationTaskErrorContext"}, + {63, nullptr, "GetLocalCommunicationSendApplicationTaskInfo"}, + {64, nullptr, "DestroyLocalCommunicationSendApplicationTask"}, + {65, nullptr, "GetLocalCommunicationSendApplicationTaskErrorContext"}, + {66, nullptr, "CalculateLocalCommunicationReceiveApplicationTaskRequiredSize"}, + {67, nullptr, "ListApplicationLocalCommunicationReceiveApplicationTask"}, + {68, nullptr, "ListApplicationLocalCommunicationSendApplicationTask"}, + {69, nullptr, "CreateLocalCommunicationReceiveSystemUpdateTask"}, + {70, nullptr, "DestroyLocalCommunicationReceiveSystemUpdateTask"}, + {71, nullptr, "ListLocalCommunicationReceiveSystemUpdateTask"}, + {72, nullptr, "RequestLocalCommunicationReceiveSystemUpdateTaskRun"}, + {73, nullptr, "GetLocalCommunicationReceiveSystemUpdateTaskInfo"}, + {74, nullptr, "CommitLocalCommunicationReceiveSystemUpdateTask"}, + {75, nullptr, "GetLocalCommunicationReceiveSystemUpdateTaskErrorContext"}, + {76, nullptr, "CreateLocalCommunicationSendSystemUpdateTask"}, + {77, nullptr, "RequestLocalCommunicationSendSystemUpdateTaskRun"}, + {78, nullptr, "GetLocalCommunicationSendSystemUpdateTaskInfo"}, + {79, nullptr, "DestroyLocalCommunicationSendSystemUpdateTask"}, + {80, nullptr, "GetLocalCommunicationSendSystemUpdateTaskErrorContext"}, + {81, nullptr, "ListLocalCommunicationSendSystemUpdateTask"}, + {82, nullptr, "GetReceivedSystemDataPath"}, + {83, nullptr, "CalculateApplyDeltaTaskOccupiedSize"}, + {84, nullptr, "ReloadErrorSimulation"}, + {85, nullptr, "ListNetworkInstallTaskContentMetaFromInstallMeta"}, + {86, nullptr, "ListNetworkInstallTaskOccupiedSize"}, + {87, nullptr, "RequestQueryAvailableELicenses"}, + {88, nullptr, "RequestAssignELicenses"}, + {89, nullptr, "RequestExtendELicenses"}, + {90, nullptr, "RequestSyncELicenses"}, + {91, nullptr, "Unknown91"}, //6.0.0-14.1.2 + {92, nullptr, "Unknown92"}, //21.0.0+ + {93, nullptr, "RequestReportActiveELicenses"}, + {94, nullptr, "RequestReportActiveELicensesPassively"}, + {95, nullptr, "RequestRegisterDynamicRightsNotificationToken"}, + {96, nullptr, "RequestAssignAllDeviceLinkedELicenses"}, + {97, nullptr, "RequestRevokeAllELicenses"}, + {98, nullptr, "RequestPrefetchForDynamicRights"}, + {99, nullptr, "CreateNetworkInstallTask"}, + {100, nullptr, "ListNetworkInstallTaskRightsIds"}, + {101, nullptr, "RequestDownloadETickets"}, + {102, nullptr, "RequestQueryDownloadableContents"}, + {103, nullptr, "DeleteNetworkInstallTaskContentMeta"}, + {104, nullptr, "RequestIssueEdgeTokenForDebug"}, + {105, nullptr, "RequestQueryAvailableELicenses2"}, + {106, nullptr, "RequestAssignELicenses2"}, + {107, nullptr, "GetNetworkInstallTaskStateCounter"}, + {108, nullptr, "InvalidateDynamicRightsNaIdTokenCacheForDebug"}, + {109, nullptr, "ListNetworkInstallTaskPartialInstallContentMeta"}, + {110, nullptr, "ListNetworkInstallTaskRightsIdsFromIndex"}, + {111, nullptr, "AddNetworkInstallTaskContentMetaForUser"}, + {112, nullptr, "RequestAssignELicensesAndDownloadETickets"}, + {113, nullptr, "RequestQueryAvailableCommonELicenses"}, + {114, nullptr, "SetNetworkInstallTaskExtendedAttribute"}, + {115, nullptr, "GetNetworkInstallTaskExtendedAttribute"}, + {116, nullptr, "GetAllocatorInfo"}, + {117, nullptr, "RequestQueryDownloadableContentsByApplicationId"}, + {118, nullptr, "MarkNoDownloadRightsErrorResolved"}, + {119, nullptr, "GetApplyDeltaTaskAllAppliedContentMeta"}, + {120, nullptr, "PrioritizeNetworkInstallTask"}, + {121, nullptr, "RequestQueryAvailableCommonELicenses2"}, + {122, nullptr, "RequestAssignCommonELicenses"}, + {123, nullptr, "RequestAssignCommonELicenses2"}, + {124, nullptr, "IsNetworkInstallTaskFrontOfQueue"}, + {125, nullptr, "PrioritizeApplyDeltaTask"}, + {126, nullptr, "RerouteDownloadingPatch"}, + {127, nullptr, "UnmarkNoDownloadRightsErrorResolved"}, + {128, nullptr, "RequestContentsSize"}, + {129, nullptr, "RequestContentsAuthorizationToken"}, + {130, nullptr, "RequestCdnVendorDiscovery"}, + {131, nullptr, "RefreshDebugAvailability"}, + {132, nullptr, "ClearResponseSimulationEntry"}, + {133, nullptr, "RegisterResponseSimulationEntry"}, + {134, nullptr, "GetProcessedCdnVendors"}, + {135, nullptr, "RefreshRuntimeBehaviorsForDebug"}, + {136, nullptr, "RequestOnlineSubscriptionFreeTrialAvailability"}, + {137, nullptr, "GetNetworkInstallTaskContentMetaCount"}, + {138, nullptr, "RequestRevokeELicenses"}, + {139, nullptr, "EnableNetworkConnectionToUseApplicationCore"}, + {140, nullptr, "DisableNetworkConnectionToUseApplicationCore"}, + {141, nullptr, "IsNetworkConnectionEnabledToUseApplicationCore"}, + {142, nullptr, "RequestCheckSafeSystemVersion"}, + {143, nullptr, "RequestApplicationIcon"}, + {144, nullptr, "RequestDownloadIdbeIconFile"}, + {147, nullptr, "Unknown147"}, //18.0.0+ + {148, nullptr, "Unknown148"}, //18.0.0+ + {150, nullptr, "Unknown150"}, //19.0.0+ + {151, nullptr, "Unknown151"}, //20.0.0+ + {152, nullptr, "Unknown152"}, //20.0.0+ + {153, nullptr, "Unknown153"}, //20.0.0+ + {154, nullptr, "Unknown154"}, //20.0.0+ + {155, nullptr, "Unknown155"}, //20.0.0+ + {156, nullptr, "Unknown156"}, //20.0.0+ + {157, nullptr, "Unknown157"}, //20.0.0+ + {158, nullptr, "Unknown158"}, //20.0.0+ + {159, nullptr, "Unknown159"}, //20.0.0+ + {160, nullptr, "Unknown160"}, //20.0.0+ + {161, nullptr, "Unknown161"}, //20.0.0+ + {162, nullptr, "Unknown162"}, //20.0.0+ + {163, nullptr, "Unknown163"}, //20.0.0+ + {164, nullptr, "Unknown164"}, //20.0.0+ + {165, nullptr, "Unknown165"}, //20.0.0+ + {166, nullptr, "Unknown166"}, //20.0.0+ + {167, nullptr, "Unknown167"}, //20.0.0+ + {168, nullptr, "Unknown168"}, //20.0.0+ + {169, nullptr, "Unknown169"}, //20.0.0+ + {170, nullptr, "Unknown170"}, //20.0.0+ + {171, nullptr, "Unknown171"}, //20.0.0+ + {172, nullptr, "Unknown172"}, //20.0.0+ + {173, nullptr, "Unknown173"}, //20.0.0+ + {174, nullptr, "Unknown174"}, //20.0.0+ + {175, nullptr, "Unknown175"}, //20.0.0+ + {176, nullptr, "Unknown176"}, //20.0.0+ + {177, nullptr, "Unknown177"}, //20.0.0+ + {2000, nullptr, "Unknown2000"}, //20.0.0+ + {2001, nullptr, "Unknown2001"}, //20.0.0+ + {2002, nullptr, "Unknown2002"}, //20.0.0+ + {2003, nullptr, "Unknown2003"}, //20.0.0+ + {2004, nullptr, "Unknown2004"}, //20.0.0+ + {2007, nullptr, "Unknown2007"}, //20.0.0+ + {2011, nullptr, "Unknown2011"}, //20.0.0+ + {2012, nullptr, "Unknown2012"}, //20.0.0+ + {2013, nullptr, "Unknown2013"}, //20.0.0+ + {2014, nullptr, "Unknown2014"}, //20.0.0+ + {2015, nullptr, "Unknown2015"}, //20.0.0+ + {2016, nullptr, "Unknown2016"}, //20.0.0+ + {2017, nullptr, "Unknown2017"}, //20.0.0+ + {2018, nullptr, "Unknown2018"}, //20.0.0+ + {2019, nullptr, "Unknown2019"}, //20.0.0+ + {2020, nullptr, "Unknown2020"}, //20.0.0+ + {2021, nullptr, "Unknown2021"}, //20.0.0+ + {2022, nullptr, "Unknown2022"}, //20.0.0+ + {2023, nullptr, "Unknown2023"}, //20.0.0+ + {2024, nullptr, "Unknown2024"}, //20.0.0+ + {2025, nullptr, "Unknown2025"}, //20.0.0+ + {2026, nullptr, "Unknown2026"}, //20.0.0+ + {2027, nullptr, "Unknown2027"}, //20.0.0+ + {2028, nullptr, "Unknown2028"}, //20.0.0+ + {2029, nullptr, "Unknown2029"}, //20.0.0+ + {2030, nullptr, "Unknown2030"}, //20.0.0+ + {2031, nullptr, "Unknown2031"}, //20.0.0+ + {2032, nullptr, "Unknown2032"}, //20.0.0+ + {2033, nullptr, "Unknown2033"}, //20.0.0+ + {2034, nullptr, "Unknown2034"}, //20.0.0+ + {2035, nullptr, "Unknown2035"}, //20.0.0+ + {2036, nullptr, "Unknown2036"}, //20.0.0+ + {2037, nullptr, "Unknown2037"}, //20.0.0+ + {2038, nullptr, "Unknown2038"}, //20.0.0+ + {2039, nullptr, "Unknown2039"}, //20.0.0+ + {2040, nullptr, "Unknown2040"}, //20.0.0+ + {2041, nullptr, "Unknown2041"}, //20.0.0+ + {2042, nullptr, "Unknown2042"}, //20.0.0+ + {2043, nullptr, "Unknown2043"}, //20.0.0+ + {2044, nullptr, "Unknown2044"}, //20.0.0+ + {2045, nullptr, "Unknown2045"}, //20.0.0+ + {2046, nullptr, "Unknown2046"}, //20.0.0+ + {2047, nullptr, "Unknown2047"}, //20.0.0+ + {2048, nullptr, "Unknown2048"}, //20.0.0+ + {2049, nullptr, "Unknown2049"}, //20.0.0+ + {2050, nullptr, "Unknown2050"}, //20.0.0+ + {2051, nullptr, "Unknown2051"}, //20.0.0+ + {3000, nullptr, "RequestLatestApplicationIcon"}, //17.0.0+ + {3001, nullptr, "RequestDownloadIdbeLatestIconFile"}, //17.0.0+ + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateSystemUpdateTask"}, - FunctionInfo{1, nullptr, "DestroySystemUpdateTask"}, - FunctionInfo{2, nullptr, "ListSystemUpdateTask"}, - FunctionInfo{3, nullptr, "RequestSystemUpdateTaskRun"}, - FunctionInfo{4, nullptr, "GetSystemUpdateTaskInfo"}, - FunctionInfo{5, nullptr, "CommitSystemUpdateTask"}, - FunctionInfo{6, nullptr, "CreateNetworkInstallTask"}, - FunctionInfo{7, nullptr, "DestroyNetworkInstallTask"}, - FunctionInfo{8, nullptr, "ListNetworkInstallTask"}, - FunctionInfo{9, nullptr, "RequestNetworkInstallTaskRun"}, - FunctionInfo{10, nullptr, "GetNetworkInstallTaskInfo"}, - FunctionInfo{11, nullptr, "CommitNetworkInstallTask"}, - FunctionInfo{12, nullptr, "RequestLatestSystemUpdateMeta"}, - FunctionInfo{14, nullptr, "ListApplicationNetworkInstallTask"}, - FunctionInfo{15, nullptr, "ListNetworkInstallTaskContentMeta"}, - FunctionInfo{16, nullptr, "RequestLatestVersion"}, - FunctionInfo{17, nullptr, "SetNetworkInstallTaskAttribute"}, - FunctionInfo{18, nullptr, "AddNetworkInstallTaskContentMeta"}, - FunctionInfo{19, nullptr, "GetDownloadedSystemDataPath"}, - FunctionInfo{20, nullptr, "CalculateNetworkInstallTaskRequiredSize"}, - FunctionInfo{21, nullptr, "IsExFatDriverIncluded"}, - FunctionInfo{22, nullptr, "GetBackgroundDownloadStressTaskInfo"}, - FunctionInfo{23, nullptr, "RequestDeviceAuthenticationToken"}, - FunctionInfo{24, nullptr, "RequestGameCardRegistrationStatus"}, - FunctionInfo{25, nullptr, "RequestRegisterGameCard"}, - FunctionInfo{26, nullptr, "RequestRegisterNotificationToken"}, - FunctionInfo{27, nullptr, "RequestDownloadTaskList"}, - FunctionInfo{28, nullptr, "RequestApplicationControl"}, - FunctionInfo{29, nullptr, "RequestLatestApplicationControl"}, - FunctionInfo{30, nullptr, "RequestVersionList"}, - FunctionInfo{31, nullptr, "CreateApplyDeltaTask"}, - FunctionInfo{32, nullptr, "DestroyApplyDeltaTask"}, - FunctionInfo{33, nullptr, "ListApplicationApplyDeltaTask"}, - FunctionInfo{34, nullptr, "RequestApplyDeltaTaskRun"}, - FunctionInfo{35, nullptr, "GetApplyDeltaTaskInfo"}, - FunctionInfo{36, nullptr, "ListApplyDeltaTask"}, - FunctionInfo{37, nullptr, "CommitApplyDeltaTask"}, - FunctionInfo{38, nullptr, "CalculateApplyDeltaTaskRequiredSize"}, - FunctionInfo{39, nullptr, "PrepareShutdown"}, - FunctionInfo{40, nullptr, "ListApplyDeltaTask"}, - FunctionInfo{41, nullptr, "ClearNotEnoughSpaceStateOfApplyDeltaTask"}, - FunctionInfo{42, nullptr, "CreateApplyDeltaTaskFromDownloadTask"}, - FunctionInfo{43, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, - FunctionInfo{44, nullptr, "GetApplyDeltaTaskRequiredStorage"}, - FunctionInfo{45, nullptr, "CalculateNetworkInstallTaskContentsSize"}, - FunctionInfo{46, nullptr, "PrepareShutdownForSystemUpdate"}, - FunctionInfo{47, nullptr, "FindMaxRequiredApplicationVersionOfTask"}, - FunctionInfo{48, nullptr, "CommitNetworkInstallTaskPartially"}, - FunctionInfo{49, nullptr, "ListNetworkInstallTaskCommittedContentMeta"}, - FunctionInfo{50, nullptr, "ListNetworkInstallTaskNotCommittedContentMeta"}, - FunctionInfo{51, nullptr, "FindMaxRequiredSystemVersionOfTask"}, - FunctionInfo{52, nullptr, "GetNetworkInstallTaskErrorContext"}, - FunctionInfo{53, nullptr, "CreateLocalCommunicationReceiveApplicationTask"}, - FunctionInfo{54, nullptr, "DestroyLocalCommunicationReceiveApplicationTask"}, - FunctionInfo{55, nullptr, "ListLocalCommunicationReceiveApplicationTask"}, - FunctionInfo{56, nullptr, "RequestLocalCommunicationReceiveApplicationTaskRun"}, - FunctionInfo{57, nullptr, "GetLocalCommunicationReceiveApplicationTaskInfo"}, - FunctionInfo{58, nullptr, "CommitLocalCommunicationReceiveApplicationTask"}, - FunctionInfo{59, nullptr, "ListLocalCommunicationReceiveApplicationTaskContentMeta"}, - FunctionInfo{60, nullptr, "CreateLocalCommunicationSendApplicationTask"}, - FunctionInfo{61, nullptr, "RequestLocalCommunicationSendApplicationTaskRun"}, - FunctionInfo{62, nullptr, "GetLocalCommunicationReceiveApplicationTaskErrorContext"}, - FunctionInfo{63, nullptr, "GetLocalCommunicationSendApplicationTaskInfo"}, - FunctionInfo{64, nullptr, "DestroyLocalCommunicationSendApplicationTask"}, - FunctionInfo{65, nullptr, "GetLocalCommunicationSendApplicationTaskErrorContext"}, - FunctionInfo{66, nullptr, "CalculateLocalCommunicationReceiveApplicationTaskRequiredSize"}, - FunctionInfo{67, nullptr, "ListApplicationLocalCommunicationReceiveApplicationTask"}, - FunctionInfo{68, nullptr, "ListApplicationLocalCommunicationSendApplicationTask"}, - FunctionInfo{69, nullptr, "CreateLocalCommunicationReceiveSystemUpdateTask"}, - FunctionInfo{70, nullptr, "DestroyLocalCommunicationReceiveSystemUpdateTask"}, - FunctionInfo{71, nullptr, "ListLocalCommunicationReceiveSystemUpdateTask"}, - FunctionInfo{72, nullptr, "RequestLocalCommunicationReceiveSystemUpdateTaskRun"}, - FunctionInfo{73, nullptr, "GetLocalCommunicationReceiveSystemUpdateTaskInfo"}, - FunctionInfo{74, nullptr, "CommitLocalCommunicationReceiveSystemUpdateTask"}, - FunctionInfo{75, nullptr, "GetLocalCommunicationReceiveSystemUpdateTaskErrorContext"}, - FunctionInfo{76, nullptr, "CreateLocalCommunicationSendSystemUpdateTask"}, - FunctionInfo{77, nullptr, "RequestLocalCommunicationSendSystemUpdateTaskRun"}, - FunctionInfo{78, nullptr, "GetLocalCommunicationSendSystemUpdateTaskInfo"}, - FunctionInfo{79, nullptr, "DestroyLocalCommunicationSendSystemUpdateTask"}, - FunctionInfo{80, nullptr, "GetLocalCommunicationSendSystemUpdateTaskErrorContext"}, - FunctionInfo{81, nullptr, "ListLocalCommunicationSendSystemUpdateTask"}, - FunctionInfo{82, nullptr, "GetReceivedSystemDataPath"}, - FunctionInfo{83, nullptr, "CalculateApplyDeltaTaskOccupiedSize"}, - FunctionInfo{84, nullptr, "ReloadErrorSimulation"}, - FunctionInfo{85, nullptr, "ListNetworkInstallTaskContentMetaFromInstallMeta"}, - FunctionInfo{86, nullptr, "ListNetworkInstallTaskOccupiedSize"}, - FunctionInfo{87, nullptr, "RequestQueryAvailableELicenses"}, - FunctionInfo{88, nullptr, "RequestAssignELicenses"}, - FunctionInfo{89, nullptr, "RequestExtendELicenses"}, - FunctionInfo{90, nullptr, "RequestSyncELicenses"}, - FunctionInfo{91, nullptr, "Unknown91", MakeVersionGate({6,0,0}, {14,1,2})}, - FunctionInfo{92, nullptr, "Unknown92", MakeVersionGate({21,0,0})}, - FunctionInfo{93, nullptr, "RequestReportActiveELicenses"}, - FunctionInfo{94, nullptr, "RequestReportActiveELicensesPassively"}, - FunctionInfo{95, nullptr, "RequestRegisterDynamicRightsNotificationToken"}, - FunctionInfo{96, nullptr, "RequestAssignAllDeviceLinkedELicenses"}, - FunctionInfo{97, nullptr, "RequestRevokeAllELicenses"}, - FunctionInfo{98, nullptr, "RequestPrefetchForDynamicRights"}, - FunctionInfo{99, nullptr, "CreateNetworkInstallTask"}, - FunctionInfo{100, nullptr, "ListNetworkInstallTaskRightsIds"}, - FunctionInfo{101, nullptr, "RequestDownloadETickets"}, - FunctionInfo{102, nullptr, "RequestQueryDownloadableContents"}, - FunctionInfo{103, nullptr, "DeleteNetworkInstallTaskContentMeta"}, - FunctionInfo{104, nullptr, "RequestIssueEdgeTokenForDebug"}, - FunctionInfo{105, nullptr, "RequestQueryAvailableELicenses2"}, - FunctionInfo{106, nullptr, "RequestAssignELicenses2"}, - FunctionInfo{107, nullptr, "GetNetworkInstallTaskStateCounter"}, - FunctionInfo{108, nullptr, "InvalidateDynamicRightsNaIdTokenCacheForDebug"}, - FunctionInfo{109, nullptr, "ListNetworkInstallTaskPartialInstallContentMeta"}, - FunctionInfo{110, nullptr, "ListNetworkInstallTaskRightsIdsFromIndex"}, - FunctionInfo{111, nullptr, "AddNetworkInstallTaskContentMetaForUser"}, - FunctionInfo{112, nullptr, "RequestAssignELicensesAndDownloadETickets"}, - FunctionInfo{113, nullptr, "RequestQueryAvailableCommonELicenses"}, - FunctionInfo{114, nullptr, "SetNetworkInstallTaskExtendedAttribute"}, - FunctionInfo{115, nullptr, "GetNetworkInstallTaskExtendedAttribute"}, - FunctionInfo{116, nullptr, "GetAllocatorInfo"}, - FunctionInfo{117, nullptr, "RequestQueryDownloadableContentsByApplicationId"}, - FunctionInfo{118, nullptr, "MarkNoDownloadRightsErrorResolved"}, - FunctionInfo{119, nullptr, "GetApplyDeltaTaskAllAppliedContentMeta"}, - FunctionInfo{120, nullptr, "PrioritizeNetworkInstallTask"}, - FunctionInfo{121, nullptr, "RequestQueryAvailableCommonELicenses2"}, - FunctionInfo{122, nullptr, "RequestAssignCommonELicenses"}, - FunctionInfo{123, nullptr, "RequestAssignCommonELicenses2"}, - FunctionInfo{124, nullptr, "IsNetworkInstallTaskFrontOfQueue"}, - FunctionInfo{125, nullptr, "PrioritizeApplyDeltaTask"}, - FunctionInfo{126, nullptr, "RerouteDownloadingPatch"}, - FunctionInfo{127, nullptr, "UnmarkNoDownloadRightsErrorResolved"}, - FunctionInfo{128, nullptr, "RequestContentsSize"}, - FunctionInfo{129, nullptr, "RequestContentsAuthorizationToken"}, - FunctionInfo{130, nullptr, "RequestCdnVendorDiscovery"}, - FunctionInfo{131, nullptr, "RefreshDebugAvailability"}, - FunctionInfo{132, nullptr, "ClearResponseSimulationEntry"}, - FunctionInfo{133, nullptr, "RegisterResponseSimulationEntry"}, - FunctionInfo{134, nullptr, "GetProcessedCdnVendors"}, - FunctionInfo{135, nullptr, "RefreshRuntimeBehaviorsForDebug"}, - FunctionInfo{136, nullptr, "RequestOnlineSubscriptionFreeTrialAvailability"}, - FunctionInfo{137, nullptr, "GetNetworkInstallTaskContentMetaCount"}, - FunctionInfo{138, nullptr, "RequestRevokeELicenses"}, - FunctionInfo{139, nullptr, "EnableNetworkConnectionToUseApplicationCore"}, - FunctionInfo{140, nullptr, "DisableNetworkConnectionToUseApplicationCore"}, - FunctionInfo{141, nullptr, "IsNetworkConnectionEnabledToUseApplicationCore"}, - FunctionInfo{142, nullptr, "RequestCheckSafeSystemVersion"}, - FunctionInfo{143, nullptr, "RequestApplicationIcon"}, - FunctionInfo{144, nullptr, "RequestDownloadIdbeIconFile"}, - FunctionInfo{147, nullptr, "Unknown147", MakeVersionGate({18,0,0})}, - FunctionInfo{148, nullptr, "Unknown148", MakeVersionGate({18,0,0})}, - FunctionInfo{150, nullptr, "Unknown150", MakeVersionGate({19,0,0})}, - FunctionInfo{151, nullptr, "Unknown151", MakeVersionGate({20,0,0})}, - FunctionInfo{152, nullptr, "Unknown152", MakeVersionGate({20,0,0})}, - FunctionInfo{153, nullptr, "Unknown153", MakeVersionGate({20,0,0})}, - FunctionInfo{154, nullptr, "Unknown154", MakeVersionGate({20,0,0})}, - FunctionInfo{155, nullptr, "Unknown155", MakeVersionGate({20,0,0})}, - FunctionInfo{156, nullptr, "Unknown156", MakeVersionGate({20,0,0})}, - FunctionInfo{157, nullptr, "Unknown157", MakeVersionGate({20,0,0})}, - FunctionInfo{158, nullptr, "Unknown158", MakeVersionGate({20,0,0})}, - FunctionInfo{159, nullptr, "Unknown159", MakeVersionGate({20,0,0})}, - FunctionInfo{160, nullptr, "Unknown160", MakeVersionGate({20,0,0})}, - FunctionInfo{161, nullptr, "Unknown161", MakeVersionGate({20,0,0})}, - FunctionInfo{162, nullptr, "Unknown162", MakeVersionGate({20,0,0})}, - FunctionInfo{163, nullptr, "Unknown163", MakeVersionGate({20,0,0})}, - FunctionInfo{164, nullptr, "Unknown164", MakeVersionGate({20,0,0})}, - FunctionInfo{165, nullptr, "Unknown165", MakeVersionGate({20,0,0})}, - FunctionInfo{166, nullptr, "Unknown166", MakeVersionGate({20,0,0})}, - FunctionInfo{167, nullptr, "Unknown167", MakeVersionGate({20,0,0})}, - FunctionInfo{168, nullptr, "Unknown168", MakeVersionGate({20,0,0})}, - FunctionInfo{169, nullptr, "Unknown169", MakeVersionGate({20,0,0})}, - FunctionInfo{170, nullptr, "Unknown170", MakeVersionGate({20,0,0})}, - FunctionInfo{171, nullptr, "Unknown171", MakeVersionGate({20,0,0})}, - FunctionInfo{172, nullptr, "Unknown172", MakeVersionGate({20,0,0})}, - FunctionInfo{173, nullptr, "Unknown173", MakeVersionGate({20,0,0})}, - FunctionInfo{174, nullptr, "Unknown174", MakeVersionGate({20,0,0})}, - FunctionInfo{175, nullptr, "Unknown175", MakeVersionGate({20,0,0})}, - FunctionInfo{176, nullptr, "Unknown176", MakeVersionGate({20,0,0})}, - FunctionInfo{177, nullptr, "Unknown177", MakeVersionGate({20,0,0})}, - FunctionInfo{2000, nullptr, "Unknown2000", MakeVersionGate({20,0,0})}, - FunctionInfo{2001, nullptr, "Unknown2001", MakeVersionGate({20,0,0})}, - FunctionInfo{2002, nullptr, "Unknown2002", MakeVersionGate({20,0,0})}, - FunctionInfo{2003, nullptr, "Unknown2003", MakeVersionGate({20,0,0})}, - FunctionInfo{2004, nullptr, "Unknown2004", MakeVersionGate({20,0,0})}, - FunctionInfo{2007, nullptr, "Unknown2007", MakeVersionGate({20,0,0})}, - FunctionInfo{2011, nullptr, "Unknown2011", MakeVersionGate({20,0,0})}, - FunctionInfo{2012, nullptr, "Unknown2012", MakeVersionGate({20,0,0})}, - FunctionInfo{2013, nullptr, "Unknown2013", MakeVersionGate({20,0,0})}, - FunctionInfo{2014, nullptr, "Unknown2014", MakeVersionGate({20,0,0})}, - FunctionInfo{2015, nullptr, "Unknown2015", MakeVersionGate({20,0,0})}, - FunctionInfo{2016, nullptr, "Unknown2016", MakeVersionGate({20,0,0})}, - FunctionInfo{2017, nullptr, "Unknown2017", MakeVersionGate({20,0,0})}, - FunctionInfo{2018, nullptr, "Unknown2018", MakeVersionGate({20,0,0})}, - FunctionInfo{2019, nullptr, "Unknown2019", MakeVersionGate({20,0,0})}, - FunctionInfo{2020, nullptr, "Unknown2020", MakeVersionGate({20,0,0})}, - FunctionInfo{2021, nullptr, "Unknown2021", MakeVersionGate({20,0,0})}, - FunctionInfo{2022, nullptr, "Unknown2022", MakeVersionGate({20,0,0})}, - FunctionInfo{2023, nullptr, "Unknown2023", MakeVersionGate({20,0,0})}, - FunctionInfo{2024, nullptr, "Unknown2024", MakeVersionGate({20,0,0})}, - FunctionInfo{2025, nullptr, "Unknown2025", MakeVersionGate({20,0,0})}, - FunctionInfo{2026, nullptr, "Unknown2026", MakeVersionGate({20,0,0})}, - FunctionInfo{2027, nullptr, "Unknown2027", MakeVersionGate({20,0,0})}, - FunctionInfo{2028, nullptr, "Unknown2028", MakeVersionGate({20,0,0})}, - FunctionInfo{2029, nullptr, "Unknown2029", MakeVersionGate({20,0,0})}, - FunctionInfo{2030, nullptr, "Unknown2030", MakeVersionGate({20,0,0})}, - FunctionInfo{2031, nullptr, "Unknown2031", MakeVersionGate({20,0,0})}, - FunctionInfo{2032, nullptr, "Unknown2032", MakeVersionGate({20,0,0})}, - FunctionInfo{2033, nullptr, "Unknown2033", MakeVersionGate({20,0,0})}, - FunctionInfo{2034, nullptr, "Unknown2034", MakeVersionGate({20,0,0})}, - FunctionInfo{2035, nullptr, "Unknown2035", MakeVersionGate({20,0,0})}, - FunctionInfo{2036, nullptr, "Unknown2036", MakeVersionGate({20,0,0})}, - FunctionInfo{2037, nullptr, "Unknown2037", MakeVersionGate({20,0,0})}, - FunctionInfo{2038, nullptr, "Unknown2038", MakeVersionGate({20,0,0})}, - FunctionInfo{2039, nullptr, "Unknown2039", MakeVersionGate({20,0,0})}, - FunctionInfo{2040, nullptr, "Unknown2040", MakeVersionGate({20,0,0})}, - FunctionInfo{2041, nullptr, "Unknown2041", MakeVersionGate({20,0,0})}, - FunctionInfo{2042, nullptr, "Unknown2042", MakeVersionGate({20,0,0})}, - FunctionInfo{2043, nullptr, "Unknown2043", MakeVersionGate({20,0,0})}, - FunctionInfo{2044, nullptr, "Unknown2044", MakeVersionGate({20,0,0})}, - FunctionInfo{2045, nullptr, "Unknown2045", MakeVersionGate({20,0,0})}, - FunctionInfo{2046, nullptr, "Unknown2046", MakeVersionGate({20,0,0})}, - FunctionInfo{2047, nullptr, "Unknown2047", MakeVersionGate({20,0,0})}, - FunctionInfo{2048, nullptr, "Unknown2048", MakeVersionGate({20,0,0})}, - FunctionInfo{2049, nullptr, "Unknown2049", MakeVersionGate({20,0,0})}, - FunctionInfo{2050, nullptr, "Unknown2050", MakeVersionGate({20,0,0})}, - FunctionInfo{2051, nullptr, "Unknown2051", MakeVersionGate({20,0,0})}, - FunctionInfo{3000, nullptr, "RequestLatestApplicationIcon", MakeVersionGate({17,0,0})}, - FunctionInfo{3001, nullptr, "RequestDownloadIdbeLatestIconFile", MakeVersionGate({17,0,0})} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class NIM_ECA final : public ServiceFramework { public: - explicit NIM_ECA(Core::System& system_) : ServiceFramework{system_, "nim:eca"} {} + explicit NIM_ECA(Core::System& system_) : ServiceFramework{system_, "nim:eca"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &NIM_ECA::CreateServerInterface, "CreateServerInterface"}, + {1, nullptr, "RefreshDebugAvailability"}, + {2, nullptr, "ClearDebugResponse"}, + {3, nullptr, "RegisterDebugResponse"}, + {4, &NIM_ECA::IsLargeResourceAvailable, "IsLargeResourceAvailable"}, + {5, &NIM_ECA::CreateServerInterface2, "CreateServerInterface2"} // 17.0.0+ + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -450,53 +463,45 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &NIM_ECA::CreateServerInterface, "CreateServerInterface"}, - FunctionInfo{1, nullptr, "RefreshDebugAvailability"}, - FunctionInfo{2, nullptr, "ClearDebugResponse"}, - FunctionInfo{3, nullptr, "RegisterDebugResponse"}, - FunctionInfo{4, &NIM_ECA::IsLargeResourceAvailable, "IsLargeResourceAvailable"}, - FunctionInfo{5, &NIM_ECA::CreateServerInterface2, "CreateServerInterface2", MakeVersionGate({17,0,0})} - ); }; class NIM_SHP final : public ServiceFramework { public: - explicit NIM_SHP(Core::System& system_) : ServiceFramework{system_, "nim:shp"} {} + explicit NIM_SHP(Core::System& system_) : ServiceFramework{system_, "nim:shp"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestDeviceAuthenticationToken"}, + {1, nullptr, "RequestCachedDeviceAuthenticationToken"}, + {2, nullptr, "RequestEdgeToken"}, + {3, nullptr, "RequestCachedEdgeToken"}, + {100, nullptr, "RequestRegisterDeviceAccount"}, + {101, nullptr, "RequestUnregisterDeviceAccount"}, + {102, nullptr, "RequestDeviceAccountStatus"}, + {103, nullptr, "GetDeviceAccountInfo"}, + {104, nullptr, "RequestDeviceRegistrationInfo"}, + {105, nullptr, "RequestTransferDeviceAccount"}, + {106, nullptr, "RequestSyncRegistration"}, + {107, nullptr, "IsOwnDeviceId"}, + {200, nullptr, "RequestRegisterNotificationToken"}, + {300, nullptr, "RequestUnlinkDevice"}, + {301, nullptr, "RequestUnlinkDeviceIntegrated"}, + {302, nullptr, "RequestLinkDevice"}, + {303, nullptr, "HasDeviceLink"}, + {304, nullptr, "RequestUnlinkDeviceAll"}, + {305, nullptr, "RequestCreateVirtualAccount"}, + {306, nullptr, "RequestDeviceLinkStatus"}, + {400, nullptr, "GetAccountByVirtualAccount"}, + {401, nullptr, "GetVirtualAccount"}, + {500, nullptr, "RequestSyncTicketLegacy"}, + {501, nullptr, "RequestDownloadTicket"}, + {502, nullptr, "RequestDownloadTicketForPrepurchasedContents"}, + {503, nullptr, "RequestSyncTicket"}, + {504, nullptr, "RequestDownloadTicketForPrepurchasedContents2"}, + {505, nullptr, "RequestDownloadTicketForPrepurchasedContentsForAccount"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestDeviceAuthenticationToken"}, - FunctionInfo{1, nullptr, "RequestCachedDeviceAuthenticationToken"}, - FunctionInfo{2, nullptr, "RequestEdgeToken"}, - FunctionInfo{3, nullptr, "RequestCachedEdgeToken"}, - FunctionInfo{100, nullptr, "RequestRegisterDeviceAccount"}, - FunctionInfo{101, nullptr, "RequestUnregisterDeviceAccount"}, - FunctionInfo{102, nullptr, "RequestDeviceAccountStatus"}, - FunctionInfo{103, nullptr, "GetDeviceAccountInfo"}, - FunctionInfo{104, nullptr, "RequestDeviceRegistrationInfo"}, - FunctionInfo{105, nullptr, "RequestTransferDeviceAccount"}, - FunctionInfo{106, nullptr, "RequestSyncRegistration"}, - FunctionInfo{107, nullptr, "IsOwnDeviceId"}, - FunctionInfo{200, nullptr, "RequestRegisterNotificationToken"}, - FunctionInfo{300, nullptr, "RequestUnlinkDevice"}, - FunctionInfo{301, nullptr, "RequestUnlinkDeviceIntegrated"}, - FunctionInfo{302, nullptr, "RequestLinkDevice"}, - FunctionInfo{303, nullptr, "HasDeviceLink"}, - FunctionInfo{304, nullptr, "RequestUnlinkDeviceAll"}, - FunctionInfo{305, nullptr, "RequestCreateVirtualAccount"}, - FunctionInfo{306, nullptr, "RequestDeviceLinkStatus"}, - FunctionInfo{400, nullptr, "GetAccountByVirtualAccount"}, - FunctionInfo{401, nullptr, "GetVirtualAccount"}, - FunctionInfo{500, nullptr, "RequestSyncTicketLegacy"}, - FunctionInfo{501, nullptr, "RequestDownloadTicket"}, - FunctionInfo{502, nullptr, "RequestDownloadTicketForPrepurchasedContents"}, - FunctionInfo{503, nullptr, "RequestSyncTicket"}, - FunctionInfo{504, nullptr, "RequestDownloadTicketForPrepurchasedContents2"}, - FunctionInfo{505, nullptr, "RequestDownloadTicketForPrepurchasedContentsForAccount"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; @@ -506,7 +511,19 @@ public: explicit IEnsureNetworkClockAvailabilityService(Core::System& system_) : ServiceFramework{system_, "IEnsureNetworkClockAvailabilityService"}, service_context{system_, "IEnsureNetworkClockAvailabilityService"} { - finished_event = service_context.CreateEvent("IEnsureNetworkClockAvailabilityService:FinishEvent"); + static const FunctionInfo functions[] = { + {0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"}, + {1, &IEnsureNetworkClockAvailabilityService::GetFinishNotificationEvent, + "GetFinishNotificationEvent"}, + {2, &IEnsureNetworkClockAvailabilityService::GetResult, "GetResult"}, + {3, &IEnsureNetworkClockAvailabilityService::Cancel, "Cancel"}, + {4, &IEnsureNetworkClockAvailabilityService::IsProcessing, "IsProcessing"}, + {5, &IEnsureNetworkClockAvailabilityService::GetServerTime, "GetServerTime"}, + }; + RegisterHandlers(functions); + + finished_event = + service_context.CreateEvent("IEnsureNetworkClockAvailabilityService:FinishEvent"); } ~IEnsureNetworkClockAvailabilityService() override { @@ -563,27 +580,23 @@ private: rb.PushRaw(server_time); } - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"}, - FunctionInfo{1, &IEnsureNetworkClockAvailabilityService::GetFinishNotificationEvent, "GetFinishNotificationEvent"}, - FunctionInfo{2, &IEnsureNetworkClockAvailabilityService::GetResult, "GetResult"}, - FunctionInfo{3, &IEnsureNetworkClockAvailabilityService::Cancel, "Cancel"}, - FunctionInfo{4, &IEnsureNetworkClockAvailabilityService::IsProcessing, "IsProcessing"}, - FunctionInfo{5, &IEnsureNetworkClockAvailabilityService::GetServerTime, "GetServerTime"} - ); KernelHelpers::ServiceContext service_context; + Kernel::KEvent* finished_event; }; class NTC final : public ServiceFramework { public: - explicit NTC(Core::System& system_) : ServiceFramework{system_, "ntc"} {} + explicit NTC(Core::System& system_) : ServiceFramework{system_, "ntc"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &NTC::OpenEnsureNetworkClockAvailabilityService, "OpenEnsureNetworkClockAvailabilityService"}, + {100, &NTC::SuspendAutonomicTimeCorrection, "SuspendAutonomicTimeCorrection"}, + {101, &NTC::ResumeAutonomicTimeCorrection, "ResumeAutonomicTimeCorrection"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -609,24 +622,18 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &NTC::OpenEnsureNetworkClockAvailabilityService, "OpenEnsureNetworkClockAvailabilityService"}, - FunctionInfo{100, &NTC::SuspendAutonomicTimeCorrection, "SuspendAutonomicTimeCorrection"}, - FunctionInfo{101, &NTC::ResumeAutonomicTimeCorrection, "ResumeAutonomicTimeCorrection"} - ); }; class NIM_ECAS final : public ServiceFramework { public: - explicit NIM_ECAS(Core::System& system_) : ServiceFramework{system_, "nim:ecas"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RegisterSpecialClient"}, - FunctionInfo{1, nullptr, "UnregisterSpecialClient"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit NIM_ECAS(Core::System& system_) : ServiceFramework{system_, "nim:ecas"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RegisterSpecialClient"}, + {1, nullptr, "UnregisterSpecialClient"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/nim/nim.h b/src/core/hle/service/nim/nim.h index e7d599908d..0fad2a71af 100644 --- a/src/core/hle/service/nim/nim.h +++ b/src/core/hle/service/nim/nim.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/npns/npns.cpp b/src/core/hle/service/npns/npns.cpp index 90bf633e8b..b0f74bef06 100644 --- a/src/core/hle/service/npns/npns.cpp +++ b/src/core/hle/service/npns/npns.cpp @@ -19,10 +19,79 @@ class INpnsSystem final : public ServiceFramework { public: explicit INpnsSystem(Core::System& system_) : ServiceFramework{system_, "npns:s"}, service_context{system, "npns:s"}, - get_receive_event{service_context}, get_request_change_state_cancel_event{service_context} {} + get_receive_event{service_context}, get_request_change_state_cancel_event{service_context} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "ListenAll"}, + {2, C<&INpnsSystem::ListenTo>, "ListenTo"}, + {3, nullptr, "Receive"}, + {4, nullptr, "ReceiveRaw"}, + {5, C<&INpnsSystem::GetReceiveEvent>, "GetReceiveEvent"}, + {6, nullptr, "ListenUndelivered"}, + {7, nullptr, "GetStateChangeEvent"}, + {8, C<&INpnsSystem::ListenToByName>, "ListenToByName"}, + {11, nullptr, "SubscribeTopic"}, + {12, nullptr, "UnsubscribeTopic"}, + {13, nullptr, "QueryIsTopicExist"}, + {14, nullptr, "SubscribeTopicByAccount"}, // 18.0.0+ + {15, nullptr, "UnsubscribeTopicByAccount"}, // 18.0.0+ + {16, nullptr, "DownloadSubscriptionList"}, // 18.0.0+ + {21, nullptr, "CreateToken"}, + {22, nullptr, "CreateTokenWithApplicationId"}, + {23, nullptr, "DestroyToken"}, + {24, nullptr, "DestroyTokenWithApplicationId"}, + {25, nullptr, "QueryIsTokenValid"}, + {26, nullptr, "ListenToMyApplicationId"}, + {27, nullptr, "DestroyTokenAll"}, + {28, nullptr, "CreateTokenWithName"}, // 18.0.0+ + {29, nullptr, "DestroyTokenWithName"}, // 18.0.0+ + {31, nullptr, "UploadTokenToBaaS"}, + {32, nullptr, "DestroyTokenForBaaS"}, + {33, nullptr, "CreateTokenForBaaS"}, + {34, nullptr, "SetBaaSDeviceAccountIdList"}, + {35, nullptr, "LinkNsaId"}, // 17.0.0+ + {36, nullptr, "UnlinkNsaId"}, // 17.0.0+ + {37, nullptr, "RelinkNsaId"}, // 18.0.0+ + {40, nullptr, "GetNetworkServiceAccountIdTokenRequestEvent"}, // 17.0.0+ + {41, nullptr, "TryPopNetworkServiceAccountIdTokenRequestUid"}, // 17.0.0+ + {42, nullptr, "SetNetworkServiceAccountIdTokenSuccess"}, // 17.0.0+ + {43, nullptr, "SetNetworkServiceAccountIdTokenFailure"}, // 17.0.0+ + {44, nullptr, "SetUidList"}, // 17.0.0+ + {45, nullptr, "PutDigitalTwinKeyValue"}, // 17.0.0+ + {51, nullptr, "DeleteDigitalTwinKeyValue"}, // 18.0.0+ + {101, nullptr, "Suspend"}, + {102, nullptr, "Resume"}, + {103, C<&INpnsSystem::GetState>, "GetState"}, + {104, nullptr, "GetStatistics"}, + {105, nullptr, "GetPlayReportRequestEvent"}, + {106, C<&INpnsSystem::GetLastNotifiedTime>, "GetLastNotifiedTime"}, // 18.0.0+ + {107, nullptr, "SetLastNotifiedTime"}, // 18.0.0+ + {111, nullptr, "GetJid"}, + {112, nullptr, "CreateJid"}, + {113, nullptr, "DestroyJid"}, + {114, nullptr, "AttachJid"}, + {115, nullptr, "DetachJid"}, + {120, nullptr, "CreateNotificationReceiver"}, + {151, nullptr, "GetStateWithHandover"}, + {152, nullptr, "GetStateChangeEventWithHandover"}, + {153, nullptr, "GetDropEventWithHandover"}, + {154, nullptr, "CreateTokenAsync"}, + {155, nullptr, "CreateTokenAsyncWithApplicationId"}, + {156, nullptr, "CreateTokenWithNameAsync"}, // 18.0.0+ + {161, C<&INpnsSystem::GetRequestChangeStateCancelEvent>, "GetRequestChangeStateCancelEvent"}, // 10.0.0+ + {162, nullptr, "RequestChangeStateForceTimedWithCancelEvent"}, + {201, nullptr, "RequestChangeStateForceTimed"}, + {202, nullptr, "RequestChangeStateForceAsync"}, + {301, nullptr, "GetPassword"}, // 18.0.0+ + {302, nullptr, "GetAllImmigration"}, // 18.0.0+ + {303, nullptr, "GetNotificationHistories"}, // 18.0.0+ + {304, nullptr, "GetPersistentConnectionSummary"}, // 18.0.0+ + {305, nullptr, "GetDigitalTwinSummary"}, // 18.0.0+ + {306, nullptr, "GetDigitalTwinValue"}, // 18.0.0+ + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } ~INpnsSystem() override = default; @@ -71,74 +140,6 @@ private: R_SUCCEED(); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "ListenAll"}, - FunctionInfo{2, C<&INpnsSystem::ListenTo>, "ListenTo"}, - FunctionInfo{3, nullptr, "Receive"}, - FunctionInfo{4, nullptr, "ReceiveRaw"}, - FunctionInfo{5, C<&INpnsSystem::GetReceiveEvent>, "GetReceiveEvent"}, - FunctionInfo{6, nullptr, "ListenUndelivered"}, - FunctionInfo{7, nullptr, "GetStateChangeEvent"}, - FunctionInfo{8, C<&INpnsSystem::ListenToByName>, "ListenToByName"}, - FunctionInfo{11, nullptr, "SubscribeTopic"}, - FunctionInfo{12, nullptr, "UnsubscribeTopic"}, - FunctionInfo{13, nullptr, "QueryIsTopicExist"}, - FunctionInfo{14, nullptr, "SubscribeTopicByAccount", MakeVersionGate({18,0,0})}, - FunctionInfo{15, nullptr, "UnsubscribeTopicByAccount", MakeVersionGate({18,0,0})}, - FunctionInfo{16, nullptr, "DownloadSubscriptionList", MakeVersionGate({18,0,0})}, - FunctionInfo{21, nullptr, "CreateToken"}, - FunctionInfo{22, nullptr, "CreateTokenWithApplicationId"}, - FunctionInfo{23, nullptr, "DestroyToken"}, - FunctionInfo{24, nullptr, "DestroyTokenWithApplicationId"}, - FunctionInfo{25, nullptr, "QueryIsTokenValid"}, - FunctionInfo{26, nullptr, "ListenToMyApplicationId"}, - FunctionInfo{27, nullptr, "DestroyTokenAll"}, - FunctionInfo{28, nullptr, "CreateTokenWithName", MakeVersionGate({18,0,0})}, - FunctionInfo{29, nullptr, "DestroyTokenWithName", MakeVersionGate({18,0,0})}, - FunctionInfo{31, nullptr, "UploadTokenToBaaS"}, - FunctionInfo{32, nullptr, "DestroyTokenForBaaS"}, - FunctionInfo{33, nullptr, "CreateTokenForBaaS"}, - FunctionInfo{34, nullptr, "SetBaaSDeviceAccountIdList"}, - FunctionInfo{35, nullptr, "LinkNsaId", MakeVersionGate({17,0,0})}, - FunctionInfo{36, nullptr, "UnlinkNsaId", MakeVersionGate({17,0,0})}, - FunctionInfo{37, nullptr, "RelinkNsaId", MakeVersionGate({18,0,0})}, - FunctionInfo{40, nullptr, "GetNetworkServiceAccountIdTokenRequestEvent", MakeVersionGate({17,0,0})}, - FunctionInfo{41, nullptr, "TryPopNetworkServiceAccountIdTokenRequestUid", MakeVersionGate({17,0,0})}, - FunctionInfo{42, nullptr, "SetNetworkServiceAccountIdTokenSuccess", MakeVersionGate({17,0,0})}, - FunctionInfo{43, nullptr, "SetNetworkServiceAccountIdTokenFailure", MakeVersionGate({17,0,0})}, - FunctionInfo{44, nullptr, "SetUidList", MakeVersionGate({17,0,0})}, - FunctionInfo{45, nullptr, "PutDigitalTwinKeyValue", MakeVersionGate({17,0,0})}, - FunctionInfo{51, nullptr, "DeleteDigitalTwinKeyValue", MakeVersionGate({18,0,0})}, - FunctionInfo{101, nullptr, "Suspend"}, - FunctionInfo{102, nullptr, "Resume"}, - FunctionInfo{103, C<&INpnsSystem::GetState>, "GetState"}, - FunctionInfo{104, nullptr, "GetStatistics"}, - FunctionInfo{105, nullptr, "GetPlayReportRequestEvent"}, - FunctionInfo{106, C<&INpnsSystem::GetLastNotifiedTime>, "GetLastNotifiedTime", MakeVersionGate({18,0,0})}, - FunctionInfo{107, nullptr, "SetLastNotifiedTime", MakeVersionGate({18,0,0})}, - FunctionInfo{111, nullptr, "GetJid"}, - FunctionInfo{112, nullptr, "CreateJid"}, - FunctionInfo{113, nullptr, "DestroyJid"}, - FunctionInfo{114, nullptr, "AttachJid"}, - FunctionInfo{115, nullptr, "DetachJid"}, - FunctionInfo{120, nullptr, "CreateNotificationReceiver"}, - FunctionInfo{151, nullptr, "GetStateWithHandover"}, - FunctionInfo{152, nullptr, "GetStateChangeEventWithHandover"}, - FunctionInfo{153, nullptr, "GetDropEventWithHandover"}, - FunctionInfo{154, nullptr, "CreateTokenAsync"}, - FunctionInfo{155, nullptr, "CreateTokenAsyncWithApplicationId"}, - FunctionInfo{156, nullptr, "CreateTokenWithNameAsync", MakeVersionGate({18,0,0})}, - FunctionInfo{161, C<&INpnsSystem::GetRequestChangeStateCancelEvent>, "GetRequestChangeStateCancelEvent", MakeVersionGate({10,0,0})}, - FunctionInfo{162, nullptr, "RequestChangeStateForceTimedWithCancelEvent"}, - FunctionInfo{201, nullptr, "RequestChangeStateForceTimed"}, - FunctionInfo{202, nullptr, "RequestChangeStateForceAsync"}, - FunctionInfo{301, nullptr, "GetPassword", MakeVersionGate({18,0,0})}, - FunctionInfo{302, nullptr, "GetAllImmigration", MakeVersionGate({18,0,0})}, - FunctionInfo{303, nullptr, "GetNotificationHistories", MakeVersionGate({18,0,0})}, - FunctionInfo{304, nullptr, "GetPersistentConnectionSummary", MakeVersionGate({18,0,0})}, - FunctionInfo{305, nullptr, "GetDigitalTwinSummary", MakeVersionGate({18,0,0})}, - FunctionInfo{306, nullptr, "GetDigitalTwinValue", MakeVersionGate({18,0,0})} - ); KernelHelpers::ServiceContext service_context; Event get_receive_event; Event get_request_change_state_cancel_event; @@ -147,10 +148,34 @@ private: class INpnsUser final : public ServiceFramework { public: explicit INpnsUser(Core::System& system_) - : ServiceFramework{system_, "npns:u"}, service_context{system, "npns:u"}, get_receive_event{service_context} {} + : ServiceFramework{system_, "npns:u"}, service_context{system, "npns:u"}, get_receive_event{service_context} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "ListenAll"}, + {2, nullptr, "ListenTo"}, + {3, nullptr, "Receive"}, + {4, nullptr, "ReceiveRaw"}, + {5, C<&INpnsUser::GetReceiveEvent>, "GetReceiveEvent"}, + {7, nullptr, "GetStateChangeEvent"}, + {8, C<&INpnsUser::ListenToByName>, "ListenToByName"}, // 18.0.0+ + {21, nullptr, "CreateToken"}, + {23, nullptr, "DestroyToken"}, + {25, nullptr, "QueryIsTokenValid"}, + {26, nullptr, "ListenToMyApplicationId"}, + {101, nullptr, "Suspend"}, + {102, nullptr, "Resume"}, + {103, nullptr, "GetState"}, + {104, nullptr, "GetStatistics"}, + {111, nullptr, "GetJid"}, + {120, nullptr, "CreateNotificationReceiver"}, + {151, nullptr, "GetStateWithHandover"}, + {152, nullptr, "GetStateChangeEventWithHandover"}, + {153, nullptr, "GetDropEventWithHandover"}, + {154, nullptr, "CreateTokenAsync"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -170,29 +195,6 @@ private: R_SUCCEED(); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, nullptr, "ListenAll"}, - FunctionInfo{2, nullptr, "ListenTo"}, - FunctionInfo{3, nullptr, "Receive"}, - FunctionInfo{4, nullptr, "ReceiveRaw"}, - FunctionInfo{5, C<&INpnsUser::GetReceiveEvent>, "GetReceiveEvent"}, - FunctionInfo{7, nullptr, "GetStateChangeEvent"}, - FunctionInfo{8, C<&INpnsUser::ListenToByName>, "ListenToByName", MakeVersionGate({18,0,0})}, - FunctionInfo{21, nullptr, "CreateToken"}, - FunctionInfo{23, nullptr, "DestroyToken"}, - FunctionInfo{25, nullptr, "QueryIsTokenValid"}, - FunctionInfo{26, nullptr, "ListenToMyApplicationId"}, - FunctionInfo{101, nullptr, "Suspend"}, - FunctionInfo{102, nullptr, "Resume"}, - FunctionInfo{103, nullptr, "GetState"}, - FunctionInfo{104, nullptr, "GetStatistics"}, - FunctionInfo{111, nullptr, "GetJid"}, - FunctionInfo{120, nullptr, "CreateNotificationReceiver"}, - FunctionInfo{151, nullptr, "GetStateWithHandover"}, - FunctionInfo{152, nullptr, "GetStateChangeEventWithHandover"}, - FunctionInfo{153, nullptr, "GetDropEventWithHandover"}, - FunctionInfo{154, nullptr, "CreateTokenAsync"} - ); KernelHelpers::ServiceContext service_context; Event get_receive_event; }; diff --git a/src/core/hle/service/npns/npns.h b/src/core/hle/service/npns/npns.h index 0019fca763..e54a91a213 100644 --- a/src/core/hle/service/npns/npns.h +++ b/src/core/hle/service/npns/npns.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ns/account_proxy_interface.cpp b/src/core/hle/service/ns/account_proxy_interface.cpp index 0107e16b72..2e3dcf928d 100644 --- a/src/core/hle/service/ns/account_proxy_interface.cpp +++ b/src/core/hle/service/ns/account_proxy_interface.cpp @@ -10,6 +10,13 @@ namespace Service::NS { IAccountProxyInterface::IAccountProxyInterface(Core::System& system_) : ServiceFramework{system_, "IAccountProxyInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateUserAccount"}, + }; + // clang-format on + + RegisterHandlers(functions); } IAccountProxyInterface::~IAccountProxyInterface() = default; diff --git a/src/core/hle/service/ns/account_proxy_interface.h b/src/core/hle/service/ns/account_proxy_interface.h index 37248726a9..14cec4ddbc 100644 --- a/src/core/hle/service/ns/account_proxy_interface.h +++ b/src/core/hle/service/ns/account_proxy_interface.h @@ -14,13 +14,6 @@ class IAccountProxyInterface final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateUserAccount"} - ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/application_manager_interface.cpp b/src/core/hle/service/ns/application_manager_interface.cpp index 7220c52dcb..348649917e 100644 --- a/src/core/hle/service/ns/application_manager_interface.cpp +++ b/src/core/hle/service/ns/application_manager_interface.cpp @@ -25,458 +25,6 @@ namespace Service::NS { -std::optional IApplicationManagerInterface::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IApplicationManagerInterface::ListApplicationRecord>, "ListApplicationRecord"}, - FunctionInfo{1, nullptr, "GenerateApplicationRecordCount"}, - FunctionInfo{2, D<&IApplicationManagerInterface::GetApplicationRecordUpdateSystemEvent>, "GetApplicationRecordUpdateSystemEvent"}, - FunctionInfo{3, nullptr, "GetApplicationViewDeprecated"}, - FunctionInfo{4, D<&IApplicationManagerInterface::DeleteApplicationEntity>, "DeleteApplicationEntity"}, - FunctionInfo{5, D<&IApplicationManagerInterface::DeleteApplicationCompletely>, "DeleteApplicationCompletely"}, - FunctionInfo{6, nullptr, "IsAnyApplicationEntityRedundant"}, - FunctionInfo{7, nullptr, "DeleteRedundantApplicationEntity"}, - FunctionInfo{8, nullptr, "IsApplicationEntityMovable"}, - FunctionInfo{9, nullptr, "MoveApplicationEntity"}, - FunctionInfo{11, nullptr, "CalculateApplicationOccupiedSize"}, - FunctionInfo{16, &IApplicationManagerInterface::PushApplicationRecord, "PushApplicationRecord"}, - FunctionInfo{17, nullptr, "ListApplicationRecordContentMeta"}, - FunctionInfo{19, nullptr, "LaunchApplicationOld"}, - FunctionInfo{21, nullptr, "GetApplicationContentPath"}, - FunctionInfo{22, nullptr, "TerminateApplication"}, - FunctionInfo{23, nullptr, "ResolveApplicationContentPath"}, - FunctionInfo{26, nullptr, "BeginInstallApplication"}, - FunctionInfo{27, nullptr, "DeleteApplicationRecord"}, - FunctionInfo{30, nullptr, "RequestApplicationUpdateInfo"}, - FunctionInfo{31, nullptr, "RequestUpdateApplication"}, - FunctionInfo{32, nullptr, "CancelApplicationDownload"}, - FunctionInfo{33, nullptr, "ResumeApplicationDownload"}, - FunctionInfo{35, nullptr, "UpdateVersionList"}, - FunctionInfo{36, nullptr, "PushLaunchVersion"}, - FunctionInfo{37, nullptr, "ListRequiredVersion"}, - FunctionInfo{38, D<&IApplicationManagerInterface::CheckApplicationLaunchVersion>, "CheckApplicationLaunchVersion"}, - FunctionInfo{39, nullptr, "CheckApplicationLaunchRights"}, - FunctionInfo{40, D<&IApplicationManagerInterface::GetApplicationLogoData>, "GetApplicationLogoData"}, - FunctionInfo{41, nullptr, "CalculateApplicationDownloadRequiredSize"}, - FunctionInfo{42, nullptr, "CleanupSdCard"}, - FunctionInfo{43, D<&IApplicationManagerInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, - FunctionInfo{44, D<&IApplicationManagerInterface::GetSdCardMountStatusChangedEvent>, "GetSdCardMountStatusChangedEvent"}, - FunctionInfo{45, nullptr, "GetGameCardAttachmentEvent"}, - FunctionInfo{46, nullptr, "GetGameCardAttachmentInfo"}, - FunctionInfo{47, D<&IApplicationManagerInterface::GetTotalSpaceSize>, "GetTotalSpaceSize"}, - FunctionInfo{48, D<&IApplicationManagerInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, - FunctionInfo{49, nullptr, "GetSdCardRemovedEvent"}, - FunctionInfo{52, D<&IApplicationManagerInterface::GetGameCardUpdateDetectionEvent>, "GetGameCardUpdateDetectionEvent"}, - FunctionInfo{53, nullptr, "DisableApplicationAutoDelete"}, - FunctionInfo{54, nullptr, "EnableApplicationAutoDelete"}, - FunctionInfo{55, D<&IApplicationManagerInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, - FunctionInfo{56, nullptr, "SetApplicationTerminateResult"}, - FunctionInfo{57, nullptr, "ClearApplicationTerminateResult"}, - FunctionInfo{58, nullptr, "GetLastSdCardMountUnexpectedResult"}, - FunctionInfo{59, D<&IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, - FunctionInfo{60, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, - FunctionInfo{61, nullptr, "GetBackgroundDownloadStressTaskInfo"}, - FunctionInfo{62, nullptr, "GetGameCardStopper"}, - FunctionInfo{63, nullptr, "IsSystemProgramInstalled"}, - FunctionInfo{64, nullptr, "StartApplyDeltaTask"}, - FunctionInfo{65, nullptr, "GetRequestServerStopper"}, - FunctionInfo{66, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, - FunctionInfo{67, nullptr, "CancelApplicationApplyDelta"}, - FunctionInfo{68, nullptr, "ResumeApplicationApplyDelta"}, - FunctionInfo{69, nullptr, "CalculateApplicationApplyDeltaRequiredSize"}, - FunctionInfo{70, D<&IApplicationManagerInterface::ResumeAll>, "ResumeAll"}, - FunctionInfo{71, D<&IApplicationManagerInterface::GetStorageSize>, "GetStorageSize"}, - FunctionInfo{80, nullptr, "RequestDownloadApplication"}, - FunctionInfo{81, nullptr, "RequestDownloadAddOnContent"}, - FunctionInfo{82, nullptr, "DownloadApplication"}, - FunctionInfo{83, nullptr, "CheckApplicationResumeRights"}, - FunctionInfo{84, nullptr, "GetDynamicCommitEvent"}, - FunctionInfo{85, nullptr, "RequestUpdateApplication2"}, - FunctionInfo{86, nullptr, "EnableApplicationCrashReport"}, - FunctionInfo{87, nullptr, "IsApplicationCrashReportEnabled"}, - FunctionInfo{90, nullptr, "BoostSystemMemoryResourceLimit"}, - FunctionInfo{91, nullptr, "DeprecatedLaunchApplication"}, - FunctionInfo{92, nullptr, "GetRunningApplicationProgramId"}, - FunctionInfo{93, nullptr, "GetMainApplicationProgramIndex"}, - FunctionInfo{94, nullptr, "LaunchApplication"}, - FunctionInfo{95, nullptr, "GetApplicationLaunchInfo"}, - FunctionInfo{96, nullptr, "AcquireApplicationLaunchInfo"}, - FunctionInfo{97, nullptr, "GetMainApplicationProgramIndexByApplicationLaunchInfo"}, - FunctionInfo{98, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, - FunctionInfo{99, nullptr, "LaunchDevMenu"}, - FunctionInfo{100, nullptr, "ResetToFactorySettings"}, - FunctionInfo{101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, - FunctionInfo{102, nullptr, "ResetToFactorySettingsForRefurbishment"}, - FunctionInfo{103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, - FunctionInfo{104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, - FunctionInfo{105, nullptr, "RequestResetToFactorySettingsSecurely"}, - FunctionInfo{106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, - FunctionInfo{200, nullptr, "CalculateUserSaveDataStatistics"}, - FunctionInfo{201, nullptr, "DeleteUserSaveDataAll"}, - FunctionInfo{210, nullptr, "DeleteUserSystemSaveData"}, - FunctionInfo{211, nullptr, "DeleteSaveData"}, - FunctionInfo{220, nullptr, "UnregisterNetworkServiceAccount"}, - FunctionInfo{221, D<&IApplicationManagerInterface::UnregisterNetworkServiceAccountWithUserSaveDataDeletion>, "UnregisterNetworkServiceAccountWithUserSaveDataDeletion"}, - FunctionInfo{300, nullptr, "GetApplicationShellEvent"}, - FunctionInfo{301, nullptr, "PopApplicationShellEventInfo"}, - FunctionInfo{302, nullptr, "LaunchLibraryApplet"}, - FunctionInfo{303, nullptr, "TerminateLibraryApplet"}, - FunctionInfo{304, nullptr, "LaunchSystemApplet"}, - FunctionInfo{305, nullptr, "TerminateSystemApplet"}, - FunctionInfo{306, nullptr, "LaunchOverlayApplet"}, - FunctionInfo{307, nullptr, "TerminateOverlayApplet"}, - FunctionInfo{400, D<&IApplicationManagerInterface::GetApplicationControlData>, "GetApplicationControlData"}, - FunctionInfo{401, nullptr, "InvalidateAllApplicationControlCache"}, - FunctionInfo{402, nullptr, "RequestDownloadApplicationControlData"}, - FunctionInfo{403, nullptr, "GetMaxApplicationControlCacheCount"}, - FunctionInfo{404, nullptr, "InvalidateApplicationControlCache"}, - FunctionInfo{405, nullptr, "ListApplicationControlCacheEntryInfo"}, - FunctionInfo{406, nullptr, "GetApplicationControlProperty"}, - FunctionInfo{407, &IApplicationManagerInterface::ListApplicationTitle, "ListApplicationTitle"}, - FunctionInfo{408, &IApplicationManagerInterface::ListApplicationIcon, "ListApplicationIcon"}, - FunctionInfo{411, nullptr, "Unknown411", MakeVersionGate({19,0,0})}, - FunctionInfo{412, nullptr, "Unknown412", MakeVersionGate({19,0,0})}, - FunctionInfo{413, nullptr, "Unknown413", MakeVersionGate({19,0,0})}, - FunctionInfo{414, nullptr, "Unknown414", MakeVersionGate({19,0,0})}, - FunctionInfo{415, nullptr, "Unknown415", MakeVersionGate({19,0,0})}, - FunctionInfo{416, nullptr, "Unknown416", MakeVersionGate({19,0,0})}, - FunctionInfo{417, nullptr, "InvalidateAllApplicationControlCacheOfTheStage", MakeVersionGate({19,0,0})}, - FunctionInfo{418, nullptr, "InvalidateApplicationControlCacheOfTheStage", MakeVersionGate({19,0,0})}, - FunctionInfo{419, D<&IApplicationManagerInterface::RequestDownloadApplicationControlDataInBackground>, "RequestDownloadApplicationControlDataInBackground"}, - FunctionInfo{420, nullptr, "CloneApplicationControlDataCacheForDebug"}, - FunctionInfo{421, nullptr, "Unknown421", MakeVersionGate({20,0,0})}, - FunctionInfo{422, nullptr, "Unknown422", MakeVersionGate({20,0,0})}, - FunctionInfo{423, nullptr, "Unknown423", MakeVersionGate({20,0,0})}, - FunctionInfo{424, nullptr, "Unknown424", MakeVersionGate({20,0,0})}, - FunctionInfo{425, nullptr, "Unknown425", MakeVersionGate({20,0,0})}, - FunctionInfo{426, nullptr, "Unknown426", MakeVersionGate({20,0,0})}, - FunctionInfo{427, nullptr, "Unknown427", MakeVersionGate({20,0,0})}, - FunctionInfo{428, nullptr, "Unknown428", MakeVersionGate({21,0,0})}, - FunctionInfo{429, nullptr, "Unknown429", MakeVersionGate({21,0,0})}, - FunctionInfo{430, nullptr, "Unknown430", MakeVersionGate({21,0,0})}, - FunctionInfo{502, nullptr, "RequestCheckGameCardRegistration"}, - FunctionInfo{503, nullptr, "RequestGameCardRegistrationGoldPoint"}, - FunctionInfo{504, nullptr, "RequestRegisterGameCard"}, - FunctionInfo{505, D<&IApplicationManagerInterface::GetGameCardMountFailureEvent>, "GetGameCardMountFailureEvent"}, - FunctionInfo{506, nullptr, "IsGameCardInserted"}, - FunctionInfo{507, nullptr, "EnsureGameCardAccess"}, - FunctionInfo{508, nullptr, "GetLastGameCardMountFailureResult"}, - FunctionInfo{509, nullptr, "ListApplicationIdOnGameCard"}, - FunctionInfo{510, nullptr, "GetGameCardPlatformRegion"}, - FunctionInfo{511, D<&IApplicationManagerInterface::GetGameCardWakenReadyEvent>, "GetGameCardWakenReadyEvent"}, - FunctionInfo{512, D<&IApplicationManagerInterface::IsGameCardApplicationRunning>, "IsGameCardApplicationRunning"}, - FunctionInfo{513, nullptr, "Unknown513", MakeVersionGate({20,0,0})}, - FunctionInfo{514, nullptr, "Unknown514", MakeVersionGate({20,0,0})}, - FunctionInfo{515, nullptr, "Unknown515", MakeVersionGate({20,0,0})}, - FunctionInfo{516, nullptr, "Unknown516", MakeVersionGate({21,0,0})}, - FunctionInfo{517, nullptr, "Unknown517", MakeVersionGate({21,0,0})}, - FunctionInfo{518, nullptr, "Unknown518", MakeVersionGate({21,0,0})}, - FunctionInfo{519, nullptr, "Unknown519", MakeVersionGate({21,0,0})}, - FunctionInfo{600, nullptr, "CountApplicationContentMeta"}, - FunctionInfo{601, nullptr, "ListApplicationContentMetaStatus"}, - FunctionInfo{602, nullptr, "ListAvailableAddOnContent"}, - FunctionInfo{603, nullptr, "GetOwnedApplicationContentMetaStatus"}, - FunctionInfo{604, nullptr, "RegisterContentsExternalKey"}, - FunctionInfo{605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, - FunctionInfo{606, nullptr, "GetContentMetaStorage"}, - FunctionInfo{607, nullptr, "ListAvailableAddOnContent"}, - FunctionInfo{609, nullptr, "ListAvailabilityAssuredAddOnContent"}, - FunctionInfo{610, nullptr, "GetInstalledContentMetaStorage"}, - FunctionInfo{611, nullptr, "PrepareAddOnContent"}, - FunctionInfo{700, nullptr, "PushDownloadTaskList"}, - FunctionInfo{701, nullptr, "ClearTaskStatusList"}, - FunctionInfo{702, nullptr, "RequestDownloadTaskList"}, - FunctionInfo{703, nullptr, "RequestEnsureDownloadTask"}, - FunctionInfo{704, nullptr, "ListDownloadTaskStatus"}, - FunctionInfo{705, nullptr, "RequestDownloadTaskListData"}, - FunctionInfo{800, nullptr, "RequestVersionList"}, - FunctionInfo{801, nullptr, "ListVersionList"}, - FunctionInfo{802, nullptr, "RequestVersionListData"}, - FunctionInfo{900, nullptr, "GetApplicationRecord"}, - FunctionInfo{901, nullptr, "GetApplicationRecordProperty"}, - FunctionInfo{902, nullptr, "EnableApplicationAutoUpdate"}, - FunctionInfo{903, nullptr, "DisableApplicationAutoUpdate"}, - FunctionInfo{904, D<&IApplicationManagerInterface::TouchApplication>, "TouchApplication"}, - FunctionInfo{905, nullptr, "RequestApplicationUpdate"}, - FunctionInfo{906, D<&IApplicationManagerInterface::IsApplicationUpdateRequested>, "IsApplicationUpdateRequested"}, - FunctionInfo{907, nullptr, "WithdrawApplicationUpdateRequest"}, - FunctionInfo{908, nullptr, "ListApplicationRecordInstalledContentMeta"}, - FunctionInfo{909, nullptr, "WithdrawCleanupAddOnContentsWithNoRightsRecommendation"}, - FunctionInfo{910, nullptr, "HasApplicationRecord"}, - FunctionInfo{911, nullptr, "SetPreInstalledApplication"}, - FunctionInfo{912, nullptr, "ClearPreInstalledApplicationFlag"}, - FunctionInfo{913, nullptr, "ListAllApplicationRecord"}, - FunctionInfo{914, nullptr, "HideApplicationRecord"}, - FunctionInfo{915, nullptr, "ShowApplicationRecord"}, - FunctionInfo{916, nullptr, "IsApplicationAutoDeleteDisabled"}, - FunctionInfo{916, nullptr, "Unknown916", MakeVersionGate({20,0,0})}, - FunctionInfo{917, nullptr, "Unknown917", MakeVersionGate({20,0,0})}, - FunctionInfo{918, nullptr, "Unknown918", MakeVersionGate({20,0,0})}, - FunctionInfo{919, nullptr, "Unknown919", MakeVersionGate({20,0,0})}, - FunctionInfo{920, nullptr, "Unknown920", MakeVersionGate({20,0,0})}, - FunctionInfo{921, nullptr, "Unknown921", MakeVersionGate({20,0,0})}, - FunctionInfo{922, nullptr, "Unknown922", MakeVersionGate({20,0,0})}, - FunctionInfo{923, nullptr, "Unknown923", MakeVersionGate({20,0,0})}, - FunctionInfo{928, nullptr, "Unknown928", MakeVersionGate({20,0,0})}, - FunctionInfo{929, nullptr, "Unknown929", MakeVersionGate({20,0,0})}, - FunctionInfo{930, nullptr, "Unknown930", MakeVersionGate({20,0,0})}, - FunctionInfo{931, nullptr, "Unknown931", MakeVersionGate({20,0,0})}, - FunctionInfo{933, nullptr, "Unknown933", MakeVersionGate({20,0,0})}, - FunctionInfo{934, nullptr, "Unknown934", MakeVersionGate({21,0,0})}, - FunctionInfo{935, nullptr, "Unknown935", MakeVersionGate({21,0,0})}, - FunctionInfo{936, D<&IApplicationManagerInterface::Unknown936>, "Unknown936", MakeVersionGate({21,0,0})}, - FunctionInfo{1000, nullptr, "RequestVerifyApplicationDeprecated"}, - FunctionInfo{1001, nullptr, "CorruptApplicationForDebug"}, - FunctionInfo{1002, nullptr, "RequestVerifyAddOnContentsRights"}, - FunctionInfo{1003, nullptr, "RequestVerifyApplication"}, - FunctionInfo{1004, nullptr, "CorruptContentForDebug"}, - FunctionInfo{1200, nullptr, "NeedsUpdateVulnerability"}, - FunctionInfo{1300, D<&IApplicationManagerInterface::IsAnyApplicationEntityInstalled>, "IsAnyApplicationEntityInstalled"}, - FunctionInfo{1301, nullptr, "DeleteApplicationContentEntities"}, - FunctionInfo{1302, nullptr, "CleanupUnrecordedApplicationEntity"}, - FunctionInfo{1303, nullptr, "CleanupAddOnContentsWithNoRights"}, - FunctionInfo{1304, nullptr, "DeleteApplicationContentEntity"}, - FunctionInfo{1305, nullptr, "TryDeleteRunningApplicationEntity"}, - FunctionInfo{1306, nullptr, "TryDeleteRunningApplicationCompletely"}, - FunctionInfo{1307, nullptr, "TryDeleteRunningApplicationContentEntities"}, - FunctionInfo{1308, nullptr, "DeleteApplicationCompletelyForDebug"}, - FunctionInfo{1309, nullptr, "CleanupUnavailableAddOnContents"}, - FunctionInfo{1310, nullptr, "RequestMoveApplicationEntity"}, - FunctionInfo{1311, nullptr, "EstimateSizeToMove"}, - FunctionInfo{1312, nullptr, "HasMovableEntity"}, - FunctionInfo{1313, nullptr, "CleanupOrphanContents"}, - FunctionInfo{1314, nullptr, "CheckPreconditionSatisfiedToMove"}, - FunctionInfo{1400, nullptr, "PrepareShutdown"}, - FunctionInfo{1500, nullptr, "FormatSdCard"}, - FunctionInfo{1501, nullptr, "NeedsSystemUpdateToFormatSdCard"}, - FunctionInfo{1502, nullptr, "GetLastSdCardFormatUnexpectedResult"}, - FunctionInfo{1504, nullptr, "InsertSdCard"}, - FunctionInfo{1505, nullptr, "RemoveSdCard"}, - FunctionInfo{1506, nullptr, "GetSdCardStartupStatus"}, - FunctionInfo{1508, nullptr, "Unknown1508", MakeVersionGate({20,0,0})}, - FunctionInfo{1509, nullptr, "Unknown1509", MakeVersionGate({20,0,0})}, - FunctionInfo{1510, nullptr, "Unknown1510", MakeVersionGate({20,0,0})}, - FunctionInfo{1511, nullptr, "Unknown1511", MakeVersionGate({20,0,0})}, - FunctionInfo{1512, nullptr, "Unknown1512", MakeVersionGate({20,0,0})}, - FunctionInfo{1600, nullptr, "GetSystemSeedForPseudoDeviceId"}, - FunctionInfo{1601, nullptr, "ResetSystemSeedForPseudoDeviceId"}, - FunctionInfo{1700, nullptr, "ListApplicationDownloadingContentMeta"}, - FunctionInfo{1701, D<&IApplicationManagerInterface::GetApplicationViewDeprecated>, "GetApplicationViewDeprecated"}, - FunctionInfo{1702, nullptr, "GetApplicationDownloadTaskStatus"}, - FunctionInfo{1703, nullptr, "GetApplicationViewDownloadErrorContext"}, - FunctionInfo{1704, D<&IApplicationManagerInterface::GetApplicationViewWithPromotionInfo>, "GetApplicationViewWithPromotionInfo"}, - FunctionInfo{1705, nullptr, "IsPatchAutoDeletableApplication"}, - FunctionInfo{1706, D<&IApplicationManagerInterface::GetApplicationView>, "GetApplicationView"}, - FunctionInfo{1800, nullptr, "IsNotificationSetupCompleted"}, - FunctionInfo{1801, nullptr, "GetLastNotificationInfoCount"}, - FunctionInfo{1802, nullptr, "ListLastNotificationInfo"}, - FunctionInfo{1803, nullptr, "ListNotificationTask"}, - FunctionInfo{1900, nullptr, "IsActiveAccount"}, - FunctionInfo{1901, nullptr, "RequestDownloadApplicationPrepurchasedRights"}, - FunctionInfo{1902, nullptr, "GetApplicationTicketInfo"}, - FunctionInfo{1903, nullptr, "RequestDownloadApplicationPrepurchasedRightsForAccount"}, - FunctionInfo{2000, nullptr, "GetSystemDeliveryInfo"}, - FunctionInfo{2001, nullptr, "SelectLatestSystemDeliveryInfo"}, - FunctionInfo{2002, nullptr, "VerifyDeliveryProtocolVersion"}, - FunctionInfo{2003, nullptr, "GetApplicationDeliveryInfo"}, - FunctionInfo{2004, nullptr, "HasAllContentsToDeliver"}, - FunctionInfo{2005, nullptr, "CompareApplicationDeliveryInfo"}, - FunctionInfo{2006, nullptr, "CanDeliverApplication"}, - FunctionInfo{2007, nullptr, "ListContentMetaKeyToDeliverApplication"}, - FunctionInfo{2008, nullptr, "NeedsSystemUpdateToDeliverApplication"}, - FunctionInfo{2009, nullptr, "EstimateRequiredSize"}, - FunctionInfo{2010, nullptr, "RequestReceiveApplication"}, - FunctionInfo{2011, nullptr, "CommitReceiveApplication"}, - FunctionInfo{2012, nullptr, "GetReceiveApplicationProgress"}, - FunctionInfo{2013, nullptr, "RequestSendApplication"}, - FunctionInfo{2014, nullptr, "GetSendApplicationProgress"}, - FunctionInfo{2015, nullptr, "CompareSystemDeliveryInfo"}, - FunctionInfo{2016, nullptr, "ListNotCommittedContentMeta"}, - FunctionInfo{2017, nullptr, "CreateDownloadTask"}, - FunctionInfo{2018, nullptr, "GetApplicationDeliveryInfoHash"}, - FunctionInfo{2019, nullptr, "Unknown2019", MakeVersionGate({20,0,0})}, - FunctionInfo{2050, D<&IApplicationManagerInterface::GetApplicationRightsOnClient>, "GetApplicationRightsOnClient"}, - FunctionInfo{2051, nullptr, "InvalidateRightsIdCache"}, - FunctionInfo{2052, nullptr, "Unknown2052", MakeVersionGate({20,0,0})}, - FunctionInfo{2053, nullptr, "Unknown2053", MakeVersionGate({20,0,0})}, - FunctionInfo{2100, D<&IApplicationManagerInterface::GetApplicationTerminateResult>, "GetApplicationTerminateResult"}, - FunctionInfo{2101, nullptr, "GetRawApplicationTerminateResult"}, - FunctionInfo{2150, nullptr, "CreateRightsEnvironment"}, - FunctionInfo{2151, nullptr, "DestroyRightsEnvironment"}, - FunctionInfo{2152, nullptr, "ActivateRightsEnvironment"}, - FunctionInfo{2153, nullptr, "DeactivateRightsEnvironment"}, - FunctionInfo{2154, nullptr, "ForceActivateRightsContextForExit"}, - FunctionInfo{2155, nullptr, "UpdateRightsEnvironmentStatus"}, - FunctionInfo{2156, nullptr, "CreateRightsEnvironmentForMicroApplication"}, - FunctionInfo{2160, nullptr, "AddTargetApplicationToRightsEnvironment"}, - FunctionInfo{2161, nullptr, "SetUsersToRightsEnvironment"}, - FunctionInfo{2170, nullptr, "GetRightsEnvironmentStatus"}, - FunctionInfo{2171, nullptr, "GetRightsEnvironmentStatusChangedEvent"}, - FunctionInfo{2180, nullptr, "RequestExtendRightsInRightsEnvironment"}, - FunctionInfo{2181, nullptr, "GetResultOfExtendRightsInRightsEnvironment"}, - FunctionInfo{2182, nullptr, "SetActiveRightsContextUsingStateToRightsEnvironment"}, - FunctionInfo{2183, nullptr, "Unknown2183", MakeVersionGate({20,1,0})}, - FunctionInfo{2190, nullptr, "GetRightsEnvironmentHandleForApplication"}, - FunctionInfo{2199, nullptr, "GetRightsEnvironmentCountForDebug"}, - FunctionInfo{2200, nullptr, "GetGameCardApplicationCopyIdentifier"}, - FunctionInfo{2201, nullptr, "GetInstalledApplicationCopyIdentifier"}, - FunctionInfo{2250, nullptr, "RequestReportActiveELicence"}, - FunctionInfo{2300, nullptr, "ListEventLog"}, - FunctionInfo{2350, nullptr, "PerformAutoUpdateByApplicationId"}, - FunctionInfo{2351, nullptr, "RequestNoDownloadRightsErrorResolution"}, - FunctionInfo{2352, nullptr, "RequestResolveNoDownloadRightsError"}, - FunctionInfo{2353, nullptr, "GetApplicationDownloadTaskInfo"}, - FunctionInfo{2354, nullptr, "PrioritizeApplicationBackgroundTask"}, - FunctionInfo{2355, nullptr, "PreferStorageEfficientUpdate"}, - FunctionInfo{2356, nullptr, "RequestStorageEfficientUpdatePreferable"}, - FunctionInfo{2357, nullptr, "EnableMultiCoreDownload"}, - FunctionInfo{2358, nullptr, "DisableMultiCoreDownload"}, - FunctionInfo{2359, nullptr, "IsMultiCoreDownloadEnabled"}, - FunctionInfo{2360, nullptr, "GetApplicationDownloadTaskCount", MakeVersionGate({19,0,0})}, - FunctionInfo{2361, nullptr, "GetMaxApplicationDownloadTaskCount", MakeVersionGate({19,0,0})}, - FunctionInfo{2362, nullptr, "Unknown2362", MakeVersionGate({20,0,0})}, - FunctionInfo{2363, nullptr, "Unknown2363", MakeVersionGate({20,0,0})}, - FunctionInfo{2364, nullptr, "Unknown2364", MakeVersionGate({20,0,0})}, - FunctionInfo{2365, nullptr, "Unknown2365", MakeVersionGate({20,0,0})}, - FunctionInfo{2366, nullptr, "Unknown2366", MakeVersionGate({20,0,0})}, - FunctionInfo{2367, nullptr, "Unknown2367", MakeVersionGate({20,0,0})}, - FunctionInfo{2368, nullptr, "Unknown2368", MakeVersionGate({20,0,0})}, - FunctionInfo{2369, nullptr, "Unknown2369", MakeVersionGate({21,0,0})}, - FunctionInfo{2400, nullptr, "GetPromotionInfo"}, - FunctionInfo{2401, nullptr, "CountPromotionInfo"}, - FunctionInfo{2402, nullptr, "ListPromotionInfo"}, - FunctionInfo{2403, nullptr, "ImportPromotionJsonForDebug"}, - FunctionInfo{2404, nullptr, "ClearPromotionInfoForDebug"}, - FunctionInfo{2500, nullptr, "ConfirmAvailableTime"}, - FunctionInfo{2510, nullptr, "CreateApplicationResource"}, - FunctionInfo{2511, nullptr, "GetApplicationResource"}, - FunctionInfo{2513, nullptr, "LaunchMicroApplication"}, - FunctionInfo{2514, nullptr, "ClearTaskOfAsyncTaskManager"}, - FunctionInfo{2515, nullptr, "CleanupAllPlaceHolderAndFragmentsIfNoTask"}, - FunctionInfo{2516, nullptr, "EnsureApplicationCertificate"}, - FunctionInfo{2517, nullptr, "CreateApplicationInstance"}, - FunctionInfo{2518, nullptr, "UpdateQualificationForDebug"}, - FunctionInfo{2519, nullptr, "IsQualificationTransitionSupported"}, - FunctionInfo{2520, D<&IApplicationManagerInterface::IsQualificationTransitionSupportedByProcessId>, "IsQualificationTransitionSupportedByProcessId"}, - FunctionInfo{2521, nullptr, "GetRightsUserChangedEvent"}, - FunctionInfo{2522, nullptr, "IsRomRedirectionAvailable"}, - FunctionInfo{2523, nullptr, "GetProgramId", MakeVersionGate({17,0,0})}, - FunctionInfo{2524, nullptr, "Unknown2524", MakeVersionGate({19,0,0})}, - FunctionInfo{2525, nullptr, "Unknown2525", MakeVersionGate({20,0,0})}, - FunctionInfo{2800, nullptr, "GetApplicationIdOfPreomia"}, - FunctionInfo{3000, nullptr, "RegisterDeviceLockKey"}, - FunctionInfo{3001, nullptr, "UnregisterDeviceLockKey"}, - FunctionInfo{3002, nullptr, "VerifyDeviceLockKey"}, - FunctionInfo{3003, nullptr, "HideApplicationIcon"}, - FunctionInfo{3004, nullptr, "ShowApplicationIcon"}, - FunctionInfo{3005, nullptr, "HideApplicationTitle"}, - FunctionInfo{3006, nullptr, "ShowApplicationTitle"}, - FunctionInfo{3007, nullptr, "EnableGameCard"}, - FunctionInfo{3008, nullptr, "DisableGameCard"}, - FunctionInfo{3009, nullptr, "EnableLocalContentShare"}, - FunctionInfo{3010, nullptr, "DisableLocalContentShare"}, - FunctionInfo{3011, nullptr, "IsApplicationIconHidden"}, - FunctionInfo{3012, nullptr, "IsApplicationTitleHidden"}, - FunctionInfo{3013, nullptr, "IsGameCardEnabled"}, - FunctionInfo{3014, nullptr, "IsLocalContentShareEnabled"}, - FunctionInfo{3050, nullptr, "ListAssignELicenseTaskResult"}, - FunctionInfo{3104, nullptr, "GetApplicationNintendoLogo", MakeVersionGate({18,0,0})}, - FunctionInfo{3105, nullptr, "GetApplicationStartupMovie", MakeVersionGate({18,0,0})}, - FunctionInfo{4000, nullptr, "Unknown4000", MakeVersionGate({20,0,0})}, - FunctionInfo{4004, nullptr, "Unknown4004", MakeVersionGate({20,0,0})}, - FunctionInfo{4006, nullptr, "Unknown4006", MakeVersionGate({20,0,0})}, - FunctionInfo{4007, nullptr, "Unknown4007", MakeVersionGate({20,0,0})}, - FunctionInfo{4008, nullptr, "Unknown4008", MakeVersionGate({20,0,0})}, - FunctionInfo{4009, nullptr, "Unknown4009", MakeVersionGate({20,0,0})}, - FunctionInfo{4010, nullptr, "Unknown4010", MakeVersionGate({20,0,0})}, - FunctionInfo{4011, nullptr, "Unknown4011", MakeVersionGate({20,0,0})}, - FunctionInfo{4012, nullptr, "Unknown4012", MakeVersionGate({20,0,0})}, - FunctionInfo{4013, nullptr, "Unknown4013", MakeVersionGate({20,0,0})}, - FunctionInfo{4015, nullptr, "Unknown4015", MakeVersionGate({20,0,0})}, - FunctionInfo{4017, nullptr, "Unknown4017", MakeVersionGate({20,0,0})}, - FunctionInfo{4019, nullptr, "Unknown4019", MakeVersionGate({20,0,0})}, - FunctionInfo{4020, nullptr, "Unknown4020", MakeVersionGate({20,0,0})}, - FunctionInfo{4021, nullptr, "Unknown4021", MakeVersionGate({20,0,0})}, - FunctionInfo{4022, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4022", MakeVersionGate({20,0,0})}, - FunctionInfo{4023, D<&IApplicationManagerInterface::Unknown4023>, "Unknown4023", MakeVersionGate({20,0,0})}, - FunctionInfo{4024, nullptr, "Unknown4024", MakeVersionGate({20,0,0})}, - FunctionInfo{4025, nullptr, "Unknown4025", MakeVersionGate({20,0,0})}, - FunctionInfo{4026, nullptr, "Unknown4026", MakeVersionGate({20,0,0})}, - FunctionInfo{4027, nullptr, "Unknown4027", MakeVersionGate({20,0,0})}, - FunctionInfo{4028, nullptr, "Unknown4028", MakeVersionGate({20,0,0})}, - FunctionInfo{4029, nullptr, "Unknown4029", MakeVersionGate({20,0,0})}, - FunctionInfo{4030, nullptr, "Unknown4030", MakeVersionGate({20,0,0})}, - FunctionInfo{4031, nullptr, "Unknown4031", MakeVersionGate({20,0,0})}, - FunctionInfo{4032, nullptr, "Unknown4032", MakeVersionGate({20,0,0})}, - FunctionInfo{4033, nullptr, "Unknown4033", MakeVersionGate({20,0,0})}, - FunctionInfo{4034, nullptr, "Unknown4034", MakeVersionGate({20,0,0})}, - FunctionInfo{4035, nullptr, "Unknown4035", MakeVersionGate({20,0,0})}, - FunctionInfo{4037, nullptr, "Unknown4037", MakeVersionGate({20,0,0})}, - FunctionInfo{4038, nullptr, "Unknown4038", MakeVersionGate({20,0,0})}, - FunctionInfo{4039, nullptr, "Unknown4039", MakeVersionGate({20,0,0})}, - FunctionInfo{4040, nullptr, "Unknown4040", MakeVersionGate({20,0,0})}, - FunctionInfo{4041, nullptr, "Unknown4041", MakeVersionGate({20,0,0})}, - FunctionInfo{4042, D<&IApplicationManagerInterface::Unknown4042>, "Unknown4042", MakeVersionGate({20,0,0})}, - FunctionInfo{4043, nullptr, "Unknown4043", MakeVersionGate({20,0,0})}, - FunctionInfo{4044, nullptr, "Unknown4044", MakeVersionGate({20,0,0})}, - FunctionInfo{4045, nullptr, "Unknown4045", MakeVersionGate({20,0,0})}, - FunctionInfo{4046, nullptr, "Unknown4046", MakeVersionGate({20,0,0})}, - FunctionInfo{4049, nullptr, "Unknown4049", MakeVersionGate({20,0,0})}, - FunctionInfo{4050, nullptr, "Unknown4050", MakeVersionGate({20,0,0})}, - FunctionInfo{4051, nullptr, "Unknown4051", MakeVersionGate({20,0,0})}, - FunctionInfo{4052, nullptr, "Unknown4052", MakeVersionGate({20,0,0})}, - FunctionInfo{4053, D<&IApplicationManagerInterface::Unknown4053>, "Unknown4053", MakeVersionGate({20,0,0})}, - FunctionInfo{4054, nullptr, "Unknown4054", MakeVersionGate({20,0,0})}, - FunctionInfo{4055, nullptr, "Unknown4055", MakeVersionGate({20,0,0})}, - FunctionInfo{4056, nullptr, "Unknown4056", MakeVersionGate({20,0,0})}, - FunctionInfo{4057, nullptr, "Unknown4057", MakeVersionGate({20,0,0})}, - FunctionInfo{4058, nullptr, "Unknown4058", MakeVersionGate({20,0,0})}, - FunctionInfo{4059, nullptr, "Unknown4059", MakeVersionGate({20,0,0})}, - FunctionInfo{4060, nullptr, "Unknown4060", MakeVersionGate({20,0,0})}, - FunctionInfo{4061, nullptr, "Unknown4061", MakeVersionGate({20,0,0})}, - FunctionInfo{4062, nullptr, "Unknown4062", MakeVersionGate({20,0,0})}, - FunctionInfo{4063, nullptr, "Unknown4063", MakeVersionGate({20,0,0})}, - FunctionInfo{4064, nullptr, "Unknown4064", MakeVersionGate({20,0,0})}, - FunctionInfo{4065, nullptr, "Unknown4065", MakeVersionGate({20,0,0})}, - FunctionInfo{4066, nullptr, "Unknown4066", MakeVersionGate({20,0,0})}, - FunctionInfo{4067, nullptr, "Unknown4067", MakeVersionGate({20,0,0})}, - FunctionInfo{4068, nullptr, "Unknown4068", MakeVersionGate({20,0,0})}, - FunctionInfo{4069, nullptr, "Unknown4069", MakeVersionGate({20,0,0})}, - FunctionInfo{4070, nullptr, "Unknown4070", MakeVersionGate({20,0,0})}, - FunctionInfo{4071, nullptr, "Unknown4071", MakeVersionGate({20,0,0})}, - FunctionInfo{4072, nullptr, "Unknown4072", MakeVersionGate({20,0,0})}, - FunctionInfo{4073, nullptr, "Unknown4073", MakeVersionGate({20,0,0})}, - FunctionInfo{4074, nullptr, "Unknown4074", MakeVersionGate({20,0,0})}, - FunctionInfo{4075, nullptr, "Unknown4075", MakeVersionGate({20,0,0})}, - FunctionInfo{4076, nullptr, "Unknown4076", MakeVersionGate({20,0,0})}, - FunctionInfo{4077, nullptr, "Unknown4077", MakeVersionGate({20,0,0})}, - FunctionInfo{4078, nullptr, "Unknown4078", MakeVersionGate({20,0,0})}, - FunctionInfo{4079, nullptr, "Unknown4079", MakeVersionGate({20,0,0})}, - FunctionInfo{4080, nullptr, "Unknown4080", MakeVersionGate({20,0,0})}, - FunctionInfo{4081, nullptr, "Unknown4081", MakeVersionGate({20,0,0})}, - FunctionInfo{4083, nullptr, "Unknown4083", MakeVersionGate({20,0,0})}, - FunctionInfo{4084, nullptr, "Unknown4084", MakeVersionGate({20,0,0})}, - FunctionInfo{4085, nullptr, "Unknown4085", MakeVersionGate({20,0,0})}, - FunctionInfo{4086, nullptr, "Unknown4086", MakeVersionGate({20,0,0})}, - FunctionInfo{4087, nullptr, "Unknown4087", MakeVersionGate({20,0,0})}, - FunctionInfo{4088, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4088", MakeVersionGate({20,0,0})}, - FunctionInfo{4089, nullptr, "Unknown4089", MakeVersionGate({20,0,0})}, - FunctionInfo{4090, nullptr, "Unknown4090", MakeVersionGate({20,0,0})}, - FunctionInfo{4091, nullptr, "Unknown4091", MakeVersionGate({20,0,0})}, - FunctionInfo{4092, nullptr, "Unknown4092", MakeVersionGate({20,0,0})}, - FunctionInfo{4093, nullptr, "Unknown4093", MakeVersionGate({20,0,0})}, - FunctionInfo{4094, nullptr, "Unknown4094", MakeVersionGate({20,0,0})}, - FunctionInfo{4095, nullptr, "Unknown4095", MakeVersionGate({20,0,0})}, - FunctionInfo{4096, nullptr, "Unknown4096", MakeVersionGate({20,0,0})}, - FunctionInfo{4097, nullptr, "Unknown4097", MakeVersionGate({20,0,0})}, - FunctionInfo{4099, nullptr, "Unknown4099", MakeVersionGate({21,0,0})}, - FunctionInfo{4105, D<&IApplicationManagerInterface::Unknown4105>, "Unknown4105", MakeVersionGate({23,0,0})}, - FunctionInfo{5000, nullptr, "Unknown5000", MakeVersionGate({18,0,0})}, - FunctionInfo{5001, nullptr, "Unknown5001", MakeVersionGate({18,0,0})}, - FunctionInfo{9999, nullptr, "GetApplicationCertificate", MakeVersionGate({10,0,0}, {10,2,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_) : ServiceFramework{system_, "IApplicationManagerInterface"}, service_context{system, "IApplicationManagerInterface"}, @@ -484,6 +32,458 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ gamecard_update_detection_event{service_context}, gamecard_mount_status_event{service_context}, gamecard_mount_failure_event{service_context}, gamecard_waken_ready_event{service_context}, unknown_event{service_context} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IApplicationManagerInterface::ListApplicationRecord>, "ListApplicationRecord"}, + {1, nullptr, "GenerateApplicationRecordCount"}, + {2, D<&IApplicationManagerInterface::GetApplicationRecordUpdateSystemEvent>, "GetApplicationRecordUpdateSystemEvent"}, + {3, nullptr, "GetApplicationViewDeprecated"}, + {4, D<&IApplicationManagerInterface::DeleteApplicationEntity>, "DeleteApplicationEntity"}, + {5, D<&IApplicationManagerInterface::DeleteApplicationCompletely>, "DeleteApplicationCompletely"}, + {6, nullptr, "IsAnyApplicationEntityRedundant"}, + {7, nullptr, "DeleteRedundantApplicationEntity"}, + {8, nullptr, "IsApplicationEntityMovable"}, + {9, nullptr, "MoveApplicationEntity"}, + {11, nullptr, "CalculateApplicationOccupiedSize"}, + {16, &IApplicationManagerInterface::PushApplicationRecord, "PushApplicationRecord"}, + {17, nullptr, "ListApplicationRecordContentMeta"}, + {19, nullptr, "LaunchApplicationOld"}, + {21, nullptr, "GetApplicationContentPath"}, + {22, nullptr, "TerminateApplication"}, + {23, nullptr, "ResolveApplicationContentPath"}, + {26, nullptr, "BeginInstallApplication"}, + {27, nullptr, "DeleteApplicationRecord"}, + {30, nullptr, "RequestApplicationUpdateInfo"}, + {31, nullptr, "RequestUpdateApplication"}, + {32, nullptr, "CancelApplicationDownload"}, + {33, nullptr, "ResumeApplicationDownload"}, + {35, nullptr, "UpdateVersionList"}, + {36, nullptr, "PushLaunchVersion"}, + {37, nullptr, "ListRequiredVersion"}, + {38, D<&IApplicationManagerInterface::CheckApplicationLaunchVersion>, "CheckApplicationLaunchVersion"}, + {39, nullptr, "CheckApplicationLaunchRights"}, + {40, D<&IApplicationManagerInterface::GetApplicationLogoData>, "GetApplicationLogoData"}, + {41, nullptr, "CalculateApplicationDownloadRequiredSize"}, + {42, nullptr, "CleanupSdCard"}, + {43, D<&IApplicationManagerInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, + {44, D<&IApplicationManagerInterface::GetSdCardMountStatusChangedEvent>, "GetSdCardMountStatusChangedEvent"}, + {45, nullptr, "GetGameCardAttachmentEvent"}, + {46, nullptr, "GetGameCardAttachmentInfo"}, + {47, D<&IApplicationManagerInterface::GetTotalSpaceSize>, "GetTotalSpaceSize"}, + {48, D<&IApplicationManagerInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, + {49, nullptr, "GetSdCardRemovedEvent"}, + {52, D<&IApplicationManagerInterface::GetGameCardUpdateDetectionEvent>, "GetGameCardUpdateDetectionEvent"}, + {53, nullptr, "DisableApplicationAutoDelete"}, + {54, nullptr, "EnableApplicationAutoDelete"}, + {55, D<&IApplicationManagerInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, + {56, nullptr, "SetApplicationTerminateResult"}, + {57, nullptr, "ClearApplicationTerminateResult"}, + {58, nullptr, "GetLastSdCardMountUnexpectedResult"}, + {59, D<&IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, + {60, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, + {61, nullptr, "GetBackgroundDownloadStressTaskInfo"}, + {62, nullptr, "GetGameCardStopper"}, + {63, nullptr, "IsSystemProgramInstalled"}, + {64, nullptr, "StartApplyDeltaTask"}, + {65, nullptr, "GetRequestServerStopper"}, + {66, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, + {67, nullptr, "CancelApplicationApplyDelta"}, + {68, nullptr, "ResumeApplicationApplyDelta"}, + {69, nullptr, "CalculateApplicationApplyDeltaRequiredSize"}, + {70, D<&IApplicationManagerInterface::ResumeAll>, "ResumeAll"}, + {71, D<&IApplicationManagerInterface::GetStorageSize>, "GetStorageSize"}, + {80, nullptr, "RequestDownloadApplication"}, + {81, nullptr, "RequestDownloadAddOnContent"}, + {82, nullptr, "DownloadApplication"}, + {83, nullptr, "CheckApplicationResumeRights"}, + {84, nullptr, "GetDynamicCommitEvent"}, + {85, nullptr, "RequestUpdateApplication2"}, + {86, nullptr, "EnableApplicationCrashReport"}, + {87, nullptr, "IsApplicationCrashReportEnabled"}, + {90, nullptr, "BoostSystemMemoryResourceLimit"}, + {91, nullptr, "DeprecatedLaunchApplication"}, + {92, nullptr, "GetRunningApplicationProgramId"}, + {93, nullptr, "GetMainApplicationProgramIndex"}, + {94, nullptr, "LaunchApplication"}, + {95, nullptr, "GetApplicationLaunchInfo"}, + {96, nullptr, "AcquireApplicationLaunchInfo"}, + {97, nullptr, "GetMainApplicationProgramIndexByApplicationLaunchInfo"}, + {98, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, + {99, nullptr, "LaunchDevMenu"}, + {100, nullptr, "ResetToFactorySettings"}, + {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, + {102, nullptr, "ResetToFactorySettingsForRefurbishment"}, + {103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, + {104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, + {105, nullptr, "RequestResetToFactorySettingsSecurely"}, + {106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, + {200, nullptr, "CalculateUserSaveDataStatistics"}, + {201, nullptr, "DeleteUserSaveDataAll"}, + {210, nullptr, "DeleteUserSystemSaveData"}, + {211, nullptr, "DeleteSaveData"}, + {220, nullptr, "UnregisterNetworkServiceAccount"}, + {221, D<&IApplicationManagerInterface::UnregisterNetworkServiceAccountWithUserSaveDataDeletion>, "UnregisterNetworkServiceAccountWithUserSaveDataDeletion"}, + {300, nullptr, "GetApplicationShellEvent"}, + {301, nullptr, "PopApplicationShellEventInfo"}, + {302, nullptr, "LaunchLibraryApplet"}, + {303, nullptr, "TerminateLibraryApplet"}, + {304, nullptr, "LaunchSystemApplet"}, + {305, nullptr, "TerminateSystemApplet"}, + {306, nullptr, "LaunchOverlayApplet"}, + {307, nullptr, "TerminateOverlayApplet"}, + {400, D<&IApplicationManagerInterface::GetApplicationControlData>, "GetApplicationControlData"}, + {401, nullptr, "InvalidateAllApplicationControlCache"}, + {402, nullptr, "RequestDownloadApplicationControlData"}, + {403, nullptr, "GetMaxApplicationControlCacheCount"}, + {404, nullptr, "InvalidateApplicationControlCache"}, + {405, nullptr, "ListApplicationControlCacheEntryInfo"}, + {406, nullptr, "GetApplicationControlProperty"}, + {407, &IApplicationManagerInterface::ListApplicationTitle, "ListApplicationTitle"}, + {408, &IApplicationManagerInterface::ListApplicationIcon, "ListApplicationIcon"}, + {411, nullptr, "Unknown411"}, //19.0.0+ + {412, nullptr, "Unknown412"}, //19.0.0+ + {413, nullptr, "Unknown413"}, //19.0.0+ + {414, nullptr, "Unknown414"}, //19.0.0+ + {415, nullptr, "Unknown415"}, //19.0.0+ + {416, nullptr, "Unknown416"}, //19.0.0+ + {417, nullptr, "InvalidateAllApplicationControlCacheOfTheStage"}, //19.0.0+ + {418, nullptr, "InvalidateApplicationControlCacheOfTheStage"}, //19.0.0+ + {419, D<&IApplicationManagerInterface::RequestDownloadApplicationControlDataInBackground>, "RequestDownloadApplicationControlDataInBackground"}, + {420, nullptr, "CloneApplicationControlDataCacheForDebug"}, + {421, nullptr, "Unknown421"}, //20.0.0+ + {422, nullptr, "Unknown422"}, //20.0.0+ + {423, nullptr, "Unknown423"}, //20.0.0+ + {424, nullptr, "Unknown424"}, //20.0.0+ + {425, nullptr, "Unknown425"}, //20.0.0+ + {426, nullptr, "Unknown426"}, //20.0.0+ + {427, nullptr, "Unknown427"}, //20.0.0+ + {428, nullptr, "Unknown428"}, //21.0.0+ + {429, nullptr, "Unknown429"}, //21.0.0+ + {430, nullptr, "Unknown430"}, //21.0.0+ + {502, nullptr, "RequestCheckGameCardRegistration"}, + {503, nullptr, "RequestGameCardRegistrationGoldPoint"}, + {504, nullptr, "RequestRegisterGameCard"}, + {505, D<&IApplicationManagerInterface::GetGameCardMountFailureEvent>, "GetGameCardMountFailureEvent"}, + {506, nullptr, "IsGameCardInserted"}, + {507, nullptr, "EnsureGameCardAccess"}, + {508, nullptr, "GetLastGameCardMountFailureResult"}, + {509, nullptr, "ListApplicationIdOnGameCard"}, + {510, nullptr, "GetGameCardPlatformRegion"}, + {511, D<&IApplicationManagerInterface::GetGameCardWakenReadyEvent>, "GetGameCardWakenReadyEvent"}, + {512, D<&IApplicationManagerInterface::IsGameCardApplicationRunning>, "IsGameCardApplicationRunning"}, + {513, nullptr, "Unknown513"}, //20.0.0+ + {514, nullptr, "Unknown514"}, //20.0.0+ + {515, nullptr, "Unknown515"}, //20.0.0+ + {516, nullptr, "Unknown516"}, //21.0.0+ + {517, nullptr, "Unknown517"}, //21.0.0+ + {518, nullptr, "Unknown518"}, //21.0.0+ + {519, nullptr, "Unknown519"}, //21.0.0+ + {600, nullptr, "CountApplicationContentMeta"}, + {601, nullptr, "ListApplicationContentMetaStatus"}, + {602, nullptr, "ListAvailableAddOnContent"}, + {603, nullptr, "GetOwnedApplicationContentMetaStatus"}, + {604, nullptr, "RegisterContentsExternalKey"}, + {605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, + {606, nullptr, "GetContentMetaStorage"}, + {607, nullptr, "ListAvailableAddOnContent"}, + {609, nullptr, "ListAvailabilityAssuredAddOnContent"}, + {610, nullptr, "GetInstalledContentMetaStorage"}, + {611, nullptr, "PrepareAddOnContent"}, + {700, nullptr, "PushDownloadTaskList"}, + {701, nullptr, "ClearTaskStatusList"}, + {702, nullptr, "RequestDownloadTaskList"}, + {703, nullptr, "RequestEnsureDownloadTask"}, + {704, nullptr, "ListDownloadTaskStatus"}, + {705, nullptr, "RequestDownloadTaskListData"}, + {800, nullptr, "RequestVersionList"}, + {801, nullptr, "ListVersionList"}, + {802, nullptr, "RequestVersionListData"}, + {900, nullptr, "GetApplicationRecord"}, + {901, nullptr, "GetApplicationRecordProperty"}, + {902, nullptr, "EnableApplicationAutoUpdate"}, + {903, nullptr, "DisableApplicationAutoUpdate"}, + {904, D<&IApplicationManagerInterface::TouchApplication>, "TouchApplication"}, + {905, nullptr, "RequestApplicationUpdate"}, + {906, D<&IApplicationManagerInterface::IsApplicationUpdateRequested>, "IsApplicationUpdateRequested"}, + {907, nullptr, "WithdrawApplicationUpdateRequest"}, + {908, nullptr, "ListApplicationRecordInstalledContentMeta"}, + {909, nullptr, "WithdrawCleanupAddOnContentsWithNoRightsRecommendation"}, + {910, nullptr, "HasApplicationRecord"}, + {911, nullptr, "SetPreInstalledApplication"}, + {912, nullptr, "ClearPreInstalledApplicationFlag"}, + {913, nullptr, "ListAllApplicationRecord"}, + {914, nullptr, "HideApplicationRecord"}, + {915, nullptr, "ShowApplicationRecord"}, + {916, nullptr, "IsApplicationAutoDeleteDisabled"}, + {916, nullptr, "Unknown916"}, //20.0.0+ + {917, nullptr, "Unknown917"}, //20.0.0+ + {918, nullptr, "Unknown918"}, //20.0.0+ + {919, nullptr, "Unknown919"}, //20.0.0+ + {920, nullptr, "Unknown920"}, //20.0.0+ + {921, nullptr, "Unknown921"}, //20.0.0+ + {922, nullptr, "Unknown922"}, //20.0.0+ + {923, nullptr, "Unknown923"}, //20.0.0+ + {928, nullptr, "Unknown928"}, //20.0.0+ + {929, nullptr, "Unknown929"}, //20.0.0+ + {930, nullptr, "Unknown930"}, //20.0.0+ + {931, nullptr, "Unknown931"}, //20.0.0+ + {933, nullptr, "Unknown933"}, //20.0.0+ + {934, nullptr, "Unknown934"}, //21.0.0+ + {935, nullptr, "Unknown935"}, //21.0.0+ + {936, D<&IApplicationManagerInterface::Unknown936>, "Unknown936"}, //21.0.0+ + {1000, nullptr, "RequestVerifyApplicationDeprecated"}, + {1001, nullptr, "CorruptApplicationForDebug"}, + {1002, nullptr, "RequestVerifyAddOnContentsRights"}, + {1003, nullptr, "RequestVerifyApplication"}, + {1004, nullptr, "CorruptContentForDebug"}, + {1200, nullptr, "NeedsUpdateVulnerability"}, + {1300, D<&IApplicationManagerInterface::IsAnyApplicationEntityInstalled>, "IsAnyApplicationEntityInstalled"}, + {1301, nullptr, "DeleteApplicationContentEntities"}, + {1302, nullptr, "CleanupUnrecordedApplicationEntity"}, + {1303, nullptr, "CleanupAddOnContentsWithNoRights"}, + {1304, nullptr, "DeleteApplicationContentEntity"}, + {1305, nullptr, "TryDeleteRunningApplicationEntity"}, + {1306, nullptr, "TryDeleteRunningApplicationCompletely"}, + {1307, nullptr, "TryDeleteRunningApplicationContentEntities"}, + {1308, nullptr, "DeleteApplicationCompletelyForDebug"}, + {1309, nullptr, "CleanupUnavailableAddOnContents"}, + {1310, nullptr, "RequestMoveApplicationEntity"}, + {1311, nullptr, "EstimateSizeToMove"}, + {1312, nullptr, "HasMovableEntity"}, + {1313, nullptr, "CleanupOrphanContents"}, + {1314, nullptr, "CheckPreconditionSatisfiedToMove"}, + {1400, nullptr, "PrepareShutdown"}, + {1500, nullptr, "FormatSdCard"}, + {1501, nullptr, "NeedsSystemUpdateToFormatSdCard"}, + {1502, nullptr, "GetLastSdCardFormatUnexpectedResult"}, + {1504, nullptr, "InsertSdCard"}, + {1505, nullptr, "RemoveSdCard"}, + {1506, nullptr, "GetSdCardStartupStatus"}, + {1508, nullptr, "Unknown1508"}, //20.0.0+ + {1509, nullptr, "Unknown1509"}, //20.0.0+ + {1510, nullptr, "Unknown1510"}, //20.0.0+ + {1511, nullptr, "Unknown1511"}, //20.0.0+ + {1512, nullptr, "Unknown1512"}, //20.0.0+ + {1600, nullptr, "GetSystemSeedForPseudoDeviceId"}, + {1601, nullptr, "ResetSystemSeedForPseudoDeviceId"}, + {1700, nullptr, "ListApplicationDownloadingContentMeta"}, + {1701, D<&IApplicationManagerInterface::GetApplicationViewDeprecated>, "GetApplicationViewDeprecated"}, + {1702, nullptr, "GetApplicationDownloadTaskStatus"}, + {1703, nullptr, "GetApplicationViewDownloadErrorContext"}, + {1704, D<&IApplicationManagerInterface::GetApplicationViewWithPromotionInfo>, "GetApplicationViewWithPromotionInfo"}, + {1705, nullptr, "IsPatchAutoDeletableApplication"}, + {1706, D<&IApplicationManagerInterface::GetApplicationView>, "GetApplicationView"}, + {1800, nullptr, "IsNotificationSetupCompleted"}, + {1801, nullptr, "GetLastNotificationInfoCount"}, + {1802, nullptr, "ListLastNotificationInfo"}, + {1803, nullptr, "ListNotificationTask"}, + {1900, nullptr, "IsActiveAccount"}, + {1901, nullptr, "RequestDownloadApplicationPrepurchasedRights"}, + {1902, nullptr, "GetApplicationTicketInfo"}, + {1903, nullptr, "RequestDownloadApplicationPrepurchasedRightsForAccount"}, + {2000, nullptr, "GetSystemDeliveryInfo"}, + {2001, nullptr, "SelectLatestSystemDeliveryInfo"}, + {2002, nullptr, "VerifyDeliveryProtocolVersion"}, + {2003, nullptr, "GetApplicationDeliveryInfo"}, + {2004, nullptr, "HasAllContentsToDeliver"}, + {2005, nullptr, "CompareApplicationDeliveryInfo"}, + {2006, nullptr, "CanDeliverApplication"}, + {2007, nullptr, "ListContentMetaKeyToDeliverApplication"}, + {2008, nullptr, "NeedsSystemUpdateToDeliverApplication"}, + {2009, nullptr, "EstimateRequiredSize"}, + {2010, nullptr, "RequestReceiveApplication"}, + {2011, nullptr, "CommitReceiveApplication"}, + {2012, nullptr, "GetReceiveApplicationProgress"}, + {2013, nullptr, "RequestSendApplication"}, + {2014, nullptr, "GetSendApplicationProgress"}, + {2015, nullptr, "CompareSystemDeliveryInfo"}, + {2016, nullptr, "ListNotCommittedContentMeta"}, + {2017, nullptr, "CreateDownloadTask"}, + {2018, nullptr, "GetApplicationDeliveryInfoHash"}, + {2019, nullptr, "Unknown2019"}, //20.0.0+ + {2050, D<&IApplicationManagerInterface::GetApplicationRightsOnClient>, "GetApplicationRightsOnClient"}, + {2051, nullptr, "InvalidateRightsIdCache"}, + {2052, nullptr, "Unknown2052"}, //20.0.0+ + {2053, nullptr, "Unknown2053"}, //20.0.0+ + {2100, D<&IApplicationManagerInterface::GetApplicationTerminateResult>, "GetApplicationTerminateResult"}, + {2101, nullptr, "GetRawApplicationTerminateResult"}, + {2150, nullptr, "CreateRightsEnvironment"}, + {2151, nullptr, "DestroyRightsEnvironment"}, + {2152, nullptr, "ActivateRightsEnvironment"}, + {2153, nullptr, "DeactivateRightsEnvironment"}, + {2154, nullptr, "ForceActivateRightsContextForExit"}, + {2155, nullptr, "UpdateRightsEnvironmentStatus"}, + {2156, nullptr, "CreateRightsEnvironmentForMicroApplication"}, + {2160, nullptr, "AddTargetApplicationToRightsEnvironment"}, + {2161, nullptr, "SetUsersToRightsEnvironment"}, + {2170, nullptr, "GetRightsEnvironmentStatus"}, + {2171, nullptr, "GetRightsEnvironmentStatusChangedEvent"}, + {2180, nullptr, "RequestExtendRightsInRightsEnvironment"}, + {2181, nullptr, "GetResultOfExtendRightsInRightsEnvironment"}, + {2182, nullptr, "SetActiveRightsContextUsingStateToRightsEnvironment"}, + {2183, nullptr, "Unknown2183"}, //20.1.0+ + {2190, nullptr, "GetRightsEnvironmentHandleForApplication"}, + {2199, nullptr, "GetRightsEnvironmentCountForDebug"}, + {2200, nullptr, "GetGameCardApplicationCopyIdentifier"}, + {2201, nullptr, "GetInstalledApplicationCopyIdentifier"}, + {2250, nullptr, "RequestReportActiveELicence"}, + {2300, nullptr, "ListEventLog"}, + {2350, nullptr, "PerformAutoUpdateByApplicationId"}, + {2351, nullptr, "RequestNoDownloadRightsErrorResolution"}, + {2352, nullptr, "RequestResolveNoDownloadRightsError"}, + {2353, nullptr, "GetApplicationDownloadTaskInfo"}, + {2354, nullptr, "PrioritizeApplicationBackgroundTask"}, + {2355, nullptr, "PreferStorageEfficientUpdate"}, + {2356, nullptr, "RequestStorageEfficientUpdatePreferable"}, + {2357, nullptr, "EnableMultiCoreDownload"}, + {2358, nullptr, "DisableMultiCoreDownload"}, + {2359, nullptr, "IsMultiCoreDownloadEnabled"}, + {2360, nullptr, "GetApplicationDownloadTaskCount"}, //19.0.0+ + {2361, nullptr, "GetMaxApplicationDownloadTaskCount"}, //19.0.0+ + {2362, nullptr, "Unknown2362"}, //20.0.0+ + {2363, nullptr, "Unknown2363"}, //20.0.0+ + {2364, nullptr, "Unknown2364"}, //20.0.0+ + {2365, nullptr, "Unknown2365"}, //20.0.0+ + {2366, nullptr, "Unknown2366"}, //20.0.0+ + {2367, nullptr, "Unknown2367"}, //20.0.0+ + {2368, nullptr, "Unknown2368"}, //20.0.0+ + {2369, nullptr, "Unknown2369"}, //21.0.0+ + {2400, nullptr, "GetPromotionInfo"}, + {2401, nullptr, "CountPromotionInfo"}, + {2402, nullptr, "ListPromotionInfo"}, + {2403, nullptr, "ImportPromotionJsonForDebug"}, + {2404, nullptr, "ClearPromotionInfoForDebug"}, + {2500, nullptr, "ConfirmAvailableTime"}, + {2510, nullptr, "CreateApplicationResource"}, + {2511, nullptr, "GetApplicationResource"}, + {2513, nullptr, "LaunchMicroApplication"}, + {2514, nullptr, "ClearTaskOfAsyncTaskManager"}, + {2515, nullptr, "CleanupAllPlaceHolderAndFragmentsIfNoTask"}, + {2516, nullptr, "EnsureApplicationCertificate"}, + {2517, nullptr, "CreateApplicationInstance"}, + {2518, nullptr, "UpdateQualificationForDebug"}, + {2519, nullptr, "IsQualificationTransitionSupported"}, + {2520, D<&IApplicationManagerInterface::IsQualificationTransitionSupportedByProcessId>, "IsQualificationTransitionSupportedByProcessId"}, + {2521, nullptr, "GetRightsUserChangedEvent"}, + {2522, nullptr, "IsRomRedirectionAvailable"}, + {2523, nullptr, "GetProgramId"}, //17.0.0+ + {2524, nullptr, "Unknown2524"}, //19.0.0+ + {2525, nullptr, "Unknown2525"}, //20.0.0+ + {2800, nullptr, "GetApplicationIdOfPreomia"}, + {3000, nullptr, "RegisterDeviceLockKey"}, + {3001, nullptr, "UnregisterDeviceLockKey"}, + {3002, nullptr, "VerifyDeviceLockKey"}, + {3003, nullptr, "HideApplicationIcon"}, + {3004, nullptr, "ShowApplicationIcon"}, + {3005, nullptr, "HideApplicationTitle"}, + {3006, nullptr, "ShowApplicationTitle"}, + {3007, nullptr, "EnableGameCard"}, + {3008, nullptr, "DisableGameCard"}, + {3009, nullptr, "EnableLocalContentShare"}, + {3010, nullptr, "DisableLocalContentShare"}, + {3011, nullptr, "IsApplicationIconHidden"}, + {3012, nullptr, "IsApplicationTitleHidden"}, + {3013, nullptr, "IsGameCardEnabled"}, + {3014, nullptr, "IsLocalContentShareEnabled"}, + {3050, nullptr, "ListAssignELicenseTaskResult"}, + {3104, nullptr, "GetApplicationNintendoLogo"}, //18.0.0+ + {3105, nullptr, "GetApplicationStartupMovie"}, //18.0.0+ + {4000, nullptr, "Unknown4000"}, //20.0.0+ + {4004, nullptr, "Unknown4004"}, //20.0.0+ + {4006, nullptr, "Unknown4006"}, //20.0.0+ + {4007, nullptr, "Unknown4007"}, //20.0.0+ + {4008, nullptr, "Unknown4008"}, //20.0.0+ + {4009, nullptr, "Unknown4009"}, //20.0.0+ + {4010, nullptr, "Unknown4010"}, //20.0.0+ + {4011, nullptr, "Unknown4011"}, //20.0.0+ + {4012, nullptr, "Unknown4012"}, //20.0.0+ + {4013, nullptr, "Unknown4013"}, //20.0.0+ + {4015, nullptr, "Unknown4015"}, //20.0.0+ + {4017, nullptr, "Unknown4017"}, //20.0.0+ + {4019, nullptr, "Unknown4019"}, //20.0.0+ + {4020, nullptr, "Unknown4020"}, //20.0.0+ + {4021, nullptr, "Unknown4021"}, //20.0.0+ + {4022, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4022"}, //20.0.0+ + {4023, D<&IApplicationManagerInterface::Unknown4023>, "Unknown4023"}, //20.0.0+ + {4024, nullptr, "Unknown4024"}, //20.0.0+ + {4025, nullptr, "Unknown4025"}, //20.0.0+ + {4026, nullptr, "Unknown4026"}, //20.0.0+ + {4027, nullptr, "Unknown4027"}, //20.0.0+ + {4028, nullptr, "Unknown4028"}, //20.0.0+ + {4029, nullptr, "Unknown4029"}, //20.0.0+ + {4030, nullptr, "Unknown4030"}, //20.0.0+ + {4031, nullptr, "Unknown4031"}, //20.0.0+ + {4032, nullptr, "Unknown4032"}, //20.0.0+ + {4033, nullptr, "Unknown4033"}, //20.0.0+ + {4034, nullptr, "Unknown4034"}, //20.0.0+ + {4035, nullptr, "Unknown4035"}, //20.0.0+ + {4037, nullptr, "Unknown4037"}, //20.0.0+ + {4038, nullptr, "Unknown4038"}, //20.0.0+ + {4039, nullptr, "Unknown4039"}, //20.0.0+ + {4040, nullptr, "Unknown4040"}, //20.0.0+ + {4041, nullptr, "Unknown4041"}, //20.0.0+ + {4042, D<&IApplicationManagerInterface::Unknown4042>, "Unknown4042"}, //20.0.0+ + {4043, nullptr, "Unknown4043"}, //20.0.0+ + {4044, nullptr, "Unknown4044"}, //20.0.0+ + {4045, nullptr, "Unknown4045"}, //20.0.0+ + {4046, nullptr, "Unknown4046"}, //20.0.0+ + {4049, nullptr, "Unknown4049"}, //20.0.0+ + {4050, nullptr, "Unknown4050"}, //20.0.0+ + {4051, nullptr, "Unknown4051"}, //20.0.0+ + {4052, nullptr, "Unknown4052"}, //20.0.0+ + {4053, D<&IApplicationManagerInterface::Unknown4053>, "Unknown4053"}, //20.0.0+ + {4054, nullptr, "Unknown4054"}, //20.0.0+ + {4055, nullptr, "Unknown4055"}, //20.0.0+ + {4056, nullptr, "Unknown4056"}, //20.0.0+ + {4057, nullptr, "Unknown4057"}, //20.0.0+ + {4058, nullptr, "Unknown4058"}, //20.0.0+ + {4059, nullptr, "Unknown4059"}, //20.0.0+ + {4060, nullptr, "Unknown4060"}, //20.0.0+ + {4061, nullptr, "Unknown4061"}, //20.0.0+ + {4062, nullptr, "Unknown4062"}, //20.0.0+ + {4063, nullptr, "Unknown4063"}, //20.0.0+ + {4064, nullptr, "Unknown4064"}, //20.0.0+ + {4065, nullptr, "Unknown4065"}, //20.0.0+ + {4066, nullptr, "Unknown4066"}, //20.0.0+ + {4067, nullptr, "Unknown4067"}, //20.0.0+ + {4068, nullptr, "Unknown4068"}, //20.0.0+ + {4069, nullptr, "Unknown4069"}, //20.0.0+ + {4070, nullptr, "Unknown4070"}, //20.0.0+ + {4071, nullptr, "Unknown4071"}, //20.0.0+ + {4072, nullptr, "Unknown4072"}, //20.0.0+ + {4073, nullptr, "Unknown4073"}, //20.0.0+ + {4074, nullptr, "Unknown4074"}, //20.0.0+ + {4075, nullptr, "Unknown4075"}, //20.0.0+ + {4076, nullptr, "Unknown4076"}, //20.0.0+ + {4077, nullptr, "Unknown4077"}, //20.0.0+ + {4078, nullptr, "Unknown4078"}, //20.0.0+ + {4079, nullptr, "Unknown4079"}, //20.0.0+ + {4080, nullptr, "Unknown4080"}, //20.0.0+ + {4081, nullptr, "Unknown4081"}, //20.0.0+ + {4083, nullptr, "Unknown4083"}, //20.0.0+ + {4084, nullptr, "Unknown4084"}, //20.0.0+ + {4085, nullptr, "Unknown4085"}, //20.0.0+ + {4086, nullptr, "Unknown4086"}, //20.0.0+ + {4087, nullptr, "Unknown4087"}, //20.0.0+ + {4088, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4088"}, //20.0.0+ + {4089, nullptr, "Unknown4089"}, //20.0.0+ + {4090, nullptr, "Unknown4090"}, //20.0.0+ + {4091, nullptr, "Unknown4091"}, //20.0.0+ + {4092, nullptr, "Unknown4092"}, //20.0.0+ + {4093, nullptr, "Unknown4093"}, //20.0.0+ + {4094, nullptr, "Unknown4094"}, //20.0.0+ + {4095, nullptr, "Unknown4095"}, //20.0.0+ + {4096, nullptr, "Unknown4096"}, //20.0.0+ + {4097, nullptr, "Unknown4097"}, //20.0.0+ + {4099, nullptr, "Unknown4099"}, //21.0.0+ + {4105, D<&IApplicationManagerInterface::Unknown4105>, "Unknown4105"}, //23.0.0+ + {5000, nullptr, "Unknown5000"}, //18.0.0+ + {5001, nullptr, "Unknown5001"}, //18.0.0+ + {9999, nullptr, "GetApplicationCertificate"}, //10.0.0-10.2.0 + }; + // clang-format on + + RegisterHandlers(functions); } IApplicationManagerInterface::~IApplicationManagerInterface() = default; diff --git a/src/core/hle/service/ns/application_manager_interface.h b/src/core/hle/service/ns/application_manager_interface.h index 592068823c..c4ca66f319 100644 --- a/src/core/hle/service/ns/application_manager_interface.h +++ b/src/core/hle/service/ns/application_manager_interface.h @@ -85,7 +85,6 @@ public: void PushApplicationRecord(HLERequestContext& ctx); void ListApplicationTitle(HLERequestContext& ctx); void ListApplicationIcon(HLERequestContext& ctx); - std::optional FindRequest(u32 key) override; private: KernelHelpers::ServiceContext service_context; diff --git a/src/core/hle/service/ns/application_version_interface.cpp b/src/core/hle/service/ns/application_version_interface.cpp index e1e747f6d2..0ed9514c2c 100644 --- a/src/core/hle/service/ns/application_version_interface.cpp +++ b/src/core/hle/service/ns/application_version_interface.cpp @@ -10,6 +10,25 @@ namespace Service::NS { IApplicationVersionInterface::IApplicationVersionInterface(Core::System& system_) : ServiceFramework{system_, "IApplicationVersionInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetLaunchRequiredVersion"}, + {1, nullptr, "UpgradeLaunchRequiredVersion"}, + {35, nullptr, "UpdateVersionList"}, + {36, nullptr, "PushLaunchVersion"}, + {37, nullptr, "ListRequiredVersion"}, + {800, nullptr, "RequestVersionList"}, + {801, nullptr, "ListVersionList"}, + {802, nullptr, "RequestVersionListData"}, + {900, nullptr, "ImportAutoUpdatePolicyJsonForDebug"}, + {901, nullptr, "ListDefaultAutoUpdatePolicy"}, + {902, nullptr, "ListAutoUpdatePolicyForSpecificApplication"}, + {1000, nullptr, "PerformAutoUpdate"}, + {1001, nullptr, "ListAutoUpdateSchedule"}, + }; + // clang-format on + + RegisterHandlers(functions); } IApplicationVersionInterface::~IApplicationVersionInterface() = default; diff --git a/src/core/hle/service/ns/application_version_interface.h b/src/core/hle/service/ns/application_version_interface.h index c1f7710a00..fcbb966a4d 100644 --- a/src/core/hle/service/ns/application_version_interface.h +++ b/src/core/hle/service/ns/application_version_interface.h @@ -14,25 +14,6 @@ class IApplicationVersionInterface final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetLaunchRequiredVersion"}, - FunctionInfo{1, nullptr, "UpgradeLaunchRequiredVersion"}, - FunctionInfo{35, nullptr, "UpdateVersionList"}, - FunctionInfo{36, nullptr, "PushLaunchVersion"}, - FunctionInfo{37, nullptr, "ListRequiredVersion"}, - FunctionInfo{800, nullptr, "RequestVersionList"}, - FunctionInfo{801, nullptr, "ListVersionList"}, - FunctionInfo{802, nullptr, "RequestVersionListData"}, - FunctionInfo{900, nullptr, "ImportAutoUpdatePolicyJsonForDebug"}, - FunctionInfo{901, nullptr, "ListDefaultAutoUpdatePolicy"}, - FunctionInfo{902, nullptr, "ListAutoUpdatePolicyForSpecificApplication"}, - FunctionInfo{1000, nullptr, "PerformAutoUpdate"}, - FunctionInfo{1001, nullptr, "ListAutoUpdateSchedule"} - ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/async_result.cpp b/src/core/hle/service/ns/async_result.cpp index d93c510141..8617280bef 100644 --- a/src/core/hle/service/ns/async_result.cpp +++ b/src/core/hle/service/ns/async_result.cpp @@ -8,17 +8,17 @@ namespace Service::NS { -std::optional IAsyncResult::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Get"}, - FunctionInfo{1, D<&IAsyncResult::Cancel>, "Cancel"}, - FunctionInfo{2, nullptr, "GetErrorContext", MakeVersionGate({4,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IAsyncResult::IAsyncResult(Core::System& system_, Service::Event* event_) : ServiceFramework{system_, "nn::ns::detail::IAsyncResult"}, event{event_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Get"}, + {1, D<&IAsyncResult::Cancel>, "Cancel"}, + {2, nullptr, "GetErrorContext"}, // 4.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } IAsyncResult::~IAsyncResult() = default; diff --git a/src/core/hle/service/ns/async_result.h b/src/core/hle/service/ns/async_result.h index 1cad75bf47..914ea5a42c 100644 --- a/src/core/hle/service/ns/async_result.h +++ b/src/core/hle/service/ns/async_result.h @@ -13,7 +13,6 @@ public: private: Result Cancel(); - std::optional FindRequest(u32 key) override; Service::Event* event{}; }; diff --git a/src/core/hle/service/ns/content_management_interface.cpp b/src/core/hle/service/ns/content_management_interface.cpp index 45922ffab3..39b9cb6f70 100644 --- a/src/core/hle/service/ns/content_management_interface.cpp +++ b/src/core/hle/service/ns/content_management_interface.cpp @@ -15,6 +15,22 @@ namespace Service::NS { IContentManagementInterface::IContentManagementInterface(Core::System& system_) : ServiceFramework{system_, "IContentManagementInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {11, D<&IContentManagementInterface::CalculateApplicationOccupiedSize>, "CalculateApplicationOccupiedSize"}, + {43, D<&IContentManagementInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, + {47, D<&IContentManagementInterface::GetTotalSpaceSize>, "GetTotalSpaceSize"}, + {48, D<&IContentManagementInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, + {71, D<&IContentManagementInterface::GetUnknown71>, "Unknown71"}, + {600, nullptr, "CountApplicationContentMeta"}, + {601, nullptr, "ListApplicationContentMetaStatus"}, + {605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, + {607, nullptr, "IsAnyApplicationRunning"}, + {608, nullptr, "Unknown608"}, //21.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } IContentManagementInterface::~IContentManagementInterface() = default; diff --git a/src/core/hle/service/ns/content_management_interface.h b/src/core/hle/service/ns/content_management_interface.h index bddd044b45..df0c51a184 100644 --- a/src/core/hle/service/ns/content_management_interface.h +++ b/src/core/hle/service/ns/content_management_interface.h @@ -24,22 +24,6 @@ public: Result GetTotalSpaceSize(Out out_total_space_size, FileSys::StorageId storage_id); Result GetFreeSpaceSize(Out out_free_space_size, FileSys::StorageId storage_id); Result GetUnknown71(Out out_value_a, Out out_value_b, u8 flag); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{11, D<&IContentManagementInterface::CalculateApplicationOccupiedSize>, "CalculateApplicationOccupiedSize"}, - FunctionInfo{43, D<&IContentManagementInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, - FunctionInfo{47, D<&IContentManagementInterface::GetTotalSpaceSize>, "GetTotalSpaceSize"}, - FunctionInfo{48, D<&IContentManagementInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, - FunctionInfo{71, D<&IContentManagementInterface::GetUnknown71>, "Unknown71"}, - FunctionInfo{600, nullptr, "CountApplicationContentMeta"}, - FunctionInfo{601, nullptr, "ListApplicationContentMetaStatus"}, - FunctionInfo{605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, - FunctionInfo{607, nullptr, "IsAnyApplicationRunning"}, - FunctionInfo{608, nullptr, "Unknown608", MakeVersionGate({21,0,0})} - ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/develop_interface.cpp b/src/core/hle/service/ns/develop_interface.cpp index 2fc41cd7dd..5a44c61f1b 100644 --- a/src/core/hle/service/ns/develop_interface.cpp +++ b/src/core/hle/service/ns/develop_interface.cpp @@ -9,6 +9,31 @@ namespace Service::NS { IDevelopInterface::IDevelopInterface(Core::System& system_) : ServiceFramework{system_, "ns:dev"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "LaunchProgram"}, + {1, nullptr, "TerminateProcess"}, + {2, nullptr, "TerminateProgram"}, + {4, nullptr, "GetShellEvent"}, + {5, nullptr, "GetShellEventInfo"}, + {6, nullptr, "TerminateApplication"}, + {7, nullptr, "PrepareLaunchProgramFromHost"}, + {8, nullptr, "LaunchApplicationFromHost"}, + {9, nullptr, "LaunchApplicationWithStorageIdForDevelop"}, + {10, nullptr, "IsSystemMemoryResourceLimitBoosted"}, + {11, nullptr, "GetRunningApplicationProcessIdForDevelop"}, + {12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop"}, + {13, nullptr, "CreateApplicationResourceForDevelop"}, + {14, nullptr, "IsPreomiaForDevelop"}, + {15, nullptr, "GetApplicationProgramIdFromHost"}, + {16, nullptr, "RefreshCachedDebugValues"}, + {17, nullptr, "PrepareLaunchApplicationFromHost"}, + {18, nullptr, "GetLaunchEvent"}, + {19, nullptr, "GetLaunchResult"}, + }; + // clang-format on + + RegisterHandlers(functions); } IDevelopInterface::~IDevelopInterface() = default; diff --git a/src/core/hle/service/ns/develop_interface.h b/src/core/hle/service/ns/develop_interface.h index 55e54fa38d..d7cb9e7a56 100644 --- a/src/core/hle/service/ns/develop_interface.h +++ b/src/core/hle/service/ns/develop_interface.h @@ -14,31 +14,6 @@ class IDevelopInterface final : public ServiceFramework { public: explicit IDevelopInterface(Core::System& system_); ~IDevelopInterface() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "LaunchProgram"}, - FunctionInfo{1, nullptr, "TerminateProcess"}, - FunctionInfo{2, nullptr, "TerminateProgram"}, - FunctionInfo{4, nullptr, "GetShellEvent"}, - FunctionInfo{5, nullptr, "GetShellEventInfo"}, - FunctionInfo{6, nullptr, "TerminateApplication"}, - FunctionInfo{7, nullptr, "PrepareLaunchProgramFromHost"}, - FunctionInfo{8, nullptr, "LaunchApplicationFromHost"}, - FunctionInfo{9, nullptr, "LaunchApplicationWithStorageIdForDevelop"}, - FunctionInfo{10, nullptr, "IsSystemMemoryResourceLimitBoosted"}, - FunctionInfo{11, nullptr, "GetRunningApplicationProcessIdForDevelop"}, - FunctionInfo{12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop"}, - FunctionInfo{13, nullptr, "CreateApplicationResourceForDevelop"}, - FunctionInfo{14, nullptr, "IsPreomiaForDevelop"}, - FunctionInfo{15, nullptr, "GetApplicationProgramIdFromHost"}, - FunctionInfo{16, nullptr, "RefreshCachedDebugValues"}, - FunctionInfo{17, nullptr, "PrepareLaunchApplicationFromHost"}, - FunctionInfo{18, nullptr, "GetLaunchEvent"}, - FunctionInfo{19, nullptr, "GetLaunchResult"} - ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/document_interface.cpp b/src/core/hle/service/ns/document_interface.cpp index f9a1e2267a..00593d1edc 100644 --- a/src/core/hle/service/ns/document_interface.cpp +++ b/src/core/hle/service/ns/document_interface.cpp @@ -12,6 +12,15 @@ namespace Service::NS { IDocumentInterface::IDocumentInterface(Core::System& system_) : ServiceFramework{system_, "IDocumentInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {21, nullptr, "GetApplicationContentPath"}, + {23, D<&IDocumentInterface::ResolveApplicationContentPath>, "ResolveApplicationContentPath"}, + {92, D<&IDocumentInterface::GetRunningApplicationProgramId>, "GetRunningApplicationProgramId"}, + }; + // clang-format on + + RegisterHandlers(functions); } IDocumentInterface::~IDocumentInterface() = default; diff --git a/src/core/hle/service/ns/document_interface.h b/src/core/hle/service/ns/document_interface.h index 43a194c3e6..4c8b15b54a 100644 --- a/src/core/hle/service/ns/document_interface.h +++ b/src/core/hle/service/ns/document_interface.h @@ -20,15 +20,6 @@ public: private: Result ResolveApplicationContentPath(ContentPath content_path); Result GetRunningApplicationProgramId(Out out_program_id, u64 caller_program_id); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{21, nullptr, "GetApplicationContentPath"}, - FunctionInfo{23, D<&IDocumentInterface::ResolveApplicationContentPath>, "ResolveApplicationContentPath"}, - FunctionInfo{92, D<&IDocumentInterface::GetRunningApplicationProgramId>, "GetRunningApplicationProgramId"} - ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/download_task_interface.cpp b/src/core/hle/service/ns/download_task_interface.cpp index 9fe6ca512f..18db60e7b0 100644 --- a/src/core/hle/service/ns/download_task_interface.cpp +++ b/src/core/hle/service/ns/download_task_interface.cpp @@ -11,6 +11,21 @@ namespace Service::NS { IDownloadTaskInterface::IDownloadTaskInterface(Core::System& system_) : ServiceFramework{system_, "IDownloadTaskInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {701, nullptr, "ClearTaskStatusList"}, + {702, nullptr, "RequestDownloadTaskList"}, + {703, nullptr, "RequestEnsureDownloadTask"}, + {704, nullptr, "ListDownloadTaskStatus"}, + {705, nullptr, "RequestDownloadTaskListData"}, + {706, nullptr, "TryCommitCurrentApplicationDownloadTask"}, + {707, D<&IDownloadTaskInterface::EnableAutoCommit>, "EnableAutoCommit"}, + {708, D<&IDownloadTaskInterface::DisableAutoCommit>, "DisableAutoCommit"}, + {709, nullptr, "TriggerDynamicCommitEvent"}, + }; + // clang-format on + + RegisterHandlers(functions); } IDownloadTaskInterface::~IDownloadTaskInterface() = default; diff --git a/src/core/hle/service/ns/download_task_interface.h b/src/core/hle/service/ns/download_task_interface.h index 0fd2bacd42..1c46339daa 100644 --- a/src/core/hle/service/ns/download_task_interface.h +++ b/src/core/hle/service/ns/download_task_interface.h @@ -18,21 +18,6 @@ public: private: Result EnableAutoCommit(); Result DisableAutoCommit(); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{701, nullptr, "ClearTaskStatusList"}, - FunctionInfo{702, nullptr, "RequestDownloadTaskList"}, - FunctionInfo{703, nullptr, "RequestEnsureDownloadTask"}, - FunctionInfo{704, nullptr, "ListDownloadTaskStatus"}, - FunctionInfo{705, nullptr, "RequestDownloadTaskListData"}, - FunctionInfo{706, nullptr, "TryCommitCurrentApplicationDownloadTask"}, - FunctionInfo{707, D<&IDownloadTaskInterface::EnableAutoCommit>, "EnableAutoCommit"}, - FunctionInfo{708, D<&IDownloadTaskInterface::DisableAutoCommit>, "DisableAutoCommit"}, - FunctionInfo{709, nullptr, "TriggerDynamicCommitEvent"} - ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/dynamic_rights_interface.cpp b/src/core/hle/service/ns/dynamic_rights_interface.cpp index 951ef4c4b2..0301085670 100644 --- a/src/core/hle/service/ns/dynamic_rights_interface.cpp +++ b/src/core/hle/service/ns/dynamic_rights_interface.cpp @@ -9,43 +9,43 @@ namespace Service::NS { -std::optional IDynamicRightsInterface::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestApplicationRightsOnServer"}, - FunctionInfo{1, nullptr, "RequestAssignRights"}, - FunctionInfo{4, nullptr, "DeprecatedRequestAssignRightsToResume"}, - FunctionInfo{5, D<&IDynamicRightsInterface::VerifyActivatedRightsOwners>, "VerifyActivatedRightsOwners"}, - FunctionInfo{6, nullptr, "DeprecatedGetApplicationRightsStatus"}, - FunctionInfo{7, nullptr, "RequestPrefetchForDynamicRights"}, - FunctionInfo{8, nullptr, "GetDynamicRightsState"}, - FunctionInfo{9, nullptr, "RequestApplicationRightsOnServerToResume"}, - FunctionInfo{10, nullptr, "RequestAssignRightsToResume"}, - FunctionInfo{11, nullptr, "GetActivatedRightsUsers"}, - FunctionInfo{12, nullptr, "GetApplicationRightsStatus"}, - FunctionInfo{13, D<&IDynamicRightsInterface::GetRunningApplicationStatus>, "GetRunningApplicationStatus"}, - FunctionInfo{14, nullptr, "SelectApplicationLicense"}, - FunctionInfo{15, nullptr, "RequestContentsAuthorizationToken"}, - FunctionInfo{16, nullptr, "QualifyUser"}, - FunctionInfo{17, nullptr, "QualifyUserWithProcessId"}, - FunctionInfo{18, D<&IDynamicRightsInterface::NotifyApplicationRightsCheckStart>, "NotifyApplicationRightsCheckStart"}, - FunctionInfo{19, nullptr, "UpdateUserList"}, - FunctionInfo{20, nullptr, "IsRightsLostUser"}, - FunctionInfo{21, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, - FunctionInfo{22, nullptr, "GetLimitedApplicationLicense"}, - FunctionInfo{23, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, - FunctionInfo{24, nullptr, "NotifyLimitedApplicationLicenseUpgradableEventForDebug"}, - FunctionInfo{25, nullptr, "RequestProceedDynamicRightsState"}, - FunctionInfo{26, D<&IDynamicRightsInterface::HasAccountRestrictedRightsInRunningApplications>, "HasAccountRestrictedRightsInRunningApplications"}, - FunctionInfo{27, nullptr, "Unknown27", MakeVersionGate({20,0,0})}, - FunctionInfo{28, nullptr, "Unknown28", MakeVersionGate({20,0,0})}, - FunctionInfo{29, nullptr, "Unknown29", MakeVersionGate({21,0,0})}, - FunctionInfo{30, nullptr, "Unknown30", MakeVersionGate({21,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IDynamicRightsInterface::IDynamicRightsInterface(Core::System& system_) : ServiceFramework{system_, "DynamicRightsInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestApplicationRightsOnServer"}, + {1, nullptr, "RequestAssignRights"}, + {4, nullptr, "DeprecatedRequestAssignRightsToResume"}, + {5, D<&IDynamicRightsInterface::VerifyActivatedRightsOwners>, "VerifyActivatedRightsOwners"}, + {6, nullptr, "DeprecatedGetApplicationRightsStatus"}, + {7, nullptr, "RequestPrefetchForDynamicRights"}, + {8, nullptr, "GetDynamicRightsState"}, + {9, nullptr, "RequestApplicationRightsOnServerToResume"}, + {10, nullptr, "RequestAssignRightsToResume"}, + {11, nullptr, "GetActivatedRightsUsers"}, + {12, nullptr, "GetApplicationRightsStatus"}, + {13, D<&IDynamicRightsInterface::GetRunningApplicationStatus>, "GetRunningApplicationStatus"}, + {14, nullptr, "SelectApplicationLicense"}, + {15, nullptr, "RequestContentsAuthorizationToken"}, + {16, nullptr, "QualifyUser"}, + {17, nullptr, "QualifyUserWithProcessId"}, + {18, D<&IDynamicRightsInterface::NotifyApplicationRightsCheckStart>, "NotifyApplicationRightsCheckStart"}, + {19, nullptr, "UpdateUserList"}, + {20, nullptr, "IsRightsLostUser"}, + {21, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, + {22, nullptr, "GetLimitedApplicationLicense"}, + {23, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, + {24, nullptr, "NotifyLimitedApplicationLicenseUpgradableEventForDebug"}, + {25, nullptr, "RequestProceedDynamicRightsState"}, + {26, D<&IDynamicRightsInterface::HasAccountRestrictedRightsInRunningApplications>, "HasAccountRestrictedRightsInRunningApplications"}, + {27, nullptr, "Unknown27"}, //20.0.0+ + {28, nullptr, "Unknown28"}, //20.0.0+ + {29, nullptr, "Unknown29"}, //21.0.0+ + {30, nullptr, "Unknown30"}, //21.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } IDynamicRightsInterface::~IDynamicRightsInterface() = default; diff --git a/src/core/hle/service/ns/dynamic_rights_interface.h b/src/core/hle/service/ns/dynamic_rights_interface.h index e8a1d81491..c3270aee05 100644 --- a/src/core/hle/service/ns/dynamic_rights_interface.h +++ b/src/core/hle/service/ns/dynamic_rights_interface.h @@ -21,8 +21,6 @@ private: Result GetRunningApplicationStatus(Out out_status, u64 rights_handle); Result VerifyActivatedRightsOwners(u64 rights_handle); Result HasAccountRestrictedRightsInRunningApplications(Out out_is_restricted); - - std::optional FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/ecommerce_interface.cpp b/src/core/hle/service/ns/ecommerce_interface.cpp index 5687d09a02..b8794bb5fb 100644 --- a/src/core/hle/service/ns/ecommerce_interface.cpp +++ b/src/core/hle/service/ns/ecommerce_interface.cpp @@ -10,6 +10,19 @@ namespace Service::NS { IECommerceInterface::IECommerceInterface(Core::System& system_) : ServiceFramework{system_, "IECommerceInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestLinkDevice"}, + {1, nullptr, "RequestCleanupAllPreInstalledApplications"}, + {2, nullptr, "RequestCleanupPreInstalledApplication"}, + {3, nullptr, "RequestSyncRights"}, + {4, nullptr, "RequestUnlinkDevice"}, + {5, nullptr, "RequestRevokeAllELicense"}, + {6, nullptr, "RequestSyncRightsBasedOnAssignedELicenses"}, + }; + // clang-format on + + RegisterHandlers(functions); } IECommerceInterface::~IECommerceInterface() = default; diff --git a/src/core/hle/service/ns/ecommerce_interface.h b/src/core/hle/service/ns/ecommerce_interface.h index d020ff5ef8..6ff9512123 100644 --- a/src/core/hle/service/ns/ecommerce_interface.h +++ b/src/core/hle/service/ns/ecommerce_interface.h @@ -14,19 +14,6 @@ class IECommerceInterface final : public ServiceFramework { public: explicit IECommerceInterface(Core::System& system_); ~IECommerceInterface() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RequestLinkDevice"}, - FunctionInfo{1, nullptr, "RequestCleanupAllPreInstalledApplications"}, - FunctionInfo{2, nullptr, "RequestCleanupPreInstalledApplication"}, - FunctionInfo{3, nullptr, "RequestSyncRights"}, - FunctionInfo{4, nullptr, "RequestUnlinkDevice"}, - FunctionInfo{5, nullptr, "RequestRevokeAllELicense"}, - FunctionInfo{6, nullptr, "RequestSyncRightsBasedOnAssignedELicenses"} - ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/factory_reset_interface.cpp b/src/core/hle/service/ns/factory_reset_interface.cpp index 1fc6edcc9b..11cdefb4be 100644 --- a/src/core/hle/service/ns/factory_reset_interface.cpp +++ b/src/core/hle/service/ns/factory_reset_interface.cpp @@ -8,21 +8,21 @@ namespace Service::NS { -std::optional IFactoryResetInterface::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{100, nullptr, "ResetToFactorySettings"}, - FunctionInfo{101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, - FunctionInfo{102, nullptr, "ResetToFactorySettingsForRefurbishment"}, - FunctionInfo{103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, - FunctionInfo{104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, - FunctionInfo{105, nullptr, "RequestResetToFactorySettingsSecurely"}, - FunctionInfo{106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IFactoryResetInterface::IFactoryResetInterface(Core::System& system_) : ServiceFramework{system_, "IFactoryResetInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {100, nullptr, "ResetToFactorySettings"}, + {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, + {102, nullptr, "ResetToFactorySettingsForRefurbishment"}, + {103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, + {104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, + {105, nullptr, "RequestResetToFactorySettingsSecurely"}, + {106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, + }; + // clang-format on + + RegisterHandlers(functions); } IFactoryResetInterface::~IFactoryResetInterface() = default; diff --git a/src/core/hle/service/ns/factory_reset_interface.h b/src/core/hle/service/ns/factory_reset_interface.h index 3d5700fb71..8181d6b379 100644 --- a/src/core/hle/service/ns/factory_reset_interface.h +++ b/src/core/hle/service/ns/factory_reset_interface.h @@ -14,7 +14,6 @@ class IFactoryResetInterface final : public ServiceFramework FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index ff1654517b..fe057422ce 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp @@ -19,25 +19,25 @@ namespace Service::NS { class INotifyService final : public ServiceFramework { public: - explicit INotifyService(Core::System& system_) : ServiceFramework{system_, "pdm:ntfy"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "NotifyAppletEvent" }, - FunctionInfo{2, nullptr, "NotifyOperationModeChangeEvent" }, - FunctionInfo{3, nullptr, "NotifyPowerStateChangeEvent" }, - FunctionInfo{4, nullptr, "NotifyClearAllEvent" }, - FunctionInfo{5, nullptr, "NotifyEventForDebug" }, - FunctionInfo{6, nullptr, "SuspendUserAccountEventService" }, - FunctionInfo{7, nullptr, "ResumeUserAccountEventService" }, - FunctionInfo{8, nullptr, "NotifyLibraryAppletEvent" }, - FunctionInfo{9, nullptr, "Cmd9" }, - FunctionInfo{20, nullptr, "Cmd20" }, - FunctionInfo{30, nullptr, "Cmd30" }, - FunctionInfo{100, nullptr, "Cmd100" }, - FunctionInfo{101, nullptr, "Cmd101" } - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit INotifyService(Core::System& system_) : ServiceFramework{system_, "pdm:ntfy"} { + // clang-format off + static const FunctionInfo functions[] = { + { 0, nullptr, "NotifyAppletEvent" }, + { 2, nullptr, "NotifyOperationModeChangeEvent" }, + { 3, nullptr, "NotifyPowerStateChangeEvent" }, + { 4, nullptr, "NotifyClearAllEvent" }, + { 5, nullptr, "NotifyEventForDebug" }, + { 6, nullptr, "SuspendUserAccountEventService" }, + { 7, nullptr, "ResumeUserAccountEventService" }, + { 8, nullptr, "NotifyLibraryAppletEvent" }, + { 9, nullptr, "Cmd9" }, + { 20, nullptr, "Cmd20" }, + { 30, nullptr, "Cmd30" }, + { 100, nullptr, "Cmd100" }, + { 101, nullptr, "Cmd101" }, + }; + // clang-format on + RegisterHandlers(functions); } }; @@ -45,10 +45,18 @@ class IVulnerabilityManagerInterface final : public ServiceFramework { public: explicit IVulnerabilityManagerInterface(Core::System& system_) - : ServiceFramework{system_, "ns:vm"} {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "ns:vm"} { + // clang-format off + static const FunctionInfo functions[] = { + {1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"}, + {1201, nullptr, "UpdateSafeSystemVersionForDebug"}, + {1202, nullptr, "GetSafeSystemVersion"}, + {3100, D<&IVulnerabilityManagerInterface::GetSafeSystemVersionCheckInfo>, "GetSafeSystemVersionCheckInfo"}, + {3101, nullptr, "RequestUpdateSafeSystemVersionCheckInfo"}, + {3102, D<&IVulnerabilityManagerInterface::ResetSafeSystemVersionCheckInfo>, "ResetSafeSystemVersionCheckInfo"}, + }; + // clang-format on + RegisterHandlers(functions); } ~IVulnerabilityManagerInterface() override = default; @@ -68,15 +76,6 @@ public: LOG_WARNING(Service_NS, "(STUBBED)"); R_SUCCEED(); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"}, - FunctionInfo{1201, nullptr, "UpdateSafeSystemVersionForDebug"}, - FunctionInfo{1202, nullptr, "GetSafeSystemVersion"}, - FunctionInfo{3100, D<&IVulnerabilityManagerInterface::GetSafeSystemVersionCheckInfo>, "GetSafeSystemVersionCheckInfo"}, - FunctionInfo{3101, nullptr, "RequestUpdateSafeSystemVersionCheckInfo"}, - FunctionInfo{3102, D<&IVulnerabilityManagerInterface::ResetSafeSystemVersionCheckInfo>, "ResetSafeSystemVersionCheckInfo"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h index f79b4ae3d6..2b14d115ca 100644 --- a/src/core/hle/service/ns/ns.h +++ b/src/core/hle/service/ns/ns.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ns/ns_results.h b/src/core/hle/service/ns/ns_results.h index 16d2ea6f7b..52f4c0ea59 100644 --- a/src/core/hle/service/ns/ns_results.h +++ b/src/core/hle/service/ns/ns_results.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ns/platform_service_manager.cpp b/src/core/hle/service/ns/platform_service_manager.cpp index dea6cb5c16..bf93a2edfa 100644 --- a/src/core/hle/service/ns/platform_service_manager.cpp +++ b/src/core/hle/service/ns/platform_service_manager.cpp @@ -27,28 +27,6 @@ namespace Service::NS { -std::optional IPlatformServiceManager::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IPlatformServiceManager::RequestLoad>, "RequestLoad"}, - FunctionInfo{1, D<&IPlatformServiceManager::GetLoadState>, "GetLoadState"}, - FunctionInfo{2, D<&IPlatformServiceManager::GetSize>, "GetSize"}, - FunctionInfo{3, D<&IPlatformServiceManager::GetSharedMemoryAddressOffset>, "GetSharedMemoryAddressOffset"}, - FunctionInfo{4, D<&IPlatformServiceManager::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, - FunctionInfo{5, D<&IPlatformServiceManager::GetSharedFontInOrderOfPriority>, "GetSharedFontInOrderOfPriority"}, - FunctionInfo{6, D<&IPlatformServiceManager::GetSharedFontInOrderOfPriority>, "GetSharedFontInOrderOfPriorityForSystem"}, - FunctionInfo{100, nullptr, "RequestApplicationFunctionAuthorization"}, - FunctionInfo{101, nullptr, "RequestApplicationFunctionAuthorizationByProcessId"}, - FunctionInfo{102, nullptr, "RequestApplicationFunctionAuthorizationByApplicationId"}, - FunctionInfo{103, nullptr, "RefreshApplicationFunctionBlackListDebugRecord"}, - FunctionInfo{104, nullptr, "RequestApplicationFunctionAuthorizationByProgramId"}, - FunctionInfo{105, nullptr, "GetFunctionBlackListSystemVersionToAuthorize"}, - FunctionInfo{106, nullptr, "GetFunctionBlackListVersion"}, - FunctionInfo{1000, nullptr, "LoadNgWordDataForPlatformRegionChina"}, - FunctionInfo{1001, nullptr, "GetNgWordDataSizeForPlatformRegionChina"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - struct FontRegion { u32 offset; u32 size; @@ -111,6 +89,28 @@ struct IPlatformServiceManager::Impl { IPlatformServiceManager::IPlatformServiceManager(Core::System& system_, const char* service_name_) : ServiceFramework{system_, service_name_}, impl{std::make_unique()} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IPlatformServiceManager::RequestLoad>, "RequestLoad"}, + {1, D<&IPlatformServiceManager::GetLoadState>, "GetLoadState"}, + {2, D<&IPlatformServiceManager::GetSize>, "GetSize"}, + {3, D<&IPlatformServiceManager::GetSharedMemoryAddressOffset>, "GetSharedMemoryAddressOffset"}, + {4, D<&IPlatformServiceManager::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, + {5, D<&IPlatformServiceManager::GetSharedFontInOrderOfPriority>, "GetSharedFontInOrderOfPriority"}, + {6, D<&IPlatformServiceManager::GetSharedFontInOrderOfPriority>, "GetSharedFontInOrderOfPriorityForSystem"}, + {100, nullptr, "RequestApplicationFunctionAuthorization"}, + {101, nullptr, "RequestApplicationFunctionAuthorizationByProcessId"}, + {102, nullptr, "RequestApplicationFunctionAuthorizationByApplicationId"}, + {103, nullptr, "RefreshApplicationFunctionBlackListDebugRecord"}, + {104, nullptr, "RequestApplicationFunctionAuthorizationByProgramId"}, + {105, nullptr, "GetFunctionBlackListSystemVersionToAuthorize"}, + {106, nullptr, "GetFunctionBlackListVersion"}, + {1000, nullptr, "LoadNgWordDataForPlatformRegionChina"}, + {1001, nullptr, "GetNgWordDataSizeForPlatformRegionChina"}, + }; + // clang-format on + RegisterHandlers(functions); + auto& fsc = system.GetFileSystemController(); // Attempt to load shared font data from disk diff --git a/src/core/hle/service/ns/platform_service_manager.h b/src/core/hle/service/ns/platform_service_manager.h index fb99a441f5..73521abbc2 100644 --- a/src/core/hle/service/ns/platform_service_manager.h +++ b/src/core/hle/service/ns/platform_service_manager.h @@ -68,12 +68,11 @@ private: Result GetSharedMemoryNativeHandle( OutCopyHandle out_shared_memory_native_handle); Result GetSharedFontInOrderOfPriority(OutArray out_font_codes, - OutArray out_font_offsets, - OutArray out_font_sizes, - Out out_fonts_are_loaded, Out out_font_count, - Set::LanguageCode language_code); + OutArray out_font_offsets, + OutArray out_font_sizes, + Out out_fonts_are_loaded, Out out_font_count, + Set::LanguageCode language_code); - std::optional FindRequest(u32 key) override; struct Impl; std::unique_ptr impl; }; diff --git a/src/core/hle/service/ns/query_service.cpp b/src/core/hle/service/ns/query_service.cpp index 13a1f33866..d22de1d169 100644 --- a/src/core/hle/service/ns/query_service.cpp +++ b/src/core/hle/service/ns/query_service.cpp @@ -14,40 +14,40 @@ namespace Service::NS { -std::optional IQueryService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "QueryAppletEvent"}, - FunctionInfo{1, nullptr, "QueryPlayStatistics"}, - FunctionInfo{2, nullptr, "QueryPlayStatisticsByUserAccountId"}, - FunctionInfo{3, nullptr, "QueryPlayStatisticsByNetworkServiceAccountId"}, - FunctionInfo{4, nullptr, "QueryPlayStatisticsByApplicationId"}, - FunctionInfo{5, D<&IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId>, "QueryPlayStatisticsByApplicationIdAndUserAccountId"}, - FunctionInfo{6, nullptr, "QueryPlayStatisticsByApplicationIdAndNetworkServiceAccountId"}, - FunctionInfo{7, nullptr, "QueryLastPlayTimeV0"}, - FunctionInfo{8, nullptr, "QueryPlayEvent"}, - FunctionInfo{9, nullptr, "GetAvailablePlayEventRange"}, - FunctionInfo{10, nullptr, "QueryAccountEvent"}, - FunctionInfo{11, nullptr, "QueryAccountPlayEvent"}, - FunctionInfo{12, nullptr, "GetAvailableAccountPlayEventRange"}, - FunctionInfo{13, nullptr, "QueryApplicationPlayStatisticsForSystemV0"}, - FunctionInfo{14, nullptr, "QueryRecentlyPlayedApplication"}, - FunctionInfo{15, nullptr, "GetRecentlyPlayedApplicationUpdateEvent"}, - FunctionInfo{16, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystemV0"}, - FunctionInfo{17, D<&IQueryService::QueryLastPlayTime>, "QueryLastPlayTime"}, - FunctionInfo{18, D<&IQueryService::QueryApplicationPlayStatisticsForSystem>, "QueryApplicationPlayStatisticsForSystem"}, - FunctionInfo{19, D<&IQueryService::QueryApplicationPlayStatisticsByUserAccountIdForSystem>, "QueryApplicationPlayStatisticsByUserAccountIdForSystem"}, - FunctionInfo{30, nullptr, "Cmd30" }, - FunctionInfo{31, nullptr, "Cmd31" }, - FunctionInfo{100, nullptr, "Cmd100" }, - FunctionInfo{110, nullptr, "Cmd110" }, - FunctionInfo{118, nullptr, "Cmd118" }, - FunctionInfo{119, nullptr, "Cmd119" } - ); - return HandlerTableGenerateWithFind(key, functions); -} - IQueryService::IQueryService(Core::System& system_) : ServiceFramework{system_, "pdm:qry"}, play_time_manager{std::make_unique()} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "QueryAppletEvent"}, + {1, nullptr, "QueryPlayStatistics"}, + {2, nullptr, "QueryPlayStatisticsByUserAccountId"}, + {3, nullptr, "QueryPlayStatisticsByNetworkServiceAccountId"}, + {4, nullptr, "QueryPlayStatisticsByApplicationId"}, + {5, D<&IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId>, "QueryPlayStatisticsByApplicationIdAndUserAccountId"}, + {6, nullptr, "QueryPlayStatisticsByApplicationIdAndNetworkServiceAccountId"}, + {7, nullptr, "QueryLastPlayTimeV0"}, + {8, nullptr, "QueryPlayEvent"}, + {9, nullptr, "GetAvailablePlayEventRange"}, + {10, nullptr, "QueryAccountEvent"}, + {11, nullptr, "QueryAccountPlayEvent"}, + {12, nullptr, "GetAvailableAccountPlayEventRange"}, + {13, nullptr, "QueryApplicationPlayStatisticsForSystemV0"}, + {14, nullptr, "QueryRecentlyPlayedApplication"}, + {15, nullptr, "GetRecentlyPlayedApplicationUpdateEvent"}, + {16, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystemV0"}, + {17, D<&IQueryService::QueryLastPlayTime>, "QueryLastPlayTime"}, + {18, D<&IQueryService::QueryApplicationPlayStatisticsForSystem>, "QueryApplicationPlayStatisticsForSystem"}, + {19, D<&IQueryService::QueryApplicationPlayStatisticsByUserAccountIdForSystem>, "QueryApplicationPlayStatisticsByUserAccountIdForSystem"}, + { 30, nullptr, "Cmd30" }, + { 31, nullptr, "Cmd31" }, + { 100, nullptr, "Cmd100" }, + { 110, nullptr, "Cmd110" }, + { 118, nullptr, "Cmd118" }, + { 119, nullptr, "Cmd119" }, + }; + // clang-format on + + RegisterHandlers(functions); } IQueryService::~IQueryService() = default; diff --git a/src/core/hle/service/ns/query_service.h b/src/core/hle/service/ns/query_service.h index 08267d3165..f5c0ae1058 100644 --- a/src/core/hle/service/ns/query_service.h +++ b/src/core/hle/service/ns/query_service.h @@ -62,7 +62,6 @@ private: OutArray out_stats, InArray application_ids); - std::optional FindRequest(u32 key) override; std::unique_ptr play_time_manager; }; diff --git a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp index c6cd822d24..1359cdbb95 100644 --- a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp +++ b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp @@ -73,21 +73,6 @@ void SanitizeJPEGImageSize(std::vector& image) { } // namespace -std::optional IReadOnlyApplicationControlDataInterface::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData>, "GetApplicationControlData"}, - FunctionInfo{1, D<&IReadOnlyApplicationControlDataInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, - FunctionInfo{2, D<&IReadOnlyApplicationControlDataInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, - FunctionInfo{3, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, - FunctionInfo{4, nullptr, "SelectApplicationDesiredLanguage"}, - FunctionInfo{5, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData2>, "GetApplicationControlData"}, - FunctionInfo{10, &IReadOnlyApplicationControlDataInterface::ListApplicationIcon, "ListApplicationIcon"}, - FunctionInfo{13, &IReadOnlyApplicationControlDataInterface::ListApplicationTitle, "ListApplicationTitle"}, - FunctionInfo{19, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData"}, - FunctionInfo{23, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData", MakeVersionGate({23,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} // IAsyncValue implementation for ListApplicationTitle // https://switchbrew.org/wiki/NS_services#ListApplicationTitle @@ -99,6 +84,13 @@ public: , data_offset{offset} , data_size{size} { + static const FunctionInfo functions[] = { + {0, D<&IAsyncValue::GetSize>, "GetSize"}, + {1, D<&IAsyncValue::Get>, "Get"}, + {2, D<&IAsyncValue::Cancel>, "Cancel"}, + {3, D<&IAsyncValue::GetErrorContext>, "GetErrorContext"}, + }; + RegisterHandlers(functions); completion_event = service_context.CreateEvent("IAsyncValue:Completion"); completion_event->GetReadableEvent().Signal(system.Kernel()); } @@ -130,16 +122,6 @@ private: LOG_DEBUG(Service_NS, "called"); R_SUCCEED(); } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IAsyncValue::GetSize>, "GetSize"}, - FunctionInfo{1, D<&IAsyncValue::Get>, "Get"}, - FunctionInfo{2, D<&IAsyncValue::Cancel>, "Cancel"}, - FunctionInfo{3, D<&IAsyncValue::GetErrorContext>, "GetErrorContext"} - ); KernelHelpers::ServiceContext service_context; Kernel::KEvent* completion_event{}; s32 data_offset; @@ -149,6 +131,22 @@ private: IReadOnlyApplicationControlDataInterface::IReadOnlyApplicationControlDataInterface( Core::System& system_) : ServiceFramework{system_, "IReadOnlyApplicationControlDataInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData>, "GetApplicationControlData"}, + {1, D<&IReadOnlyApplicationControlDataInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, + {2, D<&IReadOnlyApplicationControlDataInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, + {3, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, + {4, nullptr, "SelectApplicationDesiredLanguage"}, + {5, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData2>, "GetApplicationControlData"}, + {10, &IReadOnlyApplicationControlDataInterface::ListApplicationIcon, "ListApplicationIcon"}, + {13, &IReadOnlyApplicationControlDataInterface::ListApplicationTitle, "ListApplicationTitle"}, + {19, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData"}, + {23, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData"}, //23.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } IReadOnlyApplicationControlDataInterface::~IReadOnlyApplicationControlDataInterface() = default; diff --git a/src/core/hle/service/ns/read_only_application_control_data_interface.h b/src/core/hle/service/ns/read_only_application_control_data_interface.h index 3f68029583..a4a285151a 100644 --- a/src/core/hle/service/ns/read_only_application_control_data_interface.h +++ b/src/core/hle/service/ns/read_only_application_control_data_interface.h @@ -45,8 +45,6 @@ public: u8 flag1, u8 flag2, u64 application_id); - - std::optional FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/read_only_application_record_interface.cpp b/src/core/hle/service/ns/read_only_application_record_interface.cpp index 7a7cf9ec58..8ce7851ae2 100644 --- a/src/core/hle/service/ns/read_only_application_record_interface.cpp +++ b/src/core/hle/service/ns/read_only_application_record_interface.cpp @@ -11,18 +11,17 @@ namespace Service::NS { -std::optional IReadOnlyApplicationRecordInterface::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IReadOnlyApplicationRecordInterface::HasApplicationRecord>, "HasApplicationRecord"}, - FunctionInfo{1, nullptr, "NotifyApplicationFailure"}, - FunctionInfo{2, D<&IReadOnlyApplicationRecordInterface::IsDataCorruptedResult>, "IsDataCorruptedResult"}, - FunctionInfo{3, D<&IReadOnlyApplicationRecordInterface::ListApplicationRecord>, "ListApplicationRecord"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IReadOnlyApplicationRecordInterface::IReadOnlyApplicationRecordInterface(Core::System& system_) : ServiceFramework{system_, "IReadOnlyApplicationRecordInterface"} { + static const FunctionInfo functions[] = { + {0, D<&IReadOnlyApplicationRecordInterface::HasApplicationRecord>, "HasApplicationRecord"}, + {1, nullptr, "NotifyApplicationFailure"}, + {2, D<&IReadOnlyApplicationRecordInterface::IsDataCorruptedResult>, "IsDataCorruptedResult"}, + {3, D<&IReadOnlyApplicationRecordInterface::ListApplicationRecord>, "ListApplicationRecord"}, + }; + // clang-format on + + RegisterHandlers(functions); } IReadOnlyApplicationRecordInterface::~IReadOnlyApplicationRecordInterface() = default; diff --git a/src/core/hle/service/ns/read_only_application_record_interface.h b/src/core/hle/service/ns/read_only_application_record_interface.h index 308e753e7d..dd842070e8 100644 --- a/src/core/hle/service/ns/read_only_application_record_interface.h +++ b/src/core/hle/service/ns/read_only_application_record_interface.h @@ -24,8 +24,6 @@ private: Result ListApplicationRecord( OutArray out_records, Out out_count, s32 entry_offset); - - std::optional FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/service_getter_interface.cpp b/src/core/hle/service/ns/service_getter_interface.cpp index bbf30da3da..7b7f791650 100644 --- a/src/core/hle/service/ns/service_getter_interface.cpp +++ b/src/core/hle/service/ns/service_getter_interface.cpp @@ -20,25 +20,25 @@ namespace Service::NS { -std::optional IServiceGetterInterface::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{7988, D<&IServiceGetterInterface::GetDynamicRightsInterface>, "GetDynamicRightsInterface"}, - FunctionInfo{7989, D<&IServiceGetterInterface::GetReadOnlyApplicationControlDataInterface>, "GetReadOnlyApplicationControlDataInterface"}, - FunctionInfo{7991, D<&IServiceGetterInterface::GetReadOnlyApplicationRecordInterface>, "GetReadOnlyApplicationRecordInterface"}, - FunctionInfo{7992, D<&IServiceGetterInterface::GetECommerceInterface>, "GetECommerceInterface"}, - FunctionInfo{7993, D<&IServiceGetterInterface::GetApplicationVersionInterface>, "GetApplicationVersionInterface"}, - FunctionInfo{7994, D<&IServiceGetterInterface::GetFactoryResetInterface>, "GetFactoryResetInterface"}, - FunctionInfo{7995, D<&IServiceGetterInterface::GetAccountProxyInterface>, "GetAccountProxyInterface"}, - FunctionInfo{7996, D<&IServiceGetterInterface::GetApplicationManagerInterface>, "GetApplicationManagerInterface"}, - FunctionInfo{7997, D<&IServiceGetterInterface::GetDownloadTaskInterface>, "GetDownloadTaskInterface"}, - FunctionInfo{7998, D<&IServiceGetterInterface::GetContentManagementInterface>, "GetContentManagementInterface"}, - FunctionInfo{7999, D<&IServiceGetterInterface::GetDocumentInterface>, "GetDocumentInterface"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IServiceGetterInterface::IServiceGetterInterface(Core::System& system_, const char* name) : ServiceFramework{system_, name} { + // clang-format off + static const FunctionInfo functions[] = { + {7988, D<&IServiceGetterInterface::GetDynamicRightsInterface>, "GetDynamicRightsInterface"}, + {7989, D<&IServiceGetterInterface::GetReadOnlyApplicationControlDataInterface>, "GetReadOnlyApplicationControlDataInterface"}, + {7991, D<&IServiceGetterInterface::GetReadOnlyApplicationRecordInterface>, "GetReadOnlyApplicationRecordInterface"}, + {7992, D<&IServiceGetterInterface::GetECommerceInterface>, "GetECommerceInterface"}, + {7993, D<&IServiceGetterInterface::GetApplicationVersionInterface>, "GetApplicationVersionInterface"}, + {7994, D<&IServiceGetterInterface::GetFactoryResetInterface>, "GetFactoryResetInterface"}, + {7995, D<&IServiceGetterInterface::GetAccountProxyInterface>, "GetAccountProxyInterface"}, + {7996, D<&IServiceGetterInterface::GetApplicationManagerInterface>, "GetApplicationManagerInterface"}, + {7997, D<&IServiceGetterInterface::GetDownloadTaskInterface>, "GetDownloadTaskInterface"}, + {7998, D<&IServiceGetterInterface::GetContentManagementInterface>, "GetContentManagementInterface"}, + {7999, D<&IServiceGetterInterface::GetDocumentInterface>, "GetDocumentInterface"}, + }; + // clang-format on + + RegisterHandlers(functions); } IServiceGetterInterface::~IServiceGetterInterface() = default; diff --git a/src/core/hle/service/ns/service_getter_interface.h b/src/core/hle/service/ns/service_getter_interface.h index 8c33aafc27..fc36b04325 100644 --- a/src/core/hle/service/ns/service_getter_interface.h +++ b/src/core/hle/service/ns/service_getter_interface.h @@ -45,8 +45,6 @@ public: Result GetContentManagementInterface( Out> out_interface); Result GetDocumentInterface(Out> out_interface); - - std::optional FindRequest(u32 key) override; }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/system_update_control.cpp b/src/core/hle/service/ns/system_update_control.cpp index 3d1911c852..2711db508c 100644 --- a/src/core/hle/service/ns/system_update_control.cpp +++ b/src/core/hle/service/ns/system_update_control.cpp @@ -11,6 +11,35 @@ namespace Service::NS { ISystemUpdateControl::ISystemUpdateControl(Core::System& system_) : ServiceFramework{system_, "ISystemUpdateControl"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "HasDownloaded"}, + {1, nullptr, "RequestCheckLatestUpdate"}, + {2, nullptr, "RequestDownloadLatestUpdate"}, + {3, nullptr, "GetDownloadProgress"}, + {4, nullptr, "ApplyDownloadedUpdate"}, + {5, nullptr, "RequestPrepareCardUpdate"}, + {6, nullptr, "GetPrepareCardUpdateProgress"}, + {7, nullptr, "HasPreparedCardUpdate"}, + {8, nullptr, "ApplyCardUpdate"}, + {9, nullptr, "GetDownloadedEulaDataSize"}, + {10, nullptr, "GetDownloadedEulaData"}, + {11, nullptr, "SetupCardUpdate"}, + {12, nullptr, "GetPreparedCardUpdateEulaDataSize"}, + {13, nullptr, "GetPreparedCardUpdateEulaData"}, + {14, nullptr, "SetupCardUpdateViaSystemUpdater"}, + {15, nullptr, "HasReceived"}, + {16, nullptr, "RequestReceiveSystemUpdate"}, + {17, nullptr, "GetReceiveProgress"}, + {18, nullptr, "ApplyReceivedUpdate"}, + {19, nullptr, "GetReceivedEulaDataSize"}, + {20, nullptr, "GetReceivedEulaData"}, + {21, nullptr, "SetupToReceiveSystemUpdate"}, + {22, nullptr, "RequestCheckLatestUpdateIncludesRebootlessUpdate"}, + }; + // clang-format on + + RegisterHandlers(functions); } ISystemUpdateControl::~ISystemUpdateControl() = default; diff --git a/src/core/hle/service/ns/system_update_control.h b/src/core/hle/service/ns/system_update_control.h index acdf048e6c..70794f4abd 100644 --- a/src/core/hle/service/ns/system_update_control.h +++ b/src/core/hle/service/ns/system_update_control.h @@ -14,35 +14,6 @@ class ISystemUpdateControl final : public ServiceFramework public: explicit ISystemUpdateControl(Core::System& system_); ~ISystemUpdateControl() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "HasDownloaded"}, - FunctionInfo{1, nullptr, "RequestCheckLatestUpdate"}, - FunctionInfo{2, nullptr, "RequestDownloadLatestUpdate"}, - FunctionInfo{3, nullptr, "GetDownloadProgress"}, - FunctionInfo{4, nullptr, "ApplyDownloadedUpdate"}, - FunctionInfo{5, nullptr, "RequestPrepareCardUpdate"}, - FunctionInfo{6, nullptr, "GetPrepareCardUpdateProgress"}, - FunctionInfo{7, nullptr, "HasPreparedCardUpdate"}, - FunctionInfo{8, nullptr, "ApplyCardUpdate"}, - FunctionInfo{9, nullptr, "GetDownloadedEulaDataSize"}, - FunctionInfo{10, nullptr, "GetDownloadedEulaData"}, - FunctionInfo{11, nullptr, "SetupCardUpdate"}, - FunctionInfo{12, nullptr, "GetPreparedCardUpdateEulaDataSize"}, - FunctionInfo{13, nullptr, "GetPreparedCardUpdateEulaData"}, - FunctionInfo{14, nullptr, "SetupCardUpdateViaSystemUpdater"}, - FunctionInfo{15, nullptr, "HasReceived"}, - FunctionInfo{16, nullptr, "RequestReceiveSystemUpdate"}, - FunctionInfo{17, nullptr, "GetReceiveProgress"}, - FunctionInfo{18, nullptr, "ApplyReceivedUpdate"}, - FunctionInfo{19, nullptr, "GetReceivedEulaDataSize"}, - FunctionInfo{20, nullptr, "GetReceivedEulaData"}, - FunctionInfo{21, nullptr, "SetupToReceiveSystemUpdate"}, - FunctionInfo{22, nullptr, "RequestCheckLatestUpdateIncludesRebootlessUpdate"} - ); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/system_update_interface.cpp b/src/core/hle/service/ns/system_update_interface.cpp index 044d39835f..3f4d42fdb6 100644 --- a/src/core/hle/service/ns/system_update_interface.cpp +++ b/src/core/hle/service/ns/system_update_interface.cpp @@ -10,32 +10,32 @@ namespace Service::NS { -std::optional ISystemUpdateInterface::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ISystemUpdateInterface::GetBackgroundNetworkUpdateState>, "GetBackgroundNetworkUpdateState"}, - FunctionInfo{1, D<&ISystemUpdateInterface::OpenSystemUpdateControl>, "OpenSystemUpdateControl"}, - FunctionInfo{2, nullptr, "NotifyExFatDriverRequired"}, - FunctionInfo{3, nullptr, "ClearExFatDriverStatusForDebug"}, - FunctionInfo{4, nullptr, "RequestBackgroundNetworkUpdate"}, - FunctionInfo{5, nullptr, "NotifyBackgroundNetworkUpdate"}, - FunctionInfo{6, nullptr, "NotifyExFatDriverDownloadedForDebug"}, - FunctionInfo{9, D<&ISystemUpdateInterface::GetSystemUpdateNotificationEventForContentDelivery>, "GetSystemUpdateNotificationEventForContentDelivery"}, - FunctionInfo{10, nullptr, "NotifySystemUpdateForContentDelivery"}, - FunctionInfo{11, nullptr, "PrepareShutdown"}, - FunctionInfo{12, nullptr, "Unknown12"}, - FunctionInfo{13, nullptr, "Unknown13"}, - FunctionInfo{14, nullptr, "Unknown14"}, - FunctionInfo{15, nullptr, "Unknown15"}, - FunctionInfo{16, nullptr, "DestroySystemUpdateTask"}, - FunctionInfo{17, nullptr, "RequestSendSystemUpdate"}, - FunctionInfo{18, nullptr, "GetSendSystemUpdateProgress"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - ISystemUpdateInterface::ISystemUpdateInterface(Core::System& system_) : ServiceFramework{system_, "ns:su"}, service_context{system_, "ns:su"}, update_notification_event{service_context} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ISystemUpdateInterface::GetBackgroundNetworkUpdateState>, "GetBackgroundNetworkUpdateState"}, + {1, D<&ISystemUpdateInterface::OpenSystemUpdateControl>, "OpenSystemUpdateControl"}, + {2, nullptr, "NotifyExFatDriverRequired"}, + {3, nullptr, "ClearExFatDriverStatusForDebug"}, + {4, nullptr, "RequestBackgroundNetworkUpdate"}, + {5, nullptr, "NotifyBackgroundNetworkUpdate"}, + {6, nullptr, "NotifyExFatDriverDownloadedForDebug"}, + {9, D<&ISystemUpdateInterface::GetSystemUpdateNotificationEventForContentDelivery>, "GetSystemUpdateNotificationEventForContentDelivery"}, + {10, nullptr, "NotifySystemUpdateForContentDelivery"}, + {11, nullptr, "PrepareShutdown"}, + {12, nullptr, "Unknown12"}, + {13, nullptr, "Unknown13"}, + {14, nullptr, "Unknown14"}, + {15, nullptr, "Unknown15"}, + {16, nullptr, "DestroySystemUpdateTask"}, + {17, nullptr, "RequestSendSystemUpdate"}, + {18, nullptr, "GetSendSystemUpdateProgress"}, + }; + // clang-format on + + RegisterHandlers(functions); } ISystemUpdateInterface::~ISystemUpdateInterface() = default; diff --git a/src/core/hle/service/ns/system_update_interface.h b/src/core/hle/service/ns/system_update_interface.h index 2ea14f4f5e..76f8959ed6 100644 --- a/src/core/hle/service/ns/system_update_interface.h +++ b/src/core/hle/service/ns/system_update_interface.h @@ -33,7 +33,7 @@ private: Result GetSystemUpdateNotificationEventForContentDelivery( OutCopyHandle out_event); - std::optional FindRequest(u32 key) override; +private: KernelHelpers::ServiceContext service_context; Event update_notification_event; }; diff --git a/src/core/hle/service/nvdrv/devices/ioctl_serialization.h b/src/core/hle/service/nvdrv/devices/ioctl_serialization.h index c3baa3a75b..37d04e3cf1 100644 --- a/src/core/hle/service/nvdrv/devices/ioctl_serialization.h +++ b/src/core/hle/service/nvdrv/devices/ioctl_serialization.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project diff --git a/src/core/hle/service/nvdrv/devices/nvdevice.h b/src/core/hle/service/nvdrv/devices/nvdevice.h index 8adaddc60b..d23ec63bae 100644 --- a/src/core/hle/service/nvdrv/devices/nvdevice.h +++ b/src/core/hle/service/nvdrv/devices/nvdevice.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 358679b831..1e571be4c9 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp @@ -278,7 +278,7 @@ NvResult nvhost_gpu::AllocateObjectContext(IoctlAllocObjCtx& params) { params.flags = allowed_mask; } - s32_le ctx_class_number_index = + s32_le ctx_class_number_index = GetObjectContextClassNumberIndex(static_cast(params.class_num)); if (ctx_class_number_index < 0) { LOG_ERROR(Service_NVDRV, "Invalid class number for object context: {:#x}", diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.h b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.h index 627686757b..1747881d48 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.h b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.h index def9c254d1..e0735b7f01 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nvdrv/devices/nvhost_vic.h b/src/core/hle/service/nvdrv/devices/nvhost_vic.h index 0cc04354a0..b1cbcb9ad7 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_vic.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_vic.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index 81d8a3a63b..b252a2efa5 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp @@ -50,61 +50,55 @@ class NVGEM_C final : public ServiceFramework { public: explicit NVGEM_C(Core::System& system_) : ServiceFramework{system_, "nvgem:c"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "GetEventHandle"}, + {2, nullptr, "ControlNotification"}, + {3, nullptr, "SetNotificationPerm"}, + {4, nullptr, "SetCoreDumpPerm"}, + {5, nullptr, "GetAruid"}, + {6, nullptr, "Reset"}, + {7, nullptr, "GetAruid2"}, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{1, nullptr, "GetEventHandle"}, - FunctionInfo{2, nullptr, "ControlNotification"}, - FunctionInfo{3, nullptr, "SetNotificationPerm"}, - FunctionInfo{4, nullptr, "SetCoreDumpPerm"}, - FunctionInfo{5, nullptr, "GetAruid"}, - FunctionInfo{6, nullptr, "Reset"}, - FunctionInfo{7, nullptr, "GetAruid2"} - ); }; class NVGEM_CD final : public ServiceFramework { public: explicit NVGEM_CD(Core::System& system_) : ServiceFramework{system_, "nvgem:cd"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "GetAruid"}, + {2, nullptr, "ReadNextBlock"}, + {3, nullptr, "GetNextBlockSize"}, + {4, nullptr, "ReadNextBlock2"}, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{1, nullptr, "GetAruid"}, - FunctionInfo{2, nullptr, "ReadNextBlock"}, - FunctionInfo{3, nullptr, "GetNextBlockSize"}, - FunctionInfo{4, nullptr, "ReadNextBlock2"} - ); }; class NVDBG_D final : public ServiceFramework { public: explicit NVDBG_D(Core::System& system_) : ServiceFramework{system_, "nvdbg:d"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + {0, nullptr, "Open"}, + {1, nullptr, "Ioctl"}, + {2, nullptr, "Close"}, + {4, nullptr, "QueryEvent"}, + {9, nullptr, "DumpStatus"}, + {10, nullptr, "InitializeDevtools"}, + {11, nullptr, "Ioctl2"}, + {12, nullptr, "Ioctl3"}, + {13, nullptr, "SetConfiguration"}, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Open"}, - FunctionInfo{1, nullptr, "Ioctl"}, - FunctionInfo{2, nullptr, "Close"}, - FunctionInfo{4, nullptr, "QueryEvent"}, - FunctionInfo{9, nullptr, "DumpStatus"}, - FunctionInfo{10, nullptr, "InitializeDevtools"}, - FunctionInfo{11, nullptr, "Ioctl2"}, - FunctionInfo{12, nullptr, "Ioctl3"}, - FunctionInfo{13, nullptr, "SetConfiguration"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp index db3dbd9f8e..5fae68adbb 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp +++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp @@ -245,6 +245,24 @@ void NVDRV::DumpGraphicsMemoryInfo(HLERequestContext& ctx) { NVDRV::NVDRV(Core::System& system_, std::shared_ptr nvdrv_, const char* name) : ServiceFramework{system_, name}, nvdrv{std::move(nvdrv_)} { + static const FunctionInfo functions[] = { + {0, &NVDRV::Open, "Open"}, + {1, &NVDRV::Ioctl1, "Ioctl"}, + {2, &NVDRV::Close, "Close"}, + {3, &NVDRV::Initialize, "Initialize"}, + {4, &NVDRV::QueryEvent, "QueryEvent"}, + {5, nullptr, "MapSharedMem"}, + {6, &NVDRV::GetStatus, "GetStatus"}, + {7, nullptr, "SetAruidForTest"}, + {8, &NVDRV::SetAruid, "SetAruid"}, + {9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"}, + {10, nullptr, "InitializeDevtools"}, + {11, &NVDRV::Ioctl2, "Ioctl2"}, + {12, &NVDRV::Ioctl3, "Ioctl3"}, + {13, &NVDRV::SetGraphicsFirmwareMemoryMarginEnabled, + "SetGraphicsFirmwareMemoryMarginEnabled"}, + }; + RegisterHandlers(functions); } NVDRV::~NVDRV() { diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.h b/src/core/hle/service/nvdrv/nvdrv_interface.h index b9b574398a..f628fca7df 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.h +++ b/src/core/hle/service/nvdrv/nvdrv_interface.h @@ -38,27 +38,8 @@ private: void ServiceError(HLERequestContext& ctx, NvResult result); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &NVDRV::Open, "Open"}, - FunctionInfo{1, &NVDRV::Ioctl1, "Ioctl"}, - FunctionInfo{2, &NVDRV::Close, "Close"}, - FunctionInfo{3, &NVDRV::Initialize, "Initialize"}, - FunctionInfo{4, &NVDRV::QueryEvent, "QueryEvent"}, - FunctionInfo{5, nullptr, "MapSharedMem"}, - FunctionInfo{6, &NVDRV::GetStatus, "GetStatus"}, - FunctionInfo{7, nullptr, "SetAruidForTest"}, - FunctionInfo{8, &NVDRV::SetAruid, "SetAruid"}, - FunctionInfo{9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"}, - FunctionInfo{10, nullptr, "InitializeDevtools"}, - FunctionInfo{11, &NVDRV::Ioctl2, "Ioctl2"}, - FunctionInfo{12, &NVDRV::Ioctl3, "Ioctl3"}, - FunctionInfo{13, &NVDRV::SetGraphicsFirmwareMemoryMarginEnabled, - "SetGraphicsFirmwareMemoryMarginEnabled"} - ); std::shared_ptr nvdrv; + u64 pid{}; bool is_initialized{}; NvCore::SessionId session_id{}; diff --git a/src/core/hle/service/nvdrv/nvmemp.cpp b/src/core/hle/service/nvdrv/nvmemp.cpp index 8e2e4dfacb..a5477faf1a 100644 --- a/src/core/hle/service/nvdrv/nvmemp.cpp +++ b/src/core/hle/service/nvdrv/nvmemp.cpp @@ -11,6 +11,11 @@ namespace Service::Nvidia { NVMEMP::NVMEMP(Core::System& system_) : ServiceFramework{system_, "nvmemp"} { + static const FunctionInfo functions[] = { + {0, &NVMEMP::Open, "Open"}, + {1, &NVMEMP::GetAruid, "GetAruid"}, + }; + RegisterHandlers(functions); } NVMEMP::~NVMEMP() = default; diff --git a/src/core/hle/service/nvdrv/nvmemp.h b/src/core/hle/service/nvdrv/nvmemp.h index e98b07c494..6ff59834fe 100644 --- a/src/core/hle/service/nvdrv/nvmemp.h +++ b/src/core/hle/service/nvdrv/nvmemp.h @@ -22,14 +22,6 @@ public: private: void Open(HLERequestContext& ctx); void GetAruid(HLERequestContext& ctx); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &NVMEMP::Open, "Open"}, - FunctionInfo{1, &NVMEMP::GetAruid, "GetAruid"} - ); }; } // namespace Service::Nvidia diff --git a/src/core/hle/service/nvnflinger/binder.h b/src/core/hle/service/nvnflinger/binder.h index 124accb946..6c7ce0ed0f 100644 --- a/src/core/hle/service/nvnflinger/binder.h +++ b/src/core/hle/service/nvnflinger/binder.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2014 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/buffer_item.h b/src/core/hle/service/nvnflinger/buffer_item.h index 7fd808f546..718188d849 100644 --- a/src/core/hle/service/nvnflinger/buffer_item.h +++ b/src/core/hle/service/nvnflinger/buffer_item.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2014 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/buffer_item_consumer.h b/src/core/hle/service/nvnflinger/buffer_item_consumer.h index 9f95c92800..7857569c0f 100644 --- a/src/core/hle/service/nvnflinger/buffer_item_consumer.h +++ b/src/core/hle/service/nvnflinger/buffer_item_consumer.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2012 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/buffer_queue_consumer.h b/src/core/hle/service/nvnflinger/buffer_queue_consumer.h index a9226f1c35..84f36285c0 100644 --- a/src/core/hle/service/nvnflinger/buffer_queue_consumer.h +++ b/src/core/hle/service/nvnflinger/buffer_queue_consumer.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2014 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/buffer_queue_defs.h b/src/core/hle/service/nvnflinger/buffer_queue_defs.h index 6fd3156f4a..77ebd0a6a0 100644 --- a/src/core/hle/service/nvnflinger/buffer_queue_defs.h +++ b/src/core/hle/service/nvnflinger/buffer_queue_defs.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2014 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/buffer_transform_flags.h b/src/core/hle/service/nvnflinger/buffer_transform_flags.h index ffe579718f..6fb40d0a72 100644 --- a/src/core/hle/service/nvnflinger/buffer_transform_flags.h +++ b/src/core/hle/service/nvnflinger/buffer_transform_flags.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/consumer_base.h b/src/core/hle/service/nvnflinger/consumer_base.h index b29c16f86b..e187b520ca 100644 --- a/src/core/hle/service/nvnflinger/consumer_base.h +++ b/src/core/hle/service/nvnflinger/consumer_base.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2010 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/consumer_listener.h b/src/core/hle/service/nvnflinger/consumer_listener.h index 74a1939883..4b4d939551 100644 --- a/src/core/hle/service/nvnflinger/consumer_listener.h +++ b/src/core/hle/service/nvnflinger/consumer_listener.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2014 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/graphic_buffer_producer.cpp b/src/core/hle/service/nvnflinger/graphic_buffer_producer.cpp index d72b49a8e7..5de604233d 100644 --- a/src/core/hle/service/nvnflinger/graphic_buffer_producer.cpp +++ b/src/core/hle/service/nvnflinger/graphic_buffer_producer.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2010 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/graphic_buffer_producer.h b/src/core/hle/service/nvnflinger/graphic_buffer_producer.h index 5d7cff7d38..05980eb482 100644 --- a/src/core/hle/service/nvnflinger/graphic_buffer_producer.h +++ b/src/core/hle/service/nvnflinger/graphic_buffer_producer.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2010 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/hos_binder_driver.cpp b/src/core/hle/service/nvnflinger/hos_binder_driver.cpp index c9023374c4..fa1becc34e 100644 --- a/src/core/hle/service/nvnflinger/hos_binder_driver.cpp +++ b/src/core/hle/service/nvnflinger/hos_binder_driver.cpp @@ -11,21 +11,18 @@ namespace Service::Nvnflinger { -std::optional IHOSBinderDriver::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IHOSBinderDriver::TransactParcel>, "TransactParcel"}, - FunctionInfo{1, C<&IHOSBinderDriver::AdjustRefcount>, "AdjustRefcount"}, - FunctionInfo{2, C<&IHOSBinderDriver::GetNativeHandle>, "GetNativeHandle"}, - FunctionInfo{3, C<&IHOSBinderDriver::TransactParcelAuto>, "TransactParcelAuto"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IHOSBinderDriver::IHOSBinderDriver(Core::System& system_, std::shared_ptr server, std::shared_ptr surface_flinger) : ServiceFramework{system_, "IHOSBinderDriver"}, m_server(server), m_surface_flinger(surface_flinger) { + static const FunctionInfo functions[] = { + {0, C<&IHOSBinderDriver::TransactParcel>, "TransactParcel"}, + {1, C<&IHOSBinderDriver::AdjustRefcount>, "AdjustRefcount"}, + {2, C<&IHOSBinderDriver::GetNativeHandle>, "GetNativeHandle"}, + {3, C<&IHOSBinderDriver::TransactParcelAuto>, "TransactParcelAuto"}, + }; + RegisterHandlers(functions); } IHOSBinderDriver::~IHOSBinderDriver() = default; diff --git a/src/core/hle/service/nvnflinger/hos_binder_driver.h b/src/core/hle/service/nvnflinger/hos_binder_driver.h index 7d44046115..6b551c91d2 100644 --- a/src/core/hle/service/nvnflinger/hos_binder_driver.h +++ b/src/core/hle/service/nvnflinger/hos_binder_driver.h @@ -44,7 +44,6 @@ private: OutBuffer parcel_reply, u32 flags); private: - std::optional FindRequest(u32 key) override; const std::shared_ptr m_server; const std::shared_ptr m_surface_flinger; }; diff --git a/src/core/hle/service/nvnflinger/nvnflinger.cpp b/src/core/hle/service/nvnflinger/nvnflinger.cpp index 9e3b68b8a0..48862a747d 100644 --- a/src/core/hle/service/nvnflinger/nvnflinger.cpp +++ b/src/core/hle/service/nvnflinger/nvnflinger.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/nvnflinger.h b/src/core/hle/service/nvnflinger/nvnflinger.h index 5c41f3013c..2f5465e7ef 100644 --- a/src/core/hle/service/nvnflinger/nvnflinger.h +++ b/src/core/hle/service/nvnflinger/nvnflinger.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/parcel.h b/src/core/hle/service/nvnflinger/parcel.h index 4567942016..ed85512792 100644 --- a/src/core/hle/service/nvnflinger/parcel.h +++ b/src/core/hle/service/nvnflinger/parcel.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project diff --git a/src/core/hle/service/nvnflinger/pixel_format.h b/src/core/hle/service/nvnflinger/pixel_format.h index f77d0acfb3..b6e8b5f8a0 100644 --- a/src/core/hle/service/nvnflinger/pixel_format.h +++ b/src/core/hle/service/nvnflinger/pixel_format.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/producer_listener.h b/src/core/hle/service/nvnflinger/producer_listener.h index 6bf8aaf1ee..892f6d531d 100644 --- a/src/core/hle/service/nvnflinger/producer_listener.h +++ b/src/core/hle/service/nvnflinger/producer_listener.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2014 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/status.h b/src/core/hle/service/nvnflinger/status.h index 3fa0fe15b9..7b188b42f5 100644 --- a/src/core/hle/service/nvnflinger/status.h +++ b/src/core/hle/service/nvnflinger/status.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/ui/graphic_buffer.cpp b/src/core/hle/service/nvnflinger/ui/graphic_buffer.cpp index ede2a11933..5ba7a31cc8 100644 --- a/src/core/hle/service/nvnflinger/ui/graphic_buffer.cpp +++ b/src/core/hle/service/nvnflinger/ui/graphic_buffer.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/ui/graphic_buffer.h b/src/core/hle/service/nvnflinger/ui/graphic_buffer.h index da430aa752..099429b3f0 100644 --- a/src/core/hle/service/nvnflinger/ui/graphic_buffer.h +++ b/src/core/hle/service/nvnflinger/ui/graphic_buffer.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2007 The Android Open Source Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/nvnflinger/window.h b/src/core/hle/service/nvnflinger/window.h index 36d6cde3db..78a99f57ae 100644 --- a/src/core/hle/service/nvnflinger/window.h +++ b/src/core/hle/service/nvnflinger/window.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/olsc/daemon_controller.cpp b/src/core/hle/service/olsc/daemon_controller.cpp index f25888170c..c449c6ff31 100644 --- a/src/core/hle/service/olsc/daemon_controller.cpp +++ b/src/core/hle/service/olsc/daemon_controller.cpp @@ -9,24 +9,26 @@ namespace Service::OLSC { -std::optional IDaemonController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IDaemonController::GetApplicationAutoTransferSetting>, "GetApplicationAutoTransferSetting"}, - FunctionInfo{1, D<&IDaemonController::SetApplicationAutoTransferSetting>, "SetApplicationAutoTransferSetting"}, - FunctionInfo{2, D<&IDaemonController::GetGlobalAutoUploadSetting>, "GetGlobalAutoUploadSetting"}, - FunctionInfo{3, D<&IDaemonController::SetGlobalAutoUploadSetting>, "SetGlobalAutoUploadSetting"}, - FunctionInfo{4, D<&IDaemonController::RunTransferTaskAutonomyRegistration>, "RunTransferTaskAutonomyRegistration"}, - FunctionInfo{5, D<&IDaemonController::GetGlobalAutoDownloadSetting>, "GetGlobalAutoDownloadSetting", MakeVersionGate({11,0,0})}, - FunctionInfo{6, D<&IDaemonController::SetGlobalAutoDownloadSetting>, "SetGlobalAutoDownloadSetting", MakeVersionGate({11,0,0})}, - FunctionInfo{10, nullptr, "CreateForbiddenSaveDataInidication"}, - FunctionInfo{11, D<&IDaemonController::StopAutonomyTaskExecution>, "StopAutonomyTaskExecution"}, - FunctionInfo{12, D<&IDaemonController::GetAutonomyTaskStatus>, "GetAutonomyTaskStatus"}, - FunctionInfo{13, nullptr, "Unknown13_20_0_0_Plus", MakeVersionGate({20,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} +IDaemonController::IDaemonController(Core::System& system_) + : ServiceFramework{system_, "IDaemonController"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IDaemonController::GetApplicationAutoTransferSetting>, "GetApplicationAutoTransferSetting"}, + {1, D<&IDaemonController::SetApplicationAutoTransferSetting>, "SetApplicationAutoTransferSetting"}, + {2, D<&IDaemonController::GetGlobalAutoUploadSetting>, "GetGlobalAutoUploadSetting"}, + {3, D<&IDaemonController::SetGlobalAutoUploadSetting>, "SetGlobalAutoUploadSetting"}, + {4, D<&IDaemonController::RunTransferTaskAutonomyRegistration>, "RunTransferTaskAutonomyRegistration"}, + {5, D<&IDaemonController::GetGlobalAutoDownloadSetting>, "GetGlobalAutoDownloadSetting"}, // 11.0.0+ + {6, D<&IDaemonController::SetGlobalAutoDownloadSetting>, "SetGlobalAutoDownloadSetting"}, // 11.0.0+ + {10, nullptr, "CreateForbiddenSaveDataInidication"}, + {11, D<&IDaemonController::StopAutonomyTaskExecution>, "StopAutonomyTaskExecution"}, + {12, D<&IDaemonController::GetAutonomyTaskStatus>, "GetAutonomyTaskStatus"}, + {13, nullptr, "Unknown13_20_0_0_Plus"}, // 20.0.0+ + }; + // clang-format on -IDaemonController::IDaemonController(Core::System& system_) : ServiceFramework{system_, "IDaemonController"} {} + RegisterHandlers(functions); +} IDaemonController::~IDaemonController() = default; diff --git a/src/core/hle/service/olsc/daemon_controller.h b/src/core/hle/service/olsc/daemon_controller.h index b90d3ee778..70f3d9e235 100644 --- a/src/core/hle/service/olsc/daemon_controller.h +++ b/src/core/hle/service/olsc/daemon_controller.h @@ -38,8 +38,6 @@ private: Result GetAutonomyTaskStatus(Out out_status, Common::UUID user_id); - std::optional FindRequest(u32 key) override; - // Internal in-memory state to back the above APIs struct AppKey { Common::UUID user_id; diff --git a/src/core/hle/service/olsc/native_handle_holder.cpp b/src/core/hle/service/olsc/native_handle_holder.cpp index 1f6f8419fc..1e50195539 100644 --- a/src/core/hle/service/olsc/native_handle_holder.cpp +++ b/src/core/hle/service/olsc/native_handle_holder.cpp @@ -12,16 +12,16 @@ namespace Service::OLSC { -std::optional INativeHandleHolder::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&INativeHandleHolder::GetNativeHandle>, "GetNativeHandle"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - INativeHandleHolder::INativeHandleHolder(Core::System& system_) : ServiceFramework{system_, "INativeHandleHolder"}, service_context{system_, "OLSC"} { event = service_context.CreateEvent("OLSC::INativeHandleHolder"); + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&INativeHandleHolder::GetNativeHandle>, "GetNativeHandle"}, + }; + // clang-format on + + RegisterHandlers(functions); } INativeHandleHolder::~INativeHandleHolder() { diff --git a/src/core/hle/service/olsc/native_handle_holder.h b/src/core/hle/service/olsc/native_handle_holder.h index 0ab51c7ca0..e0eac50c28 100644 --- a/src/core/hle/service/olsc/native_handle_holder.h +++ b/src/core/hle/service/olsc/native_handle_holder.h @@ -25,7 +25,6 @@ public: private: Result GetNativeHandle(OutCopyHandle out_event); - std::optional FindRequest(u32 key) override; Service::KernelHelpers::ServiceContext service_context; Kernel::KEvent* event{}; diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp index 03b8a696f5..a86c525f9a 100644 --- a/src/core/hle/service/olsc/olsc.cpp +++ b/src/core/hle/service/olsc/olsc.cpp @@ -6,179 +6,22 @@ #include "core/hle/service/olsc/olsc.h" #include "core/hle/service/olsc/olsc_service_for_application.h" -#include "core/hle/service/olsc/native_handle_holder.h" -#include "core/hle/service/olsc/stopper_object.h" -#include "core/hle/service/olsc/daemon_controller.h" -#include "core/hle/service/olsc/transfer_task_list_controller.h" -#include "core/hle/service/olsc/remote_storage_controller.h" +#include "core/hle/service/olsc/olsc_service_for_system_service.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" -#include "core/hle/service/cmif_serialization.h" namespace Service::OLSC { class ISProfileBgAgentForSystemProcess final : public ServiceFramework { public: - explicit ISProfileBgAgentForSystemProcess(Core::System& system_) : ServiceFramework{system_, "spbg:sp"} {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit ISProfileBgAgentForSystemProcess(Core::System& system_) + : ServiceFramework{system_, "spbg:sp"} + { + static const FunctionInfo functions[] = { + { 100, nullptr, "OpenBgAgentController" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{100, nullptr, "OpenBgAgentController" } - ); -}; - -class IDaemonController; -class IRemoteStorageController; -class ITransferTaskListController; - -struct DataTransferPolicy { - u8 upload_policy; - u8 download_policy; -}; - -struct TransferTaskErrorInfo { - Common::UUID uid; - u64 application_id; - u8 unknown_0x18; - std::array reserved_0x19; - u64 unknown_0x20; - u32 error_code; - u32 reserved_0x2C; -}; -static_assert(sizeof(TransferTaskErrorInfo) == 0x30, "TransferTaskErrorInfo has incorrect size."); - -class IOlscServiceForSystemService final : public ServiceFramework { -public: - explicit IOlscServiceForSystemService(Core::System& system_) - : ServiceFramework{system_, "olsc:s"} { - } - - ~IOlscServiceForSystemService() override = default; - - Result GetTransferTaskListController( - Out> out_interface) { - LOG_INFO(Service_OLSC, "called"); - *out_interface = std::make_shared(system); - R_SUCCEED(); - } - - Result GetRemoteStorageController( - Out> out_interface) { - LOG_INFO(Service_OLSC, "called"); - *out_interface = std::make_shared(system); - R_SUCCEED(); - } - - Result GetDaemonController( - Out> out_interface) { - LOG_INFO(Service_OLSC, "called"); - *out_interface = std::make_shared(system); - R_SUCCEED(); - } - - Result GetDataTransferPolicy( - Out out_policy, u64 application_id) { - LOG_WARNING(Service_OLSC, "(STUBBED) called"); - DataTransferPolicy policy{}; - policy.upload_policy = 0; - policy.download_policy = 0; - *out_policy = policy; - R_SUCCEED(); - } - - Result GetTransferTaskErrorInfo(Out out_info, - Common::UUID uuid, u64 application_id) { - LOG_WARNING(Service_OLSC, "(STUBBED) called, uuid={} application_id={:016X}", - uuid.FormattedString(), application_id); - - TransferTaskErrorInfo info{}; - info.uid = uuid; - info.application_id = application_id; - info.unknown_0x18 = 0; - info.reserved_0x19.fill(0); - info.unknown_0x20 = 0; - info.error_code = 0; - info.reserved_0x2C = 0; - - *out_info = info; - R_SUCCEED(); - } - - Result GetOlscServiceForSystemService( - Out> out_interface) { - LOG_INFO(Service_OLSC, "called"); - *out_interface = std::static_pointer_cast(shared_from_this()); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IOlscServiceForSystemService::GetTransferTaskListController>, "GetTransferTaskListController"}, - FunctionInfo{1, D<&IOlscServiceForSystemService::GetRemoteStorageController>, "GetRemoteStorageController"}, - FunctionInfo{2, D<&IOlscServiceForSystemService::GetDaemonController>, "GetDaemonController"}, - FunctionInfo{10, nullptr, "PrepareDeleteUserProperty"}, - FunctionInfo{11, nullptr, "DeleteUserSaveDataProperty"}, - FunctionInfo{12, nullptr, "InvalidateMountCache"}, - FunctionInfo{13, nullptr, "DeleteDeviceSaveDataProperty"}, - FunctionInfo{100, nullptr, "ListLastTransferTaskErrorInfo"}, - FunctionInfo{101, nullptr, "GetLastErrorInfoCount"}, - FunctionInfo{102, nullptr, "RemoveLastErrorInfoOld"}, - FunctionInfo{103, nullptr, "GetLastErrorInfo"}, - FunctionInfo{104, nullptr, "GetLastErrorEventHolder"}, - FunctionInfo{105, D<&IOlscServiceForSystemService::GetTransferTaskErrorInfo>, "GetTransferTaskErrorInfo"}, - FunctionInfo{200, D<&IOlscServiceForSystemService::GetDataTransferPolicy>, "GetDataTransferPolicy"}, - FunctionInfo{201, nullptr, "DeleteDataTransferPolicyCache"}, - FunctionInfo{202, nullptr, "Unknown202"}, - FunctionInfo{203, nullptr, "RequestUpdateDataTransferPolicyCacheAsync"}, - FunctionInfo{204, nullptr, "ClearDataTransferPolicyCache"}, - FunctionInfo{205, nullptr, "RequestGetDataTransferPolicyAsync"}, - FunctionInfo{206, nullptr, "Unknown206", MakeVersionGate({21,0,0})}, - FunctionInfo{300, nullptr, "GetUserSaveDataProperty"}, - FunctionInfo{301, nullptr, "SetUserSaveDataProperty"}, - FunctionInfo{302, nullptr, "Unknown302", MakeVersionGate({21,0,0})}, - FunctionInfo{400, nullptr, "CleanupSaveDataBackupContextForSpecificApplications"}, - FunctionInfo{900, nullptr, "DeleteAllTransferTask"}, - FunctionInfo{902, nullptr, "DeleteAllSeriesInfo"}, - FunctionInfo{903, nullptr, "DeleteAllSdaInfoCache"}, - FunctionInfo{904, nullptr, "DeleteAllApplicationSetting"}, - FunctionInfo{905, nullptr, "DeleteAllTransferTaskErrorInfo"}, - FunctionInfo{906, nullptr, "RegisterTransferTaskErrorInfo"}, - FunctionInfo{907, nullptr, "AddSaveDataArchiveInfoCache"}, - FunctionInfo{908, nullptr, "DeleteSeriesInfo"}, - FunctionInfo{909, nullptr, "GetSeriesInfo"}, - FunctionInfo{910, nullptr, "RemoveTransferTaskErrorInfo"}, - FunctionInfo{911, nullptr, "DeleteAllSeriesInfoForSaveDataBackup"}, - FunctionInfo{912, nullptr, "DeleteSeriesInfoForSaveDataBackup"}, - FunctionInfo{913, nullptr, "GetSeriesInfoForSaveDataBackup"}, - FunctionInfo{914, nullptr, "Unknown914", MakeVersionGate({20,2,0})}, - FunctionInfo{1000, nullptr, "UpdateIssueOld"}, - FunctionInfo{1010, nullptr, "Unknown1010"}, - FunctionInfo{1011, nullptr, "Unknown1011"}, - FunctionInfo{1012, nullptr, "Unknown1012"}, - FunctionInfo{1013, nullptr, "Unkown1013"}, - FunctionInfo{1014, nullptr, "Unknown1014"}, - FunctionInfo{1020, nullptr, "Unknown1020"}, - FunctionInfo{1021, nullptr, "Unknown1021"}, - FunctionInfo{1022, nullptr, "Unknown1022"}, - FunctionInfo{1023, nullptr, "Unknown1023"}, - FunctionInfo{1024, nullptr, "Unknown1024"}, - FunctionInfo{1100, nullptr, "RepairUpdateIssueInfoCacheAync"}, - FunctionInfo{1110, nullptr, "RepairGetIssueInfo"}, - FunctionInfo{1111, nullptr, "RepairListIssueInfo"}, - FunctionInfo{1112, nullptr, "RepairListOperationPermissionInfo"}, - FunctionInfo{1113, nullptr, "RepairListDataInfoForRepairedSaveDataDownload"}, - FunctionInfo{1114, nullptr, "RepairListDataInfoForOriginalSaveDataDownload"}, - FunctionInfo{1120, nullptr, "RepairUploadSaveDataAsync"}, - FunctionInfo{1121, nullptr, "RepairUploadSaveDataAsync1"}, - FunctionInfo{1122, nullptr, "RepairDownloadRepairedSaveDataAsync"}, - FunctionInfo{1123, nullptr, "RepairDownloadOriginalSaveDataAsync"}, - FunctionInfo{1124, nullptr, "RepairGetOperationProgressInfo"}, - FunctionInfo{10000, D<&IOlscServiceForSystemService::GetOlscServiceForSystemService>, "GetOlscServiceForSystemService"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/olsc/olsc.h b/src/core/hle/service/olsc/olsc.h index 620b634fae..62000529c5 100644 --- a/src/core/hle/service/olsc/olsc.h +++ b/src/core/hle/service/olsc/olsc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/olsc/olsc_service_for_application.cpp b/src/core/hle/service/olsc/olsc_service_for_application.cpp index 8d6b20d7ff..73d7d4ed64 100644 --- a/src/core/hle/service/olsc/olsc_service_for_application.cpp +++ b/src/core/hle/service/olsc/olsc_service_for_application.cpp @@ -9,36 +9,36 @@ namespace Service::OLSC { -std::optional IOlscServiceForApplication::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IOlscServiceForApplication::Initialize>, "Initialize"}, - FunctionInfo{10, nullptr, "VerifySaveDataBackupLicenseAsync"}, - FunctionInfo{13, D<&IOlscServiceForApplication::GetSaveDataBackupSetting>, "GetSaveDataBackupSetting"}, - FunctionInfo{14, D<&IOlscServiceForApplication::SetSaveDataBackupSettingEnabled>, "SetSaveDataBackupSettingEnabled"}, - FunctionInfo{15, nullptr, "SetCustomData"}, - FunctionInfo{16, nullptr, "DeleteSaveDataBackupSetting"}, - FunctionInfo{18, nullptr, "GetSaveDataBackupInfoCache"}, - FunctionInfo{19, nullptr, "UpdateSaveDataBackupInfoCacheAsync"}, - FunctionInfo{22, nullptr, "DeleteSaveDataBackupAsync"}, - FunctionInfo{25, nullptr, "ListDownloadableSaveDataBackupInfoAsync"}, - FunctionInfo{26, nullptr, "DownloadSaveDataBackupAsync"}, - FunctionInfo{27, nullptr, "UploadSaveDataBackupAsync"}, - FunctionInfo{9010, nullptr, "VerifySaveDataBackupLicenseAsyncForDebug"}, - FunctionInfo{9013, nullptr, "GetSaveDataBackupSettingForDebug"}, - FunctionInfo{9014, nullptr, "SetSaveDataBackupSettingEnabledForDebug"}, - FunctionInfo{9015, nullptr, "SetCustomDataForDebug"}, - FunctionInfo{9016, nullptr, "DeleteSaveDataBackupSettingForDebug"}, - FunctionInfo{9018, nullptr, "GetSaveDataBackupInfoCacheForDebug"}, - FunctionInfo{9019, nullptr, "UpdateSaveDataBackupInfoCacheAsyncForDebug"}, - FunctionInfo{9022, nullptr, "DeleteSaveDataBackupAsyncForDebug"}, - FunctionInfo{9025, nullptr, "ListDownloadableSaveDataBackupInfoAsyncForDebug"}, - FunctionInfo{9026, nullptr, "DownloadSaveDataBackupAsyncForDebug"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IOlscServiceForApplication::IOlscServiceForApplication(Core::System& system_) : ServiceFramework{system_, "olsc:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IOlscServiceForApplication::Initialize>, "Initialize"}, + {10, nullptr, "VerifySaveDataBackupLicenseAsync"}, + {13, D<&IOlscServiceForApplication::GetSaveDataBackupSetting>, "GetSaveDataBackupSetting"}, + {14, D<&IOlscServiceForApplication::SetSaveDataBackupSettingEnabled>, "SetSaveDataBackupSettingEnabled"}, + {15, nullptr, "SetCustomData"}, + {16, nullptr, "DeleteSaveDataBackupSetting"}, + {18, nullptr, "GetSaveDataBackupInfoCache"}, + {19, nullptr, "UpdateSaveDataBackupInfoCacheAsync"}, + {22, nullptr, "DeleteSaveDataBackupAsync"}, + {25, nullptr, "ListDownloadableSaveDataBackupInfoAsync"}, + {26, nullptr, "DownloadSaveDataBackupAsync"}, + {27, nullptr, "UploadSaveDataBackupAsync"}, + {9010, nullptr, "VerifySaveDataBackupLicenseAsyncForDebug"}, + {9013, nullptr, "GetSaveDataBackupSettingForDebug"}, + {9014, nullptr, "SetSaveDataBackupSettingEnabledForDebug"}, + {9015, nullptr, "SetCustomDataForDebug"}, + {9016, nullptr, "DeleteSaveDataBackupSettingForDebug"}, + {9018, nullptr, "GetSaveDataBackupInfoCacheForDebug"}, + {9019, nullptr, "UpdateSaveDataBackupInfoCacheAsyncForDebug"}, + {9022, nullptr, "DeleteSaveDataBackupAsyncForDebug"}, + {9025, nullptr, "ListDownloadableSaveDataBackupInfoAsyncForDebug"}, + {9026, nullptr, "DownloadSaveDataBackupAsyncForDebug"}, + }; + // clang-format on + + RegisterHandlers(functions); } IOlscServiceForApplication::~IOlscServiceForApplication() = default; diff --git a/src/core/hle/service/olsc/olsc_service_for_application.h b/src/core/hle/service/olsc/olsc_service_for_application.h index 0d92f9ba78..8941659478 100644 --- a/src/core/hle/service/olsc/olsc_service_for_application.h +++ b/src/core/hle/service/olsc/olsc_service_for_application.h @@ -22,8 +22,6 @@ private: Result GetSaveDataBackupSetting(Out out_save_data_backup_setting); Result SetSaveDataBackupSettingEnabled(bool enabled, NS::Uid account_id); - std::optional FindRequest(u32 key) override; - bool initialized{}; }; diff --git a/src/core/hle/service/olsc/olsc_service_for_system_service.cpp b/src/core/hle/service/olsc/olsc_service_for_system_service.cpp new file mode 100644 index 0000000000..245bbd5c6b --- /dev/null +++ b/src/core/hle/service/olsc/olsc_service_for_system_service.cpp @@ -0,0 +1,144 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/olsc/daemon_controller.h" +#include "core/hle/service/olsc/olsc_service_for_system_service.h" +#include "core/hle/service/olsc/remote_storage_controller.h" +#include "core/hle/service/olsc/transfer_task_list_controller.h" + +namespace Service::OLSC { + +IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_) + : ServiceFramework{system_, "olsc:s"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IOlscServiceForSystemService::GetTransferTaskListController>, "GetTransferTaskListController"}, + {1, D<&IOlscServiceForSystemService::GetRemoteStorageController>, "GetRemoteStorageController"}, + {2, D<&IOlscServiceForSystemService::GetDaemonController>, "GetDaemonController"}, + {10, nullptr, "PrepareDeleteUserProperty"}, + {11, nullptr, "DeleteUserSaveDataProperty"}, + {12, nullptr, "InvalidateMountCache"}, + {13, nullptr, "DeleteDeviceSaveDataProperty"}, + {100, nullptr, "ListLastTransferTaskErrorInfo"}, + {101, nullptr, "GetLastErrorInfoCount"}, + {102, nullptr, "RemoveLastErrorInfoOld"}, + {103, nullptr, "GetLastErrorInfo"}, + {104, nullptr, "GetLastErrorEventHolder"}, + {105, D<&IOlscServiceForSystemService::GetTransferTaskErrorInfo>, "GetTransferTaskErrorInfo"}, + {200, D<&IOlscServiceForSystemService::GetDataTransferPolicy>, "GetDataTransferPolicy"}, + {201, nullptr, "DeleteDataTransferPolicyCache"}, + {202, nullptr, "Unknown202"}, + {203, nullptr, "RequestUpdateDataTransferPolicyCacheAsync"}, + {204, nullptr, "ClearDataTransferPolicyCache"}, + {205, nullptr, "RequestGetDataTransferPolicyAsync"}, + {206, nullptr, "Unknown206"}, //21.0.0+ + {300, nullptr, "GetUserSaveDataProperty"}, + {301, nullptr, "SetUserSaveDataProperty"}, + {302, nullptr, "Unknown302"}, //21.0.0+ + {400, nullptr, "CleanupSaveDataBackupContextForSpecificApplications"}, + {900, nullptr, "DeleteAllTransferTask"}, + {902, nullptr, "DeleteAllSeriesInfo"}, + {903, nullptr, "DeleteAllSdaInfoCache"}, + {904, nullptr, "DeleteAllApplicationSetting"}, + {905, nullptr, "DeleteAllTransferTaskErrorInfo"}, + {906, nullptr, "RegisterTransferTaskErrorInfo"}, + {907, nullptr, "AddSaveDataArchiveInfoCache"}, + {908, nullptr, "DeleteSeriesInfo"}, + {909, nullptr, "GetSeriesInfo"}, + {910, nullptr, "RemoveTransferTaskErrorInfo"}, + {911, nullptr, "DeleteAllSeriesInfoForSaveDataBackup"}, + {912, nullptr, "DeleteSeriesInfoForSaveDataBackup"}, + {913, nullptr, "GetSeriesInfoForSaveDataBackup"}, + {914, nullptr, "Unknown914"}, //20.2.0+ + {1000, nullptr, "UpdateIssueOld"}, + {1010, nullptr, "Unknown1010"}, + {1011, nullptr, "Unknown1011"}, + {1012, nullptr, "Unknown1012"}, + {1013, nullptr, "Unkown1013"}, + {1014, nullptr, "Unknown1014"}, + {1020, nullptr, "Unknown1020"}, + {1021, nullptr, "Unknown1021"}, + {1022, nullptr, "Unknown1022"}, + {1023, nullptr, "Unknown1023"}, + {1024, nullptr, "Unknown1024"}, + {1100, nullptr, "RepairUpdateIssueInfoCacheAync"}, + {1110, nullptr, "RepairGetIssueInfo"}, + {1111, nullptr, "RepairListIssueInfo"}, + {1112, nullptr, "RepairListOperationPermissionInfo"}, + {1113, nullptr, "RepairListDataInfoForRepairedSaveDataDownload"}, + {1114, nullptr, "RepairListDataInfoForOriginalSaveDataDownload"}, + {1120, nullptr, "RepairUploadSaveDataAsync"}, + {1121, nullptr, "RepairUploadSaveDataAsync1"}, + {1122, nullptr, "RepairDownloadRepairedSaveDataAsync"}, + {1123, nullptr, "RepairDownloadOriginalSaveDataAsync"}, + {1124, nullptr, "RepairGetOperationProgressInfo"}, + {10000, D<&IOlscServiceForSystemService::GetOlscServiceForSystemService>, "GetOlscServiceForSystemService"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IOlscServiceForSystemService::~IOlscServiceForSystemService() = default; + +Result IOlscServiceForSystemService::GetTransferTaskListController( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared(system); + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::GetRemoteStorageController( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared(system); + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::GetDaemonController( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared(system); + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::GetDataTransferPolicy( + Out out_policy, u64 application_id) { + LOG_WARNING(Service_OLSC, "(STUBBED) called"); + DataTransferPolicy policy{}; + policy.upload_policy = 0; + policy.download_policy = 0; + *out_policy = policy; + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::GetTransferTaskErrorInfo(Out out_info, + Common::UUID uuid, u64 application_id) { + LOG_WARNING(Service_OLSC, "(STUBBED) called, uuid={} application_id={:016X}", + uuid.FormattedString(), application_id); + + TransferTaskErrorInfo info{}; + info.uid = uuid; + info.application_id = application_id; + info.unknown_0x18 = 0; + info.reserved_0x19.fill(0); + info.unknown_0x20 = 0; + info.error_code = 0; + info.reserved_0x2C = 0; + + *out_info = info; + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::GetOlscServiceForSystemService( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::static_pointer_cast(shared_from_this()); + R_SUCCEED(); +} + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/olsc_service_for_system_service.h b/src/core/hle/service/olsc/olsc_service_for_system_service.h new file mode 100644 index 0000000000..d16c8b979b --- /dev/null +++ b/src/core/hle/service/olsc/olsc_service_for_system_service.h @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +#include "common/uuid.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::OLSC { + +class IDaemonController; +class IRemoteStorageController; +class ITransferTaskListController; + +struct DataTransferPolicy { + u8 upload_policy; + u8 download_policy; +}; + +struct TransferTaskErrorInfo { + Common::UUID uid; + u64 application_id; + u8 unknown_0x18; + std::array reserved_0x19; + u64 unknown_0x20; + u32 error_code; + u32 reserved_0x2C; +}; +static_assert(sizeof(TransferTaskErrorInfo) == 0x30, "TransferTaskErrorInfo has incorrect size."); + +class IOlscServiceForSystemService final : public ServiceFramework { +public: + explicit IOlscServiceForSystemService(Core::System& system_); + ~IOlscServiceForSystemService() override; + +private: + Result GetTransferTaskListController( + Out> out_interface); + Result GetRemoteStorageController(Out> out_interface); + Result GetDaemonController(Out> out_interface); + Result GetDataTransferPolicy(Out out_policy, u64 application_id); + Result GetTransferTaskErrorInfo(Out out_info, Common::UUID uid, u64 application_id); + Result GetOlscServiceForSystemService( + Out> out_interface); +}; + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/remote_storage_controller.cpp b/src/core/hle/service/olsc/remote_storage_controller.cpp index 1e7825da30..817097b426 100644 --- a/src/core/hle/service/olsc/remote_storage_controller.cpp +++ b/src/core/hle/service/olsc/remote_storage_controller.cpp @@ -9,44 +9,44 @@ namespace Service::OLSC { - std::optional IRemoteStorageController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetSaveDataArchiveInfoBySaveDataId"}, - FunctionInfo{1, nullptr, "GetSaveDataArchiveInfoByApplicationId"}, - FunctionInfo{3, nullptr, "GetSaveDataArchiveCount"}, - FunctionInfo{6, nullptr, "CleanupSaveDataArchives"}, - FunctionInfo{7, nullptr, "CreateSaveDataArchiveCacheUpdationTask"}, - FunctionInfo{8, nullptr, "CreateSaveDataArchiveCacheUpdationForSpecifiedApplicationTask"}, - FunctionInfo{9, nullptr, "Delete"}, - FunctionInfo{10, nullptr, "GetSeriesInfo"}, - FunctionInfo{11, nullptr, "CreateDeleteDataTask"}, - FunctionInfo{12, nullptr, "DeleteSeriesInfo"}, - FunctionInfo{13, nullptr, "CreateRegisterNotificationTokenTask"}, - FunctionInfo{14, D<&IRemoteStorageController::GetDataNewnessByApplicationId>, "GetDataNewnessByApplicationId"}, - FunctionInfo{15, nullptr, "RegisterUploadSaveDataTransferTaskForAutonomyRegistration"}, - FunctionInfo{16, nullptr, "CreateCleanupToDeleteSaveDataArchiveInfoTask"}, - FunctionInfo{17, nullptr, "ListDataInfo"}, - FunctionInfo{18, D<&IRemoteStorageController::GetDataInfo>, "GetDataInfoV1"}, - FunctionInfo{19, nullptr, "GetDataInfoCacheUpdateNativeHandleHolder"}, - FunctionInfo{20, nullptr, "CreateSaveDataArchiveInfoCacheForSaveDataBackupUpdationTask"}, - FunctionInfo{21, nullptr, "ListSecondarySaves"}, - FunctionInfo{22, D<&IRemoteStorageController::GetSecondarySave>, "GetSecondarySave"}, - FunctionInfo{23, nullptr, "TouchSecondarySave"}, - FunctionInfo{24, nullptr, "GetSecondarySaveDataInfo"}, - FunctionInfo{25, nullptr, "RegisterDownloadSaveDataTransferTaskForAutonomyRegistration"}, - FunctionInfo{26, nullptr, "Unknown26", MakeVersionGate({20,0,0})}, - FunctionInfo{27, D<&IRemoteStorageController::GetDataInfo>, "GetDataInfoV2", MakeVersionGate({20,0,0})}, - FunctionInfo{28, nullptr, "Unknown28", MakeVersionGate({20,0,0})}, - FunctionInfo{29, nullptr, "Unknown29", MakeVersionGate({21,0,0})}, - FunctionInfo{800, nullptr, "Unknown800", MakeVersionGate({20,0,0})}, - FunctionInfo{900, nullptr, "SetLoadedDataMissing"}, - FunctionInfo{901, nullptr, "Unknown901", MakeVersionGate({20,2,0})} - ); - return HandlerTableGenerateWithFind(key, functions); - } - IRemoteStorageController::IRemoteStorageController(Core::System& system_) : ServiceFramework{system_, "IRemoteStorageController"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetSaveDataArchiveInfoBySaveDataId"}, + {1, nullptr, "GetSaveDataArchiveInfoByApplicationId"}, + {3, nullptr, "GetSaveDataArchiveCount"}, + {6, nullptr, "CleanupSaveDataArchives"}, + {7, nullptr, "CreateSaveDataArchiveCacheUpdationTask"}, + {8, nullptr, "CreateSaveDataArchiveCacheUpdationForSpecifiedApplicationTask"}, + {9, nullptr, "Delete"}, + {10, nullptr, "GetSeriesInfo"}, + {11, nullptr, "CreateDeleteDataTask"}, + {12, nullptr, "DeleteSeriesInfo"}, + {13, nullptr, "CreateRegisterNotificationTokenTask"}, + {14, D<&IRemoteStorageController::GetDataNewnessByApplicationId>, "GetDataNewnessByApplicationId"}, + {15, nullptr, "RegisterUploadSaveDataTransferTaskForAutonomyRegistration"}, + {16, nullptr, "CreateCleanupToDeleteSaveDataArchiveInfoTask"}, + {17, nullptr, "ListDataInfo"}, + {18, D<&IRemoteStorageController::GetDataInfo>, "GetDataInfoV1"}, + {19, nullptr, "GetDataInfoCacheUpdateNativeHandleHolder"}, + {20, nullptr, "CreateSaveDataArchiveInfoCacheForSaveDataBackupUpdationTask"}, + {21, nullptr, "ListSecondarySaves"}, + {22, D<&IRemoteStorageController::GetSecondarySave>, "GetSecondarySave"}, + {23, nullptr, "TouchSecondarySave"}, + {24, nullptr, "GetSecondarySaveDataInfo"}, + {25, nullptr, "RegisterDownloadSaveDataTransferTaskForAutonomyRegistration"}, + {26, nullptr, "Unknown26"}, //20.0.0+ + {27, D<&IRemoteStorageController::GetDataInfo>, "GetDataInfoV2"}, //20.0.0+ + {28, nullptr, "Unknown28"}, //20.0.0+ + {29, nullptr, "Unknown29"}, //21.0.0+ + {800, nullptr, "Unknown800"}, //20.0.0+ + {900, nullptr, "SetLoadedDataMissing"}, + {901, nullptr, "Unknown901"}, //20.2.0+ + }; + // clang-format on + + RegisterHandlers(functions); } IRemoteStorageController::~IRemoteStorageController() = default; diff --git a/src/core/hle/service/olsc/remote_storage_controller.h b/src/core/hle/service/olsc/remote_storage_controller.h index 20503d9800..21b439013a 100644 --- a/src/core/hle/service/olsc/remote_storage_controller.h +++ b/src/core/hle/service/olsc/remote_storage_controller.h @@ -21,8 +21,6 @@ private: u64 application_id); Result GetDataNewnessByApplicationId(Out out_newness, u64 application_id); Result GetDataInfo(Out> out_data, u64 application_id); - - std::optional FindRequest(u32 key) override; }; } // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/transfer_task_list_controller.cpp b/src/core/hle/service/olsc/transfer_task_list_controller.cpp index af090fc292..95e41cdb51 100644 --- a/src/core/hle/service/olsc/transfer_task_list_controller.cpp +++ b/src/core/hle/service/olsc/transfer_task_list_controller.cpp @@ -11,45 +11,45 @@ namespace Service::OLSC { - std::optional ITransferTaskListController::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetTransferTaskCountForOcean"}, - FunctionInfo{1, nullptr, "GetTransferTaskInfoForOcean"}, - FunctionInfo{2, nullptr, "ListTransferTaskInfoForOcean"}, - FunctionInfo{3, nullptr, "DeleteTransferTaskForOcean"}, - FunctionInfo{4, nullptr, "RaiseTransferTaskPriorityForOcean"}, - FunctionInfo{5, D<&ITransferTaskListController::GetTransferTaskEndEventNativeHandleHolder>, "GetTransferTaskEndEventNativeHandleHolder"}, - FunctionInfo{6, nullptr, "GetTransferTaskProgressForOcean"}, - FunctionInfo{7, nullptr, "GetTransferTaskLastResultForOcean"}, - FunctionInfo{8, D<&ITransferTaskListController::StopNextTransferTaskExecution>, "StopNextTransferTaskExecution"}, - FunctionInfo{9, D<&ITransferTaskListController::GetTransferTaskStartEventNativeHandleHolder>, "GetTransferTaskStartEventNativeHandleHolder"}, - FunctionInfo{10, nullptr, "SuspendTransferTaskForOcean"}, - FunctionInfo{11, nullptr, "GetCurrentTransferTaskInfoForOcean"}, - FunctionInfo{12, nullptr, "FindTransferTaskInfoForOcean"}, - FunctionInfo{13, nullptr, "CancelCurrentRepairTransferTask"}, - FunctionInfo{14, nullptr, "GetRepairTransferTaskProgress"}, - FunctionInfo{15, nullptr, "EnsureExecutableForRepairTransferTask"}, - FunctionInfo{16, D<&ITransferTaskListController::GetTransferTaskCount>, "GetTransferTaskCount"}, - FunctionInfo{17, nullptr, "GetTransferTaskInfo"}, - FunctionInfo{18, nullptr, "ListTransferTaskInfo"}, - FunctionInfo{19, nullptr, "DeleteTransferTask"}, - FunctionInfo{20, nullptr, "RaiseTransferTaskPriority"}, - FunctionInfo{21, D<&ITransferTaskListController::GetTransferTaskProgress>, "GetTransferTaskProgress", MakeVersionGate({10,1,0})}, - FunctionInfo{22, nullptr, "GetTransferTaskLastResult"}, - FunctionInfo{23, nullptr, "SuspendTransferTask"}, - FunctionInfo{24, D<&ITransferTaskListController::GetCurrentTransferTaskInfo>, "GetCurrentTransferTaskInfo"}, - FunctionInfo{25, D<&ITransferTaskListController::FindTransferTaskInfo>, "FindTransferTaskInfo"}, - FunctionInfo{26, nullptr, "Unknown26", MakeVersionGate({20,1,0})}, - FunctionInfo{27, nullptr, "Unknown27", MakeVersionGate({20,1,0})}, - FunctionInfo{28, nullptr, "Unknown28", MakeVersionGate({20,1,0})}, - FunctionInfo{29, nullptr, "Unknown29", MakeVersionGate({20,1,0})}, - FunctionInfo{30, nullptr, "Unknown30", MakeVersionGate({20,1,0})} - ); - return HandlerTableGenerateWithFind(key, functions); - } - ITransferTaskListController::ITransferTaskListController(Core::System& system_) : ServiceFramework{system_, "ITransferTaskListController"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetTransferTaskCountForOcean"}, + {1, nullptr, "GetTransferTaskInfoForOcean"}, + {2, nullptr, "ListTransferTaskInfoForOcean"}, + {3, nullptr, "DeleteTransferTaskForOcean"}, + {4, nullptr, "RaiseTransferTaskPriorityForOcean"}, + {5, D<&ITransferTaskListController::GetTransferTaskEndEventNativeHandleHolder>, "GetTransferTaskEndEventNativeHandleHolder"}, + {6, nullptr, "GetTransferTaskProgressForOcean"}, + {7, nullptr, "GetTransferTaskLastResultForOcean"}, + {8, D<&ITransferTaskListController::StopNextTransferTaskExecution>, "StopNextTransferTaskExecution"}, + {9, D<&ITransferTaskListController::GetTransferTaskStartEventNativeHandleHolder>, "GetTransferTaskStartEventNativeHandleHolder"}, + {10, nullptr, "SuspendTransferTaskForOcean"}, + {11, nullptr, "GetCurrentTransferTaskInfoForOcean"}, + {12, nullptr, "FindTransferTaskInfoForOcean"}, + {13, nullptr, "CancelCurrentRepairTransferTask"}, + {14, nullptr, "GetRepairTransferTaskProgress"}, + {15, nullptr, "EnsureExecutableForRepairTransferTask"}, + {16, D<&ITransferTaskListController::GetTransferTaskCount>, "GetTransferTaskCount"}, + {17, nullptr, "GetTransferTaskInfo"}, + {18, nullptr, "ListTransferTaskInfo"}, + {19, nullptr, "DeleteTransferTask"}, + {20, nullptr, "RaiseTransferTaskPriority"}, + {21, D<&ITransferTaskListController::GetTransferTaskProgress>, "GetTransferTaskProgress"}, //10.1.0+ + {22, nullptr, "GetTransferTaskLastResult"}, + {23, nullptr, "SuspendTransferTask"}, + {24, D<&ITransferTaskListController::GetCurrentTransferTaskInfo>, "GetCurrentTransferTaskInfo"}, + {25, D<&ITransferTaskListController::FindTransferTaskInfo>, "FindTransferTaskInfo"}, + {26, nullptr, "Unknown26"}, //20.1.0+ + {27, nullptr, "Unknown27"}, //20.1.0+ + {28, nullptr, "Unknown28"}, //20.1.0+ + {29, nullptr, "Unknown29"}, //20.1.0+ + {30, nullptr, "Unknown30"}, //20.1.0+ + }; + // clang-format on + + RegisterHandlers(functions); } ITransferTaskListController::~ITransferTaskListController() = default; diff --git a/src/core/hle/service/olsc/transfer_task_list_controller.h b/src/core/hle/service/olsc/transfer_task_list_controller.h index 74c5eddee3..5f3429879a 100644 --- a/src/core/hle/service/olsc/transfer_task_list_controller.h +++ b/src/core/hle/service/olsc/transfer_task_list_controller.h @@ -27,8 +27,6 @@ private: Result GetTransferTaskProgress(); Result GetCurrentTransferTaskInfo(Out> out_info, u8 unknown); Result FindTransferTaskInfo(Out> out_info, InBuffer in); - - std::optional FindRequest(u32 key) override; }; } // namespace Service::OLSC diff --git a/src/core/hle/service/omm/omm.cpp b/src/core/hle/service/omm/omm.cpp index b95319e26b..cc0b686ab1 100644 --- a/src/core/hle/service/omm/omm.cpp +++ b/src/core/hle/service/omm/omm.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/omm/omm.h b/src/core/hle/service/omm/omm.h index 7bf04688ae..6b100a6d61 100644 --- a/src/core/hle/service/omm/omm.h +++ b/src/core/hle/service/omm/omm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/omm/operation_mode_manager.cpp b/src/core/hle/service/omm/operation_mode_manager.cpp index e36f606442..1af7714d0d 100644 --- a/src/core/hle/service/omm/operation_mode_manager.cpp +++ b/src/core/hle/service/omm/operation_mode_manager.cpp @@ -10,6 +10,41 @@ namespace Service::OMM { IOperationModeManager::IOperationModeManager(Core::System& system_) : ServiceFramework{system_, "omm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetOperationMode"}, + {1, nullptr, "GetOperationModeChangeEvent"}, + {2, nullptr, "EnableAudioVisual"}, + {3, nullptr, "DisableAudioVisual"}, + {4, nullptr, "EnterSleepAndWait"}, + {5, nullptr, "GetCradleStatus"}, + {6, nullptr, "FadeInDisplay"}, + {7, nullptr, "FadeOutDisplay"}, + {8, nullptr, "GetCradleFwVersion"}, + {9, nullptr, "NotifyCecSettingsChanged"}, + {10, nullptr, "SetOperationModePolicy"}, + {11, nullptr, "GetDefaultDisplayResolution"}, + {12, nullptr, "GetDefaultDisplayResolutionChangeEvent"}, + {13, nullptr, "UpdateDefaultDisplayResolution"}, + {14, nullptr, "ShouldSleepOnBoot"}, + {15, nullptr, "NotifyHdcpApplicationExecutionStarted"}, + {16, nullptr, "NotifyHdcpApplicationExecutionFinished"}, + {17, nullptr, "NotifyHdcpApplicationDrawingStarted"}, + {18, nullptr, "NotifyHdcpApplicationDrawingFinished"}, + {19, nullptr, "GetHdcpAuthenticationFailedEvent"}, + {20, nullptr, "GetHdcpAuthenticationFailedEmulationEnabled"}, + {21, nullptr, "SetHdcpAuthenticationFailedEmulation"}, + {22, nullptr, "GetHdcpStateChangeEvent"}, + {23, nullptr, "GetHdcpState"}, + {24, nullptr, "ShowCardUpdateProcessing"}, + {25, nullptr, "SetApplicationCecSettingsAndNotifyChanged"}, + {26, nullptr, "GetOperationModeSystemInfo"}, + {27, nullptr, "GetAppletFullAwakingSystemEvent"}, + {28, nullptr, "CreateCradleFirmwareUpdater"}, + }; + // clang-format on + + RegisterHandlers(functions); } IOperationModeManager::~IOperationModeManager() = default; diff --git a/src/core/hle/service/omm/operation_mode_manager.h b/src/core/hle/service/omm/operation_mode_manager.h index ea604c8f60..dd6753757c 100644 --- a/src/core/hle/service/omm/operation_mode_manager.h +++ b/src/core/hle/service/omm/operation_mode_manager.h @@ -18,41 +18,6 @@ class IOperationModeManager final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetOperationMode"}, - FunctionInfo{1, nullptr, "GetOperationModeChangeEvent"}, - FunctionInfo{2, nullptr, "EnableAudioVisual"}, - FunctionInfo{3, nullptr, "DisableAudioVisual"}, - FunctionInfo{4, nullptr, "EnterSleepAndWait"}, - FunctionInfo{5, nullptr, "GetCradleStatus"}, - FunctionInfo{6, nullptr, "FadeInDisplay"}, - FunctionInfo{7, nullptr, "FadeOutDisplay"}, - FunctionInfo{8, nullptr, "GetCradleFwVersion"}, - FunctionInfo{9, nullptr, "NotifyCecSettingsChanged"}, - FunctionInfo{10, nullptr, "SetOperationModePolicy"}, - FunctionInfo{11, nullptr, "GetDefaultDisplayResolution"}, - FunctionInfo{12, nullptr, "GetDefaultDisplayResolutionChangeEvent"}, - FunctionInfo{13, nullptr, "UpdateDefaultDisplayResolution"}, - FunctionInfo{14, nullptr, "ShouldSleepOnBoot"}, - FunctionInfo{15, nullptr, "NotifyHdcpApplicationExecutionStarted"}, - FunctionInfo{16, nullptr, "NotifyHdcpApplicationExecutionFinished"}, - FunctionInfo{17, nullptr, "NotifyHdcpApplicationDrawingStarted"}, - FunctionInfo{18, nullptr, "NotifyHdcpApplicationDrawingFinished"}, - FunctionInfo{19, nullptr, "GetHdcpAuthenticationFailedEvent"}, - FunctionInfo{20, nullptr, "GetHdcpAuthenticationFailedEmulationEnabled"}, - FunctionInfo{21, nullptr, "SetHdcpAuthenticationFailedEmulation"}, - FunctionInfo{22, nullptr, "GetHdcpStateChangeEvent"}, - FunctionInfo{23, nullptr, "GetHdcpState"}, - FunctionInfo{24, nullptr, "ShowCardUpdateProcessing"}, - FunctionInfo{25, nullptr, "SetApplicationCecSettingsAndNotifyChanged"}, - FunctionInfo{26, nullptr, "GetOperationModeSystemInfo"}, - FunctionInfo{27, nullptr, "GetAppletFullAwakingSystemEvent"}, - FunctionInfo{28, nullptr, "CreateCradleFirmwareUpdater"} - ); }; } // namespace Service::OMM diff --git a/src/core/hle/service/omm/policy_manager_system.cpp b/src/core/hle/service/omm/policy_manager_system.cpp index 1d46de7f3e..b9e8277f8c 100644 --- a/src/core/hle/service/omm/policy_manager_system.cpp +++ b/src/core/hle/service/omm/policy_manager_system.cpp @@ -10,6 +10,18 @@ namespace Service::OMM { IPolicyManagerSystem::IPolicyManagerSystem(Core::System& system_) : ServiceFramework{system_, "idle:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetAutoPowerDownEvent"}, + {1, nullptr, "IsAutoPowerDownRequested"}, + {2, nullptr, "Unknown2"}, + {3, nullptr, "SetHandlingContext"}, + {4, nullptr, "LoadAndApplySettings"}, + {5, nullptr, "ReportUserIsActive"}, + }; + // clang-format on + + RegisterHandlers(functions); } IPolicyManagerSystem::~IPolicyManagerSystem() = default; diff --git a/src/core/hle/service/omm/policy_manager_system.h b/src/core/hle/service/omm/policy_manager_system.h index c6ff451e61..2fb6eb9293 100644 --- a/src/core/hle/service/omm/policy_manager_system.h +++ b/src/core/hle/service/omm/policy_manager_system.h @@ -18,18 +18,6 @@ class IPolicyManagerSystem final : public ServiceFramework public: explicit IPolicyManagerSystem(Core::System& system_); ~IPolicyManagerSystem() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetAutoPowerDownEvent"}, - FunctionInfo{1, nullptr, "IsAutoPowerDownRequested"}, - FunctionInfo{2, nullptr, "Unknown2"}, - FunctionInfo{3, nullptr, "SetHandlingContext"}, - FunctionInfo{4, nullptr, "LoadAndApplySettings"}, - FunctionInfo{5, nullptr, "ReportUserIsActive"} - ); }; } // namespace Service::OMM diff --git a/src/core/hle/service/omm/power_state_interface.cpp b/src/core/hle/service/omm/power_state_interface.cpp index 4150882695..04ea75b496 100644 --- a/src/core/hle/service/omm/power_state_interface.cpp +++ b/src/core/hle/service/omm/power_state_interface.cpp @@ -10,6 +10,24 @@ namespace Service::OMM { IPowerStateInterface::IPowerStateInterface(Core::System& system_) : ServiceFramework{system_, "spsm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetState"}, + {1, nullptr, "EnterSleep"}, + {2, nullptr, "GetLastWakeReason"}, + {3, nullptr, "Shutdown"}, + {4, nullptr, "GetNotificationMessageEventHandle"}, + {5, nullptr, "ReceiveNotificationMessage"}, + {6, nullptr, "AnalyzeLogForLastSleepWakeSequence"}, + {7, nullptr, "ResetEventLog"}, + {8, nullptr, "AnalyzePerformanceLogForLastSleepWakeSequence"}, + {9, nullptr, "ChangeHomeButtonLongPressingTime"}, + {10, nullptr, "PutErrorState"}, + {11, nullptr, "InvalidateCurrentHomeButtonPressing"}, + }; + // clang-format on + + RegisterHandlers(functions); } IPowerStateInterface::~IPowerStateInterface() = default; diff --git a/src/core/hle/service/omm/power_state_interface.h b/src/core/hle/service/omm/power_state_interface.h index fed55a4361..dc1d376a13 100644 --- a/src/core/hle/service/omm/power_state_interface.h +++ b/src/core/hle/service/omm/power_state_interface.h @@ -18,24 +18,6 @@ class IPowerStateInterface final : public ServiceFramework public: explicit IPowerStateInterface(Core::System& system_); ~IPowerStateInterface() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetState"}, - FunctionInfo{1, nullptr, "EnterSleep"}, - FunctionInfo{2, nullptr, "GetLastWakeReason"}, - FunctionInfo{3, nullptr, "Shutdown"}, - FunctionInfo{4, nullptr, "GetNotificationMessageEventHandle"}, - FunctionInfo{5, nullptr, "ReceiveNotificationMessage"}, - FunctionInfo{6, nullptr, "AnalyzeLogForLastSleepWakeSequence"}, - FunctionInfo{7, nullptr, "ResetEventLog"}, - FunctionInfo{8, nullptr, "AnalyzePerformanceLogForLastSleepWakeSequence"}, - FunctionInfo{9, nullptr, "ChangeHomeButtonLongPressingTime"}, - FunctionInfo{10, nullptr, "PutErrorState"}, - FunctionInfo{11, nullptr, "InvalidateCurrentHomeButtonPressing"} - ); }; } // namespace Service::OMM diff --git a/src/core/hle/service/os/multi_wait.cpp b/src/core/hle/service/os/multi_wait.cpp index 7b80d28bed..c9bb256ab0 100644 --- a/src/core/hle/service/os/multi_wait.cpp +++ b/src/core/hle/service/os/multi_wait.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/os/multi_wait.h b/src/core/hle/service/os/multi_wait.h index 340c611b5b..c9076c21d7 100644 --- a/src/core/hle/service/os/multi_wait.h +++ b/src/core/hle/service/os/multi_wait.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/os/multi_wait_holder.cpp b/src/core/hle/service/os/multi_wait_holder.cpp index 01efa045b5..f3864218c9 100644 --- a/src/core/hle/service/os/multi_wait_holder.cpp +++ b/src/core/hle/service/os/multi_wait_holder.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/os/multi_wait_holder.h b/src/core/hle/service/os/multi_wait_holder.h index 646395a3f3..3b28ec6b5a 100644 --- a/src/core/hle/service/os/multi_wait_holder.h +++ b/src/core/hle/service/os/multi_wait_holder.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/os/multi_wait_utils.h b/src/core/hle/service/os/multi_wait_utils.h index 96d3a10f37..d8f3ade4c1 100644 --- a/src/core/hle/service/os/multi_wait_utils.h +++ b/src/core/hle/service/os/multi_wait_utils.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/os/mutex.h b/src/core/hle/service/os/mutex.h index 95ac9b117a..8e29bbb633 100644 --- a/src/core/hle/service/os/mutex.h +++ b/src/core/hle/service/os/mutex.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/pcie/pcie.cpp b/src/core/hle/service/pcie/pcie.cpp index f9aaa2d3b8..d162881ecf 100644 --- a/src/core/hle/service/pcie/pcie.cpp +++ b/src/core/hle/service/pcie/pcie.cpp @@ -15,62 +15,64 @@ namespace Service::PCIe { class ISession final : public ServiceFramework { public: - explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} {} + explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "QueryFunctions"}, + {1, nullptr, "AcquireFunction"}, + {2, nullptr, "ReleaseFunction"}, + {3, nullptr, "GetFunctionState"}, + {4, nullptr, "GetBarProfile"}, + {5, nullptr, "ReadConfig"}, + {6, nullptr, "WriteConfig"}, + {7, nullptr, "ReadBarRegion"}, + {8, nullptr, "WriteBarRegion"}, + {9, nullptr, "FindCapability"}, + {10, nullptr, "FindExtendedCapability"}, + {11, nullptr, "MapDma"}, + {12, nullptr, "UnmapDma"}, + {13, nullptr, "UnmapDmaBusAddress"}, + {14, nullptr, "GetDmaBusAddress"}, + {15, nullptr, "GetDmaBusAddressRange"}, + {16, nullptr, "SetDmaEnable"}, + {17, nullptr, "AcquireIrq"}, + {18, nullptr, "ReleaseIrq"}, + {19, nullptr, "SetIrqEnable"}, + {20, nullptr, "GetIrqEvent"}, + {21, nullptr, "SetAspmEnable"}, + {22, nullptr, "SetResetUponResumeEnable"}, + {23, nullptr, "ResetFunction"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "QueryFunctions"}, - FunctionInfo{1, nullptr, "AcquireFunction"}, - FunctionInfo{2, nullptr, "ReleaseFunction"}, - FunctionInfo{3, nullptr, "GetFunctionState"}, - FunctionInfo{4, nullptr, "GetBarProfile"}, - FunctionInfo{5, nullptr, "ReadConfig"}, - FunctionInfo{6, nullptr, "WriteConfig"}, - FunctionInfo{7, nullptr, "ReadBarRegion"}, - FunctionInfo{8, nullptr, "WriteBarRegion"}, - FunctionInfo{9, nullptr, "FindCapability"}, - FunctionInfo{10, nullptr, "FindExtendedCapability"}, - FunctionInfo{11, nullptr, "MapDma"}, - FunctionInfo{12, nullptr, "UnmapDma"}, - FunctionInfo{13, nullptr, "UnmapDmaBusAddress"}, - FunctionInfo{14, nullptr, "GetDmaBusAddress"}, - FunctionInfo{15, nullptr, "GetDmaBusAddressRange"}, - FunctionInfo{16, nullptr, "SetDmaEnable"}, - FunctionInfo{17, nullptr, "AcquireIrq"}, - FunctionInfo{18, nullptr, "ReleaseIrq"}, - FunctionInfo{19, nullptr, "SetIrqEnable"}, - FunctionInfo{20, nullptr, "GetIrqEvent"}, - FunctionInfo{21, nullptr, "SetAspmEnable"}, - FunctionInfo{22, nullptr, "SetResetUponResumeEnable"}, - FunctionInfo{23, nullptr, "ResetFunction"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class PCIE final : public ServiceFramework { public: - explicit PCIE(Core::System& system_) : ServiceFramework{system_, "pcie"} {} + explicit PCIE(Core::System& system_) : ServiceFramework{system_, "pcie"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RegisterClassDriver"}, + {1, nullptr, "QueryFunctionsUnregistered"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RegisterClassDriver"}, - FunctionInfo{1, nullptr, "QueryFunctionsUnregistered"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class PCIE_LOG final : public ServiceFramework { public: - explicit PCIE_LOG(Core::System& system_) : ServiceFramework{system_, "pcie:log"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetLoggedState"}, - FunctionInfo{1, nullptr, "GetLoggedStateEvent"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit PCIE_LOG(Core::System& system_) : ServiceFramework{system_, "pcie:log"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetLoggedState"}, + {1, nullptr, "GetLoggedStateEvent"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/pcie/pcie.h b/src/core/hle/service/pcie/pcie.h index 5c2d4b805b..cf2048ce65 100644 --- a/src/core/hle/service/pcie/pcie.h +++ b/src/core/hle/service/pcie/pcie.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/pctl/parental_control_service.cpp b/src/core/hle/service/pctl/parental_control_service.cpp new file mode 100644 index 0000000000..51953c2657 --- /dev/null +++ b/src/core/hle/service/pctl/parental_control_service.cpp @@ -0,0 +1,498 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +#include "core/core.h" +#include "core/file_sys/control_metadata.h" +#include "core/file_sys/patch_manager.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/pctl/parental_control_service.h" +#include "core/hle/service/pctl/pctl_results.h" + +namespace Service::PCTL { + +IParentalControlService::IParentalControlService(Core::System& system_, Capability capability_, + u64 program_id_) + : ServiceFramework{system_, "IParentalControlService"}, capability{capability_}, + program_id{program_id_}, + service_context{system_, "IParentalControlService"}, synchronization_event{service_context}, + unlinked_event{service_context}, request_suspension_event{service_context} { + // clang-format off + static const FunctionInfo functions[] = { + {1, D<&IParentalControlService::Initialize>, "Initialize"}, + {1001, D<&IParentalControlService::CheckFreeCommunicationPermission>, "CheckFreeCommunicationPermission"}, + {1002, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"}, + {1003, D<&IParentalControlService::ConfirmResumeApplicationPermission>, "ConfirmResumeApplicationPermission"}, + {1004, D<&IParentalControlService::ConfirmSnsPostPermission>, "ConfirmSnsPostPermission"}, + {1005, D<&IParentalControlService::ConfirmSystemSettingsPermission>, "ConfirmSystemSettingsPermission"}, + {1006, D<&IParentalControlService::IsRestrictionTemporaryUnlocked>, "IsRestrictionTemporaryUnlocked"}, + {1007, nullptr, "RevertRestrictionTemporaryUnlocked"}, + {1008, nullptr, "EnterRestrictedSystemSettings"}, + {1009, nullptr, "LeaveRestrictedSystemSettings"}, + {1010, D<&IParentalControlService::IsRestrictedSystemSettingsEntered>, "IsRestrictedSystemSettingsEntered"}, + {1011, nullptr, "RevertRestrictedSystemSettingsEntered"}, + {1012, nullptr, "GetRestrictedFeatures"}, + {1013, D<&IParentalControlService::ConfirmStereoVisionPermission>, "ConfirmStereoVisionPermission"}, + {1014, nullptr, "ConfirmPlayableApplicationVideoOld"}, + {1015, nullptr, "ConfirmPlayableApplicationVideo"}, + {1016, nullptr, "ConfirmShowNewsPermission"}, + {1017, D<&IParentalControlService::EndFreeCommunication>, "EndFreeCommunication"}, + {1018, D<&IParentalControlService::IsFreeCommunicationAvailable>, "IsFreeCommunicationAvailable"}, + {1019, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"}, + {1020, nullptr, "ConfirmLaunchSharedApplicationPermission"}, //20.0.0+ + {1021, nullptr, "TryBeginFreeCommunicationForStreamPlay"}, //21.0.0+ + {1022, nullptr, "EndFreeCommunicationForStreamPlay"}, //21.0.0+ + {1031, D<&IParentalControlService::IsRestrictionEnabled>, "IsRestrictionEnabled"}, + {1032, D<&IParentalControlService::GetSafetyLevel>, "GetSafetyLevel"}, + {1033, nullptr, "SetSafetyLevel"}, + {1034, nullptr, "GetSafetyLevelSettings"}, + {1035, D<&IParentalControlService::GetCurrentSettings>, "GetCurrentSettings"}, + {1036, nullptr, "SetCustomSafetyLevelSettings"}, + {1037, nullptr, "GetDefaultRatingOrganization"}, + {1038, nullptr, "SetDefaultRatingOrganization"}, + {1039, D<&IParentalControlService::GetFreeCommunicationApplicationListCount>, "GetFreeCommunicationApplicationListCount"}, + {1042, nullptr, "AddToFreeCommunicationApplicationList"}, + {1043, nullptr, "DeleteSettings"}, + {1044, nullptr, "GetFreeCommunicationApplicationList"}, + {1045, nullptr, "UpdateFreeCommunicationApplicationList"}, + {1046, nullptr, "DisableFeaturesForReset"}, + {1047, nullptr, "NotifyApplicationDownloadStarted"}, + {1048, nullptr, "NotifyNetworkProfileCreated"}, + {1049, nullptr, "ResetFreeCommunicationApplicationList"}, + {1050, nullptr, "AddToFreeCommunicationApplicationList"}, //20.0.0+ + {1051, nullptr, "NotifyApplicationDownloadStarted"}, //20.0.0+ + {1061, D<&IParentalControlService::ConfirmStereoVisionRestrictionConfigurable>, "ConfirmStereoVisionRestrictionConfigurable"}, + {1062, D<&IParentalControlService::GetStereoVisionRestriction>, "GetStereoVisionRestriction"}, + {1063, D<&IParentalControlService::SetStereoVisionRestriction>, "SetStereoVisionRestriction"}, + {1064, D<&IParentalControlService::ResetConfirmedStereoVisionPermission>, "ResetConfirmedStereoVisionPermission"}, + {1065, D<&IParentalControlService::IsStereoVisionPermitted>, "IsStereoVisionPermitted"}, + {1201, nullptr, "UnlockRestrictionTemporarily"}, + {1202, nullptr, "UnlockSystemSettingsRestriction"}, + {1203, nullptr, "SetPinCode"}, + {1204, nullptr, "GenerateInquiryCode"}, + {1205, nullptr, "CheckMasterKey"}, + {1206, D<&IParentalControlService::GetPinCodeLength>, "GetPinCodeLength"}, + {1207, nullptr, "GetPinCodeChangedEvent"}, + {1208, nullptr, "GetPinCode"}, + {1403, D<&IParentalControlService::IsPairingActive>, "IsPairingActive"}, + {1406, nullptr, "GetSettingsLastUpdated"}, + {1411, nullptr, "GetPairingAccountInfo"}, + {1421, nullptr, "GetAccountNickname"}, + {1424, nullptr, "GetAccountState"}, + {1425, nullptr, "RequestPostEvents"}, + {1426, nullptr, "GetPostEventInterval"}, + {1427, nullptr, "SetPostEventInterval"}, + {1432, D<&IParentalControlService::GetSynchronizationEvent>, "GetSynchronizationEvent"}, + {1451, D<&IParentalControlService::StartPlayTimer>, "StartPlayTimer"}, + {1452, D<&IParentalControlService::StopPlayTimer>, "StopPlayTimer"}, + {1453, D<&IParentalControlService::IsPlayTimerEnabled>, "IsPlayTimerEnabled"}, + {1454, D<&IParentalControlService::GetPlayTimerRemainingTime>, "GetPlayTimerRemainingTime"}, + {1455, D<&IParentalControlService::IsRestrictedByPlayTimer>, "IsRestrictedByPlayTimer"}, + {1456, D<&IParentalControlService::GetPlayTimerSettingsOld>, "GetPlayTimerSettingsOld"}, + {1457, D<&IParentalControlService::GetPlayTimerEventToRequestSuspension>, "GetPlayTimerEventToRequestSuspension"}, + {1458, D<&IParentalControlService::IsPlayTimerAlarmDisabled>, "IsPlayTimerAlarmDisabled"}, + {1459, D<&IParentalControlService::GetPlayTimerRemainingTimeDisplayInfo>, "GetPlayTimerRemainingTimeDisplayInfo"}, + {1460, D<&IParentalControlService::Unknown1460>, "Unknown1460"}, + {1471, nullptr, "NotifyWrongPinCodeInputManyTimes"}, + {1472, nullptr, "CancelNetworkRequest"}, + {1473, D<&IParentalControlService::GetUnlinkedEvent>, "GetUnlinkedEvent"}, + {1474, nullptr, "ClearUnlinkedEvent"}, + {1475, nullptr, "GetExtendedPlayTimerEvent"}, // 18.0.0+ + {1601, nullptr, "DisableAllFeatures"}, + {1602, nullptr, "PostEnableAllFeatures"}, + {1603, nullptr, "IsAllFeaturesDisabled"}, + {1901, nullptr, "DeleteFromFreeCommunicationApplicationListForDebug"}, + {1902, nullptr, "ClearFreeCommunicationApplicationListForDebug"}, + {1903, nullptr, "GetExemptApplicationListCountForDebug"}, + {1904, nullptr, "GetExemptApplicationListForDebug"}, + {1905, nullptr, "UpdateExemptApplicationListForDebug"}, + {1906, nullptr, "AddToExemptApplicationListForDebug"}, + {1907, nullptr, "DeleteFromExemptApplicationListForDebug"}, + {1908, nullptr, "ClearExemptApplicationListForDebug"}, + {1941, nullptr, "DeletePairing"}, + {1951, nullptr, "SetPlayTimerSettingsForDebug"}, + {1952, nullptr, "GetPlayTimerSpentTimeForTest"}, + {1953, nullptr, "SetPlayTimerAlarmDisabledForDebug"}, + {1954, nullptr, "IsBedtimeAlarmEnabled"}, // 18.0.0+ + {1955, nullptr, "GetBedtimeAlarmTime"}, // 18.0.0+ + {1956, nullptr, "GetBedtimeAlarmTimeHour"}, // 18.0.0+ + {1957, nullptr, "GetBedtimeAlarmTimeMinute"}, // 18.0.0+ + {2001, nullptr, "RequestPairingAsync"}, + {2002, nullptr, "FinishRequestPairing"}, + {2003, nullptr, "AuthorizePairingAsync"}, + {2004, nullptr, "FinishAuthorizePairing"}, + {2005, nullptr, "RetrievePairingInfoAsync"}, + {2006, nullptr, "FinishRetrievePairingInfo"}, + {2007, nullptr, "UnlinkPairingAsync"}, + {2008, nullptr, "FinishUnlinkPairing"}, + {2009, nullptr, "GetAccountMiiImageAsync"}, + {2010, nullptr, "FinishGetAccountMiiImage"}, + {2011, nullptr, "GetAccountMiiImageContentTypeAsync"}, + {2012, nullptr, "FinishGetAccountMiiImageContentType"}, + {2013, nullptr, "SynchronizeParentalControlSettingsAsync"}, + {2014, nullptr, "FinishSynchronizeParentalControlSettings"}, + {2015, nullptr, "FinishSynchronizeParentalControlSettingsWithLastUpdated"}, + {2016, nullptr, "RequestUpdateExemptionListAsync"}, //5.0.0+ + {145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings"}, // 18.0.0+ + {2017, nullptr, "AuthorizePairingAsync"}, //19.0.0+ + {2019, nullptr, "RequestUpdateDeviceUsersBackground"}, //19.0.0+ + {2021, nullptr, "RequestCopyPairingAsync"}, //20.0.0+ + {2022, nullptr, "FinishRequestCopyPairing"}, //20.0.0+ + {2023, nullptr, "IsFromPairingActiveDevice"}, //20.0.0+ + {2024, nullptr, "RollbackCopyPairing"}, //21.0.0+ + {3001, nullptr, "GetErrorContextChangedEvent"}, //20.0.0+ + {145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings"}, // 18.0.0+ + {195101, D<&IParentalControlService::SetPlayTimerSettings>, "SetPlayTimerSettingsForDebug"}, //18.0.0+ + }; + // clang-format on + RegisterHandlers(functions); +} + +IParentalControlService::~IParentalControlService() = default; + +bool IParentalControlService::CheckFreeCommunicationPermissionImpl() const { + if (states.temporary_unlocked) { + return true; + } + if ((states.application_info.parental_control_flag & 1) == 0) { + return true; + } + if (pin_code[0] == '\0') { + return true; + } + if (!settings.is_free_communication_default_on) { + return true; + } + // TODO(ogniK): Check for blacklisted/exempted applications. Return false can happen here + // but as we don't have multiproceses support yet, we can just assume our application is + // valid for the time being + return true; +} + +bool IParentalControlService::ConfirmStereoVisionPermissionImpl() const { + if (states.temporary_unlocked) { + return true; + } + if (pin_code[0] == '\0') { + return true; + } + if (!settings.is_stero_vision_restricted) { + return false; + } + return true; +} + +void IParentalControlService::SetStereoVisionRestrictionImpl(bool is_restricted) { + if (settings.disabled) { + return; + } + + if (pin_code[0] == '\0') { + return; + } + settings.is_stero_vision_restricted = is_restricted; +} + +Result IParentalControlService::Initialize() { + LOG_DEBUG(Service_PCTL, "called"); + + if (False(capability & (Capability::Application | Capability::System))) { + LOG_ERROR(Service_PCTL, "Invalid capability! capability={:X}", capability); + R_THROW(PCTL::ResultNoCapability); + } + + // TODO(ogniK): Recovery flag initialization for pctl:r + + if (program_id != 0) { + const FileSys::PatchManager pm{program_id, system.GetFileSystemController(), + system.GetContentProvider()}; + const auto control = pm.GetControlMetadata(); + if (control.first) { + states.tid_from_event = 0; + states.launch_time_valid = false; + states.is_suspended = false; + states.free_communication = false; + states.stereo_vision = false; + states.application_info = ApplicationInfo{ + .application_id = program_id, + .age_rating = control.first->GetRatingAge(), + .parental_control_flag = control.first->GetParentalControlFlag(), + .capability = capability, + }; + + if (False(capability & (Capability::System | Capability::Recovery))) { + // TODO(ogniK): Signal application launch event + } + } + } + + R_SUCCEED(); +} + +Result IParentalControlService::CheckFreeCommunicationPermission() { + LOG_DEBUG(Service_PCTL, "called"); + + if (!CheckFreeCommunicationPermissionImpl()) { + R_THROW(PCTL::ResultNoFreeCommunication); + } else { + states.free_communication = true; + R_SUCCEED(); + } +} + +Result IParentalControlService::ConfirmLaunchApplicationPermission( + InBuffer restriction_bitset, u64 nacp_flag, u64 application_id) { + LOG_WARNING(Service_PCTL, "(STUBBED) called, nacp_flag={:#x} application_id={:016X}", nacp_flag, + application_id); + R_SUCCEED(); +} + +Result IParentalControlService::ConfirmResumeApplicationPermission( + InBuffer restriction_bitset, u64 nacp_flag, u64 application_id) { + LOG_WARNING(Service_PCTL, "(STUBBED) called, nacp_flag={:#x} application_id={:016X}", nacp_flag, + application_id); + R_SUCCEED(); +} + +Result IParentalControlService::ConfirmSnsPostPermission() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_THROW(PCTL::ResultNoFreeCommunication); +} + +Result IParentalControlService::ConfirmSystemSettingsPermission() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_SUCCEED(); +} + +Result IParentalControlService::IsRestrictionTemporaryUnlocked( + Out out_is_temporary_unlocked) { + *out_is_temporary_unlocked = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, is_temporary_unlocked={}", + *out_is_temporary_unlocked); + R_SUCCEED(); +} + +Result IParentalControlService::IsRestrictedSystemSettingsEntered( + Out out_is_restricted_system_settings_entered) { + *out_is_restricted_system_settings_entered = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, is_temporary_unlocked={}", + *out_is_restricted_system_settings_entered); + R_SUCCEED(); +} + +Result IParentalControlService::ConfirmStereoVisionPermission() { + LOG_DEBUG(Service_PCTL, "called"); + states.stereo_vision = true; + R_SUCCEED(); +} + +Result IParentalControlService::EndFreeCommunication() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_SUCCEED(); +} + +Result IParentalControlService::IsFreeCommunicationAvailable() { + LOG_DEBUG(Service_PCTL, "(STUBBED) called"); + + if (!CheckFreeCommunicationPermissionImpl()) { + R_THROW(PCTL::ResultNoFreeCommunication); + } else { + R_SUCCEED(); + } +} + +Result IParentalControlService::IsRestrictionEnabled(Out out_restriction_enabled) { + LOG_DEBUG(Service_PCTL, "called"); + + if (False(capability & (Capability::Status | Capability::Recovery))) { + LOG_ERROR(Service_PCTL, "Application does not have Status or Recovery capabilities!"); + *out_restriction_enabled = false; + R_THROW(PCTL::ResultNoCapability); + } + + *out_restriction_enabled = pin_code[0] != '\0'; + R_SUCCEED(); +} + +Result IParentalControlService::GetSafetyLevel(Out out_safety_level) { + *out_safety_level = 0; + LOG_WARNING(Service_PCTL, "(STUBBED) called, safety_level={}", *out_safety_level); + R_SUCCEED(); +} + +Result IParentalControlService::GetCurrentSettings(Out out_settings) { + LOG_INFO(Service_PCTL, "called"); + *out_settings = restriction_settings; + R_SUCCEED(); +} + +Result IParentalControlService::GetFreeCommunicationApplicationListCount(Out out_count) { + *out_count = 4; + LOG_WARNING(Service_PCTL, "(STUBBED) called, count={}", *out_count); + R_SUCCEED(); +} + +Result IParentalControlService::ConfirmStereoVisionRestrictionConfigurable() { + LOG_DEBUG(Service_PCTL, "called"); + + if (False(capability & Capability::StereoVision)) { + LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); + R_THROW(PCTL::ResultNoCapability); + } + + if (pin_code[0] == '\0') { + R_THROW(PCTL::ResultNoRestrictionEnabled); + } + + R_SUCCEED(); +} + +Result IParentalControlService::IsStereoVisionPermitted(Out out_is_permitted) { + LOG_DEBUG(Service_PCTL, "called"); + + if (!ConfirmStereoVisionPermissionImpl()) { + *out_is_permitted = false; + R_THROW(PCTL::ResultStereoVisionRestricted); + } else { + *out_is_permitted = true; + R_SUCCEED(); + } +} + +Result IParentalControlService::GetPinCodeLength(Out out_length) { + *out_length = 0; + LOG_WARNING(Service_PCTL, "(STUBBED) called, length={}", *out_length); + R_SUCCEED(); +} + +Result IParentalControlService::IsPairingActive(Out out_is_pairing_active) { + *out_is_pairing_active = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, is_pairing_active={}", *out_is_pairing_active); + R_SUCCEED(); +} + +Result IParentalControlService::GetSynchronizationEvent( + OutCopyHandle out_event) { + LOG_INFO(Service_PCTL, "called"); + *out_event = synchronization_event.GetHandle(); + R_SUCCEED(); +} + +Result IParentalControlService::StartPlayTimer() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_SUCCEED(); +} + +Result IParentalControlService::StopPlayTimer() { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + R_SUCCEED(); +} + +Result IParentalControlService::IsPlayTimerEnabled(Out out_is_play_timer_enabled) { + *out_is_play_timer_enabled = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, enabled={}", *out_is_play_timer_enabled); + R_SUCCEED(); +} + +Result IParentalControlService::GetPlayTimerRemainingTime(Out out_remaining_time) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + *out_remaining_time = std::numeric_limits::max(); + R_SUCCEED(); +} + +Result IParentalControlService::IsRestrictedByPlayTimer(Out out_is_restricted_by_play_timer) { + *out_is_restricted_by_play_timer = false; + LOG_WARNING(Service_PCTL, "(STUBBED) called, restricted={}", *out_is_restricted_by_play_timer); + R_SUCCEED(); +} + +Result IParentalControlService::GetPlayTimerSettingsOld( + Out out_play_timer_settings) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + *out_play_timer_settings = {}; + R_SUCCEED(); +} + +Result IParentalControlService::GetPlayTimerSettings(Out out_play_timer_settings) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + *out_play_timer_settings = raw_play_timer_settings; + R_SUCCEED(); +} + +Result IParentalControlService::SetPlayTimerSettings(PlayTimerSettings play_timer_settings) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + raw_play_timer_settings = play_timer_settings; + R_SUCCEED(); +} + +Result IParentalControlService::GetPlayTimerEventToRequestSuspension( + OutCopyHandle out_event) { + LOG_INFO(Service_PCTL, "called"); + *out_event = request_suspension_event.GetHandle(); + R_SUCCEED(); +} + +Result IParentalControlService::IsPlayTimerAlarmDisabled(Out out_play_timer_alarm_disabled) { + *out_play_timer_alarm_disabled = false; + LOG_INFO(Service_PCTL, "called, is_play_timer_alarm_disabled={}", + *out_play_timer_alarm_disabled); + R_SUCCEED(); +} + +Result IParentalControlService::GetPlayTimerRemainingTimeDisplayInfo(Out out_display_info) { + LOG_DEBUG(Service_PCTL, "called"); + *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; + R_SUCCEED(); +} + +Result IParentalControlService::Unknown1460(u8 in_unk, Out out_display_info) { + LOG_DEBUG(Service_PCTL, "called, in_unk={}", in_unk); + *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; + R_SUCCEED(); +} + +Result IParentalControlService::GetUnlinkedEvent(OutCopyHandle out_event) { + LOG_INFO(Service_PCTL, "called"); + *out_event = unlinked_event.GetHandle(); + R_SUCCEED(); +} + +Result IParentalControlService::GetStereoVisionRestriction( + Out out_stereo_vision_restriction) { + LOG_DEBUG(Service_PCTL, "called"); + + if (False(capability & Capability::StereoVision)) { + LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); + *out_stereo_vision_restriction = false; + R_THROW(PCTL::ResultNoCapability); + } + + *out_stereo_vision_restriction = settings.is_stero_vision_restricted; + R_SUCCEED(); +} + +Result IParentalControlService::SetStereoVisionRestriction(bool stereo_vision_restriction) { + LOG_DEBUG(Service_PCTL, "called, can_use={}", stereo_vision_restriction); + + if (False(capability & Capability::StereoVision)) { + LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); + R_THROW(PCTL::ResultNoCapability); + } + + SetStereoVisionRestrictionImpl(stereo_vision_restriction); + R_SUCCEED(); +} + +Result IParentalControlService::ResetConfirmedStereoVisionPermission() { + LOG_DEBUG(Service_PCTL, "called"); + + states.stereo_vision = false; + + R_SUCCEED(); +} + +} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/parental_control_service.h b/src/core/hle/service/pctl/parental_control_service.h new file mode 100644 index 0000000000..9dabe3d059 --- /dev/null +++ b/src/core/hle/service/pctl/parental_control_service.h @@ -0,0 +1,99 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator +// Project// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/os/event.h" +#include "core/hle/service/pctl/pctl_types.h" +#include "core/hle/service/service.h" + +namespace Service::PCTL { + +class IParentalControlService final : public ServiceFramework { +public: + explicit IParentalControlService(Core::System& system_, Capability capability_, + u64 program_id_); + ~IParentalControlService() override; + +private: + bool CheckFreeCommunicationPermissionImpl() const; + bool ConfirmStereoVisionPermissionImpl() const; + void SetStereoVisionRestrictionImpl(bool is_restricted); + + Result Initialize(); + Result CheckFreeCommunicationPermission(); + Result ConfirmLaunchApplicationPermission(InBuffer restriction_bitset, + u64 nacp_flag, u64 application_id); + Result ConfirmResumeApplicationPermission(InBuffer restriction_bitset, + u64 nacp_flag, u64 application_id); + Result ConfirmSnsPostPermission(); + Result ConfirmSystemSettingsPermission(); + Result IsRestrictionTemporaryUnlocked(Out out_is_temporary_unlocked); + Result IsRestrictedSystemSettingsEntered(Out out_is_restricted_system_settings_entered); + Result ConfirmStereoVisionPermission(); + Result EndFreeCommunication(); + Result IsFreeCommunicationAvailable(); + Result IsRestrictionEnabled(Out out_restriction_enabled); + Result GetSafetyLevel(Out out_safety_level); + Result GetCurrentSettings(Out out_settings); + Result GetFreeCommunicationApplicationListCount(Out out_count); + Result ConfirmStereoVisionRestrictionConfigurable(); + Result IsStereoVisionPermitted(Out out_is_permitted); + Result GetPinCodeLength(Out out_length); + Result IsPairingActive(Out out_is_pairing_active); + Result GetSynchronizationEvent(OutCopyHandle out_event); + Result StartPlayTimer(); + Result StopPlayTimer(); + Result IsPlayTimerEnabled(Out out_is_play_timer_enabled); + Result GetPlayTimerRemainingTime(Out out_remaining_time); + Result IsRestrictedByPlayTimer(Out out_is_restricted_by_play_timer); + Result GetPlayTimerSettingsOld(Out out_play_timer_settings); + Result GetPlayTimerEventToRequestSuspension(OutCopyHandle out_event); + Result IsPlayTimerAlarmDisabled(Out out_play_timer_alarm_disabled); + Result GetPlayTimerRemainingTimeDisplayInfo(Out out_display_info); + Result Unknown1460(u8 in_unk, Out out_display_info); + Result GetUnlinkedEvent(OutCopyHandle out_event); + Result GetStereoVisionRestriction(Out out_stereo_vision_restriction); + Result SetStereoVisionRestriction(bool stereo_vision_restriction); + Result ResetConfirmedStereoVisionPermission(); + Result GetPlayTimerSettings(Out out_play_timer_settings); + Result SetPlayTimerSettings(PlayTimerSettings out_play_timer_settings); + + struct States { + u64 current_tid{}; + ApplicationInfo application_info{}; + u64 tid_from_event{}; + bool launch_time_valid{}; + bool is_suspended{}; + bool temporary_unlocked{}; + bool free_communication{}; + bool stereo_vision{}; + }; + + struct ParentalControlSettings { + bool is_stero_vision_restricted{}; + bool is_free_communication_default_on{}; + bool disabled{}; + }; + + States states{}; + ParentalControlSettings settings{}; + RestrictionSettings restriction_settings{}; + std::array pin_code{}; + Capability capability{}; + u64 program_id{}; + // TODO: this is raw + PlayTimerSettings raw_play_timer_settings{}; + + KernelHelpers::ServiceContext service_context; + Event synchronization_event; + Event unlinked_event; + Event request_suspension_event; +}; + +} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/parental_control_service_factory.cpp b/src/core/hle/service/pctl/parental_control_service_factory.cpp new file mode 100644 index 0000000000..ae278a9bbc --- /dev/null +++ b/src/core/hle/service/pctl/parental_control_service_factory.cpp @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/core.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/pctl/parental_control_service.h" +#include "core/hle/service/pctl/parental_control_service_factory.h" + +namespace Service::PCTL { + +IParentalControlServiceFactory::IParentalControlServiceFactory(Core::System& system_, + const char* name_, + Capability capability_) + : ServiceFramework{system_, name_}, capability{capability_} { + static const FunctionInfo functions[] = { + {0, D<&IParentalControlServiceFactory::CreateService>, "CreateService"}, + {1, D<&IParentalControlServiceFactory::CreateServiceWithoutInitialize>, + "CreateServiceWithoutInitialize"}, + }; + RegisterHandlers(functions); +} + +IParentalControlServiceFactory::~IParentalControlServiceFactory() = default; + +Result IParentalControlServiceFactory::CreateService( + Out> out_service, ClientProcessId process_id) { + LOG_DEBUG(Service_PCTL, "called, process_id={}", process_id.pid); + *out_service = std::make_shared( + system, capability, system.ResolveCallerProgramId(*process_id)); + R_SUCCEED(); +} + +Result IParentalControlServiceFactory::CreateServiceWithoutInitialize( + Out> out_service, ClientProcessId process_id) { + LOG_DEBUG(Service_PCTL, "called, process_id={}", process_id.pid); + *out_service = std::make_shared( + system, capability, system.ResolveCallerProgramId(*process_id)); + R_SUCCEED(); +} + +} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/parental_control_service_factory.h b/src/core/hle/service/pctl/parental_control_service_factory.h new file mode 100644 index 0000000000..0b5afede82 --- /dev/null +++ b/src/core/hle/service/pctl/parental_control_service_factory.h @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/pctl/pctl_types.h" +#include "core/hle/service/service.h" + +namespace Service::PCTL { + +class IParentalControlService; + +class IParentalControlServiceFactory : public ServiceFramework { +public: + explicit IParentalControlServiceFactory(Core::System& system_, const char* name_, + Capability capability_); + ~IParentalControlServiceFactory() override; + + Result CreateService(Out> out_service, + ClientProcessId process_id); + Result CreateServiceWithoutInitialize(Out> out_service, + ClientProcessId process_id); + +private: + Capability capability{}; +}; + +void LoopProcess(Core::System& system); + +} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/pctl.cpp b/src/core/hle/service/pctl/pctl.cpp index 4f0fbbe702..37f18a5d58 100644 --- a/src/core/hle/service/pctl/pctl.cpp +++ b/src/core/hle/service/pctl/pctl.cpp @@ -4,636 +4,27 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "common/common_funcs.h" -#include "core/file_sys/control_metadata.h" -#include "core/file_sys/patch_manager.h" -#include "core/hle/service/cmif_types.h" +#include "core/hle/service/pctl/parental_control_service_factory.h" #include "core/hle/service/pctl/pctl.h" #include "core/hle/service/server_manager.h" -#include "core/hle/service/service.h" -#include "core/hle/service/cmif_serialization.h" namespace Service::PCTL { -constexpr Result ResultNoFreeCommunication{ErrorModule::PCTL, 101}; -constexpr Result ResultStereoVisionRestricted{ErrorModule::PCTL, 104}; -constexpr Result ResultNoCapability{ErrorModule::PCTL, 131}; -constexpr Result ResultNoRestrictionEnabled{ErrorModule::PCTL, 181}; - -enum class Capability : u32 { - None = 0, - Application = 1 << 0, - SnsPost = 1 << 1, - Recovery = 1 << 6, - Status = 1 << 8, - StereoVision = 1 << 9, - System = 1 << 15, -}; -DECLARE_ENUM_FLAG_OPERATORS(Capability); - -struct ApplicationInfo { - u64 application_id{}; - std::array age_rating{}; - u32 parental_control_flag{}; - Capability capability{}; -}; -static_assert(sizeof(ApplicationInfo) == 0x30, "ApplicationInfo has incorrect size."); - -// This is nn::pctl::RestrictionSettings -struct RestrictionSettings { - u8 rating_age; - bool sns_post_restriction; - bool free_communication_restriction; -}; -static_assert(sizeof(RestrictionSettings) == 0x3, "RestrictionSettings has incorrect size."); - -// This is nn::pctl::PlayTimerSettingsOld -struct PlayTimerSettingsOld { - std::array settings; -}; -static_assert(sizeof(PlayTimerSettingsOld) == 0x34, "PlayTimerSettingsOld has incorrect size."); - -// This is nn::pctl::PlayTimerSettings -struct PlayTimerSettings { - std::array settings; //21.0.0+ now takes 0x44 -}; -static_assert(sizeof(PlayTimerSettings) == 0x44, "PlayTimerSettings has incorrect size."); - -enum class PlayTimerDisplayState : u8 { - TimesUp = 0, - BedtimeAlarm = 1, - RemainingTime = 2, - Unknown3 = 3, - Unknown4 = 4, - Unknown5 = 5, - TimerDisabled = 6, - NotConfigured = 7, -}; - -// This is nn::pctl::PlayTimerRemainingTimeDisplayInfo -struct PlayTimerRemainingTimeDisplayInfo { - PlayTimerDisplayState state; - INSERT_PADDING_BYTES(0x7); - u64 unknown_08; - u64 remaining_time; -}; -static_assert(sizeof(PlayTimerRemainingTimeDisplayInfo) == 0x18, "PlayTimerRemainingTimeDisplayInfo has incorrect size."); - -class IParentalControlService final : public ServiceFramework { -public: - explicit IParentalControlService(Core::System& system_, Capability capability_, - u64 program_id_) - : ServiceFramework{system_, "IParentalControlService"}, capability{capability_}, - program_id{program_id_}, - service_context{system_, "IParentalControlService"}, synchronization_event{service_context}, - unlinked_event{service_context}, request_suspension_event{service_context} { - } - - ~IParentalControlService() override = default; - - bool CheckFreeCommunicationPermissionImpl() const { - if (states.temporary_unlocked) { - return true; - } - if ((states.application_info.parental_control_flag & 1) == 0) { - return true; - } - if (pin_code[0] == '\0') { - return true; - } - if (!settings.is_free_communication_default_on) { - return true; - } - // TODO(ogniK): Check for blacklisted/exempted applications. Return false can happen here - // but as we don't have multiproceses support yet, we can just assume our application is - // valid for the time being - return true; - } - - bool ConfirmStereoVisionPermissionImpl() const { - if (states.temporary_unlocked) { - return true; - } - if (pin_code[0] == '\0') { - return true; - } - if (!settings.is_stero_vision_restricted) { - return false; - } - return true; - } - - void SetStereoVisionRestrictionImpl(bool is_restricted) { - if (settings.disabled) { - return; - } - - if (pin_code[0] == '\0') { - return; - } - settings.is_stero_vision_restricted = is_restricted; - } - - Result Initialize() { - LOG_DEBUG(Service_PCTL, "called"); - - if (False(capability & (Capability::Application | Capability::System))) { - LOG_ERROR(Service_PCTL, "Invalid capability! capability={:X}", capability); - R_THROW(PCTL::ResultNoCapability); - } - - // TODO(ogniK): Recovery flag initialization for pctl:r - - if (program_id != 0) { - const FileSys::PatchManager pm{program_id, system.GetFileSystemController(), - system.GetContentProvider()}; - const auto control = pm.GetControlMetadata(); - if (control.first) { - states.tid_from_event = 0; - states.launch_time_valid = false; - states.is_suspended = false; - states.free_communication = false; - states.stereo_vision = false; - states.application_info = ApplicationInfo{ - .application_id = program_id, - .age_rating = control.first->GetRatingAge(), - .parental_control_flag = control.first->GetParentalControlFlag(), - .capability = capability, - }; - - if (False(capability & (Capability::System | Capability::Recovery))) { - // TODO(ogniK): Signal application launch event - } - } - } - - R_SUCCEED(); - } - - Result CheckFreeCommunicationPermission() { - LOG_DEBUG(Service_PCTL, "called"); - - if (!CheckFreeCommunicationPermissionImpl()) { - R_THROW(PCTL::ResultNoFreeCommunication); - } else { - states.free_communication = true; - R_SUCCEED(); - } - } - - Result ConfirmLaunchApplicationPermission( - InBuffer restriction_bitset, u64 nacp_flag, u64 application_id) { - LOG_WARNING(Service_PCTL, "(STUBBED) called, nacp_flag={:#x} application_id={:016X}", nacp_flag, - application_id); - R_SUCCEED(); - } - - Result ConfirmResumeApplicationPermission( - InBuffer restriction_bitset, u64 nacp_flag, u64 application_id) { - LOG_WARNING(Service_PCTL, "(STUBBED) called, nacp_flag={:#x} application_id={:016X}", nacp_flag, - application_id); - R_SUCCEED(); - } - - Result ConfirmSnsPostPermission() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_THROW(PCTL::ResultNoFreeCommunication); - } - - Result ConfirmSystemSettingsPermission() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_SUCCEED(); - } - - Result IsRestrictionTemporaryUnlocked( - Out out_is_temporary_unlocked) { - *out_is_temporary_unlocked = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, is_temporary_unlocked={}", - *out_is_temporary_unlocked); - R_SUCCEED(); - } - - Result IsRestrictedSystemSettingsEntered( - Out out_is_restricted_system_settings_entered) { - *out_is_restricted_system_settings_entered = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, is_temporary_unlocked={}", - *out_is_restricted_system_settings_entered); - R_SUCCEED(); - } - - Result ConfirmStereoVisionPermission() { - LOG_DEBUG(Service_PCTL, "called"); - states.stereo_vision = true; - R_SUCCEED(); - } - - Result EndFreeCommunication() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_SUCCEED(); - } - - Result IsFreeCommunicationAvailable() { - LOG_DEBUG(Service_PCTL, "(STUBBED) called"); - - if (!CheckFreeCommunicationPermissionImpl()) { - R_THROW(PCTL::ResultNoFreeCommunication); - } else { - R_SUCCEED(); - } - } - - Result IsRestrictionEnabled(Out out_restriction_enabled) { - LOG_DEBUG(Service_PCTL, "called"); - - if (False(capability & (Capability::Status | Capability::Recovery))) { - LOG_ERROR(Service_PCTL, "Application does not have Status or Recovery capabilities!"); - *out_restriction_enabled = false; - R_THROW(PCTL::ResultNoCapability); - } - - *out_restriction_enabled = pin_code[0] != '\0'; - R_SUCCEED(); - } - - Result GetSafetyLevel(Out out_safety_level) { - *out_safety_level = 0; - LOG_WARNING(Service_PCTL, "(STUBBED) called, safety_level={}", *out_safety_level); - R_SUCCEED(); - } - - Result GetCurrentSettings(Out out_settings) { - LOG_INFO(Service_PCTL, "called"); - *out_settings = restriction_settings; - R_SUCCEED(); - } - - Result GetFreeCommunicationApplicationListCount(Out out_count) { - *out_count = 4; - LOG_WARNING(Service_PCTL, "(STUBBED) called, count={}", *out_count); - R_SUCCEED(); - } - - Result ConfirmStereoVisionRestrictionConfigurable() { - LOG_DEBUG(Service_PCTL, "called"); - - if (False(capability & Capability::StereoVision)) { - LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); - R_THROW(PCTL::ResultNoCapability); - } - - if (pin_code[0] == '\0') { - R_THROW(PCTL::ResultNoRestrictionEnabled); - } - - R_SUCCEED(); - } - - Result IsStereoVisionPermitted(Out out_is_permitted) { - LOG_DEBUG(Service_PCTL, "called"); - - if (!ConfirmStereoVisionPermissionImpl()) { - *out_is_permitted = false; - R_THROW(PCTL::ResultStereoVisionRestricted); - } else { - *out_is_permitted = true; - R_SUCCEED(); - } - } - - Result GetPinCodeLength(Out out_length) { - *out_length = 0; - LOG_WARNING(Service_PCTL, "(STUBBED) called, length={}", *out_length); - R_SUCCEED(); - } - - Result IsPairingActive(Out out_is_pairing_active) { - *out_is_pairing_active = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, is_pairing_active={}", *out_is_pairing_active); - R_SUCCEED(); - } - - Result GetSynchronizationEvent( - OutCopyHandle out_event) { - LOG_INFO(Service_PCTL, "called"); - *out_event = synchronization_event.GetHandle(); - R_SUCCEED(); - } - - Result StartPlayTimer() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_SUCCEED(); - } - - Result StopPlayTimer() { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - R_SUCCEED(); - } - - Result IsPlayTimerEnabled(Out out_is_play_timer_enabled) { - *out_is_play_timer_enabled = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, enabled={}", *out_is_play_timer_enabled); - R_SUCCEED(); - } - - Result GetPlayTimerRemainingTime(Out out_remaining_time) { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - *out_remaining_time = std::numeric_limits::max(); - R_SUCCEED(); - } - - Result IsRestrictedByPlayTimer(Out out_is_restricted_by_play_timer) { - *out_is_restricted_by_play_timer = false; - LOG_WARNING(Service_PCTL, "(STUBBED) called, restricted={}", *out_is_restricted_by_play_timer); - R_SUCCEED(); - } - - Result GetPlayTimerSettingsOld( - Out out_play_timer_settings) { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - *out_play_timer_settings = {}; - R_SUCCEED(); - } - - Result GetPlayTimerSettings(Out out_play_timer_settings) { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - *out_play_timer_settings = raw_play_timer_settings; - R_SUCCEED(); - } - - Result SetPlayTimerSettings(PlayTimerSettings play_timer_settings) { - LOG_WARNING(Service_PCTL, "(STUBBED) called"); - raw_play_timer_settings = play_timer_settings; - R_SUCCEED(); - } - - Result GetPlayTimerEventToRequestSuspension( - OutCopyHandle out_event) { - LOG_INFO(Service_PCTL, "called"); - *out_event = request_suspension_event.GetHandle(); - R_SUCCEED(); - } - - Result IsPlayTimerAlarmDisabled(Out out_play_timer_alarm_disabled) { - *out_play_timer_alarm_disabled = false; - LOG_INFO(Service_PCTL, "called, is_play_timer_alarm_disabled={}", - *out_play_timer_alarm_disabled); - R_SUCCEED(); - } - - Result GetPlayTimerRemainingTimeDisplayInfo(Out out_display_info) { - LOG_DEBUG(Service_PCTL, "called"); - *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; - R_SUCCEED(); - } - - Result Unknown1460(u8 in_unk, Out out_display_info) { - LOG_DEBUG(Service_PCTL, "called, in_unk={}", in_unk); - *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; - R_SUCCEED(); - } - - Result GetUnlinkedEvent(OutCopyHandle out_event) { - LOG_INFO(Service_PCTL, "called"); - *out_event = unlinked_event.GetHandle(); - R_SUCCEED(); - } - - Result GetStereoVisionRestriction( - Out out_stereo_vision_restriction) { - LOG_DEBUG(Service_PCTL, "called"); - - if (False(capability & Capability::StereoVision)) { - LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); - *out_stereo_vision_restriction = false; - R_THROW(PCTL::ResultNoCapability); - } - - *out_stereo_vision_restriction = settings.is_stero_vision_restricted; - R_SUCCEED(); - } - - Result SetStereoVisionRestriction(bool stereo_vision_restriction) { - LOG_DEBUG(Service_PCTL, "called, can_use={}", stereo_vision_restriction); - - if (False(capability & Capability::StereoVision)) { - LOG_ERROR(Service_PCTL, "Application does not have StereoVision capability!"); - R_THROW(PCTL::ResultNoCapability); - } - - SetStereoVisionRestrictionImpl(stereo_vision_restriction); - R_SUCCEED(); - } - - Result ResetConfirmedStereoVisionPermission() { - LOG_DEBUG(Service_PCTL, "called"); - - states.stereo_vision = false; - - R_SUCCEED(); - } - - struct States { - u64 current_tid{}; - ApplicationInfo application_info{}; - u64 tid_from_event{}; - bool launch_time_valid{}; - bool is_suspended{}; - bool temporary_unlocked{}; - bool free_communication{}; - bool stereo_vision{}; - }; - - struct ParentalControlSettings { - bool is_stero_vision_restricted{}; - bool is_free_communication_default_on{}; - bool disabled{}; - }; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, D<&IParentalControlService::Initialize>, "Initialize"}, - FunctionInfo{1001, D<&IParentalControlService::CheckFreeCommunicationPermission>, "CheckFreeCommunicationPermission"}, - FunctionInfo{1002, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"}, - FunctionInfo{1003, D<&IParentalControlService::ConfirmResumeApplicationPermission>, "ConfirmResumeApplicationPermission"}, - FunctionInfo{1004, D<&IParentalControlService::ConfirmSnsPostPermission>, "ConfirmSnsPostPermission"}, - FunctionInfo{1005, D<&IParentalControlService::ConfirmSystemSettingsPermission>, "ConfirmSystemSettingsPermission"}, - FunctionInfo{1006, D<&IParentalControlService::IsRestrictionTemporaryUnlocked>, "IsRestrictionTemporaryUnlocked"}, - FunctionInfo{1007, nullptr, "RevertRestrictionTemporaryUnlocked"}, - FunctionInfo{1008, nullptr, "EnterRestrictedSystemSettings"}, - FunctionInfo{1009, nullptr, "LeaveRestrictedSystemSettings"}, - FunctionInfo{1010, D<&IParentalControlService::IsRestrictedSystemSettingsEntered>, "IsRestrictedSystemSettingsEntered"}, - FunctionInfo{1011, nullptr, "RevertRestrictedSystemSettingsEntered"}, - FunctionInfo{1012, nullptr, "GetRestrictedFeatures"}, - FunctionInfo{1013, D<&IParentalControlService::ConfirmStereoVisionPermission>, "ConfirmStereoVisionPermission"}, - FunctionInfo{1014, nullptr, "ConfirmPlayableApplicationVideoOld"}, - FunctionInfo{1015, nullptr, "ConfirmPlayableApplicationVideo"}, - FunctionInfo{1016, nullptr, "ConfirmShowNewsPermission"}, - FunctionInfo{1017, D<&IParentalControlService::EndFreeCommunication>, "EndFreeCommunication"}, - FunctionInfo{1018, D<&IParentalControlService::IsFreeCommunicationAvailable>, "IsFreeCommunicationAvailable"}, - FunctionInfo{1019, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"}, - FunctionInfo{1020, nullptr, "ConfirmLaunchSharedApplicationPermission", MakeVersionGate({20,0,0})}, - FunctionInfo{1021, nullptr, "TryBeginFreeCommunicationForStreamPlay", MakeVersionGate({21,0,0})}, - FunctionInfo{1022, nullptr, "EndFreeCommunicationForStreamPlay", MakeVersionGate({21,0,0})}, - FunctionInfo{1031, D<&IParentalControlService::IsRestrictionEnabled>, "IsRestrictionEnabled"}, - FunctionInfo{1032, D<&IParentalControlService::GetSafetyLevel>, "GetSafetyLevel"}, - FunctionInfo{1033, nullptr, "SetSafetyLevel"}, - FunctionInfo{1034, nullptr, "GetSafetyLevelSettings"}, - FunctionInfo{1035, D<&IParentalControlService::GetCurrentSettings>, "GetCurrentSettings"}, - FunctionInfo{1036, nullptr, "SetCustomSafetyLevelSettings"}, - FunctionInfo{1037, nullptr, "GetDefaultRatingOrganization"}, - FunctionInfo{1038, nullptr, "SetDefaultRatingOrganization"}, - FunctionInfo{1039, D<&IParentalControlService::GetFreeCommunicationApplicationListCount>, "GetFreeCommunicationApplicationListCount"}, - FunctionInfo{1042, nullptr, "AddToFreeCommunicationApplicationList"}, - FunctionInfo{1043, nullptr, "DeleteSettings"}, - FunctionInfo{1044, nullptr, "GetFreeCommunicationApplicationList"}, - FunctionInfo{1045, nullptr, "UpdateFreeCommunicationApplicationList"}, - FunctionInfo{1046, nullptr, "DisableFeaturesForReset"}, - FunctionInfo{1047, nullptr, "NotifyApplicationDownloadStarted"}, - FunctionInfo{1048, nullptr, "NotifyNetworkProfileCreated"}, - FunctionInfo{1049, nullptr, "ResetFreeCommunicationApplicationList"}, - FunctionInfo{1050, nullptr, "AddToFreeCommunicationApplicationList", MakeVersionGate({20,0,0})}, - FunctionInfo{1051, nullptr, "NotifyApplicationDownloadStarted", MakeVersionGate({20,0,0})}, - FunctionInfo{1061, D<&IParentalControlService::ConfirmStereoVisionRestrictionConfigurable>, "ConfirmStereoVisionRestrictionConfigurable"}, - FunctionInfo{1062, D<&IParentalControlService::GetStereoVisionRestriction>, "GetStereoVisionRestriction"}, - FunctionInfo{1063, D<&IParentalControlService::SetStereoVisionRestriction>, "SetStereoVisionRestriction"}, - FunctionInfo{1064, D<&IParentalControlService::ResetConfirmedStereoVisionPermission>, "ResetConfirmedStereoVisionPermission"}, - FunctionInfo{1065, D<&IParentalControlService::IsStereoVisionPermitted>, "IsStereoVisionPermitted"}, - FunctionInfo{1201, nullptr, "UnlockRestrictionTemporarily"}, - FunctionInfo{1202, nullptr, "UnlockSystemSettingsRestriction"}, - FunctionInfo{1203, nullptr, "SetPinCode"}, - FunctionInfo{1204, nullptr, "GenerateInquiryCode"}, - FunctionInfo{1205, nullptr, "CheckMasterKey"}, - FunctionInfo{1206, D<&IParentalControlService::GetPinCodeLength>, "GetPinCodeLength"}, - FunctionInfo{1207, nullptr, "GetPinCodeChangedEvent"}, - FunctionInfo{1208, nullptr, "GetPinCode"}, - FunctionInfo{1403, D<&IParentalControlService::IsPairingActive>, "IsPairingActive"}, - FunctionInfo{1406, nullptr, "GetSettingsLastUpdated"}, - FunctionInfo{1411, nullptr, "GetPairingAccountInfo"}, - FunctionInfo{1421, nullptr, "GetAccountNickname"}, - FunctionInfo{1424, nullptr, "GetAccountState"}, - FunctionInfo{1425, nullptr, "RequestPostEvents"}, - FunctionInfo{1426, nullptr, "GetPostEventInterval"}, - FunctionInfo{1427, nullptr, "SetPostEventInterval"}, - FunctionInfo{1432, D<&IParentalControlService::GetSynchronizationEvent>, "GetSynchronizationEvent"}, - FunctionInfo{1451, D<&IParentalControlService::StartPlayTimer>, "StartPlayTimer"}, - FunctionInfo{1452, D<&IParentalControlService::StopPlayTimer>, "StopPlayTimer"}, - FunctionInfo{1453, D<&IParentalControlService::IsPlayTimerEnabled>, "IsPlayTimerEnabled"}, - FunctionInfo{1454, D<&IParentalControlService::GetPlayTimerRemainingTime>, "GetPlayTimerRemainingTime"}, - FunctionInfo{1455, D<&IParentalControlService::IsRestrictedByPlayTimer>, "IsRestrictedByPlayTimer"}, - FunctionInfo{1456, D<&IParentalControlService::GetPlayTimerSettingsOld>, "GetPlayTimerSettingsOld"}, - FunctionInfo{1457, D<&IParentalControlService::GetPlayTimerEventToRequestSuspension>, "GetPlayTimerEventToRequestSuspension"}, - FunctionInfo{1458, D<&IParentalControlService::IsPlayTimerAlarmDisabled>, "IsPlayTimerAlarmDisabled"}, - FunctionInfo{1459, D<&IParentalControlService::GetPlayTimerRemainingTimeDisplayInfo>, "GetPlayTimerRemainingTimeDisplayInfo"}, - FunctionInfo{1460, D<&IParentalControlService::Unknown1460>, "Unknown1460"}, - FunctionInfo{1471, nullptr, "NotifyWrongPinCodeInputManyTimes"}, - FunctionInfo{1472, nullptr, "CancelNetworkRequest"}, - FunctionInfo{1473, D<&IParentalControlService::GetUnlinkedEvent>, "GetUnlinkedEvent"}, - FunctionInfo{1474, nullptr, "ClearUnlinkedEvent"}, - FunctionInfo{1475, nullptr, "GetExtendedPlayTimerEvent", MakeVersionGate({18,0,0})}, - FunctionInfo{1601, nullptr, "DisableAllFeatures"}, - FunctionInfo{1602, nullptr, "PostEnableAllFeatures"}, - FunctionInfo{1603, nullptr, "IsAllFeaturesDisabled"}, - FunctionInfo{1901, nullptr, "DeleteFromFreeCommunicationApplicationListForDebug"}, - FunctionInfo{1902, nullptr, "ClearFreeCommunicationApplicationListForDebug"}, - FunctionInfo{1903, nullptr, "GetExemptApplicationListCountForDebug"}, - FunctionInfo{1904, nullptr, "GetExemptApplicationListForDebug"}, - FunctionInfo{1905, nullptr, "UpdateExemptApplicationListForDebug"}, - FunctionInfo{1906, nullptr, "AddToExemptApplicationListForDebug"}, - FunctionInfo{1907, nullptr, "DeleteFromExemptApplicationListForDebug"}, - FunctionInfo{1908, nullptr, "ClearExemptApplicationListForDebug"}, - FunctionInfo{1941, nullptr, "DeletePairing"}, - FunctionInfo{1951, nullptr, "SetPlayTimerSettingsForDebug"}, - FunctionInfo{1952, nullptr, "GetPlayTimerSpentTimeForTest"}, - FunctionInfo{1953, nullptr, "SetPlayTimerAlarmDisabledForDebug"}, - FunctionInfo{1954, nullptr, "IsBedtimeAlarmEnabled", MakeVersionGate({18,0,0})}, - FunctionInfo{1955, nullptr, "GetBedtimeAlarmTime", MakeVersionGate({18,0,0})}, - FunctionInfo{1956, nullptr, "GetBedtimeAlarmTimeHour", MakeVersionGate({18,0,0})}, - FunctionInfo{1957, nullptr, "GetBedtimeAlarmTimeMinute", MakeVersionGate({18,0,0})}, - FunctionInfo{2001, nullptr, "RequestPairingAsync"}, - FunctionInfo{2002, nullptr, "FinishRequestPairing"}, - FunctionInfo{2003, nullptr, "AuthorizePairingAsync"}, - FunctionInfo{2004, nullptr, "FinishAuthorizePairing"}, - FunctionInfo{2005, nullptr, "RetrievePairingInfoAsync"}, - FunctionInfo{2006, nullptr, "FinishRetrievePairingInfo"}, - FunctionInfo{2007, nullptr, "UnlinkPairingAsync"}, - FunctionInfo{2008, nullptr, "FinishUnlinkPairing"}, - FunctionInfo{2009, nullptr, "GetAccountMiiImageAsync"}, - FunctionInfo{2010, nullptr, "FinishGetAccountMiiImage"}, - FunctionInfo{2011, nullptr, "GetAccountMiiImageContentTypeAsync"}, - FunctionInfo{2012, nullptr, "FinishGetAccountMiiImageContentType"}, - FunctionInfo{2013, nullptr, "SynchronizeParentalControlSettingsAsync"}, - FunctionInfo{2014, nullptr, "FinishSynchronizeParentalControlSettings"}, - FunctionInfo{2015, nullptr, "FinishSynchronizeParentalControlSettingsWithLastUpdated"}, - FunctionInfo{2016, nullptr, "RequestUpdateExemptionListAsync", MakeVersionGate({5,0,0})}, - FunctionInfo{145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings", MakeVersionGate({18,0,0})}, - FunctionInfo{2017, nullptr, "AuthorizePairingAsync", MakeVersionGate({19,0,0})}, - FunctionInfo{2019, nullptr, "RequestUpdateDeviceUsersBackground", MakeVersionGate({19,0,0})}, - FunctionInfo{2021, nullptr, "RequestCopyPairingAsync", MakeVersionGate({20,0,0})}, - FunctionInfo{2022, nullptr, "FinishRequestCopyPairing", MakeVersionGate({20,0,0})}, - FunctionInfo{2023, nullptr, "IsFromPairingActiveDevice", MakeVersionGate({20,0,0})}, - FunctionInfo{2024, nullptr, "RollbackCopyPairing", MakeVersionGate({21,0,0})}, - FunctionInfo{3001, nullptr, "GetErrorContextChangedEvent", MakeVersionGate({20,0,0})}, - FunctionInfo{145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings", MakeVersionGate({18,0,0})}, - FunctionInfo{195101, D<&IParentalControlService::SetPlayTimerSettings>, "SetPlayTimerSettingsForDebug", MakeVersionGate({18,0,0})} - ); - States states{}; - ParentalControlSettings settings{}; - RestrictionSettings restriction_settings{}; - std::array pin_code{}; - Capability capability{}; - u64 program_id{}; - // TODO: this is raw - PlayTimerSettings raw_play_timer_settings{}; - - KernelHelpers::ServiceContext service_context; - Event synchronization_event; - Event unlinked_event; - Event request_suspension_event; -}; - -class IParentalControlServiceFactory : public ServiceFramework { -public: - explicit IParentalControlServiceFactory(Core::System& system_, const char* name_, Capability capability_) - : ServiceFramework{system_, name_}, capability{capability_} - {} - - ~IParentalControlServiceFactory() override = default; - - Result CreateService(Out> out_service, ClientProcessId process_id) { - LOG_DEBUG(Service_PCTL, "called, process_id={}", process_id.pid); - *out_service = std::make_shared( - system, capability, system.ResolveCallerProgramId(*process_id)); - R_SUCCEED(); - } - - Result CreateServiceWithoutInitialize(Out> out_service, ClientProcessId process_id) { - LOG_DEBUG(Service_PCTL, "called, process_id={}", process_id.pid); - *out_service = std::make_shared( - system, capability, system.ResolveCallerProgramId(*process_id)); - R_SUCCEED(); - } - -private: - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IParentalControlServiceFactory::CreateService>, "CreateService"}, - FunctionInfo{1, D<&IParentalControlServiceFactory::CreateServiceWithoutInitialize>, "CreateServiceWithoutInitialize"} - ); - Capability capability{}; -}; - void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); - server_manager->RegisterNamedService("pctl", std::make_shared(system, "pctl", Capability::Application | Capability::SnsPost | Capability::Status | Capability::StereoVision)); + server_manager->RegisterNamedService("pctl", + std::make_shared( + system, "pctl", + Capability::Application | Capability::SnsPost | + Capability::Status | Capability::StereoVision)); // TODO(ogniK): Implement remaining capabilities - server_manager->RegisterNamedService("pctl:a", std::make_shared(system, "pctl:a", Capability::None)); - server_manager->RegisterNamedService("pctl:r", std::make_shared(system, "pctl:r", Capability::None)); - server_manager->RegisterNamedService("pctl:s", std::make_shared(system, "pctl:s", Capability::None)); + server_manager->RegisterNamedService("pctl:a", std::make_shared( + system, "pctl:a", Capability::None)); + server_manager->RegisterNamedService("pctl:r", std::make_shared( + system, "pctl:r", Capability::None)); + server_manager->RegisterNamedService("pctl:s", std::make_shared( + system, "pctl:s", Capability::None)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/pctl/pctl.h b/src/core/hle/service/pctl/pctl.h index 5f9d03d4df..020866aa3d 100644 --- a/src/core/hle/service/pctl/pctl.h +++ b/src/core/hle/service/pctl/pctl.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/pctl/pctl_results.h b/src/core/hle/service/pctl/pctl_results.h new file mode 100644 index 0000000000..0aa4714a9c --- /dev/null +++ b/src/core/hle/service/pctl/pctl_results.h @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/result.h" + +namespace Service::PCTL { + +constexpr Result ResultNoFreeCommunication{ErrorModule::PCTL, 101}; +constexpr Result ResultStereoVisionRestricted{ErrorModule::PCTL, 104}; +constexpr Result ResultNoCapability{ErrorModule::PCTL, 131}; +constexpr Result ResultNoRestrictionEnabled{ErrorModule::PCTL, 181}; + +} // namespace Service::PCTL diff --git a/src/core/hle/service/pctl/pctl_types.h b/src/core/hle/service/pctl/pctl_types.h new file mode 100644 index 0000000000..3a5a19099d --- /dev/null +++ b/src/core/hle/service/pctl/pctl_types.h @@ -0,0 +1,73 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "common/common_funcs.h" + +namespace Service::PCTL { + +enum class Capability : u32 { + None = 0, + Application = 1 << 0, + SnsPost = 1 << 1, + Recovery = 1 << 6, + Status = 1 << 8, + StereoVision = 1 << 9, + System = 1 << 15, +}; +DECLARE_ENUM_FLAG_OPERATORS(Capability); + +struct ApplicationInfo { + u64 application_id{}; + std::array age_rating{}; + u32 parental_control_flag{}; + Capability capability{}; +}; +static_assert(sizeof(ApplicationInfo) == 0x30, "ApplicationInfo has incorrect size."); + +// This is nn::pctl::RestrictionSettings +struct RestrictionSettings { + u8 rating_age; + bool sns_post_restriction; + bool free_communication_restriction; +}; +static_assert(sizeof(RestrictionSettings) == 0x3, "RestrictionSettings has incorrect size."); + +// This is nn::pctl::PlayTimerSettingsOld +struct PlayTimerSettingsOld { + std::array settings; +}; +static_assert(sizeof(PlayTimerSettingsOld) == 0x34, "PlayTimerSettingsOld has incorrect size."); + +// This is nn::pctl::PlayTimerSettings +struct PlayTimerSettings { + std::array settings; //21.0.0+ now takes 0x44 +}; +static_assert(sizeof(PlayTimerSettings) == 0x44, "PlayTimerSettings has incorrect size."); + +enum class PlayTimerDisplayState : u8 { + TimesUp = 0, + BedtimeAlarm = 1, + RemainingTime = 2, + Unknown3 = 3, + Unknown4 = 4, + Unknown5 = 5, + TimerDisabled = 6, + NotConfigured = 7, +}; + +// This is nn::pctl::PlayTimerRemainingTimeDisplayInfo +struct PlayTimerRemainingTimeDisplayInfo { + PlayTimerDisplayState state; + INSERT_PADDING_BYTES(0x7); + u64 unknown_08; + u64 remaining_time; +}; +static_assert(sizeof(PlayTimerRemainingTimeDisplayInfo) == 0x18, + "PlayTimerRemainingTimeDisplayInfo has incorrect size."); + +} // namespace Service::PCTL diff --git a/src/core/hle/service/pcv/pcv.cpp b/src/core/hle/service/pcv/pcv.cpp index bb3d748527..1b314f3518 100644 --- a/src/core/hle/service/pcv/pcv.cpp +++ b/src/core/hle/service/pcv/pcv.cpp @@ -15,76 +15,91 @@ namespace Service::PCV { class PCV final : public ServiceFramework { public: - explicit PCV(Core::System& system_) : ServiceFramework{system_, "pcv"} {} + explicit PCV(Core::System& system_) : ServiceFramework{system_, "pcv"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetPowerEnabled"}, + {1, nullptr, "SetClockEnabled"}, + {2, nullptr, "SetClockRate"}, + {3, nullptr, "GetClockRate"}, + {4, nullptr, "GetState"}, + {5, nullptr, "GetPossibleClockRates"}, + {6, nullptr, "SetMinVClockRate"}, + {7, nullptr, "SetReset"}, + {8, nullptr, "SetVoltageEnabled"}, + {9, nullptr, "GetVoltageEnabled"}, + {10, nullptr, "GetVoltageRange"}, + {11, nullptr, "SetVoltageValue"}, + {12, nullptr, "GetVoltageValue"}, + {13, nullptr, "GetTemperatureThresholds"}, + {14, nullptr, "SetTemperature"}, + {15, nullptr, "Initialize"}, + {16, nullptr, "IsInitialized"}, + {17, nullptr, "Finalize"}, + {18, nullptr, "PowerOn"}, + {19, nullptr, "PowerOff"}, + {20, nullptr, "ChangeVoltage"}, + {21, nullptr, "GetPowerClockInfoEvent"}, + {22, nullptr, "GetOscillatorClock"}, + {23, nullptr, "GetDvfsTable"}, + {24, nullptr, "GetModuleStateTable"}, + {25, nullptr, "GetPowerDomainStateTable"}, + {26, nullptr, "GetFuseInfo"}, + {27, nullptr, "GetDramId"}, + {28, nullptr, "IsPoweredOn"}, + {29, nullptr, "GetVoltage"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetPowerEnabled"}, - FunctionInfo{1, nullptr, "SetClockEnabled"}, - FunctionInfo{2, nullptr, "SetClockRate"}, - FunctionInfo{3, nullptr, "GetClockRate"}, - FunctionInfo{4, nullptr, "GetState"}, - FunctionInfo{5, nullptr, "GetPossibleClockRates"}, - FunctionInfo{6, nullptr, "SetMinVClockRate"}, - FunctionInfo{7, nullptr, "SetReset"}, - FunctionInfo{8, nullptr, "SetVoltageEnabled"}, - FunctionInfo{9, nullptr, "GetVoltageEnabled"}, - FunctionInfo{10, nullptr, "GetVoltageRange"}, - FunctionInfo{11, nullptr, "SetVoltageValue"}, - FunctionInfo{12, nullptr, "GetVoltageValue"}, - FunctionInfo{13, nullptr, "GetTemperatureThresholds"}, - FunctionInfo{14, nullptr, "SetTemperature"}, - FunctionInfo{15, nullptr, "Initialize"}, - FunctionInfo{16, nullptr, "IsInitialized"}, - FunctionInfo{17, nullptr, "Finalize"}, - FunctionInfo{18, nullptr, "PowerOn"}, - FunctionInfo{19, nullptr, "PowerOff"}, - FunctionInfo{20, nullptr, "ChangeVoltage"}, - FunctionInfo{21, nullptr, "GetPowerClockInfoEvent"}, - FunctionInfo{22, nullptr, "GetOscillatorClock"}, - FunctionInfo{23, nullptr, "GetDvfsTable"}, - FunctionInfo{24, nullptr, "GetModuleStateTable"}, - FunctionInfo{25, nullptr, "GetPowerDomainStateTable"}, - FunctionInfo{26, nullptr, "GetFuseInfo"}, - FunctionInfo{27, nullptr, "GetDramId"}, - FunctionInfo{28, nullptr, "IsPoweredOn"}, - FunctionInfo{29, nullptr, "GetVoltage"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class PCV_ARB final : public ServiceFramework { public: - explicit PCV_ARB(Core::System& system_) : ServiceFramework{system_, "pcv:arb"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "ReleaseControl"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit PCV_ARB(Core::System& system_) : ServiceFramework{system_, "pcv:arb"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ReleaseControl"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class PCV_IMM final : public ServiceFramework { public: - explicit PCV_IMM(Core::System& system_) : ServiceFramework{system_, "pcv:imm"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetClockRate"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit PCV_IMM(Core::System& system_) : ServiceFramework{system_, "pcv:imm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetClockRate"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IClkrstSession final : public ServiceFramework { public: explicit IClkrstSession(Core::System& system_, DeviceCode device_code_) - : ServiceFramework{system_, "IClkrstSession"}, device_code(device_code_) {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "IClkrstSession"}, device_code(device_code_) { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetClockEnabled"}, + {1, nullptr, "SetClockDisabled"}, + {2, nullptr, "SetResetAsserted"}, + {3, nullptr, "SetResetDeasserted"}, + {4, nullptr, "SetPowerEnabled"}, + {5, nullptr, "SetPowerDisabled"}, + {6, nullptr, "GetState"}, + {7, &IClkrstSession::SetClockRate, "SetClockRate"}, + {8, &IClkrstSession::GetClockRate, "GetClockRate"}, + {9, nullptr, "SetMinVClockRate"}, + {10, nullptr, "GetPossibleClockRates"}, + {11, nullptr, "GetDvfsTable"}, + }; + // clang-format on + RegisterHandlers(functions); } private: @@ -105,30 +120,25 @@ private: rb.Push(clock_rate); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetClockEnabled"}, - FunctionInfo{1, nullptr, "SetClockDisabled"}, - FunctionInfo{2, nullptr, "SetResetAsserted"}, - FunctionInfo{3, nullptr, "SetResetDeasserted"}, - FunctionInfo{4, nullptr, "SetPowerEnabled"}, - FunctionInfo{5, nullptr, "SetPowerDisabled"}, - FunctionInfo{6, nullptr, "GetState"}, - FunctionInfo{7, &IClkrstSession::SetClockRate, "SetClockRate"}, - FunctionInfo{8, &IClkrstSession::GetClockRate, "GetClockRate"}, - FunctionInfo{9, nullptr, "SetMinVClockRate"}, - FunctionInfo{10, nullptr, "GetPossibleClockRates"}, - FunctionInfo{11, nullptr, "GetDvfsTable"} - ); DeviceCode device_code; u32 clock_rate{}; }; class CLKRST final : public ServiceFramework { public: - explicit CLKRST(Core::System& system_, const char* name) : ServiceFramework{system_, name} {} + explicit CLKRST(Core::System& system_, const char* name) : ServiceFramework{system_, name} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &CLKRST::OpenSession, "OpenSession"}, + {1, nullptr, "GetTemperatureThresholds"}, + {2, nullptr, "SetTemperature"}, + {3, nullptr, "GetModuleStateTable"}, + {4, nullptr, "GetModuleStateTableEvent"}, + {5, nullptr, "GetModuleStateTableMaxCount"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -143,26 +153,18 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system, device_code); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &CLKRST::OpenSession, "OpenSession"}, - FunctionInfo{1, nullptr, "GetTemperatureThresholds"}, - FunctionInfo{2, nullptr, "SetTemperature"}, - FunctionInfo{3, nullptr, "GetModuleStateTable"}, - FunctionInfo{4, nullptr, "GetModuleStateTableEvent"}, - FunctionInfo{5, nullptr, "GetModuleStateTableMaxCount"} - ); }; class CLKRST_A final : public ServiceFramework { public: - explicit CLKRST_A(Core::System& system_) : ServiceFramework{system_, "clkrst:a"} {} + explicit CLKRST_A(Core::System& system_) : ServiceFramework{system_, "clkrst:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ReleaseControl"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "ReleaseControl"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/pcv/pcv.h b/src/core/hle/service/pcv/pcv.h index bf541e6feb..27eb179ff4 100644 --- a/src/core/hle/service/pcv/pcv.h +++ b/src/core/hle/service/pcv/pcv.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp index 3d431c305f..ff7053b690 100644 --- a/src/core/hle/service/pm/pm.cpp +++ b/src/core/hle/service/pm/pm.cpp @@ -47,7 +47,13 @@ void GetApplicationPidGeneric(Kernel::KernelCore& kernel, HLERequestContext& ctx class BootMode final : public ServiceFramework { public: - explicit BootMode(Core::System& system_) : ServiceFramework{system_, "pm:bm"} {} + explicit BootMode(Core::System& system_) : ServiceFramework{system_, "pm:bm"} { + static const FunctionInfo functions[] = { + {0, &BootMode::GetBootMode, "GetBootMode"}, + {1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"}, + }; + RegisterHandlers(functions); + } private: void GetBootMode(HLERequestContext& ctx) { @@ -67,19 +73,28 @@ private: rb.Push(ResultSuccess); } - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &BootMode::GetBootMode, "GetBootMode"}, - FunctionInfo{1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"} - ); SystemBootMode boot_mode = SystemBootMode::Normal; }; class DebugMonitor final : public ServiceFramework { public: - explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "pm:dmnt"} {} + explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "pm:dmnt"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetJitDebugProcessIdList"}, + {1, nullptr, "StartProcess"}, + {2, &DebugMonitor::GetProcessId, "GetProcessId"}, + {3, nullptr, "HookToCreateProcess"}, + {4, &DebugMonitor::GetApplicationProcessId, "GetApplicationProcessId"}, + {5, nullptr, "HookToCreateApplicationProgress"}, + {6, nullptr, "ClearHook"}, + {65000, &DebugMonitor::AtmosphereGetProcessInfo, "AtmosphereGetProcessInfo"}, + {65001, nullptr, "AtmosphereGetCurrentLimitInfo"}, + }; + // clang-format on + + RegisterHandlers(functions); + } private: void GetProcessId(HLERequestContext& ctx) { @@ -149,26 +164,19 @@ private: rb.PushRaw(program_location); rb.PushRaw(override_status); } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetJitDebugProcessIdList"}, - FunctionInfo{1, nullptr, "StartProcess"}, - FunctionInfo{2, &DebugMonitor::GetProcessId, "GetProcessId"}, - FunctionInfo{3, nullptr, "HookToCreateProcess"}, - FunctionInfo{4, &DebugMonitor::GetApplicationProcessId, "GetApplicationProcessId"}, - FunctionInfo{5, nullptr, "HookToCreateApplicationProgress"}, - FunctionInfo{6, nullptr, "ClearHook"}, - FunctionInfo{65000, &DebugMonitor::AtmosphereGetProcessInfo, "AtmosphereGetProcessInfo"}, - FunctionInfo{65001, nullptr, "AtmosphereGetCurrentLimitInfo"} - ); }; class Info final : public ServiceFramework { public: - explicit Info(Core::System& system_) : ServiceFramework{system_, "pm:info"} {} + explicit Info(Core::System& system_) : ServiceFramework{system_, "pm:info"} { + static const FunctionInfo functions[] = { + {0, &Info::GetProgramId, "GetProgramId"}, + {65000, &Info::AtmosphereGetProcessId, "AtmosphereGetProcessId"}, + {65001, nullptr, "AtmosphereHasLaunchedProgram"}, + {65002, nullptr, "AtmosphereGetProcessInfo"}, + }; + RegisterHandlers(functions); + } private: void GetProgramId(HLERequestContext& ctx) { @@ -210,24 +218,27 @@ private: rb.Push(ResultSuccess); rb.Push(process->GetProcessId()); } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &Info::GetProgramId, "GetProgramId"}, - FunctionInfo{65000, &Info::AtmosphereGetProcessId, "AtmosphereGetProcessId"}, - FunctionInfo{65001, nullptr, "AtmosphereHasLaunchedProgram"}, - FunctionInfo{65002, nullptr, "AtmosphereGetProcessInfo"} - ); }; class Shell final : public ServiceFramework { public: - explicit Shell(Core::System& system_) : ServiceFramework{system_, "pm:shell"} {} + explicit Shell(Core::System& system_) : ServiceFramework{system_, "pm:shell"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "LaunchProgram"}, + {1, nullptr, "TerminateProcess"}, + {2, nullptr, "TerminateProgram"}, + {3, nullptr, "GetProcessEventHandle"}, + {4, nullptr, "GetProcessEventInfo"}, + {5, nullptr, "NotifyBootFinished"}, + {6, &Shell::GetApplicationProcessIdForShell, "GetApplicationProcessIdForShell"}, + {7, nullptr, "BoostSystemMemoryResourceLimit"}, + {8, nullptr, "BoostApplicationThreadResourceLimit"}, + {9, nullptr, "GetBootFinishedEventHandle"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -236,19 +247,6 @@ private: auto list = kernel.GetProcessList(); GetApplicationPidGeneric(system.Kernel(), ctx, list); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "LaunchProgram"}, - FunctionInfo{1, nullptr, "TerminateProcess"}, - FunctionInfo{2, nullptr, "TerminateProgram"}, - FunctionInfo{3, nullptr, "GetProcessEventHandle"}, - FunctionInfo{4, nullptr, "GetProcessEventInfo"}, - FunctionInfo{5, nullptr, "NotifyBootFinished"}, - FunctionInfo{6, &Shell::GetApplicationProcessIdForShell, "GetApplicationProcessIdForShell"}, - FunctionInfo{7, nullptr, "BoostSystemMemoryResourceLimit"}, - FunctionInfo{8, nullptr, "BoostApplicationThreadResourceLimit"}, - FunctionInfo{9, nullptr, "GetBootFinishedEventHandle"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/pm/pm.h b/src/core/hle/service/pm/pm.h index 5d4a1a171c..da70cfc6b8 100644 --- a/src/core/hle/service/pm/pm.h +++ b/src/core/hle/service/pm/pm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index a199c41d2c..e76c3ea93c 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp @@ -21,10 +21,45 @@ namespace Service::PlayReport { class PlayReport final : public ServiceFramework { public: - explicit PlayReport(const char* name, Core::System& system_) : ServiceFramework{system_, name} {} + explicit PlayReport(const char* name, Core::System& system_) : ServiceFramework{system_, name} { + // clang-format off + static const FunctionInfo functions[] = { + {10100, &PlayReport::SaveReport, "SaveReportOld"}, + {10101, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld"}, + {10102, &PlayReport::SaveReport, "SaveReportOld2"}, + {10103, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld2"}, + {10104, &PlayReport::SaveReport, "SaveReportOld3"}, + {10105, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld3"}, + {10106, &PlayReport::SaveReport, "SaveReport"}, + {10107, &PlayReport::SaveReportWithUser, "SaveReportWithUser"}, + {10200, &PlayReport::RequestImmediateTransmission, "RequestImmediateTransmission"}, + {10300, &PlayReport::GetTransmissionStatus, "GetTransmissionStatus"}, + {10400, &PlayReport::GetSystemSessionId, "GetSystemSessionId"}, + {20100, &PlayReport::SaveSystemReportOld, "SaveSystemReport"}, + {20101, &PlayReport::SaveSystemReportWithUserOld, "SaveSystemReportWithUser"}, + {20102, &PlayReport::SaveSystemReport, "SaveSystemReport"}, + {20103, &PlayReport::SaveSystemReportWithUser, "SaveSystemReportWithUser"}, + {20200, nullptr, "SetOperationMode"}, + {30100, nullptr, "ClearStorage"}, + {30200, nullptr, "ClearStatistics"}, + {30300, nullptr, "GetStorageUsage"}, + {30400, nullptr, "GetStatistics"}, + {30401, nullptr, "GetThroughputHistory"}, + {30500, nullptr, "GetLastUploadError"}, + {30600, nullptr, "GetApplicationUploadSummary"}, + {40100, nullptr, "IsUserAgreementCheckEnabled"}, + {40101, nullptr, "SetUserAgreementCheckEnabled"}, + {50100, nullptr, "ReadAllApplicationReportFiles"}, + {90100, nullptr, "ReadAllReportFiles"}, + {90101, nullptr, "Unknown90101"}, + {90102, nullptr, "Unknown90102"}, + {90200, nullptr, "GetStatistics"}, + {90201, nullptr, "GetThroughputHistory"}, + {90300, nullptr, "GetLastUploadError"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -179,51 +214,21 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{10100, &PlayReport::SaveReport, "SaveReportOld"}, - FunctionInfo{10101, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld"}, - FunctionInfo{10102, &PlayReport::SaveReport, "SaveReportOld2"}, - FunctionInfo{10103, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld2"}, - FunctionInfo{10104, &PlayReport::SaveReport, "SaveReportOld3"}, - FunctionInfo{10105, &PlayReport::SaveReportWithUser, "SaveReportWithUserOld3"}, - FunctionInfo{10106, &PlayReport::SaveReport, "SaveReport"}, - FunctionInfo{10107, &PlayReport::SaveReportWithUser, "SaveReportWithUser"}, - FunctionInfo{10200, &PlayReport::RequestImmediateTransmission, "RequestImmediateTransmission"}, - FunctionInfo{10300, &PlayReport::GetTransmissionStatus, "GetTransmissionStatus"}, - FunctionInfo{10400, &PlayReport::GetSystemSessionId, "GetSystemSessionId"}, - FunctionInfo{20100, &PlayReport::SaveSystemReportOld, "SaveSystemReport"}, - FunctionInfo{20101, &PlayReport::SaveSystemReportWithUserOld, "SaveSystemReportWithUser"}, - FunctionInfo{20102, &PlayReport::SaveSystemReport, "SaveSystemReport"}, - FunctionInfo{20103, &PlayReport::SaveSystemReportWithUser, "SaveSystemReportWithUser"}, - FunctionInfo{20200, nullptr, "SetOperationMode"}, - FunctionInfo{30100, nullptr, "ClearStorage"}, - FunctionInfo{30200, nullptr, "ClearStatistics"}, - FunctionInfo{30300, nullptr, "GetStorageUsage"}, - FunctionInfo{30400, nullptr, "GetStatistics"}, - FunctionInfo{30401, nullptr, "GetThroughputHistory"}, - FunctionInfo{30500, nullptr, "GetLastUploadError"}, - FunctionInfo{30600, nullptr, "GetApplicationUploadSummary"}, - FunctionInfo{40100, nullptr, "IsUserAgreementCheckEnabled"}, - FunctionInfo{40101, nullptr, "SetUserAgreementCheckEnabled"}, - FunctionInfo{50100, nullptr, "ReadAllApplicationReportFiles"}, - FunctionInfo{90100, nullptr, "ReadAllReportFiles"}, - FunctionInfo{90101, nullptr, "Unknown90101"}, - FunctionInfo{90102, nullptr, "Unknown90102"}, - FunctionInfo{90200, nullptr, "GetStatistics"}, - FunctionInfo{90201, nullptr, "GetThroughputHistory"}, - FunctionInfo{90300, nullptr, "GetLastUploadError"} - ); }; void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); - server_manager->RegisterNamedService("prepo:a", std::make_shared("prepo:a", system)); - server_manager->RegisterNamedService("prepo:a2", std::make_shared("prepo:a2", system)); - server_manager->RegisterNamedService("prepo:m", std::make_shared("prepo:m", system)); - server_manager->RegisterNamedService("prepo:s", std::make_shared("prepo:s", system)); - server_manager->RegisterNamedService("prepo:u", std::make_shared("prepo:u", system)); + server_manager->RegisterNamedService("prepo:a", + std::make_shared("prepo:a", system)); + server_manager->RegisterNamedService("prepo:a2", + std::make_shared("prepo:a2", system)); + server_manager->RegisterNamedService("prepo:m", + std::make_shared("prepo:m", system)); + server_manager->RegisterNamedService("prepo:s", + std::make_shared("prepo:s", system)); + server_manager->RegisterNamedService("prepo:u", + std::make_shared("prepo:u", system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/prepo/prepo.h b/src/core/hle/service/prepo/prepo.h index 2c2462f936..4caf752888 100644 --- a/src/core/hle/service/prepo/prepo.h +++ b/src/core/hle/service/prepo/prepo.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/ovln/ovln_types.h b/src/core/hle/service/psc/ovln/ovln_types.h index f96b52fb49..d827f039fe 100644 --- a/src/core/hle/service/psc/ovln/ovln_types.h +++ b/src/core/hle/service/psc/ovln/ovln_types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project diff --git a/src/core/hle/service/psc/ovln/receiver.cpp b/src/core/hle/service/psc/ovln/receiver.cpp new file mode 100644 index 0000000000..f43d705126 --- /dev/null +++ b/src/core/hle/service/psc/ovln/receiver.cpp @@ -0,0 +1,118 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/psc/ovln/receiver.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::PSC { + +IReceiver::IReceiver(Core::System& system_) + : ServiceFramework{system_, "IReceiver"}, service_context{system_, "IReceiver"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IReceiver::AddSource>, "AddSource"}, + {1, D<&IReceiver::RemoveSource>, "RemoveSource"}, + {2, D<&IReceiver::GetReceiveEventHandle>, "GetReceiveEventHandle"}, + {3, D<&IReceiver::Receive>, "Receive"}, + {4, D<&IReceiver::ReceiveWithTick>, "ReceiveWithTick"}, + }; + // clang-format on + + RegisterHandlers(functions); + + receive_event = service_context.CreateEvent("IReceiver::ReceiveEvent"); +} + +IReceiver::~IReceiver() { + service_context.CloseEvent(receive_event); +} + +Result IReceiver::AddSource(SourceName source_name) { + const std::string name = source_name.GetString(); + LOG_INFO(Service_PSC, "called: source_name={}", name); + + // Add source if it doesn't already exist + if (message_sources.find(name) == message_sources.end()) { + message_sources[name] = {}; + } + + R_SUCCEED(); +} + +Result IReceiver::RemoveSource(SourceName source_name) { + const std::string name = source_name.GetString(); + LOG_INFO(Service_PSC, "called: source_name={}", name); + + // Remove source if it exists + message_sources.erase(name); + + R_SUCCEED(); +} + +Result IReceiver::GetReceiveEventHandle(OutCopyHandle out_event) { + LOG_INFO(Service_PSC, "called"); + *out_event = &receive_event->GetReadableEvent(); + R_SUCCEED(); +} + +Result IReceiver::Receive(Out out_notification, Out out_flags) { + u64 tick; + return ReceiveWithTick(out_notification, out_flags, Out(&tick)); +} + +Result IReceiver::ReceiveWithTick(Out out_notification, + Out out_flags, Out out_tick) { + LOG_DEBUG(Service_PSC, "called"); + + // Find the message with the lowest ID across all sources + const std::string* target_source = nullptr; + size_t target_index = 0; + + for (const auto& [source_name, messages] : message_sources) { + if (!messages.empty()) { + if (target_source == nullptr) { + target_source = &source_name; + target_index = 0; + } + // Note: In the real implementation, we would track message IDs + // For now, just use FIFO order + } + } + + if (target_source != nullptr) { + auto& messages = message_sources[*target_source]; + *out_notification = messages[target_index].first; + *out_flags = messages[target_index].second; + *out_tick = 0; // TODO: Implement tick tracking + + // Remove the message + messages.erase(messages.begin() + target_index); + + // Clear event if no more messages + bool has_messages = false; + for (const auto& [_, msgs] : message_sources) { + if (!msgs.empty()) { + has_messages = true; + break; + } + } + if (!has_messages) { + receive_event->Clear(system.Kernel()); + } + + R_SUCCEED(); + } + + // No messages available + *out_notification = {}; + *out_flags = {}; + *out_tick = 0; + + LOG_WARNING(Service_PSC, "No messages available"); + R_THROW(ResultUnknown); // TODO: Use proper OvlnResult::NoMessages when available +} + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/receiver.h b/src/core/hle/service/psc/ovln/receiver.h new file mode 100644 index 0000000000..5f73d1a66c --- /dev/null +++ b/src/core/hle/service/psc/ovln/receiver.h @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include +#include +#include "core/hle/result.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/service.h" +#include "core/hle/service/psc/ovln/ovln_types.h" + +namespace Kernel { +class KReadableEvent; +} + +namespace Service::PSC { + +class IReceiver final : public ServiceFramework { +public: + explicit IReceiver(Core::System& system_); + ~IReceiver() override; + + IReceiver(const IReceiver&) = delete; + IReceiver& operator=(const IReceiver&) = delete; + +private: + Result AddSource(SourceName source_name); + Result RemoveSource(SourceName source_name); + Result GetReceiveEventHandle(OutCopyHandle out_event); + Result Receive(Out out_notification, Out out_flags); + Result ReceiveWithTick(Out out_notification, Out out_flags, + Out out_tick); + + KernelHelpers::ServiceContext service_context; + Kernel::KEvent* receive_event; + + std::map>> message_sources; +}; + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/receiver_service.cpp b/src/core/hle/service/psc/ovln/receiver_service.cpp index 0df9d802b9..3b0b180725 100644 --- a/src/core/hle/service/psc/ovln/receiver_service.cpp +++ b/src/core/hle/service/psc/ovln/receiver_service.cpp @@ -5,126 +5,19 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/psc/ovln/ovln_types.h" +#include "core/hle/service/psc/ovln/receiver.h" #include "core/hle/service/psc/ovln/receiver_service.h" namespace Service::PSC { -class IReceiver final : public ServiceFramework { -public: - explicit IReceiver(Core::System& system_) : ServiceFramework{system_, "IReceiver"}, service_context{system_, "IReceiver"} { - receive_event = service_context.CreateEvent("IReceiver::ReceiveEvent"); - } - - ~IReceiver() override { - service_context.CloseEvent(receive_event); - } - - Result AddSource(SourceName source_name) { - const std::string name = source_name.GetString(); - LOG_INFO(Service_PSC, "called: source_name={}", name); - // Add source if it doesn't already exist - if (message_sources.find(name) == message_sources.end()) { - message_sources[name] = {}; - } - R_SUCCEED(); - } - - Result RemoveSource(SourceName source_name) { - const std::string name = source_name.GetString(); - LOG_INFO(Service_PSC, "called: source_name={}", name); - // Remove source if it exists - message_sources.erase(name); - R_SUCCEED(); - } - - Result GetReceiveEventHandle(OutCopyHandle out_event) { - LOG_INFO(Service_PSC, "called"); - *out_event = &receive_event->GetReadableEvent(); - R_SUCCEED(); - } - - Result Receive(Out out_notification, Out out_flags) { - u64 tick; - return ReceiveWithTick(out_notification, out_flags, Out(&tick)); - } - - Result ReceiveWithTick(Out out_notification, Out out_flags, Out out_tick) { - LOG_DEBUG(Service_PSC, "called"); - - // Find the message with the lowest ID across all sources - const std::string* target_source = nullptr; - size_t target_index = 0; - - for (const auto& [source_name, messages] : message_sources) { - if (!messages.empty()) { - if (target_source == nullptr) { - target_source = &source_name; - target_index = 0; - } - // Note: In the real implementation, we would track message IDs - // For now, just use FIFO order - } - } - - if (target_source != nullptr) { - auto& messages = message_sources[*target_source]; - *out_notification = messages[target_index].first; - *out_flags = messages[target_index].second; - *out_tick = 0; // TODO: Implement tick tracking - - // Remove the message - messages.erase(messages.begin() + target_index); - - // Clear event if no more messages - bool has_messages = false; - for (const auto& [_, msgs] : message_sources) { - if (!msgs.empty()) { - has_messages = true; - break; - } - } - if (!has_messages) { - receive_event->Clear(system.Kernel()); - } - - R_SUCCEED(); - } - - // No messages available - *out_notification = {}; - *out_flags = {}; - *out_tick = 0; - - LOG_WARNING(Service_PSC, "No messages available"); - R_THROW(ResultUnknown); // TODO: Use proper OvlnResult::NoMessages when available - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IReceiver::AddSource>, "AddSource"}, - FunctionInfo{1, D<&IReceiver::RemoveSource>, "RemoveSource"}, - FunctionInfo{2, D<&IReceiver::GetReceiveEventHandle>, "GetReceiveEventHandle"}, - FunctionInfo{3, D<&IReceiver::Receive>, "Receive"}, - FunctionInfo{4, D<&IReceiver::ReceiveWithTick>, "ReceiveWithTick"} - ); - - KernelHelpers::ServiceContext service_context; - Kernel::KEvent* receive_event; - - std::map>> message_sources; -}; - -std::optional IReceiverService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IReceiverService::OpenReceiver>, "OpenReceiver"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IReceiverService::IReceiverService(Core::System& system_) : ServiceFramework{system_, "ovln:rcv"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IReceiverService::OpenReceiver>, "OpenReceiver"}, + }; + // clang-format on + + RegisterHandlers(functions); } IReceiverService::~IReceiverService() = default; diff --git a/src/core/hle/service/psc/ovln/receiver_service.h b/src/core/hle/service/psc/ovln/receiver_service.h index bd053cd50c..a7a9b012e8 100644 --- a/src/core/hle/service/psc/ovln/receiver_service.h +++ b/src/core/hle/service/psc/ovln/receiver_service.h @@ -20,8 +20,6 @@ public: private: Result OpenReceiver(Out> out_receiver); - - std::optional FindRequest(u32 key) override; }; } // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/sender.cpp b/src/core/hle/service/psc/ovln/sender.cpp new file mode 100644 index 0000000000..dffcd4bc36 --- /dev/null +++ b/src/core/hle/service/psc/ovln/sender.cpp @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/psc/ovln/sender.h" + +namespace Service::PSC { + +ISender::ISender(Core::System& system_) : ServiceFramework{system_, "ISender"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ISender::Send>, "Send"}, + {1, nullptr, "GetUnreceivedMessageCount"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +ISender::~ISender() = default; + +Result ISender::Send(const OverlayNotification& notification, MessageFlags flags) { + std::string data; + for (const auto m : notification) { + data += fmt::format("{:016X} ", m); + } + + LOG_WARNING(Service_PSC, "(STUBBED) called, flags={} notification={}", flags.raw, data); + R_SUCCEED(); +} + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/sender.h b/src/core/hle/service/psc/ovln/sender.h new file mode 100644 index 0000000000..9b0fe786bd --- /dev/null +++ b/src/core/hle/service/psc/ovln/sender.h @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/psc/ovln/ovln_types.h" +#include "core/hle/service/service.h" + +namespace Service::PSC { + +class ISender final : public ServiceFramework { +public: + explicit ISender(Core::System& system_); + ~ISender() override; + +private: + Result Send(const OverlayNotification& notification, MessageFlags flags); +}; + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/ovln/sender_service.cpp b/src/core/hle/service/psc/ovln/sender_service.cpp index 5a36f1e1ec..8f80a5c461 100644 --- a/src/core/hle/service/psc/ovln/sender_service.cpp +++ b/src/core/hle/service/psc/ovln/sender_service.cpp @@ -5,43 +5,19 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/psc/ovln/ovln_types.h" +#include "core/hle/service/psc/ovln/sender.h" #include "core/hle/service/psc/ovln/sender_service.h" namespace Service::PSC { -class ISender final : public ServiceFramework { -public: - explicit ISender(Core::System& system_) : ServiceFramework{system_, "ISender"} {} - ~ISender() override = default; - - Result Send(const OverlayNotification& notification, MessageFlags flags) { - std::string data; - for (const auto m : notification) { - data += fmt::format("{:016X} ", m); - } - - LOG_WARNING(Service_PSC, "(STUBBED) called, flags={} notification={}", flags.raw, data); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ISender::Send>, "Send"}, - FunctionInfo{1, nullptr, "GetUnreceivedMessageCount"} - ); -}; - -std::optional ISenderService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ISenderService::OpenSender>, "OpenSender"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - ISenderService::ISenderService(Core::System& system_) : ServiceFramework{system_, "ovln:snd"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ISenderService::OpenSender>, "OpenSender"}, + }; + // clang-format on + + RegisterHandlers(functions); } ISenderService::~ISenderService() = default; diff --git a/src/core/hle/service/psc/ovln/sender_service.h b/src/core/hle/service/psc/ovln/sender_service.h index 90a9a33872..8176e85e23 100644 --- a/src/core/hle/service/psc/ovln/sender_service.h +++ b/src/core/hle/service/psc/ovln/sender_service.h @@ -19,9 +19,8 @@ public: ~ISenderService() override; private: - Result OpenSender(Out> out_sender, u32 sender_id, std::array data); - - std::optional FindRequest(u32 key) override; + Result OpenSender(Out> out_sender, u32 sender_id, + std::array data); }; } // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_control.cpp b/src/core/hle/service/psc/pm_control.cpp new file mode 100644 index 0000000000..fc5852f863 --- /dev/null +++ b/src/core/hle/service/psc/pm_control.cpp @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/psc/pm_control.h" + +namespace Service::PSC { + +IPmControl::IPmControl(Core::System& system_) : ServiceFramework{system_, "psc:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "DispatchRequest"}, + {2, nullptr, "GetResult"}, + {3, nullptr, "GetState"}, + {4, nullptr, "Cancel"}, + {5, nullptr, "PrintModuleInformation"}, + {6, nullptr, "GetModuleInformation"}, + {10, nullptr, "AcquireStateLock"}, + {11, nullptr, "HasStateLock"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IPmControl::~IPmControl() = default; + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_control.h b/src/core/hle/service/psc/pm_control.h new file mode 100644 index 0000000000..7967f7ab18 --- /dev/null +++ b/src/core/hle/service/psc/pm_control.h @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/service.h" + +namespace Service::PSC { + +class IPmControl final : public ServiceFramework { +public: + explicit IPmControl(Core::System& system_); + ~IPmControl() override; +}; + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_module.cpp b/src/core/hle/service/psc/pm_module.cpp new file mode 100644 index 0000000000..38ca36ab8f --- /dev/null +++ b/src/core/hle/service/psc/pm_module.cpp @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/psc/pm_module.h" + +namespace Service::PSC { + +IPmModule::IPmModule(Core::System& system_) : ServiceFramework{system_, "IPmModule"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "GetRequest"}, + {2, nullptr, "Acknowledge"}, + {3, nullptr, "Finalize"}, + {4, nullptr, "AcknowledgeEx"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IPmModule::~IPmModule() = default; + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_module.h b/src/core/hle/service/psc/pm_module.h new file mode 100644 index 0000000000..dac8fcff2a --- /dev/null +++ b/src/core/hle/service/psc/pm_module.h @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/service.h" + +namespace Service::PSC { + +class IPmModule final : public ServiceFramework { +public: + explicit IPmModule(Core::System& system_); + ~IPmModule() override; +}; + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_service.cpp b/src/core/hle/service/psc/pm_service.cpp new file mode 100644 index 0000000000..d1803bdf48 --- /dev/null +++ b/src/core/hle/service/psc/pm_service.cpp @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/psc/pm_module.h" +#include "core/hle/service/psc/pm_service.h" + +namespace Service::PSC { + +IPmService::IPmService(Core::System& system_) : ServiceFramework{system_, "psc:m"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IPmService::GetPmModule>, "GetPmModule"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IPmService::~IPmService() = default; + +Result IPmService::GetPmModule(Out> out_module) { + LOG_DEBUG(Service_PSC, "called"); + *out_module = std::make_shared(system); + R_SUCCEED(); +} + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/pm_service.h b/src/core/hle/service/psc/pm_service.h new file mode 100644 index 0000000000..721a0602c9 --- /dev/null +++ b/src/core/hle/service/psc/pm_service.h @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::PSC { + +class IPmModule; + +class IPmService final : public ServiceFramework { +public: + explicit IPmService(Core::System& system_); + ~IPmService() override; + +private: + Result GetPmModule(Out> out_module); +}; + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/psc.cpp b/src/core/hle/service/psc/psc.cpp index 553c4f63a4..31fb9f0117 100644 --- a/src/core/hle/service/psc/psc.cpp +++ b/src/core/hle/service/psc/psc.cpp @@ -6,159 +6,102 @@ #include "core/hle/service/psc/ovln/receiver_service.h" #include "core/hle/service/psc/ovln/sender_service.h" +#include "core/hle/service/psc/pm_control.h" +#include "core/hle/service/psc/pm_service.h" #include "core/hle/service/psc/psc.h" #include "core/hle/service/psc/time/manager.h" #include "core/hle/service/psc/time/power_state_service.h" #include "core/hle/service/psc/time/service_manager.h" #include "core/hle/service/psc/time/static.h" #include "core/hle/service/service.h" -#include "core/hle/service/cmif_serialization.h" namespace Service::PSC { class PSC_L final : public ServiceFramework { public: - explicit PSC_L(Core::System& system_) : ServiceFramework{system_, "psc:l"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize_3"}, - FunctionInfo{1, nullptr, "Lock"}, - FunctionInfo{2, nullptr, "Unlock"}, - FunctionInfo{3, nullptr, "IsLocked"}, - FunctionInfo{4, nullptr, "GetRelatedState"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit PSC_L(Core::System& system_) : ServiceFramework{system_, "psc:l"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize_3"}, + {1, nullptr, "Lock"}, + {2, nullptr, "Unlock"}, + {3, nullptr, "IsLocked"}, + {4, nullptr, "GetRelatedState"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class INS_R final : public ServiceFramework { public: - explicit INS_R(Core::System& system_) : ServiceFramework{system_, "ins:r"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetInputSourceState"}, - FunctionInfo{1, nullptr, "GetTriggerTargetEvent"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit INS_R(Core::System& system_) : ServiceFramework{system_, "ins:r"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetInputSourceState"}, + {1, nullptr, "GetTriggerTargetEvent"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class INS_S final : public ServiceFramework { public: - explicit INS_S(Core::System& system_) : ServiceFramework{system_, "ins:s"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetNotifyEvent"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit INS_S(Core::System& system_) : ServiceFramework{system_, "ins:s"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetNotifyEvent"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class HSHL_SYS final : public ServiceFramework { public: - explicit HSHL_SYS(Core::System& system_) : ServiceFramework{system_, "hshl:sys"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetBatteryPercentage"}, - FunctionInfo{1, nullptr, "GetChargerType"}, - FunctionInfo{2, nullptr, "OpenChargeSession"}, - FunctionInfo{3, nullptr, "GetRawBatteryPercentage"}, - FunctionInfo{4, nullptr, "GetBatteryVoltageLevel"}, - FunctionInfo{5, nullptr, "OpenThermalSession"}, - FunctionInfo{6, nullptr, "GetAbnormalTemperatureSet"}, - FunctionInfo{7, nullptr, "OpenClockSession"}, - FunctionInfo{8, nullptr, "GetClockRate"}, - FunctionInfo{9, nullptr, "OpenBridgeSession"}, - FunctionInfo{10, nullptr, "GetBridgePowerSupply"}, - FunctionInfo{11, nullptr, "OpenVsysVoltageSession"}, - FunctionInfo{12, nullptr, "GetIsBatteryEnoughForFullAwake"}, - FunctionInfo{13, nullptr, "GetIsCharging"}, - FunctionInfo{14, nullptr, "Cmd14"}, - FunctionInfo{15, nullptr, "Cmd15"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit HSHL_SYS(Core::System& system_) : ServiceFramework{system_, "hshl:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetBatteryPercentage"}, + {1, nullptr, "GetChargerType"}, + {2, nullptr, "OpenChargeSession"}, + {3, nullptr, "GetRawBatteryPercentage"}, + {4, nullptr, "GetBatteryVoltageLevel"}, + {5, nullptr, "OpenThermalSession"}, + {6, nullptr, "GetAbnormalTemperatureSet"}, + {7, nullptr, "OpenClockSession"}, + {8, nullptr, "GetClockRate"}, + {9, nullptr, "OpenBridgeSession"}, + {10, nullptr, "GetBridgePowerSupply"}, + {11, nullptr, "OpenVsysVoltageSession"}, + {12, nullptr, "GetIsBatteryEnoughForFullAwake"}, + {13, nullptr, "GetIsCharging"}, + {14, nullptr, "Cmd14"}, + {15, nullptr, "Cmd15"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class HSHL_SET final : public ServiceFramework { public: - explicit HSHL_SET(Core::System& system_) : ServiceFramework{system_, "hshl:set"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenChargeSession_2"}, - FunctionInfo{1, nullptr, "OpenThermalSession_2"}, - FunctionInfo{2, nullptr, "SetClockRate"}, - FunctionInfo{3, nullptr, "SetBridgePowerSupply"}, - FunctionInfo{4, nullptr, "Cmd4"}, - FunctionInfo{5, nullptr, "Cmd5"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit HSHL_SET(Core::System& system_) : ServiceFramework{system_, "hshl:set"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenChargeSession_2"}, + {1, nullptr, "OpenThermalSession_2"}, + {2, nullptr, "SetClockRate"}, + {3, nullptr, "SetBridgePowerSupply"}, + {4, nullptr, "Cmd4"}, + {5, nullptr, "Cmd5"}, + }; + // clang-format on + RegisterHandlers(functions); } }; -class IPmModule final : public ServiceFramework { -public: - explicit IPmModule(Core::System& system_) : ServiceFramework{system_, "IPmModule"} {} - ~IPmModule() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{1, nullptr, "GetRequest"}, - FunctionInfo{2, nullptr, "Acknowledge"}, - FunctionInfo{3, nullptr, "Finalize"}, - FunctionInfo{4, nullptr, "AcknowledgeEx"} - ); -}; - -class IPmService final : public ServiceFramework { -public: - explicit IPmService(Core::System& system_) : ServiceFramework{system_, "psc:m"} {} - ~IPmService() override = default; - -private: - Result GetPmModule(Out> out_module) { - LOG_DEBUG(Service_PSC, "called"); - *out_module = std::make_shared(system); - R_SUCCEED(); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IPmService::GetPmModule>, "GetPmModule"} - ); -}; - -class IPmControl final : public ServiceFramework { -public: - explicit IPmControl(Core::System& system_) : ServiceFramework{system_, "psc:c"} {} - ~IPmControl() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{1, nullptr, "DispatchRequest"}, - FunctionInfo{2, nullptr, "GetResult"}, - FunctionInfo{3, nullptr, "GetState"}, - FunctionInfo{4, nullptr, "Cancel"}, - FunctionInfo{5, nullptr, "PrintModuleInformation"}, - FunctionInfo{6, nullptr, "GetModuleInformation"}, - FunctionInfo{10, nullptr, "AcquireStateLock"}, - FunctionInfo{11, nullptr, "HasStateLock"} - ); -}; - void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); diff --git a/src/core/hle/service/psc/psc.h b/src/core/hle/service/psc/psc.h index c83d07ca80..d89e6854cc 100644 --- a/src/core/hle/service/psc/psc.h +++ b/src/core/hle/service/psc/psc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/alarms.cpp b/src/core/hle/service/psc/time/alarms.cpp index c9070896b3..17a795c4c5 100644 --- a/src/core/hle/service/psc/time/alarms.cpp +++ b/src/core/hle/service/psc/time/alarms.cpp @@ -33,7 +33,8 @@ Alarm::~Alarm() { } Alarms::Alarms(Core::System& system, StandardSteadyClockCore& steady_clock, PowerStateRequestManager& power_state_request_manager) - : m_ctx{system, "Psc:Alarms"} + : m_system{system} + , m_ctx{system, "Psc:Alarms"} , m_steady_clock{steady_clock} , m_power_state_request_manager{power_state_request_manager} , m_event{m_ctx.CreateEvent("Psc:Alarms:Event")} @@ -135,7 +136,15 @@ Result Alarms::UpdateClosestAndSignal(Kernel::KernelCore& kernel) { IAlarmService::IAlarmService(Core::System& system_, std::shared_ptr manager) : ServiceFramework{system_, "time:al"} , m_alarms{manager->m_alarms} -{} +{ + // clang-format off + static const FunctionInfo functions[] = { + {0, &IAlarmService::CreateWakeupAlarm, "CreateWakeupAlarm"}, + {1, &IAlarmService::CreateBackgroundTaskAlarm, "CreateBackgroundTaskAlarm"}, + }; + // clang-format on + RegisterHandlers(functions); +} void IAlarmService::CreateWakeupAlarm(HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called."); @@ -156,6 +165,17 @@ void IAlarmService::CreateBackgroundTaskAlarm(HLERequestContext& ctx) { ISteadyClockAlarm::ISteadyClockAlarm(Core::System& system_, Alarms& alarms, AlarmType type) : ServiceFramework{system_, "ISteadyClockAlarm"}, m_ctx{system, "Psc:ISteadyClockAlarm"}, m_alarms{alarms}, m_alarm{system, m_ctx, type} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &ISteadyClockAlarm::GetAlarmEvent, "GetAlarmEvent"}, + {1, &ISteadyClockAlarm::Enable, "Enable"}, + {2, &ISteadyClockAlarm::Disable, "Disable"}, + {3, &ISteadyClockAlarm::IsEnabled, "IsEnabled"}, + {10, nullptr, "CreateWakeLock"}, + {11, nullptr, "DestroyWakeLock"}, + }; + // clang-format on + RegisterHandlers(functions); } void ISteadyClockAlarm::GetAlarmEvent(HLERequestContext& ctx) { diff --git a/src/core/hle/service/psc/time/alarms.h b/src/core/hle/service/psc/time/alarms.h index 6d916ca198..0a2fa7fac5 100644 --- a/src/core/hle/service/psc/time/alarms.h +++ b/src/core/hle/service/psc/time/alarms.h @@ -95,6 +95,7 @@ private: void Erase(Kernel::KernelCore& kernel, Alarm& alarm); Result UpdateClosestAndSignal(Kernel::KernelCore& kernel); + Core::System& m_system; KernelHelpers::ServiceContext m_ctx; StandardSteadyClockCore& m_steady_clock; @@ -113,14 +114,6 @@ public: private: void CreateWakeupAlarm(HLERequestContext& ctx); void CreateBackgroundTaskAlarm(HLERequestContext& ctx); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IAlarmService::CreateWakeupAlarm, "CreateWakeupAlarm"}, - FunctionInfo{1, &IAlarmService::CreateBackgroundTaskAlarm, "CreateBackgroundTaskAlarm"} - ); Alarms& m_alarms; }; @@ -135,18 +128,8 @@ private: void Disable(HLERequestContext& ctx); void IsEnabled(HLERequestContext& ctx); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ISteadyClockAlarm::GetAlarmEvent, "GetAlarmEvent"}, - FunctionInfo{1, &ISteadyClockAlarm::Enable, "Enable"}, - FunctionInfo{2, &ISteadyClockAlarm::Disable, "Disable"}, - FunctionInfo{3, &ISteadyClockAlarm::IsEnabled, "IsEnabled"}, - FunctionInfo{10, nullptr, "CreateWakeLock"}, - FunctionInfo{11, nullptr, "DestroyWakeLock"} - ); KernelHelpers::ServiceContext m_ctx; + Alarms& m_alarms; Alarm m_alarm; }; diff --git a/src/core/hle/service/psc/time/clocks/ephemeral_network_system_clock_core.h b/src/core/hle/service/psc/time/clocks/ephemeral_network_system_clock_core.h index 0a68867d94..0abe200206 100644 --- a/src/core/hle/service/psc/time/clocks/ephemeral_network_system_clock_core.h +++ b/src/core/hle/service/psc/time/clocks/ephemeral_network_system_clock_core.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/standard_local_system_clock_core.cpp b/src/core/hle/service/psc/time/clocks/standard_local_system_clock_core.cpp index 6a74d45946..d0e596c504 100644 --- a/src/core/hle/service/psc/time/clocks/standard_local_system_clock_core.cpp +++ b/src/core/hle/service/psc/time/clocks/standard_local_system_clock_core.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/standard_local_system_clock_core.h b/src/core/hle/service/psc/time/clocks/standard_local_system_clock_core.h index 5722d8e965..832c6907a0 100644 --- a/src/core/hle/service/psc/time/clocks/standard_local_system_clock_core.h +++ b/src/core/hle/service/psc/time/clocks/standard_local_system_clock_core.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/standard_network_system_clock_core.cpp b/src/core/hle/service/psc/time/clocks/standard_network_system_clock_core.cpp index 6938d369fe..b3143ead71 100644 --- a/src/core/hle/service/psc/time/clocks/standard_network_system_clock_core.cpp +++ b/src/core/hle/service/psc/time/clocks/standard_network_system_clock_core.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/standard_network_system_clock_core.h b/src/core/hle/service/psc/time/clocks/standard_network_system_clock_core.h index bfafc7d71f..47a411e811 100644 --- a/src/core/hle/service/psc/time/clocks/standard_network_system_clock_core.h +++ b/src/core/hle/service/psc/time/clocks/standard_network_system_clock_core.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/standard_steady_clock_core.cpp b/src/core/hle/service/psc/time/clocks/standard_steady_clock_core.cpp index 7a72d7aa25..8fc44fd691 100644 --- a/src/core/hle/service/psc/time/clocks/standard_steady_clock_core.cpp +++ b/src/core/hle/service/psc/time/clocks/standard_steady_clock_core.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/standard_steady_clock_core.h b/src/core/hle/service/psc/time/clocks/standard_steady_clock_core.h index bbf98fcd5c..342d6385fd 100644 --- a/src/core/hle/service/psc/time/clocks/standard_steady_clock_core.h +++ b/src/core/hle/service/psc/time/clocks/standard_steady_clock_core.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/standard_user_system_clock_core.h b/src/core/hle/service/psc/time/clocks/standard_user_system_clock_core.h index 32b8bc3bcd..14c8e613f4 100644 --- a/src/core/hle/service/psc/time/clocks/standard_user_system_clock_core.h +++ b/src/core/hle/service/psc/time/clocks/standard_user_system_clock_core.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/steady_clock_core.h b/src/core/hle/service/psc/time/clocks/steady_clock_core.h index f933cc15f8..31be5e25ad 100644 --- a/src/core/hle/service/psc/time/clocks/steady_clock_core.h +++ b/src/core/hle/service/psc/time/clocks/steady_clock_core.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/system_clock_core.cpp b/src/core/hle/service/psc/time/clocks/system_clock_core.cpp index 2b7466831d..7ca5e8515e 100644 --- a/src/core/hle/service/psc/time/clocks/system_clock_core.cpp +++ b/src/core/hle/service/psc/time/clocks/system_clock_core.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/system_clock_core.h b/src/core/hle/service/psc/time/clocks/system_clock_core.h index 0b928432fb..d95bab5191 100644 --- a/src/core/hle/service/psc/time/clocks/system_clock_core.h +++ b/src/core/hle/service/psc/time/clocks/system_clock_core.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/tick_based_steady_clock_core.cpp b/src/core/hle/service/psc/time/clocks/tick_based_steady_clock_core.cpp index 22da1fbccc..8666df57f1 100644 --- a/src/core/hle/service/psc/time/clocks/tick_based_steady_clock_core.cpp +++ b/src/core/hle/service/psc/time/clocks/tick_based_steady_clock_core.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/clocks/tick_based_steady_clock_core.h b/src/core/hle/service/psc/time/clocks/tick_based_steady_clock_core.h index a7bea86a25..62890cd5ca 100644 --- a/src/core/hle/service/psc/time/clocks/tick_based_steady_clock_core.h +++ b/src/core/hle/service/psc/time/clocks/tick_based_steady_clock_core.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/common.cpp b/src/core/hle/service/psc/time/common.cpp index a6d9f02ca3..dce2249ea1 100644 --- a/src/core/hle/service/psc/time/common.cpp +++ b/src/core/hle/service/psc/time/common.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/manager.h b/src/core/hle/service/psc/time/manager.h index 2cb8b58a2b..7c771d25f5 100644 --- a/src/core/hle/service/psc/time/manager.h +++ b/src/core/hle/service/psc/time/manager.h @@ -26,20 +26,20 @@ namespace Service::PSC::Time { class TimeManager { public: explicit TimeManager(Core::System& system) - : m_standard_steady_clock{system} - , m_tick_based_steady_clock{system} - , m_standard_local_system_clock{m_standard_steady_clock} - , m_standard_network_system_clock{m_standard_steady_clock} - , m_standard_user_system_clock{system, m_standard_local_system_clock - , m_standard_network_system_clock} - , m_ephemeral_network_clock{m_tick_based_steady_clock} - , m_shared_memory{system} - , m_power_state_request_manager{system} - , m_alarms{system, m_standard_steady_clock, m_power_state_request_manager} - , m_local_system_clock_context_writer{system, m_shared_memory} - , m_network_system_clock_context_writer{system, m_shared_memory, m_standard_user_system_clock} - , m_ephemeral_network_clock_context_writer{system} - {} + : m_system{system}, m_standard_steady_clock{system}, m_tick_based_steady_clock{m_system}, + m_standard_local_system_clock{m_standard_steady_clock}, + m_standard_network_system_clock{m_standard_steady_clock}, + m_standard_user_system_clock{m_system, m_standard_local_system_clock, + m_standard_network_system_clock}, + m_ephemeral_network_clock{m_tick_based_steady_clock}, m_shared_memory{m_system}, + m_power_state_request_manager{m_system}, m_alarms{m_system, m_standard_steady_clock, + m_power_state_request_manager}, + m_local_system_clock_context_writer{m_system, m_shared_memory}, + m_network_system_clock_context_writer{m_system, m_shared_memory, + m_standard_user_system_clock}, + m_ephemeral_network_clock_context_writer{m_system} {} + + Core::System& m_system; StandardSteadyClockCore m_standard_steady_clock; TickBasedSteadyClockCore m_tick_based_steady_clock; diff --git a/src/core/hle/service/psc/time/power_state_request_manager.h b/src/core/hle/service/psc/time/power_state_request_manager.h index 30a0c947d6..325f73913b 100644 --- a/src/core/hle/service/psc/time/power_state_request_manager.h +++ b/src/core/hle/service/psc/time/power_state_request_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/power_state_service.cpp b/src/core/hle/service/psc/time/power_state_service.cpp index 795aeb94a8..39af16b6f1 100644 --- a/src/core/hle/service/psc/time/power_state_service.cpp +++ b/src/core/hle/service/psc/time/power_state_service.cpp @@ -9,19 +9,20 @@ namespace Service::PSC::Time { -std::optional IPowerStateRequestHandler::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&IPowerStateRequestHandler::GetPowerStateRequestEventReadableHandle>, "GetPowerStateRequestEventReadableHandle"}, - FunctionInfo{1, D<&IPowerStateRequestHandler::GetAndClearPowerStateRequest>, "GetAndClearPowerStateRequest"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IPowerStateRequestHandler::IPowerStateRequestHandler( Core::System& system_, PowerStateRequestManager& power_state_request_manager) : ServiceFramework{system_, "time:p"} , m_power_state_request_manager{power_state_request_manager} -{} +{ + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IPowerStateRequestHandler::GetPowerStateRequestEventReadableHandle>, "GetPowerStateRequestEventReadableHandle"}, + {1, D<&IPowerStateRequestHandler::GetAndClearPowerStateRequest>, "GetAndClearPowerStateRequest"}, + }; + // clang-format on + + RegisterHandlers(functions); +} Result IPowerStateRequestHandler::GetPowerStateRequestEventReadableHandle( OutCopyHandle out_event) { diff --git a/src/core/hle/service/psc/time/power_state_service.h b/src/core/hle/service/psc/time/power_state_service.h index 14d9c1a77a..81b3adf234 100644 --- a/src/core/hle/service/psc/time/power_state_service.h +++ b/src/core/hle/service/psc/time/power_state_service.h @@ -27,7 +27,6 @@ public: Result GetAndClearPowerStateRequest(Out out_cleared, Out out_priority); private: - std::optional FindRequest(u32 key) override; PowerStateRequestManager& m_power_state_request_manager; }; diff --git a/src/core/hle/service/psc/time/service_manager.cpp b/src/core/hle/service/psc/time/service_manager.cpp index be25ee9a70..e9f1407e4d 100644 --- a/src/core/hle/service/psc/time/service_manager.cpp +++ b/src/core/hle/service/psc/time/service_manager.cpp @@ -13,30 +13,6 @@ namespace Service::PSC::Time { - std::optional ServiceManager::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ServiceManager::GetStaticServiceAsUser>, "GetStaticServiceAsUser"}, - FunctionInfo{5, D<&ServiceManager::GetStaticServiceAsAdmin>, "GetStaticServiceAsAdmin"}, - FunctionInfo{6, D<&ServiceManager::GetStaticServiceAsRepair>, "GetStaticServiceAsRepair"}, - FunctionInfo{9, D<&ServiceManager::GetStaticServiceAsServiceManager>, "GetStaticServiceAsServiceManager"}, - FunctionInfo{10, D<&ServiceManager::SetupStandardSteadyClockCore>, "SetupStandardSteadyClockCore"}, - FunctionInfo{11, D<&ServiceManager::SetupStandardLocalSystemClockCore>, "SetupStandardLocalSystemClockCore"}, - FunctionInfo{12, D<&ServiceManager::SetupStandardNetworkSystemClockCore>, "SetupStandardNetworkSystemClockCore"}, - FunctionInfo{13, D<&ServiceManager::SetupStandardUserSystemClockCore>, "SetupStandardUserSystemClockCore"}, - FunctionInfo{14, D<&ServiceManager::SetupTimeZoneServiceCore>, "SetupTimeZoneServiceCore"}, - FunctionInfo{15, D<&ServiceManager::SetupEphemeralNetworkSystemClockCore>, "SetupEphemeralNetworkSystemClockCore"}, - FunctionInfo{50, D<&ServiceManager::GetStandardLocalClockOperationEvent>, "GetStandardLocalClockOperationEvent"}, - FunctionInfo{51, D<&ServiceManager::GetStandardNetworkClockOperationEventForServiceManager>, "GetStandardNetworkClockOperationEventForServiceManager"}, - FunctionInfo{52, D<&ServiceManager::GetEphemeralNetworkClockOperationEventForServiceManager>, "GetEphemeralNetworkClockOperationEventForServiceManager"}, - FunctionInfo{60, D<&ServiceManager::GetStandardUserSystemClockAutomaticCorrectionUpdatedEvent>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedEvent"}, - FunctionInfo{100, D<&ServiceManager::SetStandardSteadyClockBaseTime>, "SetStandardSteadyClockBaseTime"}, - FunctionInfo{200, D<&ServiceManager::GetClosestAlarmUpdatedEvent>, "GetClosestAlarmUpdatedEvent"}, - FunctionInfo{201, D<&ServiceManager::CheckAndSignalAlarms>, "CheckAndSignalAlarms"}, - FunctionInfo{202, D<&ServiceManager::GetClosestAlarmInfo>, "GetClosestAlarmInfo "} - ); - return HandlerTableGenerateWithFind(key, functions); - } - ServiceManager::ServiceManager(Core::System& system_, std::shared_ptr time, ServerManager* server_manager) : ServiceFramework{system_, "time:m"}, m_time{std::move(time)}, @@ -51,6 +27,30 @@ ServiceManager::ServiceManager(Core::System& system_, std::shared_ptrm_network_system_clock_context_writer}, m_ephemeral_system_context_writer{m_time->m_ephemeral_network_clock_context_writer}, m_local_operation{system_}, m_network_operation{system_}, m_ephemeral_operation{system_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ServiceManager::GetStaticServiceAsUser>, "GetStaticServiceAsUser"}, + {5, D<&ServiceManager::GetStaticServiceAsAdmin>, "GetStaticServiceAsAdmin"}, + {6, D<&ServiceManager::GetStaticServiceAsRepair>, "GetStaticServiceAsRepair"}, + {9, D<&ServiceManager::GetStaticServiceAsServiceManager>, "GetStaticServiceAsServiceManager"}, + {10, D<&ServiceManager::SetupStandardSteadyClockCore>, "SetupStandardSteadyClockCore"}, + {11, D<&ServiceManager::SetupStandardLocalSystemClockCore>, "SetupStandardLocalSystemClockCore"}, + {12, D<&ServiceManager::SetupStandardNetworkSystemClockCore>, "SetupStandardNetworkSystemClockCore"}, + {13, D<&ServiceManager::SetupStandardUserSystemClockCore>, "SetupStandardUserSystemClockCore"}, + {14, D<&ServiceManager::SetupTimeZoneServiceCore>, "SetupTimeZoneServiceCore"}, + {15, D<&ServiceManager::SetupEphemeralNetworkSystemClockCore>, "SetupEphemeralNetworkSystemClockCore"}, + {50, D<&ServiceManager::GetStandardLocalClockOperationEvent>, "GetStandardLocalClockOperationEvent"}, + {51, D<&ServiceManager::GetStandardNetworkClockOperationEventForServiceManager>, "GetStandardNetworkClockOperationEventForServiceManager"}, + {52, D<&ServiceManager::GetEphemeralNetworkClockOperationEventForServiceManager>, "GetEphemeralNetworkClockOperationEventForServiceManager"}, + {60, D<&ServiceManager::GetStandardUserSystemClockAutomaticCorrectionUpdatedEvent>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedEvent"}, + {100, D<&ServiceManager::SetStandardSteadyClockBaseTime>, "SetStandardSteadyClockBaseTime"}, + {200, D<&ServiceManager::GetClosestAlarmUpdatedEvent>, "GetClosestAlarmUpdatedEvent"}, + {201, D<&ServiceManager::CheckAndSignalAlarms>, "CheckAndSignalAlarms"}, + {202, D<&ServiceManager::GetClosestAlarmInfo>, "GetClosestAlarmInfo "}, + }; + // clang-format on + RegisterHandlers(functions); + m_local_system_context_writer.Link(m_local_operation); m_network_system_context_writer.Link(m_network_operation); m_ephemeral_system_context_writer.Link(m_ephemeral_operation); diff --git a/src/core/hle/service/psc/time/service_manager.h b/src/core/hle/service/psc/time/service_manager.h index a8b94d8939..09cff25038 100644 --- a/src/core/hle/service/psc/time/service_manager.h +++ b/src/core/hle/service/psc/time/service_manager.h @@ -65,8 +65,6 @@ private: void SetupSAndP(); Result GetStaticService(OutInterface out_service, StaticServiceSetupInfo setup_info, const char* name); - std::optional FindRequest(u32 key) override; - std::shared_ptr m_time; ServerManager& m_server_manager; bool m_is_s_and_p_setup{}; diff --git a/src/core/hle/service/psc/time/shared_memory.cpp b/src/core/hle/service/psc/time/shared_memory.cpp index adef6bcd8b..b6841a87cb 100644 --- a/src/core/hle/service/psc/time/shared_memory.cpp +++ b/src/core/hle/service/psc/time/shared_memory.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/static.cpp b/src/core/hle/service/psc/time/static.cpp index 2b2b6f1f04..28cff3b764 100644 --- a/src/core/hle/service/psc/time/static.cpp +++ b/src/core/hle/service/psc/time/static.cpp @@ -33,31 +33,6 @@ constexpr Result GetTimeFromTimePointAndContext(s64* out_time, SteadyClockTimePo } } // namespace -std::optional StaticService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"}, - FunctionInfo{1, D<&StaticService::GetStandardNetworkSystemClock>, "GetStandardNetworkSystemClock"}, - FunctionInfo{2, D<&StaticService::GetStandardSteadyClock>, "GetStandardSteadyClock"}, - FunctionInfo{3, D<&StaticService::GetTimeZoneService>, "GetTimeZoneService"}, - FunctionInfo{4, D<&StaticService::GetStandardLocalSystemClock>, "GetStandardLocalSystemClock"}, - FunctionInfo{5, D<&StaticService::GetEphemeralNetworkSystemClock>, "GetEphemeralNetworkSystemClock"}, - FunctionInfo{20, D<&StaticService::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, - FunctionInfo{50, D<&StaticService::SetStandardSteadyClockInternalOffset>, "SetStandardSteadyClockInternalOffset"}, - FunctionInfo{51, D<&StaticService::GetStandardSteadyClockRtcValue>, "GetStandardSteadyClockRtcValue"}, - FunctionInfo{100, D<&StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled>, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, - FunctionInfo{101, D<&StaticService::SetStandardUserSystemClockAutomaticCorrectionEnabled>, "SetStandardUserSystemClockAutomaticCorrectionEnabled"}, - FunctionInfo{102, D<&StaticService::GetStandardUserSystemClockInitialYear>, "GetStandardUserSystemClockInitialYear"}, - FunctionInfo{200, D<&StaticService::IsStandardNetworkSystemClockAccuracySufficient>, "IsStandardNetworkSystemClockAccuracySufficient"}, - FunctionInfo{201, D<&StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedTime"}, - FunctionInfo{300, D<&StaticService::CalculateMonotonicSystemClockBaseTimePoint>, "CalculateMonotonicSystemClockBaseTimePoint"}, - FunctionInfo{400, D<&StaticService::GetClockSnapshot>, "GetClockSnapshot"}, - FunctionInfo{401, D<&StaticService::GetClockSnapshotFromSystemClockContext>, "GetClockSnapshotFromSystemClockContext"}, - FunctionInfo{500, D<&StaticService::CalculateStandardUserSystemClockDifferenceByUser>, "CalculateStandardUserSystemClockDifferenceByUser"}, - FunctionInfo{501, D<&StaticService::CalculateSpanBetween>, "CalculateSpanBetween"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - StaticService::StaticService(Core::System& system_, StaticServiceSetupInfo setup_info, std::shared_ptr time, const char* name) : ServiceFramework{system_, name}, m_setup_info{setup_info}, m_time{time}, @@ -67,6 +42,31 @@ StaticService::StaticService(Core::System& system_, StaticServiceSetupInfo setup m_time_zone{m_time->m_time_zone}, m_ephemeral_network_clock{m_time->m_ephemeral_network_clock}, m_shared_memory{ m_time->m_shared_memory} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"}, + {1, D<&StaticService::GetStandardNetworkSystemClock>, "GetStandardNetworkSystemClock"}, + {2, D<&StaticService::GetStandardSteadyClock>, "GetStandardSteadyClock"}, + {3, D<&StaticService::GetTimeZoneService>, "GetTimeZoneService"}, + {4, D<&StaticService::GetStandardLocalSystemClock>, "GetStandardLocalSystemClock"}, + {5, D<&StaticService::GetEphemeralNetworkSystemClock>, "GetEphemeralNetworkSystemClock"}, + {20, D<&StaticService::GetSharedMemoryNativeHandle>, "GetSharedMemoryNativeHandle"}, + {50, D<&StaticService::SetStandardSteadyClockInternalOffset>, "SetStandardSteadyClockInternalOffset"}, + {51, D<&StaticService::GetStandardSteadyClockRtcValue>, "GetStandardSteadyClockRtcValue"}, + {100, D<&StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled>, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, + {101, D<&StaticService::SetStandardUserSystemClockAutomaticCorrectionEnabled>, "SetStandardUserSystemClockAutomaticCorrectionEnabled"}, + {102, D<&StaticService::GetStandardUserSystemClockInitialYear>, "GetStandardUserSystemClockInitialYear"}, + {200, D<&StaticService::IsStandardNetworkSystemClockAccuracySufficient>, "IsStandardNetworkSystemClockAccuracySufficient"}, + {201, D<&StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime>, "GetStandardUserSystemClockAutomaticCorrectionUpdatedTime"}, + {300, D<&StaticService::CalculateMonotonicSystemClockBaseTimePoint>, "CalculateMonotonicSystemClockBaseTimePoint"}, + {400, D<&StaticService::GetClockSnapshot>, "GetClockSnapshot"}, + {401, D<&StaticService::GetClockSnapshotFromSystemClockContext>, "GetClockSnapshotFromSystemClockContext"}, + {500, D<&StaticService::CalculateStandardUserSystemClockDifferenceByUser>, "CalculateStandardUserSystemClockDifferenceByUser"}, + {501, D<&StaticService::CalculateSpanBetween>, "CalculateSpanBetween"}, + }; + // clang-format on + + RegisterHandlers(functions); } Result StaticService::GetStandardUserSystemClock(OutInterface out_service) { diff --git a/src/core/hle/service/psc/time/static.h b/src/core/hle/service/psc/time/static.h index a86fec178f..52659166f1 100644 --- a/src/core/hle/service/psc/time/static.h +++ b/src/core/hle/service/psc/time/static.h @@ -71,8 +71,6 @@ private: Result GetClockSnapshotImpl(OutClockSnapshot out_snapshot, const SystemClockContext& user_context, const SystemClockContext& network_context, TimeType type); - std::optional FindRequest(u32 key) override; - StaticServiceSetupInfo m_setup_info; std::shared_ptr m_time; StandardLocalSystemClockCore& m_local_system_clock; diff --git a/src/core/hle/service/psc/time/steady_clock.cpp b/src/core/hle/service/psc/time/steady_clock.cpp index 3d138837d3..1d1551acf9 100644 --- a/src/core/hle/service/psc/time/steady_clock.cpp +++ b/src/core/hle/service/psc/time/steady_clock.cpp @@ -11,26 +11,26 @@ namespace Service::PSC::Time { -std::optional SteadyClock::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&SteadyClock::GetCurrentTimePoint>, "GetCurrentTimePoint"}, - FunctionInfo{2, D<&SteadyClock::GetTestOffset>, "GetTestOffset"}, - FunctionInfo{3, D<&SteadyClock::SetTestOffset>, "SetTestOffset"}, - FunctionInfo{100, D<&SteadyClock::GetRtcValue>, "GetRtcValue"}, - FunctionInfo{101, D<&SteadyClock::IsRtcResetDetected>, "IsRtcResetDetected"}, - FunctionInfo{102, D<&SteadyClock::GetSetupResultValue>, "GetSetupResultValue"}, - FunctionInfo{200, D<&SteadyClock::GetInternalOffset>, "GetInternalOffset"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - SteadyClock::SteadyClock(Core::System& system_, std::shared_ptr manager, bool can_write_steady_clock, bool can_write_uninitialized_clock) : ServiceFramework{system_, "ISteadyClock"} , m_clock_core{manager->m_standard_steady_clock} , m_can_write_steady_clock{can_write_steady_clock} , m_can_write_uninitialized_clock{can_write_uninitialized_clock} -{} +{ + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&SteadyClock::GetCurrentTimePoint>, "GetCurrentTimePoint"}, + {2, D<&SteadyClock::GetTestOffset>, "GetTestOffset"}, + {3, D<&SteadyClock::SetTestOffset>, "SetTestOffset"}, + {100, D<&SteadyClock::GetRtcValue>, "GetRtcValue"}, + {101, D<&SteadyClock::IsRtcResetDetected>, "IsRtcResetDetected"}, + {102, D<&SteadyClock::GetSetupResultValue>, "GetSetupResultValue"}, + {200, D<&SteadyClock::GetInternalOffset>, "GetInternalOffset"}, + }; + // clang-format on + RegisterHandlers(functions); +} Result SteadyClock::GetCurrentTimePoint(Out out_time_point) { SCOPE_EXIT { diff --git a/src/core/hle/service/psc/time/steady_clock.h b/src/core/hle/service/psc/time/steady_clock.h index e4de3e3717..8d3d9a6280 100644 --- a/src/core/hle/service/psc/time/steady_clock.h +++ b/src/core/hle/service/psc/time/steady_clock.h @@ -34,8 +34,6 @@ public: Result GetSetupResultValue(Out out_result); Result GetInternalOffset(Out out_internal_offset); - std::optional FindRequest(u32 key) override; - private: StandardSteadyClockCore& m_clock_core; bool m_can_write_steady_clock; diff --git a/src/core/hle/service/psc/time/system_clock.cpp b/src/core/hle/service/psc/time/system_clock.cpp index c08eca0b02..e978ffb5e5 100644 --- a/src/core/hle/service/psc/time/system_clock.cpp +++ b/src/core/hle/service/psc/time/system_clock.cpp @@ -11,23 +11,23 @@ namespace Service::PSC::Time { -std::optional SystemClock::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&SystemClock::GetCurrentTime>, "GetCurrentTime"}, - FunctionInfo{1, D<&SystemClock::SetCurrentTime>, "SetCurrentTime"}, - FunctionInfo{2, D<&SystemClock::GetSystemClockContext>, "GetSystemClockContext"}, - FunctionInfo{3, D<&SystemClock::SetSystemClockContext>, "SetSystemClockContext"}, - FunctionInfo{4, D<&SystemClock::GetOperationEventReadableHandle>, "GetOperationEventReadableHandle"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - SystemClock::SystemClock(Core::System& system_, SystemClockCore& clock_core, bool can_write_clock, bool can_write_uninitialized_clock) : ServiceFramework{system_, "ISystemClock"} , m_clock_core{clock_core} , m_can_write_clock{can_write_clock} , m_can_write_uninitialized_clock{can_write_uninitialized_clock} -{} +{ + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&SystemClock::GetCurrentTime>, "GetCurrentTime"}, + {1, D<&SystemClock::SetCurrentTime>, "SetCurrentTime"}, + {2, D<&SystemClock::GetSystemClockContext>, "GetSystemClockContext"}, + {3, D<&SystemClock::SetSystemClockContext>, "SetSystemClockContext"}, + {4, D<&SystemClock::GetOperationEventReadableHandle>, "GetOperationEventReadableHandle"}, + }; + // clang-format on + RegisterHandlers(functions); +} Result SystemClock::GetCurrentTime(Out out_time) { SCOPE_EXIT { diff --git a/src/core/hle/service/psc/time/system_clock.h b/src/core/hle/service/psc/time/system_clock.h index 4f7d285d39..0d91aaa735 100644 --- a/src/core/hle/service/psc/time/system_clock.h +++ b/src/core/hle/service/psc/time/system_clock.h @@ -31,7 +31,6 @@ public: Result GetOperationEventReadableHandle(OutCopyHandle out_event); private: - std::optional FindRequest(u32 key) override; SystemClockCore& m_clock_core; bool m_can_write_clock; bool m_can_write_uninitialized_clock; diff --git a/src/core/hle/service/psc/time/time_zone.cpp b/src/core/hle/service/psc/time/time_zone.cpp index 81bfb90929..e537a821db 100644 --- a/src/core/hle/service/psc/time/time_zone.cpp +++ b/src/core/hle/service/psc/time/time_zone.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/time_zone.h b/src/core/hle/service/psc/time/time_zone.h index 0e4ed6ed00..68a235e440 100644 --- a/src/core/hle/service/psc/time/time_zone.h +++ b/src/core/hle/service/psc/time/time_zone.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/time_zone_service.cpp b/src/core/hle/service/psc/time/time_zone_service.cpp index 6a717846d3..bd6bb3ba93 100644 --- a/src/core/hle/service/psc/time/time_zone_service.cpp +++ b/src/core/hle/service/psc/time/time_zone_service.cpp @@ -13,33 +13,33 @@ namespace Service::PSC::Time { - std::optional TimeZoneService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"}, - FunctionInfo{1, D<&TimeZoneService::SetDeviceLocationName>, "SetDeviceLocationName"}, - FunctionInfo{2, D<&TimeZoneService::GetTotalLocationNameCount>, "GetTotalLocationNameCount"}, - FunctionInfo{3, D<&TimeZoneService::LoadLocationNameList>, "LoadLocationNameList"}, - FunctionInfo{4, D<&TimeZoneService::LoadTimeZoneRule>, "LoadTimeZoneRule"}, - FunctionInfo{5, D<&TimeZoneService::GetTimeZoneRuleVersion>, "GetTimeZoneRuleVersion"}, - FunctionInfo{6, D<&TimeZoneService::GetDeviceLocationNameAndUpdatedTime>, "GetDeviceLocationNameAndUpdatedTime"}, - FunctionInfo{7, D<&TimeZoneService::SetDeviceLocationNameWithTimeZoneRule>, "SetDeviceLocationNameWithTimeZoneRule"}, - FunctionInfo{8, D<&TimeZoneService::ParseTimeZoneBinary>, "ParseTimeZoneBinary"}, - FunctionInfo{20, D<&TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle>, "GetDeviceLocationNameOperationEventReadableHandle"}, - FunctionInfo{100, D<&TimeZoneService::ToCalendarTime>, "ToCalendarTime"}, - FunctionInfo{101, D<&TimeZoneService::ToCalendarTimeWithMyRule>, "ToCalendarTimeWithMyRule"}, - FunctionInfo{201, D<&TimeZoneService::ToPosixTime>, "ToPosixTime"}, - FunctionInfo{202, D<&TimeZoneService::ToPosixTimeWithMyRule>, "ToPosixTimeWithMyRule"} - ); - return HandlerTableGenerateWithFind(key, functions); - } - TimeZoneService::TimeZoneService(Core::System& system_, StandardSteadyClockCore& clock_core, TimeZone& time_zone, bool can_write_timezone_device_location) : ServiceFramework{system_, "ITimeZoneService"} , m_clock_core{clock_core} , m_time_zone{time_zone} , m_can_write_timezone_device_location{can_write_timezone_device_location} -{} +{ + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"}, + {1, D<&TimeZoneService::SetDeviceLocationName>, "SetDeviceLocationName"}, + {2, D<&TimeZoneService::GetTotalLocationNameCount>, "GetTotalLocationNameCount"}, + {3, D<&TimeZoneService::LoadLocationNameList>, "LoadLocationNameList"}, + {4, D<&TimeZoneService::LoadTimeZoneRule>, "LoadTimeZoneRule"}, + {5, D<&TimeZoneService::GetTimeZoneRuleVersion>, "GetTimeZoneRuleVersion"}, + {6, D<&TimeZoneService::GetDeviceLocationNameAndUpdatedTime>, "GetDeviceLocationNameAndUpdatedTime"}, + {7, D<&TimeZoneService::SetDeviceLocationNameWithTimeZoneRule>, "SetDeviceLocationNameWithTimeZoneRule"}, + {8, D<&TimeZoneService::ParseTimeZoneBinary>, "ParseTimeZoneBinary"}, + {20, D<&TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle>, "GetDeviceLocationNameOperationEventReadableHandle"}, + {100, D<&TimeZoneService::ToCalendarTime>, "ToCalendarTime"}, + {101, D<&TimeZoneService::ToCalendarTimeWithMyRule>, "ToCalendarTimeWithMyRule"}, + {201, D<&TimeZoneService::ToPosixTime>, "ToPosixTime"}, + {202, D<&TimeZoneService::ToPosixTimeWithMyRule>, "ToPosixTimeWithMyRule"}, + }; + // clang-format on + RegisterHandlers(functions); +} Result TimeZoneService::GetDeviceLocationName(Out out_location_name) { SCOPE_EXIT { diff --git a/src/core/hle/service/psc/time/time_zone_service.h b/src/core/hle/service/psc/time/time_zone_service.h index fbb107f87c..0067b08258 100644 --- a/src/core/hle/service/psc/time/time_zone_service.h +++ b/src/core/hle/service/psc/time/time_zone_service.h @@ -59,7 +59,6 @@ public: const CalendarTime& calendar_time); private: - std::optional FindRequest(u32 key) override; StandardSteadyClockCore& m_clock_core; TimeZone& m_time_zone; bool m_can_write_timezone_device_location; diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp index 5cad46f997..41d172b71b 100644 --- a/src/core/hle/service/ptm/psm.cpp +++ b/src/core/hle/service/ptm/psm.cpp @@ -21,13 +21,20 @@ namespace Service::PTM { class IPsmSession final : public ServiceFramework { public: explicit IPsmSession(Core::System& system_) - : ServiceFramework{system_, "IPsmSession"} - , service_context{system_, "IPsmSession"} { - state_change_event = service_context.CreateEvent("IPsmSession::state_change_event"); - } + : ServiceFramework{system_, "IPsmSession"}, service_context{system_, "IPsmSession"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IPsmSession::BindStateChangeEvent, "BindStateChangeEvent"}, + {1, &IPsmSession::UnbindStateChangeEvent, "UnbindStateChangeEvent"}, + {2, &IPsmSession::SetChargerTypeChangeEventEnabled, "SetChargerTypeChangeEventEnabled"}, + {3, &IPsmSession::SetPowerSupplyChangeEventEnabled, "SetPowerSupplyChangeEventEnabled"}, + {4, &IPsmSession::SetBatteryVoltageStateChangeEventEnabled, "SetBatteryVoltageStateChangeEventEnabled"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); + + state_change_event = service_context.CreateEvent("IPsmSession::state_change_event"); } ~IPsmSession() override { @@ -105,15 +112,8 @@ private: rb.Push(ResultSuccess); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IPsmSession::BindStateChangeEvent, "BindStateChangeEvent"}, - FunctionInfo{1, &IPsmSession::UnbindStateChangeEvent, "UnbindStateChangeEvent"}, - FunctionInfo{2, &IPsmSession::SetChargerTypeChangeEventEnabled, "SetChargerTypeChangeEventEnabled"}, - FunctionInfo{3, &IPsmSession::SetPowerSupplyChangeEventEnabled, "SetPowerSupplyChangeEventEnabled"}, - FunctionInfo{4, &IPsmSession::SetBatteryVoltageStateChangeEventEnabled, "SetBatteryVoltageStateChangeEventEnabled"} - ); - KernelHelpers::ServiceContext service_context; + bool should_signal_charger_type{}; bool should_signal_power_supply{}; bool should_signal_battery_voltage{}; @@ -122,6 +122,31 @@ private: }; PSM::PSM(Core::System& system_) : ServiceFramework{system_, "psm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &PSM::GetBatteryChargePercentage, "GetBatteryChargePercentage"}, + {1, &PSM::GetChargerType, "GetChargerType"}, + {2, nullptr, "EnableBatteryCharging"}, + {3, nullptr, "DisableBatteryCharging"}, + {4, nullptr, "IsBatteryChargingEnabled"}, + {5, nullptr, "AcquireControllerPowerSupply"}, + {6, nullptr, "ReleaseControllerPowerSupply"}, + {7, &PSM::OpenSession, "OpenSession"}, + {8, nullptr, "EnableEnoughPowerChargeEmulation"}, + {9, nullptr, "DisableEnoughPowerChargeEmulation"}, + {10, nullptr, "EnableFastBatteryCharging"}, + {11, nullptr, "DisableFastBatteryCharging"}, + {12, &PSM::GetBatteryVoltageState, "GetBatteryVoltageState"}, + {13, nullptr, "GetRawBatteryChargePercentage"}, + {14, nullptr, "IsEnoughPowerSupplied"}, + {15, &PSM::GetBatteryAgePercentage, "GetBatteryAgePercentage"}, + {16, nullptr, "GetBatteryChargeInfoEvent"}, + {17, &PSM::GetBatteryChargeInfoFields, "GetBatteryChargeInfoFields"}, + {18, nullptr, "GetBatteryChargeCalibratedEvent"}, + }; + // clang-format on + + RegisterHandlers(functions); } PSM::~PSM() = default; diff --git a/src/core/hle/service/ptm/psm.h b/src/core/hle/service/ptm/psm.h index fe77b23d79..77c38d1f9b 100644 --- a/src/core/hle/service/ptm/psm.h +++ b/src/core/hle/service/ptm/psm.h @@ -28,31 +28,6 @@ private: void GetBatteryVoltageState(HLERequestContext& ctx); void GetBatteryAgePercentage(HLERequestContext& ctx); void GetBatteryChargeInfoFields(HLERequestContext& ctx); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &PSM::GetBatteryChargePercentage, "GetBatteryChargePercentage"}, - FunctionInfo{1, &PSM::GetChargerType, "GetChargerType"}, - FunctionInfo{2, nullptr, "EnableBatteryCharging"}, - FunctionInfo{3, nullptr, "DisableBatteryCharging"}, - FunctionInfo{4, nullptr, "IsBatteryChargingEnabled"}, - FunctionInfo{5, nullptr, "AcquireControllerPowerSupply"}, - FunctionInfo{6, nullptr, "ReleaseControllerPowerSupply"}, - FunctionInfo{7, &PSM::OpenSession, "OpenSession"}, - FunctionInfo{8, nullptr, "EnableEnoughPowerChargeEmulation"}, - FunctionInfo{9, nullptr, "DisableEnoughPowerChargeEmulation"}, - FunctionInfo{10, nullptr, "EnableFastBatteryCharging"}, - FunctionInfo{11, nullptr, "DisableFastBatteryCharging"}, - FunctionInfo{12, &PSM::GetBatteryVoltageState, "GetBatteryVoltageState"}, - FunctionInfo{13, nullptr, "GetRawBatteryChargePercentage"}, - FunctionInfo{14, nullptr, "IsEnoughPowerSupplied"}, - FunctionInfo{15, &PSM::GetBatteryAgePercentage, "GetBatteryAgePercentage"}, - FunctionInfo{16, nullptr, "GetBatteryChargeInfoEvent"}, - FunctionInfo{17, &PSM::GetBatteryChargeInfoFields, "GetBatteryChargeInfoFields"}, - FunctionInfo{18, nullptr, "GetBatteryChargeCalibratedEvent"} - ); }; } // namespace Service::PTM diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index ad474ec411..de1d34a688 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -17,28 +17,28 @@ namespace Service::PTM { class PSM_MANU final : public ServiceFramework { public: explicit PSM_MANU(Core::System& system_) - : ServiceFramework{system_, "psm:manu"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "EnableVdd50StateControl"}, - FunctionInfo{1, nullptr, "DisableVdd50StateControl"}, - FunctionInfo{2, nullptr, "SetVdd50State"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "psm:manu"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "EnableVdd50StateControl"}, + {1, nullptr, "DisableVdd50StateControl"}, + {2, nullptr, "SetVdd50State"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class POWCTL final : public ServiceFramework { public: explicit POWCTL(Core::System& system_) - : ServiceFramework{system_, "powctl"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenSession"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "powctl"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenSession"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/ptm/ptm.h b/src/core/hle/service/ptm/ptm.h index a0ae03d282..a62877e441 100644 --- a/src/core/hle/service/ptm/ptm.h +++ b/src/core/hle/service/ptm/ptm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/ptm/ts.cpp b/src/core/hle/service/ptm/ts.cpp index f22ff2ec69..b1ac0c8f11 100644 --- a/src/core/hle/service/ptm/ts.cpp +++ b/src/core/hle/service/ptm/ts.cpp @@ -19,10 +19,16 @@ enum class Location : u8 { class ISession : public ServiceFramework { public: - explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} {} + explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetTemperatureRange"}, + {2, nullptr, "SetMeasurementMode"}, + {4, &ISession::GetTemperature, "GetTemperature"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -33,15 +39,20 @@ private: rb.Push(ResultSuccess); rb.Push(temperature); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetTemperatureRange"}, - FunctionInfo{2, nullptr, "SetMeasurementMode"}, - FunctionInfo{4, &ISession::GetTemperature, "GetTemperature"} - ); }; TS::TS(Core::System& system_) : ServiceFramework{system_, "ts"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetTemperatureRange"}, + {1, &TS::GetTemperature, "GetTemperature"}, + {2, nullptr, "SetMeasurementMode"}, + {3, &TS::GetTemperatureMilliC, "GetTemperatureMilliC"}, + {4, &TS::OpenSession, "OpenSession"}, + }; + // clang-format on + + RegisterHandlers(functions); } TS::~TS() = default; diff --git a/src/core/hle/service/ptm/ts.h b/src/core/hle/service/ptm/ts.h index 21f3ac2b70..d8a0d49bf8 100644 --- a/src/core/hle/service/ptm/ts.h +++ b/src/core/hle/service/ptm/ts.h @@ -20,17 +20,6 @@ private: void GetTemperature(HLERequestContext& ctx); void GetTemperatureMilliC(HLERequestContext& ctx); void OpenSession(HLERequestContext& ctx); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetTemperatureRange"}, - FunctionInfo{1, &TS::GetTemperature, "GetTemperature"}, - FunctionInfo{2, nullptr, "SetMeasurementMode"}, - FunctionInfo{3, &TS::GetTemperatureMilliC, "GetTemperatureMilliC"}, - FunctionInfo{4, &TS::OpenSession, "OpenSession"} - ); }; } // namespace Service::PTM diff --git a/src/core/hle/service/ro/ro.cpp b/src/core/hle/service/ro/ro.cpp index 838ff136f6..167bf04c9a 100644 --- a/src/core/hle/service/ro/ro.cpp +++ b/src/core/hle/service/ro/ro.cpp @@ -8,334 +8,21 @@ #include #include "core/hle/kernel/k_process.h" + +#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/ro/ro.h" +#include "core/hle/service/ro/ro_nro_utils.h" +#include "core/hle/service/ro/ro_results.h" +#include "core/hle/service/ro/ro_types.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" #ifdef HAS_NCE #include "core/arm/nce/patcher.h" #include "core/hle/kernel/k_shared_memory.h" #endif -#include "core/hle/service/cmif_serialization.h" namespace Service::RO { -constexpr Result ResultOutOfAddressSpace{ErrorModule::RO, 2}; -constexpr Result ResultAlreadyLoaded{ErrorModule::RO, 3}; -constexpr Result ResultInvalidNro{ErrorModule::RO, 4}; -constexpr Result ResultInvalidNrr{ErrorModule::RO, 6}; -constexpr Result ResultTooManyNro{ErrorModule::RO, 7}; -constexpr Result ResultTooManyNrr{ErrorModule::RO, 8}; -constexpr Result ResultNotAuthorized{ErrorModule::RO, 9}; -constexpr Result ResultInvalidNrrKind{ErrorModule::RO, 10}; -constexpr Result ResultInternalError{ErrorModule::RO, 1023}; -constexpr Result ResultInvalidAddress{ErrorModule::RO, 1025}; -constexpr Result ResultInvalidSize{ErrorModule::RO, 1026}; -constexpr Result ResultNotLoaded{ErrorModule::RO, 1028}; -constexpr Result ResultNotRegistered{ErrorModule::RO, 1029}; -constexpr Result ResultInvalidSession{ErrorModule::RO, 1030}; -constexpr Result ResultInvalidProcess{ErrorModule::RO, 1031}; - -namespace { - -struct ProcessMemoryRegion { - u64 address; - u64 size; -}; - -size_t GetTotalProcessMemoryRegionSize(const ProcessMemoryRegion* regions, size_t num_regions) { - size_t total = 0; - - for (size_t i = 0; i < num_regions; ++i) { - total += regions[i].size; - } - - return total; -} - -size_t SetupNroProcessMemoryRegions(ProcessMemoryRegion* regions, u64 nro_heap_address, - u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size) { - // Reset region count. - size_t num_regions = 0; - - // We always want a region for the nro. - regions[num_regions++] = {nro_heap_address, nro_heap_size}; - - // If we have bss, create a region for bss. - if (bss_heap_size > 0) { - regions[num_regions++] = {bss_heap_address, bss_heap_size}; - } - - return num_regions; -} - -Result SetProcessMemoryPermission(Kernel::KProcess* process, u64 address, u64 size, - Kernel::Svc::MemoryPermission permission) { - auto& page_table = process->GetPageTable(); - - // Set permission. - R_RETURN(page_table.SetProcessMemoryPermission(address, size, permission)); -} - -Result UnmapProcessCodeMemory(Kernel::KProcess* process, u64 process_code_address, - const ProcessMemoryRegion* regions, size_t num_regions) { - // Get the total process memory region size. - const size_t total_size = GetTotalProcessMemoryRegionSize(regions, num_regions); - - auto& page_table = process->GetPageTable(); - - // Unmap each region in order. - size_t cur_offset = total_size; - for (size_t i = 0; i < num_regions; ++i) { - // We want to unmap in reverse order. - const auto& cur_region = regions[num_regions - 1 - i]; - - // Subtract to update the current offset. - cur_offset -= cur_region.size; - - // Unmap. - R_TRY(page_table.UnmapCodeMemory(process_code_address + cur_offset, cur_region.address, - cur_region.size)); - } - - R_SUCCEED(); -} - -Result EnsureGuardPages(Kernel::KProcessPageTable& page_table, u64 map_address, u64 map_size) { - Kernel::KMemoryInfo memory_info; - Kernel::Svc::PageInfo page_info; - - // Ensure page before mapping is unmapped. - R_TRY(page_table.QueryInfo(std::addressof(memory_info), std::addressof(page_info), - map_address - 1)); - R_UNLESS(memory_info.GetSvcState() == Kernel::Svc::MemoryState::Free, - Kernel::ResultInvalidState); - - // Ensure page after mapping is unmapped. - R_TRY(page_table.QueryInfo(std::addressof(memory_info), std::addressof(page_info), - map_address + map_size)); - R_UNLESS(memory_info.GetSvcState() == Kernel::Svc::MemoryState::Free, - Kernel::ResultInvalidState); - - // Successfully verified guard pages. - R_SUCCEED(); -} - -Result MapProcessCodeMemory(u64* out, Kernel::KProcess* process, const ProcessMemoryRegion* regions, - size_t num_regions, std::mt19937_64& generate_random) { - auto& page_table = process->GetPageTable(); - const u64 alias_code_start = - GetInteger(page_table.GetAliasCodeRegionStart()) / Kernel::PageSize; - const u64 alias_code_size = page_table.GetAliasCodeRegionSize() / Kernel::PageSize; - - for (size_t trial = 0; trial < 64; trial++) { - // Generate a new trial address. - const u64 mapped_address = - (alias_code_start + (generate_random() % alias_code_size)) * Kernel::PageSize; - - const auto MapRegions = [&] { - // Map the regions in order. - u64 mapped_size = 0; - for (size_t i = 0; i < num_regions; ++i) { - // If we fail, unmap up to where we've mapped. - ON_RESULT_FAILURE { - R_ASSERT(UnmapProcessCodeMemory(process, mapped_address, regions, i)); - }; - - // Map the current region. - R_TRY(page_table.MapCodeMemory(mapped_address + mapped_size, regions[i].address, - regions[i].size)); - - mapped_size += regions[i].size; - } - - // If we fail, unmap all mapped regions. - ON_RESULT_FAILURE { - R_ASSERT(UnmapProcessCodeMemory(process, mapped_address, regions, num_regions)); - }; - - // Ensure guard pages. - R_RETURN(EnsureGuardPages(page_table, mapped_address, mapped_size)); - }; - - if (R_SUCCEEDED(MapRegions())) { - // Set the output address. - *out = mapped_address; - R_SUCCEED(); - } - } - - // We failed to map anything. - R_THROW(RO::ResultOutOfAddressSpace); -} - -Result MapNro(u64* out_base_address, Kernel::KProcess* process, u64 nro_heap_address, - u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size, - std::mt19937_64& generate_random) { - // Set up the process memory regions. - std::array regions{}; - const size_t num_regions = SetupNroProcessMemoryRegions( - regions.data(), nro_heap_address, nro_heap_size, bss_heap_address, bss_heap_size); - - // Re-map the nro/bss as code memory in the destination process. - R_RETURN(MapProcessCodeMemory(out_base_address, process, regions.data(), num_regions, - generate_random)); -} - -Result SetNroPerms(Kernel::KProcess* process, u64 base_address, u64 rx_size, u64 ro_size, - u64 rw_size) { - const u64 rx_offset = 0; - const u64 ro_offset = rx_offset + rx_size; - const u64 rw_offset = ro_offset + ro_size; - - R_TRY(SetProcessMemoryPermission(process, base_address + rx_offset, rx_size, - Kernel::Svc::MemoryPermission::ReadExecute)); - R_TRY(SetProcessMemoryPermission(process, base_address + ro_offset, ro_size, - Kernel::Svc::MemoryPermission::Read)); - R_TRY(SetProcessMemoryPermission(process, base_address + rw_offset, rw_size, - Kernel::Svc::MemoryPermission::ReadWrite)); - - R_SUCCEED(); -} - -Result UnmapNro(Kernel::KProcess* process, u64 base_address, u64 nro_heap_address, - u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size) { - // Set up the process memory regions. - std::array regions{}; - const size_t num_regions = SetupNroProcessMemoryRegions( - regions.data(), nro_heap_address, nro_heap_size, bss_heap_address, bss_heap_size); - - // Unmap the nro/bss. - R_RETURN(UnmapProcessCodeMemory(process, base_address, regions.data(), num_regions)); -} - -} // namespace - -enum class NrrKind : u8 { - User = 0, - JitPlugin = 1, - Count, -}; - -static constexpr size_t ModuleIdSize = 0x20; -struct ModuleId { - std::array data; -}; -static_assert(sizeof(ModuleId) == ModuleIdSize); - -struct NrrCertification { - static constexpr size_t RsaKeySize = 0x100; - static constexpr size_t SignedSize = 0x120; - - u64 program_id_mask; - u64 program_id_pattern; - std::array reserved_10; - std::array modulus; - std::array signature; -}; -static_assert(sizeof(NrrCertification) == NrrCertification::RsaKeySize + NrrCertification::SignedSize); - -class NrrHeader { -public: - static constexpr u32 Magic = Common::MakeMagic('N', 'R', 'R', '0'); - -public: - bool IsMagicValid() const { - return m_magic == Magic; - } - - bool IsProgramIdValid() const { - return (m_program_id & m_certification.program_id_mask) == - m_certification.program_id_pattern; - } - - NrrKind GetNrrKind() const { - const NrrKind kind = static_cast(m_nrr_kind); - ASSERT(kind < NrrKind::Count); - return kind; - } - - u64 GetProgramId() const { - return m_program_id; - } - - u32 GetSize() const { - return m_size; - } - - u32 GetNumHashes() const { - return m_num_hashes; - } - - size_t GetHashesOffset() const { - return m_hashes_offset; - } - - u32 GetKeyGeneration() const { - return m_key_generation; - } - - const u8* GetCertificationSignature() const { - return m_certification.signature.data(); - } - - const u8* GetCertificationSignedArea() const { - return reinterpret_cast(std::addressof(m_certification)); - } - - const u8* GetCertificationModulus() const { - return m_certification.modulus.data(); - } - - const u8* GetSignature() const { - return m_signature.data(); - } - - size_t GetSignedAreaSize() const { - return m_size - GetSignedAreaOffset(); - } - - static constexpr size_t GetSignedAreaOffset() { - return offsetof(NrrHeader, m_program_id); - } - -private: - u32 m_magic; - u32 m_key_generation; - INSERT_PADDING_BYTES_NOINIT(8); - NrrCertification m_certification; - std::array m_signature; - u64 m_program_id; - u32 m_size; - u8 m_nrr_kind; // 7.0.0+ - INSERT_PADDING_BYTES_NOINIT(3); - u32 m_hashes_offset; - u32 m_num_hashes; - INSERT_PADDING_BYTES_NOINIT(8); -}; -static_assert(sizeof(NrrHeader) == 0x350, "NrrHeader has wrong size"); - -static constexpr u32 NRO_HEADER_MAGIC = Common::MakeMagic('N', 'R', 'O', '0'); -struct NroHeader { - u32 m_entrypoint_insn; - u32 m_mod_offset; - INSERT_PADDING_BYTES_NOINIT(0x8); - u32 m_magic; - INSERT_PADDING_BYTES_NOINIT(0x4); - u32 m_size; - INSERT_PADDING_BYTES_NOINIT(0x4); - u32 m_text_offset; - u32 m_text_size; - u32 m_ro_offset; - u32 m_ro_size; - u32 m_rw_offset; - u32 m_rw_size; - u32 m_bss_size; - INSERT_PADDING_BYTES_NOINIT(0x4); - ModuleId m_module_id; - INSERT_PADDING_BYTES_NOINIT(0x20); -}; -static_assert(sizeof(NroHeader) == 0x80, "NroHeader has wrong size"); - namespace { // Atmosphere defines as follows: @@ -848,21 +535,29 @@ private: class RoInterface : public ServiceFramework { public: - explicit RoInterface(Core::System& system_, const char* name_, std::shared_ptr ro, NrrKind nrr_kind) - : ServiceFramework{system_, name_} - , m_ro(ro) - , m_context_id(InvalidContextId) - , m_nrr_kind(nrr_kind) - {} + explicit RoInterface(Core::System& system_, const char* name_, std::shared_ptr ro, + NrrKind nrr_kind) + : ServiceFramework{system_, name_}, m_ro(ro), m_context_id(InvalidContextId), + m_nrr_kind(nrr_kind) { + + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&RoInterface::MapManualLoadModuleMemory>, "MapManualLoadModuleMemory"}, + {1, C<&RoInterface::UnmapManualLoadModuleMemory>, "UnmapManualLoadModuleMemory"}, + {2, C<&RoInterface::RegisterModuleInfo>, "RegisterModuleInfo"}, + {3, C<&RoInterface::UnregisterModuleInfo>, "UnregisterModuleInfo"}, + {4, C<&RoInterface::RegisterProcessHandle>, "RegisterProcessHandle"}, + {10, C<&RoInterface::RegisterProcessModuleInfo>, "RegisterProcessModuleInfo"}, + }; + // clang-format on + + RegisterHandlers(functions); + } ~RoInterface() { m_ro->UnregisterProcess(system.Kernel(), m_context_id); } - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - Result MapManualLoadModuleMemory(Out out_load_address, ClientProcessId client_pid, u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size) { R_TRY(m_ro->ValidateProcess(m_context_id, *client_pid)); @@ -899,14 +594,6 @@ public: } private: - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&RoInterface::MapManualLoadModuleMemory>, "MapManualLoadModuleMemory"}, - FunctionInfo{1, C<&RoInterface::UnmapManualLoadModuleMemory>, "UnmapManualLoadModuleMemory"}, - FunctionInfo{2, C<&RoInterface::RegisterModuleInfo>, "RegisterModuleInfo"}, - FunctionInfo{3, C<&RoInterface::UnregisterModuleInfo>, "UnregisterModuleInfo"}, - FunctionInfo{4, C<&RoInterface::RegisterProcessHandle>, "RegisterProcessHandle"}, - FunctionInfo{10, C<&RoInterface::RegisterProcessModuleInfo>, "RegisterProcessModuleInfo"} - ); std::shared_ptr m_ro{}; size_t m_context_id{}; NrrKind m_nrr_kind{}; @@ -919,14 +606,12 @@ class IDebugMonitorInterface final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + { 0, nullptr, "GetProcessModuleInfo" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetProcessModuleInfo" } - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/ro/ro.h b/src/core/hle/service/ro/ro.h index 74dc085368..c93aac3833 100644 --- a/src/core/hle/service/ro/ro.h +++ b/src/core/hle/service/ro/ro.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ro/ro_nro_utils.cpp b/src/core/hle/service/ro/ro_nro_utils.cpp new file mode 100644 index 0000000000..1c2a97619d --- /dev/null +++ b/src/core/hle/service/ro/ro_nro_utils.cpp @@ -0,0 +1,188 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/kernel/k_process.h" +#include "core/hle/service/ro/ro_nro_utils.h" +#include "core/hle/service/ro/ro_results.h" + +namespace Service::RO { + +namespace { + +struct ProcessMemoryRegion { + u64 address; + u64 size; +}; + +size_t GetTotalProcessMemoryRegionSize(const ProcessMemoryRegion* regions, size_t num_regions) { + size_t total = 0; + + for (size_t i = 0; i < num_regions; ++i) { + total += regions[i].size; + } + + return total; +} + +size_t SetupNroProcessMemoryRegions(ProcessMemoryRegion* regions, u64 nro_heap_address, + u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size) { + // Reset region count. + size_t num_regions = 0; + + // We always want a region for the nro. + regions[num_regions++] = {nro_heap_address, nro_heap_size}; + + // If we have bss, create a region for bss. + if (bss_heap_size > 0) { + regions[num_regions++] = {bss_heap_address, bss_heap_size}; + } + + return num_regions; +} + +Result SetProcessMemoryPermission(Kernel::KProcess* process, u64 address, u64 size, + Kernel::Svc::MemoryPermission permission) { + auto& page_table = process->GetPageTable(); + + // Set permission. + R_RETURN(page_table.SetProcessMemoryPermission(address, size, permission)); +} + +Result UnmapProcessCodeMemory(Kernel::KProcess* process, u64 process_code_address, + const ProcessMemoryRegion* regions, size_t num_regions) { + // Get the total process memory region size. + const size_t total_size = GetTotalProcessMemoryRegionSize(regions, num_regions); + + auto& page_table = process->GetPageTable(); + + // Unmap each region in order. + size_t cur_offset = total_size; + for (size_t i = 0; i < num_regions; ++i) { + // We want to unmap in reverse order. + const auto& cur_region = regions[num_regions - 1 - i]; + + // Subtract to update the current offset. + cur_offset -= cur_region.size; + + // Unmap. + R_TRY(page_table.UnmapCodeMemory(process_code_address + cur_offset, cur_region.address, + cur_region.size)); + } + + R_SUCCEED(); +} + +Result EnsureGuardPages(Kernel::KProcessPageTable& page_table, u64 map_address, u64 map_size) { + Kernel::KMemoryInfo memory_info; + Kernel::Svc::PageInfo page_info; + + // Ensure page before mapping is unmapped. + R_TRY(page_table.QueryInfo(std::addressof(memory_info), std::addressof(page_info), + map_address - 1)); + R_UNLESS(memory_info.GetSvcState() == Kernel::Svc::MemoryState::Free, + Kernel::ResultInvalidState); + + // Ensure page after mapping is unmapped. + R_TRY(page_table.QueryInfo(std::addressof(memory_info), std::addressof(page_info), + map_address + map_size)); + R_UNLESS(memory_info.GetSvcState() == Kernel::Svc::MemoryState::Free, + Kernel::ResultInvalidState); + + // Successfully verified guard pages. + R_SUCCEED(); +} + +Result MapProcessCodeMemory(u64* out, Kernel::KProcess* process, const ProcessMemoryRegion* regions, + size_t num_regions, std::mt19937_64& generate_random) { + auto& page_table = process->GetPageTable(); + const u64 alias_code_start = + GetInteger(page_table.GetAliasCodeRegionStart()) / Kernel::PageSize; + const u64 alias_code_size = page_table.GetAliasCodeRegionSize() / Kernel::PageSize; + + for (size_t trial = 0; trial < 64; trial++) { + // Generate a new trial address. + const u64 mapped_address = + (alias_code_start + (generate_random() % alias_code_size)) * Kernel::PageSize; + + const auto MapRegions = [&] { + // Map the regions in order. + u64 mapped_size = 0; + for (size_t i = 0; i < num_regions; ++i) { + // If we fail, unmap up to where we've mapped. + ON_RESULT_FAILURE { + R_ASSERT(UnmapProcessCodeMemory(process, mapped_address, regions, i)); + }; + + // Map the current region. + R_TRY(page_table.MapCodeMemory(mapped_address + mapped_size, regions[i].address, + regions[i].size)); + + mapped_size += regions[i].size; + } + + // If we fail, unmap all mapped regions. + ON_RESULT_FAILURE { + R_ASSERT(UnmapProcessCodeMemory(process, mapped_address, regions, num_regions)); + }; + + // Ensure guard pages. + R_RETURN(EnsureGuardPages(page_table, mapped_address, mapped_size)); + }; + + if (R_SUCCEEDED(MapRegions())) { + // Set the output address. + *out = mapped_address; + R_SUCCEED(); + } + } + + // We failed to map anything. + R_THROW(RO::ResultOutOfAddressSpace); +} + +} // namespace + +Result MapNro(u64* out_base_address, Kernel::KProcess* process, u64 nro_heap_address, + u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size, + std::mt19937_64& generate_random) { + // Set up the process memory regions. + std::array regions{}; + const size_t num_regions = SetupNroProcessMemoryRegions( + regions.data(), nro_heap_address, nro_heap_size, bss_heap_address, bss_heap_size); + + // Re-map the nro/bss as code memory in the destination process. + R_RETURN(MapProcessCodeMemory(out_base_address, process, regions.data(), num_regions, + generate_random)); +} + +Result SetNroPerms(Kernel::KProcess* process, u64 base_address, u64 rx_size, u64 ro_size, + u64 rw_size) { + const u64 rx_offset = 0; + const u64 ro_offset = rx_offset + rx_size; + const u64 rw_offset = ro_offset + ro_size; + + R_TRY(SetProcessMemoryPermission(process, base_address + rx_offset, rx_size, + Kernel::Svc::MemoryPermission::ReadExecute)); + R_TRY(SetProcessMemoryPermission(process, base_address + ro_offset, ro_size, + Kernel::Svc::MemoryPermission::Read)); + R_TRY(SetProcessMemoryPermission(process, base_address + rw_offset, rw_size, + Kernel::Svc::MemoryPermission::ReadWrite)); + + R_SUCCEED(); +} + +Result UnmapNro(Kernel::KProcess* process, u64 base_address, u64 nro_heap_address, + u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size) { + // Set up the process memory regions. + std::array regions{}; + const size_t num_regions = SetupNroProcessMemoryRegions( + regions.data(), nro_heap_address, nro_heap_size, bss_heap_address, bss_heap_size); + + // Unmap the nro/bss. + R_RETURN(UnmapProcessCodeMemory(process, base_address, regions.data(), num_regions)); +} + +} // namespace Service::RO diff --git a/src/core/hle/service/ro/ro_nro_utils.h b/src/core/hle/service/ro/ro_nro_utils.h new file mode 100644 index 0000000000..32b97abed2 --- /dev/null +++ b/src/core/hle/service/ro/ro_nro_utils.h @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +#include "common/common_types.h" + +namespace Kernel { +class KProcess; +} + +union Result; + +namespace Service::RO { + +Result MapNro(u64* out_base_address, Kernel::KProcess* process, u64 nro_heap_address, + u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size, + std::mt19937_64& generate_random); +Result SetNroPerms(Kernel::KProcess* process, u64 base_address, u64 rx_size, u64 ro_size, + u64 rw_size); +Result UnmapNro(Kernel::KProcess* process, u64 base_address, u64 nro_heap_address, + u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size); + +} // namespace Service::RO diff --git a/src/core/hle/service/ro/ro_results.h b/src/core/hle/service/ro/ro_results.h new file mode 100644 index 0000000000..906378bc7f --- /dev/null +++ b/src/core/hle/service/ro/ro_results.h @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/result.h" + +namespace Service::RO { + +constexpr Result ResultOutOfAddressSpace{ErrorModule::RO, 2}; +constexpr Result ResultAlreadyLoaded{ErrorModule::RO, 3}; +constexpr Result ResultInvalidNro{ErrorModule::RO, 4}; +constexpr Result ResultInvalidNrr{ErrorModule::RO, 6}; +constexpr Result ResultTooManyNro{ErrorModule::RO, 7}; +constexpr Result ResultTooManyNrr{ErrorModule::RO, 8}; +constexpr Result ResultNotAuthorized{ErrorModule::RO, 9}; +constexpr Result ResultInvalidNrrKind{ErrorModule::RO, 10}; +constexpr Result ResultInternalError{ErrorModule::RO, 1023}; +constexpr Result ResultInvalidAddress{ErrorModule::RO, 1025}; +constexpr Result ResultInvalidSize{ErrorModule::RO, 1026}; +constexpr Result ResultNotLoaded{ErrorModule::RO, 1028}; +constexpr Result ResultNotRegistered{ErrorModule::RO, 1029}; +constexpr Result ResultInvalidSession{ErrorModule::RO, 1030}; +constexpr Result ResultInvalidProcess{ErrorModule::RO, 1031}; + +} // namespace Service::RO diff --git a/src/core/hle/service/ro/ro_types.h b/src/core/hle/service/ro/ro_types.h new file mode 100644 index 0000000000..8e88f43246 --- /dev/null +++ b/src/core/hle/service/ro/ro_types.h @@ -0,0 +1,142 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "common/assert.h" +#include "common/common_funcs.h" +#include "common/common_types.h" + +namespace Service::RO { + +enum class NrrKind : u8 { + User = 0, + JitPlugin = 1, + Count, +}; + +static constexpr size_t ModuleIdSize = 0x20; +struct ModuleId { + std::array data; +}; +static_assert(sizeof(ModuleId) == ModuleIdSize); + +struct NrrCertification { + static constexpr size_t RsaKeySize = 0x100; + static constexpr size_t SignedSize = 0x120; + + u64 program_id_mask; + u64 program_id_pattern; + std::array reserved_10; + std::array modulus; + std::array signature; +}; +static_assert(sizeof(NrrCertification) == + NrrCertification::RsaKeySize + NrrCertification::SignedSize); + +class NrrHeader { +public: + static constexpr u32 Magic = Common::MakeMagic('N', 'R', 'R', '0'); + +public: + bool IsMagicValid() const { + return m_magic == Magic; + } + + bool IsProgramIdValid() const { + return (m_program_id & m_certification.program_id_mask) == + m_certification.program_id_pattern; + } + + NrrKind GetNrrKind() const { + const NrrKind kind = static_cast(m_nrr_kind); + ASSERT(kind < NrrKind::Count); + return kind; + } + + u64 GetProgramId() const { + return m_program_id; + } + + u32 GetSize() const { + return m_size; + } + + u32 GetNumHashes() const { + return m_num_hashes; + } + + size_t GetHashesOffset() const { + return m_hashes_offset; + } + + u32 GetKeyGeneration() const { + return m_key_generation; + } + + const u8* GetCertificationSignature() const { + return m_certification.signature.data(); + } + + const u8* GetCertificationSignedArea() const { + return reinterpret_cast(std::addressof(m_certification)); + } + + const u8* GetCertificationModulus() const { + return m_certification.modulus.data(); + } + + const u8* GetSignature() const { + return m_signature.data(); + } + + size_t GetSignedAreaSize() const { + return m_size - GetSignedAreaOffset(); + } + + static constexpr size_t GetSignedAreaOffset() { + return offsetof(NrrHeader, m_program_id); + } + +private: + u32 m_magic; + u32 m_key_generation; + INSERT_PADDING_BYTES_NOINIT(8); + NrrCertification m_certification; + std::array m_signature; + u64 m_program_id; + u32 m_size; + u8 m_nrr_kind; // 7.0.0+ + INSERT_PADDING_BYTES_NOINIT(3); + u32 m_hashes_offset; + u32 m_num_hashes; + INSERT_PADDING_BYTES_NOINIT(8); +}; +static_assert(sizeof(NrrHeader) == 0x350, "NrrHeader has wrong size"); + +static constexpr u32 NRO_HEADER_MAGIC = Common::MakeMagic('N', 'R', 'O', '0'); +struct NroHeader { + u32 m_entrypoint_insn; + u32 m_mod_offset; + INSERT_PADDING_BYTES_NOINIT(0x8); + u32 m_magic; + INSERT_PADDING_BYTES_NOINIT(0x4); + u32 m_size; + INSERT_PADDING_BYTES_NOINIT(0x4); + u32 m_text_offset; + u32 m_text_size; + u32 m_ro_offset; + u32 m_ro_size; + u32 m_rw_offset; + u32 m_rw_size; + u32 m_bss_size; + INSERT_PADDING_BYTES_NOINIT(0x4); + ModuleId m_module_id; + INSERT_PADDING_BYTES_NOINIT(0x20); +}; +static_assert(sizeof(NroHeader) == 0x80, "NroHeader has wrong size"); + +} // namespace Service::RO diff --git a/src/core/hle/service/server_manager.h b/src/core/hle/service/server_manager.h index 5173ce46e1..d86d20b7c5 100644 --- a/src/core/hle/service/server_manager.h +++ b/src/core/hle/service/server_manager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 2c6e8d1c07..225b92a783 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -19,7 +19,6 @@ #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" #include "core/reporter.h" -#include "frontend_common/firmware_manager.h" namespace Service { @@ -48,9 +47,24 @@ ServiceFrameworkBase::~ServiceFrameworkBase() { const auto guard = ServiceFrameworkBase::LockService(); } -void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info, bool gated) { +void ServiceFrameworkBase::RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n) { + // Usually this array is sorted by id already, so hint to insert at the end + handlers.reserve(handlers.size() + n); + for (std::size_t i = 0; i < n; ++i) + handlers.emplace_hint(handlers.cend(), functions[i].expected_header, functions[i]); +} + +void ServiceFrameworkBase::RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n) { + // Usually this array is sorted by id already, so hint to insert at the end + handlers_tipc.reserve(handlers_tipc.size() + n); + for (std::size_t i = 0; i < n; ++i) + handlers_tipc.emplace_hint(handlers_tipc.cend(), functions[i].expected_header, functions[i]); +} + +void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, + const FunctionInfoBase* info) { auto cmd_buf = ctx.CommandBuffer(); - std::string function_name = bool(info) ? info->name : ""; + std::string function_name = info == nullptr ? "" : info->name; fmt::memory_buffer buf; fmt::format_to(std::back_inserter(buf), "function '{}({})': port='{}' cmd_buf={{[0]={:#x}", ctx.GetCommand(), function_name, service_name, cmd_buf[0]); @@ -59,11 +73,7 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, c buf.push_back('}'); system.GetReporter().SaveUnimplementedFunctionReport(ctx, ctx.GetCommand(), function_name, service_name); - if (gated) { - LOG_ERROR(Service, "Version gated {}", fmt::to_string(buf)); - } else { - UNIMPLEMENTED_MSG("Unknown / unimplemented {}", fmt::to_string(buf)); - } + UNIMPLEMENTED_MSG("Unknown / unimplemented {}", fmt::to_string(buf)); if (Settings::values.use_auto_stub) { LOG_WARNING(Service, "Using auto stub fallback!"); IPC::ResponseBuilder rb{ctx, 2}; @@ -71,33 +81,17 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, c } } -[[nodiscard]] static bool VersionGateCheck(Core::System& system, u32 vg) { - u32 const c_maj = FirmwareManager::GetFirmwareVersion(system).first.major; - u32 const c_min = FirmwareManager::GetFirmwareVersion(system).first.minor; - u32 const c_pat = FirmwareManager::GetFirmwareVersion(system).first.micro; - u32 const cg = (c_pat << 0) | (c_min << 4) | (c_maj << 8); - u32 const sg = (vg >> 16) & 0xffff; - u32 const ug = vg & 0xffff; - // feature available after current - if (sg && cg < sg) - return false; - // feature until xxx (0 = up to current) - return ug ? ug >= cg : true; -} - void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) { - const bool is_cmd_read = ctx.GetCommand() == 0; - auto const info = FindRequest(ctx.GetCommand()); - if (!info.has_value() || info->handler_callback == nullptr) - return ReportUnimplementedFunction(ctx, &*info, false); - - if (!VersionGateCheck(system, info->version_gating)) - { - return ReportUnimplementedFunction(ctx, &*info, true); - } + const auto command = ctx.GetCommand(); + auto it = handlers.find(command); + const bool is_cmd_read = command == 0; + FunctionInfoBase const* info = it == handlers.end() ? nullptr : &it->second; + if (info == nullptr || info->handler_callback == nullptr) + return ReportUnimplementedFunction(ctx, info); LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer())); handler_invoker(this, info->handler_callback, ctx); + if (is_i_storage && is_cmd_read) { const auto* const process = ctx.GetThread().GetOwnerProcess(); if (process != nullptr && system.IsNVDECActiveForProcess(process->GetId())) { @@ -107,15 +101,10 @@ void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) { } void ServiceFrameworkBase::InvokeRequestTipc(HLERequestContext& ctx) { - auto const info = FindRequestTipc(ctx.GetCommand()); - if (!info.has_value() || info->handler_callback == nullptr) - return ReportUnimplementedFunction(ctx, &*info, false); - - LOG_ERROR(Service, "check for {} version_gating: {}", info->name, info->version_gating); - if (!VersionGateCheck(system, info->version_gating)) - { - return ReportUnimplementedFunction(ctx, &*info, true); - } + auto it = handlers_tipc.find(ctx.GetCommand()); + FunctionInfoBase const* info = it == handlers_tipc.end() ? nullptr : &it->second; + if (info == nullptr || info->handler_callback == nullptr) + return ReportUnimplementedFunction(ctx, info); LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer())); handler_invoker(this, info->handler_callback, ctx); diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index e8bd8683ea..ea98897e79 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -7,11 +7,7 @@ #pragma once #include -#include #include -#include -#include -#include "frozen/map.h" #include "common/container/unordered_map.h" #include "common/common_types.h" #include "core/hle/service/hle_ipc.h" @@ -81,35 +77,30 @@ protected: [[nodiscard]] virtual std::unique_lock LockService() noexcept { return std::unique_lock{lock_service}; } - - static constexpr u32 MakeVersionGate(std::tuple since, std::tuple until = {0, 0, 0}) { - auto const [s_maj, s_min, s_pat] = since; - auto const [u_maj, u_min, u_pat] = until; - return (u_pat << 0) | (u_min << 4) | (u_maj << 8) - | (s_pat << 16) | (s_min << 20) | (s_maj << 24); - } - - struct FunctionInfoBase { - HandlerFnP handler_callback; - const char* name; - u32 version_gating; - }; - static_assert(std::is_trivially_constructible_v); private: template friend class ServiceFramework; - using InvokerFn = void(ServiceFrameworkBase* object, HandlerFnP member, HLERequestContext& ctx); + struct FunctionInfoBase { + u32 expected_header; + HandlerFnP handler_callback; + const char* name; + }; - explicit ServiceFrameworkBase(Core::System& system_, const char* service_name_, u32 max_sessions_, InvokerFn* handler_invoker_); + using InvokerFn = void(ServiceFrameworkBase* object, HandlerFnP member, + HLERequestContext& ctx); + + explicit ServiceFrameworkBase(Core::System& system_, const char* service_name_, + u32 max_sessions_, InvokerFn* handler_invoker_); ~ServiceFrameworkBase() override; - virtual std::optional FindRequest(u32 key) = 0; - virtual std::optional FindRequestTipc(u32 key) = 0; - - void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info, bool gated); + void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n); + void RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n); + void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info); protected: + ::Common::unordered_map handlers; + ::Common::unordered_map handlers_tipc; /// Used to gain exclusive access to the service members, e.g. from CoreTiming thread. std::mutex lock_service; /// System context that the service operates under. @@ -130,7 +121,8 @@ protected: /** * Framework for implementing HLE services. Dispatches on the header id of incoming SyncRequests * based on a table mapping header ids to handler functions. Service implementations should inherit - * from ServiceFramework using the CRTP (`class Foo : public ServiceFramework { ... };`) + * from ServiceFramework using the CRTP (`class Foo : public ServiceFramework { ... };`) and + * populate it with handlers by calling #RegisterHandlers. * * In order to avoid duplicating code in the binary and exposing too many implementation details in * the header, this class is split into a non-templated base (ServiceFrameworkBase) and a template @@ -151,77 +143,50 @@ protected: /// @param expected_header_ request header in the command buffer which will trigger dispatch to this handler /// @param handler_callback_ member function in this service which will be called to handle the request /// @param name_ human-friendly name for the request. Used mostly for logging purposes. - explicit constexpr FunctionInfoTyped(u32 expected_header_, HandlerFnP handler_callback_, const char* name_, u32 version_gating_ = 0) - : handler_callback{handler_callback_} - , name{name_} - , version_gating{version_gating_} - , expected_header{expected_header_} - {} - HandlerFnP handler_callback; - const char* name; - u32 version_gating; - u32 expected_header; + FunctionInfoTyped(u32 expected_header_, HandlerFnP handler_callback_, const char* name_) + : FunctionInfoBase{expected_header_, HandlerFnP(handler_callback_), name_} {} }; using FunctionInfo = FunctionInfoTyped; - // expected_header serves as a key to 'address' function handlers, thus only include the minimal - template - struct FunctionValueInfo { - explicit constexpr FunctionValueInfo(HandlerFnP handler_callback_, const char* name_, u32 version_gating_) - : handler_callback{handler_callback_} - , name{name_} - , version_gating{version_gating_} - {} - HandlerFnP handler_callback; - const char* name; - u32 version_gating; - }; - - template - //requires (std::same_as && ...) - [[nodiscard]] static consteval frozen::map, sizeof...(Ts)> CreateStaticMap(Ts... args) { - return frozen::map, sizeof...(args)>{ - {args.expected_header, FunctionValueInfo{args.handler_callback, args.name, args.version_gating}}... - }; - } - - // Used exclusively by NFC - template - //requires (std::same_as> && ...) - [[nodiscard]] static consteval frozen::map, sizeof...(Ts)> CreateStaticMapWithClass(Ts... args) { - return frozen::map, sizeof...(args)>{ - {args.expected_header, FunctionValueInfo{args.handler_callback, args.name, args.version_gating}}... - }; - } - - template - [[nodiscard]] static std::optional HandlerTableGenerateWithFind(u32 key, T const& map) { - auto const it = map.find(key); - if (it != map.end()) { - auto const r = it->second; - return std::optional{{ - HandlerFnP(r.handler_callback), - r.name, - r.version_gating - }}; - } - return std::nullopt; - } - - /// @brief Initializes the handler with no functions installed. - /// @param system_ The system context to construct this service under. - /// @param service_name_ Name of the service. - /// @param max_sessions_ Maximum number of sessions that can be connected to this service at the - /// same time. + /** + * Initializes the handler with no functions installed. + * + * @param system_ The system context to construct this service under. + * @param service_name_ Name of the service. + * @param max_sessions_ Maximum number of sessions that can be connected to this service at the + * same time. + */ explicit ServiceFramework(Core::System& system_, const char* service_name_, u32 max_sessions_ = ServerSessionCountMax) - : ServiceFrameworkBase(system_, service_name_, max_sessions_, Invoker) - {} + : ServiceFrameworkBase(system_, service_name_, max_sessions_, Invoker) {} - std::optional FindRequest(u32 key) override { - UNREACHABLE(); + /// Registers handlers in the service. + template + void RegisterHandlers(const FunctionInfoTyped (&functions)[N]) { + RegisterHandlers(functions, N); } - std::optional FindRequestTipc(u32 key) override { - UNREACHABLE(); + + /** + * Registers handlers in the service. Usually prefer using the other RegisterHandlers + * overload in order to avoid needing to specify the array size. + */ + template + void RegisterHandlers(const FunctionInfoTyped* functions, std::size_t n) { + RegisterHandlersBase(functions, n); + } + + /// Registers handlers in the service. + template + void RegisterHandlersTipc(const FunctionInfoTyped (&functions)[N]) { + RegisterHandlersTipc(functions, N); + } + + /** + * Registers handlers in the service. Usually prefer using the other RegisterHandlers + * overload in order to avoid needing to specify the array size. + */ + template + void RegisterHandlersTipc(const FunctionInfoTyped* functions, std::size_t n) { + RegisterHandlersBaseTipc(functions, n); } protected: diff --git a/src/core/hle/service/services.h b/src/core/hle/service/services.h index da5281ff29..4072afa3d1 100644 --- a/src/core/hle/service/services.h +++ b/src/core/hle/service/services.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project diff --git a/src/core/hle/service/set/factory_settings_server.cpp b/src/core/hle/service/set/factory_settings_server.cpp index 70d02fab3b..d663283c98 100644 --- a/src/core/hle/service/set/factory_settings_server.cpp +++ b/src/core/hle/service/set/factory_settings_server.cpp @@ -10,6 +10,55 @@ namespace Service::Set { IFactorySettingsServer::IFactorySettingsServer(Core::System& system_) : ServiceFramework{system_, "set:cal"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetBluetoothBdAddress"}, + {1, nullptr, "GetConfigurationId1"}, + {2, nullptr, "GetAccelerometerOffset"}, + {3, nullptr, "GetAccelerometerScale"}, + {4, nullptr, "GetGyroscopeOffset"}, + {5, nullptr, "GetGyroscopeScale"}, + {6, nullptr, "GetWirelessLanMacAddress"}, + {7, nullptr, "GetWirelessLanCountryCodeCount"}, + {8, nullptr, "GetWirelessLanCountryCodes"}, + {9, nullptr, "GetSerialNumber"}, + {10, nullptr, "SetInitialSystemAppletProgramId"}, + {11, nullptr, "SetOverlayDispProgramId"}, + {12, nullptr, "GetBatteryLot"}, + {14, nullptr, "GetEciDeviceCertificate"}, + {15, nullptr, "GetEticketDeviceCertificate"}, + {16, nullptr, "GetSslKey"}, + {17, nullptr, "GetSslCertificate"}, + {18, nullptr, "GetGameCardKey"}, + {19, nullptr, "GetGameCardCertificate"}, + {20, nullptr, "GetEciDeviceKey"}, + {21, nullptr, "GetEticketDeviceKey"}, + {22, nullptr, "GetSpeakerParameter"}, + {23, nullptr, "GetLcdVendorId"}, + {24, nullptr, "GetEciDeviceCertificate2"}, + {25, nullptr, "GetEciDeviceKey2"}, + {26, nullptr, "GetAmiiboKey"}, + {27, nullptr, "GetAmiiboEcqvCertificate"}, + {28, nullptr, "GetAmiiboEcdsaCertificate"}, + {29, nullptr, "GetAmiiboEcqvBlsKey"}, + {30, nullptr, "GetAmiiboEcqvBlsCertificate"}, + {31, nullptr, "GetAmiiboEcqvBlsRootCertificate"}, + {32, nullptr, "GetUsbTypeCPowerSourceCircuitVersion"}, + {33, nullptr, "GetAnalogStickModuleTypeL"}, + {34, nullptr, "GetAnalogStickModelParameterL"}, + {35, nullptr, "GetAnalogStickFactoryCalibrationL"}, + {36, nullptr, "GetAnalogStickModuleTypeR"}, + {37, nullptr, "GetAnalogStickModelParameterR"}, + {38, nullptr, "GetAnalogStickFactoryCalibrationR"}, + {39, nullptr, "GetConsoleSixAxisSensorModuleType"}, + {40, nullptr, "GetConsoleSixAxisSensorHorizontalOffset"}, + {41, nullptr, "GetBatteryVersion"}, + {42, nullptr, "GetDeviceId"}, + {43, nullptr, "GetConsoleSixAxisSensorMountType"}, + }; + // clang-format on + + RegisterHandlers(functions); } IFactorySettingsServer::~IFactorySettingsServer() = default; diff --git a/src/core/hle/service/set/factory_settings_server.h b/src/core/hle/service/set/factory_settings_server.h index dcc329f9c2..ddffcee643 100644 --- a/src/core/hle/service/set/factory_settings_server.h +++ b/src/core/hle/service/set/factory_settings_server.h @@ -18,55 +18,6 @@ class IFactorySettingsServer final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetBluetoothBdAddress"}, - FunctionInfo{1, nullptr, "GetConfigurationId1"}, - FunctionInfo{2, nullptr, "GetAccelerometerOffset"}, - FunctionInfo{3, nullptr, "GetAccelerometerScale"}, - FunctionInfo{4, nullptr, "GetGyroscopeOffset"}, - FunctionInfo{5, nullptr, "GetGyroscopeScale"}, - FunctionInfo{6, nullptr, "GetWirelessLanMacAddress"}, - FunctionInfo{7, nullptr, "GetWirelessLanCountryCodeCount"}, - FunctionInfo{8, nullptr, "GetWirelessLanCountryCodes"}, - FunctionInfo{9, nullptr, "GetSerialNumber"}, - FunctionInfo{10, nullptr, "SetInitialSystemAppletProgramId"}, - FunctionInfo{11, nullptr, "SetOverlayDispProgramId"}, - FunctionInfo{12, nullptr, "GetBatteryLot"}, - FunctionInfo{14, nullptr, "GetEciDeviceCertificate"}, - FunctionInfo{15, nullptr, "GetEticketDeviceCertificate"}, - FunctionInfo{16, nullptr, "GetSslKey"}, - FunctionInfo{17, nullptr, "GetSslCertificate"}, - FunctionInfo{18, nullptr, "GetGameCardKey"}, - FunctionInfo{19, nullptr, "GetGameCardCertificate"}, - FunctionInfo{20, nullptr, "GetEciDeviceKey"}, - FunctionInfo{21, nullptr, "GetEticketDeviceKey"}, - FunctionInfo{22, nullptr, "GetSpeakerParameter"}, - FunctionInfo{23, nullptr, "GetLcdVendorId"}, - FunctionInfo{24, nullptr, "GetEciDeviceCertificate2"}, - FunctionInfo{25, nullptr, "GetEciDeviceKey2"}, - FunctionInfo{26, nullptr, "GetAmiiboKey"}, - FunctionInfo{27, nullptr, "GetAmiiboEcqvCertificate"}, - FunctionInfo{28, nullptr, "GetAmiiboEcdsaCertificate"}, - FunctionInfo{29, nullptr, "GetAmiiboEcqvBlsKey"}, - FunctionInfo{30, nullptr, "GetAmiiboEcqvBlsCertificate"}, - FunctionInfo{31, nullptr, "GetAmiiboEcqvBlsRootCertificate"}, - FunctionInfo{32, nullptr, "GetUsbTypeCPowerSourceCircuitVersion"}, - FunctionInfo{33, nullptr, "GetAnalogStickModuleTypeL"}, - FunctionInfo{34, nullptr, "GetAnalogStickModelParameterL"}, - FunctionInfo{35, nullptr, "GetAnalogStickFactoryCalibrationL"}, - FunctionInfo{36, nullptr, "GetAnalogStickModuleTypeR"}, - FunctionInfo{37, nullptr, "GetAnalogStickModelParameterR"}, - FunctionInfo{38, nullptr, "GetAnalogStickFactoryCalibrationR"}, - FunctionInfo{39, nullptr, "GetConsoleSixAxisSensorModuleType"}, - FunctionInfo{40, nullptr, "GetConsoleSixAxisSensorHorizontalOffset"}, - FunctionInfo{41, nullptr, "GetBatteryVersion"}, - FunctionInfo{42, nullptr, "GetDeviceId"}, - FunctionInfo{43, nullptr, "GetConsoleSixAxisSensorMountType"} - ); }; } // namespace Service::Set diff --git a/src/core/hle/service/set/firmware_debug_settings_server.cpp b/src/core/hle/service/set/firmware_debug_settings_server.cpp index 35fb43f7e7..c491675567 100644 --- a/src/core/hle/service/set/firmware_debug_settings_server.cpp +++ b/src/core/hle/service/set/firmware_debug_settings_server.cpp @@ -10,6 +10,23 @@ namespace Service::Set { IFirmwareDebugSettingsServer::IFirmwareDebugSettingsServer(Core::System& system_) : ServiceFramework{system_, "set:fd"} { + // clang-format off + static const FunctionInfo functions[] = { + {2, nullptr, "SetSettingsItemValue"}, + {3, nullptr, "ResetSettingsItemValue"}, + {4, nullptr, "CreateSettingsItemKeyIterator"}, + {10, nullptr, "ReadSettings"}, + {11, nullptr, "ResetSettings"}, + {20, nullptr, "SetWebInspectorFlag"}, + {21, nullptr, "SetAllowedSslHosts"}, + {22, nullptr, "SetHostFsMountPoint"}, + {23, nullptr, "SetMemoryUsageRateFlag"}, + {24, nullptr, "CommitSettings"}, //20.0.0+ + {27, nullptr, "SetHttpAuthConfigs"}, //21.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); } IFirmwareDebugSettingsServer::~IFirmwareDebugSettingsServer() = default; diff --git a/src/core/hle/service/set/firmware_debug_settings_server.h b/src/core/hle/service/set/firmware_debug_settings_server.h index 3727a1a94c..05019faa9f 100644 --- a/src/core/hle/service/set/firmware_debug_settings_server.h +++ b/src/core/hle/service/set/firmware_debug_settings_server.h @@ -18,23 +18,6 @@ class IFirmwareDebugSettingsServer final : public ServiceFramework FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{2, nullptr, "SetSettingsItemValue"}, - FunctionInfo{3, nullptr, "ResetSettingsItemValue"}, - FunctionInfo{4, nullptr, "CreateSettingsItemKeyIterator"}, - FunctionInfo{10, nullptr, "ReadSettings"}, - FunctionInfo{11, nullptr, "ResetSettings"}, - FunctionInfo{20, nullptr, "SetWebInspectorFlag"}, - FunctionInfo{21, nullptr, "SetAllowedSslHosts"}, - FunctionInfo{22, nullptr, "SetHostFsMountPoint"}, - FunctionInfo{23, nullptr, "SetMemoryUsageRateFlag"}, - FunctionInfo{24, nullptr, "CommitSettings", MakeVersionGate({20,0,0})}, - FunctionInfo{27, nullptr, "SetHttpAuthConfigs", MakeVersionGate({21,0,0})} - ); }; } // namespace Service::Set diff --git a/src/core/hle/service/set/key_code_map.h b/src/core/hle/service/set/key_code_map.h index c76dc57298..8e010e718b 100644 --- a/src/core/hle/service/set/key_code_map.h +++ b/src/core/hle/service/set/key_code_map.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/core/hle/service/set/setting_formats/appln_settings.cpp b/src/core/hle/service/set/setting_formats/appln_settings.cpp index f7c7d5b912..5726a41cdf 100644 --- a/src/core/hle/service/set/setting_formats/appln_settings.cpp +++ b/src/core/hle/service/set/setting_formats/appln_settings.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/set/setting_formats/appln_settings.h b/src/core/hle/service/set/setting_formats/appln_settings.h index ba9af998ab..2128a631e0 100644 --- a/src/core/hle/service/set/setting_formats/appln_settings.h +++ b/src/core/hle/service/set/setting_formats/appln_settings.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/set/setting_formats/device_settings.cpp b/src/core/hle/service/set/setting_formats/device_settings.cpp index 5f295404d9..6e9c321d8e 100644 --- a/src/core/hle/service/set/setting_formats/device_settings.cpp +++ b/src/core/hle/service/set/setting_formats/device_settings.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/set/setting_formats/private_settings.cpp b/src/core/hle/service/set/setting_formats/private_settings.cpp index 81c3624826..c3a67b60eb 100644 --- a/src/core/hle/service/set/setting_formats/private_settings.cpp +++ b/src/core/hle/service/set/setting_formats/private_settings.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/set/setting_formats/private_settings.h b/src/core/hle/service/set/setting_formats/private_settings.h index 6579e95e04..75e3e03886 100644 --- a/src/core/hle/service/set/setting_formats/private_settings.h +++ b/src/core/hle/service/set/setting_formats/private_settings.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/set/setting_formats/system_settings.cpp b/src/core/hle/service/set/setting_formats/system_settings.cpp index 258e213e13..fd70e2ace3 100644 --- a/src/core/hle/service/set/setting_formats/system_settings.cpp +++ b/src/core/hle/service/set/setting_formats/system_settings.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project diff --git a/src/core/hle/service/set/settings.h b/src/core/hle/service/set/settings.h index 03cd4bb661..e6288af2e5 100644 --- a/src/core/hle/service/set/settings.h +++ b/src/core/hle/service/set/settings.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/set/settings_server.cpp b/src/core/hle/service/set/settings_server.cpp index 4580cb723b..942dddc9bc 100644 --- a/src/core/hle/service/set/settings_server.cpp +++ b/src/core/hle/service/set/settings_server.cpp @@ -89,26 +89,26 @@ LanguageCode GetLanguageCodeFromIndex(std::size_t index) { return available_language_codes.at(index); } -std::optional ISettingsServer::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&ISettingsServer::GetLanguageCode>, "GetLanguageCode"}, - FunctionInfo{1, C<&ISettingsServer::GetAvailableLanguageCodes>, "GetAvailableLanguageCodes"}, - FunctionInfo{2, C<&ISettingsServer::MakeLanguageCode>, "MakeLanguageCode"}, - FunctionInfo{3, C<&ISettingsServer::GetAvailableLanguageCodeCount>, "GetAvailableLanguageCodeCount"}, - FunctionInfo{4, C<&ISettingsServer::GetRegionCode>, "GetRegionCode"}, - FunctionInfo{5, C<&ISettingsServer::GetAvailableLanguageCodes2>, "GetAvailableLanguageCodes2"}, - FunctionInfo{6, C<&ISettingsServer::GetAvailableLanguageCodeCount2>, "GetAvailableLanguageCodeCount2"}, - FunctionInfo{7, C<&ISettingsServer::GetKeyCodeMap>, "GetKeyCodeMap"}, - FunctionInfo{8, C<&ISettingsServer::GetQuestFlag>, "GetQuestFlag"}, - FunctionInfo{9, C<&ISettingsServer::GetKeyCodeMap2>, "GetKeyCodeMap2"}, - FunctionInfo{10, nullptr, "GetFirmwareVersionForDebug"}, - FunctionInfo{11, C<&ISettingsServer::GetDeviceNickName>, "GetDeviceNickName"}, - FunctionInfo{12, C<&ISettingsServer::GetKeyCodeMapByPort>, "GetKeyCodeMapByPort"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - ISettingsServer::ISettingsServer(Core::System& system_) : ServiceFramework{system_, "set"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&ISettingsServer::GetLanguageCode>, "GetLanguageCode"}, + {1, C<&ISettingsServer::GetAvailableLanguageCodes>, "GetAvailableLanguageCodes"}, + {2, C<&ISettingsServer::MakeLanguageCode>, "MakeLanguageCode"}, + {3, C<&ISettingsServer::GetAvailableLanguageCodeCount>, "GetAvailableLanguageCodeCount"}, + {4, C<&ISettingsServer::GetRegionCode>, "GetRegionCode"}, + {5, C<&ISettingsServer::GetAvailableLanguageCodes2>, "GetAvailableLanguageCodes2"}, + {6, C<&ISettingsServer::GetAvailableLanguageCodeCount2>, "GetAvailableLanguageCodeCount2"}, + {7, C<&ISettingsServer::GetKeyCodeMap>, "GetKeyCodeMap"}, + {8, C<&ISettingsServer::GetQuestFlag>, "GetQuestFlag"}, + {9, C<&ISettingsServer::GetKeyCodeMap2>, "GetKeyCodeMap2"}, + {10, nullptr, "GetFirmwareVersionForDebug"}, + {11, C<&ISettingsServer::GetDeviceNickName>, "GetDeviceNickName"}, + {12, C<&ISettingsServer::GetKeyCodeMapByPort>, "GetKeyCodeMapByPort"}, + }; + // clang-format on + + RegisterHandlers(functions); } ISettingsServer::~ISettingsServer() = default; diff --git a/src/core/hle/service/set/settings_server.h b/src/core/hle/service/set/settings_server.h index 2aa487b8b1..c37a65cbc9 100644 --- a/src/core/hle/service/set/settings_server.h +++ b/src/core/hle/service/set/settings_server.h @@ -26,19 +26,31 @@ public: private: Result GetLanguageCode(Out out_language_code); - Result GetAvailableLanguageCodes(Out out_count, OutArray language_codes); - Result MakeLanguageCode(Out out_language_code, Language language); - Result GetAvailableLanguageCodeCount(Out out_count); - Result GetRegionCode(Out out_region_code); - Result GetAvailableLanguageCodes2(Out out_count, OutArray language_codes); - Result GetAvailableLanguageCodeCount2(Out out_count); - Result GetKeyCodeMap(OutLargeData out_key_code_map); - Result GetQuestFlag(Out out_quest_flag); - Result GetKeyCodeMap2(OutLargeData out_key_code_map); - Result GetDeviceNickName(OutLargeData, BufferAttr_HipcMapAlias> out_device_name); - Result GetKeyCodeMapByPort(OutLargeData out_key_code_map, u32 port); - std::optional FindRequest(u32 key) override; + Result GetAvailableLanguageCodes(Out out_count, + OutArray language_codes); + + Result MakeLanguageCode(Out out_language_code, Language language); + + Result GetAvailableLanguageCodeCount(Out out_count); + + Result GetRegionCode(Out out_region_code); + + Result GetAvailableLanguageCodes2( + Out out_count, OutArray language_codes); + + Result GetAvailableLanguageCodeCount2(Out out_count); + + Result GetKeyCodeMap(OutLargeData out_key_code_map); + + Result GetQuestFlag(Out out_quest_flag); + + Result GetKeyCodeMap2(OutLargeData out_key_code_map); + + Result GetDeviceNickName( + OutLargeData, BufferAttr_HipcMapAlias> out_device_name); + + Result GetKeyCodeMapByPort(OutLargeData out_key_code_map, u32 port); }; } // namespace Service::Set diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp index 925207d927..52642e37f7 100644 --- a/src/core/hle/service/set/system_settings_server.cpp +++ b/src/core/hle/service/set/system_settings_server.cpp @@ -114,239 +114,240 @@ Result GetFirmwareVersionImpl(FirmwareVersionFormat& out_firmware, Core::System& return ResultSuccess; } -std::optional ISystemSettingsServer::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&ISystemSettingsServer::SetLanguageCode>, "SetLanguageCode"}, - FunctionInfo{1, nullptr, "SetNetworkSettings"}, - FunctionInfo{2, nullptr, "GetNetworkSettings"}, - FunctionInfo{3, C<&ISystemSettingsServer::GetFirmwareVersion>, "GetFirmwareVersion"}, - FunctionInfo{4, C<&ISystemSettingsServer::GetFirmwareVersion2>, "GetFirmwareVersion2"}, - FunctionInfo{5, nullptr, "GetFirmwareVersionDigest"}, - FunctionInfo{7, C<&ISystemSettingsServer::GetLockScreenFlag>, "GetLockScreenFlag"}, - FunctionInfo{8, C<&ISystemSettingsServer::SetLockScreenFlag>, "SetLockScreenFlag"}, - FunctionInfo{9, nullptr, "GetBacklightSettings"}, - FunctionInfo{10, nullptr, "SetBacklightSettings"}, - FunctionInfo{11, nullptr, "SetBluetoothDevicesSettings"}, - FunctionInfo{12, nullptr, "GetBluetoothDevicesSettings"}, - FunctionInfo{13, C<&ISystemSettingsServer::GetExternalSteadyClockSourceId>, "GetExternalSteadyClockSourceId"}, - FunctionInfo{14, C<&ISystemSettingsServer::SetExternalSteadyClockSourceId>, "SetExternalSteadyClockSourceId"}, - FunctionInfo{15, C<&ISystemSettingsServer::GetUserSystemClockContext>, "GetUserSystemClockContext"}, - FunctionInfo{16, C<&ISystemSettingsServer::SetUserSystemClockContext>, "SetUserSystemClockContext"}, - FunctionInfo{17, C<&ISystemSettingsServer::GetAccountSettings>, "GetAccountSettings"}, - FunctionInfo{18, C<&ISystemSettingsServer::SetAccountSettings>, "SetAccountSettings"}, - FunctionInfo{19, nullptr, "GetAudioVolume"}, - FunctionInfo{20, nullptr, "SetAudioVolume"}, - FunctionInfo{21, C<&ISystemSettingsServer::GetEulaVersions>, "GetEulaVersions"}, - FunctionInfo{22, C<&ISystemSettingsServer::SetEulaVersions>, "SetEulaVersions"}, - FunctionInfo{23, C<&ISystemSettingsServer::GetColorSetId>, "GetColorSetId"}, - FunctionInfo{24, C<&ISystemSettingsServer::SetColorSetId>, "SetColorSetId"}, - FunctionInfo{25, C<&ISystemSettingsServer::GetConsoleInformationUploadFlag>, "GetConsoleInformationUploadFlag"}, - FunctionInfo{26, C<&ISystemSettingsServer::SetConsoleInformationUploadFlag>, "SetConsoleInformationUploadFlag"}, - FunctionInfo{27, C<&ISystemSettingsServer::GetAutomaticApplicationDownloadFlag>, "GetAutomaticApplicationDownloadFlag"}, - FunctionInfo{28, C<&ISystemSettingsServer::SetAutomaticApplicationDownloadFlag>, "SetAutomaticApplicationDownloadFlag"}, - FunctionInfo{29, C<&ISystemSettingsServer::GetNotificationSettings>, "GetNotificationSettings"}, - FunctionInfo{30, C<&ISystemSettingsServer::SetNotificationSettings>, "SetNotificationSettings"}, - FunctionInfo{31, C<&ISystemSettingsServer::GetAccountNotificationSettings>, "GetAccountNotificationSettings"}, - FunctionInfo{32, C<&ISystemSettingsServer::SetAccountNotificationSettings>, "SetAccountNotificationSettings"}, - FunctionInfo{35, C<&ISystemSettingsServer::GetVibrationMasterVolume>, "GetVibrationMasterVolume"}, - FunctionInfo{36, C<&ISystemSettingsServer::SetVibrationMasterVolume>, "SetVibrationMasterVolume"}, - FunctionInfo{37, C<&ISystemSettingsServer::GetSettingsItemValueSize>, "GetSettingsItemValueSize"}, - FunctionInfo{38, C<&ISystemSettingsServer::GetSettingsItemValue>, "GetSettingsItemValue"}, - FunctionInfo{39, C<&ISystemSettingsServer::GetTvSettings>, "GetTvSettings"}, - FunctionInfo{40, C<&ISystemSettingsServer::SetTvSettings>, "SetTvSettings"}, - FunctionInfo{41, nullptr, "GetEdid"}, - FunctionInfo{42, nullptr, "SetEdid"}, - FunctionInfo{43, C<&ISystemSettingsServer::GetAudioOutputMode>, "GetAudioOutputMode"}, - FunctionInfo{44, C<&ISystemSettingsServer::SetAudioOutputMode>, "SetAudioOutputMode"}, - FunctionInfo{45, C<&ISystemSettingsServer::GetSpeakerAutoMuteFlag>, "GetSpeakerAutoMuteFlag"}, - FunctionInfo{46, C<&ISystemSettingsServer::SetSpeakerAutoMuteFlag>, "SetSpeakerAutoMuteFlag"}, - FunctionInfo{47, C<&ISystemSettingsServer::GetQuestFlag>, "GetQuestFlag"}, - FunctionInfo{48, C<&ISystemSettingsServer::SetQuestFlag>, "SetQuestFlag"}, - FunctionInfo{49, nullptr, "GetDataDeletionSettings"}, - FunctionInfo{50, nullptr, "SetDataDeletionSettings"}, - FunctionInfo{51, nullptr, "GetInitialSystemAppletProgramId"}, - FunctionInfo{52, nullptr, "GetOverlayDispProgramId"}, - FunctionInfo{53, C<&ISystemSettingsServer::GetDeviceTimeZoneLocationName>, "GetDeviceTimeZoneLocationName"}, - FunctionInfo{54, C<&ISystemSettingsServer::SetDeviceTimeZoneLocationName>, "SetDeviceTimeZoneLocationName"}, - FunctionInfo{55, nullptr, "GetWirelessCertificationFileSize"}, - FunctionInfo{56, nullptr, "GetWirelessCertificationFile"}, - FunctionInfo{57, C<&ISystemSettingsServer::SetRegionCode>, "SetRegionCode"}, - FunctionInfo{58, C<&ISystemSettingsServer::GetNetworkSystemClockContext>, "GetNetworkSystemClockContext"}, - FunctionInfo{59, C<&ISystemSettingsServer::SetNetworkSystemClockContext>, "SetNetworkSystemClockContext"}, - FunctionInfo{60, C<&ISystemSettingsServer::IsUserSystemClockAutomaticCorrectionEnabled>, "IsUserSystemClockAutomaticCorrectionEnabled"}, - FunctionInfo{61, C<&ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionEnabled>, "SetUserSystemClockAutomaticCorrectionEnabled"}, - FunctionInfo{62, C<&ISystemSettingsServer::GetDebugModeFlag>, "GetDebugModeFlag"}, - FunctionInfo{63, C<&ISystemSettingsServer::GetPrimaryAlbumStorage>, "GetPrimaryAlbumStorage"}, - FunctionInfo{64, C<&ISystemSettingsServer::SetPrimaryAlbumStorage>, "SetPrimaryAlbumStorage"}, - FunctionInfo{65, C<&ISystemSettingsServer::GetUsb30EnableFlag>, "GetUsb30EnableFlag"}, - FunctionInfo{66, C<&ISystemSettingsServer::SetUsb30EnableFlag>, "SetUsb30EnableFlag"}, - FunctionInfo{67, C<&ISystemSettingsServer::GetBatteryLot>, "GetBatteryLot"}, - FunctionInfo{68, C<&ISystemSettingsServer::GetSerialNumber>, "GetSerialNumber"}, - FunctionInfo{69, C<&ISystemSettingsServer::GetNfcEnableFlag>, "GetNfcEnableFlag"}, - FunctionInfo{70, C<&ISystemSettingsServer::SetNfcEnableFlag>, "SetNfcEnableFlag"}, - FunctionInfo{71, C<&ISystemSettingsServer::GetSleepSettings>, "GetSleepSettings"}, - FunctionInfo{72, C<&ISystemSettingsServer::SetSleepSettings>, "SetSleepSettings"}, - FunctionInfo{73, C<&ISystemSettingsServer::GetWirelessLanEnableFlag>, "GetWirelessLanEnableFlag"}, - FunctionInfo{74, C<&ISystemSettingsServer::SetWirelessLanEnableFlag>, "SetWirelessLanEnableFlag"}, - FunctionInfo{75, C<&ISystemSettingsServer::GetInitialLaunchSettings>, "GetInitialLaunchSettings"}, - FunctionInfo{76, C<&ISystemSettingsServer::SetInitialLaunchSettings>, "SetInitialLaunchSettings"}, - FunctionInfo{77, C<&ISystemSettingsServer::GetDeviceNickName>, "GetDeviceNickName"}, - FunctionInfo{78, C<&ISystemSettingsServer::SetDeviceNickName>, "SetDeviceNickName"}, - FunctionInfo{79, C<&ISystemSettingsServer::GetProductModel>, "GetProductModel"}, - FunctionInfo{80, nullptr, "GetLdnChannel"}, - FunctionInfo{81, nullptr, "SetLdnChannel"}, - FunctionInfo{82, nullptr, "AcquireTelemetryDirtyFlagEventHandle"}, - FunctionInfo{83, nullptr, "GetTelemetryDirtyFlags"}, - FunctionInfo{84, nullptr, "GetPtmBatteryLot"}, - FunctionInfo{85, nullptr, "SetPtmBatteryLot"}, - FunctionInfo{86, nullptr, "GetPtmFuelGaugeParameter"}, - FunctionInfo{87, nullptr, "SetPtmFuelGaugeParameter"}, - FunctionInfo{88, C<&ISystemSettingsServer::GetBluetoothEnableFlag>, "GetBluetoothEnableFlag"}, - FunctionInfo{89, C<&ISystemSettingsServer::SetBluetoothEnableFlag>, "SetBluetoothEnableFlag"}, - FunctionInfo{90, C<&ISystemSettingsServer::GetMiiAuthorId>, "GetMiiAuthorId"}, - FunctionInfo{91, nullptr, "SetShutdownRtcValue"}, - FunctionInfo{92, nullptr, "GetShutdownRtcValue"}, - FunctionInfo{93, nullptr, "AcquireFatalDirtyFlagEventHandle"}, - FunctionInfo{94, nullptr, "GetFatalDirtyFlags"}, - FunctionInfo{95, C<&ISystemSettingsServer::GetAutoUpdateEnableFlag>, "GetAutoUpdateEnableFlag"}, - FunctionInfo{96, C<&ISystemSettingsServer::SetAutoUpdateEnableFlag>, "SetAutoUpdateEnableFlag"}, - FunctionInfo{97, nullptr, "GetNxControllerSettings"}, - FunctionInfo{98, nullptr, "SetNxControllerSettings"}, - FunctionInfo{99, C<&ISystemSettingsServer::GetBatteryPercentageFlag>, "GetBatteryPercentageFlag"}, - FunctionInfo{100, C<&ISystemSettingsServer::SetBatteryPercentageFlag>, "SetBatteryPercentageFlag"}, - FunctionInfo{101, nullptr, "GetExternalRtcResetFlag"}, - FunctionInfo{102, nullptr, "SetExternalRtcResetFlag"}, - FunctionInfo{103, nullptr, "GetUsbFullKeyEnableFlag"}, - FunctionInfo{104, nullptr, "SetUsbFullKeyEnableFlag"}, - FunctionInfo{105, C<&ISystemSettingsServer::SetExternalSteadyClockInternalOffset>, "SetExternalSteadyClockInternalOffset"}, - FunctionInfo{106, C<&ISystemSettingsServer::GetExternalSteadyClockInternalOffset>, "GetExternalSteadyClockInternalOffset"}, - FunctionInfo{107, nullptr, "GetBacklightSettingsEx"}, - FunctionInfo{108, nullptr, "SetBacklightSettingsEx"}, - FunctionInfo{109, nullptr, "GetHeadphoneVolumeWarningCount"}, - FunctionInfo{110, nullptr, "SetHeadphoneVolumeWarningCount"}, - FunctionInfo{111, nullptr, "GetBluetoothAfhEnableFlag"}, - FunctionInfo{112, nullptr, "SetBluetoothAfhEnableFlag"}, - FunctionInfo{113, nullptr, "GetBluetoothBoostEnableFlag"}, - FunctionInfo{114, nullptr, "SetBluetoothBoostEnableFlag"}, - FunctionInfo{115, nullptr, "GetInRepairProcessEnableFlag"}, - FunctionInfo{116, nullptr, "SetInRepairProcessEnableFlag"}, - FunctionInfo{117, nullptr, "GetHeadphoneVolumeUpdateFlag"}, - FunctionInfo{118, nullptr, "SetHeadphoneVolumeUpdateFlag"}, - FunctionInfo{119, nullptr, "NeedsToUpdateHeadphoneVolume"}, - FunctionInfo{120, C<&ISystemSettingsServer::GetPushNotificationActivityModeOnSleep>, "GetPushNotificationActivityModeOnSleep"}, - FunctionInfo{121, C<&ISystemSettingsServer::SetPushNotificationActivityModeOnSleep>, "SetPushNotificationActivityModeOnSleep"}, - FunctionInfo{122, nullptr, "GetServiceDiscoveryControlSettings"}, - FunctionInfo{123, nullptr, "SetServiceDiscoveryControlSettings"}, - FunctionInfo{124, C<&ISystemSettingsServer::GetErrorReportSharePermission>, "GetErrorReportSharePermission"}, - FunctionInfo{125, C<&ISystemSettingsServer::SetErrorReportSharePermission>, "SetErrorReportSharePermission"}, - FunctionInfo{126, C<&ISystemSettingsServer::GetAppletLaunchFlags>, "GetAppletLaunchFlags"}, - FunctionInfo{127, C<&ISystemSettingsServer::SetAppletLaunchFlags>, "SetAppletLaunchFlags"}, - FunctionInfo{128, nullptr, "GetConsoleSixAxisSensorAccelerationBias"}, - FunctionInfo{129, nullptr, "SetConsoleSixAxisSensorAccelerationBias"}, - FunctionInfo{130, nullptr, "GetConsoleSixAxisSensorAngularVelocityBias"}, - FunctionInfo{131, nullptr, "SetConsoleSixAxisSensorAngularVelocityBias"}, - FunctionInfo{132, nullptr, "GetConsoleSixAxisSensorAccelerationGain"}, - FunctionInfo{133, nullptr, "SetConsoleSixAxisSensorAccelerationGain"}, - FunctionInfo{134, nullptr, "GetConsoleSixAxisSensorAngularVelocityGain"}, - FunctionInfo{135, nullptr, "SetConsoleSixAxisSensorAngularVelocityGain"}, - FunctionInfo{136, C<&ISystemSettingsServer::GetKeyboardLayout>, "GetKeyboardLayout"}, - FunctionInfo{137, C<&ISystemSettingsServer::SetKeyboardLayout>, "SetKeyboardLayout"}, - FunctionInfo{138, nullptr, "GetWebInspectorFlag"}, - FunctionInfo{139, nullptr, "GetAllowedSslHosts"}, - FunctionInfo{140, nullptr, "GetHostFsMountPoint"}, - FunctionInfo{141, nullptr, "GetRequiresRunRepairTimeReviser"}, - FunctionInfo{142, nullptr, "SetRequiresRunRepairTimeReviser"}, - FunctionInfo{143, nullptr, "SetBlePairingSettings"}, - FunctionInfo{144, nullptr, "GetBlePairingSettings"}, - FunctionInfo{145, nullptr, "GetConsoleSixAxisSensorAngularVelocityTimeBias"}, - FunctionInfo{146, nullptr, "SetConsoleSixAxisSensorAngularVelocityTimeBias"}, - FunctionInfo{147, nullptr, "GetConsoleSixAxisSensorAngularAcceleration"}, - FunctionInfo{148, nullptr, "SetConsoleSixAxisSensorAngularAcceleration"}, - FunctionInfo{149, C<&ISystemSettingsServer::GetRebootlessSystemUpdateVersion>, "GetRebootlessSystemUpdateVersion"}, - FunctionInfo{150, C<&ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime>, "GetDeviceTimeZoneLocationUpdatedTime"}, - FunctionInfo{151, C<&ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime>, "SetDeviceTimeZoneLocationUpdatedTime"}, - FunctionInfo{152, C<&ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime>, "GetUserSystemClockAutomaticCorrectionUpdatedTime"}, - FunctionInfo{153, C<&ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime>, "SetUserSystemClockAutomaticCorrectionUpdatedTime"}, - FunctionInfo{154, nullptr, "GetAccountOnlineStorageSettings"}, - FunctionInfo{155, nullptr, "SetAccountOnlineStorageSettings"}, - FunctionInfo{156, nullptr, "GetPctlReadyFlag"}, - FunctionInfo{157, nullptr, "SetPctlReadyFlag"}, - FunctionInfo{158, nullptr, "GetAnalogStickUserCalibrationL"}, - FunctionInfo{159, nullptr, "SetAnalogStickUserCalibrationL"}, - FunctionInfo{160, nullptr, "GetAnalogStickUserCalibrationR"}, - FunctionInfo{161, nullptr, "SetAnalogStickUserCalibrationR"}, - FunctionInfo{162, nullptr, "GetPtmBatteryVersion"}, - FunctionInfo{163, nullptr, "SetPtmBatteryVersion"}, - FunctionInfo{164, nullptr, "GetUsb30HostEnableFlag"}, - FunctionInfo{165, nullptr, "SetUsb30HostEnableFlag"}, - FunctionInfo{166, nullptr, "GetUsb30DeviceEnableFlag"}, - FunctionInfo{167, nullptr, "SetUsb30DeviceEnableFlag"}, - FunctionInfo{168, nullptr, "GetThemeId"}, - FunctionInfo{169, nullptr, "SetThemeId"}, - FunctionInfo{170, C<&ISystemSettingsServer::GetChineseTraditionalInputMethod>, "GetChineseTraditionalInputMethod"}, - FunctionInfo{171, nullptr, "SetChineseTraditionalInputMethod"}, - FunctionInfo{172, nullptr, "GetPtmCycleCountReliability"}, - FunctionInfo{173, nullptr, "SetPtmCycleCountReliability"}, - FunctionInfo{174, C<&ISystemSettingsServer::GetHomeMenuScheme>, "GetHomeMenuScheme"}, - FunctionInfo{175, nullptr, "GetThemeSettings"}, - FunctionInfo{176, nullptr, "SetThemeSettings"}, - FunctionInfo{177, nullptr, "GetThemeKey"}, - FunctionInfo{178, nullptr, "SetThemeKey"}, - FunctionInfo{179, nullptr, "GetZoomFlag"}, - FunctionInfo{180, nullptr, "SetZoomFlag"}, - FunctionInfo{181, nullptr, "GetT"}, - FunctionInfo{182, nullptr, "SetT"}, - FunctionInfo{183, C<&ISystemSettingsServer::GetPlatformRegion>, "GetPlatformRegion"}, - FunctionInfo{184, C<&ISystemSettingsServer::SetPlatformRegion>, "SetPlatformRegion"}, - FunctionInfo{185, C<&ISystemSettingsServer::GetHomeMenuSchemeModel>, "GetHomeMenuSchemeModel"}, - FunctionInfo{186, nullptr, "GetMemoryUsageRateFlag"}, - FunctionInfo{187, C<&ISystemSettingsServer::GetTouchScreenMode>, "GetTouchScreenMode"}, - FunctionInfo{188, C<&ISystemSettingsServer::SetTouchScreenMode>, "SetTouchScreenMode"}, - FunctionInfo{189, nullptr, "GetButtonConfigSettingsFull"}, - FunctionInfo{190, nullptr, "SetButtonConfigSettingsFull"}, - FunctionInfo{191, nullptr, "GetButtonConfigSettingsEmbedded"}, - FunctionInfo{192, nullptr, "SetButtonConfigSettingsEmbedded"}, - FunctionInfo{193, nullptr, "GetButtonConfigSettingsLeft"}, - FunctionInfo{194, nullptr, "SetButtonConfigSettingsLeft"}, - FunctionInfo{195, nullptr, "GetButtonConfigSettingsRight"}, - FunctionInfo{196, nullptr, "SetButtonConfigSettingsRight"}, - FunctionInfo{197, nullptr, "GetButtonConfigRegisteredSettingsEmbedded"}, - FunctionInfo{198, nullptr, "SetButtonConfigRegisteredSettingsEmbedded"}, - FunctionInfo{199, nullptr, "GetButtonConfigRegisteredSettings"}, - FunctionInfo{200, nullptr, "SetButtonConfigRegisteredSettings"}, - FunctionInfo{201, C<&ISystemSettingsServer::GetFieldTestingFlag>, "GetFieldTestingFlag"}, - FunctionInfo{202, nullptr, "SetFieldTestingFlag"}, - FunctionInfo{203, C<&ISystemSettingsServer::GetPanelCrcMode>, "GetPanelCrcMode"}, - FunctionInfo{204, C<&ISystemSettingsServer::SetPanelCrcMode>, "SetPanelCrcMode"}, - FunctionInfo{205, nullptr, "GetNxControllerSettingsEx"}, - FunctionInfo{206, nullptr, "SetNxControllerSettingsEx"}, - FunctionInfo{207, nullptr, "GetHearingProtectionSafeguardFlag"}, - FunctionInfo{208, nullptr, "SetHearingProtectionSafeguardFlag"}, - FunctionInfo{209, nullptr, "GetHearingProtectionSafeguardRemainingTime"}, - FunctionInfo{210, nullptr, "SetHearingProtectionSafeguardRemainingTime"}, - FunctionInfo{221, nullptr, "GetForceMonauralOutputFlag", MakeVersionGate({17,0,0})}, - FunctionInfo{222, nullptr, "SetForceMonauralOutputFlag", MakeVersionGate({17,0,0})}, - FunctionInfo{251, nullptr, "GetAccountIdentificationSettings", MakeVersionGate({18,0,0})}, - FunctionInfo{252, nullptr, "SetAccountIdentificationSettings", MakeVersionGate({18,0,0})}, - FunctionInfo{263, nullptr, "AcquireVphymDirtyFlagEventHandle", MakeVersionGate({20,0,0})}, - FunctionInfo{264, nullptr, "GetVphymDirtyFlags", MakeVersionGate({20,0,0})}, - FunctionInfo{282, nullptr, "ConvertToProductModel", MakeVersionGate({20,0,0})}, - FunctionInfo{283, nullptr, "ConvertToProductModelName", MakeVersionGate({20,0,0})}, - FunctionInfo{289, nullptr, "GetDefaultAccountIdentificationFlagSet", MakeVersionGate({20,0,0})}, - FunctionInfo{300, nullptr, "AcquirePushNotificationDirtyFlagEventHandle", MakeVersionGate({20,0,0})}, - FunctionInfo{301, nullptr, "GetPushNotificationDirtyFlags", MakeVersionGate({20,0,0})}, - FunctionInfo{306, nullptr, "GetPinCodeReregistrationGuideAccounts", MakeVersionGate({20,0,0})}, - FunctionInfo{307, nullptr, "SetPinCodeReregistrationGuideAccounts", MakeVersionGate({20,0,0})}, - FunctionInfo{315, C<&ISystemSettingsServer::GetHttpAuthConfigs>, "GetHttpAuthConfigs", MakeVersionGate({21,0,0})}, - FunctionInfo{319, C<&ISystemSettingsServer::GetAccountUserSettings>, "GetAccountUserSettings", MakeVersionGate({21,0,0})}, - FunctionInfo{320, nullptr, "SetAccountUserSettings", MakeVersionGate({21,0,0})}, - FunctionInfo{321, C<&ISystemSettingsServer::GetDefaultAccountUserSettings>, "GetDefaultAccountUserSettings", MakeVersionGate({21,0,0})} - ); - return HandlerTableGenerateWithFind(key, functions); -} - ISystemSettingsServer::ISystemSettingsServer(Core::System& system_) - : ServiceFramework{system_, "set:sys"} { + : ServiceFramework{system_, "set:sys"}, m_system{system} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&ISystemSettingsServer::SetLanguageCode>, "SetLanguageCode"}, + {1, nullptr, "SetNetworkSettings"}, + {2, nullptr, "GetNetworkSettings"}, + {3, C<&ISystemSettingsServer::GetFirmwareVersion>, "GetFirmwareVersion"}, + {4, C<&ISystemSettingsServer::GetFirmwareVersion2>, "GetFirmwareVersion2"}, + {5, nullptr, "GetFirmwareVersionDigest"}, + {7, C<&ISystemSettingsServer::GetLockScreenFlag>, "GetLockScreenFlag"}, + {8, C<&ISystemSettingsServer::SetLockScreenFlag>, "SetLockScreenFlag"}, + {9, nullptr, "GetBacklightSettings"}, + {10, nullptr, "SetBacklightSettings"}, + {11, nullptr, "SetBluetoothDevicesSettings"}, + {12, nullptr, "GetBluetoothDevicesSettings"}, + {13, C<&ISystemSettingsServer::GetExternalSteadyClockSourceId>, "GetExternalSteadyClockSourceId"}, + {14, C<&ISystemSettingsServer::SetExternalSteadyClockSourceId>, "SetExternalSteadyClockSourceId"}, + {15, C<&ISystemSettingsServer::GetUserSystemClockContext>, "GetUserSystemClockContext"}, + {16, C<&ISystemSettingsServer::SetUserSystemClockContext>, "SetUserSystemClockContext"}, + {17, C<&ISystemSettingsServer::GetAccountSettings>, "GetAccountSettings"}, + {18, C<&ISystemSettingsServer::SetAccountSettings>, "SetAccountSettings"}, + {19, nullptr, "GetAudioVolume"}, + {20, nullptr, "SetAudioVolume"}, + {21, C<&ISystemSettingsServer::GetEulaVersions>, "GetEulaVersions"}, + {22, C<&ISystemSettingsServer::SetEulaVersions>, "SetEulaVersions"}, + {23, C<&ISystemSettingsServer::GetColorSetId>, "GetColorSetId"}, + {24, C<&ISystemSettingsServer::SetColorSetId>, "SetColorSetId"}, + {25, C<&ISystemSettingsServer::GetConsoleInformationUploadFlag>, "GetConsoleInformationUploadFlag"}, + {26, C<&ISystemSettingsServer::SetConsoleInformationUploadFlag>, "SetConsoleInformationUploadFlag"}, + {27, C<&ISystemSettingsServer::GetAutomaticApplicationDownloadFlag>, "GetAutomaticApplicationDownloadFlag"}, + {28, C<&ISystemSettingsServer::SetAutomaticApplicationDownloadFlag>, "SetAutomaticApplicationDownloadFlag"}, + {29, C<&ISystemSettingsServer::GetNotificationSettings>, "GetNotificationSettings"}, + {30, C<&ISystemSettingsServer::SetNotificationSettings>, "SetNotificationSettings"}, + {31, C<&ISystemSettingsServer::GetAccountNotificationSettings>, "GetAccountNotificationSettings"}, + {32, C<&ISystemSettingsServer::SetAccountNotificationSettings>, "SetAccountNotificationSettings"}, + {35, C<&ISystemSettingsServer::GetVibrationMasterVolume>, "GetVibrationMasterVolume"}, + {36, C<&ISystemSettingsServer::SetVibrationMasterVolume>, "SetVibrationMasterVolume"}, + {37, C<&ISystemSettingsServer::GetSettingsItemValueSize>, "GetSettingsItemValueSize"}, + {38, C<&ISystemSettingsServer::GetSettingsItemValue>, "GetSettingsItemValue"}, + {39, C<&ISystemSettingsServer::GetTvSettings>, "GetTvSettings"}, + {40, C<&ISystemSettingsServer::SetTvSettings>, "SetTvSettings"}, + {41, nullptr, "GetEdid"}, + {42, nullptr, "SetEdid"}, + {43, C<&ISystemSettingsServer::GetAudioOutputMode>, "GetAudioOutputMode"}, + {44, C<&ISystemSettingsServer::SetAudioOutputMode>, "SetAudioOutputMode"}, + {45, C<&ISystemSettingsServer::GetSpeakerAutoMuteFlag>, "GetSpeakerAutoMuteFlag"}, + {46, C<&ISystemSettingsServer::SetSpeakerAutoMuteFlag>, "SetSpeakerAutoMuteFlag"}, + {47, C<&ISystemSettingsServer::GetQuestFlag>, "GetQuestFlag"}, + {48, C<&ISystemSettingsServer::SetQuestFlag>, "SetQuestFlag"}, + {49, nullptr, "GetDataDeletionSettings"}, + {50, nullptr, "SetDataDeletionSettings"}, + {51, nullptr, "GetInitialSystemAppletProgramId"}, + {52, nullptr, "GetOverlayDispProgramId"}, + {53, C<&ISystemSettingsServer::GetDeviceTimeZoneLocationName>, "GetDeviceTimeZoneLocationName"}, + {54, C<&ISystemSettingsServer::SetDeviceTimeZoneLocationName>, "SetDeviceTimeZoneLocationName"}, + {55, nullptr, "GetWirelessCertificationFileSize"}, + {56, nullptr, "GetWirelessCertificationFile"}, + {57, C<&ISystemSettingsServer::SetRegionCode>, "SetRegionCode"}, + {58, C<&ISystemSettingsServer::GetNetworkSystemClockContext>, "GetNetworkSystemClockContext"}, + {59, C<&ISystemSettingsServer::SetNetworkSystemClockContext>, "SetNetworkSystemClockContext"}, + {60, C<&ISystemSettingsServer::IsUserSystemClockAutomaticCorrectionEnabled>, "IsUserSystemClockAutomaticCorrectionEnabled"}, + {61, C<&ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionEnabled>, "SetUserSystemClockAutomaticCorrectionEnabled"}, + {62, C<&ISystemSettingsServer::GetDebugModeFlag>, "GetDebugModeFlag"}, + {63, C<&ISystemSettingsServer::GetPrimaryAlbumStorage>, "GetPrimaryAlbumStorage"}, + {64, C<&ISystemSettingsServer::SetPrimaryAlbumStorage>, "SetPrimaryAlbumStorage"}, + {65, C<&ISystemSettingsServer::GetUsb30EnableFlag>, "GetUsb30EnableFlag"}, + {66, C<&ISystemSettingsServer::SetUsb30EnableFlag>, "SetUsb30EnableFlag"}, + {67, C<&ISystemSettingsServer::GetBatteryLot>, "GetBatteryLot"}, + {68, C<&ISystemSettingsServer::GetSerialNumber>, "GetSerialNumber"}, + {69, C<&ISystemSettingsServer::GetNfcEnableFlag>, "GetNfcEnableFlag"}, + {70, C<&ISystemSettingsServer::SetNfcEnableFlag>, "SetNfcEnableFlag"}, + {71, C<&ISystemSettingsServer::GetSleepSettings>, "GetSleepSettings"}, + {72, C<&ISystemSettingsServer::SetSleepSettings>, "SetSleepSettings"}, + {73, C<&ISystemSettingsServer::GetWirelessLanEnableFlag>, "GetWirelessLanEnableFlag"}, + {74, C<&ISystemSettingsServer::SetWirelessLanEnableFlag>, "SetWirelessLanEnableFlag"}, + {75, C<&ISystemSettingsServer::GetInitialLaunchSettings>, "GetInitialLaunchSettings"}, + {76, C<&ISystemSettingsServer::SetInitialLaunchSettings>, "SetInitialLaunchSettings"}, + {77, C<&ISystemSettingsServer::GetDeviceNickName>, "GetDeviceNickName"}, + {78, C<&ISystemSettingsServer::SetDeviceNickName>, "SetDeviceNickName"}, + {79, C<&ISystemSettingsServer::GetProductModel>, "GetProductModel"}, + {80, nullptr, "GetLdnChannel"}, + {81, nullptr, "SetLdnChannel"}, + {82, nullptr, "AcquireTelemetryDirtyFlagEventHandle"}, + {83, nullptr, "GetTelemetryDirtyFlags"}, + {84, nullptr, "GetPtmBatteryLot"}, + {85, nullptr, "SetPtmBatteryLot"}, + {86, nullptr, "GetPtmFuelGaugeParameter"}, + {87, nullptr, "SetPtmFuelGaugeParameter"}, + {88, C<&ISystemSettingsServer::GetBluetoothEnableFlag>, "GetBluetoothEnableFlag"}, + {89, C<&ISystemSettingsServer::SetBluetoothEnableFlag>, "SetBluetoothEnableFlag"}, + {90, C<&ISystemSettingsServer::GetMiiAuthorId>, "GetMiiAuthorId"}, + {91, nullptr, "SetShutdownRtcValue"}, + {92, nullptr, "GetShutdownRtcValue"}, + {93, nullptr, "AcquireFatalDirtyFlagEventHandle"}, + {94, nullptr, "GetFatalDirtyFlags"}, + {95, C<&ISystemSettingsServer::GetAutoUpdateEnableFlag>, "GetAutoUpdateEnableFlag"}, + {96, C<&ISystemSettingsServer::SetAutoUpdateEnableFlag>, "SetAutoUpdateEnableFlag"}, + {97, nullptr, "GetNxControllerSettings"}, + {98, nullptr, "SetNxControllerSettings"}, + {99, C<&ISystemSettingsServer::GetBatteryPercentageFlag>, "GetBatteryPercentageFlag"}, + {100, C<&ISystemSettingsServer::SetBatteryPercentageFlag>, "SetBatteryPercentageFlag"}, + {101, nullptr, "GetExternalRtcResetFlag"}, + {102, nullptr, "SetExternalRtcResetFlag"}, + {103, nullptr, "GetUsbFullKeyEnableFlag"}, + {104, nullptr, "SetUsbFullKeyEnableFlag"}, + {105, C<&ISystemSettingsServer::SetExternalSteadyClockInternalOffset>, "SetExternalSteadyClockInternalOffset"}, + {106, C<&ISystemSettingsServer::GetExternalSteadyClockInternalOffset>, "GetExternalSteadyClockInternalOffset"}, + {107, nullptr, "GetBacklightSettingsEx"}, + {108, nullptr, "SetBacklightSettingsEx"}, + {109, nullptr, "GetHeadphoneVolumeWarningCount"}, + {110, nullptr, "SetHeadphoneVolumeWarningCount"}, + {111, nullptr, "GetBluetoothAfhEnableFlag"}, + {112, nullptr, "SetBluetoothAfhEnableFlag"}, + {113, nullptr, "GetBluetoothBoostEnableFlag"}, + {114, nullptr, "SetBluetoothBoostEnableFlag"}, + {115, nullptr, "GetInRepairProcessEnableFlag"}, + {116, nullptr, "SetInRepairProcessEnableFlag"}, + {117, nullptr, "GetHeadphoneVolumeUpdateFlag"}, + {118, nullptr, "SetHeadphoneVolumeUpdateFlag"}, + {119, nullptr, "NeedsToUpdateHeadphoneVolume"}, + {120, C<&ISystemSettingsServer::GetPushNotificationActivityModeOnSleep>, "GetPushNotificationActivityModeOnSleep"}, + {121, C<&ISystemSettingsServer::SetPushNotificationActivityModeOnSleep>, "SetPushNotificationActivityModeOnSleep"}, + {122, nullptr, "GetServiceDiscoveryControlSettings"}, + {123, nullptr, "SetServiceDiscoveryControlSettings"}, + {124, C<&ISystemSettingsServer::GetErrorReportSharePermission>, "GetErrorReportSharePermission"}, + {125, C<&ISystemSettingsServer::SetErrorReportSharePermission>, "SetErrorReportSharePermission"}, + {126, C<&ISystemSettingsServer::GetAppletLaunchFlags>, "GetAppletLaunchFlags"}, + {127, C<&ISystemSettingsServer::SetAppletLaunchFlags>, "SetAppletLaunchFlags"}, + {128, nullptr, "GetConsoleSixAxisSensorAccelerationBias"}, + {129, nullptr, "SetConsoleSixAxisSensorAccelerationBias"}, + {130, nullptr, "GetConsoleSixAxisSensorAngularVelocityBias"}, + {131, nullptr, "SetConsoleSixAxisSensorAngularVelocityBias"}, + {132, nullptr, "GetConsoleSixAxisSensorAccelerationGain"}, + {133, nullptr, "SetConsoleSixAxisSensorAccelerationGain"}, + {134, nullptr, "GetConsoleSixAxisSensorAngularVelocityGain"}, + {135, nullptr, "SetConsoleSixAxisSensorAngularVelocityGain"}, + {136, C<&ISystemSettingsServer::GetKeyboardLayout>, "GetKeyboardLayout"}, + {137, C<&ISystemSettingsServer::SetKeyboardLayout>, "SetKeyboardLayout"}, + {138, nullptr, "GetWebInspectorFlag"}, + {139, nullptr, "GetAllowedSslHosts"}, + {140, nullptr, "GetHostFsMountPoint"}, + {141, nullptr, "GetRequiresRunRepairTimeReviser"}, + {142, nullptr, "SetRequiresRunRepairTimeReviser"}, + {143, nullptr, "SetBlePairingSettings"}, + {144, nullptr, "GetBlePairingSettings"}, + {145, nullptr, "GetConsoleSixAxisSensorAngularVelocityTimeBias"}, + {146, nullptr, "SetConsoleSixAxisSensorAngularVelocityTimeBias"}, + {147, nullptr, "GetConsoleSixAxisSensorAngularAcceleration"}, + {148, nullptr, "SetConsoleSixAxisSensorAngularAcceleration"}, + {149, C<&ISystemSettingsServer::GetRebootlessSystemUpdateVersion>, "GetRebootlessSystemUpdateVersion"}, + {150, C<&ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime>, "GetDeviceTimeZoneLocationUpdatedTime"}, + {151, C<&ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime>, "SetDeviceTimeZoneLocationUpdatedTime"}, + {152, C<&ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime>, "GetUserSystemClockAutomaticCorrectionUpdatedTime"}, + {153, C<&ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime>, "SetUserSystemClockAutomaticCorrectionUpdatedTime"}, + {154, nullptr, "GetAccountOnlineStorageSettings"}, + {155, nullptr, "SetAccountOnlineStorageSettings"}, + {156, nullptr, "GetPctlReadyFlag"}, + {157, nullptr, "SetPctlReadyFlag"}, + {158, nullptr, "GetAnalogStickUserCalibrationL"}, + {159, nullptr, "SetAnalogStickUserCalibrationL"}, + {160, nullptr, "GetAnalogStickUserCalibrationR"}, + {161, nullptr, "SetAnalogStickUserCalibrationR"}, + {162, nullptr, "GetPtmBatteryVersion"}, + {163, nullptr, "SetPtmBatteryVersion"}, + {164, nullptr, "GetUsb30HostEnableFlag"}, + {165, nullptr, "SetUsb30HostEnableFlag"}, + {166, nullptr, "GetUsb30DeviceEnableFlag"}, + {167, nullptr, "SetUsb30DeviceEnableFlag"}, + {168, nullptr, "GetThemeId"}, + {169, nullptr, "SetThemeId"}, + {170, C<&ISystemSettingsServer::GetChineseTraditionalInputMethod>, "GetChineseTraditionalInputMethod"}, + {171, nullptr, "SetChineseTraditionalInputMethod"}, + {172, nullptr, "GetPtmCycleCountReliability"}, + {173, nullptr, "SetPtmCycleCountReliability"}, + {174, C<&ISystemSettingsServer::GetHomeMenuScheme>, "GetHomeMenuScheme"}, + {175, nullptr, "GetThemeSettings"}, + {176, nullptr, "SetThemeSettings"}, + {177, nullptr, "GetThemeKey"}, + {178, nullptr, "SetThemeKey"}, + {179, nullptr, "GetZoomFlag"}, + {180, nullptr, "SetZoomFlag"}, + {181, nullptr, "GetT"}, + {182, nullptr, "SetT"}, + {183, C<&ISystemSettingsServer::GetPlatformRegion>, "GetPlatformRegion"}, + {184, C<&ISystemSettingsServer::SetPlatformRegion>, "SetPlatformRegion"}, + {185, C<&ISystemSettingsServer::GetHomeMenuSchemeModel>, "GetHomeMenuSchemeModel"}, + {186, nullptr, "GetMemoryUsageRateFlag"}, + {187, C<&ISystemSettingsServer::GetTouchScreenMode>, "GetTouchScreenMode"}, + {188, C<&ISystemSettingsServer::SetTouchScreenMode>, "SetTouchScreenMode"}, + {189, nullptr, "GetButtonConfigSettingsFull"}, + {190, nullptr, "SetButtonConfigSettingsFull"}, + {191, nullptr, "GetButtonConfigSettingsEmbedded"}, + {192, nullptr, "SetButtonConfigSettingsEmbedded"}, + {193, nullptr, "GetButtonConfigSettingsLeft"}, + {194, nullptr, "SetButtonConfigSettingsLeft"}, + {195, nullptr, "GetButtonConfigSettingsRight"}, + {196, nullptr, "SetButtonConfigSettingsRight"}, + {197, nullptr, "GetButtonConfigRegisteredSettingsEmbedded"}, + {198, nullptr, "SetButtonConfigRegisteredSettingsEmbedded"}, + {199, nullptr, "GetButtonConfigRegisteredSettings"}, + {200, nullptr, "SetButtonConfigRegisteredSettings"}, + {201, C<&ISystemSettingsServer::GetFieldTestingFlag>, "GetFieldTestingFlag"}, + {202, nullptr, "SetFieldTestingFlag"}, + {203, C<&ISystemSettingsServer::GetPanelCrcMode>, "GetPanelCrcMode"}, + {204, C<&ISystemSettingsServer::SetPanelCrcMode>, "SetPanelCrcMode"}, + {205, nullptr, "GetNxControllerSettingsEx"}, + {206, nullptr, "SetNxControllerSettingsEx"}, + {207, nullptr, "GetHearingProtectionSafeguardFlag"}, + {208, nullptr, "SetHearingProtectionSafeguardFlag"}, + {209, nullptr, "GetHearingProtectionSafeguardRemainingTime"}, + {210, nullptr, "SetHearingProtectionSafeguardRemainingTime"}, + {221, nullptr, "GetForceMonauralOutputFlag"}, //17.0.0+ + {222, nullptr, "SetForceMonauralOutputFlag"}, //17.0.0+ + {251, nullptr, "GetAccountIdentificationSettings"}, //18.0.0+ + {252, nullptr, "SetAccountIdentificationSettings"}, //18.0.0+ + {263, nullptr, "AcquireVphymDirtyFlagEventHandle"}, //20.0.0+ + {264, nullptr, "GetVphymDirtyFlags"}, //20.0.0+ + {282, nullptr, "ConvertToProductModel"}, //20.0.0+ + {283, nullptr, "ConvertToProductModelName"}, //20.0.0+ + {289, nullptr, "GetDefaultAccountIdentificationFlagSet"}, //20.0.0+ + {300, nullptr, "AcquirePushNotificationDirtyFlagEventHandle"}, //20.0.0+ + {301, nullptr, "GetPushNotificationDirtyFlags"}, //20.0.0+ + {306, nullptr, "GetPinCodeReregistrationGuideAccounts"}, //20.0.0+ + {307, nullptr, "SetPinCodeReregistrationGuideAccounts"}, //20.0.0+ + {315, C<&ISystemSettingsServer::GetHttpAuthConfigs>, "GetHttpAuthConfigs"}, //21.0.0+ + {319, C<&ISystemSettingsServer::GetAccountUserSettings>, "GetAccountUserSettings"}, //21.0.0+ + {320, nullptr, "SetAccountUserSettings"}, //21.0.0+ + {321, C<&ISystemSettingsServer::GetDefaultAccountUserSettings>, "GetDefaultAccountUserSettings"}, //21.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); + SetupSettings(); m_system_settings.region_code = diff --git a/src/core/hle/service/set/system_settings_server.h b/src/core/hle/service/set/system_settings_server.h index 471ed61176..1d56e61f88 100644 --- a/src/core/hle/service/set/system_settings_server.h +++ b/src/core/hle/service/set/system_settings_server.h @@ -179,7 +179,7 @@ private: void StoreSettings(); void SetSaveNeeded(); - std::optional FindRequest(u32 key) override; + Core::System& m_system; SystemSettings m_system_settings{}; PrivateSettings m_private_settings{}; DeviceSettings m_device_settings{}; diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 5c196b3218..c75c5437df 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -18,16 +18,7 @@ #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/sm/sm.h" -#include "common/assert.h" -#include "common/logging.h" -#include "core/core.h" -#include "core/hle/kernel/k_client_port.h" -#include "core/hle/kernel/k_port.h" -#include "core/hle/kernel/k_scoped_resource_reservation.h" -#include "core/hle/kernel/k_server_session.h" -#include "core/hle/kernel/k_session.h" -#include "core/hle/service/ipc_helpers.h" -#include "core/hle/service/server_manager.h" +#include "core/hle/service/sm/sm_controller.h" namespace Service::SM { @@ -36,116 +27,6 @@ constexpr Result ResultAlreadyRegistered(ErrorModule::SM, 4); constexpr Result ResultInvalidServiceName(ErrorModule::SM, 6); constexpr Result ResultNotRegistered(ErrorModule::SM, 7); -class Controller final : public ServiceFramework { -public: - // https://switchbrew.org/wiki/IPC_Marshalling - explicit Controller(Core::System& system_) : ServiceFramework{system_, "IpcController"} {} - ~Controller() override = default; - - void ConvertCurrentObjectToDomain(HLERequestContext& ctx) { - ASSERT_MSG(!ctx.GetManager()->IsDomain(), "Session is already a domain"); - LOG_DEBUG(Service, "called, server_session={}", ctx.Session()->GetId()); - ctx.GetManager()->ConvertToDomainOnRequestEnd(); - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(1); // Converted sessions start with 1 request handler - } - - void CloneCurrentObject(HLERequestContext& ctx) { - LOG_DEBUG(Service, "called"); - - auto session_manager = ctx.GetManager(); - - // FIXME: this is duplicated from the SVC, it should just call it instead - // once this is a proper process - - // Reserve a new session from the process resource limit. - Kernel::KScopedResourceReservation session_reservation(system.Kernel(), Kernel::GetCurrentProcessPointer(kernel), Kernel::LimitableResource::SessionCountMax); - ASSERT(session_reservation.Succeeded()); - - // Create the session. - Kernel::KSession* session = Kernel::KSession::Create(kernel); - ASSERT(session != nullptr); - - // Initialize the session. - session->Initialize(kernel, nullptr, 0); - - // Commit the session reservation. - session_reservation.Commit(); - - // Register the session. - Kernel::KSession::Register(kernel, session); - - // Register with server manager. - session_manager->GetServerManager().RegisterSession(&session->GetServerSession(), - session_manager); - - // We succeeded. - IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; - rb.Push(ResultSuccess); - rb.PushMoveObjects(ctx, session->GetClientSession()); - } - - void CloneCurrentObjectEx(HLERequestContext& ctx) { - LOG_DEBUG(Service, "called"); - - CloneCurrentObject(ctx); - } - - void QueryPointerBufferSize(HLERequestContext& ctx) { - LOG_DEBUG(Service, "called"); - - auto* process = Kernel::GetCurrentProcessPointer(kernel); - ASSERT(process != nullptr); - - u32 buffer_size = process->GetPointerBufferSize(); - if (buffer_size > (std::numeric_limits::max)()) { - LOG_WARNING(Service, "Pointer buffer size exceeds u16 max, clamping"); - buffer_size = (std::numeric_limits::max)(); - } - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(static_cast(buffer_size)); - } - - void SetPointerBufferSize(HLERequestContext& ctx) { - LOG_DEBUG(Service, "called"); - - auto* process = Kernel::GetCurrentProcessPointer(kernel); - ASSERT(process != nullptr); - - IPC::RequestParser rp{ctx}; - - u32 requested_size = rp.PopRaw(); - - if (requested_size > (std::numeric_limits::max)()) { - LOG_WARNING(Service, "Requested pointer buffer size too large, clamping to 0xFFFF"); - requested_size = (std::numeric_limits::max)(); - } - - process->SetPointerBufferSize(requested_size); - - LOG_INFO(Service, "Pointer buffer size dynamically updated to {:#x} bytes by process", requested_size); - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &Controller::ConvertCurrentObjectToDomain, "ConvertCurrentObjectToDomain"}, - FunctionInfo{1, nullptr, "CopyFromCurrentDomain"}, - FunctionInfo{2, &Controller::CloneCurrentObject, "CloneCurrentObject"}, - FunctionInfo{3, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"}, - FunctionInfo{4, &Controller::CloneCurrentObjectEx, "CloneCurrentObjectEx"}, - FunctionInfo{5, &Controller::SetPointerBufferSize, "SetPointerBufferSize"} //TODO: where does this come from - ); -}; - ServiceManager::ServiceManager(Kernel::KernelCore& kernel_) : kernel{kernel_} { controller_interface = std::make_unique(kernel.System()); } @@ -231,51 +112,6 @@ Result ServiceManager::GetServicePort(Kernel::KClientPort** out_client_port, return ResultSuccess; } -/// Interface to "sm:" service -class SM final : public ServiceFramework { -public: - explicit SM(ServiceManager& service_manager_, Core::System& system_); - ~SM() override; - -private: - void Initialize(HLERequestContext& ctx); - void GetServiceCmif(HLERequestContext& ctx); - void GetServiceTipc(HLERequestContext& ctx); - void RegisterServiceCmif(HLERequestContext& ctx); - void RegisterServiceTipc(HLERequestContext& ctx); - void UnregisterService(HLERequestContext& ctx); - void AtmosphereHasService(HLERequestContext& ctx); - - Result GetServiceImpl(Kernel::KClientSession** out_client_session, HLERequestContext& ctx); - void RegisterServiceImpl(HLERequestContext& ctx, std::string name, u32 max_session_count, bool is_light); - - // TODO: We reuse function list for both TIPC and non-TIPC - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - std::optional FindRequestTipc(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &SM::Initialize, "Initialize"}, - FunctionInfo{1, &SM::GetServiceTipc, "GetService"}, - FunctionInfo{2, &SM::RegisterServiceTipc, "RegisterService"}, - FunctionInfo{3, &SM::UnregisterService, "UnregisterService"}, - FunctionInfo{4, nullptr, "DetachClient"}, - FunctionInfo{65000, nullptr, "AtmosphereInstallMitm"}, - FunctionInfo{65001, nullptr, "AtmosphereUninstallMitm"}, - FunctionInfo{65002, nullptr, "Deprecated_AtmosphereAssociatePidTidForMitm"}, - FunctionInfo{65003, nullptr, "AtmosphereAcknowledgeMitmSession"}, - FunctionInfo{65004, nullptr, "AtmosphereHasMitm"}, - FunctionInfo{65005, nullptr, "AtmosphereWaitMitm"}, - FunctionInfo{65006, nullptr, "AtmosphereDeclareFutureMitm"}, - FunctionInfo{65100, &SM::AtmosphereHasService, "AtmosphereHasService"}, - FunctionInfo{65101, nullptr, "AtmosphereWaitService"} - ); - - ServiceManager& service_manager; -}; - /** * SM::Initialize service function * Inputs: @@ -358,7 +194,7 @@ Result SM::GetServiceImpl(Kernel::KClientSession** out_client_session, HLEReques // Create a new session. Kernel::KClientSession* session{}; - if (const auto result = client_port->CreateSession(system.Kernel(), &session); result.IsError()) { + if (const auto result = client_port->CreateSession(kernel, &session); result.IsError()) { LOG_ERROR(Service_SM, "called service={} -> error {:#08x}", name, result.raw); return result; } @@ -429,7 +265,42 @@ void SM::AtmosphereHasService(HLERequestContext& ctx) { SM::SM(ServiceManager& service_manager_, Core::System& system_) : ServiceFramework{system_, "sm:", 64} , service_manager{service_manager_} -{} + , kernel{system_.Kernel()} +{ + RegisterHandlers({ + {0, &SM::Initialize, "Initialize"}, + {1, &SM::GetServiceCmif, "GetService"}, + {2, &SM::RegisterServiceCmif, "RegisterService"}, + {3, &SM::UnregisterService, "UnregisterService"}, + {4, nullptr, "DetachClient"}, + // TODO: are these non-TIPC as well? + {65000, nullptr, "AtmosphereInstallMitm"}, + {65001, nullptr, "AtmosphereUninstallMitm"}, + {65002, nullptr, "Deprecated_AtmosphereAssociatePidTidForMitm"}, + {65003, nullptr, "AtmosphereAcknowledgeMitmSession"}, + {65004, nullptr, "AtmosphereHasMitm"}, + {65005, nullptr, "AtmosphereWaitMitm"}, + {65006, nullptr, "AtmosphereDeclareFutureMitm"}, + {65100, &SM::AtmosphereHasService, "AtmosphereHasService"}, + {65101, nullptr, "AtmosphereWaitService"}, + }); + RegisterHandlersTipc({ + {0, &SM::Initialize, "Initialize"}, + {1, &SM::GetServiceTipc, "GetService"}, + {2, &SM::RegisterServiceTipc, "RegisterService"}, + {3, &SM::UnregisterService, "UnregisterService"}, + {4, nullptr, "DetachClient"}, + {65000, nullptr, "AtmosphereInstallMitm"}, + {65001, nullptr, "AtmosphereUninstallMitm"}, + {65002, nullptr, "Deprecated_AtmosphereAssociatePidTidForMitm"}, + {65003, nullptr, "AtmosphereAcknowledgeMitmSession"}, + {65004, nullptr, "AtmosphereHasMitm"}, + {65005, nullptr, "AtmosphereWaitMitm"}, + {65006, nullptr, "AtmosphereDeclareFutureMitm"}, + {65100, &SM::AtmosphereHasService, "AtmosphereHasService"}, + {65101, nullptr, "AtmosphereWaitService"}, + }); +} SM::~SM() = default; diff --git a/src/core/hle/service/sm/sm.h b/src/core/hle/service/sm/sm.h index f17fc60080..c520a46fb2 100644 --- a/src/core/hle/service/sm/sm.h +++ b/src/core/hle/service/sm/sm.h @@ -33,7 +33,29 @@ class SessionRequestHandler; namespace Service::SM { class Controller; -class SM; + +/// Interface to "sm:" service +class SM final : public ServiceFramework { +public: + explicit SM(ServiceManager& service_manager_, Core::System& system_); + ~SM() override; + +private: + void Initialize(HLERequestContext& ctx); + void GetServiceCmif(HLERequestContext& ctx); + void GetServiceTipc(HLERequestContext& ctx); + void RegisterServiceCmif(HLERequestContext& ctx); + void RegisterServiceTipc(HLERequestContext& ctx); + void UnregisterService(HLERequestContext& ctx); + void AtmosphereHasService(HLERequestContext& ctx); + + Result GetServiceImpl(Kernel::KClientSession** out_client_session, HLERequestContext& ctx); + void RegisterServiceImpl(HLERequestContext& ctx, std::string name, u32 max_session_count, + bool is_light); + + ServiceManager& service_manager; + Kernel::KernelCore& kernel; +}; class ServiceManager { public: diff --git a/src/core/hle/service/sm/sm_controller.cpp b/src/core/hle/service/sm/sm_controller.cpp new file mode 100644 index 0000000000..125eb4a247 --- /dev/null +++ b/src/core/hle/service/sm/sm_controller.cpp @@ -0,0 +1,128 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "common/assert.h" +#include "common/logging.h" +#include "core/core.h" +#include "core/hle/kernel/k_client_port.h" +#include "core/hle/kernel/k_port.h" +#include "core/hle/kernel/k_scoped_resource_reservation.h" +#include "core/hle/kernel/k_server_session.h" +#include "core/hle/kernel/k_session.h" +#include "core/hle/service/ipc_helpers.h" +#include "core/hle/service/server_manager.h" +#include "core/hle/service/sm/sm_controller.h" + +namespace Service::SM { + +void Controller::ConvertCurrentObjectToDomain(HLERequestContext& ctx) { + ASSERT_MSG(!ctx.GetManager()->IsDomain(), "Session is already a domain"); + LOG_DEBUG(Service, "called, server_session={}", ctx.Session()->GetId()); + ctx.GetManager()->ConvertToDomainOnRequestEnd(); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(1); // Converted sessions start with 1 request handler +} + +void Controller::CloneCurrentObject(HLERequestContext& ctx) { + LOG_DEBUG(Service, "called"); + + auto session_manager = ctx.GetManager(); + + // FIXME: this is duplicated from the SVC, it should just call it instead + // once this is a proper process + + // Reserve a new session from the process resource limit. + Kernel::KScopedResourceReservation session_reservation(system.Kernel(), Kernel::GetCurrentProcessPointer(kernel), Kernel::LimitableResource::SessionCountMax); + ASSERT(session_reservation.Succeeded()); + + // Create the session. + Kernel::KSession* session = Kernel::KSession::Create(kernel); + ASSERT(session != nullptr); + + // Initialize the session. + session->Initialize(kernel, nullptr, 0); + + // Commit the session reservation. + session_reservation.Commit(); + + // Register the session. + Kernel::KSession::Register(kernel, session); + + // Register with server manager. + session_manager->GetServerManager().RegisterSession(&session->GetServerSession(), + session_manager); + + // We succeeded. + IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; + rb.Push(ResultSuccess); + rb.PushMoveObjects(ctx, session->GetClientSession()); +} + +void Controller::CloneCurrentObjectEx(HLERequestContext& ctx) { + LOG_DEBUG(Service, "called"); + + CloneCurrentObject(ctx); +} + +void Controller::QueryPointerBufferSize(HLERequestContext& ctx) { + LOG_DEBUG(Service, "called"); + + auto* process = Kernel::GetCurrentProcessPointer(kernel); + ASSERT(process != nullptr); + + u32 buffer_size = process->GetPointerBufferSize(); + if (buffer_size > (std::numeric_limits::max)()) { + LOG_WARNING(Service, "Pointer buffer size exceeds u16 max, clamping"); + buffer_size = (std::numeric_limits::max)(); + } + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(static_cast(buffer_size)); +} + +void Controller::SetPointerBufferSize(HLERequestContext& ctx) { + LOG_DEBUG(Service, "called"); + + auto* process = Kernel::GetCurrentProcessPointer(kernel); + ASSERT(process != nullptr); + + IPC::RequestParser rp{ctx}; + + u32 requested_size = rp.PopRaw(); + + if (requested_size > (std::numeric_limits::max)()) { + LOG_WARNING(Service, "Requested pointer buffer size too large, clamping to 0xFFFF"); + requested_size = (std::numeric_limits::max)(); + } + + process->SetPointerBufferSize(requested_size); + + LOG_INFO(Service, "Pointer buffer size dynamically updated to {:#x} bytes by process", requested_size); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + + +// https://switchbrew.org/wiki/IPC_Marshalling +Controller::Controller(Core::System& system_) : ServiceFramework{system_, "IpcController"} { + static const FunctionInfo functions[] = { + {0, &Controller::ConvertCurrentObjectToDomain, "ConvertCurrentObjectToDomain"}, + {1, nullptr, "CopyFromCurrentDomain"}, + {2, &Controller::CloneCurrentObject, "CloneCurrentObject"}, + {3, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"}, + {4, &Controller::CloneCurrentObjectEx, "CloneCurrentObjectEx"}, + {5, &Controller::SetPointerBufferSize, "SetPointerBufferSize"}, //TODO: where does this come from + }; + RegisterHandlers(functions); +} + +Controller::~Controller() = default; + +} // namespace Service::SM diff --git a/src/core/hle/service/sm/sm_controller.h b/src/core/hle/service/sm/sm_controller.h new file mode 100644 index 0000000000..f1fa327ff7 --- /dev/null +++ b/src/core/hle/service/sm/sm_controller.h @@ -0,0 +1,30 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::SM { + +class Controller final : public ServiceFramework { +public: + explicit Controller(Core::System& system_); + ~Controller() override; + +private: + void ConvertCurrentObjectToDomain(HLERequestContext& ctx); + void CloneCurrentObject(HLERequestContext& ctx); + void CloneCurrentObjectEx(HLERequestContext& ctx); + void QueryPointerBufferSize(HLERequestContext& ctx); + void SetPointerBufferSize(HLERequestContext& ctx); +}; + +} // namespace Service::SM diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 63bd7051ca..0137a3be66 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -1083,6 +1083,59 @@ void BSD_USA::OnProxyPacketReceived(const Network::ProxyPacket& packet) { BSD_USA::BSD_USA(Core::System& system_, const char* name, bool is_user_) : ServiceFramework{system_, name} , is_user{is_user_} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &BSD_USA::RegisterClient, "RegisterClient"}, + {1, &BSD_USA::StartMonitoring, "StartMonitoring"}, + {2, &BSD_USA::Socket, "Socket"}, + {3, &BSD_USA::SocketExempt, "SocketExempt"}, + {4, nullptr, "Open"}, + {5, &BSD_USA::Select, "Select"}, + {6, &BSD_USA::Poll, "Poll"}, + {7, nullptr, "Sysctl"}, + {8, &BSD_USA::Recv, "Recv"}, + {9, &BSD_USA::RecvFrom, "RecvFrom"}, + {10, &BSD_USA::Send, "Send"}, + {11, &BSD_USA::SendTo, "SendTo"}, + {12, &BSD_USA::Accept, "Accept"}, + {13, &BSD_USA::Bind, "Bind"}, + {14, &BSD_USA::Connect, "Connect"}, + {15, &BSD_USA::GetPeerName, "GetPeerName"}, + {16, &BSD_USA::GetSockName, "GetSockName"}, + {17, &BSD_USA::GetSockOpt, "GetSockOpt"}, + {18, &BSD_USA::Listen, "Listen"}, + {19, nullptr, "Ioctl"}, + {20, &BSD_USA::Fcntl, "Fcntl"}, + {21, &BSD_USA::SetSockOpt, "SetSockOpt"}, + {22, &BSD_USA::Shutdown, "Shutdown"}, + {23, nullptr, "ShutdownAllSockets"}, + {24, &BSD_USA::Write, "Write"}, + {25, &BSD_USA::Read, "Read"}, + {26, &BSD_USA::Close, "Close"}, + {27, &BSD_USA::DuplicateSocket, "DuplicateSocket"}, + {28, nullptr, "GetResourceStatistics"}, + {29, nullptr, "RecvMMsg"}, //3.0.0+ + {30, nullptr, "SendMMsg"}, //3.0.0+ + {31, &BSD_USA::EventFd, "EventFd"}, //7.0.0+ + {32, nullptr, "RegisterResourceStatisticsName"}, //7.0.0+ + {33, nullptr, "RegisterClientShared"}, //10.0.0+ + {34, nullptr, "GetSocketStatistics"}, //15.0.0+ + {35, nullptr, "NifIoctl"}, //17.0.0+ + {36, nullptr, "Unknown36"}, //18.0.0+ + {37, nullptr, "Unknown37"}, //18.0.0+ + {38, nullptr, "Unknown38"}, //18.0.0+ + {39, nullptr, "Unknown39"}, //20.0.0+ + {40, nullptr, "Unknown40"}, //20.0.0+ + {41, nullptr, "Unknown41"}, //21.0.0+ + {42, nullptr, "Unknown42"}, //21.0.0+ + {43, nullptr, "Unknown43"}, //21.0.0+ + {200, nullptr, "SetThreadCoreMask"}, //15.0.0+ + {201, nullptr, "GetThreadCoreMask"}, //15.0.0+ + }; + // clang-format on + + RegisterHandlers(functions); + if (auto room_member = Network::GetRoomMember().lock()) { proxy_packet_received = room_member->BindOnProxyPacketReceived( [this](const Network::ProxyPacket& packet) { OnProxyPacketReceived(packet); }); @@ -1103,12 +1156,40 @@ std::unique_lock BSD_USA::LockService() noexcept { BSDCFG::BSDCFG(Core::System& system_, const char *name) : ServiceFramework{system_, name} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetIfUp"}, + {1, nullptr, "SetIfUpWithEvent"}, + {2, nullptr, "CancelIf"}, + {3, nullptr, "SetIfDown"}, + {4, nullptr, "GetIfState"}, + {5, nullptr, "DhcpRenew"}, + {6, nullptr, "AddStaticArpEntry"}, + {7, nullptr, "RemoveArpEntry"}, + {8, nullptr, "LookupArpEntry"}, + {9, nullptr, "LookupArpEntry2"}, + {10, nullptr, "ClearArpEntries"}, + {11, nullptr, "ClearArpEntries2"}, + {12, nullptr, "PrintArpEntries"}, + {13, nullptr, "Unknown13"}, + {14, nullptr, "Unknown14"}, + {15, nullptr, "Unknown15"}, + }; + // clang-format on + + RegisterHandlers(functions); } BSDCFG::~BSDCFG() = default; BSD_NU::BSD_NU(Core::System& system_) : ServiceFramework{system_, "bsd:nu"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateUserService"}, + }; + // clang-format on + RegisterHandlers(functions); } BSD_NU::~BSD_NU() = default; diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h index c2aa343d51..5cc3eb5b81 100644 --- a/src/core/hle/service/sockets/bsd.h +++ b/src/core/hle/service/sockets/bsd.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -189,58 +190,6 @@ private: protected: std::unique_lock LockService() noexcept override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &BSD_USA::RegisterClient, "RegisterClient"}, - FunctionInfo{1, &BSD_USA::StartMonitoring, "StartMonitoring"}, - FunctionInfo{2, &BSD_USA::Socket, "Socket"}, - FunctionInfo{3, &BSD_USA::SocketExempt, "SocketExempt"}, - FunctionInfo{4, nullptr, "Open"}, - FunctionInfo{5, &BSD_USA::Select, "Select"}, - FunctionInfo{6, &BSD_USA::Poll, "Poll"}, - FunctionInfo{7, nullptr, "Sysctl"}, - FunctionInfo{8, &BSD_USA::Recv, "Recv"}, - FunctionInfo{9, &BSD_USA::RecvFrom, "RecvFrom"}, - FunctionInfo{10, &BSD_USA::Send, "Send"}, - FunctionInfo{11, &BSD_USA::SendTo, "SendTo"}, - FunctionInfo{12, &BSD_USA::Accept, "Accept"}, - FunctionInfo{13, &BSD_USA::Bind, "Bind"}, - FunctionInfo{14, &BSD_USA::Connect, "Connect"}, - FunctionInfo{15, &BSD_USA::GetPeerName, "GetPeerName"}, - FunctionInfo{16, &BSD_USA::GetSockName, "GetSockName"}, - FunctionInfo{17, &BSD_USA::GetSockOpt, "GetSockOpt"}, - FunctionInfo{18, &BSD_USA::Listen, "Listen"}, - FunctionInfo{19, nullptr, "Ioctl"}, - FunctionInfo{20, &BSD_USA::Fcntl, "Fcntl"}, - FunctionInfo{21, &BSD_USA::SetSockOpt, "SetSockOpt"}, - FunctionInfo{22, &BSD_USA::Shutdown, "Shutdown"}, - FunctionInfo{23, nullptr, "ShutdownAllSockets"}, - FunctionInfo{24, &BSD_USA::Write, "Write"}, - FunctionInfo{25, &BSD_USA::Read, "Read"}, - FunctionInfo{26, &BSD_USA::Close, "Close"}, - FunctionInfo{27, &BSD_USA::DuplicateSocket, "DuplicateSocket"}, - FunctionInfo{28, nullptr, "GetResourceStatistics"}, - FunctionInfo{29, nullptr, "RecvMMsg", MakeVersionGate({3,0,0})}, - FunctionInfo{30, nullptr, "SendMMsg", MakeVersionGate({3,0,0})}, - FunctionInfo{31, &BSD_USA::EventFd, "EventFd", MakeVersionGate({7,0,0})}, - FunctionInfo{32, nullptr, "RegisterResourceStatisticsName", MakeVersionGate({7,0,0})}, - FunctionInfo{33, nullptr, "RegisterClientShared", MakeVersionGate({10,0,0})}, - FunctionInfo{34, nullptr, "GetSocketStatistics", MakeVersionGate({15,0,0})}, - FunctionInfo{35, nullptr, "NifIoctl", MakeVersionGate({17,0,0})}, - FunctionInfo{36, nullptr, "Unknown36", MakeVersionGate({18,0,0})}, - FunctionInfo{37, nullptr, "Unknown37", MakeVersionGate({18,0,0})}, - FunctionInfo{38, nullptr, "Unknown38", MakeVersionGate({18,0,0})}, - FunctionInfo{39, nullptr, "Unknown39", MakeVersionGate({20,0,0})}, - FunctionInfo{40, nullptr, "Unknown40", MakeVersionGate({20,0,0})}, - FunctionInfo{41, nullptr, "Unknown41", MakeVersionGate({21,0,0})}, - FunctionInfo{42, nullptr, "Unknown42", MakeVersionGate({21,0,0})}, - FunctionInfo{43, nullptr, "Unknown43", MakeVersionGate({21,0,0})}, - FunctionInfo{200, nullptr, "SetThreadCoreMask", MakeVersionGate({15,0,0})}, - FunctionInfo{201, nullptr, "GetThreadCoreMask", MakeVersionGate({15,0,0})} - ); bool is_user = false; }; @@ -248,41 +197,12 @@ class BSDCFG final : public ServiceFramework { public: explicit BSDCFG(Core::System& system_, const char *name); ~BSDCFG() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetIfUp"}, - FunctionInfo{1, nullptr, "SetIfUpWithEvent"}, - FunctionInfo{2, nullptr, "CancelIf"}, - FunctionInfo{3, nullptr, "SetIfDown"}, - FunctionInfo{4, nullptr, "GetIfState"}, - FunctionInfo{5, nullptr, "DhcpRenew"}, - FunctionInfo{6, nullptr, "AddStaticArpEntry"}, - FunctionInfo{7, nullptr, "RemoveArpEntry"}, - FunctionInfo{8, nullptr, "LookupArpEntry"}, - FunctionInfo{9, nullptr, "LookupArpEntry2"}, - FunctionInfo{10, nullptr, "ClearArpEntries"}, - FunctionInfo{11, nullptr, "ClearArpEntries2"}, - FunctionInfo{12, nullptr, "PrintArpEntries"}, - FunctionInfo{13, nullptr, "Unknown13"}, - FunctionInfo{14, nullptr, "Unknown14"}, - FunctionInfo{15, nullptr, "Unknown15"} - ); }; class BSD_NU final : public ServiceFramework { public: explicit BSD_NU(Core::System& system_); ~BSD_NU() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateUserService"} - ); }; } // namespace Service::Sockets diff --git a/src/core/hle/service/sockets/nsd.cpp b/src/core/hle/service/sockets/nsd.cpp index 8f042aee75..241f2971ca 100644 --- a/src/core/hle/service/sockets/nsd.cpp +++ b/src/core/hle/service/sockets/nsd.cpp @@ -29,6 +29,38 @@ struct EnvironmentIdentifier { static_assert(sizeof(EnvironmentIdentifier) == 0x8); NSD::NSD(Core::System& system_, const char* name) : ServiceFramework{system_, name} { + // clang-format off + static const FunctionInfo functions[] = { + {5, nullptr, "GetSettingUrl"}, + {10, nullptr, "GetSettingName"}, + {11, &NSD::GetEnvironmentIdentifier, "GetEnvironmentIdentifier"}, + {12, nullptr, "GetDeviceId"}, + {13, nullptr, "DeleteSettings"}, + {14, nullptr, "ImportSettings"}, + {15, &NSD::SetChangeEnvironmentIdentifierDisabled, "SetChangeEnvironmentIdentifierDisabled"}, + {20, &NSD::Resolve, "Resolve"}, + {21, &NSD::ResolveEx, "ResolveEx"}, + {30, nullptr, "GetNasServiceSetting"}, + {31, nullptr, "GetNasServiceSettingEx"}, + {40, nullptr, "GetNasRequestFqdn"}, + {41, nullptr, "GetNasRequestFqdnEx"}, + {42, nullptr, "GetNasApiFqdn"}, + {43, nullptr, "GetNasApiFqdnEx"}, + {50, nullptr, "GetCurrentSetting"}, + {51, nullptr, "WriteTestParameter"}, + {52, nullptr, "ReadTestParameter"}, + {60, nullptr, "ReadSaveDataFromFsForTest"}, + {61, nullptr, "WriteSaveDataToFsForTest"}, + {62, nullptr, "DeleteSaveDataOfFsForTest"}, + {63, nullptr, "IsChangeEnvironmentIdentifierDisabled"}, + {64, nullptr, "SetWithoutDomainExchangeFqdns"}, + {100, &NSD::GetApplicationServerEnvironmentType, "GetApplicationServerEnvironmentType"}, + {101, nullptr, "SetApplicationServerEnvironmentType"}, + {102, nullptr, "DeleteApplicationServerEnvironmentType"}, + }; + // clang-format on + + RegisterHandlers(functions); } static std::string ResolveImpl(const std::string& fqdn_in) { diff --git a/src/core/hle/service/sockets/nsd.h b/src/core/hle/service/sockets/nsd.h index f3e4d48aff..e4a4588467 100644 --- a/src/core/hle/service/sockets/nsd.h +++ b/src/core/hle/service/sockets/nsd.h @@ -25,38 +25,6 @@ private: void ResolveEx(HLERequestContext& ctx); void GetEnvironmentIdentifier(HLERequestContext& ctx); void GetApplicationServerEnvironmentType(HLERequestContext& ctx); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{5, nullptr, "GetSettingUrl"}, - FunctionInfo{10, nullptr, "GetSettingName"}, - FunctionInfo{11, &NSD::GetEnvironmentIdentifier, "GetEnvironmentIdentifier"}, - FunctionInfo{12, nullptr, "GetDeviceId"}, - FunctionInfo{13, nullptr, "DeleteSettings"}, - FunctionInfo{14, nullptr, "ImportSettings"}, - FunctionInfo{15, &NSD::SetChangeEnvironmentIdentifierDisabled, "SetChangeEnvironmentIdentifierDisabled"}, - FunctionInfo{20, &NSD::Resolve, "Resolve"}, - FunctionInfo{21, &NSD::ResolveEx, "ResolveEx"}, - FunctionInfo{30, nullptr, "GetNasServiceSetting"}, - FunctionInfo{31, nullptr, "GetNasServiceSettingEx"}, - FunctionInfo{40, nullptr, "GetNasRequestFqdn"}, - FunctionInfo{41, nullptr, "GetNasRequestFqdnEx"}, - FunctionInfo{42, nullptr, "GetNasApiFqdn"}, - FunctionInfo{43, nullptr, "GetNasApiFqdnEx"}, - FunctionInfo{50, nullptr, "GetCurrentSetting"}, - FunctionInfo{51, nullptr, "WriteTestParameter"}, - FunctionInfo{52, nullptr, "ReadTestParameter"}, - FunctionInfo{60, nullptr, "ReadSaveDataFromFsForTest"}, - FunctionInfo{61, nullptr, "WriteSaveDataToFsForTest"}, - FunctionInfo{62, nullptr, "DeleteSaveDataOfFsForTest"}, - FunctionInfo{63, nullptr, "IsChangeEnvironmentIdentifierDisabled"}, - FunctionInfo{64, nullptr, "SetWithoutDomainExchangeFqdns"}, - FunctionInfo{100, &NSD::GetApplicationServerEnvironmentType, "GetApplicationServerEnvironmentType"}, - FunctionInfo{101, nullptr, "SetApplicationServerEnvironmentType"}, - FunctionInfo{102, nullptr, "DeleteApplicationServerEnvironmentType"} - ); }; } // namespace Service::Sockets diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp index c89705356e..93c01bf786 100644 --- a/src/core/hle/service/sockets/sfdnsres.cpp +++ b/src/core/hle/service/sockets/sfdnsres.cpp @@ -21,6 +21,25 @@ namespace Service::Sockets { SFDNSRES::SFDNSRES(Core::System& system_) : ServiceFramework{system_, "sfdnsres"} { + static const FunctionInfo functions[] = { + {0, nullptr, "SetDnsAddressesPrivateRequest"}, + {1, nullptr, "GetDnsAddressPrivateRequest"}, + {2, &SFDNSRES::GetHostByNameRequest, "GetHostByNameRequest"}, + {3, nullptr, "GetHostByAddrRequest"}, + {4, nullptr, "GetHostStringErrorRequest"}, + {5, &SFDNSRES::GetGaiStringErrorRequest, "GetGaiStringErrorRequest"}, + {6, &SFDNSRES::GetAddrInfoRequest, "GetAddrInfoRequest"}, + {7, nullptr, "GetNameInfoRequest"}, + {8, nullptr, "RequestCancelHandleRequest"}, + {9, nullptr, "CancelRequest"}, + {10, &SFDNSRES::GetHostByNameRequestWithOptions, "GetHostByNameRequestWithOptions"}, + {11, nullptr, "GetHostByAddrRequestWithOptions"}, + {12, &SFDNSRES::GetAddrInfoRequestWithOptions, "GetAddrInfoRequestWithOptions"}, + {13, nullptr, "GetNameInfoRequestWithOptions"}, + {14, &SFDNSRES::ResolverSetOptionRequest, "ResolverSetOptionRequest"}, + {15, nullptr, "ResolverGetOptionRequest"}, + }; + RegisterHandlers(functions); } SFDNSRES::~SFDNSRES() = default; @@ -391,6 +410,14 @@ void SFDNSRES::ResolverSetOptionRequest(HLERequestContext& ctx) { DNS_PRIV::DNS_PRIV(Core::System& system_) : ServiceFramework{system_, "dns:priv"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Cmd0"}, + {1, nullptr, "Cmd1"}, + {2, nullptr, "Cmd2"}, + }; + // clang-format on + RegisterHandlers(functions); } DNS_PRIV::~DNS_PRIV() = default; diff --git a/src/core/hle/service/sockets/sfdnsres.h b/src/core/hle/service/sockets/sfdnsres.h index b365d03b2d..4302edc43e 100644 --- a/src/core/hle/service/sockets/sfdnsres.h +++ b/src/core/hle/service/sockets/sfdnsres.h @@ -26,43 +26,12 @@ private: void GetAddrInfoRequest(HLERequestContext& ctx); void GetAddrInfoRequestWithOptions(HLERequestContext& ctx); void ResolverSetOptionRequest(HLERequestContext& ctx); - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetDnsAddressesPrivateRequest"}, - FunctionInfo{1, nullptr, "GetDnsAddressPrivateRequest"}, - FunctionInfo{2, &SFDNSRES::GetHostByNameRequest, "GetHostByNameRequest"}, - FunctionInfo{3, nullptr, "GetHostByAddrRequest"}, - FunctionInfo{4, nullptr, "GetHostStringErrorRequest"}, - FunctionInfo{5, &SFDNSRES::GetGaiStringErrorRequest, "GetGaiStringErrorRequest"}, - FunctionInfo{6, &SFDNSRES::GetAddrInfoRequest, "GetAddrInfoRequest"}, - FunctionInfo{7, nullptr, "GetNameInfoRequest"}, - FunctionInfo{8, nullptr, "RequestCancelHandleRequest"}, - FunctionInfo{9, nullptr, "CancelRequest"}, - FunctionInfo{10, &SFDNSRES::GetHostByNameRequestWithOptions, "GetHostByNameRequestWithOptions"}, - FunctionInfo{11, nullptr, "GetHostByAddrRequestWithOptions"}, - FunctionInfo{12, &SFDNSRES::GetAddrInfoRequestWithOptions, "GetAddrInfoRequestWithOptions"}, - FunctionInfo{13, nullptr, "GetNameInfoRequestWithOptions"}, - FunctionInfo{14, &SFDNSRES::ResolverSetOptionRequest, "ResolverSetOptionRequest"}, - FunctionInfo{15, nullptr, "ResolverGetOptionRequest"} - ); }; class DNS_PRIV final : public ServiceFramework { public: explicit DNS_PRIV(Core::System& system_); ~DNS_PRIV() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Cmd0"}, - FunctionInfo{1, nullptr, "Cmd1"}, - FunctionInfo{2, nullptr, "Cmd2"} - ); }; } // namespace Service::Sockets diff --git a/src/core/hle/service/sockets/sockets.cpp b/src/core/hle/service/sockets/sockets.cpp index 1c723e96a6..e96d7c5638 100644 --- a/src/core/hle/service/sockets/sockets.cpp +++ b/src/core/hle/service/sockets/sockets.cpp @@ -15,49 +15,49 @@ namespace Service::Sockets { class ETHC_C final : public ServiceFramework { public: explicit ETHC_C(Core::System& system_) - : ServiceFramework{system_, "ethc:c"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Initialize"}, - FunctionInfo{1, nullptr, "Cancel"}, - FunctionInfo{2, nullptr, "GetResult"}, - FunctionInfo{3, nullptr, "GetMediaList"}, - FunctionInfo{4, nullptr, "SetMediaType"}, - FunctionInfo{5, nullptr, "GetMediaType"}, - FunctionInfo{6, nullptr, "GetMacAddress"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "ethc:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "Cancel"}, + {2, nullptr, "GetResult"}, + {3, nullptr, "GetMediaList"}, + {4, nullptr, "SetMediaType"}, + {5, nullptr, "GetMediaType"}, + {6, nullptr, "GetMacAddress"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class ETHC_I final : public ServiceFramework { public: explicit ETHC_I(Core::System& system_) - : ServiceFramework{system_, "ethc:i"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetReadableHandle"}, - FunctionInfo{1, nullptr, "Cancel"}, - FunctionInfo{2, nullptr, "GetResult"}, - FunctionInfo{3, nullptr, "GetInterfaceList"}, - FunctionInfo{4, nullptr, "GetInterfaceCount"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "ethc:i"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetReadableHandle"}, + {1, nullptr, "Cancel"}, + {2, nullptr, "GetResult"}, + {3, nullptr, "GetInterfaceList"}, + {4, nullptr, "GetInterfaceCount"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class ISfDriverServiceCreator final : public ServiceFramework { public: explicit ISfDriverServiceCreator(Core::System& system_) - : ServiceFramework{system_, "eth:nd"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateDriverService"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + : ServiceFramework{system_, "eth:nd"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateDriverService"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/sockets/sockets_translate.h b/src/core/hle/service/sockets/sockets_translate.h index bd6721fd3e..b1dfc71961 100644 --- a/src/core/hle/service/sockets/sockets_translate.h +++ b/src/core/hle/service/sockets/sockets_translate.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/spl/spl.cpp b/src/core/hle/service/spl/spl.cpp index ad0251fac5..81be99c360 100644 --- a/src/core/hle/service/spl/spl.cpp +++ b/src/core/hle/service/spl/spl.cpp @@ -8,22 +8,181 @@ namespace Service::SPL { -SPL::SPL(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:") {} +SPL::SPL(Core::System& system_, std::shared_ptr module_) + : Interface(system_, std::move(module_), "spl:") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL::~SPL() = default; -SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:mig") {} +SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr module_) + : Interface(system_, std::move(module_), "spl:mig") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, &SPL::GenerateAesKek, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, &SPL::GenerateAesKey, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_MIG::~SPL_MIG() = default; -SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:fs") {} +SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr module_) + : Interface(system_, std::move(module_), "spl:fs") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {9, nullptr, "ImportLotusKey"}, + {10, nullptr, "DecryptLotusMessage"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {12, nullptr, "GenerateSpecificAesKey"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {19, nullptr, "LoadTitleKey"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + {31, nullptr, "GetPackage2Hash"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_FS::~SPL_FS() = default; -SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:ssl") {} +SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr module_) + : Interface(system_, std::move(module_), "spl:ssl") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {13, nullptr, "DecryptDeviceUniqueData"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + {26, nullptr, "DecryptAndStoreSslClientCertKey"}, + {27, nullptr, "ModularExponentiateWithSslClientCertKey"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_SSL::~SPL_SSL() = default; -SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:es") {} +SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr module_) + : Interface(system_, std::move(module_), "spl:es") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {13, nullptr, "DecryptDeviceUniqueData"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {17, nullptr, "ImportEsKey"}, + {18, nullptr, "UnwrapTitleKey"}, + {20, nullptr, "PrepareEsCommonKey"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + {28, nullptr, "DecryptAndStoreDrmDeviceCertKey"}, + {29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"}, + {31, nullptr, "PrepareEsArchiveKey"}, + {32, nullptr, "LoadPreparedAesKey"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_ES::~SPL_ES() = default; -SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:manu") {} +SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr module_) + : Interface(system_, std::move(module_), "spl:manu") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {13, nullptr, "DecryptDeviceUniqueData"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + {30, nullptr, "ReencryptDeviceUniqueData"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_MANU::~SPL_MANU() = default; } // namespace Service::SPL diff --git a/src/core/hle/service/spl/spl.h b/src/core/hle/service/spl/spl.h index 8f84d2a3d3..83a3cda539 100644 --- a/src/core/hle/service/spl/spl.h +++ b/src/core/hle/service/spl/spl.h @@ -18,177 +18,36 @@ class SPL final : public Module::Interface { public: explicit SPL(Core::System& system_, std::shared_ptr module_); ~SPL() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, - FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, - FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, - FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, - FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, - FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"} - ); }; class SPL_MIG final : public Module::Interface { public: explicit SPL_MIG(Core::System& system_, std::shared_ptr module_); ~SPL_MIG() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, - FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, - FunctionInfo{2, &SPL::GenerateAesKek, "GenerateAesKek"}, - FunctionInfo{3, nullptr, "LoadAesKey"}, - FunctionInfo{4, &SPL::GenerateAesKey, "GenerateAesKey"}, - FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, - FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, - FunctionInfo{14, nullptr, "DecryptAesKey"}, - FunctionInfo{15, nullptr, "CryptAesCtr"}, - FunctionInfo{16, nullptr, "ComputeCmac"}, - FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, - FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, - FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, - FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, - FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"} - ); }; class SPL_FS final : public Module::Interface { public: explicit SPL_FS(Core::System& system_, std::shared_ptr module_); ~SPL_FS() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, - FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, - FunctionInfo{2, nullptr, "GenerateAesKek"}, - FunctionInfo{3, nullptr, "LoadAesKey"}, - FunctionInfo{4, nullptr, "GenerateAesKey"}, - FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, - FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - FunctionInfo{9, nullptr, "ImportLotusKey"}, - FunctionInfo{10, nullptr, "DecryptLotusMessage"}, - FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, - FunctionInfo{12, nullptr, "GenerateSpecificAesKey"}, - FunctionInfo{14, nullptr, "DecryptAesKey"}, - FunctionInfo{15, nullptr, "CryptAesCtr"}, - FunctionInfo{16, nullptr, "ComputeCmac"}, - FunctionInfo{19, nullptr, "LoadTitleKey"}, - FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, - FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, - FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, - FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, - FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}, - FunctionInfo{31, nullptr, "GetPackage2Hash"} - ); }; class SPL_SSL final : public Module::Interface { public: explicit SPL_SSL(Core::System& system_, std::shared_ptr module_); ~SPL_SSL() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, - FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, - FunctionInfo{2, nullptr, "GenerateAesKek"}, - FunctionInfo{3, nullptr, "LoadAesKey"}, - FunctionInfo{4, nullptr, "GenerateAesKey"}, - FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, - FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, - FunctionInfo{13, nullptr, "DecryptDeviceUniqueData"}, - FunctionInfo{14, nullptr, "DecryptAesKey"}, - FunctionInfo{15, nullptr, "CryptAesCtr"}, - FunctionInfo{16, nullptr, "ComputeCmac"}, - FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, - FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, - FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, - FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, - FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}, - FunctionInfo{26, nullptr, "DecryptAndStoreSslClientCertKey"}, - FunctionInfo{27, nullptr, "ModularExponentiateWithSslClientCertKey"} - ); }; class SPL_ES final : public Module::Interface { public: explicit SPL_ES(Core::System& system_, std::shared_ptr module_); ~SPL_ES() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, - FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, - FunctionInfo{2, nullptr, "GenerateAesKek"}, - FunctionInfo{3, nullptr, "LoadAesKey"}, - FunctionInfo{4, nullptr, "GenerateAesKey"}, - FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, - FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, - FunctionInfo{13, nullptr, "DecryptDeviceUniqueData"}, - FunctionInfo{14, nullptr, "DecryptAesKey"}, - FunctionInfo{15, nullptr, "CryptAesCtr"}, - FunctionInfo{16, nullptr, "ComputeCmac"}, - FunctionInfo{17, nullptr, "ImportEsKey"}, - FunctionInfo{18, nullptr, "UnwrapTitleKey"}, - FunctionInfo{20, nullptr, "PrepareEsCommonKey"}, - FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, - FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, - FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, - FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, - FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}, - FunctionInfo{28, nullptr, "DecryptAndStoreDrmDeviceCertKey"}, - FunctionInfo{29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"}, - FunctionInfo{31, nullptr, "PrepareEsArchiveKey"}, - FunctionInfo{32, nullptr, "LoadPreparedAesKey"} - ); }; class SPL_MANU final : public Module::Interface { public: explicit SPL_MANU(Core::System& system_, std::shared_ptr module_); ~SPL_MANU() override; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &SPL::GetConfig, "GetConfig"}, - FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"}, - FunctionInfo{2, nullptr, "GenerateAesKek"}, - FunctionInfo{3, nullptr, "LoadAesKey"}, - FunctionInfo{4, nullptr, "GenerateAesKey"}, - FunctionInfo{5, &SPL::SetConfig, "SetConfig"}, - FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, - FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"}, - FunctionInfo{13, nullptr, "DecryptDeviceUniqueData"}, - FunctionInfo{14, nullptr, "DecryptAesKey"}, - FunctionInfo{15, nullptr, "CryptAesCtr"}, - FunctionInfo{16, nullptr, "ComputeCmac"}, - FunctionInfo{21, nullptr, "AllocateAesKeyslot"}, - FunctionInfo{22, nullptr, "DeallocateAesKeySlot"}, - FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"}, - FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"}, - FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}, - FunctionInfo{30, nullptr, "ReencryptDeviceUniqueData"} - ); }; } // namespace Service::SPL diff --git a/src/core/hle/service/spl/spl_module.cpp b/src/core/hle/service/spl/spl_module.cpp index 594575d9a0..520cb1860b 100644 --- a/src/core/hle/service/spl/spl_module.cpp +++ b/src/core/hle/service/spl/spl_module.cpp @@ -204,15 +204,14 @@ Result Module::Interface::GetConfigImpl(u64* out_config, ConfigItem config_item) class CSRNG final : public Module::Interface { public: - explicit CSRNG(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "csrng") {} - ~CSRNG() override = default; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit CSRNG(Core::System& system_, std::shared_ptr module_) + : Interface(system_, std::move(module_), "csrng") { + static const FunctionInfo functions[] = { + {0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"}, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"} - ); + ~CSRNG() override = default; }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/spl/spl_results.h b/src/core/hle/service/spl/spl_results.h index dd7ba11f34..8c09be49ab 100644 --- a/src/core/hle/service/spl/spl_results.h +++ b/src/core/hle/service/spl/spl_results.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/spl/spl_types.h b/src/core/hle/service/spl/spl_types.h index 91f9cc0321..d7f0c4afbb 100644 --- a/src/core/hle/service/spl/spl_types.h +++ b/src/core/hle/service/spl/spl_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ssl/cert_store.cpp b/src/core/hle/service/ssl/cert_store.cpp index b321e5d32b..ee5bf8306b 100644 --- a/src/core/hle/service/ssl/cert_store.cpp +++ b/src/core/hle/service/ssl/cert_store.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ssl/cert_store.h b/src/core/hle/service/ssl/cert_store.h index 613d7b02af..4bbb3c9c1a 100644 --- a/src/core/hle/service/ssl/cert_store.h +++ b/src/core/hle/service/ssl/cert_store.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index c5902079ee..999efd4295 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -74,17 +74,57 @@ struct SslContextSharedData { class ISslConnection final : public ServiceFramework { public: - explicit ISslConnection(Core::System& system_in, SslVersion ssl_version_in, std::shared_ptr& shared_data_in, std::unique_ptr&& backend_in) - : ServiceFramework{system_in, "ISslConnection"} - , ssl_version{ssl_version_in} - , shared_data{shared_data_in} - , backend{std::move(backend_in)} { - backend->SetVerifyOption(verify_option); - shared_data->connection_count++; - } + explicit ISslConnection(Core::System& system_in, SslVersion ssl_version_in, + std::shared_ptr& shared_data_in, + std::unique_ptr&& backend_in) + : ServiceFramework{system_in, "ISslConnection"}, ssl_version{ssl_version_in}, + shared_data{shared_data_in}, backend{std::move(backend_in)} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ISslConnection::SetSocketDescriptor>, "SetSocketDescriptor"}, + {1, D<&ISslConnection::SetHostName>, "SetHostName"}, + {2, D<&ISslConnection::SetVerifyOption>, "SetVerifyOption"}, + {3, D<&ISslConnection::SetIoMode>, "SetIoMode"}, + {4, D<&ISslConnection::GetSocketDescriptor>, "GetSocketDescriptor"}, + {5, D<&ISslConnection::GetHostName>, "GetHostName"}, + {6, nullptr, "GetVerifyOption"}, + {7, D<&ISslConnection::GetIoMode>, "GetIoMode"}, + {8, D<&ISslConnection::DoHandshake>, "DoHandshake"}, + {9, &ISslConnection::DoHandshakeGetServerCert, "DoHandshakeGetServerCert"}, + {10, D<&ISslConnection::Read>, "Read"}, + {11, D<&ISslConnection::Write>, "Write"}, + {12, D<&ISslConnection::Pending>, "Pending"}, + {13, D<&ISslConnection::Peek>, "Peek"}, + {14, D<&ISslConnection::Poll>, "Poll"}, + {15, D<&ISslConnection::GetVerifyCertError>, "GetVerifyCertError"}, + {16, D<&ISslConnection::GetNeededServerCertBufferSize>, "GetNeededServerCertBufferSize"}, + {17, D<&ISslConnection::SetSessionCacheMode>, "SetSessionCacheMode"}, + {18, D<&ISslConnection::GetSessionCacheMode>, "GetSessionCacheMode"}, + {19, D<&ISslConnection::FlushSessionCache>, "FlushSessionCache"}, + {20, D<&ISslConnection::SetRenegotiationMode>, "SetRenegotiationMode"}, + {21, D<&ISslConnection::GetRenegotiationMode>, "GetRenegotiationMode"}, + {22, D<&ISslConnection::SetOption>, "SetOption"}, + {23, D<&ISslConnection::GetOption>, "GetOption"}, + {24, nullptr, "GetVerifyCertErrors"}, + {25, nullptr, "GetCipherInfo"}, + {26, D<&ISslConnection::SetNextAlpnProto>, "SetNextAlpnProto"}, + {27, D<&ISslConnection::GetNextAlpnProto>, "GetNextAlpnProto"}, + {28, nullptr, "SetDtlsSocketDescriptor"}, + {29, nullptr, "GetDtlsHandshakeTimeout"}, + {30, nullptr, "SetPrivateOption"}, + {31, nullptr, "SetSrtpCiphers"}, + {32, nullptr, "GetSrtpCipher"}, + {33, nullptr, "ExportKeyingMaterial"}, + {34, nullptr, "SetIoTimeout"}, + {35, nullptr, "GetIoTimeout"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); + + backend->SetVerifyOption(verify_option); + + shared_data->connection_count++; } ~ISslConnection() { @@ -392,44 +432,6 @@ private: R_SUCCEED(); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ISslConnection::SetSocketDescriptor>, "SetSocketDescriptor"}, - FunctionInfo{1, D<&ISslConnection::SetHostName>, "SetHostName"}, - FunctionInfo{2, D<&ISslConnection::SetVerifyOption>, "SetVerifyOption"}, - FunctionInfo{3, D<&ISslConnection::SetIoMode>, "SetIoMode"}, - FunctionInfo{4, D<&ISslConnection::GetSocketDescriptor>, "GetSocketDescriptor"}, - FunctionInfo{5, D<&ISslConnection::GetHostName>, "GetHostName"}, - FunctionInfo{6, nullptr, "GetVerifyOption"}, - FunctionInfo{7, D<&ISslConnection::GetIoMode>, "GetIoMode"}, - FunctionInfo{8, D<&ISslConnection::DoHandshake>, "DoHandshake"}, - FunctionInfo{9, &ISslConnection::DoHandshakeGetServerCert, "DoHandshakeGetServerCert"}, - FunctionInfo{10, D<&ISslConnection::Read>, "Read"}, - FunctionInfo{11, D<&ISslConnection::Write>, "Write"}, - FunctionInfo{12, D<&ISslConnection::Pending>, "Pending"}, - FunctionInfo{13, D<&ISslConnection::Peek>, "Peek"}, - FunctionInfo{14, D<&ISslConnection::Poll>, "Poll"}, - FunctionInfo{15, D<&ISslConnection::GetVerifyCertError>, "GetVerifyCertError"}, - FunctionInfo{16, D<&ISslConnection::GetNeededServerCertBufferSize>, "GetNeededServerCertBufferSize"}, - FunctionInfo{17, D<&ISslConnection::SetSessionCacheMode>, "SetSessionCacheMode"}, - FunctionInfo{18, D<&ISslConnection::GetSessionCacheMode>, "GetSessionCacheMode"}, - FunctionInfo{19, D<&ISslConnection::FlushSessionCache>, "FlushSessionCache"}, - FunctionInfo{20, D<&ISslConnection::SetRenegotiationMode>, "SetRenegotiationMode"}, - FunctionInfo{21, D<&ISslConnection::GetRenegotiationMode>, "GetRenegotiationMode"}, - FunctionInfo{22, D<&ISslConnection::SetOption>, "SetOption"}, - FunctionInfo{23, D<&ISslConnection::GetOption>, "GetOption"}, - FunctionInfo{24, nullptr, "GetVerifyCertErrors"}, - FunctionInfo{25, nullptr, "GetCipherInfo"}, - FunctionInfo{26, D<&ISslConnection::SetNextAlpnProto>, "SetNextAlpnProto"}, - FunctionInfo{27, D<&ISslConnection::GetNextAlpnProto>, "GetNextAlpnProto"}, - FunctionInfo{28, nullptr, "SetDtlsSocketDescriptor"}, - FunctionInfo{29, nullptr, "GetDtlsHandshakeTimeout"}, - FunctionInfo{30, nullptr, "SetPrivateOption"}, - FunctionInfo{31, nullptr, "SetSrtpCiphers"}, - FunctionInfo{32, nullptr, "GetSrtpCipher"}, - FunctionInfo{33, nullptr, "ExportKeyingMaterial"}, - FunctionInfo{34, nullptr, "SetIoTimeout"}, - FunctionInfo{35, nullptr, "GetIoTimeout"} - ); SslVersion ssl_version; std::shared_ptr shared_data; std::unique_ptr backend; @@ -450,9 +452,29 @@ public: explicit ISslContext(Core::System& system_, SslVersion version) : ServiceFramework{system_, "ISslContext"}, ssl_version{version}, shared_data{std::make_shared()} { + static const FunctionInfo functions[] = { + {0, &ISslContext::SetOption, "SetOption"}, + {1, &ISslContext::GetOption, "GetOption"}, + {2, &ISslContext::CreateConnection, "CreateConnection"}, + {3, &ISslContext::GetConnectionCount, "GetConnectionCount"}, + {4, &ISslContext::ImportServerPki, "ImportServerPki"}, + {5, &ISslContext::ImportClientPki, "ImportClientPki"}, + {6, nullptr, "RemoveServerPki"}, + {7, nullptr, "RemoveClientPki"}, + {8, D<&ISslContext::RegisterInternalPki>, "RegisterInternalPki"}, + {9, nullptr, "AddPolicyOid"}, + {10, nullptr, "ImportCrl"}, + {11, nullptr, "RemoveCrl"}, + {12, nullptr, "ImportClientCertKeyPki"}, + {13, nullptr, "GeneratePrivateKeyAndCert"}, + }; + RegisterHandlers(functions); } private: + SslVersion ssl_version; + std::shared_ptr shared_data; + void SetOption(HLERequestContext& ctx) { struct Parameters { ContextOption option; @@ -539,36 +561,28 @@ private: LOG_WARNING(Service_SSL, "(STUBBED) called"); R_SUCCEED(); } - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ISslContext::SetOption, "SetOption"}, - FunctionInfo{1, &ISslContext::GetOption, "GetOption"}, - FunctionInfo{2, &ISslContext::CreateConnection, "CreateConnection"}, - FunctionInfo{3, &ISslContext::GetConnectionCount, "GetConnectionCount"}, - FunctionInfo{4, &ISslContext::ImportServerPki, "ImportServerPki"}, - FunctionInfo{5, &ISslContext::ImportClientPki, "ImportClientPki"}, - FunctionInfo{6, nullptr, "RemoveServerPki"}, - FunctionInfo{7, nullptr, "RemoveClientPki"}, - FunctionInfo{8, D<&ISslContext::RegisterInternalPki>, "RegisterInternalPki"}, - FunctionInfo{9, nullptr, "AddPolicyOid"}, - FunctionInfo{10, nullptr, "ImportCrl"}, - FunctionInfo{11, nullptr, "RemoveCrl"}, - FunctionInfo{12, nullptr, "ImportClientCertKeyPki"}, - FunctionInfo{13, nullptr, "GeneratePrivateKeyAndCert"} - ); - SslVersion ssl_version; - std::shared_ptr shared_data; }; class ISslService final : public ServiceFramework { public: - explicit ISslService(Core::System& system_) : ServiceFramework{system_, "ssl"}, cert_store{system} {} + explicit ISslService(Core::System& system_) + : ServiceFramework{system_, "ssl"}, cert_store{system} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &ISslService::CreateContext, "CreateContext"}, + {1, nullptr, "GetContextCount"}, + {2, D<&ISslService::GetCertificates>, "GetCertificates"}, + {3, D<&ISslService::GetCertificateBufSize>, "GetCertificateBufSize"}, + {4, nullptr, "DebugIoctl"}, + {5, &ISslService::SetInterfaceVersion, "SetInterfaceVersion"}, + {6, nullptr, "FlushSessionCache"}, + {7, nullptr, "SetDebugOption"}, + {8, nullptr, "GetDebugOption"}, + {8, nullptr, "ClearTls12FallbackFlag"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -614,116 +628,147 @@ private: } private: - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &ISslService::CreateContext, "CreateContext"}, - FunctionInfo{1, nullptr, "GetContextCount"}, - FunctionInfo{2, D<&ISslService::GetCertificates>, "GetCertificates"}, - FunctionInfo{3, D<&ISslService::GetCertificateBufSize>, "GetCertificateBufSize"}, - FunctionInfo{4, nullptr, "DebugIoctl"}, - FunctionInfo{5, &ISslService::SetInterfaceVersion, "SetInterfaceVersion"}, - FunctionInfo{6, nullptr, "FlushSessionCache"}, - FunctionInfo{7, nullptr, "SetDebugOption"}, - FunctionInfo{8, nullptr, "GetDebugOption"}, - FunctionInfo{8, nullptr, "ClearTls12FallbackFlag"} - ); CertStore cert_store; }; class ISslServiceForSystem final : public ServiceFramework { -public: - explicit ISslServiceForSystem(Core::System& system_) : ServiceFramework{system_, "ssl:s"} {} + public: + explicit ISslServiceForSystem(Core::System& system_) : ServiceFramework{system_, "ssl:s"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&ISslServiceForSystem::CreateContext>, "CreateContext"}, + {1, D<&ISslServiceForSystem::GetContextCount>, "GetContextCount"}, + {2, D<&ISslServiceForSystem::GetCertificates>, "GetCertificates"}, + {3, D<&ISslServiceForSystem::GetCertificateBufSize>, "GetCertificateBufSize"}, + {4, D<&ISslServiceForSystem::DebugIoctl>, "DebugIoctl"}, + {5, D<&ISslServiceForSystem::SetInterfaceVersion>, "SetInterfaceVersion"}, + {6, D<&ISslServiceForSystem::FlushSessionCache>, "FlushSessionCache"}, + {7, D<&ISslServiceForSystem::SetDebugOption>, "SetDebugOption"}, + {8, D<&ISslServiceForSystem::GetDebugOption>, "GetDebugOption"}, + {9, D<&ISslServiceForSystem::ClearTls12FallbackFlag>, "ClearTls12FallbackFlag"}, + {100, D<&ISslServiceForSystem::CreateContextForSystem>, "CreateContextForSystem"}, + {101, D<&ISslServiceForSystem::SetThreadCoreMask>, "SetThreadCoreMask"}, + {102, D<&ISslServiceForSystem::GetThreadCoreMask>, "GetThreadCoreMask"}, + {103, D<&ISslServiceForSystem::VerifySignature>, "VerifySignature"} + }; + // clang-format on - Result CreateContext() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); + RegisterHandlers(functions); + }; + + Result CreateContext() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result GetContextCount() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result GetCertificates() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result GetCertificateBufSize() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result DebugIoctl() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result SetInterfaceVersion() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result FlushSessionCache() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result SetDebugOption() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result GetDebugOption() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result ClearTls12FallbackFlag() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result CreateContextForSystem() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result SetThreadCoreMask() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result GetThreadCoreMask() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; + + Result VerifySignature() { + LOG_DEBUG(Service_SSL, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + return ResultSuccess; + }; }; - Result GetContextCount() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result GetCertificates() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result GetCertificateBufSize() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result DebugIoctl() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result SetInterfaceVersion() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result FlushSessionCache() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result SetDebugOption() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result GetDebugOption() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result ClearTls12FallbackFlag() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result CreateContextForSystem() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result SetThreadCoreMask() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result GetThreadCoreMask() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - Result VerifySignature() { - LOG_DEBUG(Service_SSL, "(STUBBED) called."); - R_SUCCEED(); - }; - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); - } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, D<&ISslServiceForSystem::CreateContext>, "CreateContext"}, - FunctionInfo{1, D<&ISslServiceForSystem::GetContextCount>, "GetContextCount"}, - FunctionInfo{2, D<&ISslServiceForSystem::GetCertificates>, "GetCertificates"}, - FunctionInfo{3, D<&ISslServiceForSystem::GetCertificateBufSize>, "GetCertificateBufSize"}, - FunctionInfo{4, D<&ISslServiceForSystem::DebugIoctl>, "DebugIoctl"}, - FunctionInfo{5, D<&ISslServiceForSystem::SetInterfaceVersion>, "SetInterfaceVersion"}, - FunctionInfo{6, D<&ISslServiceForSystem::FlushSessionCache>, "FlushSessionCache"}, - FunctionInfo{7, D<&ISslServiceForSystem::SetDebugOption>, "SetDebugOption"}, - FunctionInfo{8, D<&ISslServiceForSystem::GetDebugOption>, "GetDebugOption"}, - FunctionInfo{9, D<&ISslServiceForSystem::ClearTls12FallbackFlag>, "ClearTls12FallbackFlag"}, - FunctionInfo{100, D<&ISslServiceForSystem::CreateContextForSystem>, "CreateContextForSystem"}, - FunctionInfo{101, D<&ISslServiceForSystem::SetThreadCoreMask>, "SetThreadCoreMask"}, - FunctionInfo{102, D<&ISslServiceForSystem::GetThreadCoreMask>, "GetThreadCoreMask"}, - FunctionInfo{103, D<&ISslServiceForSystem::VerifySignature>, "VerifySignature"} - ); -}; - void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); diff --git a/src/core/hle/service/ssl/ssl.h b/src/core/hle/service/ssl/ssl.h index f6e21bbb3b..dc9f2b746b 100644 --- a/src/core/hle/service/ssl/ssl.h +++ b/src/core/hle/service/ssl/ssl.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/ssl/ssl_types.h b/src/core/hle/service/ssl/ssl_types.h index 16623c0fc5..cbd84ad1f9 100644 --- a/src/core/hle/service/ssl/ssl_types.h +++ b/src/core/hle/service/ssl/ssl_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/tma/tma.cpp b/src/core/hle/service/tma/tma.cpp index e9198eea64..c2fb33cd16 100644 --- a/src/core/hle/service/tma/tma.cpp +++ b/src/core/hle/service/tma/tma.cpp @@ -19,14 +19,12 @@ class HTC_TENV final : public ServiceFramework { public: explicit HTC_TENV(Core::System& system_) : ServiceFramework{system_, "htc:tenv"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + {0, nullptr, "GetServiceInterface"}, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetServiceInterface"} - ); }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp index f7dc15e3db..ff2a377172 100644 --- a/src/core/hle/service/usb/usb.cpp +++ b/src/core/hle/service/usb/usb.cpp @@ -17,127 +17,137 @@ namespace Service::USB { class IDsInterface final : public ServiceFramework { public: - explicit IDsInterface(Core::System& system_) : ServiceFramework{system_, "IDsInterface"} {} + explicit IDsInterface(Core::System& system_) : ServiceFramework{system_, "IDsInterface"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "AddEndpoint"}, + {1, nullptr, "GetSetupEvent"}, + {2, nullptr, "GetSetupPacket"}, + {3, nullptr, "Enable"}, + {4, nullptr, "Disable"}, + {5, nullptr, "CtrlIn"}, + {6, nullptr, "CtrlOut"}, + {7, nullptr, "GetCtrlInCompletionEvent"}, + {8, nullptr, "GetCtrlInUrbReport"}, + {9, nullptr, "GetCtrlOutCompletionEvent"}, + {10, nullptr, "GetCtrlOutUrbReport"}, + {11, nullptr, "CtrlStall"}, + {12, nullptr, "AppendConfigurationData"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "AddEndpoint"}, - FunctionInfo{1, nullptr, "GetSetupEvent"}, - FunctionInfo{2, nullptr, "GetSetupPacket"}, - FunctionInfo{3, nullptr, "Enable"}, - FunctionInfo{4, nullptr, "Disable"}, - FunctionInfo{5, nullptr, "CtrlIn"}, - FunctionInfo{6, nullptr, "CtrlOut"}, - FunctionInfo{7, nullptr, "GetCtrlInCompletionEvent"}, - FunctionInfo{8, nullptr, "GetCtrlInUrbReport"}, - FunctionInfo{9, nullptr, "GetCtrlOutCompletionEvent"}, - FunctionInfo{10, nullptr, "GetCtrlOutUrbReport"}, - FunctionInfo{11, nullptr, "CtrlStall"}, - FunctionInfo{12, nullptr, "AppendConfigurationData"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IDsRootSession final : public ServiceFramework { public: - explicit IDsRootSession(Core::System& system_) : ServiceFramework{system_, "usb:ds"} {} + explicit IDsRootSession(Core::System& system_) : ServiceFramework{system_, "usb:ds"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenDsService"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenDsService"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IClientEpSession final : public ServiceFramework { public: explicit IClientEpSession(Core::System& system_) - : ServiceFramework{system_, "IClientEpSession"} {} + : ServiceFramework{system_, "IClientEpSession"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ReOpen"}, + {1, nullptr, "Close"}, + {2, nullptr, "GetCompletionEvent"}, + {3, nullptr, "PopulateRing"}, + {4, nullptr, "PostBufferAsync"}, + {5, nullptr, "GetXferReport"}, + {6, nullptr, "PostBufferMultiAsync"}, + {7, nullptr, "CreateSmmuSpace"}, + {8, nullptr, "ShareReportRing"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "ReOpen"}, - FunctionInfo{1, nullptr, "Close"}, - FunctionInfo{2, nullptr, "GetCompletionEvent"}, - FunctionInfo{3, nullptr, "PopulateRing"}, - FunctionInfo{4, nullptr, "PostBufferAsync"}, - FunctionInfo{5, nullptr, "GetXferReport"}, - FunctionInfo{6, nullptr, "PostBufferMultiAsync"}, - FunctionInfo{7, nullptr, "CreateSmmuSpace"}, - FunctionInfo{8, nullptr, "ShareReportRing"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IClientIfSession final : public ServiceFramework { public: explicit IClientIfSession(Core::System& system_) - : ServiceFramework{system_, "IClientIfSession"} {} + : ServiceFramework{system_, "IClientIfSession"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetStateChangeEvent"}, + {1, nullptr, "SetInterface"}, + {2, nullptr, "GetInterface"}, + {3, nullptr, "GetAlternateInterface"}, + {4, nullptr, "GetCurrentFrame"}, + {5, nullptr, "CtrlXferAsync"}, + {6, nullptr, "GetCtrlXferCompletionEvent"}, + {7, nullptr, "GetCtrlXferReport"}, + {8, nullptr, "ResetDevice"}, + {9, nullptr, "OpenUsbEp"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetStateChangeEvent"}, - FunctionInfo{1, nullptr, "SetInterface"}, - FunctionInfo{2, nullptr, "GetInterface"}, - FunctionInfo{3, nullptr, "GetAlternateInterface"}, - FunctionInfo{4, nullptr, "GetCurrentFrame"}, - FunctionInfo{5, nullptr, "CtrlXferAsync"}, - FunctionInfo{6, nullptr, "GetCtrlXferCompletionEvent"}, - FunctionInfo{7, nullptr, "GetCtrlXferReport"}, - FunctionInfo{8, nullptr, "ResetDevice"}, - FunctionInfo{9, nullptr, "OpenUsbEp"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IClientRootSession final : public ServiceFramework { public: - explicit IClientRootSession(Core::System& system_) : ServiceFramework{system_, "usb:hs"} {} + explicit IClientRootSession(Core::System& system_) : ServiceFramework{system_, "usb:hs"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "BindClientProcess"}, + {1, nullptr, "QueryAllInterfaces"}, + {2, nullptr, "QueryAvailableInterfaces"}, + {3, nullptr, "QueryAcquiredInterfaces"}, + {4, nullptr, "CreateInterfaceAvailableEvent"}, + {5, nullptr, "DestroyInterfaceAvailableEvent"}, + {6, nullptr, "GetInterfaceStateChangeEvent"}, + {7, nullptr, "AcquireUsbIf"}, + {8, nullptr, "SetTestMode"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "BindClientProcess"}, - FunctionInfo{1, nullptr, "QueryAllInterfaces"}, - FunctionInfo{2, nullptr, "QueryAvailableInterfaces"}, - FunctionInfo{3, nullptr, "QueryAcquiredInterfaces"}, - FunctionInfo{4, nullptr, "CreateInterfaceAvailableEvent"}, - FunctionInfo{5, nullptr, "DestroyInterfaceAvailableEvent"}, - FunctionInfo{6, nullptr, "GetInterfaceStateChangeEvent"}, - FunctionInfo{7, nullptr, "AcquireUsbIf"}, - FunctionInfo{8, nullptr, "SetTestMode"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IPdSession final : public ServiceFramework { public: - explicit IPdSession(Core::System& system_) : ServiceFramework{system_, "IPdSession"} {} + explicit IPdSession(Core::System& system_) : ServiceFramework{system_, "IPdSession"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "BindNoticeEvent"}, + {1, nullptr, "UnbindNoticeEvent"}, + {2, nullptr, "GetStatus"}, + {3, nullptr, "GetNotice"}, + {4, nullptr, "EnablePowerRequestNotice"}, + {5, nullptr, "DisablePowerRequestNotice"}, + {6, nullptr, "ReplyPowerRequest"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "BindNoticeEvent"}, - FunctionInfo{1, nullptr, "UnbindNoticeEvent"}, - FunctionInfo{2, nullptr, "GetStatus"}, - FunctionInfo{3, nullptr, "GetNotice"}, - FunctionInfo{4, nullptr, "EnablePowerRequestNotice"}, - FunctionInfo{5, nullptr, "DisablePowerRequestNotice"}, - FunctionInfo{6, nullptr, "ReplyPowerRequest"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IPdManager final : public ServiceFramework { public: - explicit IPdManager(Core::System& system_) : ServiceFramework{system_, "usb:pd"} {} + explicit IPdManager(Core::System& system_) : ServiceFramework{system_, "usb:pd"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IPdManager::OpenSession, "OpenSession"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -148,39 +158,40 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IPdManager::OpenSession, "OpenSession"} - ); }; class IPdCradleSession final : public ServiceFramework { public: explicit IPdCradleSession(Core::System& system_) - : ServiceFramework{system_, "IPdCradleSession"} {} + : ServiceFramework{system_, "IPdCradleSession"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetCradleVdo"}, + {1, nullptr, "GetCradleVdo"}, + {2, nullptr, "ResetCradleUsbHub"}, + {3, nullptr, "GetHostPdcFirmwareType"}, + {4, nullptr, "GetHostPdcFirmwareRevision"}, + {5, nullptr, "GetHostPdcManufactureId"}, + {6, nullptr, "GetHostPdcDeviceId"}, + {7, nullptr, "EnableCradleRecovery"}, + {8, nullptr, "DisableCradleRecovery"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "SetCradleVdo"}, - FunctionInfo{1, nullptr, "GetCradleVdo"}, - FunctionInfo{2, nullptr, "ResetCradleUsbHub"}, - FunctionInfo{3, nullptr, "GetHostPdcFirmwareType"}, - FunctionInfo{4, nullptr, "GetHostPdcFirmwareRevision"}, - FunctionInfo{5, nullptr, "GetHostPdcManufactureId"}, - FunctionInfo{6, nullptr, "GetHostPdcDeviceId"}, - FunctionInfo{7, nullptr, "EnableCradleRecovery"}, - FunctionInfo{8, nullptr, "DisableCradleRecovery"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IPdCradleManager final : public ServiceFramework { public: - explicit IPdCradleManager(Core::System& system_) : ServiceFramework{system_, "usb:pd:c"} {} + explicit IPdCradleManager(Core::System& system_) : ServiceFramework{system_, "usb:pd:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &IPdCradleManager::OpenCradleSession, "OpenCradleSession"}, + }; + // clang-format on - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } private: @@ -191,64 +202,61 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(ctx, system); } - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, &IPdCradleManager::OpenCradleSession, "OpenCradleSession"} - ); }; class IPmMainService final : public ServiceFramework { public: - explicit IPmMainService(Core::System& system_) : ServiceFramework{system_, "usb:pm"} {} + explicit IPmMainService(Core::System& system_) : ServiceFramework{system_, "usb:pm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetPowerEvent"}, + {1, nullptr, "GetPowerState"}, + {2, nullptr, "GetDataEvent"}, + {3, nullptr, "GetDataRole"}, + {4, nullptr, "SetDiagData"}, + {5, nullptr, "GetDiagData"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetPowerEvent"}, - FunctionInfo{1, nullptr, "GetPowerState"}, - FunctionInfo{2, nullptr, "GetDataEvent"}, - FunctionInfo{3, nullptr, "GetDataRole"}, - FunctionInfo{4, nullptr, "SetDiagData"}, - FunctionInfo{5, nullptr, "GetDiagData"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class IPdManufactureManager final : public ServiceFramework { public: - explicit IPdManufactureManager(Core::System& system_) : ServiceFramework{system_, "usb:pd:m"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenManufactureSession"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit IPdManufactureManager(Core::System& system_) : ServiceFramework{system_, "usb:pd:m"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenManufactureSession"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IQdbManager final : public ServiceFramework { public: - explicit IQdbManager(Core::System& system_) : ServiceFramework{system_, "usb:qdb"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "ImportQuirkDevices"}, - FunctionInfo{1, nullptr, "HasQuirk"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit IQdbManager(Core::System& system_) : ServiceFramework{system_, "usb:qdb"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ImportQuirkDevices"}, + {1, nullptr, "HasQuirk"}, + }; + // clang-format on + RegisterHandlers(functions); } }; class IPmObserverService final : public ServiceFramework { public: - explicit IPmObserverService(Core::System& system_) : ServiceFramework{system_, "usb:obsv"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetTopologyChangeEvent"}, - FunctionInfo{1, nullptr, "GetFlattenedTopology"} - ); - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit IPmObserverService(Core::System& system_) : ServiceFramework{system_, "usb:obsv"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetTopologyChangeEvent"}, + {1, nullptr, "GetFlattenedTopology"}, + }; + // clang-format on + RegisterHandlers(functions); } }; diff --git a/src/core/hle/service/usb/usb.h b/src/core/hle/service/usb/usb.h index 98376ebc0c..cc25a3b29e 100644 --- a/src/core/hle/service/usb/usb.h +++ b/src/core/hle/service/usb/usb.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/application_display_service.cpp b/src/core/hle/service/vi/application_display_service.cpp index dcebb2eba9..f179ba676a 100644 --- a/src/core/hle/service/vi/application_display_service.cpp +++ b/src/core/hle/service/vi/application_display_service.cpp @@ -17,38 +17,38 @@ namespace Service::VI { -std::optional IApplicationDisplayService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{100, C<&IApplicationDisplayService::GetRelayService>, "GetRelayService"}, - FunctionInfo{101, C<&IApplicationDisplayService::GetSystemDisplayService>, "GetSystemDisplayService"}, - FunctionInfo{102, C<&IApplicationDisplayService::GetManagerDisplayService>, "GetManagerDisplayService"}, - FunctionInfo{103, C<&IApplicationDisplayService::GetIndirectDisplayTransactionService>, "GetIndirectDisplayTransactionService"}, - FunctionInfo{1000, C<&IApplicationDisplayService::ListDisplays>, "ListDisplays"}, - FunctionInfo{1010, C<&IApplicationDisplayService::OpenDisplay>, "OpenDisplay"}, - FunctionInfo{1011, C<&IApplicationDisplayService::OpenDefaultDisplay>, "OpenDefaultDisplay"}, - FunctionInfo{1020, C<&IApplicationDisplayService::CloseDisplay>, "CloseDisplay"}, - FunctionInfo{1101, C<&IApplicationDisplayService::SetDisplayEnabled>, "SetDisplayEnabled"}, - FunctionInfo{1102, C<&IApplicationDisplayService::GetDisplayResolution>, "GetDisplayResolution"}, - FunctionInfo{2020, C<&IApplicationDisplayService::OpenLayer>, "OpenLayer"}, - FunctionInfo{2021, C<&IApplicationDisplayService::CloseLayer>, "CloseLayer"}, - FunctionInfo{2030, C<&IApplicationDisplayService::CreateStrayLayer>, "CreateStrayLayer"}, - FunctionInfo{2031, C<&IApplicationDisplayService::DestroyStrayLayer>, "DestroyStrayLayer"}, - FunctionInfo{2101, C<&IApplicationDisplayService::SetLayerScalingMode>, "SetLayerScalingMode"}, - FunctionInfo{2102, C<&IApplicationDisplayService::ConvertScalingMode>, "ConvertScalingMode"}, - FunctionInfo{2103, C<&IApplicationDisplayService::Cmd2103>, "Cmd2103"}, - FunctionInfo{2450, C<&IApplicationDisplayService::GetIndirectLayerImageMap>, "GetIndirectLayerImageMap"}, - FunctionInfo{2451, nullptr, "GetIndirectLayerImageCropMap"}, - FunctionInfo{2460, C<&IApplicationDisplayService::GetIndirectLayerImageRequiredMemoryInfo>, "GetIndirectLayerImageRequiredMemoryInfo"}, - FunctionInfo{5202, C<&IApplicationDisplayService::GetDisplayVsyncEvent>, "GetDisplayVsyncEvent"}, - FunctionInfo{5203, nullptr, "GetDisplayVsyncEventForDebug"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IApplicationDisplayService::IApplicationDisplayService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "IApplicationDisplayService"}, m_container{std::move(container)}, m_context{system, "IApplicationDisplayService"} { + // clang-format off + static const FunctionInfo functions[] = { + {100, C<&IApplicationDisplayService::GetRelayService>, "GetRelayService"}, + {101, C<&IApplicationDisplayService::GetSystemDisplayService>, "GetSystemDisplayService"}, + {102, C<&IApplicationDisplayService::GetManagerDisplayService>, "GetManagerDisplayService"}, + {103, C<&IApplicationDisplayService::GetIndirectDisplayTransactionService>, "GetIndirectDisplayTransactionService"}, + {1000, C<&IApplicationDisplayService::ListDisplays>, "ListDisplays"}, + {1010, C<&IApplicationDisplayService::OpenDisplay>, "OpenDisplay"}, + {1011, C<&IApplicationDisplayService::OpenDefaultDisplay>, "OpenDefaultDisplay"}, + {1020, C<&IApplicationDisplayService::CloseDisplay>, "CloseDisplay"}, + {1101, C<&IApplicationDisplayService::SetDisplayEnabled>, "SetDisplayEnabled"}, + {1102, C<&IApplicationDisplayService::GetDisplayResolution>, "GetDisplayResolution"}, + {2020, C<&IApplicationDisplayService::OpenLayer>, "OpenLayer"}, + {2021, C<&IApplicationDisplayService::CloseLayer>, "CloseLayer"}, + {2030, C<&IApplicationDisplayService::CreateStrayLayer>, "CreateStrayLayer"}, + {2031, C<&IApplicationDisplayService::DestroyStrayLayer>, "DestroyStrayLayer"}, + {2101, C<&IApplicationDisplayService::SetLayerScalingMode>, "SetLayerScalingMode"}, + {2102, C<&IApplicationDisplayService::ConvertScalingMode>, "ConvertScalingMode"}, + {2103, C<&IApplicationDisplayService::Cmd2103>, "Cmd2103"}, + {2450, C<&IApplicationDisplayService::GetIndirectLayerImageMap>, "GetIndirectLayerImageMap"}, + {2451, nullptr, "GetIndirectLayerImageCropMap"}, + {2460, C<&IApplicationDisplayService::GetIndirectLayerImageRequiredMemoryInfo>, "GetIndirectLayerImageRequiredMemoryInfo"}, + {5202, C<&IApplicationDisplayService::GetDisplayVsyncEvent>, "GetDisplayVsyncEvent"}, + {5203, nullptr, "GetDisplayVsyncEventForDebug"}, + }; + // clang-format on + + RegisterHandlers(functions); } IApplicationDisplayService::~IApplicationDisplayService() { diff --git a/src/core/hle/service/vi/application_display_service.h b/src/core/hle/service/vi/application_display_service.h index 0b5898ee56..d2db391efd 100644 --- a/src/core/hle/service/vi/application_display_service.h +++ b/src/core/hle/service/vi/application_display_service.h @@ -74,8 +74,8 @@ public: s64 width, s64 height); private: - std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; + KernelHelpers::ServiceContext m_context; std::mutex m_lock{}; std::set m_open_layer_ids{}; diff --git a/src/core/hle/service/vi/application_root_service.cpp b/src/core/hle/service/vi/application_root_service.cpp index f12c564277..2204f77ed4 100644 --- a/src/core/hle/service/vi/application_root_service.cpp +++ b/src/core/hle/service/vi/application_root_service.cpp @@ -14,17 +14,14 @@ namespace Service::VI { -std::optional IApplicationRootService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, C<&IApplicationRootService::GetDisplayService>, "GetDisplayService"}, - FunctionInfo{1, nullptr, "GetDisplayServiceWithProxyNameExchange"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IApplicationRootService::IApplicationRootService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "vi:u"}, m_container{std::move(container)} { + static const FunctionInfo functions[] = { + {0, C<&IApplicationRootService::GetDisplayService>, "GetDisplayService"}, + {1, nullptr, "GetDisplayServiceWithProxyNameExchange"}, + }; + RegisterHandlers(functions); } IApplicationRootService::~IApplicationRootService() = default; diff --git a/src/core/hle/service/vi/application_root_service.h b/src/core/hle/service/vi/application_root_service.h index 4deaa04f4c..b66293b73f 100644 --- a/src/core/hle/service/vi/application_root_service.h +++ b/src/core/hle/service/vi/application_root_service.h @@ -30,7 +30,6 @@ private: Policy policy); private: - std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/display.h b/src/core/hle/service/vi/display.h index fceda75e39..543c6ee68d 100644 --- a/src/core/hle/service/vi/display.h +++ b/src/core/hle/service/vi/display.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/display_list.h b/src/core/hle/service/vi/display_list.h index f710ac472c..bf9cf78a27 100644 --- a/src/core/hle/service/vi/display_list.h +++ b/src/core/hle/service/vi/display_list.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/layer.h b/src/core/hle/service/vi/layer.h index e4c9c98646..9bd6d033ac 100644 --- a/src/core/hle/service/vi/layer.h +++ b/src/core/hle/service/vi/layer.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/layer_list.h b/src/core/hle/service/vi/layer_list.h index 4afca6f403..8fc7cd3ade 100644 --- a/src/core/hle/service/vi/layer_list.h +++ b/src/core/hle/service/vi/layer_list.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/manager_display_service.cpp b/src/core/hle/service/vi/manager_display_service.cpp index 1b3b0f3379..34a0175b49 100644 --- a/src/core/hle/service/vi/manager_display_service.cpp +++ b/src/core/hle/service/vi/manager_display_service.cpp @@ -10,96 +10,96 @@ namespace Service::VI { -std::optional IManagerDisplayService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{200, nullptr, "AllocateProcessHeapBlock"}, - FunctionInfo{201, nullptr, "FreeProcessHeapBlock"}, - FunctionInfo{1102, nullptr, "GetDisplayResolution"}, - FunctionInfo{2010, C<&IManagerDisplayService::CreateManagedLayer>, "CreateManagedLayer"}, - FunctionInfo{2011, C<&IManagerDisplayService::DestroyManagedLayer>, "DestroyManagedLayer"}, - FunctionInfo{2012, nullptr, "CreateStrayLayer"}, - FunctionInfo{2050, nullptr, "CreateIndirectLayer"}, - FunctionInfo{2051, nullptr, "DestroyIndirectLayer"}, - FunctionInfo{2052, nullptr, "CreateIndirectProducerEndPoint"}, - FunctionInfo{2053, nullptr, "DestroyIndirectProducerEndPoint"}, - FunctionInfo{2054, nullptr, "CreateIndirectConsumerEndPoint"}, - FunctionInfo{2055, nullptr, "DestroyIndirectConsumerEndPoint"}, - FunctionInfo{2060, nullptr, "CreateWatermarkCompositor"}, - FunctionInfo{2062, nullptr, "SetWatermarkText"}, - FunctionInfo{2063, nullptr, "SetWatermarkLayerStacks"}, - FunctionInfo{2300, nullptr, "AcquireLayerTexturePresentingEvent"}, - FunctionInfo{2301, nullptr, "ReleaseLayerTexturePresentingEvent"}, - FunctionInfo{2302, nullptr, "GetDisplayHotplugEvent"}, - FunctionInfo{2303, nullptr, "GetDisplayModeChangedEvent"}, - FunctionInfo{2402, nullptr, "GetDisplayHotplugState"}, - FunctionInfo{2501, nullptr, "GetCompositorErrorInfo"}, - FunctionInfo{2601, nullptr, "GetDisplayErrorEvent"}, - FunctionInfo{2701, nullptr, "GetDisplayFatalErrorEvent"}, - FunctionInfo{4201, nullptr, "SetDisplayAlpha"}, - FunctionInfo{4203, nullptr, "SetDisplayLayerStack"}, - FunctionInfo{4205, nullptr, "SetDisplayPowerState"}, - FunctionInfo{4206, nullptr, "SetDefaultDisplay"}, - FunctionInfo{4207, nullptr, "ResetDisplayPanel"}, - FunctionInfo{4208, nullptr, "SetDisplayFatalErrorEnabled"}, - FunctionInfo{4209, nullptr, "IsDisplayPanelOn"}, - FunctionInfo{4300, nullptr, "GetInternalPanelId"}, - FunctionInfo{6000, C<&IManagerDisplayService::AddToLayerStack>, "AddToLayerStack"}, - FunctionInfo{6001, nullptr, "RemoveFromLayerStack"}, - FunctionInfo{6002, C<&IManagerDisplayService::SetLayerVisibility>, "SetLayerVisibility"}, - FunctionInfo{6003, nullptr, "SetLayerConfig"}, - FunctionInfo{6004, nullptr, "AttachLayerPresentationTracer"}, - FunctionInfo{6005, nullptr, "DetachLayerPresentationTracer"}, - FunctionInfo{6006, nullptr, "StartLayerPresentationRecording"}, - FunctionInfo{6007, nullptr, "StopLayerPresentationRecording"}, - FunctionInfo{6008, nullptr, "StartLayerPresentationFenceWait"}, - FunctionInfo{6009, nullptr, "StopLayerPresentationFenceWait"}, - FunctionInfo{6010, nullptr, "GetLayerPresentationAllFencesExpiredEvent"}, - FunctionInfo{6011, nullptr, "EnableLayerAutoClearTransitionBuffer"}, - FunctionInfo{6012, nullptr, "DisableLayerAutoClearTransitionBuffer"}, - FunctionInfo{6013, nullptr, "SetLayerOpacity"}, - FunctionInfo{6014, nullptr, "AttachLayerWatermarkCompositor"}, - FunctionInfo{6015, nullptr, "DetachLayerWatermarkCompositor"}, - FunctionInfo{7000, nullptr, "SetContentVisibility"}, - FunctionInfo{8000, nullptr, "SetConductorLayer"}, - FunctionInfo{8001, nullptr, "SetTimestampTracking"}, - FunctionInfo{8100, nullptr, "SetIndirectProducerFlipOffset"}, - FunctionInfo{8200, nullptr, "CreateSharedBufferStaticStorage"}, - FunctionInfo{8201, nullptr, "CreateSharedBufferTransferMemory"}, - FunctionInfo{8202, nullptr, "DestroySharedBuffer"}, - FunctionInfo{8203, nullptr, "BindSharedLowLevelLayerToManagedLayer"}, - FunctionInfo{8204, nullptr, "BindSharedLowLevelLayerToIndirectLayer"}, - FunctionInfo{8207, nullptr, "UnbindSharedLowLevelLayer"}, - FunctionInfo{8208, nullptr, "ConnectSharedLowLevelLayerToSharedBuffer"}, - FunctionInfo{8209, nullptr, "DisconnectSharedLowLevelLayerFromSharedBuffer"}, - FunctionInfo{8210, nullptr, "CreateSharedLayer"}, - FunctionInfo{8211, nullptr, "DestroySharedLayer"}, - FunctionInfo{8216, nullptr, "AttachSharedLayerToLowLevelLayer"}, - FunctionInfo{8217, nullptr, "ForceDetachSharedLayerFromLowLevelLayer"}, - FunctionInfo{8218, nullptr, "StartDetachSharedLayerFromLowLevelLayer"}, - FunctionInfo{8219, nullptr, "FinishDetachSharedLayerFromLowLevelLayer"}, - FunctionInfo{8220, nullptr, "GetSharedLayerDetachReadyEvent"}, - FunctionInfo{8221, nullptr, "GetSharedLowLevelLayerSynchronizedEvent"}, - FunctionInfo{8222, nullptr, "CheckSharedLowLevelLayerSynchronized"}, - FunctionInfo{8223, nullptr, "RegisterSharedBufferImporterAruid"}, - FunctionInfo{8224, nullptr, "UnregisterSharedBufferImporterAruid"}, - FunctionInfo{8227, nullptr, "CreateSharedBufferProcessHeap"}, - FunctionInfo{8228, nullptr, "GetSharedLayerLayerStacks"}, - FunctionInfo{8229, nullptr, "SetSharedLayerLayerStacks"}, - FunctionInfo{8291, nullptr, "PresentDetachedSharedFrameBufferToLowLevelLayer"}, - FunctionInfo{8292, nullptr, "FillDetachedSharedFrameBufferColor"}, - FunctionInfo{8293, nullptr, "GetDetachedSharedFrameBufferImage"}, - FunctionInfo{8294, nullptr, "SetDetachedSharedFrameBufferImage"}, - FunctionInfo{8295, nullptr, "CopyDetachedSharedFrameBufferImage"}, - FunctionInfo{8296, nullptr, "SetDetachedSharedFrameBufferSubImage"}, - FunctionInfo{8297, nullptr, "GetSharedFrameBufferContentParameter"}, - FunctionInfo{8298, nullptr, "ExpandStartupLogoOnSharedFrameBuffer"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IManagerDisplayService::IManagerDisplayService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "IManagerDisplayService"}, m_container{std::move(container)} { + // clang-format off + static const FunctionInfo functions[] = { + {200, nullptr, "AllocateProcessHeapBlock"}, + {201, nullptr, "FreeProcessHeapBlock"}, + {1102, nullptr, "GetDisplayResolution"}, + {2010, C<&IManagerDisplayService::CreateManagedLayer>, "CreateManagedLayer"}, + {2011, C<&IManagerDisplayService::DestroyManagedLayer>, "DestroyManagedLayer"}, + {2012, nullptr, "CreateStrayLayer"}, + {2050, nullptr, "CreateIndirectLayer"}, + {2051, nullptr, "DestroyIndirectLayer"}, + {2052, nullptr, "CreateIndirectProducerEndPoint"}, + {2053, nullptr, "DestroyIndirectProducerEndPoint"}, + {2054, nullptr, "CreateIndirectConsumerEndPoint"}, + {2055, nullptr, "DestroyIndirectConsumerEndPoint"}, + {2060, nullptr, "CreateWatermarkCompositor"}, + {2062, nullptr, "SetWatermarkText"}, + {2063, nullptr, "SetWatermarkLayerStacks"}, + {2300, nullptr, "AcquireLayerTexturePresentingEvent"}, + {2301, nullptr, "ReleaseLayerTexturePresentingEvent"}, + {2302, nullptr, "GetDisplayHotplugEvent"}, + {2303, nullptr, "GetDisplayModeChangedEvent"}, + {2402, nullptr, "GetDisplayHotplugState"}, + {2501, nullptr, "GetCompositorErrorInfo"}, + {2601, nullptr, "GetDisplayErrorEvent"}, + {2701, nullptr, "GetDisplayFatalErrorEvent"}, + {4201, nullptr, "SetDisplayAlpha"}, + {4203, nullptr, "SetDisplayLayerStack"}, + {4205, nullptr, "SetDisplayPowerState"}, + {4206, nullptr, "SetDefaultDisplay"}, + {4207, nullptr, "ResetDisplayPanel"}, + {4208, nullptr, "SetDisplayFatalErrorEnabled"}, + {4209, nullptr, "IsDisplayPanelOn"}, + {4300, nullptr, "GetInternalPanelId"}, + {6000, C<&IManagerDisplayService::AddToLayerStack>, "AddToLayerStack"}, + {6001, nullptr, "RemoveFromLayerStack"}, + {6002, C<&IManagerDisplayService::SetLayerVisibility>, "SetLayerVisibility"}, + {6003, nullptr, "SetLayerConfig"}, + {6004, nullptr, "AttachLayerPresentationTracer"}, + {6005, nullptr, "DetachLayerPresentationTracer"}, + {6006, nullptr, "StartLayerPresentationRecording"}, + {6007, nullptr, "StopLayerPresentationRecording"}, + {6008, nullptr, "StartLayerPresentationFenceWait"}, + {6009, nullptr, "StopLayerPresentationFenceWait"}, + {6010, nullptr, "GetLayerPresentationAllFencesExpiredEvent"}, + {6011, nullptr, "EnableLayerAutoClearTransitionBuffer"}, + {6012, nullptr, "DisableLayerAutoClearTransitionBuffer"}, + {6013, nullptr, "SetLayerOpacity"}, + {6014, nullptr, "AttachLayerWatermarkCompositor"}, + {6015, nullptr, "DetachLayerWatermarkCompositor"}, + {7000, nullptr, "SetContentVisibility"}, + {8000, nullptr, "SetConductorLayer"}, + {8001, nullptr, "SetTimestampTracking"}, + {8100, nullptr, "SetIndirectProducerFlipOffset"}, + {8200, nullptr, "CreateSharedBufferStaticStorage"}, + {8201, nullptr, "CreateSharedBufferTransferMemory"}, + {8202, nullptr, "DestroySharedBuffer"}, + {8203, nullptr, "BindSharedLowLevelLayerToManagedLayer"}, + {8204, nullptr, "BindSharedLowLevelLayerToIndirectLayer"}, + {8207, nullptr, "UnbindSharedLowLevelLayer"}, + {8208, nullptr, "ConnectSharedLowLevelLayerToSharedBuffer"}, + {8209, nullptr, "DisconnectSharedLowLevelLayerFromSharedBuffer"}, + {8210, nullptr, "CreateSharedLayer"}, + {8211, nullptr, "DestroySharedLayer"}, + {8216, nullptr, "AttachSharedLayerToLowLevelLayer"}, + {8217, nullptr, "ForceDetachSharedLayerFromLowLevelLayer"}, + {8218, nullptr, "StartDetachSharedLayerFromLowLevelLayer"}, + {8219, nullptr, "FinishDetachSharedLayerFromLowLevelLayer"}, + {8220, nullptr, "GetSharedLayerDetachReadyEvent"}, + {8221, nullptr, "GetSharedLowLevelLayerSynchronizedEvent"}, + {8222, nullptr, "CheckSharedLowLevelLayerSynchronized"}, + {8223, nullptr, "RegisterSharedBufferImporterAruid"}, + {8224, nullptr, "UnregisterSharedBufferImporterAruid"}, + {8227, nullptr, "CreateSharedBufferProcessHeap"}, + {8228, nullptr, "GetSharedLayerLayerStacks"}, + {8229, nullptr, "SetSharedLayerLayerStacks"}, + {8291, nullptr, "PresentDetachedSharedFrameBufferToLowLevelLayer"}, + {8292, nullptr, "FillDetachedSharedFrameBufferColor"}, + {8293, nullptr, "GetDetachedSharedFrameBufferImage"}, + {8294, nullptr, "SetDetachedSharedFrameBufferImage"}, + {8295, nullptr, "CopyDetachedSharedFrameBufferImage"}, + {8296, nullptr, "SetDetachedSharedFrameBufferSubImage"}, + {8297, nullptr, "GetSharedFrameBufferContentParameter"}, + {8298, nullptr, "ExpandStartupLogoOnSharedFrameBuffer"}, + }; + // clang-format on + + RegisterHandlers(functions); } IManagerDisplayService::~IManagerDisplayService() = default; diff --git a/src/core/hle/service/vi/manager_display_service.h b/src/core/hle/service/vi/manager_display_service.h index 1c7a79f337..2e05e730c7 100644 --- a/src/core/hle/service/vi/manager_display_service.h +++ b/src/core/hle/service/vi/manager_display_service.h @@ -37,7 +37,6 @@ public: Result SetLayerVisibility(bool visible, u64 layer_id); private: - std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/manager_root_service.cpp b/src/core/hle/service/vi/manager_root_service.cpp index 0cc98bc2c0..094261e060 100644 --- a/src/core/hle/service/vi/manager_root_service.cpp +++ b/src/core/hle/service/vi/manager_root_service.cpp @@ -15,21 +15,18 @@ namespace Service::VI { -std::optional IManagerRootService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{2, C<&IManagerRootService::GetDisplayService>, "GetDisplayService"}, - FunctionInfo{3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, - FunctionInfo{100, nullptr, "PrepareFatal"}, - FunctionInfo{101, nullptr, "ShowFatal"}, - FunctionInfo{102, nullptr, "DrawFatalRectangle"}, - FunctionInfo{103, nullptr, "DrawFatalText32"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - IManagerRootService::IManagerRootService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "vi:m"}, m_container{std::move(container)} { + static const FunctionInfo functions[] = { + {2, C<&IManagerRootService::GetDisplayService>, "GetDisplayService"}, + {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, + {100, nullptr, "PrepareFatal"}, + {101, nullptr, "ShowFatal"}, + {102, nullptr, "DrawFatalRectangle"}, + {103, nullptr, "DrawFatalText32"}, + }; + RegisterHandlers(functions); } IManagerRootService::~IManagerRootService() = default; diff --git a/src/core/hle/service/vi/manager_root_service.h b/src/core/hle/service/vi/manager_root_service.h index 78c0d1f80d..114dc36c07 100644 --- a/src/core/hle/service/vi/manager_root_service.h +++ b/src/core/hle/service/vi/manager_root_service.h @@ -29,7 +29,6 @@ public: Policy policy); private: - std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/service_creator.cpp b/src/core/hle/service/vi/service_creator.cpp index 2b8e5f9577..34dbf7baae 100644 --- a/src/core/hle/service/vi/service_creator.cpp +++ b/src/core/hle/service/vi/service_creator.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/service_creator.h b/src/core/hle/service/vi/service_creator.h index c6ba1797dc..8b50e94af5 100644 --- a/src/core/hle/service/vi/service_creator.h +++ b/src/core/hle/service/vi/service_creator.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/shared_buffer_manager.h b/src/core/hle/service/vi/shared_buffer_manager.h index d1ce57ee27..807db10f31 100644 --- a/src/core/hle/service/vi/shared_buffer_manager.h +++ b/src/core/hle/service/vi/shared_buffer_manager.h @@ -18,10 +18,6 @@ class KPageGroup; class KReadableEvent; } // namespace Kernel -namespace Core { -class System; -} - namespace Service::android { class BufferQueueProducer; } diff --git a/src/core/hle/service/vi/system_display_service.cpp b/src/core/hle/service/vi/system_display_service.cpp index 997f0a51fc..aa225f69df 100644 --- a/src/core/hle/service/vi/system_display_service.cpp +++ b/src/core/hle/service/vi/system_display_service.cpp @@ -12,63 +12,63 @@ namespace Service::VI { -std::optional ISystemDisplayService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1200, nullptr, "GetZOrderCountMin"}, - FunctionInfo{1202, nullptr, "GetZOrderCountMax"}, - FunctionInfo{1203, nullptr, "GetDisplayLogicalResolution"}, - FunctionInfo{1204, nullptr, "SetDisplayMagnification"}, - FunctionInfo{2201, nullptr, "SetLayerPosition"}, - FunctionInfo{2203, nullptr, "SetLayerSize"}, - FunctionInfo{2204, C<&ISystemDisplayService::GetLayerZ>, "GetLayerZ"}, - FunctionInfo{2205, C<&ISystemDisplayService::SetLayerZ>, "SetLayerZ"}, - FunctionInfo{2207, C<&ISystemDisplayService::SetLayerVisibility>, "SetLayerVisibility"}, - FunctionInfo{2209, nullptr, "SetLayerAlpha"}, - FunctionInfo{2210, nullptr, "SetLayerPositionAndSize"}, - FunctionInfo{2312, nullptr, "CreateStrayLayer"}, - FunctionInfo{2400, nullptr, "OpenIndirectLayer"}, - FunctionInfo{2401, nullptr, "CloseIndirectLayer"}, - FunctionInfo{2402, nullptr, "FlipIndirectLayer"}, - FunctionInfo{3000, C<&ISystemDisplayService::ListDisplayModes>, "ListDisplayModes"}, - FunctionInfo{3001, nullptr, "ListDisplayRgbRanges"}, - FunctionInfo{3002, nullptr, "ListDisplayContentTypes"}, - FunctionInfo{3200, C<&ISystemDisplayService::GetDisplayMode>, "GetDisplayMode"}, - FunctionInfo{3201, nullptr, "SetDisplayMode"}, - FunctionInfo{3202, nullptr, "GetDisplayUnderscan"}, - FunctionInfo{3203, nullptr, "SetDisplayUnderscan"}, - FunctionInfo{3204, nullptr, "GetDisplayContentType"}, - FunctionInfo{3205, nullptr, "SetDisplayContentType"}, - FunctionInfo{3206, nullptr, "GetDisplayRgbRange"}, - FunctionInfo{3207, nullptr, "SetDisplayRgbRange"}, - FunctionInfo{3208, nullptr, "GetDisplayCmuMode"}, - FunctionInfo{3209, nullptr, "SetDisplayCmuMode"}, - FunctionInfo{3210, nullptr, "GetDisplayContrastRatio"}, - FunctionInfo{3211, nullptr, "SetDisplayContrastRatio"}, - FunctionInfo{3214, nullptr, "GetDisplayGamma"}, - FunctionInfo{3215, nullptr, "SetDisplayGamma"}, - FunctionInfo{3216, nullptr, "GetDisplayCmuLuma"}, - FunctionInfo{3217, nullptr, "SetDisplayCmuLuma"}, - FunctionInfo{3218, nullptr, "SetDisplayCrcMode"}, - FunctionInfo{6013, nullptr, "GetLayerPresentationSubmissionTimestamps"}, - FunctionInfo{8225, C<&ISystemDisplayService::GetSharedBufferMemoryHandleId>, "GetSharedBufferMemoryHandleId"}, - FunctionInfo{8250, C<&ISystemDisplayService::OpenSharedLayer>, "OpenSharedLayer"}, - FunctionInfo{8251, nullptr, "CloseSharedLayer"}, - FunctionInfo{8252, C<&ISystemDisplayService::ConnectSharedLayer>, "ConnectSharedLayer"}, - FunctionInfo{8253, nullptr, "DisconnectSharedLayer"}, - FunctionInfo{8254, C<&ISystemDisplayService::AcquireSharedFrameBuffer>, "AcquireSharedFrameBuffer"}, - FunctionInfo{8255, C<&ISystemDisplayService::PresentSharedFrameBuffer>, "PresentSharedFrameBuffer"}, - FunctionInfo{8256, C<&ISystemDisplayService::GetSharedFrameBufferAcquirableEvent>, "GetSharedFrameBufferAcquirableEvent"}, - FunctionInfo{8257, nullptr, "FillSharedFrameBufferColor"}, - FunctionInfo{8258, C<&ISystemDisplayService::CancelSharedFrameBuffer>, "CancelSharedFrameBuffer"}, - FunctionInfo{9000, nullptr, "GetDp2hdmiController"} - ); - return HandlerTableGenerateWithFind(key, functions); +ISystemDisplayService::ISystemDisplayService(Core::System& system_, + std::shared_ptr container) + : ServiceFramework{system_, "ISystemDisplayService"}, m_container{std::move(container)} { + // clang-format off + static const FunctionInfo functions[] = { + {1200, nullptr, "GetZOrderCountMin"}, + {1202, nullptr, "GetZOrderCountMax"}, + {1203, nullptr, "GetDisplayLogicalResolution"}, + {1204, nullptr, "SetDisplayMagnification"}, + {2201, nullptr, "SetLayerPosition"}, + {2203, nullptr, "SetLayerSize"}, + {2204, C<&ISystemDisplayService::GetLayerZ>, "GetLayerZ"}, + {2205, C<&ISystemDisplayService::SetLayerZ>, "SetLayerZ"}, + {2207, C<&ISystemDisplayService::SetLayerVisibility>, "SetLayerVisibility"}, + {2209, nullptr, "SetLayerAlpha"}, + {2210, nullptr, "SetLayerPositionAndSize"}, + {2312, nullptr, "CreateStrayLayer"}, + {2400, nullptr, "OpenIndirectLayer"}, + {2401, nullptr, "CloseIndirectLayer"}, + {2402, nullptr, "FlipIndirectLayer"}, + {3000, C<&ISystemDisplayService::ListDisplayModes>, "ListDisplayModes"}, + {3001, nullptr, "ListDisplayRgbRanges"}, + {3002, nullptr, "ListDisplayContentTypes"}, + {3200, C<&ISystemDisplayService::GetDisplayMode>, "GetDisplayMode"}, + {3201, nullptr, "SetDisplayMode"}, + {3202, nullptr, "GetDisplayUnderscan"}, + {3203, nullptr, "SetDisplayUnderscan"}, + {3204, nullptr, "GetDisplayContentType"}, + {3205, nullptr, "SetDisplayContentType"}, + {3206, nullptr, "GetDisplayRgbRange"}, + {3207, nullptr, "SetDisplayRgbRange"}, + {3208, nullptr, "GetDisplayCmuMode"}, + {3209, nullptr, "SetDisplayCmuMode"}, + {3210, nullptr, "GetDisplayContrastRatio"}, + {3211, nullptr, "SetDisplayContrastRatio"}, + {3214, nullptr, "GetDisplayGamma"}, + {3215, nullptr, "SetDisplayGamma"}, + {3216, nullptr, "GetDisplayCmuLuma"}, + {3217, nullptr, "SetDisplayCmuLuma"}, + {3218, nullptr, "SetDisplayCrcMode"}, + {6013, nullptr, "GetLayerPresentationSubmissionTimestamps"}, + {8225, C<&ISystemDisplayService::GetSharedBufferMemoryHandleId>, "GetSharedBufferMemoryHandleId"}, + {8250, C<&ISystemDisplayService::OpenSharedLayer>, "OpenSharedLayer"}, + {8251, nullptr, "CloseSharedLayer"}, + {8252, C<&ISystemDisplayService::ConnectSharedLayer>, "ConnectSharedLayer"}, + {8253, nullptr, "DisconnectSharedLayer"}, + {8254, C<&ISystemDisplayService::AcquireSharedFrameBuffer>, "AcquireSharedFrameBuffer"}, + {8255, C<&ISystemDisplayService::PresentSharedFrameBuffer>, "PresentSharedFrameBuffer"}, + {8256, C<&ISystemDisplayService::GetSharedFrameBufferAcquirableEvent>, "GetSharedFrameBufferAcquirableEvent"}, + {8257, nullptr, "FillSharedFrameBufferColor"}, + {8258, C<&ISystemDisplayService::CancelSharedFrameBuffer>, "CancelSharedFrameBuffer"}, + {9000, nullptr, "GetDp2hdmiController"}, + }; + // clang-format on + RegisterHandlers(functions); } -ISystemDisplayService::ISystemDisplayService(Core::System& system_, std::shared_ptr container) - : ServiceFramework{system_, "ISystemDisplayService"}, m_container{std::move(container)} -{} - ISystemDisplayService::~ISystemDisplayService() = default; Result ISystemDisplayService::GetLayerZ(Out out_z_value, u64 layer_id) { diff --git a/src/core/hle/service/vi/system_display_service.h b/src/core/hle/service/vi/system_display_service.h index 04c9f0977e..a3b88c519d 100644 --- a/src/core/hle/service/vi/system_display_service.h +++ b/src/core/hle/service/vi/system_display_service.h @@ -47,7 +47,6 @@ private: Result CancelSharedFrameBuffer(u64 layer_id, s64 slot); private: - std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/system_root_service.cpp b/src/core/hle/service/vi/system_root_service.cpp index c078be37a3..c761f136e2 100644 --- a/src/core/hle/service/vi/system_root_service.cpp +++ b/src/core/hle/service/vi/system_root_service.cpp @@ -14,17 +14,14 @@ namespace Service::VI { -std::optional ISystemRootService::FindRequest(u32 key) { - static constexpr auto functions = CreateStaticMap( - FunctionInfo{1, C<&ISystemRootService::GetDisplayService>, "GetDisplayService"}, - FunctionInfo{3, nullptr, "GetDisplayServiceWithProxyNameExchange"} - ); - return HandlerTableGenerateWithFind(key, functions); -} - ISystemRootService::ISystemRootService(Core::System& system_, std::shared_ptr container) - : ServiceFramework{system_, "vi:s"}, m_container{std::move(container)} -{} + : ServiceFramework{system_, "vi:s"}, m_container{std::move(container)} { + static const FunctionInfo functions[] = { + {1, C<&ISystemRootService::GetDisplayService>, "GetDisplayService"}, + {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, + }; + RegisterHandlers(functions); +} ISystemRootService::~ISystemRootService() = default; diff --git a/src/core/hle/service/vi/system_root_service.h b/src/core/hle/service/vi/system_root_service.h index baf516fec5..1587e0e30f 100644 --- a/src/core/hle/service/vi/system_root_service.h +++ b/src/core/hle/service/vi/system_root_service.h @@ -29,7 +29,6 @@ private: Out> out_application_display_service, Policy policy); - std::optional FindRequest(u32 key) override; const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index b388efaf6f..2ea64f5d32 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/vi.h b/src/core/hle/service/vi/vi.h index 7c1f350d84..bcc55228aa 100644 --- a/src/core/hle/service/vi/vi.h +++ b/src/core/hle/service/vi/vi.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/vi_results.h b/src/core/hle/service/vi/vi_results.h index 22bac799f0..89b7317792 100644 --- a/src/core/hle/service/vi/vi_results.h +++ b/src/core/hle/service/vi/vi_results.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/vi/vi_types.h b/src/core/hle/service/vi/vi_types.h index 95ff663582..2d4287169a 100644 --- a/src/core/hle/service/vi/vi_types.h +++ b/src/core/hle/service/vi/vi_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/wlan/wlan.cpp b/src/core/hle/service/wlan/wlan.cpp index fa68ff51ba..bcd357d57a 100644 --- a/src/core/hle/service/wlan/wlan.cpp +++ b/src/core/hle/service/wlan/wlan.cpp @@ -16,248 +16,232 @@ class ILocalManager final : public ServiceFramework { public: explicit ILocalManager(Core::System& system_) : ServiceFramework{system_, "wlan:lcl"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + { 0, nullptr, "OpenMasterMode" }, + { 0, nullptr, "OpenMode_2" }, + { 1, nullptr, "CloseMasterMode" }, + { 1, nullptr, "CloseMode_2" }, + { 2, nullptr, "OpenClientMode" }, + { 2, nullptr, "GetMacAddress_2" }, + { 3, nullptr, "CloseClientMode" }, + { 3, nullptr, "CreateBss" }, + { 4, nullptr, "OpenSpectatorMode" }, + { 4, nullptr, "DestroyBss" }, + { 5, nullptr, "CloseSpectatorMode" }, + { 5, nullptr, "StartScan_2" }, + { 6, nullptr, "GetMacAddress_2" }, + { 6, nullptr, "StopScan_2" }, + { 7, nullptr, "CreateBss" }, + { 7, nullptr, "Connect_2" }, + { 8, nullptr, "DestroyBss" }, + { 8, nullptr, "CancelConnect_2" }, + { 9, nullptr, "StartScan_2" }, + { 9, nullptr, "Join" }, + { 10, nullptr, "StopScan_2" }, + { 10, nullptr, "CancelJoin" }, + { 11, nullptr, "Connect_2" }, + { 11, nullptr, "Disconnect_2" }, + { 12, nullptr, "CancelConnect_2" }, + { 12, nullptr, "SetBeaconLostCount" }, + { 13, nullptr, "Join" }, + { 13, nullptr, "GetSystemEvent_2" }, + { 14, nullptr, "CancelJoin" }, + { 14, nullptr, "GetConnectionStatus_2" }, + { 15, nullptr, "Disconnect_2" }, + { 15, nullptr, "GetClientStatus" }, + { 16, nullptr, "SetBeaconLostCount" }, + { 16, nullptr, "GetBssIndicationEvent" }, + { 17, nullptr, "GetSystemEvent_2" }, + { 17, nullptr, "GetBssIndicationInfo" }, + { 18, nullptr, "GetConnectionStatus_2" }, + { 18, nullptr, "GetState_2" }, + { 19, nullptr, "GetClientStatus" }, + { 19, nullptr, "GetAllowedChannels" }, + { 20, nullptr, "GetBssIndicationEvent" }, + { 20, nullptr, "AddIe" }, + { 21, nullptr, "GetBssIndicationInfo" }, + { 21, nullptr, "DeleteIe" }, + { 22, nullptr, "GetState_2" }, + { 22, nullptr, "PutFrameRaw" }, + { 23, nullptr, "GetAllowedChannels" }, + { 23, nullptr, "CancelGetFrame" }, + { 24, nullptr, "AddIe" }, + { 24, nullptr, "CreateRxEntry" }, + { 25, nullptr, "DeleteIe" }, + { 25, nullptr, "DeleteRxEntry" }, + { 26, nullptr, "PutFrameRaw" }, + { 26, nullptr, "AddEthertypeToRxEntry" }, + { 27, nullptr, "CancelGetFrame" }, + { 27, nullptr, "DeleteEthertypeFromRxEntry" }, + { 28, nullptr, "CreateRxEntry" }, + { 28, nullptr, "AddMatchingDataToRxEntry" }, + { 29, nullptr, "DeleteRxEntry" }, + { 29, nullptr, "RemoveMatchingDataFromRxEntry" }, + { 30, nullptr, "AddEthertypeToRxEntry" }, + { 30, nullptr, "GetScanResult_2" }, + { 31, nullptr, "DeleteEthertypeFromRxEntry" }, + { 31, nullptr, "PutActionFrameOneShot" }, + { 32, nullptr, "AddMatchingDataToRxEntry" }, + { 32, nullptr, "SetActionFrameWithBeacon" }, + { 33, nullptr, "RemoveMatchingDataFromRxEntry" }, + { 33, nullptr, "CancelActionFrameWithBeacon" }, + { 34, nullptr, "GetScanResult_2" }, + { 34, nullptr, "CreateRxEntryForActionFrame" }, + { 35, nullptr, "PutActionFrameOneShot" }, + { 35, nullptr, "DeleteRxEntryForActionFrame" }, + { 36, nullptr, "SetActionFrameWithBeacon" }, + { 36, nullptr, "AddSubtypeToRxEntryForActionFrame" }, + { 37, nullptr, "CancelActionFrameWithBeacon" }, + { 37, nullptr, "DeleteSubtypeFromRxEntryForActionFrame" }, + { 38, nullptr, "CreateRxEntryForActionFrame" }, + { 38, nullptr, "CancelGetActionFrame" }, + { 39, nullptr, "DeleteRxEntryForActionFrame" }, + { 39, nullptr, "GetRssi_2" }, + { 40, nullptr, "AddSubtypeToRxEntryForActionFrame" }, + { 40, nullptr, "SetMaxAssociationNumber" }, + { 41, nullptr, "DeleteSubtypeFromRxEntryForActionFrame" }, + { 41, nullptr, "Cmd41" }, + { 42, nullptr, "CancelGetActionFrame" }, + { 42, nullptr, "Cmd42" }, + { 43, nullptr, "GetRssi_2" }, + { 43, nullptr, "Cmd43" }, + { 44, nullptr, "SetMaxAssociationNumber" }, + { 45, nullptr, "OpenLcsMasterMode" }, + { 46, nullptr, "CloseLcsMasterMode" }, + { 47, nullptr, "OpenLcsClientMode" }, + { 48, nullptr, "CloseLcsClientMode" }, + { 49, nullptr, "GetChannelStats" }, + { 50, nullptr, "Cmd50" }, + { 51, nullptr, "Cmd51" }, + { 52, nullptr, "Cmd52" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "OpenMasterMode"}, - FunctionInfo{0, nullptr, "OpenMode_2"}, - FunctionInfo{1, nullptr, "CloseMasterMode"}, - FunctionInfo{1, nullptr, "CloseMode_2"}, - FunctionInfo{2, nullptr, "OpenClientMode"}, - FunctionInfo{2, nullptr, "GetMacAddress_2"}, - FunctionInfo{3, nullptr, "CloseClientMode"}, - FunctionInfo{3, nullptr, "CreateBss"}, - FunctionInfo{4, nullptr, "OpenSpectatorMode"}, - FunctionInfo{4, nullptr, "DestroyBss"}, - FunctionInfo{5, nullptr, "CloseSpectatorMode"}, - FunctionInfo{5, nullptr, "StartScan_2"}, - FunctionInfo{6, nullptr, "GetMacAddress_2"}, - FunctionInfo{6, nullptr, "StopScan_2"}, - FunctionInfo{7, nullptr, "CreateBss"}, - FunctionInfo{7, nullptr, "Connect_2"}, - FunctionInfo{8, nullptr, "DestroyBss"}, - FunctionInfo{8, nullptr, "CancelConnect_2"}, - FunctionInfo{9, nullptr, "StartScan_2"}, - FunctionInfo{9, nullptr, "Join"}, - FunctionInfo{10, nullptr, "StopScan_2"}, - FunctionInfo{10, nullptr, "CancelJoin"}, - FunctionInfo{11, nullptr, "Connect_2"}, - FunctionInfo{11, nullptr, "Disconnect_2"}, - FunctionInfo{12, nullptr, "CancelConnect_2"}, - FunctionInfo{12, nullptr, "SetBeaconLostCount"}, - FunctionInfo{13, nullptr, "Join"}, - FunctionInfo{13, nullptr, "GetSystemEvent_2"}, - FunctionInfo{14, nullptr, "CancelJoin"}, - FunctionInfo{14, nullptr, "GetConnectionStatus_2"}, - FunctionInfo{15, nullptr, "Disconnect_2"}, - FunctionInfo{15, nullptr, "GetClientStatus"}, - FunctionInfo{16, nullptr, "SetBeaconLostCount"}, - FunctionInfo{16, nullptr, "GetBssIndicationEvent"}, - FunctionInfo{17, nullptr, "GetSystemEvent_2"}, - FunctionInfo{17, nullptr, "GetBssIndicationInfo"}, - FunctionInfo{18, nullptr, "GetConnectionStatus_2"}, - FunctionInfo{18, nullptr, "GetState_2"}, - FunctionInfo{19, nullptr, "GetClientStatus"}, - FunctionInfo{19, nullptr, "GetAllowedChannels"}, - FunctionInfo{20, nullptr, "GetBssIndicationEvent"}, - FunctionInfo{20, nullptr, "AddIe"}, - FunctionInfo{21, nullptr, "GetBssIndicationInfo"}, - FunctionInfo{21, nullptr, "DeleteIe"}, - FunctionInfo{22, nullptr, "GetState_2"}, - FunctionInfo{22, nullptr, "PutFrameRaw"}, - FunctionInfo{23, nullptr, "GetAllowedChannels"}, - FunctionInfo{23, nullptr, "CancelGetFrame"}, - FunctionInfo{24, nullptr, "AddIe"}, - FunctionInfo{24, nullptr, "CreateRxEntry"}, - FunctionInfo{25, nullptr, "DeleteIe"}, - FunctionInfo{25, nullptr, "DeleteRxEntry"}, - FunctionInfo{26, nullptr, "PutFrameRaw"}, - FunctionInfo{26, nullptr, "AddEthertypeToRxEntry"}, - FunctionInfo{27, nullptr, "CancelGetFrame"}, - FunctionInfo{27, nullptr, "DeleteEthertypeFromRxEntry"}, - FunctionInfo{28, nullptr, "CreateRxEntry"}, - FunctionInfo{28, nullptr, "AddMatchingDataToRxEntry"}, - FunctionInfo{29, nullptr, "DeleteRxEntry"}, - FunctionInfo{29, nullptr, "RemoveMatchingDataFromRxEntry"}, - FunctionInfo{30, nullptr, "AddEthertypeToRxEntry"}, - FunctionInfo{30, nullptr, "GetScanResult_2"}, - FunctionInfo{31, nullptr, "DeleteEthertypeFromRxEntry"}, - FunctionInfo{31, nullptr, "PutActionFrameOneShot"}, - FunctionInfo{32, nullptr, "AddMatchingDataToRxEntry"}, - FunctionInfo{32, nullptr, "SetActionFrameWithBeacon"}, - FunctionInfo{33, nullptr, "RemoveMatchingDataFromRxEntry"}, - FunctionInfo{33, nullptr, "CancelActionFrameWithBeacon"}, - FunctionInfo{34, nullptr, "GetScanResult_2"}, - FunctionInfo{34, nullptr, "CreateRxEntryForActionFrame"}, - FunctionInfo{35, nullptr, "PutActionFrameOneShot"}, - FunctionInfo{35, nullptr, "DeleteRxEntryForActionFrame"}, - FunctionInfo{36, nullptr, "SetActionFrameWithBeacon"}, - FunctionInfo{36, nullptr, "AddSubtypeToRxEntryForActionFrame"}, - FunctionInfo{37, nullptr, "CancelActionFrameWithBeacon"}, - FunctionInfo{37, nullptr, "DeleteSubtypeFromRxEntryForActionFrame"}, - FunctionInfo{38, nullptr, "CreateRxEntryForActionFrame"}, - FunctionInfo{38, nullptr, "CancelGetActionFrame"}, - FunctionInfo{39, nullptr, "DeleteRxEntryForActionFrame"}, - FunctionInfo{39, nullptr, "GetRssi_2"}, - FunctionInfo{40, nullptr, "AddSubtypeToRxEntryForActionFrame"}, - FunctionInfo{40, nullptr, "SetMaxAssociationNumber"}, - FunctionInfo{41, nullptr, "DeleteSubtypeFromRxEntryForActionFrame"}, - FunctionInfo{41, nullptr, "Cmd41"}, - FunctionInfo{42, nullptr, "CancelGetActionFrame"}, - FunctionInfo{42, nullptr, "Cmd42"}, - FunctionInfo{43, nullptr, "GetRssi_2"}, - FunctionInfo{43, nullptr, "Cmd43"}, - FunctionInfo{44, nullptr, "SetMaxAssociationNumber"}, - FunctionInfo{45, nullptr, "OpenLcsMasterMode"}, - FunctionInfo{46, nullptr, "CloseLcsMasterMode"}, - FunctionInfo{47, nullptr, "OpenLcsClientMode"}, - FunctionInfo{48, nullptr, "CloseLcsClientMode"}, - FunctionInfo{49, nullptr, "GetChannelStats"}, - FunctionInfo{50, nullptr, "Cmd50"}, - FunctionInfo{51, nullptr, "Cmd51"}, - FunctionInfo{52, nullptr, "Cmd52"} - ); }; class ILocalGetFrame final : public ServiceFramework { public: explicit ILocalGetFrame(Core::System& system_) : ServiceFramework{system_, "wlan:lg"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + { 0, nullptr, "GetFrameRaw" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetFrameRaw" } - ); }; class ILocalGetActionFrame final : public ServiceFramework { public: explicit ILocalGetActionFrame(Core::System& system_) : ServiceFramework{system_, "wlan:lga"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + { 0, nullptr, "GetActionFrame" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetActionFrame" } - ); }; class ISocketGetFrame final : public ServiceFramework { public: explicit ISocketGetFrame(Core::System& system_) : ServiceFramework{system_, "wlan:sg"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + { 0, nullptr, "GetFrameRaw" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetFrameRaw" } - ); }; class ISocketManager final : public ServiceFramework { public: explicit ISocketManager(Core::System& system_) : ServiceFramework{system_, "wlan:soc"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + { 0, nullptr, "PutFrameRaw_2" }, + { 1, nullptr, "CancelGetFrame_2" }, + { 2, nullptr, "CreateRxEntry_2" }, + { 3, nullptr, "DeleteRxEntry_2" }, + { 4, nullptr, "AddEthertypeToRxEntry_2" }, + { 5, nullptr, "DeleteEthertypeFromRxEntry_2" }, + { 6, nullptr, "GetMacAddress_3" }, + { 7, nullptr, "SwitchTsfTimerFunction" }, + { 8, nullptr, "GetDeltaTimeBetweenSystemAndTsf" }, + { 9, nullptr, "RegisterSharedMemory" }, + { 10, nullptr, "UnregisterSharedMemory" }, + { 11, nullptr, "EnableSharedMemory" }, + { 12, nullptr, "SetMulticastFilter" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "PutFrameRaw_2"}, - FunctionInfo{1, nullptr, "CancelGetFrame_2"}, - FunctionInfo{2, nullptr, "CreateRxEntry_2"}, - FunctionInfo{3, nullptr, "DeleteRxEntry_2"}, - FunctionInfo{4, nullptr, "AddEthertypeToRxEntry_2"}, - FunctionInfo{5, nullptr, "DeleteEthertypeFromRxEntry_2"}, - FunctionInfo{6, nullptr, "GetMacAddress_3"}, - FunctionInfo{7, nullptr, "SwitchTsfTimerFunction"}, - FunctionInfo{8, nullptr, "GetDeltaTimeBetweenSystemAndTsf"}, - FunctionInfo{9, nullptr, "RegisterSharedMemory"}, - FunctionInfo{10, nullptr, "UnregisterSharedMemory"}, - FunctionInfo{11, nullptr, "EnableSharedMemory"}, - FunctionInfo{12, nullptr, "SetMulticastFilter"} - ); }; class IDetectManager final : public ServiceFramework { public: explicit IDetectManager(Core::System& system_) : ServiceFramework{system_, "wlan:dtc"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + { 0, nullptr, "Cmd0" }, + { 1, nullptr, "Cmd1" }, + { 2, nullptr, "Cmd2" }, + { 3, nullptr, "Cmd3" }, + { 4, nullptr, "Cmd4" }, + { 5, nullptr, "Cmd5" }, + { 6, nullptr, "Cmd6" }, + { 7, nullptr, "Cmd7" }, + { 8, nullptr, "Cmd8" }, + { 9, nullptr, "Cmd9" }, + { 10, nullptr, "Cmd10" }, + { 11, nullptr, "Cmd11" }, + { 12, nullptr, "Cmd12" }, + { 13, nullptr, "Cmd13" }, + { 14, nullptr, "Cmd14" }, + { 15, nullptr, "Cmd15" }, + { 16, nullptr, "Cmd16" }, + { 17, nullptr, "Cmd17" }, + { 18, nullptr, "Cmd18" }, + { 19, nullptr, "Cmd19" }, + { 20, nullptr, "Cmd20" }, + { 21, nullptr, "Cmd21" }, + { 22, nullptr, "Cmd22" }, + { 23, nullptr, "Cmd23" }, + { 24, nullptr, "Cmd24" }, + { 25, nullptr, "Cmd25" }, + { 26, nullptr, "Cmd26" }, + { 27, nullptr, "Cmd27" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "Cmd0"}, - FunctionInfo{1, nullptr, "Cmd1"}, - FunctionInfo{2, nullptr, "Cmd2"}, - FunctionInfo{3, nullptr, "Cmd3"}, - FunctionInfo{4, nullptr, "Cmd4"}, - FunctionInfo{5, nullptr, "Cmd5"}, - FunctionInfo{6, nullptr, "Cmd6"}, - FunctionInfo{7, nullptr, "Cmd7"}, - FunctionInfo{8, nullptr, "Cmd8"}, - FunctionInfo{9, nullptr, "Cmd9"}, - FunctionInfo{10, nullptr, "Cmd10"}, - FunctionInfo{11, nullptr, "Cmd11"}, - FunctionInfo{12, nullptr, "Cmd12"}, - FunctionInfo{13, nullptr, "Cmd13"}, - FunctionInfo{14, nullptr, "Cmd14"}, - FunctionInfo{15, nullptr, "Cmd15"}, - FunctionInfo{16, nullptr, "Cmd16"}, - FunctionInfo{17, nullptr, "Cmd17"}, - FunctionInfo{18, nullptr, "Cmd18"}, - FunctionInfo{19, nullptr, "Cmd19"}, - FunctionInfo{20, nullptr, "Cmd20"}, - FunctionInfo{21, nullptr, "Cmd21"}, - FunctionInfo{22, nullptr, "Cmd22"}, - FunctionInfo{23, nullptr, "Cmd23"}, - FunctionInfo{24, nullptr, "Cmd24"}, - FunctionInfo{25, nullptr, "Cmd25"}, - FunctionInfo{26, nullptr, "Cmd26"}, - FunctionInfo{27, nullptr, "Cmd27"} - ); }; class IPrivateServiceCreator final : public ServiceFramework { public: explicit IPrivateServiceCreator(Core::System& system_) : ServiceFramework{system_, "wlan:p"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + { 0, nullptr, "CreateWirelessCommunicationService" }, + { 1, nullptr, "CreatePrivateWirelessCommunicationService" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateWirelessCommunicationService"}, - FunctionInfo{1, nullptr, "CreatePrivateWirelessCommunicationService"} - ); }; class ISfDriverServiceCreator final : public ServiceFramework { public: explicit ISfDriverServiceCreator(Core::System& system_) : ServiceFramework{system_, "wlan:nd"} - {} - - std::optional FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + { + static const FunctionInfo functions[] = { + { 0, nullptr, "CreateDriverService" }, + }; + RegisterHandlers(functions); } - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "CreateDriverService" } - ); }; void LoopProcess(Core::System& system) { diff --git a/tools/README.md b/tools/README.md index f6a520a69c..cde6a21464 100644 --- a/tools/README.md +++ b/tools/README.md @@ -8,7 +8,7 @@ Tools for Eden and other subprojects. When adding new scripts please use `#!/bin ## Binaries -- `maxwell-spirv`: Converts Maxwell shaders (dumped from `.ash` files) into SPIR-V code sent to stdout. +- `maxwell-spirv`: Converts Maxwell shaders (dumped from `.ash` files) into SPIR-V code (emitted into STDOUT). - `maxwell-disas`: Dumb raw Maxwell disassembler. - `maxwell-ir`: Dump generated IR of Maxwell shaders. From aaa0bcb9bf5694d62538c361b210147294a5ce3d Mon Sep 17 00:00:00 2001 From: xbzk Date: Thu, 15 Oct 2026 12:13:17 +0200 Subject: [PATCH 181/198] [patcher, ro, settings] runtime tls patch (#4492) optimization and nuke toggle (#4502) (#4523) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This is a follow up for the biomutant fix. By the time i knew it was shallow, coz i was running patchtext routine even for svc and modules, causing a routine which were needed to run 14 times to run 4000+ instead. Since some perf loss was reported in 30 sep nightly, and it caused ac3r to not boot, we had added a temp toggle, which is now being removed as optimizations + fix are in. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4523 Reviewed-by: lizzie Reviewed-by: MaranBr --- .../features/settings/model/BooleanSetting.kt | 3 +- .../settings/model/view/SettingsItem.kt | 7 --- .../settings/ui/SettingsFragmentPresenter.kt | 1 - .../app/src/main/res/values/strings.xml | 2 - src/common/settings.h | 2 - src/core/arm/nce/patcher.cpp | 42 +++++++++++++ src/core/arm/nce/patcher.h | 7 +++ src/core/hle/service/ro/ro.cpp | 62 ++++++++++++------- src/qt_common/config/shared_translation.cpp | 4 -- 9 files changed, 89 insertions(+), 41 deletions(-) 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 2f2d3823f8..0548004cf5 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 @@ -17,7 +17,6 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { USE_CUSTOM_CPU_TICKS("use_custom_cpu_ticks"), SKIP_CPU_INNER_INVALIDATION("skip_cpu_inner_invalidation"), NCE_INVALIDATION_GPU_READBACK("nce_invalidation_gpu_readback"), - NCE_RUNTIME_NRO_PATCH("nce_runtime_nro_patch"), FIX_BLOOM_EFFECTS("fix_bloom_effects"), EMULATE_BGR565("emulate_bgr565"), RESCALE_HACK("rescale_hack"), @@ -95,7 +94,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { ENABLE_QUICK_SETTINGS("enable_quick_settings"); -// external fun isFrameSkippingEnabled(): Boolean + //external fun isFrameSkippingEnabled(): Boolean external fun isFrameInterpolationEnabled(): Boolean override fun getBoolean(needsGlobal: Boolean): Boolean = diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 8346339ee4..690c746628 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -866,13 +866,6 @@ abstract class SettingsItem( descriptionId = R.string.nce_invalidation_gpu_readback_description ) ) - put( - SwitchSetting( - BooleanSetting.NCE_RUNTIME_NRO_PATCH, - titleId = R.string.nce_runtime_nro_patch, - descriptionId = R.string.nce_runtime_nro_patch_description - ) - ) put( SwitchSetting( BooleanSetting.FIX_BLOOM_EFFECTS, 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 74e1e90836..f9185e39e6 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 @@ -555,7 +555,6 @@ class SettingsFragmentPresenter( add(BooleanSetting.SKIP_CPU_INNER_INVALIDATION.key) add(BooleanSetting.NCE_INVALIDATION_GPU_READBACK.key) - add(BooleanSetting.NCE_RUNTIME_NRO_PATCH.key) add(BooleanSetting.FIX_BLOOM_EFFECTS.key) add(BooleanSetting.EMULATE_BGR565.key) add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 703a91fd02..191506c818 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -595,8 +595,6 @@ Skips certain CPU-side cache invalidations during memory updates, reducing CPU usage and improving it\'s performance. This may cause glitches or crashes on some games. GPU Readback Before NCE Invalidation Temporary. Fix Ender Magnolia (and other UE titles) crashes. May reduce performance. Improvement in progress. - Patch Runtime NROs for NCE - Temporary. Fix Biomutant boot. May impact performance. Improvement in progress. Fix Bloom Effects Reduces bloom blur in LA/EOW (Adreno A6XX - A7XX/ Turnip), removes bloom in Burnout. Warning: may cause graphical artifacts in other games. Emulate BGR565 diff --git a/src/common/settings.h b/src/common/settings.h index 2a4bf3e9e4..d1f891607b 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -641,8 +641,6 @@ struct Values { true}; SwitchableSetting nce_invalidation_gpu_readback{ linkage, false, "nce_invalidation_gpu_readback", Category::RendererHacks}; - SwitchableSetting nce_runtime_nro_patch{ - linkage, false, "nce_runtime_nro_patch", Category::RendererHacks}; SwitchableSetting async_presentation{linkage, #ifdef __ANDROID__ true, diff --git a/src/core/arm/nce/patcher.cpp b/src/core/arm/nce/patcher.cpp index 7d2041d4d2..f21d7cacdc 100644 --- a/src/core/arm/nce/patcher.cpp +++ b/src/core/arm/nce/patcher.cpp @@ -45,6 +45,23 @@ Patcher::Patcher() : c(m_patch_instructions), c_pre(m_patch_instructions_pre) { WriteLoadContext(c_pre); } +Patcher::Patcher(std::span text) : c(m_patch_instructions), c_pre(m_patch_instructions_pre) { + modules.emplace_back(); + curr_patch = &modules.back(); + const auto words = std::span{reinterpret_cast(text.data()), text.size() / sizeof(u32)}; + for (u32 i = ModuleCodeIndex; i < static_cast(words.size()); ++i) { + const uintptr_t offset = i * sizeof(u32); + if (auto mrs = MRS{words[i]}; mrs.Verify() && mrs.GetRt() != 31 && (mrs.GetSystemReg() == TpidrEl0 || mrs.GetSystemReg() == TpidrroEl0)) { + BranchToPatch(offset); + const auto src_reg = mrs.GetSystemReg() == TpidrroEl0 ? oaknut::SystemReg::TPIDRRO_EL0 : oaknut::SystemReg::TPIDR_EL0; + WriteMrsHandler(offset + sizeof(u32), oaknut::XReg{static_cast(mrs.GetRt())}, src_reg); + } else if (auto msr = MSR{words[i]}; msr.Verify() && msr.GetSystemReg() == TpidrEl0) { + BranchToPatch(offset); + WriteMsrHandler(offset + sizeof(u32), oaknut::XReg{static_cast(msr.GetRt())}); + } + } +} + Patcher::~Patcher() = default; bool Patcher::PatchText(std::span program_image, const Kernel::CodeSet::Segment& code) { @@ -182,6 +199,31 @@ bool Patcher::PatchText(std::span program_image, const Kernel::CodeSet return true; } +std::span Patcher::RelocateRuntimeTls( + s64 patch_offset, std::vector& out_patches) { + const auto& patch = modules.front(); + const auto can_branch = [](s64 offset) { + return offset % 4 == 0 && offset >= -static_cast(MaxRelativeBranch) && offset < static_cast(MaxRelativeBranch); + }; + out_patches.clear(); + out_patches.reserve(patch.m_branch_to_patch_relocations.size()); + for (const auto& rel : patch.m_branch_to_patch_relocations) { + const s64 offset = patch_offset + rel.patch_offset - static_cast(rel.module_offset); + if (!can_branch(offset)) {return {};} + u32 replacement; + oaknut::CodeGenerator rc{&replacement}; + rc.B(offset); + out_patches.push_back({rel.module_offset, replacement}); + } + for (const auto& rel : patch.m_branch_to_module_relocations) { + const s64 offset = static_cast(rel.module_offset) - patch_offset - rel.patch_offset; + if (!can_branch(offset)) {return {};} + oaknut::CodeGenerator rc{m_patch_instructions.data() + rel.patch_offset / sizeof(u32)}; + rc.B(offset); + } + return m_patch_instructions; +} + bool Patcher::RelocateAndCopy(Common::ProcessAddress load_base, const Kernel::CodeSet::Segment& code, std::vector& program_image, EntryTrampolines* out_trampolines) { const size_t patch_size = GetSectionSize(); const size_t pre_patch_size = GetPreSectionSize(); diff --git a/src/core/arm/nce/patcher.h b/src/core/arm/nce/patcher.h index a3b314000c..695161cd18 100644 --- a/src/core/arm/nce/patcher.h +++ b/src/core/arm/nce/patcher.h @@ -48,15 +48,22 @@ using ModuleTextAddress = u64; using PatchTextAddress = u64; using EntryTrampolines = ::Common::unordered_map; +struct InstructionPatch { + u64 offset; + u32 replacement; +}; + class Patcher { public: void SetModuleID(const ModuleID& id) { module_id = id; } explicit Patcher(); + explicit Patcher(std::span text); ~Patcher(); bool PatchText(std::span program_image, const Kernel::CodeSet::Segment& code); bool RelocateAndCopy(Common::ProcessAddress load_base, const Kernel::CodeSet::Segment& code, std::vector& program_image, EntryTrampolines* out_trampolines); + std::span RelocateRuntimeTls(s64 patch_offset, std::vector& out_patches); size_t GetSectionSize() const noexcept; size_t GetPreSectionSize() const noexcept; diff --git a/src/core/hle/service/ro/ro.cpp b/src/core/hle/service/ro/ro.cpp index 167bf04c9a..335efa3ad3 100644 --- a/src/core/hle/service/ro/ro.cpp +++ b/src/core/hle/service/ro/ro.cpp @@ -7,6 +7,7 @@ #include #include +#include "common/scope_exit.h" #include "core/hle/kernel/k_process.h" #include "core/hle/service/cmif_serialization.h" @@ -425,36 +426,51 @@ public: R_TRY(context->ValidateNro(std::addressof(nro_info->module_id), std::addressof(rx_size), std::addressof(ro_size), std::addressof(rw_size), nro_info->base_address, nro_size, bss_size)); + R_TRY(SetNroPerms(context->GetProcess(), nro_info->base_address, rx_size, ro_size, rw_size + bss_size)); #ifdef HAS_NCE - if (Settings::values.nce_runtime_nro_patch.GetValue()) { - if (Settings::IsNceEnabled()) { - auto* process = context->GetProcess(); - auto& memory = process->GetMemory(); - - std::vector image(total_size); - memory.ReadBlock(nro_info->base_address, image.data(), rx_size); - - Kernel::CodeSet::Segment code{.size = static_cast(rx_size)}; - Core::NCE::Patcher patch; - patch.PatchText(image, code); - patch.RelocateAndCopy(nro_info->base_address, code, image, nullptr); - - const u64 patch_address = nro_info->base_address + total_size; - const size_t patch_size = patch.GetSectionSize(); + if (Settings::IsNceEnabled()) { + auto* process = context->GetProcess(); + auto& memory = process->GetMemory(); + std::vector text(rx_size); + memory.ReadBlock(nro_info->base_address, text.data(), text.size()); + Core::NCE::Patcher patch{text}; + const size_t patch_size = patch.GetSectionSize(); + if (patch_size != 0) { constexpr auto permission = Kernel::Svc::MemoryPermission::ReadExecute; - auto* patch_memory = Kernel::KSharedMemory::Create(kernel); + SCOPE_EXIT { patch_memory->Close(kernel); }; R_TRY(patch_memory->Initialize(kernel, kernel.System().DeviceMemory(), process, permission, permission, patch_size)); - std::memcpy(patch_memory->GetPointer(), image.data() + total_size, patch_size); - R_TRY(process->AddSharedMemory(kernel, patch_memory, patch_address, patch_size)); - R_TRY(patch_memory->Map(*process, patch_address, patch_size, permission)); - memory.WriteBlock(nro_info->base_address, image.data(), rx_size); + Kernel::KSharedMemory::Register(kernel, patch_memory); + const std::array offsets{static_cast(total_size + Kernel::PageSize),-static_cast(patch_size + Kernel::PageSize)}; + std::vector tls_patches; + std::span instructions; + u64 patch_address = 0; + for (const s64 offset : offsets) { + instructions = patch.RelocateRuntimeTls(offset, tls_patches); + if (instructions.empty()) {continue;} + const u64 address = static_cast(static_cast(nro_info->base_address) + offset); + if (R_FAILED(patch_memory->Map(*process, address, patch_size, permission))) {continue;} + patch_address = address; + break; + } + R_UNLESS(patch_address != 0, RO::ResultOutOfAddressSpace); + const Result add_shared_memory_result = process->AddSharedMemory(kernel, patch_memory, patch_address, patch_size); + if (R_FAILED(add_shared_memory_result)) { + R_ASSERT(patch_memory->Unmap(*process, patch_address, patch_size)); + } + R_TRY(add_shared_memory_result); + std::memcpy(patch_memory->GetPointer(), instructions.data(), instructions.size_bytes()); + auto* ptr = reinterpret_cast(patch_address); + __builtin___clear_cache(ptr, ptr + instructions.size_bytes()); + for (const auto& instruction : tls_patches) { + const u64 address = nro_info->base_address + instruction.offset; + memory.Write32(address, instruction.replacement); + ptr = reinterpret_cast(address); + __builtin___clear_cache(ptr, ptr + sizeof(u32)); + } } } #endif - // Set NRO perms. - R_TRY(SetNroPerms(context->GetProcess(), nro_info->base_address, rx_size, ro_size, - rw_size + bss_size)); context->SetNroInfoInUse(nro_info, true); nro_info->code_size = rx_size + ro_size; diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 964a4cdad4..09e64b98f0 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -198,10 +198,6 @@ std::unique_ptr InitializeTranslations(QObject* parent) { tr("GPU Readback Before NCE Invalidation"), tr("Flushes GPU buffer data back to guest memory before NCE invalidates the whole " "guest page, preserving it while the CPU store proceeds.")); - INSERT(Settings, nce_runtime_nro_patch, - tr("Patch Runtime NROs for NCE"), - tr("Applies NCE code patches to runtime-loaded NRO modules." - "This is required for some games to run correctly.")); INSERT(Settings, vsync_mode, tr("VSync Mode:"), tr("FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen " "refresh rate.\nFIFO Relaxed allows tearing as it recovers from a slow down.\n" From d8c6c59b679867d2595fdc0953df033475e23380 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Fri, 16 Oct 2026 01:17:53 +0200 Subject: [PATCH 182/198] Fix Check Strings after 4523 (#4534) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4534 --- src/android/app/src/main/res/values-ar/strings.xml | 2 -- src/android/app/src/main/res/values-zh-rTW/strings.xml | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/android/app/src/main/res/values-ar/strings.xml b/src/android/app/src/main/res/values-ar/strings.xml index 09722b486e..2fdff9847b 100644 --- a/src/android/app/src/main/res/values-ar/strings.xml +++ b/src/android/app/src/main/res/values-ar/strings.xml @@ -589,8 +589,6 @@ يتخطى بعض عمليات إبطال ذاكرة التخزين المؤقتة من جانب وحدة المعالجة المركزية أثناء تحديثات الذاكرة، مما يقلل من استخدام وحدة المعالجة المركزية ويحسن أداءها. قد يتسبب ذلك في حدوث أعطال أو تعطل في بعض الألعاب. إعادة قراءة وحدة معالجة الرسومات قبل إبطال صلاحية NCE إصلاح مؤقت. يعالج مشكلة تعطل لعبة Ender Magnolia (وغيرها من ألعاب UE). قد يؤدي إلى انخفاض في الأداء. يجري العمل على تحسينه. - تصحيح حالات NRO في وقت التشغيل لـ NCE - حل مؤقت. إصلاح مشكلة تشغيل لعبة Biomutant. قد يؤثر ذلك على الأداء. يجري العمل على تحسينه. إصلاح تأثيرات التوهج يقلل من ضبابية التوهج في LA/EOW (Adreno A6XX - A7XX/ Turnip)، ويزيل التوهج في Burnout. تحذير: قد يسبب تشوهات رسومية في ألعاب أخرى. محاكاة BGR565 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 index 3f3272daf4..3f0c6d9215 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -579,8 +579,6 @@ 在記憶體更新期間跳過某些 CPU 端快取的失效處理,減少 CPU 使用率並提高其性能。可能會導致某些遊戲出現故障或當機 在 NCE 無效化前進行 GPU 回讀 (暫時性功能)修復 \"終結者瑪格諾莉亞:霧中綻放\" 及其它使用虛幻引擎之遊戲中的當機問題,可能會降低效能。此功能正在改善中 - 對 NCE Runtime 的 NRO 檔案進行修補 - (暫時性功能)修復 \"Biomutant\" 的啟動問題,可能會對效能造成影響。此功能正在改善中 修正光暈特效 在 \"薩爾達傳說:織夢島\" 和 \"薩爾達傳說:智慧的再現\" 中減少光暈模糊的問題並移除 \"橫衝直撞:狂飆樂園重製版\" 中的光暈效果(適用於 Adreno A6XX - A7XX/ Turnip)。警告:可能會在其它遊戲中導致圖形異常 模擬 BGR565 @@ -1197,4 +1195,4 @@ 授權 來自 AMD 的升級圖像品質 - + \ No newline at end of file From e0d47f2790e3f758fa2188926a0bb2f56af6b310 Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 16 Oct 2026 21:41:11 +0200 Subject: [PATCH 183/198] [cmake] fix macOS compilation by forcing lz4 to be static (#4540) Signed-off-by: crueter - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4540 --- CMakeModules/find/Findlz4.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeModules/find/Findlz4.cmake b/CMakeModules/find/Findlz4.cmake index d4f2153162..77ac390160 100644 --- a/CMakeModules/find/Findlz4.cmake +++ b/CMakeModules/find/Findlz4.cmake @@ -24,7 +24,7 @@ else() endif() if (lz4_FOUND AND NOT TARGET lz4::lz4) - if (TARGET LZ4::lz4_shared) + if (TARGET LZ4::lz4_shared AND NOT YUZU_STATIC_BUILD) add_library(lz4::lz4 ALIAS LZ4::lz4_shared) elseif (TARGET LZ4::lz4_static) add_library(lz4::lz4 ALIAS LZ4::lz4_static) From de7e6e01d43e8cf2ec193d74fa053b0d7949955f Mon Sep 17 00:00:00 2001 From: John Date: Sun, 18 Oct 2026 00:17:28 +0200 Subject: [PATCH 184/198] Revert [input_common/joycon] Enumerate SDL devices iff SDL signals change (#4486) (#4545) Due to causing the platform windows to crash when a controller is activated. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Co-authored-by: Your Name Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4545 Reviewed-by: lizzie Reviewed-by: Maufeat --- src/input_common/drivers/joycon.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/input_common/drivers/joycon.cpp b/src/input_common/drivers/joycon.cpp index 047e7eb6d8..ded92d3f1d 100644 --- a/src/input_common/drivers/joycon.cpp +++ b/src/input_common/drivers/joycon.cpp @@ -83,21 +83,20 @@ void Joycons::ScanThread(std::stop_token stop_token) { constexpr u16 nintendo_vendor_id = 0x057e; Common::SetCurrentThreadName("JoyconScanThread"); - auto last_ret = 0u; do { - auto ret = SDL_hid_device_change_count(); - if (last_ret == 0u || last_ret != ret) { - last_ret = ret; - SDL_hid_device_info* devs = SDL_hid_enumerate(nintendo_vendor_id, 0x0); - for (auto* cur_dev = devs; cur_dev; cur_dev = cur_dev->next) { - if (IsDeviceNew(cur_dev)) { - LOG_DEBUG(Input, "Device Found,type : {:04X} {:04X}", cur_dev->vendor_id, cur_dev->product_id); - RegisterNewDevice(cur_dev); - } - cur_dev = cur_dev->next; + SDL_hid_device_info* devs = SDL_hid_enumerate(nintendo_vendor_id, 0x0); + SDL_hid_device_info* cur_dev = devs; + + while (cur_dev) { + if (IsDeviceNew(cur_dev)) { + LOG_DEBUG(Input, "Device Found,type : {:04X} {:04X}", cur_dev->vendor_id, + cur_dev->product_id); + RegisterNewDevice(cur_dev); } - SDL_hid_free_enumeration(devs); + cur_dev = cur_dev->next; } + + SDL_hid_free_enumeration(devs); } while (Common::StoppableTimedWait(stop_token, std::chrono::seconds{5})); } From 989768aa46720e3fcab9e2111e3ddd70819c382b Mon Sep 17 00:00:00 2001 From: John Date: Mon, 19 Oct 2026 15:58:04 +0200 Subject: [PATCH 185/198] Fix [core, gpu, threads] Multithreading refactor (#4254) (#4548) Performance loss regression fixed in Link's Awakening, Castlevania, Super Mario RPG, etc Tested by Mr. Knobs on Android and myself on Linux Multicore ON may be fixed for some users using Intel CPUs. Games include: FF Tactics, Shredder's Revenge, Unity Engine Games. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4548 Reviewed-by: Maufeat Reviewed-by: lizzie --- .../service/nvnflinger/hardware_composer.cpp | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/nvnflinger/hardware_composer.cpp b/src/core/hle/service/nvnflinger/hardware_composer.cpp index 5decb791e1..9ac56e17bb 100644 --- a/src/core/hle/service/nvnflinger/hardware_composer.cpp +++ b/src/core/hle/service/nvnflinger/hardware_composer.cpp @@ -57,8 +57,21 @@ u32 HardwareComposer::ComposeLocked(f32* out_speed_scale, Display& display, // Set default speed limit to 100%. *out_speed_scale = 1.0f; + // If no layers are visible, skip the logic. Acquiring and holding buffers here would + // consume the producer's queue without ever presenting. + bool any_visible = false; + for (auto& layer : display.stack.layers) { + if (layer->visible) { + any_visible = true; + break; + } + } + if (!any_visible) { + return 1; + } + + // Wait for the previous composite, bounding the number of in-flight composites. nvdisp.WaitForComposite(); - this->ReleaseFramebuffersLocked(display); // Determine the number of vsync periods to wait before composing again. std::optional swap_interval{}; @@ -152,6 +165,13 @@ u32 HardwareComposer::ComposeLocked(f32* out_speed_scale, Display& display, // Advance by 1 frame (60 FPS compositing) m_frame_number += 1; + // Release framebuffers once the frame has been handed to the compositor. This happens + // within the same vsync period as the acquire (release_frame_number is checked against + // the advanced counter), so the producer gets its buffers back immediately instead of + // losing a queue slot for a whole frame. + // TODO: support release fences; releasing before the composite has finished can tear. + this->ReleaseFramebuffersLocked(display); + return 1; } From 305f40100d76ec57b13c2f03eafd490db83691cb Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Sun, 25 Oct 2026 10:03:16 +0100 Subject: [PATCH 186/198] Fix aarch and android builds (#4576) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- credit: John and Crueter Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4576 Reviewed-by: crueter --- src/android/app/build.gradle.kts | 2 +- src/core/arm/nce/arm_nce_asm_definitions.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index 3ae6d73994..69dd6a8e4f 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -259,7 +259,7 @@ android { externalNativeBuild { cmake { - version = "3.31.6" + version = "3.31.5" path = file("${edenDir}/CMakeLists.txt") } } diff --git a/src/core/arm/nce/arm_nce_asm_definitions.h b/src/core/arm/nce/arm_nce_asm_definitions.h index 8ea4383f73..ec6abd62d2 100644 --- a/src/core/arm/nce/arm_nce_asm_definitions.h +++ b/src/core/arm/nce/arm_nce_asm_definitions.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project */ /* SPDX-License-Identifier: GPL-2.0-or-later */ @@ -5,9 +8,22 @@ #define __ASSEMBLY__ +// Newer Linux UAPI headers check __ASSEMBLER__ instead of __ASSEMBLY__ to hide C declarations. +// Without it, asm-generic/signal.h redeclares sigset_t and clashes with glibc's. Only define it +// around these includes, since glibc headers also look at __ASSEMBLER__. +#ifndef __ASSEMBLER__ +#define __ASSEMBLER__ +#define EDEN_NCE_UNDEF_ASSEMBLER +#endif + #include #include +#ifdef EDEN_NCE_UNDEF_ASSEMBLER +#undef __ASSEMBLER__ +#undef EDEN_NCE_UNDEF_ASSEMBLER +#endif + #define ReturnToRunCodeByExceptionLevelChangeSignal SIGUSR2 #define BreakFromRunCodeSignal SIGURG #define GuestAccessFaultSignal SIGSEGV From eb88a40a8eb0fe847281ea6913fcc7ff7daedcd2 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Sun, 25 Oct 2026 16:06:46 +0100 Subject: [PATCH 187/198] [qt] fix graphics API toggle getting stuck on OpenGL_GLSL (#4577) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4577 Reviewed-by: crueter Reviewed-by: CamilleLaVey --- src/yuzu/main_window.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/yuzu/main_window.cpp b/src/yuzu/main_window.cpp index 60bfbae5cd..6e21265f9e 100644 --- a/src/yuzu/main_window.cpp +++ b/src/yuzu/main_window.cpp @@ -3661,12 +3661,12 @@ void MainWindow::OnToggleGraphicsAPI() { api = Settings::RendererBackend::OpenGL_GLSL; break; case Settings::RendererBackend::OpenGL_GLSL: - api = Settings::RendererBackend::OpenGL_GLSL; - break; - case Settings::RendererBackend::OpenGL_SPIRV: api = Settings::RendererBackend::OpenGL_GLASM; break; case Settings::RendererBackend::OpenGL_GLASM: + api = Settings::RendererBackend::OpenGL_SPIRV; + break; + case Settings::RendererBackend::OpenGL_SPIRV: api = Settings::RendererBackend::Null; break; #else From 05f36d990ce5301b310871451201a72e4c52b4df Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Mon, 26 Oct 2026 16:23:23 +0100 Subject: [PATCH 188/198] [chore] re-add out/ to .gitignore (#4578) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4578 Reviewed-by: crueter Reviewed-by: CamilleLaVey --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 20ed5e93c1..873b99bec2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # Build directory /[Bb]uild*/ doc-build/ +out/ AppDir/ uruntime From 58968bd1274d8ebb1f159ad31500dde8d74abea6 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Mon, 26 Oct 2026 17:23:18 +0100 Subject: [PATCH 189/198] [core] Support block-compressed NSZ and XCZ (#4552) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- - Add NCZBLOCK (nsz -B / .xcz) reader: each read decodes only the covered blocks and re-encrypts CTR sections, no disk output. - Allow installing solid .nsz to NAND via DecompressNCZForInstall (lazy, incremental decode with frontier, O(n) instead of O(n^2)). - Accept BKTR updates with thousands of sections (MaxSectionCount = 0x10000). - Wire .nsz/.xcz into loader, registered cache, scanner, and NAND install (content_manager.h), and reject solid NCZ from the game list. - Bump the pinned zstd to 33618c8 in cpmfile.json, which includes the upstream AArch64 revert ([33618c89](https://github.com/facebook/zstd/commit/33618c89e511637f8a6ef955b3501766d71feb53)) for a ZSTD_decodeSequence branch optimization that could corrupt data on ARM64; without it, solid NCZ decoding on Android fails with "Data corruption detected". NCZ format and CTR counter semantics follow the reference nsz tool and its Rust port: - https://github.com/nicoboss/nsz (Decompressor.py, BlockDecompressorReader.py) - https://docs.rs/nsz-rs/0.3.0/src/nsz_rs/decompress.rs.html The last-block edge case (decompressed size is an exact multiple of block size) is handled as described in https://github.com/nicoboss/nsz/issues/210 Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4552 Reviewed-by: CamilleLaVey Reviewed-by: Shinmegumi --- cpmfile.json | 4 +- .../main/java/org/yuzu/yuzu_emu/model/Game.kt | 2 +- .../org/yuzu/yuzu_emu/utils/GameHelper.kt | 2 +- .../app/src/main/jni/game_metadata.cpp | 4 +- src/common/zstd_compression.cpp | 9 + src/common/zstd_compression.h | 14 + src/core/CMakeLists.txt | 2 + src/core/crypto/ncz_decompressor.cpp | 430 ++++++++++++++++++ src/core/crypto/ncz_decompressor.h | 35 ++ src/core/file_sys/registered_cache.cpp | 46 +- src/core/file_sys/submission_package.cpp | 12 + src/core/loader/loader.cpp | 48 +- src/core/loader/loader.h | 2 + src/core/loader/nsp.cpp | 11 + src/frontend_common/content_manager.h | 6 +- src/qt_common/game_list/worker.cpp | 10 +- src/qt_common/qt_common.cpp | 3 +- src/yuzu/main_window.cpp | 11 +- 18 files changed, 624 insertions(+), 27 deletions(-) create mode 100644 src/core/crypto/ncz_decompressor.cpp create mode 100644 src/core/crypto/ncz_decompressor.h diff --git a/cpmfile.json b/cpmfile.json index 9cac812b7a..0032734712 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -351,13 +351,13 @@ }, "zstd": { "find_args": "MODULE", - "hash": "cc5ad4b119a9c2ea57f0b71eeff01113bb506e0d17000159c5409cb8236d22e38c52d5e9e97e7947a4bf1b2dfc44b6c503ab2d9aedbd59458435c6a2849cb029", + "hash": "2b006c3c110c38bd2f5896b42d36a38931c8eae261f30552f9a9fd04458d218d8f1a1425f117fd12af545ed77042e4b2d1a1a9b6286c4d0b9d74ef79f20a8f08", "min_version": "1.5", "options": [ "ZSTD_BUILD_SHARED OFF" ], "repo": "facebook/zstd", "source_subdir": "build/cmake", - "version": "b8d6101fba" + "version": "33618c8" } } 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 6717894c93..f5f0cda0e9 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 @@ -100,7 +100,7 @@ class Game( companion object { val extensions: Set = HashSet( - listOf("xci", "nsp", "nca", "nro") + listOf("xci", "nsp", "nca", "nro", "nsz", "xcz") ) } } 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 411b764e36..bb2337a310 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 @@ -109,7 +109,7 @@ object GameHelper { // File extensions considered as external content, buuut should // be done better imo. - private val externalContentExtensions = setOf("nsp", "xci") + private val externalContentExtensions = setOf("nsp", "xci", "nsz", "xcz") private fun scanContentContainersRecursive( files: Array, diff --git a/src/android/app/src/main/jni/game_metadata.cpp b/src/android/app/src/main/jni/game_metadata.cpp index 49d92bca75..9b6cd44e9f 100644 --- a/src/android/app/src/main/jni/game_metadata.cpp +++ b/src/android/app/src/main/jni/game_metadata.cpp @@ -76,7 +76,9 @@ jboolean Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIsValid(JNIEnv* env, jobj auto const file_type = loader->GetFileType(); if (file_type == Loader::FileType::Unknown || file_type == Loader::FileType::Error) return false; - if ((file_type == Loader::FileType::NSP || file_type == Loader::FileType::XCI) && !Loader::IsBootableGameContainer(file, file_type)) + if ((file_type == Loader::FileType::NSP || file_type == Loader::FileType::XCI || + file_type == Loader::FileType::NSZ || file_type == Loader::FileType::XCZ) && + !Loader::IsBootableGameContainer(file, file_type)) return false; u64 program_id = 0; return loader->ReadProgramId(program_id) == Loader::ResultStatus::Success; diff --git a/src/common/zstd_compression.cpp b/src/common/zstd_compression.cpp index cb6ec171b5..7665482ee6 100644 --- a/src/common/zstd_compression.cpp +++ b/src/common/zstd_compression.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -46,4 +49,10 @@ std::vector DecompressDataZSTD(std::span compressed) { return decompressed; } +std::size_t DecompressDataZSTD(std::span compressed, std::span output) { + const std::size_t result = + ZSTD_decompress(output.data(), output.size(), compressed.data(), compressed.size()); + return ZSTD_isError(result) ? 0 : result; +} + } // namespace Common::Compression diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h index a5ab2d05bd..819d7d201a 100644 --- a/src/common/zstd_compression.h +++ b/src/common/zstd_compression.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -42,4 +45,15 @@ namespace Common::Compression { */ [[nodiscard]] std::vector DecompressDataZSTD(std::span compressed); +/** + * Decompresses a single Zstandard frame into a caller-provided buffer of known size. + * + * @param compressed the compressed source memory region. + * @param output the destination buffer. Its size is the maximum number of bytes to write. + * + * @return the number of bytes written, or 0 if the frame is invalid or doesn't fit. An empty + * frame also returns 0. + */ +[[nodiscard]] std::size_t DecompressDataZSTD(std::span compressed, std::span output); + } // namespace Common::Compression diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 31f9931d3a..1b578f67ba 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -33,6 +33,8 @@ add_library(core STATIC crypto/encryption_layer.h crypto/key_manager.cpp crypto/key_manager.h + crypto/ncz_decompressor.cpp + crypto/ncz_decompressor.h crypto/partition_data_manager.cpp crypto/partition_data_manager.h crypto/xts_encryption_layer.cpp diff --git a/src/core/crypto/ncz_decompressor.cpp b/src/core/crypto/ncz_decompressor.cpp new file mode 100644 index 0000000000..5f56e55375 --- /dev/null +++ b/src/core/crypto/ncz_decompressor.cpp @@ -0,0 +1,430 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "common/common_types.h" +#include "common/logging.h" +#include "common/zstd_compression.h" +#include "core/crypto/aes_util.h" +#include "core/crypto/key_manager.h" +#include "core/crypto/ncz_decompressor.h" +#include "core/file_sys/vfs/vfs.h" + +namespace Core::Crypto { + +namespace { + +constexpr u64 HeaderSize = 0x4000; +constexpr std::size_t SectionWire = 0x40; +constexpr std::size_t BlockFixed = 0x18; +constexpr std::size_t Chunk = 0x100000; +// Upper bound on NCZ section entries (64 bytes each, so the table is at most 4 MiB). A base NCA +// has a handful of sections, but nsz stores an update's patch (BKTR) data one entry per +// subsection, which is thousands of them. +constexpr u64 MaxSectionCount = 0x10000; +constexpr std::array SectionsMagic{'N', 'C', 'Z', 'S', 'E', 'C', 'T', 'N'}; +constexpr std::array BlockMagic{'N', 'C', 'Z', 'B', 'L', 'O', 'C', 'K'}; + +struct Section { + s64 offset, size; + u64 crypto_type; + Key128 key, counter; + bool Ctr() const { return crypto_type == 3 || crypto_type == 4; } +}; + +struct BlockHeader { + u32 exponent; + u64 decompressed_size; + std::vector sizes; +}; + +u64 Le(const u8* p, std::size_t n) { + u64 v = 0; + for (std::size_t i = n; i-- > 0;) v = (v << 8) | p[i]; + return v; +} + +// Mirrors nsz AESCTR.seek(): upper 8 bytes = stored counter, lower 8 = absolute NCA offset / 16. +void SetIv(Key128& iv, const Key128& base, u64 off) { + iv = base; + u64 blk = off >> 4; + for (std::size_t i = 0; i < 8; ++i) { iv[15 - i] = static_cast(blk & 0xFF); blk >>= 8; } +} + +// Parse header + section table + optional block header. Returns payload_start. +std::optional, std::optional>> ParseHeader( + const FileSys::VirtualFile& f, u64& payload_start) { + const u64 fsize = f->GetSize(); + if (fsize < HeaderSize + 16) return std::nullopt; + + const auto head = f->ReadBytes(16, HeaderSize); + if (head.size() != 16 || !std::equal(head.begin(), head.begin() + 8, SectionsMagic.begin())) + return std::nullopt; + const u64 count = Le(head.data() + 8, 8); + if (count == 0 || count > MaxSectionCount || count * SectionWire > fsize - HeaderSize - 16) + return std::nullopt; + + const auto table = f->ReadBytes(count * SectionWire, HeaderSize + 16); + if (table.size() != count * SectionWire) return std::nullopt; + + std::vector
sections; + sections.reserve(count + 1); + for (u64 i = 0; i < count; ++i) { + const u8* e = table.data() + i * SectionWire; + Section s{}; + s.offset = static_cast(Le(e, 8)); + s.size = static_cast(Le(e + 8, 8)); + s.crypto_type = Le(e + 16, 8); + std::memcpy(s.key.data(), e + 32, 16); + std::memcpy(s.counter.data(), e + 48, 16); + sections.push_back(s); + } + + const u64 block_start = HeaderSize + 16 + count * SectionWire; + const auto fixed = f->ReadBytes(BlockFixed, block_start); + std::optional bh; + if (fixed.size() == BlockFixed && + std::equal(fixed.begin(), fixed.begin() + 8, BlockMagic.begin())) { + BlockHeader b{}; + b.exponent = fixed[11]; + const s32 n = static_cast(Le(fixed.data() + 12, 4)); + if (n <= 0) return std::nullopt; + b.decompressed_size = Le(fixed.data() + 16, 8); + const auto sizes = f->ReadBytes(static_cast(n) * 4, block_start + BlockFixed); + if (sizes.size() != static_cast(n) * 4) return std::nullopt; + b.sizes.resize(n); + for (s32 i = 0; i < n; ++i) b.sizes[i] = static_cast(Le(sizes.data() + i * 4, 4)); + payload_start = block_start + BlockFixed + static_cast(n) * 4; + bh = std::move(b); + } else { + payload_start = block_start; + } + + if (!sections.empty() && sections[0].offset > static_cast(HeaderSize)) { + Section fake{}; + fake.offset = static_cast(HeaderSize); + fake.size = sections[0].offset - static_cast(HeaderSize); + sections.insert(sections.begin(), fake); + } + return std::make_pair(std::move(sections), std::move(bh)); +} + +// Sequential reader over independently-compressed blocks, one block cached (like nsz_rs). +class BlockReader { +public: + BlockReader(FileSys::VirtualFile f, const BlockHeader& bh, u64 payload_start) + : source{std::move(f)}, block_size{1ULL << bh.exponent}, sizes{bh.sizes}, + decompressed_size{bh.decompressed_size} { + if (bh.exponent < 14 || bh.exponent > 32 || sizes.empty()) + throw std::runtime_error("bad NCZBLOCK header"); + u64 off = payload_start; + offsets.reserve(sizes.size()); + for (u32 s : sizes) { offsets.push_back(off); off += s; } + } + + // Fills `out` from `position`; returns bytes written. + std::size_t ReadAt(u64 position, std::span out) { + std::size_t done = 0; + while (done < out.size() && position < decompressed_size) { + const u64 id = position / block_size; + if (id >= sizes.size()) break; + if (cache_id != id && !Load(id)) break; + const u64 in = position - id * block_size; + const std::size_t n = static_cast( + std::min(out.size() - done, cache.size() - in)); + std::memcpy(out.data() + done, cache.data() + in, n); + done += n; + position += n; + } + return done; + } + +private: + bool Load(u64 id) { + u64 want = block_size; + if (id + 1 == sizes.size()) { + const u64 rem = decompressed_size % block_size; + if (rem > 0) want = rem; // avoid the 0-size bug from the original nsz + } + try { cache.resize(static_cast(want)); } + catch (const std::bad_alloc&) { return false; } + const u32 csize = sizes[id]; + if (csize < want) { + const auto comp = source->ReadBytes(csize, offsets[id]); + if (comp.size() != csize || + Common::Compression::DecompressDataZSTD(comp, cache) != want) return false; + } else if (source->Read(cache.data(), cache.size(), offsets[id]) != cache.size()) { + return false; + } + cache_id = id; + return true; + } + + FileSys::VirtualFile source; + u64 block_size; + std::vector offsets; + std::vector sizes; + u64 decompressed_size; + u64 cache_id = ~0ULL; + std::vector cache; +}; + +class BlockNczFile final : public FileSys::VfsFile { +public: + BlockNczFile(std::string name_, std::vector hdr_, std::vector
sections_, + std::unique_ptr body_) + : name{std::move(name_)}, hdr{std::move(hdr_)}, sections{std::move(sections_)}, + body{std::move(body_)} { + nca_size = HeaderSize; + for (const auto& s : sections) + nca_size = std::max(nca_size, static_cast(s.offset + s.size)); + ciphers.reserve(sections.size()); + for (const auto& s : sections) + ciphers.push_back(s.Ctr() ? std::make_unique>(s.key, Mode::CTR) + : nullptr); + } + + std::string GetName() const override { return name; } + std::size_t GetSize() const override { return static_cast(nca_size); } + bool Resize(std::size_t) override { return false; } + FileSys::VirtualDir GetContainingDirectory() const override { return nullptr; } + bool IsWritable() const override { return false; } + bool IsReadable() const override { return true; } + + std::size_t Read(u8* data, std::size_t len, std::size_t off) const override { + if (off >= nca_size) return 0; + len = static_cast(std::min(len, nca_size - off)); + const u64 end = off + len; + u64 pos = off; + if (pos < HeaderSize) { + const u64 n = std::min(end, HeaderSize) - pos; + std::memcpy(data, hdr.data() + pos, static_cast(n)); + pos += n; + } + std::scoped_lock lock{mutex}; + for (std::size_t i = 0; i < sections.size() && pos < end; ++i) { + const auto& s = sections[i]; + const u64 begin = std::max(static_cast(s.offset), HeaderSize); + const u64 stop = std::max(static_cast(s.offset + s.size), begin); + if (stop <= pos) continue; + if (pos < begin) { + const u64 g = std::min(end, begin); + std::memset(data + (pos - off), 0, static_cast(g - pos)); + pos = g; + if (pos >= end) break; + } + const u64 pe = std::min(end, stop); + const std::span piece(data + (pos - off), static_cast(pe - pos)); + if (body->ReadAt(pos - HeaderSize, piece) != piece.size()) + return static_cast(pos - off); + if (ciphers[i]) { + Key128 iv{}; + SetIv(iv, s.counter, pos); + ciphers[i]->SetIV(iv); + ciphers[i]->Transcode(piece.data(), piece.size(), piece.data(), Op::Encrypt); + } + pos = pe; + } + return len; + } + + std::size_t Write(const u8*, std::size_t, std::size_t) override { return 0; } + bool Rename(std::string_view) override { return false; } + +private: + const std::string name; + const std::vector hdr; + const std::vector
sections; + const std::unique_ptr body; + std::vector>> ciphers; + mutable std::mutex mutex; + u64 nca_size{}; +}; + +// Solid NCZ: one zstd stream over the whole body. Decoded incrementally into memory, up to the +// requested offset, so sequential install reads are O(n) instead of O(n^2). +class SolidNczFile final : public FileSys::VfsFile { +public: + SolidNczFile(std::string name_, FileSys::VirtualFile source_, + std::vector
sections_, u64 payload_start_) + : name{std::move(name_)}, source{std::move(source_)}, sections{std::move(sections_)}, + payload_start{payload_start_} { + const auto raw_header = source->ReadBytes(HeaderSize, 0); + data.assign(raw_header.begin(), raw_header.end()); + frontier = HeaderSize; + } + + ~SolidNczFile() override { + if (stream != nullptr) ZSTD_freeDStream(stream); + } + + std::string GetName() const override { return name; } + std::size_t GetSize() const override { + u64 size = HeaderSize; + for (const auto& s : sections) + size = std::max(size, static_cast(s.offset + s.size)); + return static_cast(size); + } + bool Resize(std::size_t) override { return false; } + FileSys::VirtualDir GetContainingDirectory() const override { return nullptr; } + bool IsWritable() const override { return false; } + bool IsReadable() const override { return true; } + + std::size_t Read(u8* out, std::size_t len, std::size_t off) const override { + std::scoped_lock lock{mutex}; + const u64 nca_size = GetSize(); + if (off >= nca_size) return 0; + len = static_cast(std::min(len, nca_size - off)); + const u64 needed = off + len; + if (needed > frontier && !DecodeTo(needed)) return 0; + std::memcpy(out, data.data() + off, len); + return len; + } + + std::size_t Write(const u8*, std::size_t, std::size_t) override { return 0; } + bool Rename(std::string_view) override { return false; } + +private: + bool DecodeTo(u64 needed) const { + if (stream == nullptr) { + stream = ZSTD_createDStream(); + if (stream == nullptr) return false; + ZSTD_DCtx_setParameter(stream, ZSTD_d_windowLogMax, 31); + read_pos = payload_start; + } + + const u64 file_size = source->GetSize(); + std::vector out_buf(Chunk); + + std::size_t index = 0; + for (; index < sections.size(); ++index) { + const auto& s = sections[index]; + const u64 begin = std::max(static_cast(s.offset), HeaderSize); + const u64 end = std::max(static_cast(s.offset) + static_cast(s.size), + begin); + if (end > frontier) break; + } + + for (; index < sections.size() && frontier < needed; ++index) { + const auto& s = sections[index]; + const u64 begin = std::max(static_cast(s.offset), HeaderSize); + const u64 end = std::max(static_cast(s.offset) + static_cast(s.size), + begin); + if (end <= frontier) continue; + u64 pos = std::max(begin, frontier); + + std::optional> cipher; + if (s.Ctr()) cipher.emplace(s.key, Mode::CTR); + + while (pos < end && frontier < needed) { + const u64 want = std::min(end - pos, out_buf.size()); + std::size_t produced = 0; + while (produced < want) { + if (in.pos >= in.size) { + const u64 remaining = file_size - read_pos; + const std::size_t chunk = static_cast( + std::min(Chunk, remaining)); + if (chunk == 0) { LOG_ERROR(Crypto, "Solid NCZ: truncated"); return false; } + const auto bytes = source->ReadBytes(chunk, read_pos); + if (bytes.empty()) { LOG_ERROR(Crypto, "Solid NCZ: truncated"); return false; } + read_pos += bytes.size(); + in_buf.assign(bytes.begin(), bytes.end()); + in.src = in_buf.data(); + in.size = in_buf.size(); + in.pos = 0; + } + ZSTD_outBuffer outb{out_buf.data() + produced, want - produced, 0}; + const std::size_t res = ZSTD_decompressStream(stream, &outb, &in); + if (ZSTD_isError(res)) { + LOG_ERROR(Crypto, "Solid NCZ: zstd error"); + return false; + } + produced += outb.pos; + } + if (cipher) { + Key128 iv{}; + SetIv(iv, s.counter, pos); + cipher->SetIV(iv); + cipher->Transcode(out_buf.data(), produced, out_buf.data(), Op::Encrypt); + } + data.insert(data.end(), out_buf.begin(), out_buf.begin() + produced); + pos += produced; + frontier = pos; + } + } + return frontier >= needed; + } + + const std::string name; + const FileSys::VirtualFile source; + const std::vector
sections; + const u64 payload_start; + mutable std::mutex mutex; + mutable std::vector data; + mutable ZSTD_DStream* stream = nullptr; + mutable u64 read_pos = 0; + mutable u64 frontier = 0; + mutable std::vector in_buf; + mutable ZSTD_inBuffer in{nullptr, 0, 0}; +}; + +// Shared opener: block path always; solid only when allow_solid is true. +FileSys::VirtualFile OpenNcz(const FileSys::VirtualFile& f, std::string_view name, + bool allow_solid) { + if (!f) return nullptr; + u64 ps = 0; + auto parsed = ParseHeader(f, ps); + if (!parsed) return nullptr; + auto& [sections, block] = *parsed; + + if (block) { + auto hdr = f->ReadBytes(HeaderSize, 0); + if (hdr.size() != HeaderSize) return nullptr; + std::unique_ptr body; + try { body = std::make_unique(f, *block, ps); } + catch (const std::exception& e) { + LOG_ERROR(Crypto, "Failed to open NCZBLOCK: {}", e.what()); + return nullptr; + } + return std::make_shared(std::string{name}, std::move(hdr), + std::move(sections), std::move(body)); + } + + if (allow_solid) { + return std::make_shared(std::string{name}, f, std::move(sections), ps); + } + + LOG_DEBUG(Crypto, "Solid NCZ {} skipped (only NCZBLOCK is supported for play)", name); + return nullptr; +} + +} // Anonymous namespace + +bool IsBlockCompressedNCZ(const FileSys::VirtualFile& f) { + if (!f) return false; + u64 ps = 0; + const auto p = ParseHeader(f, ps); + return p && p->second.has_value(); +} + +FileSys::VirtualFile DecompressNCZ(const FileSys::VirtualFile& f, std::string_view name) { + return OpenNcz(f, name, /*allow_solid=*/false); +} + +FileSys::VirtualFile DecompressNCZForInstall(const FileSys::VirtualFile& f, + std::string_view name) { + return OpenNcz(f, name, /*allow_solid=*/true); +} + +} // namespace Core::Crypto \ No newline at end of file diff --git a/src/core/crypto/ncz_decompressor.h b/src/core/crypto/ncz_decompressor.h new file mode 100644 index 0000000000..9557f8c517 --- /dev/null +++ b/src/core/crypto/ncz_decompressor.h @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include + +#include "core/file_sys/vfs/vfs_types.h" + +namespace Core::Crypto { + +/** + * Opens an NCZBLOCK-compressed NCA (nsz -B / .xcz block format) as a VirtualFile backed by + * on-demand block decoding. Nothing is written to disk; each read decodes only the blocks it + * covers and re-encrypts CTR sections. Solid NCZ is not supported. + * + * @param ncz_file The raw NCZ payload (e.g. ".ncz" entry from an NSZ/XCZ PFS0). + * @param output_name Name to give the returned VirtualFile (e.g. ".nca"). + * + * @return a VirtualFile for the NCA, or nullptr if the NCZ is malformed or not NCZBLOCK. + */ +[[nodiscard]] FileSys::VirtualFile DecompressNCZ(const FileSys::VirtualFile& ncz_file, + std::string_view output_name); + +/** + * Returns true if the given file is an NCZ payload in block-compressed (NCZBLOCK) form, + * i.e. one that DecompressNCZ() can open. Solid NCZ returns false. + */ +[[nodiscard]] bool IsBlockCompressedNCZ(const FileSys::VirtualFile& ncz_file); + +// Install to NAND: same as DecompressNCZ, but solid NCZ is decoded on demand too. +[[nodiscard]] FileSys::VirtualFile DecompressNCZForInstall( + const FileSys::VirtualFile& ncz_file, std::string_view output_name); + +} // namespace Core::Crypto \ No newline at end of file diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 1f430434f7..26e73d260a 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -16,6 +16,7 @@ #include "common/random.h" #include "common/string_util.h" #include "core/crypto/key_manager.h" +#include "core/crypto/ncz_decompressor.h" #include "core/file_sys/card_image.h" #include "core/file_sys/common_funcs.h" #include "core/file_sys/content_archive.h" @@ -158,6 +159,25 @@ static std::shared_ptr OpenContainerAsNsp(const VirtualFile& file, Loader:: return nullptr; } +// Checks that every .ncz entry in the container is NCZBLOCK. Solid NCZ has no random access, +// and the whole point of this build is to reject it at scan time so such files never appear +// in the game list. Containers without any .ncz (plain NSP/XCI) pass through. +static bool ContainerIsFullyBlockCompressed(const std::shared_ptr& nsp) { + if (!nsp) { + return false; + } + for (const auto& entry : nsp->GetFiles()) { + const auto name = entry->GetName(); + if (name.size() < 4 || name.substr(name.size() - 4) != ".ncz") { + continue; + } + if (!Core::Crypto::IsBlockCompressedNCZ(entry)) { + return false; // solid NCZ -> reject the whole container + } + } + return true; // no .ncz at all, or all block-compressed +} + template bool ForEachContainerEntry(const std::shared_ptr& nsp, bool only_content, std::optional base_program_id, Callback&& on_entry) { @@ -811,7 +831,14 @@ std::vector RegisteredCache::ListEntriesFilter( } static std::shared_ptr GetNCAFromNSPForID(const NSP& nsp, const NcaID& id) { - auto file = nsp.GetFile(fmt::format("{}.nca", Common::HexToString(id, false))); + const auto id_string = Common::HexToString(id, false); + auto file = nsp.GetFile(fmt::format("{}.nca", id_string)); + if (file == nullptr) { + if (auto ncz_file = nsp.GetFile(fmt::format("{}.ncz", id_string))) { + file = Core::Crypto::DecompressNCZForInstall( + ncz_file, fmt::format("{}.nca", id_string)); + } + } if (file == nullptr) { return nullptr; } @@ -1273,6 +1300,12 @@ bool ManualContentProvider::AddEntriesFromContainer(VirtualFile file, bool only_ return false; } + // Reject solid NCZ (.nsz without -B): only block-compressed NCZ is supported. + if (!ContainerIsFullyBlockCompressed(nsp)) { + LOG_DEBUG(Service_FS, "Skipping solid-compressed container: {}", file->GetName()); + return false; + } + return ForEachContainerEntry( nsp, only_content, base_program_id, [this](TitleType title_type, ContentRecordType content_type, u64 title_id, @@ -1415,8 +1448,9 @@ void ExternalContentProvider::ScanDirectory(const VirtualDir& dir) { } const auto extension = Common::ToLower(filename.substr(dot_pos + 1)); - - if (extension == "nsp") { + // .xcz is an XCI container, but its updates only work through the NSP/PFS0 path + // (DecompressNCZ), not ProcessXCI. So route .xcz here on purpose. + if (extension == "nsp" || extension == "nsz" || extension == "xcz") { ProcessNSP(file); } else if (extension == "xci") { ProcessXCI(file); @@ -1434,6 +1468,12 @@ void ExternalContentProvider::ProcessNSP(const VirtualFile& file) { return; } + // Reject solid NCZ (.nsz without -B): Eden only supports block-compressed NCZ. + if (!ContainerIsFullyBlockCompressed(nsp)) { + LOG_DEBUG(Service_FS, "Skipping solid-compressed container: {}", file->GetName()); + return; + } + LOG_DEBUG(Service_FS, "Processing NSP file: {}", file->GetName()); AddExternalEntriesFromContainer(nsp, entries, versions, multi_version_entries); } diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp index 0ea323492b..1a39d819f6 100644 --- a/src/core/file_sys/submission_package.cpp +++ b/src/core/file_sys/submission_package.cpp @@ -12,6 +12,7 @@ #include "common/hex_util.h" #include "common/logging.h" #include "core/crypto/key_manager.h" +#include "core/crypto/ncz_decompressor.h" #include "core/file_sys/common_funcs.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/nca_metadata.h" @@ -246,6 +247,17 @@ void NSP::ReadNCAs(const std::vector& files) { const auto id_string = Common::HexToString(rec.nca_id, false); auto next_file = pfs->GetFile(fmt::format("{}.nca", id_string)); + if (next_file == nullptr) { + auto ncz_file = pfs->GetFile(fmt::format("{}.ncz", id_string)); + if (ncz_file != nullptr) { + next_file = Core::Crypto::DecompressNCZ(ncz_file, fmt::format("{}.nca", id_string)); + if (next_file == nullptr) { + LOG_DEBUG(Service_FS, "Skipping solid or unsupported NCZ content {}.ncz", id_string); + continue; + } + } + } + if (next_file == nullptr) { if (rec.type != ContentRecordType::DeltaFragment) { LOG_WARNING(Service_FS, diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index 90e23ccc11..92e2e2f602 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp @@ -82,23 +82,27 @@ std::shared_ptr OpenContainerAsNsp(FileSys::VirtualFile file, File return nullptr; } - if (type == FileType::NSP) { + if (type == FileType::NSP || type == FileType::NSZ) { auto nsp = std::make_shared(file, program_id, program_index); return nsp->GetStatus() == ResultStatus::Success ? nsp : nullptr; } - if (type == FileType::XCI) { + if (type == FileType::XCI || type == FileType::XCZ) { FileSys::XCI xci{file, program_id, program_index}; - if (xci.GetStatus() != ResultStatus::Success) { - return nullptr; + if (xci.GetStatus() == ResultStatus::Success) { + auto secure_nsp = xci.GetSecurePartitionNSP(); + if (secure_nsp != nullptr && secure_nsp->GetStatus() == ResultStatus::Success) { + return secure_nsp; + } } - auto secure_nsp = xci.GetSecurePartitionNSP(); - if (secure_nsp == nullptr || secure_nsp->GetStatus() != ResultStatus::Success) { - return nullptr; + // PFS0-shaped .xcz (NSZ-style container) does not parse as XCI; fall back to NSP. + if (type == FileType::XCZ) { + auto nsp = std::make_shared(file, program_id, program_index); + return nsp->GetStatus() == ResultStatus::Success ? nsp : nullptr; } - return secure_nsp; + return nullptr; } return nullptr; @@ -144,7 +148,8 @@ FileType IdentifyFile(FileSys::VirtualFile file) { } bool IsContainerType(FileType type) { - return type == FileType::NSP || type == FileType::XCI; + return type == FileType::NSP || type == FileType::NSZ || type == FileType::XCI || + type == FileType::XCZ; } bool IsBootableGameContainer(FileSys::VirtualFile file, FileType type, u64 program_id, @@ -180,8 +185,12 @@ FileType GuessFromFilename(const std::string& name) { return FileType::NCA; else if (extension == "xci") return FileType::XCI; + else if (extension == "xcz") + return FileType::XCZ; else if (extension == "nsp") return FileType::NSP; + else if (extension == "nsz") + return FileType::NSZ; else if (extension == "kip") return FileType::KIP; return FileType::Unknown; @@ -197,10 +206,14 @@ std::string GetFileTypeString(FileType type) { return "NCA"; case FileType::XCI: return "XCI"; + case FileType::XCZ: + return "XCZ"; case FileType::NAX: return "NAX"; case FileType::NSP: return "NSP"; + case FileType::NSZ: + return "NSZ"; case FileType::KIP: return "KIP"; case FileType::DeconstructedRomDirectory: @@ -326,12 +339,29 @@ static std::unique_ptr GetFileLoader(Core::System& system, FileSys::V system.GetContentProvider(), program_id, program_index); + // NCZ-compressed XCI container. XCI-shaped .xcz goes to the XCI loader, while + // PFS0-shaped (NSZ-style) .xcz containers fall back to the NSP loader. + case FileType::XCZ: { + FileSys::XCI probe{file, program_id, program_index}; + if (probe.GetStatus() == ResultStatus::Success && + probe.GetSecurePartitionNSP() != nullptr) { + return std::make_unique(std::move(file), + system.GetFileSystemController(), + system.GetContentProvider(), program_id, + program_index); + } + return std::make_unique(std::move(file), system.GetFileSystemController(), + system.GetContentProvider(), program_id, + program_index); + } + // NX NAX (NintendoAesXts) file format. case FileType::NAX: return std::make_unique(std::move(file)); // NX NSP (Nintendo Submission Package) file format case FileType::NSP: + case FileType::NSZ: return std::make_unique(std::move(file), system.GetFileSystemController(), system.GetContentProvider(), program_id, program_index); diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 95ce638da0..d3c0230cb0 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -42,7 +42,9 @@ enum class FileType { NRO, NCA, NSP, + NSZ, XCI, + XCZ, NAX, KIP, DeconstructedRomDirectory, diff --git a/src/core/loader/nsp.cpp b/src/core/loader/nsp.cpp index cfc908b4ef..8b2c79394d 100644 --- a/src/core/loader/nsp.cpp +++ b/src/core/loader/nsp.cpp @@ -56,6 +56,17 @@ AppLoader_NSP::AppLoader_NSP(FileSys::VirtualFile file_, AppLoader_NSP::~AppLoader_NSP() = default; FileType AppLoader_NSP::IdentifyType(const FileSys::VirtualFile& nsp_file) { + // .nsz is NSP-compatible; return NSZ so the game list shows the right type. + if (nsp_file->GetName().ends_with(".nsz")) { + return FileType::NSZ; + } + + // PFS0-shaped .xcz containers are handled by this loader too; report XCZ so the game + // list does not show them as NSP. XCI-shaped .xcz is identified by AppLoader_XCI. + if (nsp_file->GetName().ends_with(".xcz")) { + return FileType::XCZ; + } + const FileSys::NSP nsp(nsp_file); if (nsp.GetStatus() != ResultStatus::Success) { diff --git a/src/frontend_common/content_manager.h b/src/frontend_common/content_manager.h index 4f3112e3fb..6d79098efa 100644 --- a/src/frontend_common/content_manager.h +++ b/src/frontend_common/content_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: 2024 yuzu Emulator Project @@ -163,7 +163,9 @@ inline InstallResult InstallNSP(Core::System& system, FileSys::VfsFilesystem& vf std::shared_ptr nsp; FileSys::VirtualFile file = vfs.OpenFile(filename, FileSys::OpenMode::Read); - if (boost::to_lower_copy(file->GetName()).ends_with("nsp")) { + const auto lower_name = boost::to_lower_copy(file->GetName()); + + if (lower_name.ends_with("nsp") || lower_name.ends_with("nsz")) { nsp = std::make_shared(file); if (nsp->IsExtractedType()) { return InstallResult::Failure; diff --git a/src/qt_common/game_list/worker.cpp b/src/qt_common/game_list/worker.cpp index 586a26e8b9..6b6f93447d 100644 --- a/src/qt_common/game_list/worker.cpp +++ b/src/qt_common/game_list/worker.cpp @@ -360,7 +360,8 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa } if (target == ScanTarget::PopulateGameList && - (file_type == Loader::FileType::XCI || file_type == Loader::FileType::NSP) && + (file_type == Loader::FileType::XCI || file_type == Loader::FileType::XCZ || + file_type == Loader::FileType::NSP || file_type == Loader::FileType::NSZ) && !Loader::IsBootableGameContainer(file, file_type)) { return true; } @@ -375,7 +376,9 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa program_id, file); } else if (Settings::values.ext_content_from_game_dirs.GetValue() && (file_type == Loader::FileType::XCI || - file_type == Loader::FileType::NSP)) { + file_type == Loader::FileType::XCZ || + file_type == Loader::FileType::NSP || + file_type == Loader::FileType::NSZ)) { void(provider->AddEntriesFromContainer(file)); } } else { @@ -402,7 +405,8 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa }; if (res2 == Loader::ResultStatus::Success && program_ids.size() > 1 && - (file_type == Loader::FileType::XCI || file_type == Loader::FileType::NSP)) { + (file_type == Loader::FileType::XCI || file_type == Loader::FileType::XCZ || + file_type == Loader::FileType::NSP || file_type == Loader::FileType::NSZ)) { for (const auto id : program_ids) { // dravee suggested this, only viable way to // not show sub-games in qlaunch for now. diff --git a/src/qt_common/qt_common.cpp b/src/qt_common/qt_common.cpp index b9b8caf6e8..794aeaabb1 100644 --- a/src/qt_common/qt_common.cpp +++ b/src/qt_common/qt_common.cpp @@ -57,7 +57,8 @@ std::unique_ptr emu_thread = nullptr; const QStringList supported_file_extensions = {QStringLiteral("nro"), QStringLiteral("nso"), QStringLiteral("nca"), QStringLiteral("xci"), - QStringLiteral("nsp"), QStringLiteral("kip")}; + QStringLiteral("xcz"), QStringLiteral("nsp"), + QStringLiteral("nsz"), QStringLiteral("kip")}; Core::Frontend::WindowSystemType GetWindowSystemType() { // Determine WSI type based on Qt platform. diff --git a/src/yuzu/main_window.cpp b/src/yuzu/main_window.cpp index 6e21265f9e..ad76e5b2db 100644 --- a/src/yuzu/main_window.cpp +++ b/src/yuzu/main_window.cpp @@ -2797,9 +2797,9 @@ void MainWindow::IncrementInstallProgress() { void MainWindow::OnMenuInstallToNAND() { const QString file_filter = - tr("Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive " - "(*.nca);;Nintendo Submission Package (*.nsp);;NX Cartridge " - "Image (*.xci)"); + tr("Installable Switch File (*.nca *.nsp *.nsz *.xci *.xcz);;Nintendo Content Archive " + "(*.nca);;Nintendo Submission Package (*.nsp *.nsz);;NX Cartridge " + "Image (*.xci *.xcz)"); QStringList filenames = QFileDialog::getOpenFileNames( this, tr("Install Files"), QString::fromStdString(UISettings::values.roms_path), @@ -2856,7 +2856,10 @@ void MainWindow::OnMenuInstallToNAND() { QFuture future; ContentManager::InstallResult result; - if (file.endsWith(QStringLiteral("nsp"), Qt::CaseInsensitive)) { + if (file.endsWith(QStringLiteral("nsp"), Qt::CaseInsensitive) || + file.endsWith(QStringLiteral("nsz"), Qt::CaseInsensitive) || + file.endsWith(QStringLiteral("xci"), Qt::CaseInsensitive) || + file.endsWith(QStringLiteral("xcz"), Qt::CaseInsensitive)) { const auto progress_callback = [this](size_t size, size_t progress) { emit UpdateInstallProgress(); if (install_progress->wasCanceled()) { From a95efaf18f50721aa6f5cdce8b5b94e858ffd8d1 Mon Sep 17 00:00:00 2001 From: wildcard Date: Mon, 26 Oct 2026 17:23:45 +0100 Subject: [PATCH 190/198] [vulkan] Fix TOTK dark squares (#4565) Qualcomm and Turnip use different subpixel rounding for Vulkan texture gather coordinates than the Switch's Maxwell GPU. This can select the wrong texels near texture boundaries, producing large black squares in TOTK - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4565 Reviewed-by: CamilleLaVey Reviewed-by: Shinmegumi --- src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index a85e2811a3..e9403580d5 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -447,7 +447,9 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE || driver_id == VK_DRIVER_ID_MESA_RADV || driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS || - driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA, + driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA || + driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY || + driver_id == VK_DRIVER_ID_MESA_TURNIP, .has_broken_spirv_clamp = driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, .has_broken_spirv_position_input = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, From 0689f73147ebeddb9ac5fb8b0edf2625425f8d71 Mon Sep 17 00:00:00 2001 From: xbzk Date: Mon, 26 Oct 2026 17:24:00 +0100 Subject: [PATCH 191/198] [ir] resolve conditional Phi inputs when tracking bindless texture handles (#4551) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Aimed to fix Ender Magnolia missing shader textures. Main example is Yolvan character bullets. By using windows version of the game, dxvk lib to make it vulkan, and renderdoc, it was possible to capture bullets, and by tracking backward composition and comparing with a similar scene from eden with missing bullets, it was possible to unveil the missing functionality: conditional Phi inputs resolve for bindless handles. By ignoring the boolean predicate register in the shader, handles for these shaders were resolving to some old value instead of proper live conditional ones. TESTS: -Compare Yolvan bullets -Usual roam on main titles for regression check. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4551 Reviewed-by: CamilleLaVey Reviewed-by: Shinmegumi --- .../frontend/ir/breadth_first_search.h | 11 ++- src/shader_recompiler/ir_opt/texture_pass.cpp | 87 +++++++++++++++---- 2 files changed, 79 insertions(+), 19 deletions(-) diff --git a/src/shader_recompiler/frontend/ir/breadth_first_search.h b/src/shader_recompiler/frontend/ir/breadth_first_search.h index ec55425549..afe153f180 100644 --- a/src/shader_recompiler/frontend/ir/breadth_first_search.h +++ b/src/shader_recompiler/frontend/ir/breadth_first_search.h @@ -1,8 +1,12 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once +#include #include #include #include @@ -13,9 +17,10 @@ namespace Shader::IR { -template -auto BreadthFirstSearch(const Value& value, Pred&& pred) +template +auto BreadthFirstSearch(Value value, Pred&& pred, Resolve&& resolve = {}) -> std::invoke_result_t { + value = resolve(value); if (value.IsImmediate()) { // Nothing to do with immediates return std::nullopt; @@ -36,7 +41,7 @@ auto BreadthFirstSearch(const Value& value, Pred&& pred) } // Visit the right most arguments first for (size_t arg = inst->NumArgs(); arg--;) { - const Value arg_value{inst->Arg(arg)}; + const Value arg_value{resolve(inst->Arg(arg))}; if (arg_value.IsImmediate()) { continue; } diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index fe34a67555..fae69ab91b 100644 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp @@ -31,6 +31,60 @@ struct TextureInst { using TextureInstVector = boost::container::small_vector; +const IR::Block* ConditionalHeader(const IR::Block* body) { + const auto predecessors{body->ImmPredecessors()}; + const auto successors{body->ImmSuccessors()}; + if (predecessors.size() != 1 || successors.size() != 1) return nullptr; + const IR::Block* const header{predecessors[0]}; + const auto targets{header->ImmSuccessors()}; + if (targets.size() != 2 || targets[0] != body || targets[1] != successors[0] || + targets[1]->ImmPredecessors().size() != 2 || header->empty() || + header->back().GetOpcode() != IR::Opcode::ConditionRef) { + return nullptr; + } + return header; +} + +std::pair Condition(IR::Value value) { + bool negated{}; + while (const IR::Inst* inst = value.TryInstRecursive()) { + if (inst->GetOpcode() == IR::Opcode::LogicalNot) negated = !negated; + else if (inst->GetOpcode() != IR::Opcode::ConditionRef) break; + value = inst->Arg(0); + } + return {value.Resolve(), negated}; +} + +IR::Value ResolveConditionalPhi(IR::Value value, const IR::Block* block) { + if (!value.Resolve().IsPhi() || !(block = ConditionalHeader(block))) return value; + const auto [condition, negated]{Condition(block->back().Arg(0))}; + boost::container::small_vector visited; + while (value.Resolve().IsPhi() && std::ranges::find(visited, block) == visited.end()) { + visited.push_back(block); + const IR::Inst* const phi{value.InstRecursive()}; + const auto predecessors{block->ImmPredecessors()}; + if (predecessors.size() == 1) { + block = predecessors[0]; + continue; + } + if (predecessors.size() != 2 || phi->NumArgs() != 2) break; + const IR::Block* body{predecessors[0]}; + const IR::Block* header{ConditionalHeader(body)}; + if (header != predecessors[1]) { + body = predecessors[1]; + header = ConditionalHeader(body); + if (header != predecessors[0]) break; + } + const auto [other_condition, other_negated]{Condition(header->back().Arg(0))}; + if (condition == other_condition && (phi->PhiBlock(0) == header || phi->PhiBlock(0) == body)) { + const IR::Block* const incoming{negated == other_negated ? body : header}; + value = phi->Arg(phi->PhiBlock(0) == incoming ? 0 : 1); + } + block = header; + } + return value; +} + constexpr u32 DESCRIPTOR_SIZE = 8; constexpr u32 DESCRIPTOR_SIZE_SHIFT = u32(std::countr_zero(DESCRIPTOR_SIZE)); constexpr u32 DESCRIPTOR_MAX_COUNT = 1024; @@ -299,23 +353,23 @@ static inline bool IsTexturePixelFormatIntegerCached(Environment& env, } -std::optional Track(const IR::Value& value, Environment& env, const HostTranslateInfo& host_info); -static inline std::optional TrackCached(const IR::Value& v, Environment& env, const HostTranslateInfo& host_info) { - if (const IR::Inst* key = v.InstRecursive()) { +std::optional Track(const IR::Value& value, Environment& env, const HostTranslateInfo& host_info, const IR::Block* block); +static inline std::optional TrackCached(const IR::Value& v, Environment& env, const HostTranslateInfo& host_info, const IR::Block* block) { + if (const IR::Inst* key = v.TryInstRecursive()) { if (auto it = env.track_cache.find(key); it != env.track_cache.end()) return it->second; - auto found = Track(v, env, host_info); + auto found = Track(v, env, host_info, block); if (found) env.track_cache.emplace(key, *found); return found; } - return Track(v, env, host_info); + return Track(v, env, host_info, block); } -std::optional TryGetConstBuffer(const IR::Inst* inst, Environment& env, const HostTranslateInfo& host_info); +std::optional TryGetConstBuffer(const IR::Inst* inst, Environment& env, const HostTranslateInfo& host_info, const IR::Block* block); -std::optional Track(const IR::Value& value, Environment& env, const HostTranslateInfo& host_info) { - return IR::BreadthFirstSearch(value, [&env, &host_info](const IR::Inst* inst) { - return TryGetConstBuffer(inst, env, host_info); - }); +std::optional Track(const IR::Value& value, Environment& env, const HostTranslateInfo& host_info, const IR::Block* block) { + return IR::BreadthFirstSearch(value, [&env, &host_info, block](const IR::Inst* inst) { + return TryGetConstBuffer(inst, env, host_info, block); + }, [&](IR::Value operand) { return ResolveConditionalPhi(operand, block); }); } std::optional TryGetConstant(IR::Value& value, Environment& env) { @@ -339,13 +393,13 @@ std::optional TryGetConstant(IR::Value& value, Environment& env) { return ReadCbufCached(env, index_number, offset_number); } -std::optional TryGetConstBuffer(const IR::Inst* inst, Environment& env, const HostTranslateInfo& host_info) { +std::optional TryGetConstBuffer(const IR::Inst* inst, Environment& env, const HostTranslateInfo& host_info, const IR::Block* block) { switch (inst->GetOpcode()) { default: return std::nullopt; case IR::Opcode::BitwiseOr32: { - std::optional lhs{TrackCached(inst->Arg(0), env, host_info)}; - std::optional rhs{TrackCached(inst->Arg(1), env, host_info)}; + std::optional lhs{TrackCached(inst->Arg(0), env, host_info, block)}; + std::optional rhs{TrackCached(inst->Arg(1), env, host_info, block)}; if (!lhs || !rhs) { return std::nullopt; } @@ -375,7 +429,7 @@ std::optional TryGetConstBuffer(const IR::Inst* inst, Environme if (!shift.IsImmediate()) { return std::nullopt; } - std::optional lhs{TrackCached(inst->Arg(0), env, host_info)}; + std::optional lhs{TrackCached(inst->Arg(0), env, host_info, block)}; if (lhs) { lhs->shift_left = shift.U32(); } @@ -403,7 +457,7 @@ std::optional TryGetConstBuffer(const IR::Inst* inst, Environme return std::nullopt; } while (false); } - std::optional lhs{TrackCached(op1, env, host_info)}; + std::optional lhs{TrackCached(op1, env, host_info, block)}; if (lhs) { lhs->shift_left = static_cast(std::countr_zero(op2.U32())); } @@ -469,7 +523,7 @@ std::optional TryGetConstBuffer(const IR::Inst* inst, Environme TextureInst MakeInst(Environment& env, IR::Block* block, IR::Inst& inst, const HostTranslateInfo& host_info) { ConstBufferAddr addr; if (IsBindless(inst)) { - const std::optional track_addr{TrackCached(inst.Arg(0), env, host_info)}; + const std::optional track_addr{TrackCached(inst.Arg(0), env, host_info, block)}; if (!track_addr) { throw NotImplementedException("Failed to track bindless texture constant buffer"); @@ -671,6 +725,7 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo env.track_cache.clear(); TextureInstVector to_replace; for (IR::Block* const block : program.post_order_blocks) { + env.track_cache.clear(); for (IR::Inst& inst : block->Instructions()) { if (!IsTextureInstruction(inst)) { continue; From 0e11fe8b5e3d3b563946726ed06cb44b2bf5ccb3 Mon Sep 17 00:00:00 2001 From: xbzk Date: Mon, 26 Oct 2026 17:24:28 +0100 Subject: [PATCH 192/198] [video_core, settings] readback for nce invalidations (#4490) optimization and nuke toggles (#4502) (#4531) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Follow up for #4490: Originally i was racing locks between dirty and clean invalidations, but +94% were clean so it was causing useless locks. Solutioin was to share locks between both. P.S.: THIS IS INTENDED TO FIX RANDOM CRASHES IN UE, OBJECTIVELY REPRODUCIBLE IN ENDER MAGNOLIA IN ANDROID. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4531 Reviewed-by: CamilleLaVey Reviewed-by: Shinmegumi --- .../features/settings/model/BooleanSetting.kt | 1 - .../features/settings/model/view/SettingsItem.kt | 7 ------- .../settings/ui/SettingsFragmentPresenter.kt | 1 - src/android/app/src/main/res/values-ar/strings.xml | 2 -- .../app/src/main/res/values-zh-rTW/strings.xml | 2 -- src/android/app/src/main/res/values/strings.xml | 2 -- src/common/settings.h | 2 -- src/qt_common/config/shared_translation.cpp | 4 ---- src/video_core/gpu.cpp | 6 +++--- src/video_core/rasterizer_interface.h | 9 +++++++++ src/video_core/renderer_vulkan/vk_rasterizer.cpp | 12 ++++++++++++ src/video_core/renderer_vulkan/vk_rasterizer.h | 1 + 12 files changed, 25 insertions(+), 24 deletions(-) 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 0548004cf5..6c33fc7812 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 @@ -16,7 +16,6 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_USE_SPEED_LIMIT("use_speed_limit"), USE_CUSTOM_CPU_TICKS("use_custom_cpu_ticks"), SKIP_CPU_INNER_INVALIDATION("skip_cpu_inner_invalidation"), - NCE_INVALIDATION_GPU_READBACK("nce_invalidation_gpu_readback"), FIX_BLOOM_EFFECTS("fix_bloom_effects"), EMULATE_BGR565("emulate_bgr565"), RESCALE_HACK("rescale_hack"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 690c746628..f968a0ae18 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -859,13 +859,6 @@ abstract class SettingsItem( descriptionId = R.string.skip_cpu_inner_invalidation_description ) ) - put( - SwitchSetting( - BooleanSetting.NCE_INVALIDATION_GPU_READBACK, - titleId = R.string.nce_invalidation_gpu_readback, - descriptionId = R.string.nce_invalidation_gpu_readback_description - ) - ) put( SwitchSetting( BooleanSetting.FIX_BLOOM_EFFECTS, 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 f9185e39e6..824a54181e 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 @@ -554,7 +554,6 @@ class SettingsFragmentPresenter( add(HeaderSetting(R.string.hacks)) add(BooleanSetting.SKIP_CPU_INNER_INVALIDATION.key) - add(BooleanSetting.NCE_INVALIDATION_GPU_READBACK.key) add(BooleanSetting.FIX_BLOOM_EFFECTS.key) add(BooleanSetting.EMULATE_BGR565.key) add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key) diff --git a/src/android/app/src/main/res/values-ar/strings.xml b/src/android/app/src/main/res/values-ar/strings.xml index 2fdff9847b..3be04d9186 100644 --- a/src/android/app/src/main/res/values-ar/strings.xml +++ b/src/android/app/src/main/res/values-ar/strings.xml @@ -587,8 +587,6 @@ يجعل اللعبة تعتقد أن عمل وحدة معالجة الرسومات ينتهي بشكل أسرع مما هو عليه في الواقع، لذلك تتوقف عن خفض الدقة ومسافة العرض لتتناسب مع سرعات جهاز Switch. تخطي إبطال صلاحية وحدة المعالجة المركزية الداخلية يتخطى بعض عمليات إبطال ذاكرة التخزين المؤقتة من جانب وحدة المعالجة المركزية أثناء تحديثات الذاكرة، مما يقلل من استخدام وحدة المعالجة المركزية ويحسن أداءها. قد يتسبب ذلك في حدوث أعطال أو تعطل في بعض الألعاب. - إعادة قراءة وحدة معالجة الرسومات قبل إبطال صلاحية NCE - إصلاح مؤقت. يعالج مشكلة تعطل لعبة Ender Magnolia (وغيرها من ألعاب UE). قد يؤدي إلى انخفاض في الأداء. يجري العمل على تحسينه. إصلاح تأثيرات التوهج يقلل من ضبابية التوهج في LA/EOW (Adreno A6XX - A7XX/ Turnip)، ويزيل التوهج في Burnout. تحذير: قد يسبب تشوهات رسومية في ألعاب أخرى. محاكاة BGR565 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 index 3f0c6d9215..1391f1bc6e 100644 --- a/src/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml @@ -577,8 +577,6 @@ 讓遊戲誤以為 GPU 工作能更快完成,避免遊戲為了配合 Switch 的時脈而降低解析度與渲染距離 跳過 CPU 內部失效處理 在記憶體更新期間跳過某些 CPU 端快取的失效處理,減少 CPU 使用率並提高其性能。可能會導致某些遊戲出現故障或當機 - 在 NCE 無效化前進行 GPU 回讀 - (暫時性功能)修復 \"終結者瑪格諾莉亞:霧中綻放\" 及其它使用虛幻引擎之遊戲中的當機問題,可能會降低效能。此功能正在改善中 修正光暈特效 在 \"薩爾達傳說:織夢島\" 和 \"薩爾達傳說:智慧的再現\" 中減少光暈模糊的問題並移除 \"橫衝直撞:狂飆樂園重製版\" 中的光暈效果(適用於 Adreno A6XX - A7XX/ Turnip)。警告:可能會在其它遊戲中導致圖形異常 模擬 BGR565 diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 191506c818..33e1eaa340 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -593,8 +593,6 @@ Makes the game believe GPU work finishes faster than it does, so it stops lowering resolution and render distance to fit the Switch\'s clocks. Skip CPU Inner Invalidation Skips certain CPU-side cache invalidations during memory updates, reducing CPU usage and improving it\'s performance. This may cause glitches or crashes on some games. - GPU Readback Before NCE Invalidation - Temporary. Fix Ender Magnolia (and other UE titles) crashes. May reduce performance. Improvement in progress. Fix Bloom Effects Reduces bloom blur in LA/EOW (Adreno A6XX - A7XX/ Turnip), removes bloom in Burnout. Warning: may cause graphical artifacts in other games. Emulate BGR565 diff --git a/src/common/settings.h b/src/common/settings.h index d1f891607b..b57bec5c12 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -639,8 +639,6 @@ struct Values { Specialization::Default, true, true}; - SwitchableSetting nce_invalidation_gpu_readback{ - linkage, false, "nce_invalidation_gpu_readback", Category::RendererHacks}; SwitchableSetting async_presentation{linkage, #ifdef __ANDROID__ true, diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 09e64b98f0..bb92d896f8 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -194,10 +194,6 @@ std::unique_ptr InitializeTranslations(QObject* parent) { INSERT(Settings, skip_cpu_inner_invalidation, tr("Skip CPU Inner Invalidation"), tr("Skips certain cache invalidations during memory updates, reducing CPU usage and " "improving latency. This may cause soft-crashes.")); - INSERT(Settings, nce_invalidation_gpu_readback, - tr("GPU Readback Before NCE Invalidation"), - tr("Flushes GPU buffer data back to guest memory before NCE invalidates the whole " - "guest page, preserving it while the CPU store proceeds.")); INSERT(Settings, vsync_mode, tr("VSync Mode:"), tr("FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen " "refresh rate.\nFIFO Relaxed allows tearing as it recovers from a slow down.\n" diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 4e36d086e6..1621b24125 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -227,17 +227,17 @@ struct GPU::Impl { /// Notify rasterizer that any caches of the specified region should be invalidated void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) { - if (Settings::values.nce_invalidation_gpu_readback.GetValue()) { + if (preserve_gpu_writes) { VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer(); - if (preserve_gpu_writes && rasterizer->MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) { + if (!rasterizer->TryCacheInvalidation(addr, size)) { const u64 fence = RequestSyncOperation([rasterizer, addr, size] { rasterizer->FlushRegion(addr, size, VideoCommon::CacheType::BufferCache); rasterizer->OnCacheInvalidation(addr, size); }); gpu_thread.TickGPU(is_async); WaitForSyncOperation(fence); - return; } + return; } gpu_thread.InvalidateRegion(addr, size); } diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h index 481efbf53b..b527c0e2a9 100644 --- a/src/video_core/rasterizer_interface.h +++ b/src/video_core/rasterizer_interface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -111,6 +114,12 @@ public: /// Notify rasterizer that any caches of the specified region are desync with guest virtual void OnCacheInvalidation(PAddr addr, u64 size) = 0; + virtual bool TryCacheInvalidation(DAddr addr, u64 size) { + if (MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) return false; + OnCacheInvalidation(addr, size); + return true; + } + virtual bool OnCPUWrite(PAddr addr, u64 size) = 0; /// Sync memory between guest and host. diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index f43bea1220..264ffb28b5 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -798,6 +798,18 @@ void RasterizerVulkan::OnCacheInvalidation(DAddr addr, u64 size) { pipeline_cache.InvalidateRegion(addr, size); } +bool RasterizerVulkan::TryCacheInvalidation(DAddr addr, u64 size) { + if (addr == 0 || size == 0) return true; + { + std::scoped_lock lock{buffer_cache.mutex, texture_cache.mutex}; + if (buffer_cache.IsRegionGpuModified(addr, size)) return false; + texture_cache.WriteMemory(addr, size); + buffer_cache.WriteMemory(addr, size); + } + pipeline_cache.InvalidateRegion(addr, size); + return true; +} + void RasterizerVulkan::InvalidateGPUCache() { gpu.InvalidateGPUCache(); } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 7470aa4f14..ae9929ca0b 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -106,6 +106,7 @@ public: VideoCommon::CacheType which = VideoCommon::CacheType::All) override; void InnerInvalidation(std::span> sequences) override; void OnCacheInvalidation(DAddr addr, u64 size) override; + bool TryCacheInvalidation(DAddr addr, u64 size) override; bool OnCPUWrite(DAddr addr, u64 size) override; void InvalidateGPUCache() override; void UnmapMemory(DAddr addr, u64 size) override; From 5239cbe2a78d6533e3541a71c4d3c723818dcb6e Mon Sep 17 00:00:00 2001 From: xbzk Date: Mon, 26 Oct 2026 17:24:45 +0100 Subject: [PATCH 193/198] [nce] handles duplicate NCE interrupts (#4530) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Another crash observed in Ender Magnolia: A deadlock caused between CPUCore_0/GPU/GPUFencingThread. CPUCore_0 waits for GPU work inside the NCE fault handler GPU waits for the syncpoint mutex GPUFencingThread holds that mutex while waiting for CPUCore_0 NCE interrupt lock The fix makes duplicate interrupts return before acquiring the lock, while the first request keeps its original behavior. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4530 Reviewed-by: CamilleLaVey Reviewed-by: Shinmegumi --- src/core/arm/nce/arm_nce.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/arm/nce/arm_nce.cpp b/src/core/arm/nce/arm_nce.cpp index 63d5638fce..438dd4d981 100644 --- a/src/core/arm/nce/arm_nce.cpp +++ b/src/core/arm/nce/arm_nce.cpp @@ -369,8 +369,8 @@ void ArmNce::SetContext(const Kernel::Svc::ThreadContext& ctx) { } void ArmNce::SignalInterrupt(Kernel::KThread* thread) { - // Add break loop condition. - m_guest_ctx.esr_el1.fetch_or(static_cast(HaltReason::BreakLoop)); + constexpr u64 break_loop = static_cast(HaltReason::BreakLoop); + if ((m_guest_ctx.esr_el1.fetch_or(break_loop) & break_loop) != 0) return; auto* params = &thread->GetNativeExecutionParameters(); LockThreadParameters(params); From a3debcf731143aabd6eefee406d511551d3c9a73 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Mon, 26 Oct 2026 17:25:24 +0100 Subject: [PATCH 194/198] [buffer_cashe] use old logic when Optimized Vertex Buffers is disabled (#4528) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Fixes vertex explosions on Turnip. Fixes Celeste on QCOM. Fixes new issues discovered after #3579 Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4528 Reviewed-by: CamilleLaVey Reviewed-by: Shinmegumi --- src/video_core/buffer_cache/buffer_cache.h | 82 +++++++++++++++------- 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 53addb5dec..f30c85911f 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1738,36 +1738,64 @@ void BufferCache

::TouchBuffer(Buffer& buffer, BufferId buffer_id) noexcept { template bool BufferCache

::SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 size) { - upload_copies.clear(); - u64 total_size_bytes = 0; - u64 largest_copy = 0; - const DAddr buffer_start = buffer.cpu_addr_cached; - const auto add_upload = [&](DAddr start, DAddr end) { - if (start == end) return; - const u64 range_size = end - start; - upload_copies.push_back(BufferCopy{ - .src_offset = total_size_bytes, - .dst_offset = start - buffer_start, - .size = range_size, +#ifdef __ANDROID__ + const bool use_optimized_vertex_buffers = Settings::values.use_optimized_vertex_buffers.GetValue(); +#else + constexpr bool use_optimized_vertex_buffers = true; +#endif + + if (use_optimized_vertex_buffers) { + upload_copies.clear(); + u64 total_size_bytes = 0; + u64 largest_copy = 0; + const DAddr buffer_start = buffer.cpu_addr_cached; + const auto add_upload = [&](DAddr start, DAddr end) { + if (start == end) return; + const u64 range_size = end - start; + upload_copies.push_back(BufferCopy{ + .src_offset = total_size_bytes, + .dst_offset = start - buffer_start, + .size = range_size, + }); + total_size_bytes += range_size; + largest_copy = (std::max)(largest_copy, range_size); + }; + memory_tracker.ForEachUploadRange(device_addr, size, [&](u64 device_addr_out, u64 range_size) { + DAddr upload_start = device_addr_out; + gpu_modified_ranges.ForEachInRange(device_addr_out, range_size, [&](DAddr gpu_start, DAddr gpu_end) { + add_upload(upload_start, gpu_start); + upload_start = gpu_end; + }); + add_upload(upload_start, device_addr_out + range_size); }); - total_size_bytes += range_size; - largest_copy = (std::max)(largest_copy, range_size); - }; - memory_tracker.ForEachUploadRange(device_addr, size, [&](u64 device_addr_out, u64 range_size) { - DAddr upload_start = device_addr_out; - gpu_modified_ranges.ForEachInRange(device_addr_out, range_size, [&](DAddr gpu_start, DAddr gpu_end) { - add_upload(upload_start, gpu_start); - upload_start = gpu_end; + if (total_size_bytes == 0) { + return true; + } + const std::span copies_span(upload_copies.data(), upload_copies.size()); + UploadMemory(buffer, total_size_bytes, largest_copy, copies_span); + any_buffer_uploaded = true; + return false; + } else { + boost::container::small_vector copies; + u64 total_size_bytes = 0; + u64 largest_copy = 0; + DAddr buffer_start = buffer.CpuAddr(); + memory_tracker.ForEachUploadRange(device_addr, size, [&](u64 device_addr_out, u64 range_size) { + copies.push_back(BufferCopy{ + .src_offset = total_size_bytes, + .dst_offset = device_addr_out - buffer_start, + .size = range_size, + }); + total_size_bytes += range_size; + largest_copy = (std::max)(largest_copy, range_size); }); - add_upload(upload_start, device_addr_out + range_size); - }); - if (total_size_bytes == 0) { - return true; + if (total_size_bytes == 0) { + return true; + } + const std::span copies_span(copies.data(), copies.size()); + UploadMemory(buffer, total_size_bytes, largest_copy, copies_span); + return false; } - const std::span copies_span(upload_copies.data(), upload_copies.size()); - UploadMemory(buffer, total_size_bytes, largest_copy, copies_span); - any_buffer_uploaded = true; - return false; } template From cbd4cf2d8ce9b66936bff8a19be4715e770e0c71 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 26 Oct 2026 17:25:47 +0100 Subject: [PATCH 195/198] [hle][core] Hang Freeze Fix - Video Fixes - Revert Microsleep (#4316) (#4525) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Credit: amicuchu Co-Authored-By: Claude Opus 5.5 - Fixes Mario Strikers Intro Freezing from legacy. - Microsleep no longer needed for Absolum Video freezing and other videos freezing. - Revert `[service, nvhost] added machinery to allow microsleep between nvdec read requests to avoid guest panic in some games #4316` - Tested with CPU/GPU decoding on Linux/Windows. Special thanks to xbzk Co-authored-by: Your Name Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4525 Reviewed-by: Maufeat Reviewed-by: Shinmegumi --- src/core/core.cpp | 40 +++---------------- src/core/core.h | 4 +- .../service/filesystem/fsp/fs_i_storage.cpp | 12 ++++++ .../hle/service/filesystem/fsp/fs_i_storage.h | 6 +++ .../service/nvdrv/devices/nvhost_nvdec.cpp | 11 +---- src/core/hle/service/service.cpp | 16 +------- src/core/hle/service/service.h | 2 - 7 files changed, 28 insertions(+), 63 deletions(-) diff --git a/src/core/core.cpp b/src/core/core.cpp index 046ee53346..06543b0833 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include "game_settings.h" @@ -249,30 +248,12 @@ struct System::Impl { } } - void NotifyNVDECChannelOpen(u64 process_id) { - std::scoped_lock lock{nvdec_active_mutex}; - ++nvdec_active_channels[process_id]; - } - - void NotifyNVDECChannelClose(u64 process_id) { - std::scoped_lock lock{nvdec_active_mutex}; - const auto it = nvdec_active_channels.find(process_id); - if (it == nvdec_active_channels.end()) { - return; - } - if (--it->second == 0) { - nvdec_active_channels.erase(it); - } + void SetNVDECActive(bool is_nvdec_active) { + nvdec_active = is_nvdec_active; } bool GetNVDECActive() { - std::scoped_lock lock{nvdec_active_mutex}; - return !nvdec_active_channels.empty(); - } - - bool IsNVDECActiveForProcess(u64 process_id) { - std::scoped_lock lock{nvdec_active_mutex}; - return nvdec_active_channels.contains(process_id); + return nvdec_active; } void InitializeDebugger(System& system, u16 port) { @@ -528,8 +509,6 @@ struct System::Impl { mutable std::mutex suspend_guard; std::mutex general_channel_mutex; - std::mutex nvdec_active_mutex; - std::unordered_map nvdec_active_channels; std::atomic_bool is_paused{}; std::atomic_bool is_shutting_down{}; std::atomic_bool is_powered_on{}; @@ -537,6 +516,7 @@ struct System::Impl { bool extended_memory_layout : 1 = false; bool exit_locked : 1 = false; bool exit_requested : 1 = false; + bool nvdec_active : 1 = false; void EnsureGeneralChannelInitialized(System& system) { if (!general_channel_event) { @@ -600,22 +580,14 @@ void System::UnstallApplication() { impl->UnstallApplication(); } -void System::NotifyNVDECChannelOpen(u64 process_id) { - impl->NotifyNVDECChannelOpen(process_id); -} - -void System::NotifyNVDECChannelClose(u64 process_id) { - impl->NotifyNVDECChannelClose(process_id); +void System::SetNVDECActive(bool is_nvdec_active) { + impl->SetNVDECActive(is_nvdec_active); } bool System::GetNVDECActive() { return impl->GetNVDECActive(); } -bool System::IsNVDECActiveForProcess(u64 process_id) { - return impl->IsNVDECActiveForProcess(process_id); -} - void System::InitializeDebugger() { impl->InitializeDebugger(*this, Settings::values.gdbstub_port.GetValue()); } diff --git a/src/core/core.h b/src/core/core.h index e26093f260..d88ed64151 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -191,10 +191,8 @@ public: std::unique_lock StallApplication(); void UnstallApplication(); - void NotifyNVDECChannelOpen(u64 process_id); - void NotifyNVDECChannelClose(u64 process_id); + void SetNVDECActive(bool is_nvdec_active); [[nodiscard]] bool GetNVDECActive(); - [[nodiscard]] bool IsNVDECActiveForProcess(u64 process_id); /** * Initialize the debugger. diff --git a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp index 50b7d1e765..8541c17817 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp @@ -4,6 +4,10 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include +#include +#include + #include "core/file_sys/errors.h" #include "core/hle/service/cmif_serialization.h" #include "core/hle/service/filesystem/fsp/fs_i_storage.h" @@ -31,6 +35,14 @@ Result IStorage::Read( R_UNLESS(length >= 0, FileSys::ResultInvalidSize); R_UNLESS(offset >= 0, FileSys::ResultInvalidOffset); + const auto now = std::chrono::steady_clock::now(); + if (now < next_read_tick) { + std::this_thread::sleep_for(next_read_tick - now); + } + next_read_tick = std::chrono::steady_clock::now() + + std::chrono::nanoseconds{std::min(length, MaxChargedReadSize) * + 1'000'000'000 / ReadBytesPerSecond}; + // Read the data from the Storage backend backend->Read(out_bytes.data(), length, offset); diff --git a/src/core/hle/service/filesystem/fsp/fs_i_storage.h b/src/core/hle/service/filesystem/fsp/fs_i_storage.h index e676c52220..bac72d73c7 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_storage.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_storage.h @@ -6,6 +6,8 @@ #pragma once +#include + #include "core/file_sys/vfs/vfs.h" #include "core/hle/service/cmif_types.h" #include "core/hle/service/filesystem/filesystem.h" @@ -20,6 +22,10 @@ public: private: FileSys::VirtualFile backend; + static constexpr s64 ReadBytesPerSecond = 40'000'000; + static constexpr s64 MaxChargedReadSize = 64 * 1024; + std::chrono::steady_clock::time_point next_read_tick{}; + Result Read( OutBuffer out_bytes, s64 offset, s64 length); diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp index f47369adb8..7ac3dfaa46 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp @@ -8,7 +8,6 @@ #include "common/assert.h" #include "common/logging.h" #include "core/core.h" -#include "core/hle/kernel/k_process.h" #include "core/hle/service/nvdrv/core/container.h" #include "core/hle/service/nvdrv/devices/ioctl_serialization.h" #include "core/hle/service/nvdrv/devices/nvhost_nvdec.h" @@ -72,23 +71,17 @@ NvResult nvhost_nvdec::Ioctl3(DeviceFD fd, Ioctl command, std::span in void nvhost_nvdec::OnOpen(NvCore::SessionId session_id, DeviceFD fd) { LOG_INFO(Service_NVDRV, "NVDEC video stream started"); + system.SetNVDECActive(true); sessions[fd] = session_id; - if (const auto* session = core.GetSession(session_id); - session != nullptr && session->process != nullptr) { - system.NotifyNVDECChannelOpen(session->process->GetId()); - } host1x.StartDevice(fd, Tegra::Host1x::ChannelType::NvDec, channel_syncpoint); } void nvhost_nvdec::OnClose(DeviceFD fd) { LOG_INFO(Service_NVDRV, "NVDEC video stream ended"); host1x.StopDevice(fd, Tegra::Host1x::ChannelType::NvDec); + system.SetNVDECActive(false); auto it = sessions.find(fd); if (it != sessions.end()) { - if (const auto* session = core.GetSession(it->second); - session != nullptr && session->process != nullptr) { - system.NotifyNVDECChannelClose(session->process->GetId()); - } sessions.erase(it); } } diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 225b92a783..b4fe2b3ed5 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -4,16 +4,12 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include #include -#include -#include #include "common/assert.h" #include "common/logging.h" #include "common/settings.h" #include "core/core.h" #include "core/hle/ipc.h" -#include "core/hle/kernel/k_process.h" #include "core/hle/kernel/kernel.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/service.h" @@ -37,7 +33,6 @@ ServiceFrameworkBase::ServiceFrameworkBase(Core::System& system_, const char* se : SessionRequestHandler(system_.Kernel(), service_name_) , system{system_} , service_name{service_name_} - , is_i_storage{std::string_view{service_name_} == "IStorage"} , handler_invoker{handler_invoker_} , max_sessions{max_sessions_} {} @@ -82,22 +77,13 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, } void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) { - const auto command = ctx.GetCommand(); - auto it = handlers.find(command); - const bool is_cmd_read = command == 0; + auto it = handlers.find(ctx.GetCommand()); FunctionInfoBase const* info = it == handlers.end() ? nullptr : &it->second; if (info == nullptr || info->handler_callback == nullptr) return ReportUnimplementedFunction(ctx, info); LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer())); handler_invoker(this, info->handler_callback, ctx); - - if (is_i_storage && is_cmd_read) { - const auto* const process = ctx.GetThread().GetOwnerProcess(); - if (process != nullptr && system.IsNVDECActiveForProcess(process->GetId())) { - std::this_thread::sleep_for(std::chrono::microseconds{600}); - } - } } void ServiceFrameworkBase::InvokeRequestTipc(HLERequestContext& ctx) { diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index ea98897e79..68b0d636d8 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -107,8 +107,6 @@ protected: Core::System& system; /// Identifier string used to connect to the service. const char* service_name; - /// Whether this is the IStorage service. - const bool is_i_storage; /// Function used to safely up-cast pointers to the derived class before invoking a handler. InvokerFn* handler_invoker; /// Maximum number of concurrent sessions that this service can handle. From b7c1ded1593c3c2dc58625824a04e30a63fe80c7 Mon Sep 17 00:00:00 2001 From: xbzk Date: Mon, 26 Oct 2026 17:26:07 +0100 Subject: [PATCH 196/198] [file_sys] added log for newer keys needed error (#4519) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- One log line which could have spared me from a lot of trouble. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4519 Reviewed-by: CamilleLaVey Reviewed-by: Shinmegumi --- src/core/file_sys/content_archive.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index b47b9437d0..1ba7bd3de3 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp @@ -45,6 +45,7 @@ NCA::NCA(VirtualFile file_, const NCA* base_nca, bool allow_missing_base) // Ensure we have the proper key area keys to continue. const u8 master_key_id = MasterKeyIdForKeyGeneration(reader->GetKeyGeneration()); if (!keys.HasKey(Core::Crypto::S128KeyType::KeyArea, master_key_id, reader->GetKeyIndex())) { + LOG_ERROR(Loader, "Cannot decrypt {}: keys for gen 0x{:02X}+ required.", file->GetName(), reader->GetKeyGeneration()); status = Loader::ResultStatus::ErrorMissingKeyAreaKey; return; } From 26a03d2473787abf3223b2d0e65b291eee00c1e1 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 26 Oct 2026 17:26:32 +0100 Subject: [PATCH 197/198] Revert "[video_core] Improve asynchronous shader building (#2560)" (#4512) Restores performance but need to check TOTK item icons and Jamboree graphic issues. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4512 Reviewed-by: CamilleLaVey Reviewed-by: Shinmegumi --- src/video_core/renderer_opengl/gl_shader_cache.cpp | 5 +++++ src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index df69eb97f5..277cf222fa 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp @@ -414,6 +414,11 @@ GraphicsPipeline* ShaderCache::BuiltPipeline(GraphicsPipeline* pipeline) const n if (!use_asynchronous_shaders) { return pipeline; } + // If something is using depth, we can assume that games are not rendering anything which + // will be used one time. + if (maxwell3d->regs.zeta_enable) { + return nullptr; + } // If games are using a small index count, we can assume these are full screen quads. // Usually these shaders are only used once for building textures so we can assume they // can't be built async diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index e9403580d5..d4ffcd8317 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -789,6 +789,11 @@ GraphicsPipeline* PipelineCache::BuiltPipeline(GraphicsPipeline* pipeline) const if (!use_asynchronous_shaders) { return pipeline; } + // If something is using depth, we can assume that games are not rendering anything which + // will be used one time. + if (maxwell3d->regs.zeta_enable) { + return nullptr; + } // If games are using a small index count, we can assume these are full screen quads. // Usually these shaders are only used once for building textures so we can assume they // can't be built async From a2aa4d97e10a8345babfe647e1abd5ed5909c623 Mon Sep 17 00:00:00 2001 From: crueter Date: Thu, 29 Oct 2026 17:10:37 +0100 Subject: [PATCH 198/198] [docs] Remove AI restrictions, and adapt to new open registration (#4585) Registration is now open. Enjoy Signed-off-by: crueter - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4585 Reviewed-by: lizzie --- .github/PULL_REQUEST_TEMPLATE.md | 1 - CONTRIBUTING.md | 39 ++---- docs/policies/AI.md | 203 ------------------------------- 3 files changed, 8 insertions(+), 235 deletions(-) delete mode 100644 docs/policies/AI.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 422efb5fdc..bdf9d048e8 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ - [ ] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). -- [ ] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [ ] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8c16de9ddb..c87dd11dbe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,15 +16,14 @@ Eden is free, open-source, copyleft software, licensed under the terms of the [G ### Policies -- We are trialing a slightly relaxed AI policy to allow high-quality contributors to use AI *responsibly*. Please read our [detailed AI policy](docs/policies/AI.md) for more info. -- Usage of any form of profanity or otherwise unsavory language is generally discouraged. - - This is primarily because it rarely helps to actually understand what's going on. - - Remember that your comments should be focused and actually address what's happening. With very few exceptions, expletives are actively detrimental at best. -- New code must follow the same general style as the surrounding codebase. Exceptions may be granted in certain cases. +- AI usage is allowed, but we reserve the right to close and rework your PR if you don't fully understand the changes you're making. + - As a common courtesy, please disclose your AI usage under the PR description, as `Assisted-by: ()`. +- Usage of any form of profanity or otherwise unsavory language is discouraged but not strictly disallowed. +- New code must follow the same style as the surrounding codebase. Exceptions may be granted in certain cases. - Maintainers reserve the right to change your patches and pull requests at will. We will try to avoid this. - You should generally respect all decisions made by the [code owners](docs/CODEOWNERS) in your particular subsystem. - However, if you feel they are overstepping or are incorrect, don't be afraid to stand your ground! Maintainers are not always correct. -- While we do *not* adhere to the terms of a formal code of conduct, you will generally be expected to respect other developers, contributors, and community members. +- While we do *not* adhere to the terms of a formal code of conduct, you are expected to treat other developers, contributors, and community members respectfully. - You **must** have basic knowledge of [Git](https://git-scm.com/learn). Knowing how to manage your branches and follow proper fork policies is a necessity. ### Where do I start? @@ -38,7 +37,8 @@ You may also search for open issues on [GitHub](https://github.com/eden-emulator There are five primary ways to contribute. - Submit pull requests directly to our source tree - - You must first request an account on our Forgejo. See [Signup](#how-do-i-sign-up) + - You must first [create an account](https://git.eden-emu.dev/user/sign_up). + - You may use an internal account, or you may use a GitHub/Codeberg account linked to our instance. - Submit pull requests to our [GitHub mirror](https://github.com/eden-emulator/Issue-Reports) - Note that this is subject to being removed by DMCA, so don't rely on this. - Submit pull requests to our [Codeberg mirror](https://codeberg.org/eden-emu/eden) @@ -50,31 +50,8 @@ There are five primary ways to contribute. To test your changes, ensure to read the [build documentation](./docs/Build.md) for your specific platform(s) to ensure everything compiles and works properly. You should also make sure that your branch is up-to-date with the upstream `master` branch before opening a pull request. -### How do I sign up? - -

-To sign up and begin contributing... (click to open) - -Email [crueter@crueter.xyz](mailto:crueter@crueter.xyz) with the following format: - -```txt -Subject: [Eden Git] Registration Request -Username: -Email: -I wish to sign up because... -``` - -Received mail that does not follow this format will be ignored. - -Once your request is processed, you will receive a confirmation email with your temporary password and some information on Git access and policies. If you do not receive a response within 48 hours, feel free to send another email. - -> [!WARNING] -> Some email providers may place the response email in your spam/junk folder; notable offenders include Gmail and Outlook. *Always* ensure to check your Spam or Junk folder. - -
- ## Non-code Contributions Alongside the other contribution methods listed up top, you can also choose to contribute through documentation, organization, or community guides. These can be done either through the code contribution methods described above, or created externally and shared via our Discord community. -If you have an external tool/page that you believe would be handy to integrate/link into Eden, please additionally email our developers at [`developers@eden-emu.dev`](mailto:developers@eden-emu.dev). **Do not submit vibe-coded or AI generated tools or applications**. +If you have an external tool/page that you believe would be handy to integrate/link into Eden, please additionally email our developers at [`developers@eden-emu.dev`](mailto:developers@eden-emu.dev). diff --git a/docs/policies/AI.md b/docs/policies/AI.md deleted file mode 100644 index dd4b4a7fb2..0000000000 --- a/docs/policies/AI.md +++ /dev/null @@ -1,203 +0,0 @@ -# AI Policy - -> [!WARNING] -> We are trialing a slightly relaxed AI policy to allow high-quality contributors to use AI *responsibly*. -> This policy is subject to change at any point in time, so check back frequently. -> -> This banner will be removed once we have finalized our revised policy. - -- [AI Policy](#ai-policy) - - [TL;DR](#tldr) - - [Definitions](#definitions) - - [Scope](#scope) - - [Introduction](#introduction) - - [Requirements](#requirements) - - [Sign-off, Authorship, and Copyright](#sign-off-authorship-and-copyright) - - [Permitted Usage](#permitted-usage) - - [Recommended Prior Discussion](#recommended-prior-discussion) - - [Forbidden Usage](#forbidden-usage) - - [Human Effort Denial of Service](#human-effort-denial-of-service) - - [Disclosure](#disclosure) - - [Codebase Ingestion](#codebase-ingestion) - - [Enforcement](#enforcement) - - [Addendum: AI Commit Messages](#addendum-ai-commit-messages) - - [References](#references) - -## TL;DR - -AI-assisted contributions are welcome, provided you take responsibility for them. - -- You **must** disclose any AI or LLM usage in your pull request description *and* commit message. -- You **must** be able to explain, defend, and revise every line of code you submit. -- Commit messages, PR descriptions, issues, and comments **must** be written by you. Verbatim AI output is not acceptable. -- Undisclosed AI usage will result in your contribution being rejected. -- Low-quality contributions, disclosed or not, will be reworked or rejected. -- Spamming automated PRs, comments, or issues is treated as a Denial of Service (DoS) attack on our reviewers; see [Human Effort Denial of Service](#human-effort-denial-of-service). - -## Definitions - -An *AI or LLM-based tool* is any piece of software that generates code, text, or other content through machine learning models. This includes, but is not limited to: chat assistants, agentic coding tools/harnesses, inline code completion suggestions you have accepted into the code, and AI-driven explanation/refactoring features. - -For the purposes of this policy, basic deterministic/static development tools (such as clang-tidy, git, compilers, etc.) are not considered AI tools. - -Terms such as "substantially", "large-scale", "majority", and "low-quality" are intentionally left vague, and will be interpreted at the maintainers' discretion. When in doubt, ask first. - -## Scope - -This policy applies to all code contributions, alongside issues and pull requests surrounding this codebase. This includes: - -- Commit messages -- PR descriptions -- Code review comments -- Issue/PR comments -- Patches submitted via e-mail - -Areas that are not directly related to code--such as our surrounding communities--are not covered by the terms of this policy. Additionally, spelling/grammar checking via AI or LLM-based tools is not covered under this document. - -## Introduction - -In the right hands, AI and LLM-based tools are incredibly useful for getting features and bugfixes out the door as fast as possible. At the same time, reviewer bandwidth is a scarce resource. We are therefore open to AI-assisted contributions, provided they are produced and disclosed properly. - -The goal of this document is *not* to set arbitrary restrictions, but rather to keep our development healthy and stable, while still allowing contributors to use the tools they find helpful. A contribution must be worth more to the project than the time it takes to review it. - -Throughout this document, **must** and **must not** are inflexible, binding requirements. Refusal to follow these is treated as a violation of the terms outlined in this document. - -## Requirements - -These apply to all contributions, whether AI-assisted or not. AI-assisted contributions also carry additional disclosure requirements as outlined in [Disclosure](#disclosure). - -1. *Disclosure*. Any and all usage of AI or LLM-based tools within any contribution **must** be explicitly marked and disclosed as appropriate. -2. *Responsibility*. The human submitter of any contribution is held wholly responsible for the accuracy, completeness, and intent of what is submitted. You **must** be able to explain, defend, and revise your code during review. -3. *Review*. All code **must** be thoroughly reviewed by the author before opening a PR or marking it ready for review. -4. *Testing*. All code changes **must** be tested directly by the human author. -5. *Quality*. All submitted code is held to a strict standard of excellence. Low-quality AI-generated content does not uphold this standard. -6. *Licensing*. All code **must** be compatible with the GPLv3 or later. You **must** warrant that you have the right to submit it under those terms, and that it was not copied from work published under an incompatible license. - -## Sign-off, Authorship, and Copyright - -AI agents **must not** add `Signed-off-by:` tags. The human submitter **must** sign off on all changes. - -Similarly, AI agents cannot hold authorship or copyright over code, and **must not** add `Co-authored-by:` or `Co-developed-by:` tags. The human submitter **must** author all changes. - -## Permitted Usage - -This is a non-exhaustive list of permitted uses of AI and LLM-based tools, provided they are disclosed properly. - -- Drafting issues and pull requests, provided the final text and submitted code are substantially your own. -- Debugging issues, bugs, glitches, and crashes, whether pre-existing or introduced by your own changes. -- Reviewing your own changes before submitting a PR. -- Research, brainstorming, and codebase searching/understanding. -- Applying tedious but not particularly large changes, such as mass-migrating specific classes to polyfills or abstractions. - -## Recommended Prior Discussion - -Some usage cases are not necessarily forbidden nor permitted. These should be discussed with maintainers in an issue or e-mail *before* submission. Maintainers and reviewers may also comment on this during the review/submission phase. - -- Generating boilerplate/scaffolding for new code. -- Writing unit tests. -- Large-scale refactors primarily driven by an AI agent. -- Any contribution where an AI agent or model was responsible for the majority of the implementation. - -## Forbidden Usage - -This is a non-exhaustive list of strictly forbidden uses of AI and LLM-based tools. - -- Vibecoding, or changes entirely authored by AI agents without human intervention or understanding. - - If you don't choose to put in the necessary effort to understand every line of code you submitted, neither will we. -- Fully AI-generated commit messages, PR descriptions, issues, or comments. See [Addendum: AI Commit Messages](#addendum-ai-commit-messages). -- Submission of AI-assisted work that is not disclosed per the [Disclosure](#disclosure) requirements. -- Low-quality submissions that fail to satisfy our standard of code excellence. -- Submitting secrets, credentials, private user data, or unpublished security reports to third-party AI services. - - This includes console keys, encryption material, and private vulnerability disclosures. -- Verbatim AI code reviews (e.g. Codex/Copilot reviews). - -## Human Effort Denial of Service - -Using automated tools and AI to submit PRs, issues, and comments that we have to carefully review and handle is considered a [Denial-of-service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) on our human effort. - -It takes very little effort on your side (an LLM prompt) to generate a large amount of effort on ours (careful and thorough code review). Please respect our time and don't do that. - -## Disclosure - -How you disclose AI usage is up to you. However, it **must** be explicit, easy to identify, and placed both within the commit message *and* the surrounding PR description. For patches submitted by e-mail, the cover letter counts as the PR description. We recommend an `Assisted-by:` footer: - -```txt -Assisted-by: () -``` - -For instance: - -```txt -Assisted-by: Claude Opus 5.5 (initial draft and code review) -``` - -Contributions without a commit message (e.g. issues/comments) should instead use a plain sentence in the text body such as `I used to help with `. PRs and commit messages may opt to use this format as well. - -Multi-commit series/squashes **must** maintain the trailer. Maintainers will handle this for merges to master, but you are responsible for ensuring the disclosure survives into the final commit/PR body of squashes within your branches. - -Regardless, what matters is that reviewers can tell *at a glance* where and how AI was involved in your contribution. - -## Codebase Ingestion - -Ingestion of this codebase by LLMs for any purpose--such as training or prompt context--is permitted *for now*. This may change at any point as litigation and court rulings around AI and code copyright proceed. - -AI models may have ingested AGPLv3 or otherwise copyleft-incompatible code and may regurgitate it. You remain responsible for ensuring that all code you submit is compatible with the GPLv3 or later. - -## Enforcement - -- If we suspect undisclosed AI usage in a contribution, we will ask for disclosure. -- Refusal to provide disclosure will result in rejection of the contribution, and your PR or issue will be closed. Maintainers may choose to rework it themselves if the change is worth having. -- Accounts that spam us with repeated automated PRs or comments will be blocked or permanently suspended from our Git instance. -- Maintainers reserve the right to close your issues and pull requests if you don't follow the guidelines and procedures outlined in this document, and refuse or fail to make changes as necessary to comply. -- Repeated failures to comply may result in loss of contribution privileges. - -## Addendum: AI Commit Messages - -The patchset for pull request [#3422](https://git.eden-emu.dev/eden-emu/eden/pulls/3422) was fed into a dedicated code AI model, and it produced the following: - -```txt -profile_manager: Refactor user deletion to use index instead of UUID - -This commit improves the user profile deletion flow in the following ways: - -1. **UI layer (ConfigureProfileManager)**: - - Replaces UUID-based deletion with index-based deletion - - Passes the selected row index from the tree view to the confirmation dialog - - Emits deleteUser(int index) signal from ConfigureProfileManagerDeleteDialog - - Removes lambda capture and std::function callback in favor of direct signal/slot connection - -2. **Delete dialog**: - - Changes SetInfo() signature to accept index instead of accept callback - - Stores index internally and emits it via deleteUser signal on acceptance - -3. **Core ProfileManager**: - - Refactors RemoveUser(UUID) → RemoveProfileAtIndex(index) - - Removes duplicated stable_partition + save logic from RemoveUser() - - Centralizes profile removal and save-file writing in RemoveProfileAtIndex() - -4. **Minor follow-up**: - - Adds profile_manager.ResetUserSaveFile() call in PopulateUserList() to ensure consistent state when refreshing the user list - -These changes eliminate redundant code, reduce the risk of UUID → index mismatch bugs, and make the deletion path more straightforward and maintainable. - -Fixes: potential inconsistency when user order changes between UI and backend -``` - -This: - -- Is needlessly verbose (nobody cares about most of these details) -- Doesn't address the actual purpose of the PR (fixing a double-deletion bug in the profile manager) -- Has unicode arrows (this is bad for command-line editors) -- Uses corporate and word-salad language that pads out the message to make it look like a lot changed - -A good commit message should be concise, descriptive, and convey the *intent* behind the change, such as the bug being fixed or the feature being added. It should *not* be a detailed changelog of every individual byte that's changed. - -## References - -This policy document has been adapted from the AI policies of numerous other free and open-source projects, whether restrictive or permissive. - -- [Gitea](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#ai-contribution-policy) -- The [Linux kernel](https://kernel.org/doc/html/next/process/coding-assistants.html) -- [Gentoo Linux](https://wiki.gentoo.org/wiki/Project:Council/AI_policy) -- [cURL](https://curl.se/dev/contribute.html#on-ai-use-in-curl) -- [FastAPI](https://tiangolo.com/open-source/contributing/#automated-code-and-ai)